Skip to content

Commit 34e2535

Browse files
authored
Remove more //NORELEASE (#57517)
We agreed on removing the following //NORELEASE tags.
1 parent 51e3d5a commit 34e2535

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

modules/repository-url/src/main/java/org/elasticsearch/common/blobstore/url/URLBlobContainer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ public InputStream readBlob(String name) throws IOException {
112112
}
113113
}
114114

115+
@Override
116+
public InputStream readBlob(String blobName, long position, long length) throws IOException {
117+
throw new UnsupportedOperationException();
118+
}
119+
115120
@Override
116121
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
117122
throw new UnsupportedOperationException("URL repository doesn't support this operation");

plugins/repository-hdfs/src/main/java/org/elasticsearch/repositories/hdfs/HdfsBlobContainer.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ public InputStream readBlob(String blobName) throws IOException {
105105
}
106106
}
107107

108+
@Override
109+
public InputStream readBlob(String blobName, long position, long length) throws IOException {
110+
throw new UnsupportedOperationException();
111+
}
112+
108113
@Override
109114
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
110115
store.execute((Operation<Void>) fileContext -> {

server/src/main/java/org/elasticsearch/common/blobstore/BlobContainer.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ public interface BlobContainer {
6161
* @throws NoSuchFileException if the blob does not exist
6262
* @throws IOException if the blob can not be read.
6363
*/
64-
default InputStream readBlob(final String blobName, final long position, final long length) throws IOException {
65-
throw new UnsupportedOperationException(); // NORELEASE
66-
}
64+
InputStream readBlob(String blobName, long position, long length) throws IOException;
6765

6866
/**
6967
* Provides a hint to clients for a suitable length to use with {@link BlobContainer#readBlob(String, long, long)}.

server/src/test/java/org/elasticsearch/snapshots/mockstore/MockEventuallyConsistentRepository.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import org.elasticsearch.common.blobstore.DeleteResult;
3131
import org.elasticsearch.common.blobstore.support.PlainBlobMetadata;
3232
import org.elasticsearch.common.bytes.BytesArray;
33+
import org.elasticsearch.common.io.Streams;
3334
import org.elasticsearch.common.util.Maps;
3435
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
3536
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -205,6 +206,15 @@ public InputStream readBlob(String name) throws NoSuchFileException {
205206
}
206207
}
207208

209+
@Override
210+
public InputStream readBlob(String blobName, long position, long length) throws IOException {
211+
final InputStream stream = readBlob(blobName);
212+
if (position > 0) {
213+
stream.skip(position);
214+
}
215+
return Streams.limitStream(stream, length);
216+
}
217+
208218
private List<BlobStoreAction> relevantActions(String blobPath) {
209219
assert Thread.holdsLock(context.actions);
210220
final List<BlobStoreAction> relevantActions = new ArrayList<>(

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/index/store/BaseSearchableSnapshotIndexInput.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,6 @@ protected final boolean assertCurrentThreadMayAccessBlobStore() {
139139
// Cache prewarming runs on a dedicated thread pool.
140140
|| threadName.contains('[' + SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOTS_THREAD_POOL_NAME + ']')
141141

142-
// Today processExistingRecoveries considers all shards and constructs a shard store snapshot on this thread, this needs
143-
// addressing. TODO NORELEASE
144-
|| threadName.contains('[' + ThreadPool.Names.FETCH_SHARD_STORE + ']')
145-
146142
// Unit tests access the blob store on the main test thread; simplest just to permit this rather than have them override this
147143
// method somehow.
148144
|| threadName.startsWith("TEST-")

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,10 @@ protected void masterOperation(
154154
}
155155
final SnapshotId snapshotId = matchingSnapshotId.get();
156156

157+
// TODO validate IDs in the restore:
157158
// We must fail the restore if it obtains different IDs from the ones we just obtained (e.g. the target snapshot was replaced
158159
// by one with the same name while we are restoring it) or else the index metadata might bear no relation to the snapshot we're
159-
// searching. TODO NORELEASE validate IDs in the restore.
160+
// searching.
160161

161162
client.admin()
162163
.cluster()

x-pack/plugin/searchable-snapshots/src/test/java/org/elasticsearch/index/store/cache/TestUtils.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,11 @@ public InputStream readBlob(String blobName) {
157157
throw unsupportedException();
158158
}
159159

160+
@Override
161+
public InputStream readBlob(String blobName, long position, long length) throws IOException {
162+
throw unsupportedException();
163+
}
164+
160165
@Override
161166
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) {
162167
throw unsupportedException();

0 commit comments

Comments
 (0)