/** * Set the correlation id field * * @param registrationId field value * @return flyweight */ public PublicationBuffersReadyFlyweight registrationId(final long registrationId) { buffer.putLong(offset + REGISTRATION_ID_OFFSET, registrationId); return this; }
public static int allocateCounterId( final MutableDirectBuffer tempBuffer, final String name, final int typeId, final CountersManager countersManager, final long registrationId) { tempBuffer.putLong(REGISTRATION_ID_OFFSET, registrationId); final int keyLength = REGISTRATION_ID_OFFSET + SIZE_OF_LONG; final int labelOffset = BitUtil.align(keyLength, SIZE_OF_INT); int labelLength = 0; labelLength += tempBuffer.putStringWithoutLengthAscii(labelOffset + labelLength, name); labelLength += tempBuffer.putStringWithoutLengthAscii(labelOffset + labelLength, ": "); labelLength += tempBuffer.putLongAscii(labelOffset + labelLength, registrationId); return countersManager.allocate( typeId, tempBuffer, 0, keyLength, tempBuffer, labelOffset, labelLength); } }
/** * set registration correlation id field * * @param correlationId field value * @return flyweight */ public DestinationMessageFlyweight registrationCorrelationId(final long correlationId) { buffer.putLong(offset + REGISTRATION_CORRELATION_ID_OFFSET, correlationId); return this; }
/** * set registration correlation id field * * @param correlationId field value * @return flyweight */ public SubscriptionMessageFlyweight registrationCorrelationId(final long correlationId) { buffer.putLong(offset + REGISTRATION_CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set the correlation id field * * @param correlationId field value * @return flyweight */ public PublicationBuffersReadyFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId); return this; }
/** * set counter type id field * * @param typeId field value * @return flyweight */ public CounterMessageFlyweight typeId(final long typeId) { buffer.putLong(offset + COUNTER_TYPE_ID_FIELD_OFFSET, typeId); return this; }
/** * set client id field * * @param clientId field value * @return for fluent API */ public ClientTimeoutFlyweight clientId(final long clientId) { buffer.putLong(offset + CLIENT_ID_FIELD_OFFSET, clientId); return this; } }
/** * set correlation id field * * @param correlationId field value * @return for fluent API */ public CorrelatedMessageFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_FIELD_OFFSET, correlationId); return this; } }
/** * set correlation id field * * @param correlationId field value * @return for fluent API */ public OperationSucceededFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_FIELD_OFFSET, correlationId); return this; } }
/** * set correlation id field * * @param correlationId field value * @return flyweight */ public ImageMessageFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set registration id field * * @param registrationId field value * @return flyweight */ public RemoveMessageFlyweight registrationId(final long registrationId) { buffer.putLong(offset + REGISTRATION_ID_OFFSET, registrationId); return this; }
/** * set client id field * * @param clientId field value * @return for fluent API */ public CorrelatedMessageFlyweight clientId(final long clientId) { buffer.putLong(offset + CLIENT_ID_FIELD_OFFSET, clientId); return this; }
/** * Set the correlation id field * * @param correlationId field value * @return flyweight */ public SubscriptionReadyFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set correlation ID of the offending command. * * @param correlationId of the offending command * @return flyweight */ public ErrorResponseFlyweight offendingCommandCorrelationId(final long correlationId) { buffer.putLong(offset + OFFENDING_COMMAND_CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set the correlation id field * * @param correlationId field value * @return flyweight */ public CounterUpdateFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set the tegistration ID for the subscription. * * @param registrationId for the subscription * @return flyweight */ public ImageMessageFlyweight subscriptionRegistrationId(final long registrationId) { buffer.putLong(offset + SUBSCRIPTION_REGISTRATION_ID_OFFSET, registrationId); return this; }
/** * set correlation id field * * @param correlationId field value * @return flyweight */ public ImageBuffersReadyFlyweight correlationId(final long correlationId) { buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId); return this; }
/** * Set the registration Id for the Subscription * * @param id for the Subscription * @return flyweight */ public ImageBuffersReadyFlyweight subscriptionRegistrationId(final long id) { buffer.putLong(offset + SUBSCRIPTION_REGISTRATION_ID_OFFSET, id); return this; }
private static int encodeLogHeader( final MutableDirectBuffer encodingBuffer, final int captureLength, final int length) { int relativeOffset = 0; /* * Stream of values: * - capture buffer length (int) * - total buffer length (int) * - timestamp (long) * - buffer (until end) */ encodingBuffer.putInt(relativeOffset, captureLength, LITTLE_ENDIAN); relativeOffset += SIZE_OF_INT; encodingBuffer.putInt(relativeOffset, length, LITTLE_ENDIAN); relativeOffset += SIZE_OF_INT; encodingBuffer.putLong(relativeOffset, System.nanoTime(), LITTLE_ENDIAN); relativeOffset += SIZE_OF_LONG; return relativeOffset; }
private static void sendChunk( final Publication publication, final BufferClaim bufferClaim, final long correlationId, final UnsafeBuffer fileBuffer, final int chunkOffset, final int chunkLength) { long result; while ((result = publication.tryClaim(CHUNK_PAYLOAD_OFFSET + chunkLength, bufferClaim)) < 0) { checkResult(result); Thread.yield(); } final MutableDirectBuffer buffer = bufferClaim.buffer(); final int offset = bufferClaim.offset(); buffer.putInt(offset + VERSION_OFFSET, VERSION, LITTLE_ENDIAN); buffer.putInt(offset + TYPE_OFFSET, FILE_CHUNK_TYPE, LITTLE_ENDIAN); buffer.putLong(offset + CORRELATION_ID_OFFSET, correlationId, LITTLE_ENDIAN); buffer.putLong(offset + CHUNK_OFFSET_OFFSET, chunkOffset, LITTLE_ENDIAN); buffer.putLong(offset + CHUNK_LENGTH_OFFSET, chunkLength, LITTLE_ENDIAN); buffer.putBytes(offset + CHUNK_PAYLOAD_OFFSET, fileBuffer, chunkOffset, chunkLength); bufferClaim.commit(); }