public boolean appliesTo(Composite rowPrefix, ColumnFamily current, long now) throws InvalidRequestException { CellName name = current.metadata().comparator.create(rowPrefix, column); return isSatisfiedByValue(value, current.getColumn(name), column.type, operator, now); } }
public CFRowAdder addListEntry(String cql3ColumnName, Object value) { ColumnDefinition def = getDefinition(cql3ColumnName); assert def.type instanceof ListType; CellName name = cf.getComparator().create(prefix, def, ByteBuffer.wrap(UUIDGen.getTimeUUIDBytes())); return add(name, def, value); }
public boolean appliesTo(Composite rowPrefix, ColumnFamily current, long now) throws InvalidRequestException { CellName name = current.metadata().comparator.create(rowPrefix, column); for (ByteBuffer value : inValues) { if (isSatisfiedByValue(value, current.getColumn(name), column.type, Operator.EQ, now)) return true; } return false; } }
protected CellName makeIndexColumnName(ByteBuffer rowKey, Cell cell) { return getIndexComparator().create(makeIndexColumnPrefix(rowKey, cell.name()), null); }
public CFRowAdder add(String cql3ColumnName, Object value) { ColumnDefinition def = getDefinition(cql3ColumnName); return add(cf.getComparator().create(prefix, def), def, value); }
protected Cell getMetaColumn(Cell firstColumn, Float score) { CellNameType cellNameType = table.getComparator(); ColumnDefinition columnDefinition = resultMapper.tableMapper.primaryColumnDefinition; CellName cellName = cellNameType.create(firstColumn.name(), columnDefinition); return new BufferCell(cellName, UTF8Type.instance.decompose("{\"score\":" + score.toString() + "}")); }
public boolean isStale(IndexedEntry entry, ColumnFamily data, long now) { CellName name = data.getComparator().create(entry.indexedEntryPrefix, columnDef, entry.indexValue.getKey()); Cell cell = data.getColumn(name); return cell == null || !cell.isLive(now); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { CellName cname = cf.getComparator().create(prefix, column); ByteBuffer value = t.bindAndGet(params.options); cf.addColumn(value == null ? params.makeTombstone(cname) : params.makeColumn(cname, value)); } }
public CFRowAdder addMapEntry(String cql3ColumnName, Object key, Object value) { ColumnDefinition def = getDefinition(cql3ColumnName); assert def.type instanceof MapType; MapType mt = (MapType)def.type; CellName name = cf.getComparator().create(prefix, def, mt.getKeysType().decompose(key)); return add(name, def, value); }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { if (column.type.isMultiCell()) { // delete + add CellName name = cf.getComparator().create(prefix, column); cf.addAtom(params.makeTombstoneForOverwrite(name.slice())); } Adder.doAdd(t, cf, prefix, column, params); } }
public boolean isStale(IndexedEntry entry, ColumnFamily data, long now) { CellName name = data.getComparator().create(entry.indexedEntryPrefix, columnDef); Cell cell = data.getColumn(name); return cell == null || !cell.isLive(now) || columnDef.type.compare(entry.indexValue.getKey(), cell.value()) != 0; } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); long increment = ByteBufferUtil.toLong(bytes); CellName cname = cf.getComparator().create(prefix, column); cf.addColumn(params.makeCounter(cname, increment)); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { if (column.type.isMultiCell()) { // delete + put CellName name = cf.getComparator().create(prefix, column); cf.addAtom(params.makeTombstoneForOverwrite(name.slice())); } Putter.doPut(t, cf, prefix, column, params); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { if (column.type.isMultiCell()) { // delete + append CellName name = cf.getComparator().create(prefix, column); cf.addAtom(params.makeTombstoneForOverwrite(name.slice())); } Appender.doAppend(t, cf, prefix, column, params); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { ByteBuffer bytes = t.bindAndGet(params.options); if (bytes == null) throw new InvalidRequestException("Invalid null value for counter increment"); long increment = ByteBufferUtil.toLong(bytes); if (increment == Long.MIN_VALUE) throw new InvalidRequestException("The negation of " + increment + " overflows supported counter precision (signed 8 bytes integer)"); CellName cname = cf.getComparator().create(prefix, column); cf.addColumn(params.makeCounter(cname, -increment)); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { assert column.type.isMultiCell() : "Attempted to delete a single key in a frozen map"; Term.Terminal key = t.bind(params.options); if (key == null) throw new InvalidRequestException("Invalid null map key"); CellName cellName = cf.getComparator().create(prefix, column, key.get(params.options)); cf.addColumn(params.makeTombstone(cellName)); } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { CellName cname = cf.getComparator().create(prefix, column); if (column.type.isMultiCell()) cf.addAtom(params.makeRangeTombstone(cname.slice())); else cf.addColumn(params.makeTombstone(cname)); } };
public boolean isStale(IndexedEntry entry, ColumnFamily data, long now) { CellName name = data.getComparator().create(entry.indexedEntryPrefix, columnDef, entry.indexedEntryCollectionKey); Cell cell = data.getColumn(name); return cell == null || !cell.isLive(now) || ((CollectionType) columnDef.type).valueComparator().compare(entry.indexValue.getKey(), cell.value()) != 0; } }
public void execute(ByteBuffer rowKey, ColumnFamily cf, Composite prefix, UpdateParameters params) throws InvalidRequestException { assert column.type.isMultiCell() : "Attempted to delete a single element in a frozen set"; Term.Terminal elt = t.bind(params.options); if (elt == null) throw new InvalidRequestException("Invalid null set element"); CellName cellName = cf.getComparator().create(prefix, column, elt.get(params.options)); cf.addColumn(params.makeTombstone(cellName)); } }
public CFRowAdder resetCollection(String cql3ColumnName) { ColumnDefinition def = getDefinition(cql3ColumnName); assert def.type.isCollection() && def.type.isMultiCell(); Composite name = cf.getComparator().create(prefix, def); cf.addAtom(new RangeTombstone(name.start(), name.end(), timestamp - 1, ldt)); return this; }