@Override public ByteBuffer getColumn(Cell element) { return org.apache.cassandra.utils.ByteBufferUtil.clone(element.name().toByteBuffer()); }
names.add(CellNames.simpleDense(ByteBufferUtil.zeroByteBuffer(1))); NamesQueryFilter nqf = new NamesQueryFilter(names); SliceByNamesReadCommand cmd = new SliceByNamesReadCommand(ks, ByteBufferUtil.zeroByteBuffer(1), cf, 1L, nqf);
CFMetaData cfm = new CFMetaData(keyspaceName, columnfamilyName, ColumnFamilyType.Standard, CellNames.fromAbstractType(comparator, true));
public final Composite start(CellName cellName) { CBuilder builder = clusteringCType.builder(); for (int i = 0; i < cellName.clusteringSize(); i++) { ByteBuffer component = cellName.get(i); builder.add(component); } return builder.build(); }
private CellName create(Composite prefix, ColumnIdentifier columnName, boolean isStatic) { if (isStatic) prefix = staticPrefix(); assert prefix.size() == clusteringSize; if (prefix.isEmpty()) return new CompoundSparseCellName(columnName, isStatic); assert prefix instanceof CompoundComposite; CompoundComposite lc = (CompoundComposite)prefix; return new CompoundSparseCellName(lc.elements, clusteringSize, columnName, isStatic); }
protected Composite makeWith(ByteBuffer[] components, int size, Composite.EOC eoc, boolean isStatic) { if (size < clusteringSize + 1 || eoc != Composite.EOC.NONE) return new CompoundComposite(components, size, isStatic).withEOC(eoc); return new CompoundSparseCellName(components, clusteringSize, idFor(components[clusteringSize]), isStatic); }
public CellName create(Composite prefix, ColumnDefinition column) { assert prefix.size() == 1; // We ignore the column because it's just the COMPACT_VALUE name which is not store in the cell name return new SimpleDenseCellName(prefix.get(0)); }
@Override protected Composite makeWith(ByteBuffer[] components, int size, Composite.EOC eoc, boolean isStatic) { if (size < fullSize) return super.makeWith(components, size, eoc, isStatic); return new CompoundSparseCellName.WithCollection(components, clusteringSize, idFor(components[clusteringSize]), components[fullSize - 1], isStatic); }
@Override public Composite make(Object... components) { return components.length == size() ? makeCellName(components) : super.make(components); }
public Composite build() { if (size == 0) return Composites.EMPTY; // We don't allow to add more element to a builder that has been built so // that we don't have to copy values. built = true; // If the builder is full and we're building a dense cell name, then we can // directly allocate the CellName object as it's complete. if (size == values.length && type instanceof CellNameType && ((CellNameType)type).isDense()) return new CompoundDenseCellName(values); return new CompoundComposite(values, size, false); }
public Composite readNext() throws IOException { maybeReadNext(); if (nextFull == EMPTY) return Composites.EMPTY; deserializeAll(); Composite c = type.copyAndMakeWith(nextComponents, nextSize, nextEOC, nextIsStatic); nextFull = null; return c; }
private CompoundSparseCellNameType(CompoundCType clusteringType, AbstractType<?> columnNameType, CompoundCType fullType, Map<ByteBuffer, ColumnIdentifier> internedIds) { super(clusteringType, fullType); this.columnNameType = columnNameType; this.internedIds = internedIds; this.staticPrefix = makeStaticPrefix(clusteringType.size()); }
public CType getKeyValidatorAsCType() { return keyValidator instanceof CompositeType ? new CompoundCType(((CompositeType) keyValidator).types) : new SimpleCType(keyValidator); }
protected AbstractCompoundCellNameType(CompoundCType clusteringType, CompoundCType fullType) { super(isByteOrderComparable(fullType.types)); this.clusteringType = clusteringType; this.fullType = fullType; this.clusteringSize = clusteringType.size(); this.fullSize = fullType.size(); }
public Composite readNext() throws IOException { maybeReadNext(); Composite c = type.fromByteBuffer(next); next = null; return c; }
public Composite copy(CFMetaData cfm, AbstractAllocator allocator) { return new BoundedComposite(wrapped.copy(cfm, allocator), isStart); } }
public long serializedSize(CellName c, TypeSizes type) { return serializer().serializedSize(c, type); } };
rm.add(columnFamily, CellNames.simpleDense(e.getColumnAs(StaticBuffer.BB_FACTORY)), e.getValueAs(StaticBuffer.BB_FACTORY), commitTime.getAdditionTime(times), ttl); } else { rm.add(columnFamily, CellNames.simpleDense(e.getColumnAs(StaticBuffer.BB_FACTORY)), e.getValueAs(StaticBuffer.BB_FACTORY), commitTime.getAdditionTime(times)); rm.delete(columnFamily, CellNames.simpleDense(col.as(StaticBuffer.BB_FACTORY)), commitTime.getDeletionTime(times));
Composite startComposite = CellNames.simpleDense(query.getSliceStart().asByteBuffer()); Composite endComposite = CellNames.simpleDense(query.getSliceEnd().asByteBuffer()); SliceQueryFilter sqf = new SliceQueryFilter(startComposite, endComposite, false, query.getLimit() + (query.hasLimit()?1:0));