private static CFMetaData indexCFMD(String ksName, String cfName, final Boolean withIdxType) throws ConfigurationException { return standardCFMD(ksName, cfName) .columnMetadata(new HashMap<ByteBuffer, ColumnDefinition>() {{ ByteBuffer cName = ByteBuffer.wrap("birthyear".getBytes(Charsets.UTF_8)); IndexType keys = withIdxType ? IndexType.KEYS : null; //TODO: that last null is for composites. Need to understand that better, but null is reasonable ColumnDefinition def = new org.apache.cassandra.config.ColumnDefinition(cName,LongType.instance,IndexType.KEYS,null,"birthyear_index",null, Type.REGULAR); put (cName,def); }}).rebuild(); }
private static CFMetaData cqlTestCf(String ksName, String cfName, AbstractType comp) throws ConfigurationException { return new CFMetaData(ksName, cfName, ColumnFamilyType.Standard, comp, null) .keyValidator(UTF8Type.instance).columnMetadata(new HashMap<ByteBuffer, ColumnDefinition>() {{ ByteBuffer cName = ByteBuffer.wrap("birthyear".getBytes(Charsets.UTF_8)); put(cName, new ColumnDefinition(cName, LongType.instance, null, null, null,null, Type.REGULAR)); }}).rebuild(); } }
/** * SuperColumn key is stored in {@link CFMetaData#columnMetadata} as a clustering column (to make sure we can make * a distinction between the SuperColumn key and SuperColumn value columns, especially when they have the same type * and were renamed), but exposed as {@link CFMetaData#superCfKeyColumn} as a regular column to be compatible with * the storage engine. * * This remapping is necessary to facilitate the column metadata part. */ public static ColumnDefinition getSuperCfSschemaRepresentation(ColumnDefinition superCfKeyColumn) { return new ColumnDefinition(superCfKeyColumn.ksName, superCfKeyColumn.cfName, superCfKeyColumn.name, superCfKeyColumn.type, 1, ColumnDefinition.Kind.CLUSTERING); }
/** * SuperColumn key is stored in {@link CFMetaData#columnMetadata} as a clustering column (to make sure we can make * a distinction between the SuperColumn key and SuperColumn value columns, especially when they have the same type * and were renamed), but exposed as {@link CFMetaData#superCfKeyColumn} as a regular column to be compatible with * the storage engine. * * This remapping is necessary to facilitate the column metadata part. */ public static ColumnDefinition getSuperCfSschemaRepresentation(ColumnDefinition superCfKeyColumn) { return new ColumnDefinition(superCfKeyColumn.ksName, superCfKeyColumn.cfName, superCfKeyColumn.name, superCfKeyColumn.type, 1, ColumnDefinition.Kind.CLUSTERING); }
public static ColumnDefinition partitionKeyDef(CFMetaData cfm, ByteBuffer name, AbstractType<?> validator, Integer componentIndex) { return new ColumnDefinition(cfm, name, validator, componentIndex, Kind.PARTITION_KEY); }
public static ColumnDefinition regularDef(CFMetaData cfm, ByteBuffer name, AbstractType<?> type) { return new ColumnDefinition(cfm, name, type, NO_POSITION, Kind.REGULAR); }
public ColumnDefinition withNewName(ColumnIdentifier newName) { return new ColumnDefinition(ksName, cfName, newName, type, position, kind); }
public ColumnDefinition withNewType(AbstractType<?> newType) { return new ColumnDefinition(ksName, cfName, name, newType, position, kind); }
/** * SuperColumn key is stored in {@link CFMetaData#columnMetadata} as a clustering column (to make sure we can make * a distinction between the SuperColumn key and SuperColumn value columns, especially when they have the same type * and were renamed), but exposed as {@link CFMetaData#superCfKeyColumn} as a regular column to be compatible with * the storage engine. * * This remapping is necessary to facilitate the column metadata part. */ public static ColumnDefinition getSuperCfSschemaRepresentation(ColumnDefinition superCfKeyColumn) { return new ColumnDefinition(superCfKeyColumn.ksName, superCfKeyColumn.cfName, superCfKeyColumn.name, superCfKeyColumn.type, 1, ColumnDefinition.Kind.CLUSTERING); }
public static ColumnDefinition regularDef(CFMetaData cfm, ByteBuffer name, AbstractType<?> type) { return new ColumnDefinition(cfm, name, type, NO_POSITION, Kind.REGULAR); }
public ColumnDefinition withNewType(AbstractType<?> newType) { return new ColumnDefinition(ksName, cfName, name, newType, position, kind); }
public static ColumnDefinition regularDef(CFMetaData cfm, ByteBuffer name, AbstractType<?> type) { return new ColumnDefinition(cfm, name, type, NO_POSITION, Kind.REGULAR); }
public static ColumnDefinition staticDef(CFMetaData cfm, ByteBuffer name, AbstractType<?> type) { return new ColumnDefinition(cfm, name, type, NO_POSITION, Kind.STATIC); }
public ColumnDefinition withNewName(ColumnIdentifier newName) { return new ColumnDefinition(ksName, cfName, newName, type, position, kind); }
public static ColumnDefinition partitionKeyDef(String ksName, String cfName, String name, AbstractType<?> type, int position) { return new ColumnDefinition(ksName, cfName, ColumnIdentifier.getInterned(name, true), type, position, Kind.PARTITION_KEY); }
public static ColumnDefinition partitionKeyDef(String ksName, String cfName, String name, AbstractType<?> type, int position) { return new ColumnDefinition(ksName, cfName, ColumnIdentifier.getInterned(name, true), type, position, Kind.PARTITION_KEY); }
public static ColumnDefinition clusteringDef(String ksName, String cfName, String name, AbstractType<?> type, int position) { return new ColumnDefinition(ksName, cfName, ColumnIdentifier.getInterned(name, true), type, position, Kind.CLUSTERING); }
private static CFMetaData indexCFMD(String ksName, String cfName, final Boolean withIdxType) throws ConfigurationException { return standardCFMD(ksName, cfName) .columnMetadata(new HashMap<ByteBuffer, ColumnDefinition>() {{ ByteBuffer cName = ByteBuffer.wrap("birthyear".getBytes(Charsets.UTF_8)); IndexType keys = withIdxType ? IndexType.KEYS : null; put(cName, new ColumnDefinition(cName, LongType.instance, keys, null, "birthyear_index")); }}); }
private static CFMetaData cqlTestCf(String ksName, String cfName, AbstractType comp) throws ConfigurationException { return new CFMetaData(ksName, cfName, ColumnFamilyType.Standard, comp, null) .keyValidator(UTF8Type.instance).columnMetadata(new HashMap<ByteBuffer, ColumnDefinition>() {{ ByteBuffer cName = ByteBuffer.wrap("birthyear".getBytes(Charsets.UTF_8)); put(cName, new ColumnDefinition(cName, LongType.instance, null, null, null)); }}); } }
private static CFMetaData cqlTestCf(String ksName, String cfName, AbstractType comp) throws ConfigurationException { return new CFMetaData(ksName, cfName, ColumnFamilyType.Standard, comp, null) .keyValidator(UTF8Type.instance).columnMetadata(new HashMap<ByteBuffer, ColumnDefinition>() {{ ByteBuffer cName = ByteBuffer.wrap("birthyear".getBytes(Charsets.UTF_8)); put(cName, new ColumnDefinition(cName, LongType.instance, null, null, null,null, Type.REGULAR)); }}).rebuild(); } }