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(); } }
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 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(); } }