- private void createLocalHistory(final CreateLocalHistoryCommand command) {
- final CompletableFuture<ClientLocalHistory> future = command.future();
- final LocalHistoryIdentifier historyId = new LocalHistoryIdentifier(getIdentifier(), nextHistoryId++);
- LOG.debug("{}: creating a new local history {} for {}", persistenceId(), historyId, future);
-
- // FIXME: initiate backend instantiation
- future.completeExceptionally(new UnsupportedOperationException("Not implemented yet"));
- }
-
- @Override
- protected ClientActorBehavior onCommand(final Object command) {
- if (command instanceof CreateLocalHistoryCommand) {
- createLocalHistory((CreateLocalHistoryCommand) command);
- } else if (command instanceof GetClientRequest) {
- ((GetClientRequest) command).getReplyTo().tell(new Status.Success(this), ActorRef.noSender());
- } else if (SHUTDOWN.equals(command)) {
- // FIXME: Add shutdown procedures here
- return null;
- } else {
- LOG.warn("{}: ignoring unhandled command {}", persistenceId(), command);
- }
-
- return this;
- }
-
- //
- //
- // Methods below are invoked from application threads
- //
- //
-
- @Override
- public CompletionStage<ClientLocalHistory> createLocalHistory() {
- final CreateLocalHistoryCommand command = new CreateLocalHistoryCommand();
- self().tell(command, ActorRef.noSender());
- return command.future();
+ DistributedDataStoreClientBehavior(final ClientActorContext context, final ActorContext actorContext) {
+ this(context, new ModuleShardBackendResolver(context.getIdentifier(), actorContext));