static NameType typeOf(CellName name) { if (name instanceof CompoundDenseCellName) { assert !name.isStatic(); return COMPOUND_DENSE; } if (name instanceof CompoundSparseCellName) return name.isStatic() ? COMPOUND_SPARSE_STATIC : COMPOUND_SPARSE; if (name instanceof SimpleDenseCellName) { assert !name.isStatic(); return SIMPLE_DENSE; } if (name instanceof SimpleSparseCellName) { assert !name.isStatic(); return SIMPLE_SPARSE; } if (name instanceof NativeCell) return ((NativeCell) name).nametype(); throw new AssertionError(); } }
public SparseRowIterator(CFMetaData cfMetaData, CellNameType type, Iterator<Cell> cells, long now) { this.cfMetaData = cfMetaData; this.type = type; this.cells = cells; this.now = now; this.staticRow = hasNextCell() && nextCell.name().isStatic() ? computeNext() : null; }
public boolean isSameCQL3RowAs(CellNameType type, CellName other) { if (clusteringSize() != other.clusteringSize() || other.isStatic() != isStatic()) return false; for (int i = 0; i < clusteringSize(); i++) { if (type.subtype(i).compare(elements[i], other.get(i)) != 0) return false; } return true; }
public boolean isSameCQL3RowAs(CellNameType type, CellName other) { switch (nametype()) { case SIMPLE_DENSE: case COMPOUND_DENSE: return type.compare(this, other) == 0; case COMPOUND_SPARSE_STATIC: case COMPOUND_SPARSE: int clusteringSize = clusteringSize(); if (clusteringSize != other.clusteringSize() || other.isStatic() != isStatic()) return false; for (int i = 0; i < clusteringSize; i++) if (type.subtype(i).compare(get(i), other.get(i)) != 0) return false; return true; case SIMPLE_SPARSE: return true; default: throw new AssertionError(); } }
live++; else if (!current.isStatic()) // ignore statics if we've seen any other statics or any other groups