public TransactionSubsystem(INcApplicationContext appCtx, IRecoveryManagerFactory recoveryManagerFactory) {
this.appCtx = appCtx;
this.id = appCtx.getServiceContext().getNodeId();
this.txnProperties = appCtx.getTransactionProperties();
this.transactionManager = new TransactionManager(this);
this.lockManager = new ConcurrentLockManager(txnProperties.getLockManagerShrinkTimer());
final ReplicationProperties repProperties = appCtx.getReplicationProperties();
final boolean replicationEnabled = repProperties.isReplicationEnabled();
final CheckpointProperties checkpointProperties = new CheckpointProperties(txnProperties, id);
if (LOGGER.isInfoEnabled()) {
LOGGER.log(Level.INFO, "Checkpoint Properties: " + checkpointProperties);
}
checkpointManager = CheckpointManagerFactory.create(this, checkpointProperties);
final Checkpoint latestCheckpoint = checkpointManager.getLatest();
if (latestCheckpoint != null) {
transactionManager.ensureMaxTxnId(latestCheckpoint.getMaxTxnId());
}
this.logManager = replicationEnabled ? new LogManagerWithReplication(this) : new LogManager(this);
this.recoveryManager = recoveryManagerFactory.createRecoveryManager(appCtx.getServiceContext(), this);
if (txnProperties.isCommitProfilerEnabled()) {
ecp = new EntityCommitProfiler(this, this.txnProperties.getCommitProfilerReportInterval());
((ExecutorService) appCtx.getThreadExecutor()).submit(ecp);
}
}