Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
JNSimba committed Dec 2, 2024
1 parent 24c1bf5 commit 4284446
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ public String generateTableLabel(long chkId) {
Preconditions.checkState(tableIdentifier != null);
String label = String.format("%s_%s_%s_%s", labelPrefix, tableIdentifier, subtaskId, chkId);

String uuid = UUID.randomUUID().toString().replace("-", "");
if (!enable2PC) {
label = label + "_" + uuid;
label = label + "_" + UUID.randomUUID();
}

if (LABEL_PATTERN.matcher(label).matches()) {
Expand All @@ -69,14 +68,14 @@ public String generateTableLabel(long chkId) {
// In 2pc, replace uuid with the table name. This will cause some txns to fail to be
// aborted when aborting.
// Later, the label needs to be stored in the state and aborted through label
return String.format("%s_%s_%s_%s", labelPrefix, uuid, subtaskId, chkId);
return String.format("%s_%s_%s_%s", labelPrefix, UUID.randomUUID(), subtaskId, chkId);
} else {
return String.format("%s_%s_%s_%s", labelPrefix, subtaskId, chkId, uuid);
return String.format("%s_%s_%s_%s", labelPrefix, subtaskId, chkId, UUID.randomUUID());
}
}

public String generateBatchLabel(String table) {
String uuid = UUID.randomUUID().toString().replace("-", "");
String uuid = UUID.randomUUID().toString();
String label = String.format("%s_%s_%s", labelPrefix, table, uuid);
if (!LABEL_PATTERN.matcher(label).matches()) {
return labelPrefix + "_" + uuid;
Expand Down

0 comments on commit 4284446

Please sign in to comment.