-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#12081] Remove commons-buffer from Agent module
- Loading branch information
Showing
12 changed files
with
132 additions
and
174 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 0 additions & 49 deletions
49
...t-module/profiler/src/main/java/com/navercorp/pinpoint/profiler/util/ByteBufferUtils.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...s-server/src/main/java/com/navercorp/pinpoint/common/server/util/TransactionIdParser.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package com.navercorp.pinpoint.common.server.util; | ||
|
||
import com.navercorp.pinpoint.common.buffer.Buffer; | ||
import com.navercorp.pinpoint.common.buffer.FixedBuffer; | ||
import com.navercorp.pinpoint.common.profiler.util.TransactionId; | ||
import com.navercorp.pinpoint.common.profiler.util.TransactionIdUtils; | ||
import com.navercorp.pinpoint.common.util.IdValidateUtils; | ||
import com.navercorp.pinpoint.common.util.StringUtils; | ||
|
||
import java.util.Arrays; | ||
import java.util.Objects; | ||
|
||
public class TransactionIdParser { | ||
|
||
public static TransactionId parse(final byte[] transactionId, String defaultAgentId) { | ||
Objects.requireNonNull(transactionId, "transactionId"); | ||
|
||
final Buffer buffer = new FixedBuffer(transactionId); | ||
final byte version = buffer.readByte(); | ||
if (version != TransactionIdUtils.VERSION) { | ||
throw new IllegalArgumentException("invalid Version"); | ||
} | ||
|
||
String agentId = buffer.readPrefixedString(); | ||
agentId = StringUtils.defaultString(agentId, defaultAgentId); | ||
if (!IdValidateUtils.validateId(agentId)) { | ||
throw new IllegalArgumentException("invalid transactionId:" + Arrays.toString(transactionId)); | ||
} | ||
|
||
final long agentStartTime = buffer.readVLong(); | ||
final long transactionSequence = buffer.readVLong(); | ||
|
||
return TransactionId.of(agentId, agentStartTime,transactionSequence); | ||
} | ||
|
||
} |
Oops, something went wrong.