public class MasterTransfer
extends java.lang.Object
Each Master Transfer operation uses a separate instance of this class. There is usually no more than one instance in the lifetime of a master node, because if the transfer succeeds, the old master node environment becomes invalid and must be closed. However, if an operation times out, another operation can try again later. Or, a second operation can "forcibly" supersede an existing operation in progress.
Modifier and Type | Class and Description |
---|---|
(package private) static class |
MasterTransfer.VLSNProgress
An event of interest in the pursuit of our goal of completing the Master
Transfer.
|
Constructor and Description |
---|
MasterTransfer(java.util.Set<java.lang.String> replicas,
long timeout,
RepNode repNode) |
Modifier and Type | Method and Description |
---|---|
boolean |
abort(java.lang.Exception e)
Aborts an existing, in-progress Master Transfer operation, if it hasn't
reached the point of no return.
|
(package private) void |
addFeeder(Feeder f)
Enables the given
Feeder to contribute to this Master Transfer
operation. |
(package private) long |
getStartTime() |
(package private) void |
giveUp(java.lang.String replicaNodeName)
Informs this Master Transfer operation that the named Feeder is shutting
down, because its replica connection has been lost.
|
(package private) void |
noteProgress(MasterTransfer.VLSNProgress p)
Accepts a Progress event and posts it to our queue for processing by the
Master Transfer operation thread.
|
(package private) java.lang.String |
transfer()
Performs the core processing of a Master Transfer operation.
|
MasterTransfer(java.util.Set<java.lang.String> replicas, long timeout, RepNode repNode)
public boolean abort(java.lang.Exception e)
void noteProgress(MasterTransfer.VLSNProgress p)
void giveUp(java.lang.String replicaNodeName)
Actually all we do here is post a special kind of "progress" event to
our queue; it gets processed for real in the chooseReplica()
thread, along with all the other events.
chooseReplica()
java.lang.String transfer()
If the operation fails we release any transaction commit/abort threads
that may have been blocked during phase 2 of the wait. However, in the
success case the release of any such transaction threads is done as a
natural by-product of the invalidation of the environment when it
discovers that it is no longer master (the MasterReplicaTransitionException
).
void addFeeder(Feeder f)
Feeder
to contribute to this Master Transfer
operation. Called from the FeederManager
when a new Feeder
is established during the time when a Master Transfer operation
is already in progress.long getStartTime()
Copyright (c) 2004-2012 Oracle. All rights reserved.