コード例 #1
0
 /*
  * Convenience method for displaying output when debugging.
  */
 private void displayRow(Table tbl) {
   final TableIterator<Row> itr = tableAPI.tableIterator(tbl.createPrimaryKey(), null, null);
   while (itr.hasNext()) {
     System.out.println(itr.next());
   }
   itr.close();
 }
コード例 #2
0
  private void deleteExistingData() {

    /* Get an iterator over all the primary keys in the table. */
    final TableIterator<PrimaryKey> itr =
        tableAPI.tableKeysIterator(table.createPrimaryKey(), null, null);

    /* Delete each row from the table. */
    long cnt = 0;
    while (itr.hasNext()) {
      tableAPI.delete(itr.next(), null, null);
      cnt++;
    }
    itr.close();
    System.out.println(cnt + " records deleted");
  }