public class LocalSessions
extends java.lang.Object
CoordinatorSession
Modifier and Type | Class and Description |
---|---|
static interface |
LocalSessions.Listener |
Modifier and Type | Field and Description |
---|---|
static int |
CLEANUP_INTERVAL
How often LocalSessions.cleanup is run
|
Constructor and Description |
---|
LocalSessions() |
Modifier and Type | Method and Description |
---|---|
protected LocalSession |
buildSession(LocalSession.Builder builder) |
void |
cancelSession(TimeUUID sessionID,
boolean force)
hook for operators to cancel sessions, cancelling from a non-coordinator is an error, unless
force is set to true.
|
void |
cleanup()
Auto fails and auto deletes timed out and old sessions
Compaction will clean up the sstables still owned by a deleted session
|
CleanupSummary |
cleanup(TableId tid,
java.util.Collection<Range<Token>> ranges,
boolean force) |
void |
deleteSession(TimeUUID sessionID) |
void |
failSession(LocalSession session,
boolean sendMessage) |
void |
failSession(TimeUUID sessionID) |
void |
failSession(TimeUUID sessionID,
boolean sendMessage) |
protected InetAddressAndPort |
getBroadcastAddressAndPort() |
long |
getFinalSessionRepairedAt(TimeUUID sessionID)
Returns the repairedAt time for a sessions which is unknown, failed, or finalized
calling this for a session which is in progress throws an exception
|
protected ActiveRepairService.ParentRepairSession |
getParentRepairSession(TimeUUID sessionID) |
PendingStats |
getPendingStats(TableId tid,
java.util.Collection<Range<Token>> ranges) |
RepairedState.Stats |
getRepairedStats(TableId tid,
java.util.Collection<Range<Token>> ranges) |
LocalSession |
getSession(TimeUUID sessionID) |
void |
handleFailSessionMessage(InetAddressAndPort from,
FailSession msg) |
void |
handleFinalizeCommitMessage(InetAddressAndPort from,
FinalizeCommit commit)
Finalizes the repair session, completing it as successful.
|
void |
handleFinalizeProposeMessage(InetAddressAndPort from,
FinalizePropose propose) |
void |
handlePrepareMessage(InetAddressAndPort from,
PrepareConsistentRequest request)
The PrepareConsistentRequest promotes the parent repair session to a consistent incremental
session, and isolates the data to be repaired from the rest of the table's data
No response is sent to the repair coordinator until the data preparation / isolation has completed
successfully.
|
void |
handleStatusRequest(InetAddressAndPort from,
StatusRequest request) |
void |
handleStatusResponse(InetAddressAndPort from,
StatusResponse response) |
protected boolean |
isAlive(InetAddressAndPort address) |
protected boolean |
isNodeInitialized() |
boolean |
isSessionFinalized(TimeUUID sessionID)
determines if a local session exists, and if it's in the finalized state
|
boolean |
isSessionInProgress(TimeUUID sessionID)
determines if a local session exists, and if it's not finalized or failed
|
boolean |
isStarted() |
void |
maybeSetRepairing(TimeUUID sessionID) |
static void |
registerListener(LocalSessions.Listener listener) |
protected void |
sendMessage(InetAddressAndPort destination,
Message<? extends RepairMessage> message) |
void |
sendStatusRequest(LocalSession session) |
void |
sessionCompleted(LocalSession session) |
boolean |
sessionExists(TimeUUID sessionID)
determines if a local session exists
|
protected boolean |
sessionHasData(LocalSession session) |
java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
sessionInfo(boolean all,
java.util.Set<Range<Token>> ranges) |
void |
start()
Loads sessions out of the repairs table and sets state to started
|
void |
stop() |
static void |
unregisterListener(LocalSessions.Listener listener) |
public static final int CLEANUP_INTERVAL
protected InetAddressAndPort getBroadcastAddressAndPort()
protected boolean isAlive(InetAddressAndPort address)
protected boolean isNodeInitialized()
public java.util.List<java.util.Map<java.lang.String,java.lang.String>> sessionInfo(boolean all, java.util.Set<Range<Token>> ranges)
public RepairedState.Stats getRepairedStats(TableId tid, java.util.Collection<Range<Token>> ranges)
public PendingStats getPendingStats(TableId tid, java.util.Collection<Range<Token>> ranges)
public CleanupSummary cleanup(TableId tid, java.util.Collection<Range<Token>> ranges, boolean force)
public void cancelSession(TimeUUID sessionID, boolean force)
public void start()
public void stop()
public boolean isStarted()
public void cleanup()
protected LocalSession buildSession(LocalSession.Builder builder)
public LocalSession getSession(TimeUUID sessionID)
protected ActiveRepairService.ParentRepairSession getParentRepairSession(TimeUUID sessionID) throws NoSuchRepairSessionException
NoSuchRepairSessionException
protected void sendMessage(InetAddressAndPort destination, Message<? extends RepairMessage> message)
public void failSession(TimeUUID sessionID)
public void failSession(TimeUUID sessionID, boolean sendMessage)
public void failSession(LocalSession session, boolean sendMessage)
public void deleteSession(TimeUUID sessionID)
public void handlePrepareMessage(InetAddressAndPort from, PrepareConsistentRequest request)
public void maybeSetRepairing(TimeUUID sessionID)
public void handleFinalizeProposeMessage(InetAddressAndPort from, FinalizePropose propose)
public void sessionCompleted(LocalSession session)
public void handleFinalizeCommitMessage(InetAddressAndPort from, FinalizeCommit commit)
public void handleFailSessionMessage(InetAddressAndPort from, FailSession msg)
public void sendStatusRequest(LocalSession session)
public void handleStatusRequest(InetAddressAndPort from, StatusRequest request)
public void handleStatusResponse(InetAddressAndPort from, StatusResponse response)
public boolean isSessionInProgress(TimeUUID sessionID)
public boolean isSessionFinalized(TimeUUID sessionID)
public boolean sessionExists(TimeUUID sessionID)
protected boolean sessionHasData(LocalSession session)
public long getFinalSessionRepairedAt(TimeUUID sessionID)
public static void registerListener(LocalSessions.Listener listener)
public static void unregisterListener(LocalSessions.Listener listener)
Copyright © 2009- The Apache Software Foundation