/** * Returns the intersection between this bucket set and another. * * @param rhs The set to form an intersection with. * @return The intersection. */ public BucketSet intersection(BucketSet rhs) { if (rhs == null) { return new BucketSet(this); // The other has all buckets marked, this is the smaller. } else { BucketSet ret = new BucketSet(this); ret.retainAll(rhs); return ret; } }
/** * Returns the union between this bucket set and another. * * @param rhs The set to form a union with. * @return The union. */ public BucketSet union(BucketSet rhs) { if (rhs == null) { return null; } else { BucketSet ret = new BucketSet(this); ret.addAll(rhs); return ret; } }
return new BucketSet(factory.getBucketId(new DocumentId(name))); return new BucketSet(new BucketId(factory.getLocationBitCount(), (Long)value)); return new BucketSet(new BucketId(factory.getLocationBitCount(), new GroupDocIdString("", name, "").getLocation())); return new BucketSet(new BucketId((Long)value));
/** * 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; }