Skip to content

Commit 8eaf934

Browse files
committed
rename shared extstore hashing utilities to PayloadHasher.
1 parent ec8a056 commit 8eaf934

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

contrib/temporal-payload-storage-s3/src/main/java/io/temporal/payload/storage/s3/CompletableFutures.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ private CompletableFutures() {}
1010
/**
1111
* Returns a future that completes when all of the given futures complete, yielding a list of
1212
* their results. If any future completes exceptionally, the returned future also completes
13-
* exceptionally with the same exception. If the input list is empty, the returned future completes
14-
* immediately with an empty list.
13+
* exceptionally with the same exception. If the input list is empty, the returned future
14+
* completes immediately with an empty list.
1515
*
1616
* @param <T>
1717
* @param futures

contrib/temporal-payload-storage-s3/src/main/java/io/temporal/payload/storage/s3/S3StorageDriver.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.google.protobuf.InvalidProtocolBufferException;
44
import io.temporal.api.common.v1.Payload;
55
import io.temporal.common.Experimental;
6-
import io.temporal.payload.storage.PayloadStorageHashes;
6+
import io.temporal.payload.storage.PayloadHasher;
77
import io.temporal.payload.storage.StorageDriver;
88
import io.temporal.payload.storage.StorageDriverClaim;
99
import io.temporal.payload.storage.StorageDriverRetrieveContext;
@@ -86,7 +86,7 @@ public CompletableFuture<List<StorageDriverClaim>> store(
8686
List<CompletableFuture<StorageDriverClaim>> claimFutures = new ArrayList<>(payloads.size());
8787
for (Payload payload : payloads) {
8888
byte[] data = payload.toByteArray();
89-
String hexDigest = PayloadStorageHashes.sha256Hex(data);
89+
String hexDigest = PayloadHasher.sha256Hex(data);
9090
String bucket = bucketResolver.resolveBucket(context, payload);
9191
String key = S3StorageKey.forPayload(target, HASH_ALGORITHM, hexDigest);
9292
String location = storageLocation(bucket, key, describeSuffix);
@@ -152,7 +152,7 @@ private Payload verifyAndParse(
152152
if (expectedHash == null) {
153153
throw missingField(CLAIM_HASH_VALUE);
154154
}
155-
String actualHash = PayloadStorageHashes.sha256Hex(data);
155+
String actualHash = PayloadHasher.sha256Hex(data);
156156
if (!actualHash.equals(expectedHash)) {
157157
throw new S3StorageException(
158158
"integrity check failed [bucket="

temporal-sdk/src/main/java/io/temporal/payload/storage/PayloadStorageHashes.java renamed to temporal-sdk/src/main/java/io/temporal/payload/storage/PayloadHasher.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
import java.security.NoSuchAlgorithmException;
66
import javax.annotation.Nonnull;
77

8-
/** Hash helpers shared by external storage drivers. */
8+
/** Computes payload hashes shared by external storage drivers. */
99
@Experimental
10-
public final class PayloadStorageHashes {
10+
public final class PayloadHasher {
1111
private static final char[] HEX = "0123456789abcdef".toCharArray();
1212

13-
private PayloadStorageHashes() {}
13+
private PayloadHasher() {}
1414

1515
/** Returns the lower-case SHA-256 hex digest of {@code data}. */
1616
@Nonnull

0 commit comments

Comments
 (0)