mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
Fixing line lengths in murmur3 and hdfs plugins (#34603)
This commit is contained in:
parent
f11a23be2f
commit
6ccaa83d2a
@ -82,7 +82,9 @@ public final class HdfsRepository extends BlobStoreRepository {
|
||||
uri = URI.create(uriSetting);
|
||||
if ("hdfs".equalsIgnoreCase(uri.getScheme()) == false) {
|
||||
throw new IllegalArgumentException(String.format(Locale.ROOT,
|
||||
"Invalid scheme [%s] specified in uri [%s]; only 'hdfs' uri allowed for hdfs snapshot/restore", uri.getScheme(), uriSetting));
|
||||
"Invalid scheme [%s] specified in uri [%s]; only 'hdfs' uri allowed for hdfs snapshot/restore",
|
||||
uri.getScheme(),
|
||||
uriSetting));
|
||||
}
|
||||
if (Strings.hasLength(uri.getPath()) && uri.getPath().equals("/") == false) {
|
||||
throw new IllegalArgumentException(String.format(Locale.ROOT,
|
||||
@ -134,7 +136,10 @@ public final class HdfsRepository extends BlobStoreRepository {
|
||||
}
|
||||
});
|
||||
|
||||
logger.debug("Using file-system [{}] for URI [{}], path [{}]", fileContext.getDefaultFileSystem(), fileContext.getDefaultFileSystem().getUri(), path);
|
||||
logger.debug("Using file-system [{}] for URI [{}], path [{}]",
|
||||
fileContext.getDefaultFileSystem(),
|
||||
fileContext.getDefaultFileSystem().getUri(),
|
||||
path);
|
||||
|
||||
try {
|
||||
return new HdfsBlobStore(fileContext, path, bufferSize, isReadOnly(), haEnabled);
|
||||
|
@ -76,11 +76,25 @@ public class HdfsTests extends ESSingleNodeTestCase {
|
||||
assertThat(count(client, "test-idx-3"), equalTo(100L));
|
||||
|
||||
logger.info("--> snapshot");
|
||||
CreateSnapshotResponse createSnapshotResponse = client.admin().cluster().prepareCreateSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*", "-test-idx-3").get();
|
||||
CreateSnapshotResponse createSnapshotResponse = client.admin()
|
||||
.cluster()
|
||||
.prepareCreateSnapshot("test-repo", "test-snap")
|
||||
.setWaitForCompletion(true)
|
||||
.setIndices("test-idx-*", "-test-idx-3")
|
||||
.get();
|
||||
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), greaterThan(0));
|
||||
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(), equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
|
||||
assertThat(createSnapshotResponse.getSnapshotInfo().successfulShards(),
|
||||
equalTo(createSnapshotResponse.getSnapshotInfo().totalShards()));
|
||||
|
||||
assertThat(client.admin().cluster().prepareGetSnapshots("test-repo").setSnapshots("test-snap").get().getSnapshots().get(0).state(), equalTo(SnapshotState.SUCCESS));
|
||||
assertThat(client.admin()
|
||||
.cluster()
|
||||
.prepareGetSnapshots("test-repo")
|
||||
.setSnapshots("test-snap")
|
||||
.get()
|
||||
.getSnapshots()
|
||||
.get(0)
|
||||
.state(),
|
||||
equalTo(SnapshotState.SUCCESS));
|
||||
|
||||
logger.info("--> delete some data");
|
||||
for (int i = 0; i < 50; i++) {
|
||||
@ -101,7 +115,12 @@ public class HdfsTests extends ESSingleNodeTestCase {
|
||||
client.admin().indices().prepareClose("test-idx-1", "test-idx-2").get();
|
||||
|
||||
logger.info("--> restore all indices from the snapshot");
|
||||
RestoreSnapshotResponse restoreSnapshotResponse = client.admin().cluster().prepareRestoreSnapshot("test-repo", "test-snap").setWaitForCompletion(true).execute().actionGet();
|
||||
RestoreSnapshotResponse restoreSnapshotResponse = client.admin()
|
||||
.cluster()
|
||||
.prepareRestoreSnapshot("test-repo", "test-snap")
|
||||
.setWaitForCompletion(true)
|
||||
.execute()
|
||||
.actionGet();
|
||||
assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0));
|
||||
|
||||
ensureGreen();
|
||||
@ -113,7 +132,13 @@ public class HdfsTests extends ESSingleNodeTestCase {
|
||||
logger.info("--> delete indices");
|
||||
client().admin().indices().prepareDelete("test-idx-1", "test-idx-2").get();
|
||||
logger.info("--> restore one index after deletion");
|
||||
restoreSnapshotResponse = client.admin().cluster().prepareRestoreSnapshot("test-repo", "test-snap").setWaitForCompletion(true).setIndices("test-idx-*", "-test-idx-2").execute().actionGet();
|
||||
restoreSnapshotResponse = client.admin()
|
||||
.cluster()
|
||||
.prepareRestoreSnapshot("test-repo", "test-snap")
|
||||
.setWaitForCompletion(true)
|
||||
.setIndices("test-idx-*", "-test-idx-2")
|
||||
.execute()
|
||||
.actionGet();
|
||||
assertThat(restoreSnapshotResponse.getRestoreInfo().totalShards(), greaterThan(0));
|
||||
ensureGreen();
|
||||
assertThat(count(client, "test-idx-1"), equalTo(100L));
|
||||
|
Loading…
x
Reference in New Issue
Block a user