Search in sources :

Example 6 with ApiMetaDataBo

use of com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo in project pinpoint by naver.

the class HbaseApiMetaDataDao method getApiMetaData.

@Override
@Cacheable(value = "apiMetaData", key = SPEL_KEY)
public List<ApiMetaDataBo> getApiMetaData(String agentId, long time, int apiId) {
    if (agentId == null) {
        throw new NullPointerException("agentId must not be null");
    }
    ApiMetaDataBo apiMetaDataBo = new ApiMetaDataBo(agentId, time, apiId);
    byte[] sqlId = getDistributedKey(apiMetaDataBo.toRowKey());
    Get get = new Get(sqlId);
    get.addFamily(HBaseTables.API_METADATA_CF_API);
    return hbaseOperations2.get(HBaseTables.API_METADATA, get, apiMetaDataMapper);
}
Also used : Get(org.apache.hadoop.hbase.client.Get) ApiMetaDataBo(com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo) Cacheable(org.springframework.cache.annotation.Cacheable)

Example 7 with ApiMetaDataBo

use of com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo in project pinpoint by naver.

the class CorruptedSpanAlignFactory method get.

public SpanAlign get(final String title, final SpanBo span, final SpanEventBo spanEvent) {
    final SpanEventBo missedEvent = new SpanEventBo();
    // TODO use invalid event information ?
    missedEvent.setStartElapsed(spanEvent.getStartElapsed());
    missedEvent.setEndElapsed(spanEvent.getEndElapsed());
    missedEvent.setServiceType(ServiceType.COLLECTOR.getCode());
    List<AnnotationBo> annotations = new ArrayList<>();
    ApiMetaDataBo apiMetaData = new ApiMetaDataBo();
    apiMetaData.setLineNumber(-1);
    apiMetaData.setApiInfo("...");
    apiMetaData.setMethodTypeEnum(MethodTypeEnum.CORRUPTED);
    final AnnotationBo apiMetaDataAnnotation = new AnnotationBo();
    apiMetaDataAnnotation.setKey(AnnotationKey.API_METADATA.getCode());
    apiMetaDataAnnotation.setValue(apiMetaData);
    annotations.add(apiMetaDataAnnotation);
    final AnnotationBo argumentAnnotation = new AnnotationBo();
    argumentAnnotation.setKey(AnnotationKeyUtils.getArgs(0).getCode());
    if (System.currentTimeMillis() - span.getStartTime() < timeoutMillisec) {
        argumentAnnotation.setValue("Corrupted(waiting for packet) ");
    } else {
        if (title != null) {
            argumentAnnotation.setValue("Corrupted(" + title + ")");
        } else {
            argumentAnnotation.setValue("Corrupted");
        }
    }
    annotations.add(argumentAnnotation);
    missedEvent.setAnnotationBoList(annotations);
    return new SpanAlign(span, missedEvent);
}
Also used : AnnotationBo(com.navercorp.pinpoint.common.server.bo.AnnotationBo) ArrayList(java.util.ArrayList) ApiMetaDataBo(com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo) SpanEventBo(com.navercorp.pinpoint.common.server.bo.SpanEventBo)

Aggregations

ApiMetaDataBo (com.navercorp.pinpoint.common.server.bo.ApiMetaDataBo)7 AnnotationBo (com.navercorp.pinpoint.common.server.bo.AnnotationBo)3 ArrayList (java.util.ArrayList)3 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)2 AutomaticBuffer (com.navercorp.pinpoint.common.buffer.AutomaticBuffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 MethodTypeEnum (com.navercorp.pinpoint.common.server.bo.MethodTypeEnum)1 SpanEventBo (com.navercorp.pinpoint.common.server.bo.SpanEventBo)1 AnnotationKey (com.navercorp.pinpoint.common.trace.AnnotationKey)1 ApiDescription (com.navercorp.pinpoint.common.util.ApiDescription)1 SpanAlign (com.navercorp.pinpoint.web.calltree.span.SpanAlign)1 List (java.util.List)1 Cell (org.apache.hadoop.hbase.Cell)1 Get (org.apache.hadoop.hbase.client.Get)1 Put (org.apache.hadoop.hbase.client.Put)1 Cacheable (org.springframework.cache.annotation.Cacheable)1