Skip to content

Commit

Permalink
Fix precommit failures
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <[email protected]>
  • Loading branch information
Sachin Kale committed Sep 2, 2024
1 parent 54d54e8 commit c2b9b8e
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import java.io.Closeable;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.function.Supplier;
Expand Down Expand Up @@ -115,6 +116,7 @@ public void pinTimestamp(long timestamp, String pinningEntity, ActionListener<Vo
long elapsedTime = System.nanoTime() - startTime;
if (elapsedTime > RemoteStoreSettings.getPinnedTimestampsLookbackInterval().nanos()) {
String errorMessage = String.format(
Locale.ROOT,
"Timestamp pinning took %s nanoseconds which is more than limit of %s nanoseconds, failing the operation",
elapsedTime,
RemoteStoreSettings.getPinnedTimestampsLookbackInterval().nanos()
Expand Down Expand Up @@ -157,7 +159,12 @@ public void cloneTimestamp(long timestamp, String existingPinningEntity, String
blobContainer.writeBlob(getBlobName(timestamp, newPinningEntity), new ByteArrayInputStream(new byte[0]), 0, true);
listener.onResponse(null);
} else {
String errorMessage = String.format("Timestamp: %s is not pinned by existing entity: %s", timestamp, existingPinningEntity);
String errorMessage = String.format(
Locale.ROOT,
"Timestamp: %s is not pinned by existing entity: %s",
timestamp,
existingPinningEntity
);
listener.onFailure(new IllegalArgumentException(errorMessage));
}
} catch (IOException e) {
Expand Down Expand Up @@ -197,7 +204,7 @@ public void unpinTimestamp(long timestamp, String pinningEntity, ActionListener<
blobContainer.deleteBlobsIgnoringIfNotExists(List.of(blobName));
listener.onResponse(null);
} else {
String errorMessage = String.format("Timestamp: %s is not pinned by entity: %s", timestamp, pinningEntity);
String errorMessage = String.format(Locale.ROOT, "Timestamp: %s is not pinned by entity: %s", timestamp, pinningEntity);
listener.onFailure(new IllegalArgumentException(errorMessage));
}
} catch (IOException e) {
Expand Down

0 comments on commit c2b9b8e

Please sign in to comment.