ListSerializer listSerializer = listType.getSerializer(); Collection outputCollection = new ArrayList(); if (useNativeProtocol2)
public static Value fromSerialized(ByteBuffer value, ListType type, ProtocolVersion version) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but compose does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, version); List<ByteBuffer> elements = new ArrayList<>(l.size()); for (Object element : l) // elements can be null in lists that represent a set of IN values elements.add(element == null ? null : type.getElementsType().decompose(element)); return new Value(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static Value fromSerialized(ByteBuffer value, ListType type, ProtocolVersion version) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but compose does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, version); List<ByteBuffer> elements = new ArrayList<>(l.size()); for (Object element : l) // elements can be null in lists that represent a set of IN values elements.add(element == null ? null : type.getElementsType().decompose(element)); return new Value(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static Value fromSerialized(ByteBuffer value, ListType type, ProtocolVersion version) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but compose does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, version); List<ByteBuffer> elements = new ArrayList<>(l.size()); for (Object element : l) // elements can be null in lists that represent a set of IN values elements.add(element == null ? null : type.getElementsType().decompose(element)); return new Value(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static Value fromSerialized(ByteBuffer value, ListType type, int version) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but compose does the validation (so we're fine). List<?> l = (List<?>)type.getSerializer().deserializeForNativeProtocol(value, version); List<ByteBuffer> elements = new ArrayList<ByteBuffer>(l.size()); for (Object element : l) // elements can be null in lists that represent a set of IN values elements.add(element == null ? null : type.getElementsType().decompose(element)); return new Value(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static Value fromSerialized(ByteBuffer value, ListType type, ProtocolVersion version) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but compose does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, version); List<ByteBuffer> elements = new ArrayList<>(l.size()); for (Object element : l) // elements can be null in lists that represent a set of IN values elements.add(element == null ? null : type.getElementsType().decompose(element)); return new Value(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but the deserialization does the validation (so we're fine). List<?> l = (List<?>)type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.getElementsType() instanceof TupleType; TupleType tupleType = (TupleType) type.getElementsType(); // type.split(bytes) List<List<ByteBuffer>> elements = new ArrayList<>(l.size()); for (Object element : l) elements.add(Arrays.asList(tupleType.split(type.getElementsType().decompose(element)))); return new InValue(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but the deserialization does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.getElementsType() instanceof TupleType; TupleType tupleType = Tuples.getTupleType(type.getElementsType()); // type.split(bytes) List<List<ByteBuffer>> elements = new ArrayList<>(l.size()); for (Object element : l) elements.add(Arrays.asList(tupleType.split(type.getElementsType().decompose(element)))); return new InValue(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but the deserialization does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.getElementsType() instanceof TupleType; TupleType tupleType = (TupleType) type.getElementsType(); // type.split(bytes) List<List<ByteBuffer>> elements = new ArrayList<>(l.size()); for (Object element : l) elements.add(Arrays.asList(tupleType.split(type.getElementsType().decompose(element)))); return new InValue(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but the deserialization does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.getElementsType() instanceof TupleType; TupleType tupleType = Tuples.getTupleType(type.getElementsType()); // type.split(bytes) List<List<ByteBuffer>> elements = new ArrayList<>(l.size()); for (Object element : l) elements.add(Arrays.asList(tupleType.split(type.getElementsType().decompose(element)))); return new InValue(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
public static InValue fromSerialized(ByteBuffer value, ListType type, QueryOptions options) throws InvalidRequestException { try { // Collections have this small hack that validate cannot be called on a serialized object, // but the deserialization does the validation (so we're fine). List<?> l = type.getSerializer().deserializeForNativeProtocol(value, options.getProtocolVersion()); assert type.getElementsType() instanceof TupleType; TupleType tupleType = Tuples.getTupleType(type.getElementsType()); // type.split(bytes) List<List<ByteBuffer>> elements = new ArrayList<>(l.size()); for (Object element : l) elements.add(Arrays.asList(tupleType.split(type.getElementsType().decompose(element)))); return new InValue(elements); } catch (MarshalException e) { throw new InvalidRequestException(e.getMessage()); } }
return type.compareForCQL(leftOperand, rightOperand) != 0; case IN: List inValues = ((List) ListType.getInstance(type, false).getSerializer().deserialize(rightOperand)); return inValues.contains(type.getSerializer().deserialize(leftOperand)); case CONTAINS:
return type.compareForCQL(leftOperand, rightOperand) != 0; case IN: List inValues = ((List) ListType.getInstance(type, false).getSerializer().deserialize(rightOperand)); return inValues.contains(type.getSerializer().deserialize(leftOperand)); case CONTAINS:
cellValue = cell == null ? null : listType.getSerializer().getElement(cell.value(), ElementAccessBound.getListIndex(collectionElement));
cellValue = cell == null ? null : listType.getSerializer().getElement(cell.value(), ElementAccessBound.getListIndex(collectionElement));
cellValue = cell == null ? null : listType.getSerializer().getElement(cell.value(), ElementAccessBound.getListIndex(collectionElement));
ByteBuffer listElementValue = listType.getSerializer().getElement(cell.value(), getListIndex(collectionElement)); return compareWithOperator(operator, listType.getElementsType(), value, listElementValue);
ByteBuffer listElementValue = listType.getSerializer().getElement(cell.value(), getListIndex(collectionElement)); return compareWithOperator(operator, listType.getElementsType(), value, listElementValue);
ByteBuffer listElementValue = listType.getSerializer().getElement(cell.value(), getListIndex(collectionElement)); return compareWithOperator(operator, listType.getElementsType(), value, listElementValue);
ByteBuffer listElementValue = cell.isLive(now) ? listType.getSerializer().getElement(cell.value(), getListIndex(collectionElement)) : null; return compareWithOperator(operator, listType.getElementsType(), value, listElementValue);