示例#1
0
        /// <summary>
        /// Allocate an indicator for tracking the status of a channel endpoint.
        /// </summary>
        /// <param name="tempBuffer">      to be used for labels and metadata. </param>
        /// <param name="name">            of the counter for the label. </param>
        /// <param name="typeId">          of the counter for classification. </param>
        /// <param name="countersManager"> from which to allocated the underlying storage. </param>
        /// <param name="channel">         for the stream of messages. </param>
        /// <returns> a new <seealso cref="AtomicCounter"/> for tracking the status. </returns>
        public static AtomicCounter Allocate(IMutableDirectBuffer tempBuffer, string name, int typeId,
                                             CountersManager countersManager, string channel)
        {
            int keyLength =
                tempBuffer.PutStringWithoutLengthAscii(CHANNEL_OFFSET + BitUtil.SIZE_OF_INT, channel, 0,
                                                       MAX_CHANNEL_LENGTH);

            tempBuffer.PutInt(CHANNEL_OFFSET, keyLength);

            int labelLength = 0;

            labelLength += tempBuffer.PutStringWithoutLengthAscii(keyLength + labelLength, name);
            labelLength += tempBuffer.PutStringWithoutLengthAscii(keyLength + labelLength, ": ");
            labelLength += tempBuffer.PutStringWithoutLengthAscii(keyLength + labelLength, channel, 0,
                                                                  CountersReader.MAX_LABEL_LENGTH - labelLength);


            if (labelLength < CountersReader.MAX_LABEL_LENGTH)
            {
                tempBuffer.PutByte(keyLength + labelLength, (byte)' ');
                labelLength += 1;
            }

            return(countersManager.NewCounter(typeId, tempBuffer, 0, keyLength, tempBuffer, keyLength, labelLength));
        }
 public StartRecordingRequestEncoder SourceLocation(SourceLocation value)
 {
     _buffer.PutByte(_offset + 20, (byte)value);
     return(this);
 }
示例#3
0
 public RecordingDescriptorHeaderEncoder Valid(sbyte value)
 {
     _buffer.PutByte(_offset + 4, unchecked ((byte)value));
     return(this);
 }
示例#4
0
 public ListRecordingSubscriptionsRequestEncoder ApplyStreamId(BooleanType value)
 {
     _buffer.PutByte(_offset + 24, (byte)value);
     return(this);
 }