public void SetUp() { delegateFragmentHandler = A.Fake<FragmentHandler>(); termBuffer = A.Fake<IDirectBuffer>(); adapter = new FragmentAssembler(delegateFragmentHandler); header = A.Fake<Header>(x => x.Wrapping(new Header(INITIAL_TERM_ID, LogBufferDescriptor.TERM_MIN_LENGTH))); header.SetBuffer(termBuffer, 0); A.CallTo(() => termBuffer.GetInt(A<int>._)).Returns(SESSION_ID); }
public int InitialTermId() { return(_buffer.GetInt(_offset + 56, ByteOrder.LittleEndian)); }
public ClusterAction Action() { return((ClusterAction)_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian)); }
public static UnsafeBuffer CreateErrorLogBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer) { var offset = END_OF_METADATA_OFFSET + metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0)) + metaDataBuffer.GetInt(ToClientsBufferLengthOffset(0)) + metaDataBuffer.GetInt(CountersMetaDataBufferLengthOffset(0)) + metaDataBuffer.GetInt(CountersValuesBufferLengthOffset(0)); return(new UnsafeBuffer(buffer.Pointer, offset, metaDataBuffer.GetInt(ErrorLogBufferLengthOffset(0)))); }
public uint Length() { return(unchecked ((uint)_buffer.GetInt(_offset + 0, ByteOrder.LittleEndian))); }
public static UnsafeBuffer CreateToDriverBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer) { return new UnsafeBuffer(buffer.Pointer, END_OF_METADATA_OFFSET, metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0))); }
public int RecordCount() { return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian)); }
public int Version() { return(_buffer.GetInt(_offset + 0, ByteOrder.LittleEndian)); }
public int StreamId() { return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian)); }
public int CandidateMemberId() { return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian)); }
public int SessionId() { return(_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian)); }
public AdminQueryType QueryType() { return((AdminQueryType)_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian)); }
public HeaderWriter(IDirectBuffer defaultHeader) { _versionFlagsType = (long)defaultHeader.GetInt(HeaderFlyweight.VERSION_FIELD_OFFSET) << 32; _sessionId = (long)defaultHeader.GetInt(DataHeaderFlyweight.SESSION_ID_FIELD_OFFSET) << 32; _streamId = defaultHeader.GetInt(DataHeaderFlyweight.STREAM_ID_FIELD_OFFSET) & 0xFFFFFFFFL; }
public int EncodedChallengeLength() { int limit = _parentMessage.Limit(); return((int)unchecked ((uint)_buffer.GetInt(limit, ByteOrder.LittleEndian))); }
public int CommitPositionId() { return(_buffer.GetInt(_offset + 8, ByteOrder.LittleEndian)); }
public int ResponseDataLength() { int limit = _parentMessage.Limit(); return((int)unchecked ((uint)_buffer.GetInt(limit, ByteOrder.LittleEndian))); }
public int LeaderMemberId() { return(_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian)); }
public int PendingMessageCapacity() { return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian)); }
public int ResponseStreamId() { return(_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian)); }
public CloseReason CloseReason() { return((CloseReason)_buffer.GetInt(_offset + 32, ByteOrder.LittleEndian)); }
public int FollowerMemberId() { return(_buffer.GetInt(_offset + 8, ByteOrder.LittleEndian)); }
public static UnsafeBuffer CreateToDriverBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer) { return(new UnsafeBuffer(buffer.Pointer, END_OF_METADATA_OFFSET, metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0)))); }
public static UnsafeBuffer CreateErrorLogBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer) { var offset = END_OF_METADATA_OFFSET + metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0)) + metaDataBuffer.GetInt(ToClientsBufferLengthOffset(0)) + metaDataBuffer.GetInt(CountersMetaDataBufferLengthOffset(0)) + metaDataBuffer.GetInt(CountersValuesBufferLengthOffset(0)); return new UnsafeBuffer(buffer.Pointer, offset, metaDataBuffer.GetInt(ErrorLogBufferLengthOffset(0))); }
public int VotedForMemberId() { return(_buffer.GetInt(_offset + 56, ByteOrder.LittleEndian)); }