public Map<Long, Long> create(final Object... entries) { final Long2LongHashMap map = new Long2LongHashMap( entries.length * 2, Hashing.DEFAULT_LOAD_FACTOR, -1L, false); for (final Object o : entries) { @SuppressWarnings("unchecked") final Map.Entry<Long, Long> e = (Map.Entry<Long, Long>)o; map.put(e.getKey(), e.getValue()); } return map; }
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 final GatewayPublication outboundPublication; private final Long2LongHashMap resendSlowStatus = new Long2LongHashMap(-1); private final Long2LongHashMap resendNotSlowStatus = new Long2LongHashMap(-1); private final AgentInvoker conductorAgentInvoker; private final RecordingCoordinator recordingCoordinator;