endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect); endpointByMemberIdMap = tempMap;
endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect);
endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect); CloseHelper.quietClose(publication); CloseHelper.quietClose(subscription);
endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect); endpointByMemberIdMap = tempMap;
/** * Construct a new map allowing a configuration for initial capacity and load factor. * * @param initialCapacity for the backing array * @param loadFactor limit for resizing on puts */ public Int2ObjectHashMap( @DoNotSub final int initialCapacity, final float loadFactor) { validateLoadFactor(loadFactor); this.loadFactor = loadFactor; /* @DoNotSub */ final int capacity = BitUtil.findNextPositivePowerOfTwo(initialCapacity); /* @DoNotSub */ resizeThreshold = (int)(capacity * loadFactor); keys = new int[capacity]; values = new Object[capacity]; // Cached to avoid allocation. valueCollection = new ValueCollection<>(); keySet = new KeySet(); entrySet = new EntrySet<>(); }
private void quiesce() { final Long2LongHashMap inboundPositions = new Long2LongHashMap(CompletionPosition.MISSING_VALUE); inboundPositions.put(inboundPublication.id(), inboundPublication.position()); inboundCompletionPosition.complete(inboundPositions); final Long2LongHashMap outboundPositions = new Long2LongHashMap(CompletionPosition.MISSING_VALUE); idToLibrary.values().forEach(liveLibraryInfo -> { final int aeronSessionId = liveLibraryInfo.aeronSessionId(); final Image image = librarySubscription.imageBySessionId(aeronSessionId); if (image != null) { final long position = image.position(); outboundPositions.put(aeronSessionId, position); } }); outboundLibraryCompletionPosition.complete(outboundPositions); recordingCoordinator.completionPositions(inboundPositions, outboundPositions); }
private int pollLibraries(final long timeInMs) { int total = 0; final Iterator<LiveLibraryInfo> iterator = idToLibrary.values().iterator(); while (iterator.hasNext()) { final LiveLibraryInfo library = iterator.next(); total += library.poll(timeInMs); if (!library.isConnected()) { DebugLogger.log(LIBRARY_MANAGEMENT, "Timing out connection to library %s%n", library.libraryId()); iterator.remove(); library.releaseSlowPeeker(); tryAcquireLibrarySessions(library); saveLibraryTimeout(library); } } total += removeIf(librariesBeingAcquired, retryAcquireLibrarySessionsFunc); return total; }
/** * {@inheritDoc} */ public ValueCollection values() { if (null == valueCollection) { valueCollection = new ValueCollection(); } return valueCollection; }
endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect);
endpointByMemberIdMap.values().forEach(MemberEndpoint::disconnect); CloseHelper.quietClose(publication); CloseHelper.quietClose(subscription);
/** * {@inheritDoc} */ public ValueCollection values() { if (null == valueCollection) { valueCollection = new ValueCollection(); } return valueCollection; }