private BucketShards compute()
            throws SQLException
    {
        if (!resultSet.next()) {
            return endOfData();
        }

        UUID shardUuid = uuidFromBytes(resultSet.getBytes("shard_uuid"));
        Set<String> nodeIdentifiers;
        OptionalInt bucketNumber = OptionalInt.empty();

        if (bucketToNode != null) {
            int bucket = resultSet.getInt("bucket_number");
            bucketNumber = OptionalInt.of(bucket);
            nodeIdentifiers = ImmutableSet.of(getBucketNode(bucket));
        }
        else {
            List<Integer> nodeIds = intArrayFromBytes(resultSet.getBytes("node_ids"));
            nodeIdentifiers = getNodeIdentifiers(nodeIds, shardUuid);
        }

        ShardNodes shard = new ShardNodes(shardUuid, nodeIdentifiers);
        return new BucketShards(bucketNumber, ImmutableSet.of(shard));
    }
private BucketShards compute ( ) throws SQLException { if ( ! resultSet . next ( ) ) { return endOfData ( ) ; } UUID shardUuid = uuidFromBytes ( resultSet . getBytes ( "shard_uuid" ) ) ; Set < String > nodeIdentifiers ; OptionalInt bucketNumber = OptionalInt . empty ( ) ; if ( bucketToNode != null ) { int bucket = resultSet . getInt ( "bucket_number" ) ; bucketNumber = OptionalInt . of ( bucket ) ; nodeIdentifiers = ImmutableSet . of ( getBucketNode ( bucket ) ) ; } else { List < Integer > nodeIds = intArrayFromBytes ( resultSet . getBytes ( "node_ids" ) ) ; nodeIdentifiers = getNodeIdentifiers ( nodeIds , shardUuid ) ; } ShardNodes shard = new ShardNodes ( shardUuid , nodeIdentifiers ) ; return new BucketShards ( bucketNumber , ImmutableSet . of ( shard ) ) ; }
Compute split-per-shard (separate split for each shard).