当前位置: 首页>>代码示例>>Java>>正文


Java Scan.setStartRow方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.client.Scan.setStartRow方法的典型用法代码示例。如果您正苦于以下问题:Java Scan.setStartRow方法的具体用法?Java Scan.setStartRow怎么用?Java Scan.setStartRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.client.Scan的用法示例。


在下文中一共展示了Scan.setStartRow方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAvgWithInvalidRange

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testAvgWithInvalidRange() {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY,TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[1]);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  Double avg = null;
  try {
    avg = aClient.avg(TEST_TABLE, ci, scan);
  } catch (Throwable e) {
  }
  assertEquals(null, avg);// control should go to the catch block
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestAggregateProtocol.java

示例2: testMinWithInvalidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test(timeout = 300000)
public void testMinWithInvalidRange2() {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addFamily(TEST_FAMILY);
  scan.setStartRow(ROWS[6]);
  scan.setStopRow(ROWS[6]);
  final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci = 
      new DoubleColumnInterpreter();
  Double min = null;
  try {
    min = aClient.min(TEST_TABLE, ci, scan);
  } catch (Throwable e) {
  }
  assertEquals(null, min);// control should go to the catch block
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestDoubleColumnInterpreter.java

示例3: testAvgWithInvalidRange

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testAvgWithInvalidRange() {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[1]);
  final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
    new BigDecimalColumnInterpreter();
  Double avg = null;
  try {
    avg = aClient.avg(TEST_TABLE, ci, scan);
  } catch (Throwable e) {
  }
  assertEquals(null, avg);// control should go to the catch block
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestBigDecimalColumnInterpreter.java

示例4: testMaxWithInvalidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testMaxWithInvalidRange2() throws Throwable {
  BigDecimal max = new BigDecimal(Long.MIN_VALUE);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
  scan.setStartRow(ROWS[4]);
  scan.setStopRow(ROWS[4]);
  try {
    AggregationClient aClient = new AggregationClient(conf);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    max = aClient.max(TEST_TABLE, ci, scan);
  } catch (Exception e) {
    max = BigDecimal.ZERO;
  }
  assertEquals(BigDecimal.ZERO, max);// control should go to the catch block
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:18,代码来源:TestBigDecimalColumnInterpreter.java

示例5: findStartNode

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
private static CINode findStartNode(Table table, byte[] startKey) throws IOException {
  Scan scan = new Scan();
  scan.setStartRow(startKey);
  scan.setBatch(1);
  scan.addColumn(FAMILY_NAME, COLUMN_PREV);

  long t1 = System.currentTimeMillis();
  ResultScanner scanner = table.getScanner(scan);
  Result result = scanner.next();
  long t2 = System.currentTimeMillis();
  scanner.close();

  if ( result != null) {
    CINode node = getCINode(result, new CINode());
    System.out.printf("FSR %d %s\n", t2 - t1, Bytes.toStringBinary(node.key));
    return node;
  }

  System.out.println("FSR " + (t2 - t1));

  return null;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:IntegrationTestBigLinkedList.java

示例6: testMinWithValidRange

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
 * @throws Throwable
 */
@Test (timeout=300000)
public void testMinWithValidRange() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
  scan.setStartRow(HConstants.EMPTY_START_ROW);
  scan.setStopRow(HConstants.EMPTY_END_ROW);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  Long min = aClient.min(TEST_TABLE, ci,
      scan);
  assertEquals(0l, min.longValue());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:17,代码来源:TestAggregateProtocol.java

示例7: testStdWithValidRange2WithNoCQ

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testStdWithValidRange2WithNoCQ() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addFamily(TEST_FAMILY);
  scan.setStartRow(ROWS[6]);
  scan.setStopRow(ROWS[7]);
  final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
    new BigDecimalColumnInterpreter();
  double std = aClient.std(TEST_TABLE, ci, scan);
  System.out.println("std is:" + std);
  assertEquals(0, std, 0.05d);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:TestBigDecimalColumnInterpreter.java

示例8: testSumWithValidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
 * @throws Throwable
 */
@Test (timeout=300000)
public void testSumWithValidRange2() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY,TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[15]);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  long sum = aClient.sum(TEST_TABLE, ci, scan);
  assertEquals(95, sum);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TestAggregateProtocol.java

示例9: testMaxWithValidRange2WithNoCQ

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test (timeout=300000)
public void testMaxWithValidRange2WithNoCQ() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addFamily(TEST_FAMILY);
  scan.setStartRow(ROWS[6]);
  scan.setStopRow(ROWS[7]);
  final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
  BigDecimal max = aClient.max(TEST_TABLE, ci, scan);
  assertEquals(new BigDecimal("6.00"), max);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:TestBigDecimalColumnInterpreter.java

示例10: getRowOrBefore

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
private Result getRowOrBefore(byte[] tableName, byte[] row, byte[] family) throws IOException {
  Scan scan = new Scan(row);
  scan.setReversed(true);
  scan.addFamily(family);
  scan.setStartRow(row);
  Table table = getTable(tableName);
  try (ResultScanner scanner = table.getScanner(scan)) {
    return scanner.next();
  } finally{
    if(table != null){
      table.close();
    }
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:ThriftServerRunner.java

示例11: testMaxWithValidRange2WithNoCQ

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test(timeout = 300000)
public void testMaxWithValidRange2WithNoCQ() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addFamily(TEST_FAMILY);
  scan.setStartRow(ROWS[6]);
  scan.setStopRow(ROWS[7]);
  final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci = 
      new DoubleColumnInterpreter();
  double max = aClient.max(TEST_TABLE, ci, scan);
  assertEquals(6.00, max, 0.00);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:13,代码来源:TestDoubleColumnInterpreter.java

示例12: testMinWithValidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
 * @throws Throwable
 */
@Test (timeout=300000)
public void testMinWithValidRange2() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[15]);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  long min = aClient.min(TEST_TABLE, ci, scan);
  assertEquals(5, min);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TestAggregateProtocol.java

示例13: testMaxWithValidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
 * @throws Throwable
 */
@Test (timeout=300000)
public void testMaxWithValidRange2() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[15]);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  long max = aClient.max(TEST_TABLE, ci, scan);
  assertEquals(14, max);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TestAggregateProtocol.java

示例14: testAvgWithValidRange2

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
/**
 * @throws Throwable
 */
@Test (timeout=300000)
public void testAvgWithValidRange2() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addColumn(TEST_FAMILY,TEST_QUALIFIER);
  scan.setStartRow(ROWS[5]);
  scan.setStopRow(ROWS[15]);
  final ColumnInterpreter<Long, Long, EmptyMsg, LongMsg, LongMsg> ci =
      new LongColumnInterpreter();
  double avg = aClient.avg(TEST_TABLE, ci, scan);
  assertEquals(9.5, avg, 0);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TestAggregateProtocol.java

示例15: testStdWithValidRange2WithNoCQ

import org.apache.hadoop.hbase.client.Scan; //导入方法依赖的package包/类
@Test(timeout = 300000)
public void testStdWithValidRange2WithNoCQ() throws Throwable {
  AggregationClient aClient = new AggregationClient(conf);
  Scan scan = new Scan();
  scan.addFamily(TEST_FAMILY);
  scan.setStartRow(ROWS[6]);
  scan.setStopRow(ROWS[7]);
  final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci = 
      new DoubleColumnInterpreter();
  double std = aClient.std(TEST_TABLE, ci, scan);
  System.out.println("std is:" + std);
  assertEquals(0, std, 0.05d);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:14,代码来源:TestDoubleColumnInterpreter.java


注:本文中的org.apache.hadoop.hbase.client.Scan.setStartRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。