Beispiel #1
0
  /** Grab some random rows that aren't on the first EE page for the table. */
  public static VoltTable sample(VoltTable t) throws Exception {
    VoltTable t2 = t.clone(4096 * 1024);

    ClientResponse cr =
        client.callProcedure(
            "@AdHoc",
            String.format(
                "select * from %s where pkey >= 100000 order by pkey limit 100;",
                TableHelper.getTableName(t)));
    assert (cr.getStatus() == ClientResponse.SUCCESS);
    VoltTable result = cr.getResults()[0];
    result.resetRowPosition();
    while (result.advanceRow()) {
      t2.add(result);
    }

    return t2;
  }