java/kudu-client/src/test/java/org/apache/kudu/client/TestKuduClient.java
private int countRowsForTestScanNonCoveredTable(KuduTable table,
                                                  Integer lowerBound,
                                                  Integer upperBound) throws Exception {

    KuduScanner.KuduScannerBuilder scanBuilder = syncClient.newScannerBuilder(table);
    if (lowerBound != null) {
      PartialRow bound = basicSchema.newPartialRow();
      bound.addInt(0, lowerBound);
      scanBuilder.lowerBound(bound);
    }
    if (upperBound != null) {
      PartialRow bound = basicSchema.newPartialRow();
      bound.addInt(0, upperBound);
      scanBuilder.exclusiveUpperBound(bound);
    }

    KuduScanner scanner = scanBuilder.build();
    int count = 0;
    while (scanner.hasMoreRows()) {
      count += scanner.nextRows().getNumRows();
    }
    return count;
  }
/**
   * Counts the rows in a table between two optional bounds.
   * @param table the table to scan, must have the basic schema
   * @param lowerBound an optional lower bound key
   * @param upperBound an optional upper bound key
   * @return the row count
   * @throws Exception on error
   */
Counts the rows in a table between two optional bounds.
Counts the rows in a table between two optional bounds .
private int countRowsForTestScanNonCoveredTable(KuduTable table,
                                                  Integer lowerBound,
                                                  Integer upperBound) throws Exception {
    KuduScanner.KuduScannerBuilder scanBuilder = syncClient.newScannerBuilder(table);
    if (lowerBound != null) {
      PartialRow bound = basicSchema.newPartialRow();
      bound.addInt(0, lowerBound);
      scanBuilder.lowerBound(bound);
    }
    if (upperBound != null) {
      PartialRow bound = basicSchema.newPartialRow();
      bound.addInt(0, upperBound);
      scanBuilder.exclusiveUpperBound(bound);
    }
    KuduScanner scanner = scanBuilder.build();
    int count = 0;
    while (scanner.hasMoreRows()) {
      count += scanner.nextRows().getNumRows();
    }
    return count;
  }
private int countRowsForTestScanNonCoveredTable ( KuduTable table , Integer lowerBound , Integer upperBound ) throws Exception { KuduScanner . KuduScannerBuilder scanBuilder = syncClient . newScannerBuilder ( table ) ; if ( lowerBound != null ) { PartialRow bound = basicSchema . newPartialRow ( ) ; bound . addInt ( 0 , lowerBound ) ; scanBuilder . lowerBound ( bound ) ; } if ( upperBound != null ) { PartialRow bound = basicSchema . newPartialRow ( ) ; bound . addInt ( 0 , upperBound ) ; scanBuilder . exclusiveUpperBound ( bound ) ; } KuduScanner scanner = scanBuilder . build ( ) ; int count = 0 ; while ( scanner . hasMoreRows ( ) ) { count += scanner . nextRows ( ) . getNumRows ( ) ; } return count ; }
Counts the rows in a table between two optional bounds.
Counts the rows in a table between two optional bounds .