diff --git a/src/main/java/com/profiler/server/dao/HbaseJvmInfoDao.java b/src/main/java/com/profiler/server/dao/HbaseJvmInfoDao.java index 24085b41b..807fc8527 100644 --- a/src/main/java/com/profiler/server/dao/HbaseJvmInfoDao.java +++ b/src/main/java/com/profiler/server/dao/HbaseJvmInfoDao.java @@ -3,6 +3,8 @@ package com.profiler.server.dao; import com.profiler.common.dto.thrift.JVMInfoThriftDTO; import com.profiler.common.hbase.HbaseOperations2; +import com.profiler.common.util.RowKeyUtils; +import com.profiler.common.util.SpanUtils; import org.apache.hadoop.hbase.client.Put; import org.apache.hadoop.hbase.util.Bytes; import org.springframework.beans.factory.annotation.Autowired; @@ -30,13 +32,9 @@ public class HbaseJvmInfoDao implements JvmInfoDao { byte[] getRowKey(JVMInfoThriftDTO jvmInfoThriftDTO) { String agentId = jvmInfoThriftDTO.getAgentId(); // agentId의 제한 필요? + // 24byte byte[] agnetIdBytes = Bytes.toBytes(agentId); - long currentTime = jvmInfoThriftDTO.getDataTime(); - - byte[] buffer = new byte[agnetIdBytes.length + 8]; - Bytes.putBytes(buffer, 0, agnetIdBytes, 0, agnetIdBytes.length); - Bytes.putLong(buffer, agnetIdBytes.length, currentTime); - return buffer; + return RowKeyUtils.concatFixedByteAndLong(agnetIdBytes, SpanUtils.AGENT_NAME_LIMIT, currentTime); } }