本文整理了Java中me.prettyprint.hector.api.beans.Row.getKey
方法的一些代码示例,展示了Row.getKey
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getKey
方法的具体详情如下:
包路径:me.prettyprint.hector.api.beans.Row
类名称:Row
方法名:getKey
暂无
代码示例来源:origin: hector-client/hector
@Override
public Row<K, N, V> next() {
Row<K, N, V> row = iterator.next();
startKey = row.getKey();
rows++;
return row;
}
代码示例来源:origin: hector-client/hector
@Override
public Row<K, N, V> next() {
Row<K, N, V> row = iterator.next();
startKey = row.getKey();
rows++;
return row;
}
代码示例来源:origin: hector-client/hector
@Override
public boolean accept(Row<String, Integer, Integer> row)
{
return Integer.parseInt(row.getKey().replaceAll("^k", "")) < 10;
}
};
代码示例来源:origin: hector-client/hector
private void findNext(boolean fromRunQuery) {
nextValue = null;
if (rowsIterator == null) {
return;
}
while (rowsIterator.hasNext() && nextValue == null) {
Row<K, String, String> row = rowsIterator.next();
lastReadValue = row.getKey();
if (!row.getColumnSlice().getColumns().isEmpty()) {
nextValue = lastReadValue;
}
}
if (!rowsIterator.hasNext() && nextValue == null) {
runQuery(lastReadValue, endKey);
}
}
代码示例来源:origin: Comcast/cmb
@Override
public K getKey() {
return row.getKey();
}
@Override
代码示例来源:origin: hector-client/hector
private void assertKeys(RangeSlicesQuery query, int expected, String start, String end, SliceFilter<Row<String, Integer, Integer>> filter) {
RangeSlicesIterator<String, Integer, Integer> iterator = new RangeSlicesIterator<String, Integer, Integer>(query, start, end).setFilter(filter);
int total = 0;
while(iterator.hasNext()) {
iterator.next().getKey();
total ++;
}
assertEquals(expected, total);
}
}
代码示例来源:origin: org.hectorclient/hector-core
@Override
public Row<K, N, V> next() {
Row<K, N, V> row = iterator.next();
startKey = row.getKey();
rows++;
return row;
}
代码示例来源:origin: me.prettyprint/hector-core
@Override
public Row<K, N, V> next() {
Row<K, N, V> row = iterator.next();
startKey = row.getKey();
rows++;
return row;
}
代码示例来源:origin: hector-client/hector
@Test
public void testModificationIterator() {
LinkedList<String> KEYS= new LinkedList<String>();
for (int j = 0; j < 100; j++) {
KEYS.add(KEY+j);
}
Mutator mutator = HFactory.createMutator(keyspace, se);
MultigetSliceIterator<String, UUID, String> it=
new MultigetSliceIterator<String, UUID, String>(false,keyspace, se,us,se, CF, KEYS, null,null,1,10,1000);// Retrieve all columns from row -> 1000
Map<UUID, String> results = new HashMap<UUID, String>();
while (it.hasNext()) {
Row<String,UUID, String> r = it.next();
for (HColumn<UUID, String> c : r.getColumnSlice().getColumns()) {
results.put(c.getName(), c.getValue());
mutator.addDeletion(r.getKey(), CF, c.getName(), us);
mutator.execute();
}
}
assertEquals(100*1000, results.size());
}
@Test
代码示例来源:origin: hector-client/hector
@Test
public void testKeysOnlyPredicate() {
RangeSlicesQuery<String, String, Long> rangeSlicesQuery = HFactory.createRangeSlicesQuery(keyspace, se, se, le);
QueryResult<OrderedRows<String, String, Long>> result =
rangeSlicesQuery.setColumnFamily(cf).setKeys("", "").setReturnKeysOnly().execute();
OrderedRows<String, String, Long> orderedRows = result.get();
Row<String, String, Long> row = orderedRows.iterator().next();
assertNotNull(row.getKey());
assertEquals(0,row.getColumnSlice().getColumns().size());
result = rangeSlicesQuery.setColumnNames("birthyear","birthmonth").setRowCount(5).execute();
orderedRows = result.get();
row = orderedRows.iterator().next();
assertNotNull(row.getKey());
assertEquals(2,row.getColumnSlice().getColumns().size());
}
代码示例来源:origin: org.hectorclient/hector-core
@Override
public Row<K, N, V> next() {
Row<K, N, V> row = iterator.next();
startKey = row.getKey();
rows++;
return row;
}
代码示例来源:origin: me.prettyprint/hector-core
private void findNext(boolean fromRunQuery) {
nextValue = null;
if (rowsIterator == null) {
return;
}
while (rowsIterator.hasNext() && nextValue == null) {
Row<K, String, String> row = rowsIterator.next();
lastReadValue = row.getKey();
if (!row.getColumnSlice().getColumns().isEmpty()) {
nextValue = lastReadValue;
}
}
if (!rowsIterator.hasNext() && nextValue == null) {
runQuery(lastReadValue, endKey);
}
}
代码示例来源:origin: hector-client/hector
Row<String, String, String> row = rows.getList().get(0);
assertNotNull(row);
assertEquals("testRangeSlicesQuery1", row.getKey());
ColumnSlice<String, String> slice = row.getColumnSlice();
assertNotNull(slice);
代码示例来源:origin: hector-client/hector
@Test
public void testRangeSubSlicesQuery() {
String cf = "Super1";
TestCleanupDescriptor cleanup = insertSuperColumns(cf, 4,
"testRangeSubSlicesQuery", 3, "testRangeSubSlicesQuery");
// get value
RangeSubSlicesQuery<String, String, String, String> q = createRangeSubSlicesQuery(
ko, se, se, se, se);
q.setColumnFamily(cf);
q.setKeys("testRangeSubSlicesQuery2", "testRangeSubSlicesQuery3");
// try with column name first
q.setSuperColumn("testRangeSubSlicesQuery1");
q.setColumnNames("c021", "c111");
QueryResult<OrderedRows<String, String, String>> r = q.execute();
assertNotNull(r);
OrderedRows<String, String, String> rows = r.get();
assertNotNull(rows);
assertEquals(2, rows.getCount());
Row<String, String, String> row = rows.getList().get(0);
assertNotNull(row);
assertEquals("testRangeSubSlicesQuery2", row.getKey());
ColumnSlice<String, String> slice = row.getColumnSlice();
assertNotNull(slice);
// Test slice.getColumnByName
assertEquals("v021", slice.getColumnByName("c021").getValue());
assertEquals("v121", slice.getColumnByName("c111").getValue());
assertNull(slice.getColumnByName("c033"));
// Delete values
deleteColumns(cleanup);
}
代码示例来源:origin: hector-client/hector
Row<String, String, String> row = rows.getByKey("testMultigetSliceQuery1");
assertNotNull(row);
assertEquals("testMultigetSliceQuery1", row.getKey());
ColumnSlice<String, String> slice = row.getColumnSlice();
assertNotNull(slice);
代码示例来源:origin: hector-client/hector
.getByKey("testMultigetSubSliceQuery0");
assertNotNull(row);
assertEquals("testMultigetSubSliceQuery0", row.getKey());
ColumnSlice<String, String> slice = row.getColumnSlice();
assertNotNull(slice);
代码示例来源:origin: cumulusrdf/cumulusrdf
@Override
public K getKey(final V value) throws DataAccessLayerException {
RangeSlicesQuery<K, byte[], V> rq = HFactory.createRangeSlicesQuery(
_keyspace,
_serializer_k,
BYTE_SERIALIZER,
_serializer_v);
rq.addEqualsExpression(COLUMN_NAME, value).setReturnKeysOnly()
.setColumnFamily(_cf_name)
.setColumnNames(COLUMN_NAME).setRowCount(1);
final List<Row<K, byte[], V>> rows = rq.execute().get().getList();
return rows.isEmpty() ? null : _serializer_k.fromBytes((byte[])rows.get(0).getKey());
}
代码示例来源:origin: cumulusrdf/cumulusrdf
@Override
public K getKey(final V value) throws DataAccessLayerException {
RangeSlicesQuery<K, byte[], V> rq = HFactory.createRangeSlicesQuery(
_keyspace,
_serializer_k,
BYTE_SERIALIZER,
_serializer_v);
rq.addEqualsExpression(COLUMN_NAME, value).setReturnKeysOnly()
.setColumnFamily(_cf_name)
.setColumnNames(COLUMN_NAME).setRowCount(1);
final List<Row<K, byte[], V>> rows = rq.execute().get().getList();
return rows.isEmpty() ? null : _serializer_k.fromBytes((byte[])rows.get(0).getKey());
}
代码示例来源:origin: org.apache.archiva/metadata-store-cassandra
protected void removeLicenses( String projectVersionMetadataKey )
{
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getLicenseFamilyName() ) //
.setColumnNames( NAME.toString() ) //
.setRowCount( Integer.MAX_VALUE ) //
.addEqualsExpression( "projectVersionMetadataModel.key", projectVersionMetadataKey ) //
.execute();
for ( Row<String, String, String> row : result.get() )
{
this.licenseTemplate.deleteRow( row.getKey() );
}
}
代码示例来源:origin: org.apache.archiva/metadata-store-cassandra
protected void removeDependencies( String projectVersionMetadataKey )
{
QueryResult<OrderedRows<String, String, String>> result =
HFactory.createRangeSlicesQuery( cassandraArchivaManager.getKeyspace(), ss, ss, ss ) //
.setColumnFamily( cassandraArchivaManager.getDependencyFamilyName() ) //
.setColumnNames( GROUP_ID.toString() ) //
.setRowCount( Integer.MAX_VALUE ) //
.addEqualsExpression( "projectVersionMetadataModel.key", projectVersionMetadataKey ) //
.execute();
for ( Row<String, String, String> row : result.get() )
{
this.dependencyTemplate.deleteRow( row.getKey() );
}
}
内容来源于网络,如有侵权,请联系作者删除!