All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.quorum.QuorumWatcher Maven / Gradle / Ivy

/**

Copyright (C) SYSTAP, LLC DBA Blazegraph 2006-2016.  All rights reserved.

Contact:
     SYSTAP, LLC DBA Blazegraph
     2501 Calvert ST NW #106
     Washington, DC 20008
     [email protected]

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
/*
 * Created on Jun 6, 2010
 */
package com.bigdata.quorum;

import java.rmi.Remote;

/**
 * An interface that watches for changes in the distributed quorum state. An
 * implementation of this interface is generally an inner class of the concrete
 * {@link AbstractQuorum} and is responsible for updating the internal state of
 * the {@link AbstractQuorum} as it the distributed quorum state. The quorum
 * internal state always reflects the distributed quorum state.
 * 

* For example, the zookeeper implementation will watch the zpath whose children * are the member services. If a new child appears, it will invoke * {@link AbstractQuorum#memberAdd(java.util.UUID)} so the * {@link AbstractQuorum} can update its internal state. *

* Since this interface watches the distributed state of the quorum, it * does not have any specific methods which it must declare other than those * which manage its life cycle (start/terminate). All of the interesting methods * are on the {@link AbstractQuorum} class. *

* The {@link QuorumWatcher} is responsible for generating these events during * its discovery phase when it starts running. The {@link QuorumWatcher} MUST * report the discovered state in a manner consistent with the preconditions and * postconditions defined for the {@link QuorumActor} the {@link QuorumWatcher}. *

* The {@link QuorumActor} provides the complementary functionality of * causing changes in the distributed state of the quorum. * * @param * @param * * @see QuorumActor * * @author [email protected] */ public interface QuorumWatcher> { // /** // * Start asynchronous processing. // */ // public void start(); // // /** // * Terminate asynchronous processing. // */ // public void terminate(); }