fabriziofortino commented on a change in pull request #492:
URL: https://github.com/apache/jackrabbit-oak/pull/492#discussion_r810119882



##########
File path: 
oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/index/ElasticIndexCommand.java
##########
@@ -137,9 +136,10 @@ private void execute(NodeStoreFixture fixture, 
ElasticIndexOptions indexOpts, Cl
         //dumpIndexStats(indexOpts, indexHelper);
         //dumpIndexDefinitions(indexOpts, indexHelper);
         reindexOperation(indexOpts, indexHelper);
-        // This will not work with --doc-traversal mode, since that only works 
with read only mode and apply index def needs read write mode
-        // read write requirement - logic handled in applyIndexDefOperation
-        applyIndexDefOperation(indexOpts, indexHelper);
+
+        // For elastic implementation - this applies the newly created elastic 
defintion to the repo and brings the index up to date with the

Review comment:
       typo
   ```suggestion
           // For elastic implementation - this applies the newly created 
elastic definition to the repo and brings the index up to date with the
   ```

##########
File path: 
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/IndexerSupport.java
##########
@@ -119,7 +119,7 @@ private void updateIndexDefinitions(NodeBuilder 
rootBuilder) throws IOException,
         }
     }
 
-    private void dumpIndexDefinitions(NodeStore nodeStore) throws IOException, 
CommitFailedException {
+    protected void dumpIndexDefinitions(NodeStore nodeStore) throws 
IOException, CommitFailedException {

Review comment:
       `CommitFailedException` is never thrown here. I would remove it.

##########
File path: 
oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/index/ElasticIndexCommand.java
##########
@@ -31,7 +31,6 @@
 import org.apache.jackrabbit.oak.plugins.commit.AnnotatingConflictHandler;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictHook;
 import org.apache.jackrabbit.oak.plugins.commit.ConflictValidatorProvider;
-import org.apache.jackrabbit.oak.plugins.index.elastic.ElasticIndexDefinition;
 import org.apache.jackrabbit.oak.plugins.index.importer.IndexDefinitionUpdater;
 import org.apache.jackrabbit.oak.run.cli.CommonOptions;
 import org.apache.jackrabbit.oak.run.cli.NodeStoreFixture;

Review comment:
       `import org.apache.jackrabbit.oak.spi.state.NodeState;` (line 49) can be 
removed

##########
File path: 
oak-run-elastic/src/main/java/org/apache/jackrabbit/oak/index/ElasticIndexCommand.java
##########
@@ -216,33 +207,25 @@ private void reindex(ElasticIndexOptions indexOpts, 
IndexHelper indexHelper, Str
                     indexOpts.getElasticScheme(), indexOpts.getElasticHost(),
                     indexOpts.getElasticPort(), indexOpts.getApiKeyId(), 
indexOpts.getApiKeySecret())) {
                 indexer.reindex();
-                // Wait for default flush interval before exiting the try block
-                // to make sure the client is not closed before the last flush
-                // TODO : See if this can be handled in a better manner
-                
Thread.sleep(ElasticIndexDefinition.BULK_FLUSH_INTERVAL_MS_DEFAULT * 2);

Review comment:
       +1 👏 

##########
File path: 
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/IndexerSupport.java
##########
@@ -150,7 +150,7 @@ public void postIndexWork(NodeStore copyOnWriteStore) 
throws CommitFailedExcepti
         dumpIndexDefinitions(copyOnWriteStore);
     }
 
-    private void switchIndexLanesBack(NodeStore copyOnWriteStore) throws 
CommitFailedException, IOException {
+    protected void switchIndexLanesBack(NodeStore copyOnWriteStore) throws 
CommitFailedException, IOException {

Review comment:
       `IOException` never thrown here. I would remove it.




-- 
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]


Reply via email to