use of org.agrona.concurrent.status.StatusIndicator in project Aeron by real-logic.
the class SetControllableIdleStrategy method main.
public static void main(final String[] args) throws Exception {
try (Aeron aeron = Aeron.connect()) {
final CountersReader countersReader = aeron.countersReader();
final MutableInteger id = new MutableInteger();
id.value = -1;
countersReader.forEach((counterId, typeId, keyBuffer, label) -> {
if (counterId == SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.id() && label.equals(SystemCounterDescriptor.CONTROLLABLE_IDLE_STRATEGY.label())) {
id.value = counterId;
}
});
if (-1 != id.value) {
final StatusIndicator statusIndicator = new UnsafeBufferStatusIndicator(countersReader.valuesBuffer(), id.value);
final int status = Integer.parseInt(args[0]);
statusIndicator.setOrdered(status);
System.out.println("Set ControllableIdleStrategy status to " + status);
} else {
System.out.println("Could not find ControllableIdleStrategy status.");
}
}
}
Aggregations