Skip to content

Commit 55b91cd

Browse files
author
Ali Beyad
committed
Removes unused test helper method to write old blob store format
1 parent 99734ec commit 55b91cd

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

core/src/test/java/org/elasticsearch/repositories/blobstore/BlobStoreRepositoryTests.java

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@
2323
import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
2424
import org.elasticsearch.client.Client;
2525
import org.elasticsearch.common.UUIDs;
26-
import org.elasticsearch.common.bytes.BytesReference;
27-
import org.elasticsearch.common.io.stream.BytesStreamOutput;
28-
import org.elasticsearch.common.io.stream.OutputStreamStreamOutput;
29-
import org.elasticsearch.common.io.stream.StreamInput;
30-
import org.elasticsearch.common.io.stream.StreamOutput;
3126
import org.elasticsearch.common.settings.Settings;
32-
import org.elasticsearch.common.xcontent.XContentBuilder;
33-
import org.elasticsearch.common.xcontent.XContentFactory;
34-
import org.elasticsearch.common.xcontent.XContentType;
3527
import org.elasticsearch.repositories.RepositoriesService;
3628
import org.elasticsearch.repositories.RepositoryData;
3729
import org.elasticsearch.snapshots.SnapshotId;
@@ -178,25 +170,4 @@ private BlobStoreRepository setupRepo() {
178170
return repository;
179171
}
180172

181-
private void writeOldFormat(final BlobStoreRepository repository, final List<String> snapshotNames) throws Exception {
182-
final BytesReference bRef;
183-
try (BytesStreamOutput bStream = new BytesStreamOutput()) {
184-
try (StreamOutput stream = new OutputStreamStreamOutput(bStream)) {
185-
XContentBuilder builder = XContentFactory.contentBuilder(XContentType.JSON, stream);
186-
builder.startObject();
187-
builder.startArray("snapshots");
188-
for (final String snapshotName : snapshotNames) {
189-
builder.value(snapshotName);
190-
}
191-
builder.endArray();
192-
builder.endObject();
193-
builder.close();
194-
}
195-
bRef = bStream.bytes();
196-
}
197-
try (StreamInput stream = bRef.streamInput()) {
198-
repository.blobContainer().writeBlob(BlobStoreRepository.SNAPSHOTS_FILE, stream, bRef.length()); // write to index file
199-
}
200-
}
201-
202173
}

0 commit comments

Comments
 (0)