You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use int for number of parts in blob store (#61618)
Today we use `long` to represent the number of parts of a blob. There's
no need for this extra range, it forces us to do some casting elsewhere,
and indeed when snapshotting we iterate over the parts using an `int`
which would be an infinite loop in case of overflow anyway:
for (int i = 0; i < fileInfo.numberOfParts(); i++) {
This commit changes the representation of the number of parts of a blob
to an `int`.
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/SearchableSnapshotDirectory.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/cache/CachedBlobContainerIndexInput.java
+13-13
Original file line number
Diff line number
Diff line change
@@ -655,23 +655,23 @@ private InputStream openInputStreamFromBlobStore(final long position, final long
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/direct/DirectBlobContainerIndexInput.java
Copy file name to clipboardExpand all lines: x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/direct/DirectBlobContainerIndexInputTests.java
+3-3
Original file line number
Diff line number
Diff line change
@@ -79,18 +79,18 @@ private DirectBlobContainerIndexInput createIndexInput(final byte[] input, long
79
79
onReadBlob.run();
80
80
81
81
finalInputStreamstream;
82
-
if (fileInfo.numberOfParts() == 1L) {
82
+
if (fileInfo.numberOfParts() == 1) {
83
83
assertThat("Unexpected blob name [" + name + "]", name, equalTo(fileInfo.name()));
0 commit comments