This is an automated email from the ASF dual-hosted git repository. daim pushed a commit to branch OAK-12018 in repository https://gitbox.apache.org/repos/asf/jackrabbit-oak.git
commit 1fadf47a94a181aab1126c2754955c4e09bba292 Author: rishabhdaim <[email protected]> AuthorDate: Thu Nov 27 17:17:29 2025 +0530 OAK-12018 : replaced DirectExecutor.INSTANCE call with ExecutorUtils.directExecutor --- .../internal/concurrent/DirectExecutor.java | 3 +- .../internal/concurrent/DirectExecutorTest.java | 4 +-- .../oak/commons/jmx/ManagementOperationTest.java | 4 +-- .../ActiveDeletedBlobCollectorMBeanImplTest.java | 7 ++--- .../index/lucene/IndexCopierCleanupTest.java | 4 +-- .../oak/plugins/index/lucene/IndexCopierTest.java | 36 +++++++++++----------- .../plugins/index/lucene/IndexNodeManagerTest.java | 4 +-- .../oak/plugins/index/lucene/LuceneIndexTest.java | 6 ++-- .../ConcurrentCopyOnReadDirectoryTest.java | 4 +-- .../lucene/directory/CopyOnReadDirectoryTest.java | 4 +-- .../index/lucene/hybrid/DelayedFacetReadTest.java | 4 +-- .../index/lucene/hybrid/DocumentQueueTest.java | 16 +++++----- .../index/lucene/hybrid/FacetCacheTest.java | 4 +-- .../index/lucene/hybrid/HybridIndexClusterIT.java | 4 +-- .../index/lucene/hybrid/HybridIndexTest.java | 4 +-- .../lucene/hybrid/LocalIndexWriterFactoryTest.java | 6 ++-- .../index/lucene/hybrid/ManyFacetsTest.java | 4 +-- ...eadedOldLuceneFacetProviderReadFailureTest.java | 4 +-- .../index/lucene/hybrid/NRTIndexFactoryTest.java | 4 +-- .../plugins/index/lucene/hybrid/NRTIndexTest.java | 4 +-- .../index/lucene/hybrid/ReaderRefCountIT.java | 6 ++-- .../bundlor/BundlingConfigHandlerTest.java | 4 +-- 22 files changed, 70 insertions(+), 70 deletions(-) diff --git a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutor.java b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutor.java index bc60e3d33b..f8b51899d8 100644 --- a/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutor.java +++ b/oak-commons/src/main/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutor.java @@ -21,8 +21,9 @@ package org.apache.jackrabbit.oak.commons.internal.concurrent; import java.util.concurrent.Executor; /** - * An @{@link Executor} that runs the task in calling thread + * An {@link Executor} that runs the task in calling thread */ +// Note: Direct usage of this class is discouraged, please use {@link ExecutorUtils#directExecutor} public enum DirectExecutor implements Executor { INSTANCE; diff --git a/oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutorTest.java b/oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutorTest.java index cbb3f6d89a..3e0e002d6b 100644 --- a/oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutorTest.java +++ b/oak-commons/src/test/java/org/apache/jackrabbit/oak/commons/internal/concurrent/DirectExecutorTest.java @@ -31,7 +31,7 @@ public class DirectExecutorTest { final String callingThread = Thread.currentThread().getName(); final String[] executedThread = new String[1]; - DirectExecutor.INSTANCE.execute(() -> executedThread[0] = Thread.currentThread().getName()); + ExecutorUtils.directExecutor().execute(() -> executedThread[0] = Thread.currentThread().getName()); Assert.assertEquals(callingThread, executedThread[0]); } @@ -39,7 +39,7 @@ public class DirectExecutorTest { @Test public void testExecuteRunsImmediately() { final boolean[] ran = {false}; - DirectExecutor.INSTANCE.execute(() -> ran[0] = true); + ExecutorUtils.directExecutor().execute(() -> ran[0] = true); Assert.assertTrue(ran[0]); } } \ No newline at end of file diff --git a/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/commons/jmx/ManagementOperationTest.java b/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/commons/jmx/ManagementOperationTest.java index 6ca84c2ce4..58000fb1d3 100644 --- a/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/commons/jmx/ManagementOperationTest.java +++ b/oak-core-spi/src/test/java/org/apache/jackrabbit/oak/commons/jmx/ManagementOperationTest.java @@ -40,7 +40,7 @@ import java.util.concurrent.TimeoutException; import javax.management.openmbean.CompositeData; import org.apache.jackrabbit.guava.common.util.concurrent.ListeningExecutorService; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.jmx.ManagementOperation.Status; import org.junit.After; import org.junit.Before; @@ -64,7 +64,7 @@ public class ManagementOperationTest { ManagementOperation<Integer> op = ManagementOperation.done("test", 42); assertTrue(op.isDone()); assertEquals(42, (int) op.get()); - DirectExecutor.INSTANCE.execute(op); + ExecutorUtils.directExecutor().execute(op); } @Test diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/ActiveDeletedBlobCollectorMBeanImplTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/ActiveDeletedBlobCollectorMBeanImplTest.java index b429f851ac..f8a579cfcf 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/ActiveDeletedBlobCollectorMBeanImplTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/ActiveDeletedBlobCollectorMBeanImplTest.java @@ -28,7 +28,6 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.jmx.IndexStatsMBean; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.collections.IterableUtils; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.osgi.OsgiWhiteboard; import org.apache.jackrabbit.oak.plugins.document.DocumentMKBuilderProvider; @@ -241,7 +240,7 @@ public class ActiveDeletedBlobCollectorMBeanImplTest { ActiveDeletedBlobCollectorMBeanImpl bean = new ActiveDeletedBlobCollectorMBeanImpl(ActiveDeletedBlobCollectorFactory.NOOP, wb, failingNodeStore, indexPathService, asyncIndexInfoService, - new MemoryBlobStore(), DirectExecutor.INSTANCE); + new MemoryBlobStore(), ExecutorUtils.directExecutor()); bean.clock = clock; bean.flagActiveDeletionUnsafeForCurrentState(); @@ -274,7 +273,7 @@ public class ActiveDeletedBlobCollectorMBeanImplTest { return null; }), wb, nodeStore, indexPathService, asyncIndexInfoService, - new MemoryBlobStore(), DirectExecutor.INSTANCE); + new MemoryBlobStore(), ExecutorUtils.directExecutor()); bean.clock = clock; bean.flagActiveDeletionUnsafeForCurrentState(); @@ -312,7 +311,7 @@ public class ActiveDeletedBlobCollectorMBeanImplTest { ActiveDeletedBlobCollectorMBeanImpl bean = new ActiveDeletedBlobCollectorMBeanImpl(ActiveDeletedBlobCollectorFactory.NOOP, wb, dns1, indexPathService, asyncIndexInfoService, - new MemoryBlobStore(), DirectExecutor.INSTANCE); + new MemoryBlobStore(), ExecutorUtils.directExecutor()); bean.clock = clock; bean.flagActiveDeletionUnsafeForCurrentState(); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierCleanupTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierCleanupTest.java index de7cf670bb..00447bddf0 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierCleanupTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierCleanupTest.java @@ -21,7 +21,7 @@ package org.apache.jackrabbit.oak.plugins.index.lucene; import org.apache.commons.io.FileUtils; import org.apache.jackrabbit.oak.commons.collections.SetUtils; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.pio.Closer; import org.apache.jackrabbit.oak.spi.state.NodeBuilder; import org.apache.jackrabbit.oak.spi.state.NodeState; @@ -98,7 +98,7 @@ public class IndexCopierCleanupTest { localFSDir = temporaryFolder.newFolder(); - copier = new RAMIndexCopier(localFSDir, DirectExecutor.INSTANCE, temporaryFolder.getRoot(), true); + copier = new RAMIndexCopier(localFSDir, ExecutorUtils.directExecutor(), temporaryFolder.getRoot(), true); // convince copier that local FS dir is ok (avoid integrity check doing the cleanup) copier.getCoRDir().close(); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierTest.java index 456b47780b..aecef2c90d 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexCopierTest.java @@ -49,7 +49,7 @@ import org.apache.jackrabbit.guava.common.util.concurrent.MoreExecutors; import org.apache.commons.io.FileUtils; import org.apache.jackrabbit.oak.commons.IOUtils; import org.apache.jackrabbit.oak.commons.collections.SetUtils; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.pio.Closer; import org.apache.jackrabbit.oak.plugins.index.lucene.directory.LocalIndexFile; import org.apache.jackrabbit.oak.plugins.index.search.IndexDefinition; @@ -123,7 +123,7 @@ public class IndexCopierTest { public void basicTest() throws Exception{ Directory baseDir = new RAMDirectory(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new RAMDirectory(); Directory wrapped = c1.wrapForRead("/foo", defn, remote, INDEX_DATA_CHILD_NAME); @@ -156,7 +156,7 @@ public class IndexCopierTest { } }; LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir(), true); + IndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir(), true); Directory remote = new RAMDirectory(); @@ -203,7 +203,7 @@ public class IndexCopierTest { @Test public void basicTestWithFS() throws Exception{ LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new IndexCopier(DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new IndexCopier(ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new RAMDirectory(); Directory wrapped = c1.wrapForRead("/foo", defn, remote, INDEX_DATA_CHILD_NAME); @@ -233,7 +233,7 @@ public class IndexCopierTest { @Test public void multiDirNames() throws Exception{ LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new IndexCopier(DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new IndexCopier(ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new CloseSafeDir(); byte[] t1 = writeFile(remote, "t1"); @@ -252,7 +252,7 @@ public class IndexCopierTest { @Test public void deleteOldPostReindex() throws Exception{ LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new IndexCopier(DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new IndexCopier(ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new CloseSafeDir(); Directory w1 = c1.wrapForRead(indexPath, defn, remote, INDEX_DATA_CHILD_NAME); @@ -402,7 +402,7 @@ public class IndexCopierTest { public void reuseLocalDir() throws Exception{ Directory baseDir = new RAMDirectory(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); FileTrackingDirectory remote = new FileTrackingDirectory(); Directory wrapped = c1.wrapForRead("/foo", defn, remote, INDEX_DATA_CHILD_NAME); @@ -437,7 +437,7 @@ public class IndexCopierTest { public void deleteCorruptedFile() throws Exception{ Directory baseDir = new RAMDirectory(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - RAMIndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + RAMIndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new RAMDirectory(){ @Override @@ -467,7 +467,7 @@ public class IndexCopierTest { LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory r1 = new DelayCopyingSimpleFSDirectory(); @@ -510,7 +510,7 @@ public class IndexCopierTest { }; LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier c1 = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier c1 = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory r1 = new DelayCopyingSimpleFSDirectory(); @@ -561,7 +561,7 @@ public class IndexCopierTest { Directory baseDir = new CloseSafeDir(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); //1. Open a local and read t1 from remote Directory remote1 = new RAMDirectory(); @@ -588,7 +588,7 @@ public class IndexCopierTest { public void wrapForWriteWithoutIndexPath() throws Exception{ Directory remote = new CloseSafeDir(); - IndexCopier copier = new IndexCopier(DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new IndexCopier(ExecutorUtils.directExecutor(), getWorkDir()); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); Directory dir = copier.wrapForWrite(defn, remote, false, INDEX_DATA_CHILD_NAME, @@ -607,7 +607,7 @@ public class IndexCopierTest { public void wrapForWriteWithIndexPath() throws Exception{ Directory remote = new CloseSafeDir(); - IndexCopier copier = new IndexCopier(DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new IndexCopier(ExecutorUtils.directExecutor(), getWorkDir()); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); Directory dir = copier.wrapForWrite(defn, remote, false, INDEX_DATA_CHILD_NAME, @@ -632,7 +632,7 @@ public class IndexCopierTest { public void copyOnWriteBasics() throws Exception{ Directory baseDir = new CloseSafeDir(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new RAMDirectory(); byte[] t1 = writeFile(remote, "t1"); @@ -693,7 +693,7 @@ public class IndexCopierTest { public void cowExistingLocalFileNotDeleted() throws Exception{ Directory baseDir = new CloseSafeDir(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); Directory remote = new CloseSafeDir(); byte[] t1 = writeFile(remote, "t1"); @@ -738,7 +738,7 @@ public class IndexCopierTest { } }; LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir()); + IndexCopier copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir()); final Set<String> readRemotes = new HashSet<>(); Directory remote = new RAMDirectory() { @@ -1057,7 +1057,7 @@ public class IndexCopierTest { public void directoryContentMismatch_COR() throws Exception{ Directory baseDir = new CloseSafeDir(); LuceneIndexDefinition defn = new LuceneIndexDefinition(root, builder.getNodeState(), "/foo"); - IndexCopier copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir(), true); + IndexCopier copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir(), true); Directory remote = new RAMDirectory(); byte[] t1 = writeFile(remote, "t1"); @@ -1078,7 +1078,7 @@ public class IndexCopierTest { t1 = writeFile(remoteModified, "t1"); //3. Reopen the copier - copier = new RAMIndexCopier(baseDir, DirectExecutor.INSTANCE, getWorkDir(), true); + copier = new RAMIndexCopier(baseDir, ExecutorUtils.directExecutor(), getWorkDir(), true); //4. Post opening local the content should be in sync with remote //So t1 should be recreated matching remote diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexNodeManagerTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexNodeManagerTest.java index fd5a5b02b0..7c1d2c06c6 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexNodeManagerTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/IndexNodeManagerTest.java @@ -23,7 +23,7 @@ import java.io.IOException; import java.util.Collections; import java.util.List; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.lucene.directory.OakDirectory; import org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndex; import org.apache.jackrabbit.oak.plugins.index.lucene.hybrid.NRTIndexFactory; @@ -74,7 +74,7 @@ public class IndexNodeManagerTest { @Before public void setUp() throws IOException { - indexCopier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.getRoot()); + indexCopier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.getRoot()); nrtFactory = new NRTIndexFactory(indexCopier, StatisticsProvider.NOOP); readerFactory = new DefaultIndexReaderFactory(Mounts.defaultMountInfoProvider(), indexCopier); LuceneIndexEditorContext.configureUniqueId(builder); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java index 088762bd28..23e9d1183c 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/LuceneIndexTest.java @@ -68,7 +68,7 @@ import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.collections.IteratorUtils; import org.apache.jackrabbit.oak.commons.collections.ListUtils; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.junit.LogCustomizer; import org.apache.jackrabbit.oak.plugins.index.IndexConstants; import org.apache.jackrabbit.oak.plugins.index.IndexUpdate; @@ -670,7 +670,7 @@ public class LuceneIndexTest { NodeState indexed = HOOK.processCommit(before, after,CommitInfo.EMPTY); File indexRootDir = new File(getIndexDir()); - tracker = new IndexTracker(new IndexCopier(DirectExecutor.INSTANCE, indexRootDir)); + tracker = new IndexTracker(new IndexCopier(ExecutorUtils.directExecutor(), indexRootDir)); tracker.update(indexed); assertQuery(tracker, indexed, "foo", "bar"); @@ -696,7 +696,7 @@ public class LuceneIndexTest { NodeState indexed = HOOK.processCommit(before, builder.getNodeState(),CommitInfo.EMPTY); - IndexCopier copier = new IndexCopier(DirectExecutor.INSTANCE, new File(getIndexDir())); + IndexCopier copier = new IndexCopier(ExecutorUtils.directExecutor(), new File(getIndexDir())); tracker = new IndexTracker(copier); tracker.update(indexed); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java index 3888aa8540..2cdbceec0c 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/ConcurrentCopyOnReadDirectoryTest.java @@ -19,7 +19,7 @@ package org.apache.jackrabbit.oak.plugins.index.lucene.directory; import org.apache.jackrabbit.oak.InitialContentHelper; import org.apache.jackrabbit.oak.commons.collections.IterableUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.junit.TemporarySystemProperty; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier; import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexDefinition; @@ -97,7 +97,7 @@ public class ConcurrentCopyOnReadDirectoryTest { IndexInput remoteInput = remote.openInput("file", IOContext.READ); assertTrue(remoteInput.length() > 1); - copier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.newFolder(), true); + copier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.newFolder(), true); NodeState root = InitialContentHelper.INITIAL_CONTENT; defn = new LuceneIndexDefinition(root, root, "/foo"); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnReadDirectoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnReadDirectoryTest.java index e207f3f982..424f241b00 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnReadDirectoryTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/directory/CopyOnReadDirectoryTest.java @@ -23,7 +23,7 @@ import java.io.File; import java.util.concurrent.Executor; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier; import org.apache.lucene.store.Directory; import org.apache.lucene.store.RAMDirectory; @@ -41,7 +41,7 @@ public class CopyOnReadDirectoryTest { public void multipleCloseCalls() throws Exception{ AtomicInteger executionCount = new AtomicInteger(); Executor e = r -> {executionCount.incrementAndGet(); r.run();}; - IndexCopier c = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.newFolder(), true); + IndexCopier c = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.newFolder(), true); Directory dir = new CopyOnReadDirectory(c, new RAMDirectory(), new RAMDirectory(), false, "foo", e); dir.close(); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DelayedFacetReadTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DelayedFacetReadTest.java index 8a50193789..a206728b8c 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DelayedFacetReadTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DelayedFacetReadTest.java @@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.jcr.Jcr; import org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate; import org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider; @@ -138,7 +138,7 @@ public class DelayedFacetReadTest extends AbstractQueryTest { LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory); luceneIndexProvider = new LuceneIndexProvider(tracker); - queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DocumentQueueTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DocumentQueueTest.java index fc50a36c47..4aa6c90322 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DocumentQueueTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/DocumentQueueTest.java @@ -31,7 +31,7 @@ import org.apache.commons.collections4.ListValuedMap; import org.apache.commons.collections4.multimap.ArrayListValuedHashMap; import org.apache.jackrabbit.oak.api.CommitFailedException; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.time.Stopwatch; import org.apache.jackrabbit.oak.plugins.index.IndexEditorProvider; import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider; @@ -112,14 +112,14 @@ public class DocumentQueueTest { @Test public void noIssueIfNoIndex() throws Exception{ - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); assertTrue(queue.add(LuceneDoc.forDelete("foo", "bar"))); assertTrue(queue.getQueuedDocs().isEmpty()); } @Test public void closeQueue() throws Exception{ - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); queue.close(); try { @@ -133,7 +133,7 @@ public class DocumentQueueTest { @Test public void noIssueIfNoWriter() throws Exception{ NodeState indexed = createAndPopulateAsyncIndex(FulltextIndexConstants.IndexingMode.NRT); - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); tracker.update(indexed); assertTrue(queue.add(LuceneDoc.forDelete("/oak:index/fooIndex", "bar"))); @@ -144,7 +144,7 @@ public class DocumentQueueTest { IndexTracker tracker = createTracker(); NodeState indexed = createAndPopulateAsyncIndex(FulltextIndexConstants.IndexingMode.NRT); tracker.update(indexed); - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); Document d1 = new Document(); d1.add(newPathField("/a/b")); @@ -164,7 +164,7 @@ public class DocumentQueueTest { clock.waitUntil(refreshDelta); - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); TopDocs td = doSearch("bar"); assertEquals(1, td.totalHits); @@ -225,7 +225,7 @@ public class DocumentQueueTest { NodeState indexed = createAndPopulateAsyncIndex(FulltextIndexConstants.IndexingMode.SYNC); tracker.update(indexed); - DocumentQueue queue = new DocumentQueue(2, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(2, tracker, ExecutorUtils.directExecutor()); TopDocs td = doSearch("bar"); assertEquals(1, td.totalHits); @@ -323,7 +323,7 @@ public class DocumentQueueTest { } private IndexTracker createTracker() throws IOException { - IndexCopier indexCopier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.getRoot()); + IndexCopier indexCopier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.getRoot()); indexFactory = new NRTIndexFactory(indexCopier, clock, TimeUnit.MILLISECONDS.toSeconds(refreshDelta), StatisticsProvider.NOOP); return new IndexTracker( new DefaultIndexReaderFactory(defaultMountInfoProvider(), indexCopier), diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/FacetCacheTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/FacetCacheTest.java index e4bc5a81dd..a69525864f 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/FacetCacheTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/FacetCacheTest.java @@ -27,7 +27,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.junit.LogCustomizer; import org.apache.jackrabbit.oak.jcr.Jcr; import org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate; @@ -138,7 +138,7 @@ public class FacetCacheTest extends AbstractQueryTest { LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory); luceneIndexProvider = new LuceneIndexProvider(tracker); - queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexClusterIT.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexClusterIT.java index 0b47e5673d..9389ffc9dc 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexClusterIT.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexClusterIT.java @@ -36,7 +36,7 @@ import javax.jcr.query.QueryResult; import javax.jcr.query.Row; import org.apache.jackrabbit.commons.JcrUtils; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.fixture.DocumentMemoryFixture; import org.apache.jackrabbit.oak.fixture.NodeStoreFixture; import org.apache.jackrabbit.oak.jcr.Jcr; @@ -100,7 +100,7 @@ public class HybridIndexClusterIT extends AbstractClusterTest { LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory,nrtIndexFactory); LuceneIndexProvider provider = new LuceneIndexProvider(tracker); - DocumentQueue queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexTest.java index 36706f4973..fcad988f6e 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/HybridIndexTest.java @@ -53,7 +53,7 @@ import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.collections.IteratorUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.junit.LogCustomizer; import org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate; import org.apache.jackrabbit.oak.plugins.index.IndexConstants; @@ -147,7 +147,7 @@ public class HybridIndexTest extends AbstractQueryTest { LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory,nrtIndexFactory); luceneIndexProvider = new LuceneIndexProvider(tracker); - queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LocalIndexWriterFactoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LocalIndexWriterFactoryTest.java index 673583a6c6..4aae6198ea 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LocalIndexWriterFactoryTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/LocalIndexWriterFactoryTest.java @@ -24,7 +24,7 @@ import java.util.List; import java.util.Map; import org.apache.jackrabbit.oak.api.CommitFailedException; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.IndexUpdateProvider; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker; import org.apache.jackrabbit.oak.plugins.index.lucene.TestUtil; @@ -59,7 +59,7 @@ public class LocalIndexWriterFactoryTest { @Before public void setUp() throws IOException { tracker = new IndexTracker(); - DocumentQueue queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); editorProvider = new LuceneIndexEditorProvider( null, null, @@ -147,7 +147,7 @@ public class LocalIndexWriterFactoryTest { public void inMemoryDocLimit() throws Exception{ NodeState indexed = createAndPopulateAsyncIndex(FulltextIndexConstants.IndexingMode.NRT); editorProvider.setInMemoryDocsLimit(5); - editorProvider.setIndexingQueue(new DocumentQueue(1, tracker, DirectExecutor.INSTANCE)); + editorProvider.setIndexingQueue(new DocumentQueue(1, tracker, ExecutorUtils.directExecutor())); builder = indexed.builder(); for (int i = 0; i < 10; i++) { builder.child("b" + i).setProperty("foo", "bar"); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ManyFacetsTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ManyFacetsTest.java index 56c48355a4..3f23d500af 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ManyFacetsTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ManyFacetsTest.java @@ -49,7 +49,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.commons.json.JsonObject; import org.apache.jackrabbit.oak.jcr.Jcr; import org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate; @@ -135,7 +135,7 @@ public class ManyFacetsTest extends AbstractQueryTest { LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory); luceneIndexProvider = new LuceneIndexProvider(tracker); - queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/MultithreadedOldLuceneFacetProviderReadFailureTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/MultithreadedOldLuceneFacetProviderReadFailureTest.java index 1c6fd1feda..64542921b7 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/MultithreadedOldLuceneFacetProviderReadFailureTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/MultithreadedOldLuceneFacetProviderReadFailureTest.java @@ -26,7 +26,7 @@ import org.apache.jackrabbit.oak.api.Tree; import org.apache.jackrabbit.oak.api.Type; import org.apache.jackrabbit.oak.commons.PathUtils; import org.apache.jackrabbit.oak.commons.concurrent.ExecutorCloser; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.jcr.Jcr; import org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate; import org.apache.jackrabbit.oak.plugins.index.counter.NodeCounterEditorProvider; @@ -140,7 +140,7 @@ public class MultithreadedOldLuceneFacetProviderReadFailureTest extends Abstract LuceneIndexReaderFactory indexReaderFactory = new DefaultIndexReaderFactory(mip, copier); IndexTracker tracker = new IndexTracker(indexReaderFactory, nrtIndexFactory); luceneIndexProvider = new LuceneIndexProvider(tracker); - queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); LuceneIndexEditorProvider editorProvider = new LuceneIndexEditorProvider(copier, tracker, null, diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexFactoryTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexFactoryTest.java index ba4af0caa8..01956c3e2f 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexFactoryTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexFactoryTest.java @@ -22,7 +22,7 @@ package org.apache.jackrabbit.oak.plugins.index.lucene.hybrid; import java.io.File; import java.io.IOException; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier; import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexDefinition; import org.apache.jackrabbit.oak.plugins.index.lucene.TestUtil; @@ -57,7 +57,7 @@ public class NRTIndexFactoryTest { @Before public void setUp() throws IOException { - indexCopier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.getRoot()); + indexCopier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.getRoot()); indexFactory = new NRTIndexFactory(indexCopier, StatisticsProvider.NOOP); indexFactory.setAssertAllResourcesClosed(true); } diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexTest.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexTest.java index 5bd52f38b1..2f15c0c2f4 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexTest.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/NRTIndexTest.java @@ -23,7 +23,7 @@ import java.io.File; import java.io.IOException; import java.util.List; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier; import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexDefinition; import org.apache.jackrabbit.oak.plugins.index.lucene.TestUtil; @@ -64,7 +64,7 @@ public class NRTIndexTest { @Before public void setUp() throws IOException { - indexCopier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.getRoot()); + indexCopier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.getRoot()); indexFactory = new NRTIndexFactory(indexCopier, StatisticsProvider.NOOP); indexFactory.setAssertAllResourcesClosed(true); LuceneIndexEditorContext.configureUniqueId(builder); diff --git a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java index 5fb6d2bf1e..87fde67c4a 100644 --- a/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java +++ b/oak-lucene/src/test/java/org/apache/jackrabbit/oak/plugins/index/lucene/hybrid/ReaderRefCountIT.java @@ -32,7 +32,7 @@ import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexCopier; import org.apache.jackrabbit.oak.plugins.index.lucene.IndexTracker; import org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexNode; @@ -67,7 +67,7 @@ public class ReaderRefCountIT { @Before public void setUp() throws IOException { - indexCopier = new IndexCopier(DirectExecutor.INSTANCE, temporaryFolder.getRoot()); + indexCopier = new IndexCopier(ExecutorUtils.directExecutor(), temporaryFolder.getRoot()); } @Test @@ -132,7 +132,7 @@ public class ReaderRefCountIT { } }; - DocumentQueue queue = new DocumentQueue(100, tracker, DirectExecutor.INSTANCE); + DocumentQueue queue = new DocumentQueue(100, tracker, ExecutorUtils.directExecutor()); queue.setExceptionHandler(uh); diff --git a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigHandlerTest.java b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigHandlerTest.java index fea4e1dbc7..4748a437b4 100644 --- a/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigHandlerTest.java +++ b/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/bundlor/BundlingConfigHandlerTest.java @@ -22,7 +22,7 @@ package org.apache.jackrabbit.oak.plugins.document.bundlor; import org.apache.jackrabbit.oak.api.CommitFailedException; import org.apache.jackrabbit.oak.api.Type; -import org.apache.jackrabbit.oak.commons.internal.concurrent.DirectExecutor; +import org.apache.jackrabbit.oak.commons.internal.concurrent.ExecutorUtils; import org.apache.jackrabbit.oak.plugins.memory.MemoryNodeStore; import org.apache.jackrabbit.oak.spi.commit.CommitInfo; import org.apache.jackrabbit.oak.spi.commit.EmptyHook; @@ -50,7 +50,7 @@ public class BundlingConfigHandlerTest { @Test public void detectRegistryUpdate() throws Exception{ - configHandler.initialize(nodeStore, DirectExecutor.INSTANCE); + configHandler.initialize(nodeStore, ExecutorUtils.directExecutor()); addBundlorConfigForAsset(); BundledTypesRegistry registry = configHandler.getRegistry();
