Examples of avg()


Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    Filter f = new PrefixFilter(Bytes.toBytes("foo:bar"));
    scan.setFilter(f);
    final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci =
        new DoubleColumnInterpreter();
    Double avg = null;
    avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(Double.NaN, avg, 0);
  }

  /**
   * ****************** Test cases for STD **********************
 
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci =
        new DoubleColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(9.5, avg, 0);
  }

  /**
   * @throws Throwable
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[5]);
    scan.setStopRow(ROWS[15]);
    final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci =
        new DoubleColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(9.5, avg, 0);
  }

  @Test(timeout = 300000)
  public void testAvgWithValidRangeWithNoCQ() throws Throwable {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci =
        new DoubleColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(10.45, avg, 0.01);
  }

  @Test(timeout = 300000)
  public void testAvgWithValidRange2WithNoCQ() throws Throwable {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    scan.addFamily(TEST_FAMILY);
    scan.setStartRow(ROWS[6]);
    scan.setStopRow(ROWS[7]);
    final ColumnInterpreter<Double, Double, EmptyMsg, DoubleMsg, DoubleMsg> ci =
        new DoubleColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(6 + 0.60, avg, 0);
  }

  @Test(timeout = 300000)
  public void testAvgWithValidRangeWithNullCF() {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(9.5, avg, 0);
  }

  /**
   * @throws Throwable
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    scan.addColumn(TEST_FAMILY, TEST_QUALIFIER);
    scan.setStartRow(ROWS[5]);
    scan.setStopRow(ROWS[15]);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(9.5, avg, 0);
  }

  @Test (timeout=300000)
  public void testAvgWithValidRangeWithNoCQ() throws Throwable {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    AggregationClient aClient = new AggregationClient(conf);
    Scan scan = new Scan();
    scan.addFamily(TEST_FAMILY);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(10.45, avg, 0.01);
  }

  @Test (timeout=300000)
  public void testAvgWithValidRange2WithNoCQ() throws Throwable {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    scan.addFamily(TEST_FAMILY);
    scan.setStartRow(ROWS[6]);
    scan.setStopRow(ROWS[7]);
    final ColumnInterpreter<BigDecimal, BigDecimal, EmptyMsg, BigDecimalMsg, BigDecimalMsg> ci =
      new BigDecimalColumnInterpreter();
    double avg = aClient.avg(TEST_TABLE, ci, scan);
    assertEquals(6 + 0.60, avg, 0);
  }

  @Test (timeout=300000)
  public void testAvgWithValidRangeWithNullCF() {
View Full Code Here

Examples of org.apache.hadoop.hbase.client.coprocessor.AggregationClient.avg()

    Scan scan = new Scan();
    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);// CP will throw an IOException about the
    // null column family, and max will be set to 0
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.