public AbstractType<?> getIndexedValueType(ColumnDefinition indexedColumn) { return ((CollectionType) indexedColumn.type).nameComparator(); } };
public AbstractType<?> getIndexedValueType(ColumnDefinition indexedColumn) { return ((CollectionType) indexedColumn.type).nameComparator(); } };
private AbstractType<?> forKeys(AbstractType<?> collectionType) { assert collectionType instanceof CollectionType; CollectionType ct = (CollectionType)collectionType; switch (ct.kind) { case LIST: case MAP: return ct.nameComparator(); } throw new AssertionError(); }
private AbstractType<?> forKeys(AbstractType<?> collectionType) { assert collectionType instanceof CollectionType; CollectionType ct = (CollectionType)collectionType; switch (ct.kind) { case LIST: case MAP: return ct.nameComparator(); } throw new AssertionError(); }
public int compareCollectionMembers(ByteBuffer o1, ByteBuffer o2, ByteBuffer collectionName) { CollectionType t = defined.get(collectionName); if (t == null) throw new RuntimeException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); return t.nameComparator().compare(o1, o2); }
public int compareCollectionMembers(ByteBuffer o1, ByteBuffer o2, ByteBuffer collectionName) { CollectionType t = defined.get(collectionName); if (t == null) throw new RuntimeException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); return t.nameComparator().compare(o1, o2); }
public static CellNameType buildIndexComparator(CFMetaData baseMetadata, ColumnDefinition columnDef) { int prefixSize = columnDef.position(); List<AbstractType<?>> types = new ArrayList<>(prefixSize + 2); types.add(SecondaryIndex.keyComparator); for (int i = 0; i < prefixSize; i++) types.add(baseMetadata.comparator.subtype(i)); types.add(((CollectionType)columnDef.type).nameComparator()); // collection key return new CompoundDenseCellNameType(types); }
public AbstractType<?> getIndexedValueType(ColumnDefinition indexedColumn) { CollectionType colType = (CollectionType)indexedColumn.type; return CompositeType.getInstance(colType.nameComparator(), colType.valueComparator()); } };
public AbstractType<?> getIndexedValueType(ColumnDefinition indexedColumn) { CollectionType colType = (CollectionType)indexedColumn.type; return CompositeType.getInstance(colType.nameComparator(), colType.valueComparator()); } };
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException { CollectionType t = defined.get(collectionName); if (t == null) throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); t.nameComparator().validate(bytes); }
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException { CollectionType t = defined.get(collectionName); if (t == null) throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); t.nameComparator().validate(bytes); }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s]", type.getString(element.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s]", type.getString(element.get(0))); } }
public void validateCollectionMember(ByteBuffer bytes, ByteBuffer collectionName) throws MarshalException { CollectionType t = defined.get(collectionName); if (t == null) throw new MarshalException(ByteBufferUtil.bytesToHex(collectionName) + " is not defined as a collection"); t.nameComparator().validate(bytes); }
public CFMetaData.Builder addIndexClusteringColumns(CFMetaData.Builder builder, CFMetaData baseMetadata, ColumnDefinition columnDef) { for (ColumnDefinition def : baseMetadata.clusteringColumns()) builder.addClusteringColumn(def.name, def.type); // collection key builder.addClusteringColumn("cell_path", ((CollectionType)columnDef.type).nameComparator()); return builder; } };
public CFMetaData.Builder addIndexClusteringColumns(CFMetaData.Builder builder, CFMetaData baseMetadata, ColumnDefinition columnDef) { for (ColumnDefinition def : baseMetadata.clusteringColumns()) builder.addClusteringColumn(def.name, def.type); // collection key builder.addClusteringColumn("cell_path", ((CollectionType)columnDef.type).nameComparator()); return builder; } };
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
@Override public String toString() { // This assert we're dealing with a collection since that's the only thing it's used for so far. AbstractType<?> type = ((CollectionType<?>)column().type).nameComparator(); return String.format("[%s:%s]", from == CellPath.BOTTOM ? "" : type.getString(from.get(0)), to == CellPath.TOP ? "" : type.getString(to.get(0))); } }
private void validateCellPath(CellPath path) { if (!isComplex()) throw new MarshalException("Only complex cells should have a cell path"); assert type.isMultiCell(); if (type.isCollection()) ((CollectionType)type).nameComparator().validate(path.get(0)); else ((UserType)type).nameComparator().validate(path.get(0)); }
private void validateCellPath(CellPath path) { if (!isComplex()) throw new MarshalException("Only complex cells should have a cell path"); assert type.isMultiCell(); if (type.isCollection()) ((CollectionType)type).nameComparator().validate(path.get(0)); else ((UserType)type).nameComparator().validate(path.get(0)); }