org.apache.hadoop.hbase.client.Put.getPriority()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(169)

本文整理了Java中org.apache.hadoop.hbase.client.Put.getPriority()方法的一些代码示例,展示了Put.getPriority()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Put.getPriority()方法的具体详情如下:
包路径:org.apache.hadoop.hbase.client.Put
类名称:Put
方法名:getPriority

Put.getPriority介绍

暂无

代码示例

代码示例来源:origin: apache/hbase

private boolean doCheckAndPut(final byte[] row, final byte[] family, final byte[] qualifier,
 final String opName, final byte[] value, final TimeRange timeRange, final Put put)
 throws IOException {
 ClientServiceCallable<Boolean> callable =
   new ClientServiceCallable<Boolean>(this.connection, getName(), row,
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Boolean rpcCall() throws Exception {
   CompareType compareType = CompareType.valueOf(opName);
   MutateRequest request = RequestConverter.buildMutateRequest(
     getLocation().getRegionInfo().getRegionName(), row, family, qualifier,
     new BinaryComparator(value), compareType, timeRange, put);
   MutateResponse response = doMutate(request);
   return Boolean.valueOf(response.getProcessed());
  }
 };
 return rpcCallerFactory.<Boolean> newCaller(this.writeRpcTimeoutMs)
   .callWithRetries(callable, this.operationTimeoutMs);
}

代码示例来源:origin: apache/hbase

/**
 * Submit immediately the list of rows, whatever the server status. Kept for backward
 * compatibility: it allows to be used with the batch interface that return an array of objects.
 * @param task The setting and data
 */
private <CResult> AsyncRequestFuture submitAll(AsyncProcessTask task) {
 RowAccess<? extends Row> rows = task.getRowAccess();
 List<Action> actions = new ArrayList<>(rows.size());
 // The position will be used by the processBatch to match the object array returned.
 int posInList = -1;
 NonceGenerator ng = this.connection.getNonceGenerator();
 int highestPriority = HConstants.PRIORITY_UNSET;
 for (Row r : rows) {
  posInList++;
  if (r instanceof Put) {
   Put put = (Put) r;
   if (put.isEmpty()) {
    throw new IllegalArgumentException("No columns to insert for #" + (posInList+1)+ " item");
   }
   highestPriority = Math.max(put.getPriority(), highestPriority);
  }
  Action action = new Action(r, posInList, highestPriority);
  setNonce(ng, r, action);
  actions.add(action);
 }
 AsyncRequestFutureImpl<CResult> ars = createAsyncRequestFuture(task, actions, ng.getNonceGroup());
 ars.groupAndSendMultiAction(actions, 1);
 return ars;
}

代码示例来源:origin: apache/hbase

@Override
public void put(final Put put) throws IOException {
 validatePut(put);
 ClientServiceCallable<Void> callable =
   new ClientServiceCallable<Void>(this.connection, getName(), put.getRow(),
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Void rpcCall() throws Exception {
   MutateRequest request =
     RequestConverter.buildMutateRequest(getLocation().getRegionInfo().getRegionName(), put);
   doMutate(request);
   return null;
  }
 };
 rpcCallerFactory.<Void> newCaller(this.writeRpcTimeoutMs).callWithRetries(callable,
   this.operationTimeoutMs);
}

代码示例来源:origin: org.apache.hbase/hbase-client

private boolean doCheckAndPut(final byte[] row, final byte[] family, final byte[] qualifier,
 final String opName, final byte[] value, final TimeRange timeRange, final Put put)
 throws IOException {
 ClientServiceCallable<Boolean> callable =
   new ClientServiceCallable<Boolean>(this.connection, getName(), row,
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Boolean rpcCall() throws Exception {
   CompareType compareType = CompareType.valueOf(opName);
   MutateRequest request = RequestConverter.buildMutateRequest(
     getLocation().getRegionInfo().getRegionName(), row, family, qualifier,
     new BinaryComparator(value), compareType, timeRange, put);
   MutateResponse response = doMutate(request);
   return Boolean.valueOf(response.getProcessed());
  }
 };
 return rpcCallerFactory.<Boolean> newCaller(this.writeRpcTimeoutMs)
   .callWithRetries(callable, this.operationTimeoutMs);
}

代码示例来源:origin: org.apache.hbase/hbase-client

/**
 * Submit immediately the list of rows, whatever the server status. Kept for backward
 * compatibility: it allows to be used with the batch interface that return an array of objects.
 * @param task The setting and data
 */
private <CResult> AsyncRequestFuture submitAll(AsyncProcessTask task) {
 RowAccess<? extends Row> rows = task.getRowAccess();
 List<Action> actions = new ArrayList<>(rows.size());
 // The position will be used by the processBatch to match the object array returned.
 int posInList = -1;
 NonceGenerator ng = this.connection.getNonceGenerator();
 int highestPriority = HConstants.PRIORITY_UNSET;
 for (Row r : rows) {
  posInList++;
  if (r instanceof Put) {
   Put put = (Put) r;
   if (put.isEmpty()) {
    throw new IllegalArgumentException("No columns to insert for #" + (posInList+1)+ " item");
   }
   highestPriority = Math.max(put.getPriority(), highestPriority);
  }
  Action action = new Action(r, posInList, highestPriority);
  setNonce(ng, r, action);
  actions.add(action);
 }
 AsyncRequestFutureImpl<CResult> ars = createAsyncRequestFuture(task, actions, ng.getNonceGroup());
 ars.groupAndSendMultiAction(actions, 1);
 return ars;
}

代码示例来源:origin: org.apache.hbase/hbase-client

@Override
public void put(final Put put) throws IOException {
 validatePut(put);
 ClientServiceCallable<Void> callable =
   new ClientServiceCallable<Void>(this.connection, getName(), put.getRow(),
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Void rpcCall() throws Exception {
   MutateRequest request =
     RequestConverter.buildMutateRequest(getLocation().getRegionInfo().getRegionName(), put);
   doMutate(request);
   return null;
  }
 };
 rpcCallerFactory.<Void> newCaller(this.writeRpcTimeoutMs).callWithRetries(callable,
   this.operationTimeoutMs);
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

private boolean doCheckAndPut(final byte[] row, final byte[] family, final byte[] qualifier,
 final String opName, final byte[] value, final TimeRange timeRange, final Put put)
 throws IOException {
 ClientServiceCallable<Boolean> callable =
   new ClientServiceCallable<Boolean>(this.connection, getName(), row,
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Boolean rpcCall() throws Exception {
   CompareType compareType = CompareType.valueOf(opName);
   MutateRequest request = RequestConverter.buildMutateRequest(
     getLocation().getRegionInfo().getRegionName(), row, family, qualifier,
     new BinaryComparator(value), compareType, timeRange, put);
   MutateResponse response = doMutate(request);
   return Boolean.valueOf(response.getProcessed());
  }
 };
 return rpcCallerFactory.<Boolean> newCaller(this.writeRpcTimeoutMs)
   .callWithRetries(callable, this.operationTimeoutMs);
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

/**
 * Submit immediately the list of rows, whatever the server status. Kept for backward
 * compatibility: it allows to be used with the batch interface that return an array of objects.
 * @param task The setting and data
 */
private <CResult> AsyncRequestFuture submitAll(AsyncProcessTask task) {
 RowAccess<? extends Row> rows = task.getRowAccess();
 List<Action> actions = new ArrayList<>(rows.size());
 // The position will be used by the processBatch to match the object array returned.
 int posInList = -1;
 NonceGenerator ng = this.connection.getNonceGenerator();
 int highestPriority = HConstants.PRIORITY_UNSET;
 for (Row r : rows) {
  posInList++;
  if (r instanceof Put) {
   Put put = (Put) r;
   if (put.isEmpty()) {
    throw new IllegalArgumentException("No columns to insert for #" + (posInList+1)+ " item");
   }
   highestPriority = Math.max(put.getPriority(), highestPriority);
  }
  Action action = new Action(r, posInList, highestPriority);
  setNonce(ng, r, action);
  actions.add(action);
 }
 AsyncRequestFutureImpl<CResult> ars = createAsyncRequestFuture(task, actions, ng.getNonceGroup());
 ars.groupAndSendMultiAction(actions, 1);
 return ars;
}

代码示例来源:origin: com.aliyun.hbase/alihbase-client

@Override
public void put(final Put put) throws IOException {
 validatePut(put);
 ClientServiceCallable<Void> callable =
   new ClientServiceCallable<Void>(this.connection, getName(), put.getRow(),
     this.rpcControllerFactory.newController(), put.getPriority()) {
  @Override
  protected Void rpcCall() throws Exception {
   MutateRequest request =
     RequestConverter.buildMutateRequest(getLocation().getRegionInfo().getRegionName(), put);
   doMutate(request);
   return null;
  }
 };
 rpcCallerFactory.<Void> newCaller(this.writeRpcTimeoutMs).callWithRetries(callable,
   this.operationTimeoutMs);
}

相关文章