Skip to content

Commit

Permalink
Remove more //NORELEASE (#57517)
Browse files Browse the repository at this point in the history
We agreed on removing the following //NORELEASE tags.
  • Loading branch information
tlrx committed Jun 5, 2020
1 parent 87831fb commit 7ccd056
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ public InputStream readBlob(String name) throws IOException {
}
}

@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");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ public InputStream readBlob(String blobName) throws IOException {
}
}

@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 -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
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.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContentHelper;
Expand Down Expand Up @@ -210,6 +211,15 @@ public InputStream readBlob(String name) throws NoSuchFileException {
}
}

@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<>(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,6 @@ protected final boolean assertCurrentThreadMayAccessBlobStore() {
// 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-")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,10 @@ protected void masterOperation(
}
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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ public InputStream readBlob(String blobName) {
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();
Expand Down

0 comments on commit 7ccd056

Please sign in to comment.