- final DistributedDataStore dataStore = new DistributedDataStore(actorSystem,
- new ClusterWrapperImpl(actorSystem), config, introspector.newContextFactory(), restoreFromSnapshot);
+ ClusterWrapper clusterWrapper = new ClusterWrapperImpl(actorSystem);
+ DatastoreContextFactory contextFactory = introspector.newContextFactory();
+
+ final AbstractDataStore dataStore = datastoreContext.isUseTellBasedProtocol()
+ ? new ClientBackedDataStore(actorSystem, clusterWrapper, config, contextFactory, restoreFromSnapshot) :
+ new DistributedDataStore(actorSystem, clusterWrapper, config, contextFactory, restoreFromSnapshot);