|
@@ -186,9 +186,9 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx-1", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
- index("test-idx-2", "_doc", Integer.toString(i), "foo", "baz" + i);
|
|
|
- index("test-idx-3", "_doc", Integer.toString(i), "foo", "baz" + i);
|
|
|
+ indexDoc("test-idx-1", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-2", Integer.toString(i), "foo", "baz" + i);
|
|
|
+ indexDoc("test-idx-3", Integer.toString(i), "foo", "baz" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertHitCount(client.prepareSearch("test-idx-1").setSize(0).get(), 100L);
|
|
@@ -331,7 +331,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
Client client = client();
|
|
|
// Write a document
|
|
|
String docId = Integer.toString(randomInt());
|
|
|
- index(indexName, "_doc", docId, "value", expectedValue);
|
|
|
+ indexDoc(indexName, docId, "value", expectedValue);
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository(repoName)
|
|
@@ -737,7 +737,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -800,7 +800,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -858,7 +858,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -927,7 +927,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -990,7 +990,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -1098,7 +1098,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
// index some documents
|
|
|
final int nbDocs = scaledRandomIntBetween(10, 100);
|
|
|
for (int i = 0; i < nbDocs; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
flushAndRefresh(indexName);
|
|
|
assertThat(client().prepareSearch(indexName).setSize(0).get().getHits().getTotalHits().value, equalTo((long) nbDocs));
|
|
@@ -1191,7 +1191,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -1285,7 +1285,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
logger.info("--> creating {} snapshots ", numberOfSnapshots);
|
|
|
for (int i = 0; i < numberOfSnapshots; i++) {
|
|
|
for (int j = 0; j < 10; j++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i * 10 + j), "foo", "bar" + i * 10 + j);
|
|
|
+ indexDoc("test-idx", Integer.toString(i * 10 + j), "foo", "bar" + i * 10 + j);
|
|
|
}
|
|
|
refresh();
|
|
|
logger.info("--> snapshot {}", i);
|
|
@@ -1351,7 +1351,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
assertAcked(prepareCreate(indexName));
|
|
|
ensureGreen();
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -1713,8 +1713,8 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx-1", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
- index("test-idx-2", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-1", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-2", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx-1").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -1835,7 +1835,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -1901,7 +1901,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -1983,7 +1983,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -2050,7 +2050,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -2109,7 +2109,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -2231,7 +2231,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -2561,9 +2561,9 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx-1", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
- index("test-idx-2", "_doc", Integer.toString(i), "foo", "baz" + i);
|
|
|
- index("test-idx-3", "_doc", Integer.toString(i), "foo", "baz" + i);
|
|
|
+ indexDoc("test-idx-1", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-2", Integer.toString(i), "foo", "baz" + i);
|
|
|
+ indexDoc("test-idx-3", Integer.toString(i), "foo", "baz" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx-1").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -2622,8 +2622,8 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index("test-idx-1", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
- index("test-idx-2", "_doc", Integer.toString(i), "foo", "baz" + i);
|
|
|
+ indexDoc("test-idx-1", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-2", Integer.toString(i), "foo", "baz" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx-1").setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -2685,7 +2685,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < 100; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch(indexName).setSize(0).get().getHits().getTotalHits().value, equalTo(100L));
|
|
@@ -3070,7 +3070,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
createIndex(indexName);
|
|
|
ensureGreen();
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3087,7 +3087,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> index more documents");
|
|
|
for (int i = 10; i < 20; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3153,7 +3153,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
assertAcked(prepareCreate(indexName, 1, Settings.builder().put("number_of_replicas", 0)));
|
|
|
ensureGreen();
|
|
|
for (int i = 0; i < 10; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3194,7 +3194,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
logger.info("--> take another snapshot to be in-progress");
|
|
|
// add documents so there are data files to block on
|
|
|
for (int i = 10; i < 20; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3284,7 +3284,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
|
|
|
logger.info("--> indexing some data");
|
|
|
for (int i = 0; i < numDocs; i++) {
|
|
|
- index(index, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(index, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3349,7 +3349,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
ensureGreen();
|
|
|
final int numDocs = randomIntBetween(1, 5);
|
|
|
for (int i = 0; i < numDocs; i++) {
|
|
|
- index("test-idx", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
assertThat(client.prepareSearch("test-idx").setSize(0).get().getHits().getTotalHits().value, equalTo((long) numDocs));
|
|
@@ -3405,7 +3405,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
ensureGreen();
|
|
|
final int numDocs = randomIntBetween(1, 5);
|
|
|
for (int i = 0; i < numDocs; i++) {
|
|
|
- index("test-idx-good", "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc("test-idx-good", Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
refresh();
|
|
|
|
|
@@ -3484,7 +3484,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
if (randomBoolean()) {
|
|
|
final int numDocs = randomIntBetween(1, 5);
|
|
|
for (int k = 0; k < numDocs; k++) {
|
|
|
- index("test-idx-" + j, "_doc", Integer.toString(k), "foo", "bar" + k);
|
|
|
+ indexDoc("test-idx-" + j, Integer.toString(k), "foo", "bar" + k);
|
|
|
}
|
|
|
refresh();
|
|
|
}
|
|
@@ -3562,7 +3562,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
createIndex(indexName, settings);
|
|
|
ensureGreen();
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
|
|
|
final Index index = resolveIndex(indexName);
|
|
@@ -3571,7 +3571,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
EngineTestCase.generateNewSeqNo(getEngineFromShard(primary));
|
|
|
|
|
|
for (int i = 5; i < 10; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
|
|
|
refresh();
|
|
@@ -3598,7 +3598,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
assertThat(shardStats.getSeqNoStats().getGlobalCheckpoint(), equalTo(10L));
|
|
|
logger.info("--> indexing some more");
|
|
|
for (int i = 10; i < 15; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
client().admin().indices().prepareFlush(indexName).setForce(true).setWaitIfOngoing(true).get();
|
|
|
|
|
@@ -3625,10 +3625,10 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
Client client = client();
|
|
|
// Write a document
|
|
|
String docId = Integer.toString(randomInt());
|
|
|
- index(indexName1, "_doc", docId, "value", expectedValue);
|
|
|
+ indexDoc(indexName1, docId, "value", expectedValue);
|
|
|
|
|
|
String docId2 = Integer.toString(randomInt());
|
|
|
- index(indexName2, "_doc", docId2, "value", expectedValue);
|
|
|
+ indexDoc(indexName2, docId2, "value", expectedValue);
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository(repoName)
|
|
@@ -3686,10 +3686,10 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
Client client = client();
|
|
|
// Write a document
|
|
|
String docId = Integer.toString(randomInt());
|
|
|
- index(indexName1, "_doc", docId, "value", expectedValue);
|
|
|
+ indexDoc(indexName1, docId, "value", expectedValue);
|
|
|
|
|
|
String docId2 = Integer.toString(randomInt());
|
|
|
- index(indexName2, "_doc", docId2, "value", expectedValue);
|
|
|
+ indexDoc(indexName2, docId2, "value", expectedValue);
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
|
assertAcked(client.admin().cluster().preparePutRepository(repoName)
|
|
@@ -3784,7 +3784,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
logger.info("--> indexing some documents");
|
|
|
final int docCount = initialShardCount * randomIntBetween(1, 10);
|
|
|
for (int i = 0; i < docCount; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
|
|
|
logger.info("--> creating repository");
|
|
@@ -3808,7 +3808,7 @@ public class SharedClusterSnapshotRestoreIT extends AbstractSnapshotIntegTestCas
|
|
|
logger.info("--> indexing some documents");
|
|
|
final int newDocCount = newShardCount * randomIntBetween(1, 10);
|
|
|
for (int i = 0; i < newDocCount; i++) {
|
|
|
- index(indexName, "_doc", Integer.toString(i), "foo", "bar" + i);
|
|
|
+ indexDoc(indexName, Integer.toString(i), "foo", "bar" + i);
|
|
|
}
|
|
|
|
|
|
logger.info("--> snapshot with [{}] shards", newShardCount);
|