Remove more //NORELEASE (#57517)

We agreed on removing the following //NORELEASE tags.
This commit is contained in:
Tanguy Leroux 2020-06-05 15:19:38 +02:00
parent b03a83a69d
commit 0e57528d5d
7 changed files with 28 additions and 8 deletions

View File

@ -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 @Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException { public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
throw new UnsupportedOperationException("URL repository doesn't support this operation"); throw new UnsupportedOperationException("URL repository doesn't support this operation");

View File

@ -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 @Override
public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException { public void writeBlob(String blobName, InputStream inputStream, long blobSize, boolean failIfAlreadyExists) throws IOException {
store.execute((Operation<Void>) fileContext -> { store.execute((Operation<Void>) fileContext -> {

View File

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

View File

@ -30,6 +30,7 @@ import org.elasticsearch.common.blobstore.BlobStore;
import org.elasticsearch.common.blobstore.DeleteResult; import org.elasticsearch.common.blobstore.DeleteResult;
import org.elasticsearch.common.blobstore.support.PlainBlobMetadata; import org.elasticsearch.common.blobstore.support.PlainBlobMetadata;
import org.elasticsearch.common.bytes.BytesArray; import org.elasticsearch.common.bytes.BytesArray;
import org.elasticsearch.common.io.Streams;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentHelper; import org.elasticsearch.common.xcontent.XContentHelper;
@ -210,6 +211,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) { private List<BlobStoreAction> relevantActions(String blobPath) {
assert Thread.holdsLock(context.actions); assert Thread.holdsLock(context.actions);
final List<BlobStoreAction> relevantActions = new ArrayList<>( final List<BlobStoreAction> relevantActions = new ArrayList<>(

View File

@ -139,10 +139,6 @@ public abstract class BaseSearchableSnapshotIndexInput extends BufferedIndexInpu
// Cache prewarming runs on a dedicated thread pool. // Cache prewarming runs on a dedicated thread pool.
|| threadName.contains('[' + SearchableSnapshotsConstants.SEARCHABLE_SNAPSHOTS_THREAD_POOL_NAME + ']') || 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 // Unit tests access the blob store on the main test thread; simplest just to permit this rather than have them override this
// method somehow. // method somehow.
|| threadName.startsWith("TEST-") || threadName.startsWith("TEST-")

View File

@ -152,9 +152,10 @@ public class TransportMountSearchableSnapshotAction extends TransportMasterNodeA
} }
final SnapshotId snapshotId = matchingSnapshotId.get(); 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 // 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 // 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() client.admin()
.cluster() .cluster()

View File

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