- public DistributedDataStore(ActorSystem actorSystem, ClusterWrapper cluster,
- Configuration configuration, DatastoreContextFactory datastoreContextFactory,
- DatastoreSnapshot restoreFromSnapshot) {
- Preconditions.checkNotNull(actorSystem, "actorSystem should not be null");
- Preconditions.checkNotNull(cluster, "cluster should not be null");
- Preconditions.checkNotNull(configuration, "configuration should not be null");
- Preconditions.checkNotNull(datastoreContextFactory, "datastoreContextFactory should not be null");
-
- this.type = datastoreContextFactory.getBaseDatastoreContext().getDataStoreType();
-
- String shardManagerId = ShardManagerIdentifier.builder().type(type).build().toString();
-
- LOG.info("Creating ShardManager : {}", shardManagerId);
-
- String shardDispatcher =
- new Dispatchers(actorSystem.dispatchers()).getDispatcherPath(Dispatchers.DispatcherType.Shard);
-
- PrimaryShardInfoFutureCache primaryShardInfoCache = new PrimaryShardInfoFutureCache();
-
- ShardManager.Builder builder = ShardManager.builder().cluster(cluster).configuration(configuration).
- datastoreContextFactory(datastoreContextFactory).waitTillReadyCountdownLatch(waitTillReadyCountDownLatch).
- primaryShardInfoCache(primaryShardInfoCache).restoreFromSnapshot(restoreFromSnapshot);
-
- actorContext = new ActorContext(actorSystem, createShardManager(actorSystem, builder, shardDispatcher,
- shardManagerId), cluster, configuration, datastoreContextFactory.getBaseDatastoreContext(), primaryShardInfoCache);
-
- this.waitTillReadyTimeInMillis =
- actorContext.getDatastoreContext().getShardLeaderElectionTimeout().duration().toMillis() * READY_WAIT_FACTOR;
-
- this.txContextFactory = TransactionContextFactory.create(actorContext);
-
- datastoreConfigMXBean = new DatastoreConfigurationMXBeanImpl(
- datastoreContextFactory.getBaseDatastoreContext().getDataStoreMXBeanType());
- datastoreConfigMXBean.setContext(datastoreContextFactory.getBaseDatastoreContext());
- datastoreConfigMXBean.registerMBean();
-
- datastoreInfoMXBean = new DatastoreInfoMXBeanImpl(datastoreContextFactory.getBaseDatastoreContext().
- getDataStoreMXBeanType(), actorContext);
- datastoreInfoMXBean.registerMBean();
+ public DistributedDataStore(final ActorSystem actorSystem, final ClusterWrapper cluster,
+ final Configuration configuration, final DatastoreContextFactory datastoreContextFactory,
+ final DatastoreSnapshot restoreFromSnapshot) {
+ super(actorSystem, cluster, configuration, datastoreContextFactory, restoreFromSnapshot);
+ this.txContextFactory = new TransactionContextFactory(getActorContext(), getIdentifier());