use of com.hazelcast.cp.internal.session.RaftSessionService in project hazelcast by hazelcast.
the class AbstractSemaphoreAdvancedTest method testActiveSessionIsNotClosed.
@Test
public void testActiveSessionIsNotClosed() throws InterruptedException {
semaphore.init(1);
semaphore.acquire();
assertTrueEventually(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService sessionService = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertFalse(sessionService.getAllSessions(getGroupId()).get().isEmpty());
}
});
assertTrueAllTheTime(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService sessionService = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertFalse(sessionService.getAllSessions(getGroupId()).get().isEmpty());
}
}, 20);
}
use of com.hazelcast.cp.internal.session.RaftSessionService in project hazelcast by hazelcast.
the class HeartbeatSessionOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
RaftSessionService service = getService();
service.heartbeat(groupId, sessionId);
return null;
}
use of com.hazelcast.cp.internal.session.RaftSessionService in project hazelcast by hazelcast.
the class ExpireSessionsOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
RaftSessionService service = getService();
service.expireSessions(groupId, sessions);
return null;
}
use of com.hazelcast.cp.internal.session.RaftSessionService in project hazelcast by hazelcast.
the class CloseInactiveSessionsOp method run.
@Override
public Object run(CPGroupId groupId, long commitIndex) {
RaftSessionService service = getService();
service.closeInactiveSessions(groupId, sessions);
return null;
}
use of com.hazelcast.cp.internal.session.RaftSessionService in project hazelcast by hazelcast.
the class AbstractFencedLockAdvancedTest method testActiveSessionIsNotClosedWhenLockIsHeld.
@Test
public void testActiveSessionIsNotClosedWhenLockIsHeld() {
lock.lock();
assertTrueEventually(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService sessionService = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertFalse(sessionService.getAllSessions(lock.getGroupId()).get().isEmpty());
}
});
assertTrueAllTheTime(() -> {
for (HazelcastInstance instance : instances) {
RaftSessionService sessionService = getNodeEngineImpl(instance).getService(RaftSessionService.SERVICE_NAME);
assertFalse(sessionService.getAllSessions(lock.getGroupId()).get().isEmpty());
}
}, 20);
}
Aggregations