public int compareTo(ColumnSubselection other) { assert other.column().name.equals(column().name); return column().cellPathComparator().compare(comparisonPath(), other.comparisonPath()); }
private boolean hasSubselection(CellPath path) { while (current != null || iterator.hasNext()) { if (current == null) current = iterator.next(); int cmp = current.compareInclusionOf(path); if (cmp == 0) // The path is included return true; else if (cmp < 0) // The path is before this sub-selection, it's not included by any return false; // the path is after this sub-selection, we need to check the next one. current = null; } return false; } }
public Builder select(ColumnDefinition c, CellPath elt) { return addSubSelection(ColumnSubselection.element(c, elt)); }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
private Builder addSubSelection(ColumnSubselection subSelection) { add(subSelection.column()); if (subSelections == null) subSelections = new ArrayList<>(); subSelections.add(subSelection); return this; }
public Builder slice(ColumnDefinition c, CellPath from, CellPath to) { return addSubSelection(ColumnSubselection.slice(c, from, to)); }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
private Builder addSubSelection(ColumnSubselection subSelection) { add(subSelection.column()); if (subSelections == null) subSelections = new ArrayList<>(); subSelections.add(subSelection); return this; }
public Builder slice(ColumnDefinition c, CellPath from, CellPath to) { return addSubSelection(ColumnSubselection.slice(c, from, to)); }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
public int compareTo(ColumnSubselection other) { assert other.column().name.equals(column().name); return column().cellPathComparator().compare(comparisonPath(), other.comparisonPath()); }
private Builder addSubSelection(ColumnSubselection subSelection) { add(subSelection.column()); if (subSelections == null) subSelections = new ArrayList<>(); subSelections.add(subSelection); return this; }
private boolean hasSubselection(CellPath path) { while (current != null || iterator.hasNext()) { if (current == null) current = iterator.next(); int cmp = current.compareInclusionOf(path); if (cmp == 0) // The path is included return true; else if (cmp < 0) // The path is before this sub-selection, it's not included by any return false; // the path is after this sub-selection, we need to check the next one. current = null; } return false; } }
public Builder select(ColumnDefinition c, CellPath elt) { return addSubSelection(ColumnSubselection.element(c, elt)); }
public Builder slice(ColumnDefinition c, CellPath from, CellPath to) { return addSubSelection(ColumnSubselection.slice(c, from, to)); }
public void serialize(ColumnSubselection subSel, DataOutputPlus out, int version) throws IOException { ColumnDefinition column = subSel.column(); ByteBufferUtil.writeWithShortLength(column.name.bytes, out); out.writeByte(subSel.kind().ordinal()); switch (subSel.kind()) { case SLICE: Slice slice = (Slice)subSel; column.cellPathSerializer().serialize(slice.from, out); column.cellPathSerializer().serialize(slice.to, out); break; case ELEMENT: Element eltSelection = (Element)subSel; column.cellPathSerializer().serialize(eltSelection.element, out); break; default: throw new AssertionError(); } }
public int compareTo(ColumnSubselection other) { assert other.column().name.equals(column().name); return column().cellPathComparator().compare(comparisonPath(), other.comparisonPath()); }
private Builder addSubSelection(ColumnSubselection subSelection) { add(subSelection.column()); if (subSelections == null) subSelections = new ArrayList<>(); subSelections.add(subSelection); return this; }
private boolean hasSubselection(CellPath path) { while (current != null || iterator.hasNext()) { if (current == null) current = iterator.next(); int cmp = current.compareInclusionOf(path); if (cmp == 0) // The path is included return true; else if (cmp < 0) // The path is before this sub-selection, it's not included by any return false; // the path is after this sub-selection, we need to check the next one. current = null; } return false; } }
public Builder select(ColumnDefinition c, CellPath elt) { return addSubSelection(ColumnSubselection.element(c, elt)); }