com.netflix.astyanax.model.Row.getColumns()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.7k)|赞(0)|评价(0)|浏览(95)

本文整理了Java中com.netflix.astyanax.model.Row.getColumns方法的一些代码示例,展示了Row.getColumns的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Row.getColumns方法的具体详情如下:
包路径:com.netflix.astyanax.model.Row
类名称:Row
方法名:getColumns

Row.getColumns介绍

[英]Child columns of the row. Note that if a ColumnPath was provided to a query these will be the columns at the column path location and not the columns at the root of the row.
[中]行的子列。请注意,如果向查询提供了ColumnPath,则这些将是列路径位置的列,而不是行根的列。

代码示例

代码示例来源:origin: thinkaurelius/titan

@Override
  public boolean apply(@Nullable Row<ByteBuffer, ByteBuffer> row) {
    return (row != null) && row.getColumns().size() > 0;
  }
}

代码示例来源:origin: apache/usergrid

final ColumnList<C> columns = result.getRow( key ).getColumns();

代码示例来源:origin: apache/usergrid

/**
 * A single row is present, only parse the single row
 * @param result
 * @return
 */
private List<T> singleRowResult( final Rows<R, C> result ) {
  if (logger.isTraceEnabled()) logger.trace( "Only a single row has columns.  Parsing directly" );
  for ( R key : result.getKeys() ) {
    final ColumnList<C> columnList = result.getRow( key ).getColumns();
    final int size = columnList.size();
    if ( size > 0 ) {
      final List<T> results = new ArrayList<>(size);
      for(Column<C> column: columnList){
        results.add(columnParser.parseColumn( column ));
      }
      return results;
    }
  }
  //we didn't have any results, just return nothing
  return Collections.<T>emptyList();
}

代码示例来源:origin: apache/usergrid

final ColumnList<C> columns = result.getRow( key ).getColumns();

代码示例来源:origin: thinkaurelius/titan

@Override
public RecordIterator<Entry> getEntries() {
  ensureOpen();
  if (sliceQuery == null)
    throw new IllegalStateException("getEntries() requires SliceQuery to be set.");
  return new RecordIterator<Entry>() {
    private final Iterator<Entry> columns =
        CassandraHelper.makeEntryIterator(currentRow.getColumns(),
            entryGetter,
            sliceQuery.getSliceEnd(),sliceQuery.getLimit());
    @Override
    public boolean hasNext() {
      ensureOpen();
      return columns.hasNext();
    }
    @Override
    public Entry next() {
      ensureOpen();
      return columns.next();
    }
    @Override
    public void close() {
      isClosed = true;
    }
    @Override
    public void remove() {
      throw new UnsupportedOperationException();
    }
  };
}

代码示例来源:origin: apache/usergrid

/**
 * Return true if we have < 2 rows with columns, false otherwise
 */
private boolean containsSingleRowOnly( final Rows<R, C> result ) {
  int count = 0;
  for ( R key : result.getKeys() ) {
    if ( result.getRow( key ).getColumns().size() > 0 ) {
      count++;
      //we have more than 1 row with values, return them
      if ( count > 1 ) {
        return false;
      }
    }
  }
  return true;
}

代码示例来源:origin: apache/usergrid

Column<Boolean> column = row.getColumns().getColumnByName( COLUMN_NAME );

代码示例来源:origin: apache/usergrid

final Row<ScopedRowKey<Id>, Boolean> row = latestEntityColumns.next();
final ColumnList<Boolean> columns = row.getColumns();

代码示例来源:origin: apache/usergrid

final Row<ScopedRowKey<K>, UUID> row = latestEntityColumns.next();
final ColumnList<UUID> columns = row.getColumns();

代码示例来源:origin: apache/usergrid

final Row<ScopedRowKey<CollectionPrefixedKey<Id>>, UUID> row = latestEntityColumns.next();
final ColumnList<UUID> columns = row.getColumns();

代码示例来源:origin: thinkaurelius/titan

assert !result.containsKey(row.getKey());
result.put(StaticArrayBuffer.of(row.getKey()),
   CassandraHelper.makeEntryList(row.getColumns(),entryGetter, query.getSliceEnd(), query.getLimit()));

代码示例来源:origin: rackerlabs/blueflood

ColumnList<Locator> columns = row.getColumns();
ArrayList<ReRollWork> work = new ArrayList<ReRollWork>();

代码示例来源:origin: com.netflix.zuul/zuul-netflix

/**
 * Utility for creating Cassandra responses
 *
 * @param row
 * @return
 */
@SuppressWarnings("unchecked")
private static ColumnList<String> mockColumnList(Row<String, String> row) {
  ColumnList<String> columnList = mock(ColumnList.class);
  when(row.getColumns()).thenReturn(columnList);
  return columnList;
}

代码示例来源:origin: com.netflix.zuul/zuul-core

/**
 * Utility for creating Cassandra responses
 *
 * @param row
 * @return
 */
@SuppressWarnings("unchecked")
private static ColumnList<String> mockColumnList(Row<String, String> row) {
  ColumnList<String> columnList = mock(ColumnList.class);
  when(row.getColumns()).thenReturn(columnList);
  return columnList;
}

代码示例来源:origin: com.thinkaurelius.titan/titan-cassandra

@Override
  public boolean apply(@Nullable Row<ByteBuffer, ByteBuffer> row) {
    return (row != null) && row.getColumns().size() > 0;
  }
}

代码示例来源:origin: com.netflix.astyanax/astyanax-recipes

@Override
public Boolean apply(Row<K,C> input) {
  counter.addAndGet(input.getColumns().size());
  return true;
}

代码示例来源:origin: com.netflix.astyanax/astyanax-test

private void checkRowResult(Rows<Integer, Population> result, List<Integer> rowKeys, Population ... expected) throws Exception {
  
  int index = 0;
  for (Row<Integer, Population> row : result) {
    Assert.assertEquals(rowKeys.toString() + " " + row.getKey(), rowKeys.get(index++), row.getKey());
    checkResult(row.getColumns(), expected);
  }
  Assert.assertTrue(rowKeys.size() == result.size());
}

代码示例来源:origin: com.bazaarvoice.emodb/emodb-event

@Override
  protected String computeNext() {
    while (rowIter.hasNext()) {
      Row<String, UUID> row = rowIter.next();
      if (!row.getColumns().isEmpty()) {
        return row.getKey();
      }
    }
    return endOfData();
  }
};

代码示例来源:origin: com.bazaarvoice.emodb/emodb-event

@Override
  protected String computeNext() {
    while (rowIter.hasNext()) {
      Row<String, ByteBuffer> row = rowIter.next();
      if (!row.getColumns().isEmpty()) {
        return row.getKey();
      }
    }
    return endOfData();
  }
};

代码示例来源:origin: com.netflix.astyanax/astyanax-test

private void checkRowResult(Rows<Integer, Population> result, Integer startKey, Integer size, Population ... expected) throws Exception {
  
  int rowKey = startKey;
  for (Row<Integer, Population> row : result) {
    Assert.assertTrue(rowKey == row.getKey());
    checkResult(row.getColumns(), expected);
    rowKey++;
  }
  Assert.assertTrue("Result: " + result.size() + ", size: " + size, size == result.size());
}

相关文章