use of org.infinispan.factories.annotations.Start in project infinispan by infinispan.
the class ClusterTopologyManagerImpl method start.
@Start(priority = 100)
public void start() {
helper = new TopologyManagementHelper(gcr);
joinViewFuture = new ConditionFuture<>(timeoutScheduledExecutor);
actionSequencer = new ActionSequencer(nonBlockingExecutor, true, timeService);
cacheManagerNotifier.addListener(viewListener);
// The listener already missed the initial view
handleClusterView(false, transport.getViewId());
globalRebalancingEnabled = join(fetchRebalancingStatusFromCoordinator(INITIAL_CONNECTION_ATTEMPTS));
}
use of org.infinispan.factories.annotations.Start in project infinispan by infinispan.
the class LocalCacheStatus method preStart.
// This must be invoked before GlobalStateManagerImpl.start
@Start(priority = 0)
public void preStart() {
helper = new TopologyManagementHelper(gcr);
actionSequencer = new ActionSequencer(nonBlockingExecutor, true, timeService);
if (globalStateManager != null) {
globalStateManager.registerStateProvider(this);
}
}
use of org.infinispan.factories.annotations.Start in project infinispan by infinispan.
the class TransactionTable method start.
// Start before cache loader manager
@Start(priority = 9)
public void start() {
this.clustered = configuration.clustering().cacheMode().isClustered();
this.isPessimisticLocking = configuration.transaction().lockingMode() == LockingMode.PESSIMISTIC;
final int concurrencyLevel = configuration.locking().concurrencyLevel();
// use the IdentityEquivalence because some Transaction implementation does not have a stable hash code function
// and it can cause some leaks in the concurrent map.
localTransactions = new ConcurrentHashMap<>(concurrencyLevel, 0.75f, concurrencyLevel);
globalToLocalTransactions = new ConcurrentHashMap<>(concurrencyLevel, 0.75f, concurrencyLevel);
boolean transactional = configuration.transaction().transactionMode().isTransactional();
if (clustered && transactional) {
minTopologyRecalculationLock = new ReentrantLock();
remoteTransactions = new ConcurrentHashMap<>(concurrencyLevel, 0.75f, concurrencyLevel);
notifier.addListener(this);
cacheManagerNotifier.addListener(this);
completedTransactionsInfo = new CompletedTransactionsInfo();
// Periodically run a task to cleanup the transaction table of completed transactions.
long interval = configuration.transaction().reaperWakeUpInterval();
timeoutExecutor.scheduleAtFixedRate(() -> completedTransactionsInfo.cleanupCompletedTransactions(), interval, interval, TimeUnit.MILLISECONDS);
timeoutExecutor.scheduleAtFixedRate(this::cleanupTimedOutTransactions, interval, interval, TimeUnit.MILLISECONDS);
}
running = true;
}
use of org.infinispan.factories.annotations.Start in project infinispan by infinispan.
the class PreloadManager method doPreload.
private CompletionStage<Void> doPreload() {
Publisher<MarshallableEntry<Object, Object>> publisher = persistenceManager.preloadPublisher();
long start = timeService.time();
final long maxEntries = getMaxEntries();
final long flags = getFlagsForStateInsertion();
AdvancedCache<?, ?> tmpCache = this.cache.wired().withStorageMediaType();
DataConversion keyDataConversion = tmpCache.getKeyDataConversion();
DataConversion valueDataConversion = tmpCache.getValueDataConversion();
Transaction outerTransaction = suspendIfNeeded();
try {
return Flowable.fromPublisher(publisher).take(maxEntries).concatMapSingle(me -> preloadEntry(flags, me, keyDataConversion, valueDataConversion)).count().toCompletionStage().thenAccept(insertAmount -> {
this.fullyPreloaded = insertAmount < maxEntries;
log.debugf("Preloaded %d keys in %s", insertAmount, Util.prettyPrintTime(timeService.timeDuration(start, MILLISECONDS)));
});
} finally {
resumeIfNeeded(outerTransaction);
}
}
use of org.infinispan.factories.annotations.Start in project infinispan by infinispan.
the class ScriptingManagerImpl method start.
@Start
public void start() {
ClassLoader classLoader = globalConfiguration.classLoader();
this.scriptEngineManager = new ScriptEngineManager(classLoader);
taskManager.registerTaskEngine(new ScriptingTaskEngine(this));
scriptConversions = new ScriptConversions(encoderRegistry);
}
Aggregations