private static ZooKeeperRegistrationSpec serverSetsSpec(
            ServerSetsRegistrationSpec spec, Server server) {
        final ServerSetsInstance serverSetsInstance = spec.serverSetsInstance();
        if (serverSetsInstance.serviceEndpoint() != null) {
            warnIfInactivePort(server, serverSetsInstance.serviceEndpoint().port(), null);
            return spec;
        }
        final ServerSetsRegistrationSpecBuilder builder =
                ZooKeeperRegistrationSpec.builderForServerSets();
        builder.serviceEndpoint(defaultEndpoint(server))
               .additionalEndpoints(serverSetsInstance.additionalEndpoints())
               .metadata(serverSetsInstance.metadata())
               .sequential(spec.isSequential())
               .nodeName(spec.path().substring(1)); // Simply remove prepended '/'.
        final Integer shardId = serverSetsInstance.shardId();
        if (shardId != null) {
            builder.shardId(shardId);
        }
        return builder.build();
    }
Returns a {@link ZooKeeperUpdatingListenerBuilder} with a ZooKeeper connection string and a znode path.

@param zkConnectionStr the ZooKeeper connection string
@param znodePath the ZooKeeper node to register
@param spec the {@link ZooKeeperRegistrationSpec} to encode and register the {@link Server}
zookeeper3/src/main/java/com/linecorp/armeria/server/zookeeper/ZooKeeperUpdatingListener.java