void removeControlSession(final ControlSession controlSession) { controlSessionByIdMap.remove(controlSession.sessionId()); }
void onSessionClose(final long clusterSessionId, final long timestampMs, final CloseReason closeReason) { clusterTimeMs = timestampMs; final ClientSession session = sessionByIdMap.remove(clusterSessionId); session.disconnect(); service.onSessionClose(session, timestampMs, closeReason); }
void onReplaySessionClose(final long clusterSessionId, final long timestamp, final CloseReason closeReason) { clusterTimeMs(timestamp); sessionByIdMap.remove(clusterSessionId).close(closeReason); }
void releaseLogBuffers(final LogBuffers logBuffers, final long registrationId) { if (logBuffers.decRef() == 0) { logBuffers.timeOfLastStateChange(nanoClock.nanoTime()); logBuffersByIdMap.remove(registrationId); lingeringResources.add(logBuffers); } }
void closeReplaySession(final ReplaySession session) { replaySessionByIdMap.remove(session.sessionId()); session.sendPendingError(controlResponseProxy); closeSession(session); }
public void onSessionClose(final long clusterSessionId) { final ClusterSession session = sessionByIdMap.get(clusterSessionId); if (null != session && Cluster.Role.LEADER == role) { session.close(CloseReason.CLIENT_ACTION); if (logPublisher.appendSessionClose(session, leadershipTermId, clusterTimeMs)) { sessionByIdMap.remove(clusterSessionId); } } }
void releaseSubscription(final Subscription subscription) { clientLock.lock(); try { if (!subscription.isClosed()) { ensureActive(); ensureNotReentrant(); subscription.internalClose(); final long registrationId = subscription.registrationId(); resourceByRegIdMap.remove(registrationId); awaitResponse(driverProxy.removeSubscription(registrationId)); } } finally { clientLock.unlock(); } }
void releaseCounter(final Counter counter) { clientLock.lock(); try { if (!counter.isClosed()) { ensureActive(); ensureNotReentrant(); counter.internalClose(); final long registrationId = counter.registrationId(); if (null != resourceByRegIdMap.remove(registrationId)) { awaitResponse(driverProxy.removeCounter(registrationId)); } } } finally { clientLock.unlock(); } }
private void fileChunk( final long correlationId, final long chunkOffset, final long chunkLength, final DirectBuffer buffer, final int offset) { final UnsafeBuffer fileBuffer = fileSessionByIdMap.get(correlationId); buffer.getBytes(offset + CHUNK_PAYLOAD_OFFSET, fileBuffer, (int)chunkOffset, (int)chunkLength); if ((chunkOffset + chunkLength) >= fileBuffer.capacity()) { fileSessionByIdMap.remove(correlationId); IoUtil.unmap(fileBuffer.byteBuffer()); } }
void closeRecordingSession(final RecordingSession session) { final long recordingId = session.sessionId(); catalog.recordingStopped(recordingId, session.recordingPosition().get(), epochClock.time()); recordingSessionByIdMap.remove(recordingId); closeSession(session); }
void onServiceCloseSession(final long clusterSessionId) { final ClusterSession session = sessionByIdMap.get(clusterSessionId); if (null != session) { if (session.isResponsePublicationConnected()) { egressPublisher.sendEvent( session, leadershipTermId, leaderMember.id(), EventCode.ERROR, SESSION_TERMINATED_MSG); } session.close(CloseReason.SERVICE_ACTION); if (Cluster.Role.LEADER == role && logPublisher.appendSessionClose(session, leadershipTermId, clusterTimeMs)) { sessionByIdMap.remove(clusterSessionId); } } }
void releasePublication(final Publication publication) { clientLock.lock(); try { if (!publication.isClosed()) { ensureActive(); ensureNotReentrant(); publication.internalClose(); if (publication == resourceByRegIdMap.remove(publication.registrationId())) { releaseLogBuffers(publication.logBuffers(), publication.originalRegistrationId()); awaitResponse(driverProxy.removePublication(publication.registrationId())); } } } finally { clientLock.unlock(); } }
@Override public boolean onTimerExpiry(TimeUnit timeUnit, long now, long timerId) { final TimerSubscription timer = timerJobMap.remove(timerId); if (timer != null) { timer.onTimerExpired(timeUnit, now); } return true; } };
@Override public boolean onTimerExpiry(TimeUnit timeUnit, long now, long timerId) { final TimerSubscription timer = timerJobMap.remove(timerId); if (timer != null) { timer.onTimerExpired(timeUnit, now); } return true; } };
private Action attempt(final long correlationId, final UnitOfWork unitOfWork) { final Action action = unitOfWork.attemptToAction(); if (action != ABORT) { correlationIdToTransactions.remove(correlationId); } return action; }
public void remove(TimerSubscription timer) { final long timerId = timer.getTimerId(); timerJobMap.remove(timerId); cancelTimer(timerId); } }
private void pushDeploymentToPartitions(final long key) { if (!partitionsToDistributeTo.isEmpty()) { deployOnMultiplePartitions(key); } else { LOG.trace("No other partitions to distribute deployment."); LOG.trace("Deployment finished."); pendingDeploymentFutures.remove(key).complete(null); } }
void releaseLogBuffers(final LogBuffers logBuffers, final long registrationId) { if (logBuffers.decRef() == 0) { logBuffers.timeOfLastStateChange(nanoClock.nanoTime()); logBuffersByIdMap.remove(registrationId); lingeringResources.add(logBuffers); } }
void closeReplaySession(final ReplaySession session) { replaySessionByIdMap.remove(session.sessionId()); session.sendPendingError(controlResponseProxy); closeSession(session); }
@Override public boolean onTimerExpiry(TimeUnit timeUnit, long now, long timerId) { final OutgoingRequest request = requestsByTimeoutIds.get(timerId); if (request != null) { reclaimRequestBuffer(request.getRequestBuffer().byteBuffer()); request.timeout(); inFlightRequests.remove(request.getLastRequestId()); } return true; }