Example #1
0
        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));
 }
Example #3
0
 public ClusterAction Action()
 {
     return((ClusterAction)_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian));
 }
Example #4
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))));
        }
Example #5
0
 public uint Length()
 {
     return(unchecked ((uint)_buffer.GetInt(_offset + 0, ByteOrder.LittleEndian)));
 }
Example #6
0
 public static UnsafeBuffer CreateToDriverBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer)
 {
     return new UnsafeBuffer(buffer.Pointer, END_OF_METADATA_OFFSET, metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0)));
 }
Example #7
0
 public int RecordCount()
 {
     return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian));
 }
Example #8
0
 public int Version()
 {
     return(_buffer.GetInt(_offset + 0, ByteOrder.LittleEndian));
 }
Example #9
0
 public int StreamId()
 {
     return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian));
 }
Example #10
0
 public int CandidateMemberId()
 {
     return(_buffer.GetInt(_offset + 24, ByteOrder.LittleEndian));
 }
Example #11
0
 public int SessionId()
 {
     return(_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian));
 }
Example #12
0
 public AdminQueryType QueryType()
 {
     return((AdminQueryType)_buffer.GetInt(_offset + 16, ByteOrder.LittleEndian));
 }
Example #13
0
 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;
 }
Example #14
0
        public int EncodedChallengeLength()
        {
            int limit = _parentMessage.Limit();

            return((int)unchecked ((uint)_buffer.GetInt(limit, ByteOrder.LittleEndian)));
        }
Example #15
0
 public int CommitPositionId()
 {
     return(_buffer.GetInt(_offset + 8, ByteOrder.LittleEndian));
 }
Example #16
0
        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));
 }
Example #18
0
 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));
 }
Example #21
0
 public int FollowerMemberId()
 {
     return(_buffer.GetInt(_offset + 8, ByteOrder.LittleEndian));
 }
Example #22
0
 public static UnsafeBuffer CreateToDriverBuffer(MappedByteBuffer buffer, IDirectBuffer metaDataBuffer)
 {
     return(new UnsafeBuffer(buffer.Pointer, END_OF_METADATA_OFFSET, metaDataBuffer.GetInt(ToDriverBufferLengthOffset(0))));
 }
Example #23
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)));
        }
Example #24
0
 public int VotedForMemberId()
 {
     return(_buffer.GetInt(_offset + 56, ByteOrder.LittleEndian));
 }