Package com.qfs.messenger
Interface IDistributedHierarchyManager
-
- All Superinterfaces:
IAgent,IDistributedAgent,IExtendedPluginValue,IMonitoredComponent
- All Known Implementing Classes:
DistributedHierarchyManager
public interface IDistributedHierarchyManager extends IMonitoredComponent, IDistributedAgent
Component of cube of query that can handleIInitialDiscoveryMessage,ITransactionCommittedMessageor members (cube of data) leaving the cluster and apply associated changes into the cube.- Author:
- ActiveViam
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIDistributedHierarchyManager.IDistributedExceptionHandlerInterface for exception handlers to process an exception raised when consuming a message.-
Nested classes/interfaces inherited from interface com.quartetfs.fwk.IAgent
IAgent.ITransition, IAgent.State
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_PLUGIN_KEYThe plugin key of the default implementation.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidapplyGoodbyeMessageRemovalAsync(GoodbyeMessage message)Immediately triggers the removal task for the member broadcasting the receivedmessage.voidapplyInitialDiscoveryMessageAsync(IInitialDiscoveryMessage discoveryMessage)Applies the response to an initial discovery message and updates the current view ID to the given one (IInitialDiscoveryMessage.getViewId()).voidapplyInitialDiscoveryMessageAsync(CompositeDiscoveryMessage compositeDiscoveryMessage)Applies the response to an initial discovery message and updates the current view ID to the given one (IInitialDiscoveryMessage.getViewId()).voidapplyRemoteTransactionAsync(ITransactionCommittedMessage message)Applies asynchronously, but in the required order, the data associated with the given remote transaction.booleancanReceiveDiscoveryMessage(String remoteAddress)Returns whether this manager can receive an additional initial discovery message from the given data cube.IEpochgetMostRecentAcknowledgedEpoch(String remoteAddress, long viewId)Returns the last known epoch of the remote cube or null if no message between the two instances has been sent & applied.IMultiVersionDistributedActivePivotgetPivot()Returns the QUERY cube the manager belongs to.booleanisDiscoveryApplied(String applicationId)Returns true if the schema of this application has already been received and applied.voidwaitForAllMessages(long timeoutMillis)Waits for all the query node messages to be processed.-
Methods inherited from interface com.quartetfs.fwk.IAgent
getProperties, getStatus, init, pause, resume, start, stop
-
Methods inherited from interface com.qfs.messenger.IDistributedAgent
onMembersChanged
-
Methods inherited from interface com.quartetfs.fwk.types.IExtendedPluginValue
getType
-
Methods inherited from interface com.quartetfs.fwk.monitoring.IMonitoredComponent
getAvailableAttributes, getAvailableOperations, getMonitoredChildren, getStatistics
-
-
-
-
Field Detail
-
DEFAULT_PLUGIN_KEY
static final String DEFAULT_PLUGIN_KEY
The plugin key of the default implementation.- See Also:
- Constant Field Values
-
-
Method Detail
-
getPivot
IMultiVersionDistributedActivePivot getPivot()
Returns the QUERY cube the manager belongs to.
-
applyInitialDiscoveryMessageAsync
void applyInitialDiscoveryMessageAsync(CompositeDiscoveryMessage compositeDiscoveryMessage)
Applies the response to an initial discovery message and updates the current view ID to the given one (IInitialDiscoveryMessage.getViewId()). This is done asynchronously.- Parameters:
compositeDiscoveryMessage- the message to apply that contains informations about aremote data cube
-
applyInitialDiscoveryMessageAsync
void applyInitialDiscoveryMessageAsync(IInitialDiscoveryMessage discoveryMessage)
Applies the response to an initial discovery message and updates the current view ID to the given one (IInitialDiscoveryMessage.getViewId()). This is done asynchronously.- Parameters:
discoveryMessage- the message to apply that contains informations about aremote data cube
-
applyRemoteTransactionAsync
void applyRemoteTransactionAsync(ITransactionCommittedMessage message)
Applies asynchronously, but in the required order, the data associated with the given remote transaction.- Parameters:
message- TheITransactionCommittedMessagethat represents the remote commit
-
applyGoodbyeMessageRemovalAsync
void applyGoodbyeMessageRemovalAsync(GoodbyeMessage message)
Immediately triggers the removal task for the member broadcasting the receivedmessage.- Parameters:
message- TheGoodbyeMessagenotifying that a remote instance is leaving the cluster
-
getMostRecentAcknowledgedEpoch
IEpoch getMostRecentAcknowledgedEpoch(String remoteAddress, long viewId)
Returns the last known epoch of the remote cube or null if no message between the two instances has been sent & applied.- Parameters:
remoteAddress- the address of the remote instance (cube of data)viewId- the view id of theHelloMessage
-
isDiscoveryApplied
boolean isDiscoveryApplied(String applicationId)
Returns true if the schema of this application has already been received and applied.- Parameters:
applicationId- the id of an application
-
canReceiveDiscoveryMessage
boolean canReceiveDiscoveryMessage(String remoteAddress)
Returns whether this manager can receive an additional initial discovery message from the given data cube.If there are too many pending initial discoveries, this method will return
falseand the data cube should retry later.- Parameters:
remoteAddress- The address of the data cube- Returns:
trueif we can accept an initial discovery from this data cube,falseotherwise
-
waitForAllMessages
void waitForAllMessages(long timeoutMillis) throws TimeoutException, InterruptedExceptionWaits for all the query node messages to be processed.- Parameters:
timeoutMillis- Maximum time to wait in Milliseconds- Throws:
InterruptedException- If issue with Thread.sleep()TimeoutException- If waited longer than maximum providedtimeoutMillis.
-
-