public void clientClose() { correlatedMessage.correlationId(Aeron.NULL_VALUE); toDriverCommandBuffer.write(CLIENT_CLOSE, buffer, 0, CorrelatedMessageFlyweight.LENGTH); } }
public void logFrameOut(final ByteBuffer buffer, final InetSocketAddress dstAddress) { if (IS_FRAME_OUT_ENABLED) { final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get(); final int encodedLength = EventEncoder.encode( encodedBuffer, buffer, buffer.position(), buffer.remaining(), dstAddress); ringBuffer.write(EventCode.FRAME_OUT.id(), encodedBuffer, 0, encodedLength); } }
public void logFrameIn( final DirectBuffer buffer, final int offset, final int length, final InetSocketAddress dstAddress) { if (IS_FRAME_IN_ENABLED) { final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get(); final int encodedLength = EventEncoder.encode(encodedBuffer, buffer, offset, length, dstAddress); ringBuffer.write(EventCode.FRAME_IN.id(), encodedBuffer, 0, encodedLength); } }
private void logString(final EventCode code, final String value) { final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get(); final int encodingLength = EventEncoder.encode(encodedBuffer, value); ringBuffer.write(code.id(), encodedBuffer, 0, encodingLength); } }
public void sendClientKeepalive() { correlatedMessage.correlationId(0); if (!toDriverCommandBuffer.write(CLIENT_KEEPALIVE, buffer, 0, CorrelatedMessageFlyweight.LENGTH)) { throw new AeronException("could not send client keepalive command"); } }
public void log(final EventCode code, final DirectBuffer buffer, final int offset, final int length) { if (EventCode.isEnabled(code, ENABLED_EVENT_CODES)) { final MutableDirectBuffer encodedBuffer = ENCODING_BUFFER.get(); final int encodedLength = EventEncoder.encode(encodedBuffer, buffer, offset, length); ringBuffer.write(code.id(), encodedBuffer, 0, encodedLength); } }
public long removeSubscription(final long registrationId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); removeMessage .registrationId(registrationId) .correlationId(correlationId); if (!toDriverCommandBuffer.write(REMOVE_SUBSCRIPTION, buffer, 0, RemoveMessageFlyweight.length())) { throw new AeronException("could not write remove subscription message"); } return correlationId; }
public long removeCounter(final long registrationId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); removeMessage .registrationId(registrationId) .correlationId(correlationId); if (!toDriverCommandBuffer.write(REMOVE_COUNTER, buffer, 0, RemoveMessageFlyweight.length())) { throw new AeronException("could not write remove counter command"); } return correlationId; }
public long removePublication(final long registrationId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); removeMessage .registrationId(registrationId) .correlationId(correlationId); if (!toDriverCommandBuffer.write(REMOVE_PUBLICATION, buffer, 0, RemoveMessageFlyweight.length())) { throw new AeronException("could not write remove publication command"); } return correlationId; }
public long addRcvDestination(final long registrationId, final String endpointChannel) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); destinationMessage .registrationCorrelationId(registrationId) .channel(endpointChannel) .correlationId(correlationId); if (!toDriverCommandBuffer.write(ADD_RCV_DESTINATION, buffer, 0, destinationMessage.length())) { throw new AeronException("could not write rcv destination command"); } return correlationId; }
public long removeDestination(final long registrationId, final String endpointChannel) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); destinationMessage .registrationCorrelationId(registrationId) .channel(endpointChannel) .correlationId(correlationId); if (!toDriverCommandBuffer.write(REMOVE_DESTINATION, buffer, 0, destinationMessage.length())) { throw new AeronException("could not write destination command"); } return correlationId; }
public long removeRcvDestination(final long registrationId, final String endpointChannel) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); destinationMessage .registrationCorrelationId(registrationId) .channel(endpointChannel) .correlationId(correlationId); if (!toDriverCommandBuffer.write(REMOVE_RCV_DESTINATION, buffer, 0, destinationMessage.length())) { throw new AeronException("could not write rcv destination command"); } return correlationId; }
public long addPublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add publication command"); } return correlationId; }
public long addExclusivePublication(final String channel, final int streamId) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); publicationMessage.correlationId(correlationId); publicationMessage .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_EXCLUSIVE_PUBLICATION, buffer, 0, publicationMessage.length())) { throw new AeronException("could not write add exclusive publication command"); } return correlationId; }
public long addDestination(final long registrationId, final String endpointChannel) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); destinationMessage .registrationCorrelationId(registrationId) .channel(endpointChannel) .correlationId(correlationId); if (!toDriverCommandBuffer.write(ADD_DESTINATION, buffer, 0, destinationMessage.length())) { throw new AeronException("could not write destination command"); } return correlationId; }
public long addCounter(final int typeId, final String label) { final long correlationId = toDriverCommandBuffer.nextCorrelationId(); counterMessage .typeId(typeId) .keyBuffer(null, 0, 0) .label(label) .correlationId(correlationId); if (!toDriverCommandBuffer.write(ADD_COUNTER, buffer, 0, counterMessage.length())) { throw new AeronException("could not write add counter command"); } return correlationId; }
public void run() { try { barrier.await(); } catch (final Exception ignore) { } final int length = BitUtil.SIZE_OF_INT * 2; final int repsValueOffset = BitUtil.SIZE_OF_INT; final UnsafeBuffer srcBuffer = new UnsafeBuffer(new byte[1024]); srcBuffer.putInt(0, producerId); for (int i = 0; i < reps; i++) { srcBuffer.putInt(repsValueOffset, i); while (!ringBuffer.write(MSG_TYPE_ID, srcBuffer, 0, length)) { Thread.yield(); } } } }
public long addSubscription(final String channel, final int streamId) { final long registrationId = Aeron.NULL_VALUE; final long correlationId = toDriverCommandBuffer.nextCorrelationId(); subscriptionMessage.correlationId(correlationId); subscriptionMessage .registrationCorrelationId(registrationId) .streamId(streamId) .channel(channel); if (!toDriverCommandBuffer.write(ADD_SUBSCRIPTION, buffer, 0, subscriptionMessage.length())) { throw new AeronException("could not write add subscription command"); } return correlationId; }
public void run() { try { barrier.await(); } catch (final Exception ignore) { } final int length = BitUtil.SIZE_OF_INT * 2; final int repsValueOffset = BitUtil.SIZE_OF_INT; final UnsafeBuffer srcBuffer = new UnsafeBuffer(new byte[1024]); srcBuffer.putInt(0, producerId); for (int i = 0; i < reps; i++) { srcBuffer.putInt(repsValueOffset, i); while (!ringBuffer.write(MSG_TYPE_ID, srcBuffer, 0, length)) { Thread.yield(); } } } }
.correlationId(correlationId); if (!toDriverCommandBuffer.write(ADD_COUNTER, buffer, 0, counterMessage.length()))