move spring value defaults to module alfresco-global
This commit is contained in:
@@ -9,14 +9,8 @@ import java.util.Map;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.service.cmr.repository.InvalidNodeRefException;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.NodeService;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.extensions.webscripts.WebScriptException;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
import org.springframework.extensions.webscripts.WebScriptResponse;
|
||||
|
||||
+2
-10
@@ -12,17 +12,12 @@ import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.repo.index.shard.Floc;
|
||||
import org.alfresco.repo.index.shard.Shard;
|
||||
import org.alfresco.repo.index.shard.ShardInstance;
|
||||
import org.alfresco.repo.index.shard.ShardRegistry;
|
||||
import org.alfresco.repo.index.shard.ShardState;
|
||||
import org.alfresco.service.cmr.repository.StoreRef;
|
||||
import org.alfresco.service.cmr.search.SearchParameters;
|
||||
import org.alfresco.service.cmr.search.SearchService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -45,9 +40,6 @@ public abstract class AbstractActionService {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Autowired
|
||||
private NamespaceService namespaceService;
|
||||
|
||||
@Autowired
|
||||
private ApiService apiService;
|
||||
|
||||
@@ -58,10 +50,10 @@ public abstract class AbstractActionService {
|
||||
@Qualifier(Constants.QUALIFIER_ASIE)
|
||||
private ShardRegistry shardRegistry;
|
||||
|
||||
@Value("${inteligr8.asie.default.concurrentQueueSize:64}")
|
||||
@Value("${inteligr8.asie.default.concurrentQueueSize}")
|
||||
private int concurrentQueueSize;
|
||||
|
||||
@Value("${inteligr8.asie.default.concurrency:16}")
|
||||
@Value("${inteligr8.asie.default.concurrency}")
|
||||
private int concurrency;
|
||||
|
||||
protected int getConcurrency() {
|
||||
|
||||
+4
-2
@@ -8,6 +8,7 @@ import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Future;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.TimeoutException;
|
||||
@@ -25,6 +26,7 @@ import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.DisposableBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -61,10 +63,10 @@ public abstract class AbstractNodeActionService {
|
||||
@Qualifier(Constants.QUALIFIER_ASIE)
|
||||
private ShardRegistry shardRegistry;
|
||||
|
||||
@Value("${inteligr8.asie.default.concurrentQueueSize:64}")
|
||||
@Value("${inteligr8.asie.default.concurrentQueueSize}")
|
||||
private int concurrentQueueSize;
|
||||
|
||||
@Value("${inteligr8.asie.default.concurrency:16}")
|
||||
@Value("${inteligr8.asie.default.concurrency}")
|
||||
private int concurrency;
|
||||
|
||||
protected int getConcurrency() {
|
||||
|
||||
@@ -62,16 +62,16 @@ public class AcsReconcileService implements InitializingBean, DisposableBean {
|
||||
@Autowired
|
||||
private ReindexService reindexService;
|
||||
|
||||
@Value("${inteligr8.asie.reconciliation.nodesChunkSize:250}")
|
||||
@Value("${inteligr8.asie.reconciliation.nodesChunkSize}")
|
||||
private int nodesChunkSize;
|
||||
|
||||
@Value("${inteligr8.asie.reconciliation.nodeTimeoutSeconds:10}")
|
||||
@Value("${inteligr8.asie.reconciliation.nodeTimeoutSeconds}")
|
||||
private int nodeTimeoutSeconds;
|
||||
|
||||
@Value("${inteligr8.asie.reconciliation.concurrentQueueSize:64}")
|
||||
@Value("${inteligr8.asie.reconciliation.concurrentQueueSize}")
|
||||
private int concurrentQueueSize;
|
||||
|
||||
@Value("${inteligr8.asie.reconciliation.concurrency:2}")
|
||||
@Value("${inteligr8.asie.reconciliation.concurrency}")
|
||||
private int concurrency;
|
||||
|
||||
private ThrottledThreadPoolExecutor executor;
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ApiService implements InitializingBean {
|
||||
@Value("${inteligr8.asie.basePath}")
|
||||
private String solrBaseUrl;
|
||||
|
||||
@Value("${inteligr8.asie.reconciliation.nodesChunkSize:250}")
|
||||
@Value("${inteligr8.asie.reconciliation.nodesChunkSize}")
|
||||
private int nodesChunkSize;
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,7 @@ import com.inteligr8.alfresco.asie.util.ThrottledThreadPoolExecutor;
|
||||
@Component
|
||||
public class ExecutorManager implements InitializingBean, DisposableBean, RemovalListener<String, ExecutorService> {
|
||||
|
||||
@Value("${inteligr8.asie.executors.expireTimeInMinutes:30}")
|
||||
@Value("${inteligr8.asie.executors.expireTimeInMinutes}")
|
||||
private int expireTimeInMinutes;
|
||||
|
||||
private Cache<String, ExecutorService> refCache;
|
||||
|
||||
@@ -79,7 +79,7 @@ public class CompositeFuture<T> implements Future<T> {
|
||||
List<T> results = new ArrayList<>(this.futures.size());
|
||||
for (Future<T> future : this.futures) {
|
||||
if (future instanceof RunnableFuture<?>) {
|
||||
this.logger.debug("Waiting {} ms since the start of the exectuion of the future to complete", unit.toMillis(timeout));
|
||||
this.logger.debug("Waiting {} ms since the start of the execution of the future to complete", unit.toMillis(timeout));
|
||||
results.add(((RunnableFuture<T>) future).get(timeout, unit));
|
||||
} else {
|
||||
long remainingTimeMillis = expireTimeMillis - System.currentTimeMillis();
|
||||
@@ -124,6 +124,7 @@ public class CompositeFuture<T> implements Future<T> {
|
||||
List<CompositeFuture<?>> cfutures = new LinkedList<>();
|
||||
int removedCancelled = 0;
|
||||
int removedDone = 0;
|
||||
int remain = 0;
|
||||
|
||||
Iterator<Future<T>> i = this.futures.iterator();
|
||||
while (i.hasNext()) {
|
||||
@@ -132,16 +133,20 @@ public class CompositeFuture<T> implements Future<T> {
|
||||
if (includeCancelled) {
|
||||
removedCancelled++;
|
||||
i.remove();
|
||||
} else {
|
||||
remain++;
|
||||
}
|
||||
} else if (future.isDone()) {
|
||||
removedDone++;
|
||||
i.remove();
|
||||
} else if (future instanceof CompositeFuture<?>) {
|
||||
cfutures.add((CompositeFuture<?>) future);
|
||||
} else {
|
||||
remain++;
|
||||
}
|
||||
}
|
||||
|
||||
this.logger.debug("Purged {} cancelled and {} completed futures", removedCancelled, removedDone);
|
||||
this.logger.debug("Purged {} cancelled and {} completed futures; {} remain", removedCancelled, removedDone, remain);
|
||||
|
||||
for (CompositeFuture<?> cfuture : cfutures)
|
||||
cfuture.purge(includeCancelled);
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public class ThrottledThreadPoolExecutor extends ThreadPoolExecutor {
|
||||
this.getQueue().put(runnable);
|
||||
} else {
|
||||
if (!this.getQueue().offer(runnable, throttlingBlockTimeout, throttlingBlockUnit))
|
||||
throw new TimeoutException();
|
||||
throw new TimeoutException("Timeout waiting for queue space for runnable");
|
||||
}
|
||||
|
||||
return runnable;
|
||||
|
||||
+17
@@ -1,8 +1,25 @@
|
||||
|
||||
# defaulting to 3 days = 60 * 24 * 3 = 4320
|
||||
# once the node is selected, no other node for the shard will be used for the backup
|
||||
inteligr8.asie.backup.persistTimeMinutes=4320
|
||||
|
||||
# what authorities (users or groups) may use the REST services provided by this module?
|
||||
inteligr8.asie.allowedAuthorities=GROUP_ALFRESCO_ADMINISTRATORS
|
||||
|
||||
# same as solr.baseUrl, but that property is private to the Search subsystem
|
||||
inteligr8.asie.basePath=/solr
|
||||
|
||||
|
||||
# How long should idle executors remain before being shutdown?
|
||||
# They will re-initialize if needed again
|
||||
inteligr8.asie.executors.expireTimeInMinutes=30
|
||||
|
||||
# Reconciliation configuration; each node will be processed in its own thread
|
||||
inteligr8.asie.reconciliation.nodesChunkSize=250
|
||||
inteligr8.asie.reconciliation.nodeTimeoutSeconds=10
|
||||
inteligr8.asie.reconciliation.concurrentQueueSize=32
|
||||
inteligr8.asie.reconciliation.concurrency=2
|
||||
|
||||
# Action (like indexing and re-indexing) configuration
|
||||
inteligr8.asie.default.concurrentQueueSize=32
|
||||
inteligr8.asie.default.concurrency=2
|
||||
|
||||
Reference in New Issue
Block a user