|
23 | 23 | import org.elasticsearch.action.admin.cluster.snapshots.create.CreateSnapshotResponse;
|
24 | 24 | import org.elasticsearch.client.Client;
|
25 | 25 | 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; |
31 | 26 | 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; |
35 | 27 | import org.elasticsearch.repositories.RepositoriesService;
|
36 | 28 | import org.elasticsearch.repositories.RepositoryData;
|
37 | 29 | import org.elasticsearch.snapshots.SnapshotId;
|
@@ -178,25 +170,4 @@ private BlobStoreRepository setupRepo() {
|
178 | 170 | return repository;
|
179 | 171 | }
|
180 | 172 |
|
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 |
| - |
202 | 173 | }
|
0 commit comments