static boolean valueAppliesTo(CollectionType type, Iterator<Cell> iter, Term.Terminal value, Operator operator) { if (value == null) return !iter.hasNext(); switch (type.kind) { case LIST: List<ByteBuffer> valueList = ((Lists.Value) value).elements; return listAppliesTo((ListType)type, iter, valueList, operator); case SET: Set<ByteBuffer> valueSet = ((Sets.Value) value).elements; return setAppliesTo((SetType)type, iter, valueSet, operator); case MAP: Map<ByteBuffer, ByteBuffer> valueMap = ((Maps.Value) value).map; return mapAppliesTo((MapType)type, iter, valueMap, operator); } throw new AssertionError(); }
static boolean listAppliesTo(ListType type, Iterator<Cell> iter, List<ByteBuffer> elements, Operator operator) { return setOrListAppliesTo(type.getElementsType(), iter, elements.iterator(), operator, false); }
return valueAppliesTo(type, iter, value, operator); conditionValue = ((Maps.Value) value).get(ProtocolVersion.V3); return compareWithOperator(operator, type, conditionValue, cell.value());
Iterator<Cell> iter = collectionColumns(current.metadata().comparator.create(rowPrefix, column), current, now); if (value == null) return valueAppliesTo(type, iter, value, operator); conditionValue = ((Maps.Value) value).getWithProtocolVersion(Server.VERSION_3); return compareWithOperator(operator, type, conditionValue, cell.value());
for (Term.Terminal value : inValues) if (CollectionBound.valueAppliesTo(type, cells.iterator(), value, Operator.EQ)) return true;
return valueAppliesTo(type, iter, value, operator); conditionValue = ((Maps.Value) value).get(ProtocolVersion.V3); return compareWithOperator(operator, type, conditionValue, cell.value());
if (CollectionBound.valueAppliesTo(type, getCells(row, column), value, Operator.EQ)) return true;
return valueAppliesTo(type, iter, value, operator); conditionValue = ((Maps.Value) value).get(ProtocolVersion.V3); return compareWithOperator(operator, type, conditionValue, cell.value());
if (CollectionBound.valueAppliesTo(type, getCells(row, column), value, Operator.EQ)) return true;
if (CollectionBound.valueAppliesTo(type, getCells(row, column), value, Operator.EQ)) return true;
public ColumnCondition.Bound bind(QueryOptions options) throws InvalidRequestException { boolean isInCondition = operator == Operator.IN; if (column.type instanceof CollectionType) { if (collectionElement != null) return isInCondition ? new ElementAccessInBound(this, options) : new ElementAccessBound(this, options); else return isInCondition ? new CollectionInBound(this, options) : new CollectionBound(this, options); } else if (column.type.isUDT()) { if (field != null) return isInCondition ? new UDTFieldAccessInBound(this, options) : new UDTFieldAccessBound(this, options); else return isInCondition ? new UDTInBound(this, options) : new UDTBound(this, options); } return isInCondition ? new SimpleInBound(this, options) : new SimpleBound(this, options); }
public ColumnCondition.Bound bind(QueryOptions options) throws InvalidRequestException { boolean isInCondition = operator == Operator.IN; if (column.type instanceof CollectionType) { if (collectionElement != null) return isInCondition ? new ElementAccessInBound(this, options) : new ElementAccessBound(this, options); else return isInCondition ? new CollectionInBound(this, options) : new CollectionBound(this, options); } else if (column.type.isUDT()) { if (field != null) return isInCondition ? new UDTFieldAccessInBound(this, options) : new UDTFieldAccessBound(this, options); else return isInCondition ? new UDTInBound(this, options) : new UDTBound(this, options); } return isInCondition ? new SimpleInBound(this, options) : new SimpleBound(this, options); }
public ColumnCondition.Bound bind(QueryOptions options) throws InvalidRequestException { boolean isInCondition = operator == Operator.IN; if (column.type instanceof CollectionType) { if (collectionElement != null) return isInCondition ? new ElementAccessInBound(this, options) : new ElementAccessBound(this, options); else return isInCondition ? new CollectionInBound(this, options) : new CollectionBound(this, options); } else if (column.type.isUDT()) { if (field != null) return isInCondition ? new UDTFieldAccessInBound(this, options) : new UDTFieldAccessBound(this, options); else return isInCondition ? new UDTInBound(this, options) : new UDTBound(this, options); } return isInCondition ? new SimpleInBound(this, options) : new SimpleBound(this, options); }
static boolean valueAppliesTo(CollectionType type, Iterator<Cell> iter, Term.Terminal value, Operator operator) { if (value == null) return !iter.hasNext(); switch (type.kind) { case LIST: List<ByteBuffer> valueList = ((Lists.Value) value).elements; return listAppliesTo((ListType)type, iter, valueList, operator); case SET: Set<ByteBuffer> valueSet = ((Sets.Value) value).elements; return setAppliesTo((SetType)type, iter, valueSet, operator); case MAP: Map<ByteBuffer, ByteBuffer> valueMap = ((Maps.Value) value).map; return mapAppliesTo((MapType)type, iter, valueMap, operator); } throw new AssertionError(); }
static boolean valueAppliesTo(CollectionType type, Iterator<Cell> iter, Term.Terminal value, Operator operator) { if (value == null) return !iter.hasNext(); switch (type.kind) { case LIST: List<ByteBuffer> valueList = ((Lists.Value) value).elements; return listAppliesTo((ListType)type, iter, valueList, operator); case SET: Set<ByteBuffer> valueSet = ((Sets.Value) value).elements; return setAppliesTo((SetType)type, iter, valueSet, operator); case MAP: Map<ByteBuffer, ByteBuffer> valueMap = ((Maps.Value) value).map; return mapAppliesTo((MapType)type, iter, valueMap, operator); } throw new AssertionError(); }
static boolean listAppliesTo(ListType type, Iterator<Cell> iter, List<ByteBuffer> elements, Operator operator) { return setOrListAppliesTo(type.getElementsType(), iter, elements.iterator(), operator, false); }
static boolean listAppliesTo(ListType type, Iterator<Cell> iter, List<ByteBuffer> elements, Operator operator) { return setOrListAppliesTo(type.getElementsType(), iter, elements.iterator(), operator, false); }
static boolean setAppliesTo(SetType type, Iterator<Cell> iter, Set<ByteBuffer> elements, Operator operator) { ArrayList<ByteBuffer> sortedElements = new ArrayList<>(elements.size()); sortedElements.addAll(elements); Collections.sort(sortedElements, type.getElementsType()); return setOrListAppliesTo(type.getElementsType(), iter, sortedElements.iterator(), operator, true); }
static boolean listAppliesTo(ListType type, Iterator<Cell> iter, List<ByteBuffer> elements, Operator operator) { return setOrListAppliesTo(type.getElementsType(), iter, elements.iterator(), operator, false); }
static boolean setAppliesTo(SetType type, Iterator<Cell> iter, Set<ByteBuffer> elements, Operator operator) { ArrayList<ByteBuffer> sortedElements = new ArrayList<>(elements.size()); sortedElements.addAll(elements); Collections.sort(sortedElements, type.getElementsType()); return setOrListAppliesTo(type.getElementsType(), iter, sortedElements.iterator(), operator, true); }