public boolean hasStaticSlice(CFMetaData cfm) { for (ColumnSlice slice : slices) if (sliceIncludesStatics(slice, cfm)) return true; return false; }
/** * Splits this filter into two SliceQueryFilters: one that slices only the static columns, and one that slices the * remainder of the normal data. * * This should only be called when the filter is reversed and the filter is known to cover static columns (through * hasStaticSlice()). * * @return a pair of (static, normal) SliceQueryFilters */ public Pair<SliceQueryFilter, SliceQueryFilter> splitOutStaticSlice(CFMetaData cfm) { assert reversed; Composite staticSliceEnd = cfm.comparator.staticPrefix().end(); List<ColumnSlice> nonStaticSlices = new ArrayList<>(slices.length); for (ColumnSlice slice : slices) { if (sliceIncludesStatics(slice, cfm)) nonStaticSlices.add(new ColumnSlice(slice.start, staticSliceEnd)); else nonStaticSlices.add(slice); } return Pair.create( new SliceQueryFilter(staticSliceEnd, Composites.EMPTY, true, count, compositesToGroup), new SliceQueryFilter(nonStaticSlices.toArray(new ColumnSlice[nonStaticSlices.size()]), true, count, compositesToGroup)); }
if (!reversed && sliceIncludesStatics(slice, cfm)) newSlices.add(new ColumnSlice(Composites.EMPTY, cfm.comparator.staticPrefix().end())); if (!reversed && sliceIncludesStatics(slice, cfm) && !newStart.isEmpty()) newSlices.add(new ColumnSlice(Composites.EMPTY, cfm.comparator.staticPrefix().end()));