use of org.xbib.elasticsearch.common.util.PlainIndexableObject in project elasticsearch-jdbc by jprante.
the class ColumnStrategySourceTests method createFixturesAndPopulateSink.
private ProductFixtures createFixturesAndPopulateSink(boolean[] shouldProductsBeDeleted, MockSink sink) throws IOException {
ProductFixture[] fixtures = new ProductFixture[shouldProductsBeDeleted.length];
int expectedExistsCountAfterRun = 0;
for (int i = 0; i < shouldProductsBeDeleted.length; i++) {
IndexableObject p = new PlainIndexableObject().id(Integer.toString(i)).source(createSource(i)).optype("delete");
sink.index(p, false);
Timestamp deletedAt;
if (shouldProductsBeDeleted[i]) {
deletedAt = okTimestamp();
} else {
deletedAt = oldTimestamp();
expectedExistsCountAfterRun++;
}
fixtures[i] = ProductFixture.one().setId(i).createdAt(oldTimestamp()).updatedAt(oldTimestamp()).deletedAt(deletedAt);
}
return new ProductFixtures(fixtures, expectedExistsCountAfterRun);
}
Aggregations