/** * Return the read-only status indicator for the given send channel URI. * * @param countersReader that holds the status indicator. * @param channel for the send channel. * @return read-only status indicator that can be used to query the status of the send channel or null * @see ChannelEndpointStatus for status values and indications. */ public static StatusIndicatorReader sendChannelStatus(final CountersReader countersReader, final String channel) { StatusIndicatorReader statusReader = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, typeId, keyBuffer, label) -> { if (typeId == SendChannelStatus.SEND_CHANNEL_STATUS_TYPE_ID) { if (channel.startsWith(keyBuffer.getStringAscii(ChannelEndpointStatus.CHANNEL_OFFSET))) { id.value = counterId; } } }); if (Aeron.NULL_VALUE != id.value) { statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusReader; }
statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value);
/** * Return the controllable idle strategy {@link StatusIndicator}. * * @param countersReader that holds the status indicator. * @return status indicator to use or null if not found. */ public static StatusIndicator controllableIdleStrategy(final CountersReader countersReader) { StatusIndicator statusIndicator = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, label) -> { if (counterId == SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.id() && label.equals(SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.label())) { id.value = counterId; } }); if (Aeron.NULL_VALUE != id.value) { statusIndicator = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusIndicator; }
private void concludeIdleStrategies() final StatusIndicator indicator = new UnsafeBufferStatusIndicator( countersManager.valuesBuffer(), CONTROLLABLE_IDLE_STRATEGY.id());
statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value);
statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value);
/** * Return the read-only status indicator for the given send channel URI. * * @param countersReader that holds the status indicator. * @param channel for the send channel. * @return read-only status indicator that can be used to query the status of the send channel or null * @see ChannelEndpointStatus for status values and indications. */ public static StatusIndicatorReader sendChannelStatus(final CountersReader countersReader, final String channel) { StatusIndicatorReader statusReader = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, typeId, keyBuffer, label) -> { if (typeId == SendChannelStatus.SEND_CHANNEL_STATUS_TYPE_ID) { if (channel.startsWith(keyBuffer.getStringAscii(ChannelEndpointStatus.CHANNEL_OFFSET))) { id.value = counterId; } } }); if (Aeron.NULL_VALUE != id.value) { statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusReader; }
/** * Return the read-only status indicator for the given send channel URI. * * @param countersReader that holds the status indicator. * @param channel for the send channel. * @return read-only status indicator that can be used to query the status of the send channel or null * @see ChannelEndpointStatus for status values and indications. */ public static StatusIndicatorReader sendChannelStatus(final CountersReader countersReader, final String channel) { StatusIndicatorReader statusReader = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, typeId, keyBuffer, label) -> { if (typeId == SendChannelStatus.SEND_CHANNEL_STATUS_TYPE_ID) { if (channel.startsWith(keyBuffer.getStringAscii(ChannelEndpointStatus.CHANNEL_OFFSET))) { id.value = counterId; } } }); if (Aeron.NULL_VALUE != id.value) { statusReader = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusReader; }
/** * Return the controllable idle strategy {@link StatusIndicator}. * * @param countersReader that holds the status indicator. * @return status indicator to use or null if not found. */ public static StatusIndicator controllableIdleStrategy(final CountersReader countersReader) { StatusIndicator statusIndicator = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, label) -> { if (counterId == SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.id() && label.equals(SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.label())) { id.value = counterId; } }); if (Aeron.NULL_VALUE != id.value) { statusIndicator = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusIndicator; }
/** * Return the controllable idle strategy {@link StatusIndicator}. * * @param countersReader that holds the status indicator. * @return status indicator to use or null if not found. */ public static StatusIndicator controllableIdleStrategy(final CountersReader countersReader) { StatusIndicator statusIndicator = null; final MutableInteger id = new MutableInteger(-1); countersReader.forEach( (counterId, label) -> { if (counterId == SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.id() && label.equals(SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.label())) { id.value = counterId; } }); if (Aeron.NULL_VALUE != id.value) { statusIndicator = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value); } return statusIndicator; }
private void concludeIdleStrategies() final StatusIndicator indicator = new UnsafeBufferStatusIndicator( countersManager.valuesBuffer(), CONTROLLABLE_IDLE_STRATEGY.id());
private void concludeIdleStrategies() final StatusIndicator indicator = new UnsafeBufferStatusIndicator( countersManager.valuesBuffer(), CONTROLLABLE_IDLE_STRATEGY.id());