@Override public WaitSet createNew(WaitNotifyKey key) { return new WaitSet(logger, nodeEngine, waitSetMap, delayQueue); } };
@Override public void cancelParkedOperations(String serviceName, Object objectId, Throwable cause) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.cancelAll(serviceName, objectId, cause); } }
@Override public void populate(LiveOperations liveOperations) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.populate(liveOperations); } }
@Probe public int getTotalParkedOperationCount() { int count = 0; for (WaitSet waitSet : waitSetMap.values()) { count += waitSet.size(); } return count; }
public void shutdown() { logger.finest("Stopping tasks..."); expirationTaskFuture.cancel(true); expirationExecutor.shutdown(); for (WaitSet waitSet : waitSetMap.values()) { waitSet.onShutdown(); } waitSetMap.clear(); }
@Override public void park(BlockingOperation op) { WaitSet waitSet = getOrPutIfAbsent(waitSetMap, op.getWaitKey(), waitSetConstructor); waitSet.park(op); }
@Override public void unpark(Notifier notifier) { WaitNotifyKey waitNotifyKey = notifier.getNotifiedKey(); WaitSet waitSet = waitSetMap.get(waitNotifyKey); if (waitSet != null) { waitSet.unpark(notifier, waitNotifyKey); } }
public void onMemberLeft(MemberImpl leftMember) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.invalidateAll(leftMember.getUuid()); } }
public int getTotalValidWaitingOperationCount() { int count = 0; for (WaitSet waitSet : waitSetMap.values()) { count += waitSet.totalValidWaitingOperationCount(); } return count; }
/** * Invalidates all parked operations for the migrated partition and sends a {@link PartitionMigratingException} as a * response. * Invoked on the migration destination. This is executed under partition migration lock! */ public void onPartitionMigrate(Address thisAddress, MigrationInfo migrationInfo) { if (!thisAddress.equals(migrationInfo.getSource())) { return; } for (WaitSet waitSet : waitSetMap.values()) { waitSet.onPartitionMigrate(thisAddress, migrationInfo); } }
@Probe public int getTotalParkedOperationCount() { int count = 0; for (WaitSet waitSet : waitSetMap.values()) { count += waitSet.size(); } return count; }
public void shutdown() { logger.finest("Stopping tasks..."); expirationTaskFuture.cancel(true); expirationExecutor.shutdown(); for (WaitSet waitSet : waitSetMap.values()) { waitSet.onShutdown(); } waitSetMap.clear(); }
@Override public void park(BlockingOperation op) { WaitSet waitSet = getOrPutIfAbsent(waitSetMap, op.getWaitKey(), waitSetConstructor); waitSet.park(op); }
@Override public void unpark(Notifier notifier) { WaitNotifyKey waitNotifyKey = notifier.getNotifiedKey(); WaitSet waitSet = waitSetMap.get(waitNotifyKey); if (waitSet != null) { waitSet.unpark(notifier, waitNotifyKey); } }
public void onMemberLeft(MemberImpl leftMember) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.invalidateAll(leftMember.getUuid()); } }
public int getTotalValidWaitingOperationCount() { int count = 0; for (WaitSet waitSet : waitSetMap.values()) { count += waitSet.totalValidWaitingOperationCount(); } return count; }
/** * Invalidates all parked operations for the migrated partition and sends a {@link PartitionMigratingException} as a * response. * Invoked on the migration destination. This is executed under partition migration lock! */ public void onPartitionMigrate(MigrationInfo migrationInfo) { if (migrationInfo.getSource() == null || !migrationInfo.getSource().isIdentical(nodeEngine.getLocalMember())) { return; } for (WaitSet waitSet : waitSetMap.values()) { waitSet.onPartitionMigrate(migrationInfo); } }
@Override public void cancelParkedOperations(String serviceName, Object objectId, Throwable cause) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.cancelAll(serviceName, objectId, cause); } }
@Override public String toString() { StringBuilder sb = new StringBuilder("OperationParker{"); sb.append("delayQueue="); sb.append(delayQueue.size()); sb.append(" \n["); for (WaitSet waitSet : waitSetMap.values()) { sb.append("\t"); sb.append(waitSet.size()); sb.append(", "); } sb.append("]\n}"); return sb.toString(); }
@Override public void populate(LiveOperations liveOperations) { for (WaitSet waitSet : waitSetMap.values()) { waitSet.populate(liveOperations); } }