Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,11 @@
*/
package org.apache.jackrabbit.oak.spi.blob.data;

import org.apache.commons.lang3.concurrent.BasicThreadFactory;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

import org.apache.jackrabbit.oak.spi.blob.data.util.NamedThreadFactory;

/**
* Abstract Backend which has a reference to the underlying {@link CachingDataStore} and is
Expand Down Expand Up @@ -168,8 +167,8 @@ protected Executor createAsyncWriteExecutor() {
Executor asyncExecutor;

if (dataStore.getAsyncUploadLimit() > 0 && getAsyncWritePoolSize() > 0) {
asyncExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(getAsyncWritePoolSize(),
new NamedThreadFactory(getClass().getSimpleName() + "-write-worker"));
asyncExecutor = Executors.newFixedThreadPool(getAsyncWritePoolSize(),
BasicThreadFactory.builder().namingPattern(getClass().getSimpleName() + "-write-worker-%d").build());
} else {
asyncExecutor = new ImmediateExecutor();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.jackrabbit.oak.spi.blob.data.util.NamedThreadFactory;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -355,7 +355,7 @@ public void init(String homeDir) throws RepositoryException {
}
}
downloadExecService = Executors.newFixedThreadPool(5,
new NamedThreadFactory("backend-file-download-worker"));
BasicThreadFactory.builder().namingPattern("backend-file-download-worker-%d").build());
cache = new LocalCache(path, tmpDir.getAbsolutePath(), cacheSize,
cachePurgeTrigFactor, cachePurgeResizeFactor, asyncWriteCache);
/*
Expand Down Expand Up @@ -1281,7 +1281,7 @@ void upload() throws DataStoreException {
long startTime = System.currentTimeMillis();
LOG.info(" Uploading [{}] using [{}] threads.", files.size(), threads);
ExecutorService executor = Executors.newFixedThreadPool(threads,
new NamedThreadFactory("backend-file-upload-worker"));
BasicThreadFactory.builder().namingPattern("backend-file-upload-worker-%d").build());
int partitionSize = files.size() / (threads);
int startIndex = 0;
int endIndex = partitionSize;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.jackrabbit.oak.spi.blob.data.util.NamedThreadFactory;
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -344,7 +344,7 @@ public void testConcurrentInitWithStore() {
cache.close();

ExecutorService executor = Executors.newFixedThreadPool(10,
new NamedThreadFactory("localcache-store-worker"));
BasicThreadFactory.builder().namingPattern("localcache-store-worker-%d").build());
cache = new LocalCache(cacheDirPath, tempDirPath, 10000000, 0.95,
0.70, pendingFiles);
executor.execute(new StoreWorker(cache, byteMap));
Expand Down
Loading