private int discardLast(ColumnFamily cf, int toDiscard, ColumnFamily newCf) {
   boolean isReversed = isReversed();
   DeletionInfo.InOrderTester tester = cf.deletionInfo().inOrderTester(isReversed);
   return isReversed
       ? discardHead(cf, toDiscard, newCf, cf.reverseIterator(), tester)
       : discardTail(cf, toDiscard, newCf, cf.iterator(), tester);
 }
示例#2
0
  public boolean isFullyCoveredBy(ColumnFamily cf, long now) {
    // cf is the beginning of a partition. It covers this filter if:
    //   1) either this filter requests the head of the partition and request less
    //      than what cf has to offer (note: we do need to use getLiveCount() for that
    //      as it knows if the filter count cells or CQL3 rows).
    //   2) the start and finish bound of this filter are included in cf.
    if (isHeadFilter() && count <= getLiveCount(cf, now)) return true;

    if (start().isEmpty() || finish().isEmpty() || !cf.hasColumns()) return false;

    Composite low = isReversed() ? finish() : start();
    Composite high = isReversed() ? start() : finish();

    CellName first = cf.iterator(ColumnSlice.ALL_COLUMNS_ARRAY).next().name();
    CellName last = cf.reverseIterator(ColumnSlice.ALL_COLUMNS_ARRAY).next().name();

    return cf.getComparator().compare(first, low) <= 0
        && cf.getComparator().compare(high, last) <= 0;
  }
示例#3
0
 public Iterator<Cell> getColumnIterator(ColumnFamily cf) {
   assert cf != null;
   return reversed ? cf.reverseIterator(slices) : cf.iterator(slices);
 }