You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by GitBox <gi...@apache.org> on 2020/07/29 17:47:06 UTC

[GitHub] [jackrabbit-oak] jsedding commented on a change in pull request #243: OAK-9149 : Use batch calls in backgroundSplit

jsedding commented on a change in pull request #243:
URL: https://github.com/apache/jackrabbit-oak/pull/243#discussion_r462359594



##########
File path: oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStore.java
##########
@@ -3160,6 +3187,22 @@ private void signalClusterStateChange() {
         }
     }
 
+    /**
+     * FOR TESTING ONLY :
+     * stops the backgroundUpdateThread (by overwriting its
+     * isDisposed flag) and optionally waits for the thread to
+     * terminate.
+     * @param timeoutMillis optional amount of millis to wait for the thread to terminate at max
+     * @return true if thread is no longer running
+     */
+    boolean stopBackgroundUpdateThread(long timeoutMillis) throws InterruptedException {

Review comment:
       Since @Joscorbe asked for a second opinion. I could imagine passing a thread-factory (could be a BiFunction<BackgroundUpdateOperation, String>) into a new `DocumentNodeStore` constructor. That way the tests could pass in a suitable factory and keep a reference to the thread and `BackgroundUpdateOperation` to be able to accomplish the desired behaviour. IMHO that would be more elegant, but that, as always, is in the eye of the beholder.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org