コード例 #1
0
ファイル: MultiHConnection.java プロジェクト: Reidddddd/hbase
  /**
   * Randomly pick a connection and process the batch of actions for a given table
   *
   * @param actions the actions
   * @param tableName table name
   * @param results the results array
   * @param callback to run when results are in
   * @throws IOException If IO failure occurs
   */
  @SuppressWarnings("deprecation")
  public <R> void processBatchCallback(
      List<? extends Row> actions,
      TableName tableName,
      Object[] results,
      Batch.Callback<R> callback)
      throws IOException {
    // Currently used by RegionStateStore
    ClusterConnection conn =
        (ClusterConnection) connections[ThreadLocalRandom.current().nextInt(noOfConnections)];

    HTable.doBatchWithCallback(actions, results, callback, conn, batchPool, tableName);
  }