org.apache.hadoop.hbase.client.BufferedMutator#flush ( )源码实例Demo

下面列出了org.apache.hadoop.hbase.client.BufferedMutator#flush ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: hudi   文件: HBaseIndex.java
/**
 * Helper method to facilitate performing mutations (including puts and deletes) in Hbase.
 */
private void doMutations(BufferedMutator mutator, List<Mutation> mutations) throws IOException {
  if (mutations.isEmpty()) {
    return;
  }
  mutator.mutate(mutations);
  mutator.flush();
  mutations.clear();
  sleepForTime(SLEEP_TIME_MILLISECONDS);
}
 
源代码2 项目: beam   文件: HBaseIOTest.java
/** Helper function to create a table and return the rows that it created. */
private static void writeData(String tableId, int numRows) throws Exception {
  Connection connection = admin.getConnection();
  TableName tableName = TableName.valueOf(tableId);
  BufferedMutator mutator = connection.getBufferedMutator(tableName);
  List<Mutation> mutations = makeTableData(numRows);
  mutator.mutate(mutations);
  mutator.flush();
  mutator.close();
}
 
源代码3 项目: hbase   文件: TestExpiredMobFileCleaner.java
private void putKVAndFlush(BufferedMutator table, byte[] row, byte[] value, long ts)
    throws Exception {

  Put put = new Put(row, ts);
  put.addColumn(Bytes.toBytes(family), qf, value);
  table.mutate(put);

  table.flush();
  admin.flush(tableName);
}