コード例 #1
0
  public static <T extends RingPosition<T>> boolean isInBounds(
      T token, Iterable<Bounds<T>> bounds) {
    assert bounds != null;

    for (Bounds<T> bound : bounds) {
      if (bound.contains(token)) {
        return true;
      }
    }
    return false;
  }
コード例 #2
0
ファイル: Util.java プロジェクト: hobinyoon/mutants-cassandra
  public static List<Row> getRangeSlice(ColumnFamilyStore cfs, ByteBuffer superColumn) {
    IDiskAtomFilter filter =
        superColumn == null
            ? new IdentityQueryFilter()
            : new SliceQueryFilter(
                SuperColumns.startOf(superColumn),
                SuperColumns.endOf(superColumn),
                false,
                Integer.MAX_VALUE);

    Token min = StorageService.getPartitioner().getMinimumToken();
    return cfs.getRangeSlice(Bounds.makeRowBounds(min, min), null, filter, 10000);
  }
コード例 #3
0
 public boolean intersects(Bounds<T> that) {
   // We either contains one of the that bounds, or we are fully contained into that.
   return contains(that.left) || contains(that.right) || that.contains(left);
 }