Search in sources :

Example 21 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project deeplearning4j by deeplearning4j.

the class SbeStatsInitializationReport method decode.

@Override
public void decode(byte[] decode) {
    MutableDirectBuffer buffer = new UnsafeBuffer(decode);
    decode(buffer);
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer) UnsafeBuffer(org.agrona.concurrent.UnsafeBuffer)

Example 22 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project deeplearning4j by deeplearning4j.

the class SbeStorageMetaData method decode.

@Override
public void decode(byte[] decode) {
    MutableDirectBuffer buffer = new UnsafeBuffer(decode);
    decode(buffer);
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer) UnsafeBuffer(org.agrona.concurrent.UnsafeBuffer)

Example 23 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project deeplearning4j by deeplearning4j.

the class SbeStorageMetaData method encode.

@Override
public byte[] encode() {
    byte[] bytes = new byte[encodingLengthBytes()];
    MutableDirectBuffer buffer = new UnsafeBuffer(bytes);
    encode(buffer);
    return bytes;
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer) UnsafeBuffer(org.agrona.concurrent.UnsafeBuffer)

Example 24 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.

the class EventLogger method logString.

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);
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer)

Example 25 with MutableDirectBuffer

use of org.agrona.MutableDirectBuffer in project Aeron by real-logic.

the class EventLogger method logFrameOut.

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);
    }
}
Also used : MutableDirectBuffer(org.agrona.MutableDirectBuffer)

Aggregations

MutableDirectBuffer (org.agrona.MutableDirectBuffer)42 UnsafeBuffer (org.agrona.concurrent.UnsafeBuffer)18 BeforeEach (org.junit.jupiter.api.BeforeEach)12 Test (org.junit.jupiter.api.Test)12 DirectBuffer (org.agrona.DirectBuffer)11 MediaDriver (io.aeron.driver.MediaDriver)10 ExtendWith (org.junit.jupiter.api.extension.ExtendWith)10 RegisterExtension (org.junit.jupiter.api.extension.RegisterExtension)10 RegistrationException (io.aeron.exceptions.RegistrationException)8 FragmentHandler (io.aeron.logbuffer.FragmentHandler)8 InterruptAfter (io.aeron.test.InterruptAfter)8 InterruptingTestCallback (io.aeron.test.InterruptingTestCallback)8 SystemTestWatcher (io.aeron.test.SystemTestWatcher)8 Tests (io.aeron.test.Tests)8 TestMediaDriver (io.aeron.test.driver.TestMediaDriver)8 Objects.requireNonNull (java.util.Objects.requireNonNull)8 MutableLong (org.agrona.collections.MutableLong)8 Assertions.assertNotEquals (org.junit.jupiter.api.Assertions.assertNotEquals)8 Assertions.assertThrows (org.junit.jupiter.api.Assertions.assertThrows)8 Assumptions.assumeTrue (org.junit.jupiter.api.Assumptions.assumeTrue)8