/** * Constructs a new bucket set that contains a single id. * * @param id The id to add to this as initial value. */ public BucketSet(BucketId id) { add(id); }
/** * Compares a search column node with a literal node. * * @param factory The bucket id factory used. * @param node The search column node. * @param literal The literal node to compare to. * @return The bucket set containing the buckets covered. */ private BucketSet compare(BucketIdFactory factory, SearchColumnNode node, LiteralNode literal) { Object value = literal.getValue(); int bucketCount = (int) Math.pow(2, 16); if (value instanceof Long) { BucketSet ret = new BucketSet(); for (int i = 0; i < bucketCount; i++) { BucketId id = new BucketId(16, i); if ((Long)value == node.getDistribution().getColumn(id)) { ret.add(new BucketId(16, i)); } } return ret; } return null; }