Skip to content

Commit 7ccd056

Browse files
committed
Remove more //NORELEASE (elastic#57517)
We agreed on removing the following //NORELEASE tags.
1 parent 87831fb commit 7ccd056

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.xcontent.LoggingDeprecationHandler;
3435
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
3536
import org.elasticsearch.common.xcontent.XContentHelper;
@@ -210,6 +211,15 @@ public InputStream readBlob(String name) throws NoSuchFileException {
210211
}
211212
}
212213

214+
@Override
215+
public InputStream readBlob(String blobName, long position, long length) throws IOException {
216+
final InputStream stream = readBlob(blobName);
217+
if (position > 0) {
218+
stream.skip(position);
219+
}
220+
return Streams.limitStream(stream, length);
221+
}
222+
213223
private List<BlobStoreAction> relevantActions(String blobPath) {
214224
assert Thread.holdsLock(context.actions);
215225
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
@@ -152,9 +152,10 @@ protected void masterOperation(
152152
}
153153
final SnapshotId snapshotId = matchingSnapshotId.get();
154154

155+
// TODO validate IDs in the restore:
155156
// We must fail the restore if it obtains different IDs from the ones we just obtained (e.g. the target snapshot was replaced
156157
// 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
157-
// searching. TODO NORELEASE validate IDs in the restore.
158+
// searching.
158159

159160
client.admin()
160161
.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
@@ -158,6 +158,11 @@ public InputStream readBlob(String blobName) {
158158
throw unsupportedException();
159159
}
160160

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

0 commit comments

Comments
 (0)