fabriziofortino commented on a change in pull request #399:
URL: https://github.com/apache/jackrabbit-oak/pull/399#discussion_r736497317
##########
File path:
oak-search-elastic/src/main/java/org/apache/jackrabbit/oak/plugins/index/elastic/index/ElasticIndexWriter.java
##########
@@ -102,11 +101,12 @@ public boolean close(long timestamp) throws IOException {
return bulkProcessorHandler.close();
}
- protected void provisionIndex(long seed) throws IOException {
+ protected void provisionIndex() throws IOException {
final IndicesClient indicesClient =
elasticConnection.getClient().indices();
// check if index already exists
- final String indexName =
ElasticIndexNameHelper.getRemoteIndexName(indexDefinition, seed);
- boolean exists = indicesClient.exists(new GetIndexRequest(indexName),
RequestOptions.DEFAULT);
+ boolean exists = elasticConnection.getClient().indices().exists(
Review comment:
The `indexName` depends on the `reindex` flag: it's the full name on
reindex operations or the alias during incremental indexing. I can see this is
not clear. The problem lays in the classes' design: the index provisioning
logic is spread across 3 different classes (`ElasticIndexWriter`,
`ElasticIndexWriterFactory`, `ElasticIndexEditorContext`) making it quite
ununderstandable. I have taken the opportunity to refactor it with the intent
of making it more understandable: all these parts (create seed, provision
index, enable index) have been moved to `ElasticIndexWriter`. Please let me
know if it makes more sense now.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]