- return dataTree.isPresent() ? new LocalProxyHistory(client, identifier, dataTree.get())
- : new RemoteProxyHistory(client, identifier);
+ return dataTree.isPresent() ? new ClientLocalProxyHistory(client, identifier, dataTree.get())
+ : new RemoteProxyHistory(client, identifier);
+ }
+
+ static AbstractProxyHistory createSingle(final DistributedDataStoreClientBehavior client,
+ final Optional<ShardBackendInfo> backendInfo, final LocalHistoryIdentifier identifier) {
+ final Optional<DataTree> dataTree = backendInfo.flatMap(ShardBackendInfo::getDataTree);
+ return dataTree.isPresent() ? new SingleLocalProxyHistory(client, identifier, dataTree.get())
+ : new RemoteProxyHistory(client, identifier);