Class FLUSH
- All Implemented Interfaces:
Lifecycle
Flush is needed for:
(1) State transfer. When a member requests state transfer, the coordinator tells everyone to stop sending messages and waits for everyone's ack. Then it asks the application for its state and ships it back to the requester. After the requester has received and set the state successfully, the coordinator tells everyone to resume sending messages.
(2) View changes (e.g.a join). Before installing a new view V2, flushing would ensure that all messages *sent* in the current view V1 are indeed *delivered* in V1, rather than in V2 (in all non-faulty members). This is essentially Virtual Synchrony.
- Since:
- 2.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated, for removal: This API element is subject to removal in a future version.private static final classDeprecated, for removal: This API element is subject to removal in a future version. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate doubleDeprecated, for removal: This API element is subject to removal in a future version.private final ReentrantLockDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.private ViewDeprecated, for removal: This API element is subject to removal in a future version.protected booleanDeprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.private final Promise<FLUSH.FlushStartResult> Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.private booleanDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.private AddressDeprecated, for removal: This API element is subject to removal in a future version.Group member that requested FLUSH.private final AtomicBooleanDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.private booleanDeprecated, for removal: This API element is subject to removal in a future version.Indicates if FLUSH.down() is currently blocking threads Condition predicate associated with blockMutexprivate final ConditionDeprecated, for removal: This API element is subject to removal in a future version.private intDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.private final AtomicBooleanDeprecated, for removal: This API element is subject to removal in a future version.private final AtomicBooleanDeprecated, for removal: This API element is subject to removal in a future version.private final ObjectDeprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.private longDeprecated, for removal: This API element is subject to removal in a future version.private static final FLUSH.FlushStartResultDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.protected longDeprecated, for removal: This API element is subject to removal in a future version.private longDeprecated, for removal: This API element is subject to removal in a future version.private final AtomicIntegerDeprecated, for removal: This API element is subject to removal in a future version.Fields inherited from class org.jgroups.stack.Protocol
after_creation_hook, down_prot, ergonomics, id, local_addr, log, policies, stack, stats, up_prot -
Constructor Summary
ConstructorsConstructorDescriptionFLUSH()Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidDeprecated, for removal: This API element is subject to removal in a future version.private longDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.An event is to be sent down the stack.Deprecated, for removal: This API element is subject to removal in a future version.A message is sent down the stack.private DigestfindHighestSequences(View view) Deprecated, for removal: This API element is subject to removal in a future version.doubleDeprecated, for removal: This API element is subject to removal in a future version.intDeprecated, for removal: This API element is subject to removal in a future version.longDeprecated, for removal: This API element is subject to removal in a future version.longDeprecated, for removal: This API element is subject to removal in a future version.longDeprecated, for removal: This API element is subject to removal in a future version.private ObjecthandleConnect(Event evt, boolean waitForUnblock) Deprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.private voidhandleStartFlush(Message msg, FLUSH.FlushHeader fh) Deprecated, for removal: This API element is subject to removal in a future version.private booleanDeprecated, for removal: This API element is subject to removal in a future version.private booleanDeprecated, for removal: This API element is subject to removal in a future version.protected static ByteArraymarshal(Collection<? extends Address> participants, Digest digest) Deprecated, for removal: This API element is subject to removal in a future version.protected static DigestDeprecated, for removal: This API element is subject to removal in a future version.Returns a digest which contains, for all members of view, the highest delivered and received seqno of all digestsprivate voidonFlushCompleted(Address address, Message m, FLUSH.FlushHeader header) Deprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.private voidonStartFlush(Address flushStarter, Message msg, FLUSH.FlushHeader fh) Deprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.private voidonSuspect(Collection<Address> addresses) Deprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.Starts the flush protocolprivate booleanonViewChange(View view) Deprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.List of events that are provided to layers below (they will be handled when sent from down below)protected Tuple<Collection<? extends Address>, Digest> readParticipantsAndDigest(byte[] buffer, int offset, int length) Deprecated, for removal: This API element is subject to removal in a future version.private voidrejectFlush(Collection<? extends Address> participants, long viewId) Deprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.protected static booleanDeprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.private voidDeprecated, for removal: This API element is subject to removal in a future version.booleansetBypass(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version.setRetryTimeout(long retry_timeout) Deprecated, for removal: This API element is subject to removal in a future version.setStartFlushTimeout(long start_flush_timeout) Deprecated, for removal: This API element is subject to removal in a future version.voidstart()Deprecated, for removal: This API element is subject to removal in a future version.This method is called on aJChannel.connect(String); starts work.voidDeprecated, for removal: This API element is subject to removal in a future version.private voidstartFlush(List<Address> flushParticipants) Deprecated, for removal: This API element is subject to removal in a future version.private voidstartFlush(Event evt) Deprecated, for removal: This API element is subject to removal in a future version.voidstop()Deprecated, for removal: This API element is subject to removal in a future version.Called on aJChannel.disconnect(); stops work (e.g.voidDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.An event was received from the protocol below.Deprecated, for removal: This API element is subject to removal in a future version.A single message was received.voidup(MessageBatch batch) Deprecated, for removal: This API element is subject to removal in a future version.Sends up a multiple messages in aMessageBatch.private voidDeprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class org.jgroups.stack.Protocol
accept, addPolicy, addr, addr, afterCreationHook, destroy, down, enableStats, getAddress, getComponents, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getPolicies, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, init, isErgonomics, level, parse, policies, providedUpServices, removePolicy, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setAddress, setDownProtocol, setErgonomics, setId, setLevel, setPolicies, setProtocolStack, setSocketFactory, setUpProtocol, setValue, statsEnabled, toString
-
Field Details
-
SUCCESS_START_FLUSH
Deprecated, for removal: This API element is subject to removal in a future version. -
timeout
protected long timeoutDeprecated, for removal: This API element is subject to removal in a future version. -
start_flush_timeout
protected long start_flush_timeoutDeprecated, for removal: This API element is subject to removal in a future version. -
end_flush_timeout
protected long end_flush_timeoutDeprecated, for removal: This API element is subject to removal in a future version. -
retry_timeout
protected long retry_timeoutDeprecated, for removal: This API element is subject to removal in a future version. -
enable_reconciliation
protected boolean enable_reconciliationDeprecated, for removal: This API element is subject to removal in a future version. -
bypass
protected boolean bypassDeprecated, for removal: This API element is subject to removal in a future version. -
startFlushTime
private long startFlushTimeDeprecated, for removal: This API element is subject to removal in a future version. -
totalTimeInFlush
private long totalTimeInFlushDeprecated, for removal: This API element is subject to removal in a future version. -
numberOfFlushes
private int numberOfFlushesDeprecated, for removal: This API element is subject to removal in a future version. -
averageFlushDuration
private double averageFlushDurationDeprecated, for removal: This API element is subject to removal in a future version. -
currentView
Deprecated, for removal: This API element is subject to removal in a future version. -
flushCoordinator
Deprecated, for removal: This API element is subject to removal in a future version.Group member that requested FLUSH. For view installations flush coordinator is the group coordinator For state transfer flush coordinator is the state requesting member -
flushMembers
Deprecated, for removal: This API element is subject to removal in a future version. -
viewCounter
Deprecated, for removal: This API element is subject to removal in a future version. -
flushCompletedMap
Deprecated, for removal: This API element is subject to removal in a future version. -
flushNotCompletedMap
Deprecated, for removal: This API element is subject to removal in a future version. -
suspected
Deprecated, for removal: This API element is subject to removal in a future version. -
reconcileOks
Deprecated, for removal: This API element is subject to removal in a future version. -
blockMutex
Deprecated, for removal: This API element is subject to removal in a future version. -
notBlockedDown
Deprecated, for removal: This API element is subject to removal in a future version. -
isBlockingFlushDown
private volatile boolean isBlockingFlushDownDeprecated, for removal: This API element is subject to removal in a future version.Indicates if FLUSH.down() is currently blocking threads Condition predicate associated with blockMutex -
flushCompleted
private boolean flushCompletedDeprecated, for removal: This API element is subject to removal in a future version. -
flush_promise
Deprecated, for removal: This API element is subject to removal in a future version. -
flush_unblock_promise
Deprecated, for removal: This API element is subject to removal in a future version. -
flushInProgress
Deprecated, for removal: This API element is subject to removal in a future version. -
sentBlock
Deprecated, for removal: This API element is subject to removal in a future version. -
sentUnblock
Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
FLUSH
public FLUSH()Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getStartFlushTimeout
public long getStartFlushTimeout()Deprecated, for removal: This API element is subject to removal in a future version. -
setStartFlushTimeout
Deprecated, for removal: This API element is subject to removal in a future version. -
getRetryTimeout
public long getRetryTimeout()Deprecated, for removal: This API element is subject to removal in a future version. -
setRetryTimeout
Deprecated, for removal: This API element is subject to removal in a future version. -
start
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolThis method is called on aJChannel.connect(String); starts work. Protocols are connected ready to receive events. Will be called from bottom to top. -
stop
public void stop()Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolCalled on aJChannel.disconnect(); stops work (e.g. by closing multicast socket). Will be called from top to bottom. -
getAverageFlushDuration
public double getAverageFlushDuration()Deprecated, for removal: This API element is subject to removal in a future version. -
getTotalTimeInFlush
public long getTotalTimeInFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
getNumberOfFlushes
public int getNumberOfFlushes()Deprecated, for removal: This API element is subject to removal in a future version. -
setBypass
public boolean setBypass(boolean flag) Deprecated, for removal: This API element is subject to removal in a future version. -
startFlush
public void startFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
startFlush
Deprecated, for removal: This API element is subject to removal in a future version. -
startFlush
Deprecated, for removal: This API element is subject to removal in a future version. -
stopFlush
public void stopFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
down
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolAn event is to be sent down the stack. A protocol may want to examine its type and perform some action on it, depending on the event's type. If the event is a message MSG, then the protocol may need to add a header to it (or do nothing at all) before sending it down the stack usingdown_prot.down(). -
down
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolA message is sent down the stack. Protocols may examine the message and do something (e.g. add a header) with it, before passing it down. -
handleConnect
Deprecated, for removal: This API element is subject to removal in a future version. -
blockMessageDuringFlush
private void blockMessageDuringFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
up
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolAn event was received from the protocol below. Usually the current protocol will want to examine the event type and - depending on its type - perform some computation (e.g. removing headers from a MSG event type, or updating the internal membership list when receiving a VIEW_CHANGE event). Finally, the event is either a) discarded, or b) an event is sent down the stack usingdown_prot.down()or c) the event (or another event) is sent up the stack usingup_prot.up(). -
up
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolA single message was received. Protocols may examine the message and do something (e.g. add a header) with it before passing it up. -
up
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolSends up a multiple messages in aMessageBatch. The sender of the batch is always the same, and so is the destination (null == multicast messages). Messages in a batch can be OOB messages, regular messages, or mixed messages, although the transport itself will create initial MessageBatches that contain only either OOB or regular messages.The default processing below sends messages up the stack individually, based on a matching criteria (calling
Protocol.accept(Message)), and - if true - callsProtocol.up(org.jgroups.Event)for that message and removes the message. If the batch is not empty, it is passed up, or else it is dropped.Subclasses should check if there are any messages destined for them (e.g. using
MessageBatch.iterator(Predicate)), then possibly remove and process them and finally pass the batch up to the next protocol. Protocols can also modify messages in place, e.g. ENCRYPT could decrypt all encrypted messages in the batch, not remove them, and pass the batch up when done. -
waitForUnblock
private void waitForUnblock()Deprecated, for removal: This API element is subject to removal in a future version. -
onFlushReconcileOK
Deprecated, for removal: This API element is subject to removal in a future version. -
handleFlushReconcile
Deprecated, for removal: This API element is subject to removal in a future version. -
handleStartFlush
Deprecated, for removal: This API element is subject to removal in a future version. -
rejectFlush
Deprecated, for removal: This API element is subject to removal in a future version. -
providedDownServices
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from class:ProtocolList of events that are provided to layers below (they will be handled when sent from down below)- Overrides:
providedDownServicesin classProtocol
-
sendBlockUpToChannel
private void sendBlockUpToChannel()Deprecated, for removal: This API element is subject to removal in a future version. -
sendUnBlockUpToChannel
private void sendUnBlockUpToChannel()Deprecated, for removal: This API element is subject to removal in a future version. -
isCurrentFlushMessage
Deprecated, for removal: This API element is subject to removal in a future version. -
currentViewId
private long currentViewId()Deprecated, for removal: This API element is subject to removal in a future version. -
onViewChange
Deprecated, for removal: This API element is subject to removal in a future version. -
onStopFlush
private void onStopFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
resetForNextFlush
private void resetForNextFlush()Deprecated, for removal: This API element is subject to removal in a future version. -
onSuspend
Deprecated, for removal: This API element is subject to removal in a future version.Starts the flush protocol- Parameters:
members- List of participants in the flush protocol. Guaranteed to be non-null
-
onResume
Deprecated, for removal: This API element is subject to removal in a future version. -
onStartFlush
Deprecated, for removal: This API element is subject to removal in a future version. -
onFlushCompleted
Deprecated, for removal: This API element is subject to removal in a future version. -
hasVirtualSynchronyGaps
private boolean hasVirtualSynchronyGaps()Deprecated, for removal: This API element is subject to removal in a future version. -
same
Deprecated, for removal: This API element is subject to removal in a future version. -
findHighestSequences
Deprecated, for removal: This API element is subject to removal in a future version. -
maxSeqnos
Deprecated, for removal: This API element is subject to removal in a future version.Returns a digest which contains, for all members of view, the highest delivered and received seqno of all digests -
onSuspect
Deprecated, for removal: This API element is subject to removal in a future version. -
marshal
Deprecated, for removal: This API element is subject to removal in a future version. -
readParticipantsAndDigest
protected Tuple<Collection<? extends Address>,Digest> readParticipantsAndDigest(byte[] buffer, int offset, int length) Deprecated, for removal: This API element is subject to removal in a future version.
-