use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessions method handleStatusRequest.
public void handleStatusRequest(InetAddressAndPort from, StatusRequest request) {
logger.trace("received {} from {}", request, from);
UUID sessionID = request.sessionID;
LocalSession session = getSession(sessionID);
if (session == null) {
logger.warn("Received status request message for unknown session {}", sessionID);
sendMessage(from, Message.out(STATUS_RSP, new StatusResponse(sessionID, FAILED)));
} else {
sendMessage(from, Message.out(STATUS_RSP, new StatusResponse(sessionID, session.getState())));
logger.info("Responding to status response message for incremental repair session {} with local state {}", sessionID, session.getState());
}
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusResponseFailed.
@Test
public void handleStatusResponseFailed() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
session.setState(FINALIZE_PROMISED);
sessions.handleStatusResponse(PARTICIPANT1, new StatusResponse(sessionID, FAILED));
Assert.assertEquals(FAILED, session.getState());
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusResponseFailedRedundant.
@Test
public void handleStatusResponseFailedRedundant() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
session.setState(FAILED);
sessions.handleStatusResponse(PARTICIPANT1, new StatusResponse(sessionID, FAILED));
Assert.assertEquals(FAILED, session.getState());
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusRequest.
@Test
public void handleStatusRequest() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
Assert.assertEquals(PREPARED, session.getState());
sessions.sentMessages.clear();
sessions.handleStatusRequest(PARTICIPANT2, new StatusRequest(sessionID));
assertNoMessagesSent(sessions, PARTICIPANT1);
assertMessagesSent(sessions, PARTICIPANT2, new StatusResponse(sessionID, PREPARED));
assertNoMessagesSent(sessions, PARTICIPANT3);
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusResponseNoop.
@Test
public void handleStatusResponseNoop() throws Exception {
UUID sessionID = registerSession();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
LocalSession session = sessions.prepareForTest(sessionID);
session.setState(REPAIRING);
sessions.handleStatusResponse(PARTICIPANT1, new StatusResponse(sessionID, FINALIZE_PROMISED));
Assert.assertEquals(REPAIRING, session.getState());
}
Aggregations