-public class DistributedDataStore implements DOMStore, SchemaContextListener,
- DatastoreContextConfigAdminOverlay.Listener, AutoCloseable {
-
- private static final Logger LOG = LoggerFactory.getLogger(DistributedDataStore.class);
- private static final String UNKNOWN_TYPE = "unknown";
-
- private static final long READY_WAIT_FACTOR = 3;
-
- private final ActorContext actorContext;
- private final long waitTillReadyTimeInMillis;
-
-
- private AutoCloseable closeable;
-
- private DatastoreConfigurationMXBeanImpl datastoreConfigMXBean;
-
- private CountDownLatch waitTillReadyCountDownLatch = new CountDownLatch(1);
-
- private final String type;
-
- public DistributedDataStore(ActorSystem actorSystem, ClusterWrapper cluster,
- Configuration configuration, DatastoreContext datastoreContext) {
- 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(datastoreContext, "datastoreContext should not be null");
-
- this.type = datastoreContext.getDataStoreType();
-
- String shardManagerId = ShardManagerIdentifier.builder().type(type).build().toString();
-
- LOG.info("Creating ShardManager : {}", shardManagerId);
-
- String shardDispatcher =
- new Dispatchers(actorSystem.dispatchers()).getDispatcherPath(Dispatchers.DispatcherType.Shard);
-
- actorContext = new ActorContext(actorSystem, actorSystem.actorOf(
- ShardManager.props(cluster, configuration, datastoreContext, waitTillReadyCountDownLatch)
- .withDispatcher(shardDispatcher).withMailbox(ActorContext.MAILBOX), shardManagerId ),
- cluster, configuration, datastoreContext);
-
- this.waitTillReadyTimeInMillis =
- actorContext.getDatastoreContext().getShardLeaderElectionTimeout().duration().toMillis() * READY_WAIT_FACTOR;
-
-
- datastoreConfigMXBean = new DatastoreConfigurationMXBeanImpl(datastoreContext.getDataStoreMXBeanType());
- datastoreConfigMXBean.setContext(datastoreContext);
- datastoreConfigMXBean.registerMBean();
+@Deprecated(since = "7.0.0", forRemoval = true)
+public class DistributedDataStore extends AbstractDataStore {
+ private final TransactionContextFactory txContextFactory;
+
+ public DistributedDataStore(final ActorSystem actorSystem, final ClusterWrapper cluster,
+ final Configuration configuration, final DatastoreContextFactory datastoreContextFactory,
+ final DatastoreSnapshot restoreFromSnapshot) {
+ super(actorSystem, cluster, configuration, datastoreContextFactory, restoreFromSnapshot);
+ txContextFactory = new TransactionContextFactory(getActorUtils(), getIdentifier());