use of com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldEncodingStrategy in project pinpoint by naver.
the class DataSourceCodec method decodeJoinDataSourceBoList.
private List<JoinDataSourceBo> decodeJoinDataSourceBoList(Buffer valueBuffer) {
int numValues = valueBuffer.readVInt();
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
EncodingStrategy<Short> serviceTypeEncodingStrategy = UnsignedShortEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<String> urlEncodingStrategy = StringEncodingStrategy.getFromCode(headerDecoder.getCode());
JoinIntFieldEncodingStrategy activeConnectionSizeEncodingStrategy = JoinIntFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
List<Short> serviceTypeCodeList = this.codec.decodeValues(valueBuffer, serviceTypeEncodingStrategy, numValues);
List<String> jdbcUrlList = this.codec.decodeValues(valueBuffer, urlEncodingStrategy, numValues);
final List<JoinIntFieldBo> activeConnectionSizeValueList = this.codec.decodeValues(valueBuffer, activeConnectionSizeEncodingStrategy, numValues);
List<JoinDataSourceBo> joinDataSourceBoList = new ArrayList<JoinDataSourceBo>(numValues);
for (int i = 0; i < numValues; ++i) {
JoinDataSourceBo joinDataSourceBo = new JoinDataSourceBo();
joinDataSourceBo.setServiceTypeCode(serviceTypeCodeList.get(i));
joinDataSourceBo.setUrl(jdbcUrlList.get(i));
joinDataSourceBo.setActiveConnectionSizeJoinValue(activeConnectionSizeValueList.get(i));
joinDataSourceBoList.add(joinDataSourceBo);
}
return joinDataSourceBoList;
}
use of com.navercorp.pinpoint.common.server.bo.codec.stat.strategy.JoinIntFieldEncodingStrategy in project pinpoint by naver.
the class ActiveTraceCodec method decodeValues.
@Override
public List<JoinStatBo> decodeValues(Buffer valueBuffer, ApplicationStatDecodingContext decodingContext) {
final String id = decodingContext.getApplicationId();
final long baseTimestamp = decodingContext.getBaseTimestamp();
final long timestampDelta = decodingContext.getTimestampDelta();
final long initialTimestamp = baseTimestamp + timestampDelta;
int numValues = valueBuffer.readVInt();
List<Long> timestampList = this.codec.decodeTimestamps(initialTimestamp, valueBuffer, numValues);
final byte[] header = valueBuffer.readPrefixedBytes();
AgentStatHeaderDecoder headerDecoder = new BitCountingHeaderDecoder(header);
EncodingStrategy<Short> versionEncodingStrategy = UnsignedShortEncodingStrategy.getFromCode(headerDecoder.getCode());
EncodingStrategy<Integer> schemaTypeEncodingStrategy = UnsignedIntegerEncodingStrategy.getFromCode(headerDecoder.getCode());
JoinIntFieldEncodingStrategy totalCountJoinIntValueEncodingStrategy = JoinIntFieldEncodingStrategy.getFromCode(headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode(), headerDecoder.getCode());
List<Short> versionList = this.codec.decodeValues(valueBuffer, versionEncodingStrategy, numValues);
List<Integer> schemaTypeList = this.codec.decodeValues(valueBuffer, schemaTypeEncodingStrategy, numValues);
List<JoinIntFieldBo> totalCountJoinIntValueList = this.codec.decodeValues(valueBuffer, totalCountJoinIntValueEncodingStrategy, numValues);
List<JoinStatBo> joinActiveTraceBoList = new ArrayList<>();
for (int i = 0; i < numValues; i++) {
JoinActiveTraceBo joinActiveTraceBo = new JoinActiveTraceBo();
joinActiveTraceBo.setId(id);
joinActiveTraceBo.setVersion(versionList.get(i));
joinActiveTraceBo.setTimestamp(timestampList.get(i));
joinActiveTraceBo.setHistogramSchemaType(schemaTypeList.get(i));
joinActiveTraceBo.setTotalCountJoinValue(totalCountJoinIntValueList.get(i));
joinActiveTraceBoList.add(joinActiveTraceBo);
}
return joinActiveTraceBoList;
}
Aggregations