public List<ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException { List<ByteBuffer> partitionKeys = restrictions.getPartitionKeys(options); for (ByteBuffer key : partitionKeys) QueryProcessor.validateKey(key); return partitionKeys; }
public List<ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException { List<ByteBuffer> partitionKeys = restrictions.getPartitionKeys(options); for (ByteBuffer key : partitionKeys) QueryProcessor.validateKey(key); return partitionKeys; }
public List<ByteBuffer> buildPartitionKeyNames(QueryOptions options) throws InvalidRequestException { List<ByteBuffer> partitionKeys = restrictions.getPartitionKeys(options); for (ByteBuffer key : partitionKeys) QueryProcessor.validateKey(key); return partitionKeys; }
private void validate(Collection<Mutation> tmutations) throws InvalidRequestException { for (Mutation mutation : tmutations) { QueryProcessor.validateKey(mutation.key().getKey()); for (PartitionUpdate update : mutation.getPartitionUpdates()) update.validate(); } }
private void validate(Collection<Mutation> tmutations) throws InvalidRequestException { for (Mutation mutation : tmutations) { QueryProcessor.validateKey(mutation.key().getKey()); for (PartitionUpdate update : mutation.getPartitionUpdates()) update.validate(); } }
private void validate(Collection<Mutation> tmutations) throws InvalidRequestException { for (Mutation mutation : tmutations) { QueryProcessor.validateKey(mutation.key().getKey()); for (PartitionUpdate update : mutation.getPartitionUpdates()) update.validate(); } }
private List<ReadCommand> getSliceCommands(QueryOptions options, int limit, long now) throws RequestValidationException { Collection<ByteBuffer> keys = getKeys(options); if (keys.isEmpty()) // in case of IN () for (the last column of) the partition key. return null; List<ReadCommand> commands = new ArrayList<>(keys.size()); IDiskAtomFilter filter = makeFilter(options, limit); if (filter == null) return null; // Note that we use the total limit for every key, which is potentially inefficient. // However, IN + LIMIT is not a very sensible choice. for (ByteBuffer key : keys) { QueryProcessor.validateKey(key); // We should not share the slice filter amongst the commands (hence the cloneShallow), due to // SliceQueryFilter not being immutable due to its columnCounter used by the lastCounted() method // (this is fairly ugly and we should change that but that's probably not a tiny refactor to do that cleanly) commands.add(ReadCommand.create(keyspace(), ByteBufferUtil.clone(key), columnFamily(), now, filter.cloneShallow())); } return commands; }
private void validate(Collection<Mutation> tmutations) throws InvalidRequestException { for (Mutation mutation : tmutations) { QueryProcessor.validateKey(mutation.key()); for (ColumnFamily tcf : mutation.getColumnFamilies()) for (Cell cell : tcf) cell.validateFields(tcf.metadata()); } }
private ReadQuery getSliceCommands(QueryOptions options, DataLimits limit, int nowInSec) throws RequestValidationException { Collection<ByteBuffer> keys = restrictions.getPartitionKeys(options); if (keys.isEmpty()) return ReadQuery.EMPTY; ClusteringIndexFilter filter = makeClusteringIndexFilter(options); if (filter == null) return ReadQuery.EMPTY; RowFilter rowFilter = getRowFilter(options); // Note that we use the total limit for every key, which is potentially inefficient. // However, IN + LIMIT is not a very sensible choice. List<SinglePartitionReadCommand> commands = new ArrayList<>(keys.size()); for (ByteBuffer key : keys) { QueryProcessor.validateKey(key); DecoratedKey dk = cfm.decorateKey(ByteBufferUtil.clone(key)); ColumnFilter cf = (cfm.isSuper() && cfm.isDense()) ? SuperColumnCompatibility.getColumnFilter(cfm, options, restrictions.getSuperColumnRestrictions()) : queriedColumns; commands.add(SinglePartitionReadCommand.create(cfm, nowInSec, cf, rowFilter, limit, dk, filter)); } return new SinglePartitionReadCommand.Group(commands, limit); }
private ReadQuery getSliceCommands(QueryOptions options, DataLimits limit, int nowInSec) throws RequestValidationException { Collection<ByteBuffer> keys = restrictions.getPartitionKeys(options); if (keys.isEmpty()) return ReadQuery.EMPTY; ClusteringIndexFilter filter = makeClusteringIndexFilter(options); if (filter == null) return ReadQuery.EMPTY; RowFilter rowFilter = getRowFilter(options); // Note that we use the total limit for every key, which is potentially inefficient. // However, IN + LIMIT is not a very sensible choice. List<SinglePartitionReadCommand> commands = new ArrayList<>(keys.size()); for (ByteBuffer key : keys) { QueryProcessor.validateKey(key); DecoratedKey dk = cfm.decorateKey(ByteBufferUtil.clone(key)); ColumnFilter cf = (cfm.isSuper() && cfm.isDense()) ? SuperColumnCompatibility.getColumnFilter(cfm, options, restrictions.getSuperColumnRestrictions()) : queriedColumns; commands.add(SinglePartitionReadCommand.create(cfm, nowInSec, cf, rowFilter, limit, dk, filter)); } return new SinglePartitionReadCommand.Group(commands, limit); }
private ReadQuery getSliceCommands(QueryOptions options, DataLimits limit, int nowInSec) throws RequestValidationException { Collection<ByteBuffer> keys = restrictions.getPartitionKeys(options); if (keys.isEmpty()) return ReadQuery.EMPTY; ClusteringIndexFilter filter = makeClusteringIndexFilter(options); if (filter == null) return ReadQuery.EMPTY; RowFilter rowFilter = getRowFilter(options); // Note that we use the total limit for every key, which is potentially inefficient. // However, IN + LIMIT is not a very sensible choice. List<SinglePartitionReadCommand> commands = new ArrayList<>(keys.size()); for (ByteBuffer key : keys) { QueryProcessor.validateKey(key); DecoratedKey dk = cfm.decorateKey(ByteBufferUtil.clone(key)); ColumnFilter cf = (cfm.isSuper() && cfm.isDense()) ? SuperColumnCompatibility.getColumnFilter(cfm, options, restrictions.getSuperColumnRestrictions()) : queriedColumns; commands.add(SinglePartitionReadCommand.create(cfm, nowInSec, cf, rowFilter, limit, dk, filter)); } return new SinglePartitionReadCommand.Group(commands, limit); }