Exemple #1
0
  public int readValue(byte[] bytes, int offset, int length) {
    final int endOffset = offset + length;
    final Buffer buffer = new OffsetFixedBuffer(bytes, offset);

    this.version = buffer.readByte();

    // this.mostTraceID = buffer.readLong();
    // this.leastTraceID = buffer.readLong();

    this.agentId = buffer.readPrefixedString();
    this.applicationId = buffer.readPrefixedString();
    this.agentStartTime = buffer.readVarLong();

    this.startElapsed = buffer.readVarInt();
    this.endElapsed = buffer.readVarInt();

    // don't need to get sequence because it can be got at Qualifier
    // this.sequence = buffer.readShort();

    this.rpc = buffer.readPrefixedString();
    this.serviceType = buffer.readShort();
    this.endPoint = buffer.readPrefixedString();
    this.destinationId = buffer.readPrefixedString();
    this.apiId = buffer.readSVarInt();

    this.depth = buffer.readSVarInt();
    this.nextSpanId = buffer.readLong();

    this.hasException = buffer.readBoolean();
    if (hasException) {
      this.exceptionId = buffer.readSVarInt();
      this.exceptionMessage = buffer.readPrefixedString();
    }

    this.annotationBoList = readAnnotation(buffer);
    if (buffer.getOffset() < endOffset) {
      nextAsyncId = buffer.readSVarInt();
    }

    return buffer.getOffset();
  }