Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#noissue] Cleanup #10182

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public MetaDataRowKey decodeRowKey(byte[] rowkey) {
}

private String readAgentId(byte[] rowKey) {
return BytesUtils.safeTrim(BytesUtils.toString(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN));
return BytesUtils.toStringAndRightTrim(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN);
}

private long readAgentStartTime(byte[] rowKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

private String readAgentId(byte[] rowKey) {
return BytesUtils.safeTrim(BytesUtils.toString(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN));
return BytesUtils.toStringAndRightTrim(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN);

Check warning on line 22 in commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/metadata/uid/UidMetadataDecoder.java

View check run for this annotation

Codecov / codecov/patch

commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/metadata/uid/UidMetadataDecoder.java#L22

Added line #L22 was not covered by tests
}

private long readAgentStartTime(byte[] rowKey) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class AgentStatRowKeyDecoder implements RowKeyDecoder<AgentStatRowKeyComp

@Override
public AgentStatRowKeyComponent decodeRowKey(byte[] rowkey) {
final String agentId = BytesUtils.safeTrim(BytesUtils.toString(rowkey, 0, AGENT_ID_MAX_LEN));
final String agentId = BytesUtils.toStringAndRightTrim(rowkey, 0, AGENT_ID_MAX_LEN);
final AgentStatType agentStatType = AgentStatType.fromTypeCode(rowkey[AGENT_ID_MAX_LEN]);
final long reversedBaseTimestamp = BytesUtils.bytesToLong(rowkey, AGENT_ID_MAX_LEN + TYPE_CODE_BYTE_LENGTH);
final long baseTimestamp = TimeUtils.recoveryTimeMillis(reversedBaseTimestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

@Override
public ApplicationStatRowKeyComponent decodeRowKey(byte[] rowkey) {
final String applicationId = BytesUtils.safeTrim(BytesUtils.toString(rowkey, 0, APPLICATION_NAME_MAX_LEN));
final String applicationId = BytesUtils.toStringAndRightTrim(rowkey, 0, APPLICATION_NAME_MAX_LEN);

Check warning on line 34 in commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/stat/ApplicationStatRowKeyDecoder.java

View check run for this annotation

Codecov / codecov/patch

commons-server/src/main/java/com/navercorp/pinpoint/common/server/bo/serializer/stat/ApplicationStatRowKeyDecoder.java#L34

Added line #L34 was not covered by tests
final StatType statType = StatType.fromTypeCode(rowkey[APPLICATION_NAME_MAX_LEN]);
final long reversedBaseTimestamp = BytesUtils.bytesToLong(rowkey, APPLICATION_NAME_MAX_LEN + TYPE_CODE_BYTE_LENGTH);
final long baseTimestamp = TimeUtils.recoveryTimeMillis(reversedBaseTimestamp);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
@Override
public AgentInfoBo mapRow(Result result, int rowNum) throws Exception {
byte[] rowKey = result.getRow();
String agentId = BytesUtils.safeTrim(BytesUtils.toString(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN));
String agentId = BytesUtils.toStringAndRightTrim(rowKey, 0, PinpointConstants.AGENT_ID_MAX_LEN);

Check warning on line 44 in commons-server/src/main/java/com/navercorp/pinpoint/common/server/dao/hbase/mapper/AgentInfoBoMapper.java

View check run for this annotation

Codecov / codecov/patch

commons-server/src/main/java/com/navercorp/pinpoint/common/server/dao/hbase/mapper/AgentInfoBoMapper.java#L44

Added line #L44 was not covered by tests
long reverseStartTime = BytesUtils.bytesToLong(rowKey, HbaseTableConstants.AGENT_ID_MAX_LEN);
long startTime = TimeUtils.recoveryTimeMillis(reverseStartTime);

Expand Down