Search in sources :

Example 11 with AgentLifeCycleBo

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

the class AgentLifeCycleMapper method createAgentLifeCycleBo.

private AgentLifeCycleBo createAgentLifeCycleBo(Cell valueCell) {
    if (valueCell == null) {
        return null;
    }
    byte[] value = CellUtil.cloneValue(valueCell);
    final Buffer buffer = new FixedBuffer(value);
    final int version = buffer.readInt();
    switch(version) {
        case 0:
            final String agentId = buffer.readPrefixedString();
            final long startTimestamp = buffer.readLong();
            final long eventTimestamp = buffer.readLong();
            final long eventIdentifier = buffer.readLong();
            final AgentLifeCycleState agentLifeCycleState = AgentLifeCycleState.getStateByCode(buffer.readShort());
            final AgentLifeCycleBo agentLifeCycleBo = new AgentLifeCycleBo(agentId, startTimestamp, eventTimestamp, eventIdentifier, agentLifeCycleState);
            return agentLifeCycleBo;
        default:
            return null;
    }
}
Also used : FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) Buffer(com.navercorp.pinpoint.common.buffer.Buffer) FixedBuffer(com.navercorp.pinpoint.common.buffer.FixedBuffer) AgentLifeCycleBo(com.navercorp.pinpoint.common.server.bo.AgentLifeCycleBo) AgentLifeCycleState(com.navercorp.pinpoint.common.server.util.AgentLifeCycleState)

Aggregations

AgentLifeCycleBo (com.navercorp.pinpoint.common.server.bo.AgentLifeCycleBo)11 Scan (org.apache.hadoop.hbase.client.Scan)8 AgentLifeCycleState (com.navercorp.pinpoint.common.server.util.AgentLifeCycleState)7 AgentStatus (com.navercorp.pinpoint.web.vo.AgentStatus)7 ResultsExtractor (com.navercorp.pinpoint.common.hbase.ResultsExtractor)5 TableName (org.apache.hadoop.hbase.TableName)5 Test (org.junit.Test)5 AgentInfo (com.navercorp.pinpoint.web.vo.AgentInfo)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)1 FixedBuffer (com.navercorp.pinpoint.common.buffer.FixedBuffer)1 ArrayList (java.util.ArrayList)1