Browse Source

Remove more //NORELEASE (#57517)

We agreed on removing the following //NORELEASE tags.
Tanguy Leroux 5 years ago
parent
commit
34e253558d

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

@@ -112,6 +112,11 @@ public class URLBlobContainer extends AbstractBlobContainer {
         }
     }
 
+    @Override
+    public InputStream readBlob(String blobName, long position, long length) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
     @Override
     public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
         throw new UnsupportedOperationException("URL repository doesn't support this operation");

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

@@ -105,6 +105,11 @@ final class HdfsBlobContainer extends AbstractBlobContainer {
         }
     }
 
+    @Override
+    public InputStream readBlob(String blobName, long position, long length) throws IOException {
+        throw new UnsupportedOperationException();
+    }
+
     @Override
     public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
         store.execute((Operation<Void>) fileContext -> {

+ 1 - 3
server/src/main/java/org/elasticsearch/common/blobstore/BlobContainer.java

@@ -61,9 +61,7 @@ public interface BlobContainer {
      * @throws NoSuchFileException if the blob does not exist
      * @throws IOException         if the blob can not be read.
      */
-    default InputStream readBlob(final String blobName, final long position, final long length) throws IOException {
-        throw new UnsupportedOperationException(); // NORELEASE
-    }
+    InputStream readBlob(String blobName, long position, long length) throws IOException;
 
     /**
      * Provides a hint to clients for a suitable length to use with {@link BlobContainer#readBlob(String, long, long)}.

+ 10 - 0
server/src/test/java/org/elasticsearch/snapshots/mockstore/MockEventuallyConsistentRepository.java

@@ -30,6 +30,7 @@ import org.elasticsearch.common.blobstore.BlobStore;
 import org.elasticsearch.common.blobstore.DeleteResult;
 import org.elasticsearch.common.blobstore.support.PlainBlobMetadata;
 import org.elasticsearch.common.bytes.BytesArray;
+import org.elasticsearch.common.io.Streams;
 import org.elasticsearch.common.util.Maps;
 import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
 import org.elasticsearch.common.xcontent.NamedXContentRegistry;
@@ -205,6 +206,15 @@ public class MockEventuallyConsistentRepository extends BlobStoreRepository {
                 }
             }
 
+            @Override
+            public InputStream readBlob(String blobName, long position, long length) throws IOException {
+                final InputStream stream = readBlob(blobName);
+                if (position > 0) {
+                    stream.skip(position);
+                }
+                return Streams.limitStream(stream, length);
+            }
+
             private List<BlobStoreAction> relevantActions(String blobPath) {
                 assert Thread.holdsLock(context.actions);
                 final List<BlobStoreAction> relevantActions = new ArrayList<>(

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

@@ -139,10 +139,6 @@ public abstract class BaseSearchableSnapshotIndexInput extends BufferedIndexInpu
             // Cache prewarming runs on a dedicated thread pool.
             || threadName.contains('[' + SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOTS_THREAD_POOL_NAME + ']')
 
-            // Today processExistingRecoveries considers all shards and constructs a shard store snapshot on this thread, this needs
-            // addressing. TODO NORELEASE
-            || threadName.contains('[' + ThreadPool.Names.FETCH_SHARD_STORE + ']')
-
             // Unit tests access the blob store on the main test thread; simplest just to permit this rather than have them override this
             // method somehow.
             || threadName.startsWith("TEST-")

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

@@ -154,9 +154,10 @@ public class TransportMountSearchableSnapshotAction extends TransportMasterNodeA
             }
             final SnapshotId snapshotId = matchingSnapshotId.get();
 
+            // TODO validate IDs in the restore:
             // We must fail the restore if it obtains different IDs from the ones we just obtained (e.g. the target snapshot was replaced
             // 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
-            // searching. TODO NORELEASE validate IDs in the restore.
+            // searching.
 
             client.admin()
                 .cluster()

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

@@ -157,6 +157,11 @@ public final class TestUtils {
             throw unsupportedException();
         }
 
+        @Override
+        public InputStream readBlob(String blobName, long position, long length) throws IOException {
+            throw unsupportedException();
+        }
+
         @Override
         public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) {
             throw unsupportedException();