class ShardManager extends AbstractUntypedPersistentActorWithMetering {

    @SuppressWarnings("checkstyle:IllegalCatch")
    private void onCreateShard(final CreateShard createShard) {
        LOG.debug("{}: onCreateShard: {}", persistenceId(), createShard);

        Object reply;
        try {
            String shardName = createShard.getModuleShardConfig().getShardName();
            if (localShards.containsKey(shardName)) {
                LOG.debug("{}: Shard {} already exists", persistenceId(), shardName);
                reply = new Status.Success(String.format("Shard with name %s already exists", shardName));
            } else {
                doCreateShard(createShard);
                reply = new Status.Success(null);
            }
        } catch (Exception e) {
            LOG.error("{}: onCreateShard failed", persistenceId(), e);
            reply = new Status.Failure(e);
        }

        if (getSender() != null && !getContext().system().deadLetters().equals(getSender())) {
            getSender().tell(reply, getSelf());
        }
    }

      ShardManager(final AbstractShardManagerCreator<?> builder);

}