Пример #1
0
        public void Write(UnsafeBuffer termBuffer, int offset, int length, int termId)
        {
            var lengthVersionFlagsType = _versionFlagsType | (-length & 0xFFFFFFFFL);
            var termOffsetSessionId    = _sessionId | (uint)offset;
            var streamAndTermIds       = _streamId | ((long)termId << 32);

            termBuffer.PutLongOrdered(offset + HeaderFlyweight.FRAME_LENGTH_FIELD_OFFSET, lengthVersionFlagsType);

            termBuffer.PutLongOrdered(offset + DataHeaderFlyweight.TERM_OFFSET_FIELD_OFFSET, termOffsetSessionId);
            termBuffer.PutLong(offset + DataHeaderFlyweight.STREAM_ID_FIELD_OFFSET, streamAndTermIds);
        }
Пример #2
0
 private void PutRawTailOrdered(int termId, int termOffset)
 {
     _metaDataBuffer.PutLongOrdered((int)_tailAddressOffset, LogBufferDescriptor.PackTail(termId, termOffset));
 }
Пример #3
0
 /// <summary>
 ///     Set the value of the end of stream position.
 /// </summary>
 /// <param name="metaDataBuffer"> containing the metadata. </param>
 /// <param name="position">          value of the end of stream position </param>
 public static void EndOfStreamPosition(UnsafeBuffer metaDataBuffer, long position)
 {
     metaDataBuffer.PutLongOrdered(LOG_END_OF_STREAM_POSITION_OFFSET, position);
 }
Пример #4
0
 public override void SetOrdered(long value)
 {
     _buffer.PutLongOrdered(_offset, value);
 }
Пример #5
0
 public virtual void TimestampOrdered(long timestamp)
 {
     buffer.PutLongOrdered(timestampFieldOffset, timestamp);
 }
Пример #6
0
 /// <summary>
 /// Set the value of the time of last SM used by the producer of this log.
 /// </summary>
 /// <param name="logMetaDataBuffer"> containing the meta data. </param>
 /// <param name="timeInMillis">      value of the time of last SM in <seealso cref="System#currentTimeMillis()"/> </param>
 public static void TimeOfLastStatusMessage(UnsafeBuffer logMetaDataBuffer, long timeInMillis)
 {
     logMetaDataBuffer.PutLongOrdered(LOG_TIME_OF_LAST_SM_OFFSET, timeInMillis);
 }