获取没有值的动态复合列 - Astyanax

时间:2015-02-01 08:37:03

标签: cassandra astyanax

要查询DynamicComposite列,查询将如下所示

ColumnFamily<String, DynamicComposite> columnFamilyEntity = ColumnFamily.newColumnFamily(columnFamily,
                            StringSerializer.get(), DynamicCompositeSerializer.get(), ByteSerializer.get());
        RowQuery<String, com.netflix.astyanax.model.DynamicComposite> rowQuery = keyspace.prepareQuery(columnFamilyEntity).getKey(rowKey);
        com.netflix.astyanax.model.DynamicComposite startRange = getStartComposite(startComponentNames);
        com.netflix.astyanax.model.DynamicComposite endRange = getEndComposite(endComponentNames);
        RangeBuilder rangeBuilder = new RangeBuilder();
        rangeBuilder.setStart(startRange,DynamicCompositeSerializer.get());
        rangeBuilder.setEnd(endRange,DynamicCompositeSerializer.get());
        rangeBuilder.setReversed(reversed);
        rowQuery.withColumnRange(rangeBuilder.build());
ColumnList<com.netflix.astyanax.model.DynamicComposite> queryResultCols = rowQuery.execute().getResult();

如果我只想查询DynamicComposite中的列名(或组件名)而不是列值,是否可以告诉Astyanax客户端不查询值?

0 个答案:

没有答案