use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusResponseFinalized.
@Test
public void handleStatusResponseFinalized() 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, FINALIZED));
Assert.assertEquals(FINALIZED, session.getState());
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusResponseNoSession.
@Test
public void handleStatusResponseNoSession() throws Exception {
UUID sessionID = UUIDGen.getTimeUUID();
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
sessions.handleStatusResponse(PARTICIPANT1, new StatusResponse(sessionID, FINALIZE_PROMISED));
Assert.assertNull(sessions.getSession(sessionID));
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessionTest method handleStatusRequestNoSession.
@Test
public void handleStatusRequestNoSession() throws Exception {
InstrumentedLocalSessions sessions = new InstrumentedLocalSessions();
sessions.start();
sessions.sentMessages.clear();
UUID sessionID = UUIDGen.getTimeUUID();
sessions.handleStatusRequest(PARTICIPANT2, new StatusRequest(sessionID));
assertNoMessagesSent(sessions, PARTICIPANT1);
assertMessagesSent(sessions, PARTICIPANT2, new StatusResponse(sessionID, FAILED));
assertNoMessagesSent(sessions, PARTICIPANT3);
}
use of org.apache.cassandra.repair.messages.StatusResponse in project cassandra by apache.
the class LocalSessions method handleStatusRequest.
public void handleStatusRequest(InetAddress from, StatusRequest request) {
logger.debug("received {} from {}", request, from);
UUID sessionID = request.sessionID;
LocalSession session = getSession(sessionID);
if (session == null) {
logger.warn("Received status response message for unknown session {}", sessionID);
sendMessage(from, new StatusResponse(sessionID, FAILED));
} else {
sendMessage(from, new StatusResponse(sessionID, 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);
}
Aggregations