hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From git-site-r...@apache.org
Subject [25/51] [partial] hbase-site git commit: Published site at 82d554e3783372cc6b05489452c815b57c06f6cd.
Date Fri, 19 May 2017 14:59:11 GMT
http://git-wip-us.apache.org/repos/asf/hbase-site/blob/c635e71b/devapidocs/src-html/org/apache/hadoop/hbase/client/HTable.html
----------------------------------------------------------------------
diff --git a/devapidocs/src-html/org/apache/hadoop/hbase/client/HTable.html b/devapidocs/src-html/org/apache/hadoop/hbase/client/HTable.html
index 15c41e8..d1b87db 100644
--- a/devapidocs/src-html/org/apache/hadoop/hbase/client/HTable.html
+++ b/devapidocs/src-html/org/apache/hadoop/hbase/client/HTable.html
@@ -724,616 +724,614 @@
 <span class="sourceLineNo">716</span>      npe = new NullPointerException("row is null");<a name="line.716"></a>
 <span class="sourceLineNo">717</span>    } else if (family == null) {<a name="line.717"></a>
 <span class="sourceLineNo">718</span>      npe = new NullPointerException("family is null");<a name="line.718"></a>
-<span class="sourceLineNo">719</span>    } else if (qualifier == null) {<a name="line.719"></a>
-<span class="sourceLineNo">720</span>      npe = new NullPointerException("qualifier is null");<a name="line.720"></a>
-<span class="sourceLineNo">721</span>    }<a name="line.721"></a>
-<span class="sourceLineNo">722</span>    if (npe != null) {<a name="line.722"></a>
-<span class="sourceLineNo">723</span>      throw new IOException(<a name="line.723"></a>
-<span class="sourceLineNo">724</span>          "Invalid arguments to incrementColumnValue", npe);<a name="line.724"></a>
-<span class="sourceLineNo">725</span>    }<a name="line.725"></a>
-<span class="sourceLineNo">726</span><a name="line.726"></a>
-<span class="sourceLineNo">727</span>    NoncedRegionServerCallable&lt;Long&gt; callable =<a name="line.727"></a>
-<span class="sourceLineNo">728</span>        new NoncedRegionServerCallable&lt;Long&gt;(this.connection, getName(), row,<a name="line.728"></a>
-<span class="sourceLineNo">729</span>            this.rpcControllerFactory.newController()) {<a name="line.729"></a>
-<span class="sourceLineNo">730</span>      @Override<a name="line.730"></a>
-<span class="sourceLineNo">731</span>      protected Long rpcCall() throws Exception {<a name="line.731"></a>
-<span class="sourceLineNo">732</span>        MutateRequest request = RequestConverter.buildIncrementRequest(<a name="line.732"></a>
-<span class="sourceLineNo">733</span>          getLocation().getRegionInfo().getRegionName(), row, family,<a name="line.733"></a>
-<span class="sourceLineNo">734</span>          qualifier, amount, durability, getNonceGroup(), getNonce());<a name="line.734"></a>
-<span class="sourceLineNo">735</span>        MutateResponse response = doMutate(request);<a name="line.735"></a>
-<span class="sourceLineNo">736</span>        Result result = ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());<a name="line.736"></a>
-<span class="sourceLineNo">737</span>        return Long.valueOf(Bytes.toLong(result.getValue(family, qualifier)));<a name="line.737"></a>
-<span class="sourceLineNo">738</span>      }<a name="line.738"></a>
-<span class="sourceLineNo">739</span>    };<a name="line.739"></a>
-<span class="sourceLineNo">740</span>    return rpcCallerFactory.&lt;Long&gt; newCaller(this.writeRpcTimeout).<a name="line.740"></a>
-<span class="sourceLineNo">741</span>        callWithRetries(callable, this.operationTimeout);<a name="line.741"></a>
-<span class="sourceLineNo">742</span>  }<a name="line.742"></a>
-<span class="sourceLineNo">743</span><a name="line.743"></a>
-<span class="sourceLineNo">744</span>  /**<a name="line.744"></a>
-<span class="sourceLineNo">745</span>   * {@inheritDoc}<a name="line.745"></a>
-<span class="sourceLineNo">746</span>   */<a name="line.746"></a>
-<span class="sourceLineNo">747</span>  @Override<a name="line.747"></a>
-<span class="sourceLineNo">748</span>  public boolean checkAndPut(final byte [] row,<a name="line.748"></a>
-<span class="sourceLineNo">749</span>      final byte [] family, final byte [] qualifier, final byte [] value,<a name="line.749"></a>
-<span class="sourceLineNo">750</span>      final Put put)<a name="line.750"></a>
-<span class="sourceLineNo">751</span>  throws IOException {<a name="line.751"></a>
-<span class="sourceLineNo">752</span>    ClientServiceCallable&lt;Boolean&gt; callable = new ClientServiceCallable&lt;Boolean&gt;(this.connection, getName(), row,<a name="line.752"></a>
-<span class="sourceLineNo">753</span>        this.rpcControllerFactory.newController()) {<a name="line.753"></a>
-<span class="sourceLineNo">754</span>      @Override<a name="line.754"></a>
-<span class="sourceLineNo">755</span>      protected Boolean rpcCall() throws Exception {<a name="line.755"></a>
-<span class="sourceLineNo">756</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.756"></a>
-<span class="sourceLineNo">757</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.757"></a>
-<span class="sourceLineNo">758</span>          new BinaryComparator(value), CompareType.EQUAL, put);<a name="line.758"></a>
-<span class="sourceLineNo">759</span>        MutateResponse response = doMutate(request);<a name="line.759"></a>
-<span class="sourceLineNo">760</span>        return Boolean.valueOf(response.getProcessed());<a name="line.760"></a>
-<span class="sourceLineNo">761</span>      }<a name="line.761"></a>
-<span class="sourceLineNo">762</span>    };<a name="line.762"></a>
-<span class="sourceLineNo">763</span>    return rpcCallerFactory.&lt;Boolean&gt; newCaller(this.writeRpcTimeout).<a name="line.763"></a>
-<span class="sourceLineNo">764</span>        callWithRetries(callable, this.operationTimeout);<a name="line.764"></a>
-<span class="sourceLineNo">765</span>  }<a name="line.765"></a>
-<span class="sourceLineNo">766</span><a name="line.766"></a>
-<span class="sourceLineNo">767</span>  /**<a name="line.767"></a>
-<span class="sourceLineNo">768</span>   * {@inheritDoc}<a name="line.768"></a>
-<span class="sourceLineNo">769</span>   */<a name="line.769"></a>
-<span class="sourceLineNo">770</span>  @Override<a name="line.770"></a>
-<span class="sourceLineNo">771</span>  public boolean checkAndPut(final byte [] row, final byte [] family,<a name="line.771"></a>
-<span class="sourceLineNo">772</span>      final byte [] qualifier, final CompareOp compareOp, final byte [] value,<a name="line.772"></a>
-<span class="sourceLineNo">773</span>      final Put put)<a name="line.773"></a>
-<span class="sourceLineNo">774</span>  throws IOException {<a name="line.774"></a>
-<span class="sourceLineNo">775</span>    ClientServiceCallable&lt;Boolean&gt; callable =<a name="line.775"></a>
-<span class="sourceLineNo">776</span>        new ClientServiceCallable&lt;Boolean&gt;(this.connection, getName(), row,<a name="line.776"></a>
-<span class="sourceLineNo">777</span>            this.rpcControllerFactory.newController()) {<a name="line.777"></a>
-<span class="sourceLineNo">778</span>      @Override<a name="line.778"></a>
-<span class="sourceLineNo">779</span>      protected Boolean rpcCall() throws Exception {<a name="line.779"></a>
-<span class="sourceLineNo">780</span>        CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.780"></a>
-<span class="sourceLineNo">781</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.781"></a>
-<span class="sourceLineNo">782</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.782"></a>
-<span class="sourceLineNo">783</span>          new BinaryComparator(value), compareType, put);<a name="line.783"></a>
-<span class="sourceLineNo">784</span>        MutateResponse response = doMutate(request);<a name="line.784"></a>
-<span class="sourceLineNo">785</span>        return Boolean.valueOf(response.getProcessed());<a name="line.785"></a>
-<span class="sourceLineNo">786</span>      }<a name="line.786"></a>
-<span class="sourceLineNo">787</span>    };<a name="line.787"></a>
-<span class="sourceLineNo">788</span>    return rpcCallerFactory.&lt;Boolean&gt; newCaller(this.writeRpcTimeout).<a name="line.788"></a>
-<span class="sourceLineNo">789</span>        callWithRetries(callable, this.operationTimeout);<a name="line.789"></a>
-<span class="sourceLineNo">790</span>  }<a name="line.790"></a>
-<span class="sourceLineNo">791</span><a name="line.791"></a>
-<span class="sourceLineNo">792</span>  /**<a name="line.792"></a>
-<span class="sourceLineNo">793</span>   * {@inheritDoc}<a name="line.793"></a>
-<span class="sourceLineNo">794</span>   */<a name="line.794"></a>
-<span class="sourceLineNo">795</span>  @Override<a name="line.795"></a>
-<span class="sourceLineNo">796</span>  public boolean checkAndDelete(final byte [] row, final byte [] family, final byte [] qualifier,<a name="line.796"></a>
-<span class="sourceLineNo">797</span>      final byte [] value, final Delete delete) throws IOException {<a name="line.797"></a>
-<span class="sourceLineNo">798</span>    return checkAndDelete(row, family, qualifier, CompareOp.EQUAL, value, delete);<a name="line.798"></a>
-<span class="sourceLineNo">799</span>  }<a name="line.799"></a>
-<span class="sourceLineNo">800</span><a name="line.800"></a>
-<span class="sourceLineNo">801</span>  /**<a name="line.801"></a>
-<span class="sourceLineNo">802</span>   * {@inheritDoc}<a name="line.802"></a>
-<span class="sourceLineNo">803</span>   */<a name="line.803"></a>
-<span class="sourceLineNo">804</span>  @Override<a name="line.804"></a>
-<span class="sourceLineNo">805</span>  public boolean checkAndDelete(final byte [] row, final byte [] family,<a name="line.805"></a>
-<span class="sourceLineNo">806</span>      final byte [] qualifier, final CompareOp compareOp, final byte [] value,<a name="line.806"></a>
-<span class="sourceLineNo">807</span>      final Delete delete)<a name="line.807"></a>
-<span class="sourceLineNo">808</span>  throws IOException {<a name="line.808"></a>
-<span class="sourceLineNo">809</span>    CancellableRegionServerCallable&lt;SingleResponse&gt; callable =<a name="line.809"></a>
-<span class="sourceLineNo">810</span>        new CancellableRegionServerCallable&lt;SingleResponse&gt;(<a name="line.810"></a>
-<span class="sourceLineNo">811</span>            this.connection, getName(), row, this.rpcControllerFactory.newController(),<a name="line.811"></a>
-<span class="sourceLineNo">812</span>            writeRpcTimeout, new RetryingTimeTracker().start()) {<a name="line.812"></a>
-<span class="sourceLineNo">813</span>      @Override<a name="line.813"></a>
-<span class="sourceLineNo">814</span>      protected SingleResponse rpcCall() throws Exception {<a name="line.814"></a>
-<span class="sourceLineNo">815</span>        CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.815"></a>
-<span class="sourceLineNo">816</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.816"></a>
-<span class="sourceLineNo">817</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.817"></a>
-<span class="sourceLineNo">818</span>          new BinaryComparator(value), compareType, delete);<a name="line.818"></a>
-<span class="sourceLineNo">819</span>        MutateResponse response = doMutate(request);<a name="line.819"></a>
-<span class="sourceLineNo">820</span>        return ResponseConverter.getResult(request, response, getRpcControllerCellScanner());<a name="line.820"></a>
-<span class="sourceLineNo">821</span>      }<a name="line.821"></a>
-<span class="sourceLineNo">822</span>    };<a name="line.822"></a>
-<span class="sourceLineNo">823</span>    List&lt;Delete&gt; rows = Collections.singletonList(delete);<a name="line.823"></a>
-<span class="sourceLineNo">824</span>    Object[] results = new Object[1];<a name="line.824"></a>
-<span class="sourceLineNo">825</span>    AsyncProcessTask task = AsyncProcessTask.newBuilder()<a name="line.825"></a>
-<span class="sourceLineNo">826</span>            .setPool(pool)<a name="line.826"></a>
-<span class="sourceLineNo">827</span>            .setTableName(tableName)<a name="line.827"></a>
-<span class="sourceLineNo">828</span>            .setRowAccess(rows)<a name="line.828"></a>
-<span class="sourceLineNo">829</span>            .setCallable(callable)<a name="line.829"></a>
-<span class="sourceLineNo">830</span>            // TODO any better timeout?<a name="line.830"></a>
-<span class="sourceLineNo">831</span>            .setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))<a name="line.831"></a>
-<span class="sourceLineNo">832</span>            .setOperationTimeout(operationTimeout)<a name="line.832"></a>
-<span class="sourceLineNo">833</span>            .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)<a name="line.833"></a>
-<span class="sourceLineNo">834</span>            .setResults(results)<a name="line.834"></a>
-<span class="sourceLineNo">835</span>            .build();<a name="line.835"></a>
-<span class="sourceLineNo">836</span>    AsyncRequestFuture ars = multiAp.submit(task);<a name="line.836"></a>
-<span class="sourceLineNo">837</span>    ars.waitUntilDone();<a name="line.837"></a>
-<span class="sourceLineNo">838</span>    if (ars.hasError()) {<a name="line.838"></a>
-<span class="sourceLineNo">839</span>      throw ars.getErrors();<a name="line.839"></a>
-<span class="sourceLineNo">840</span>    }<a name="line.840"></a>
-<span class="sourceLineNo">841</span>    return ((SingleResponse.Entry)results[0]).isProcessed();<a name="line.841"></a>
-<span class="sourceLineNo">842</span>  }<a name="line.842"></a>
-<span class="sourceLineNo">843</span><a name="line.843"></a>
-<span class="sourceLineNo">844</span>  /**<a name="line.844"></a>
-<span class="sourceLineNo">845</span>   * {@inheritDoc}<a name="line.845"></a>
-<span class="sourceLineNo">846</span>   */<a name="line.846"></a>
-<span class="sourceLineNo">847</span>  @Override<a name="line.847"></a>
-<span class="sourceLineNo">848</span>  public boolean checkAndMutate(final byte [] row, final byte [] family, final byte [] qualifier,<a name="line.848"></a>
-<span class="sourceLineNo">849</span>    final CompareOp compareOp, final byte [] value, final RowMutations rm)<a name="line.849"></a>
-<span class="sourceLineNo">850</span>    throws IOException {<a name="line.850"></a>
-<span class="sourceLineNo">851</span>    CancellableRegionServerCallable&lt;MultiResponse&gt; callable =<a name="line.851"></a>
-<span class="sourceLineNo">852</span>      new CancellableRegionServerCallable&lt;MultiResponse&gt;(connection, getName(), rm.getRow(),<a name="line.852"></a>
-<span class="sourceLineNo">853</span>        rpcControllerFactory.newController(), writeRpcTimeout, new RetryingTimeTracker().start()) {<a name="line.853"></a>
-<span class="sourceLineNo">854</span>        @Override<a name="line.854"></a>
-<span class="sourceLineNo">855</span>        protected MultiResponse rpcCall() throws Exception {<a name="line.855"></a>
-<span class="sourceLineNo">856</span>          CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.856"></a>
-<span class="sourceLineNo">857</span>          MultiRequest request = RequestConverter.buildMutateRequest(<a name="line.857"></a>
-<span class="sourceLineNo">858</span>            getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.858"></a>
-<span class="sourceLineNo">859</span>            new BinaryComparator(value), compareType, rm);<a name="line.859"></a>
-<span class="sourceLineNo">860</span>          ClientProtos.MultiResponse response = doMulti(request);<a name="line.860"></a>
-<span class="sourceLineNo">861</span>          ClientProtos.RegionActionResult res = response.getRegionActionResultList().get(0);<a name="line.861"></a>
-<span class="sourceLineNo">862</span>          if (res.hasException()) {<a name="line.862"></a>
-<span class="sourceLineNo">863</span>            Throwable ex = ProtobufUtil.toException(res.getException());<a name="line.863"></a>
-<span class="sourceLineNo">864</span>            if (ex instanceof IOException) {<a name="line.864"></a>
-<span class="sourceLineNo">865</span>              throw (IOException)ex;<a name="line.865"></a>
-<span class="sourceLineNo">866</span>            }<a name="line.866"></a>
-<span class="sourceLineNo">867</span>            throw new IOException("Failed to checkAndMutate row: "+<a name="line.867"></a>
-<span class="sourceLineNo">868</span>              Bytes.toStringBinary(rm.getRow()), ex);<a name="line.868"></a>
-<span class="sourceLineNo">869</span>          }<a name="line.869"></a>
-<span class="sourceLineNo">870</span>          return ResponseConverter.getResults(request, response, getRpcControllerCellScanner());<a name="line.870"></a>
-<span class="sourceLineNo">871</span>        }<a name="line.871"></a>
-<span class="sourceLineNo">872</span>      };<a name="line.872"></a>
-<span class="sourceLineNo">873</span><a name="line.873"></a>
-<span class="sourceLineNo">874</span>    /**<a name="line.874"></a>
-<span class="sourceLineNo">875</span>     *  Currently, we use one array to store 'processed' flag which is returned by server.<a name="line.875"></a>
-<span class="sourceLineNo">876</span>     *  It is excessive to send such a large array, but that is required by the framework right now<a name="line.876"></a>
-<span class="sourceLineNo">877</span>     * */<a name="line.877"></a>
-<span class="sourceLineNo">878</span>    Object[] results = new Object[rm.getMutations().size()];<a name="line.878"></a>
-<span class="sourceLineNo">879</span>    AsyncProcessTask task = AsyncProcessTask.newBuilder()<a name="line.879"></a>
-<span class="sourceLineNo">880</span>            .setPool(pool)<a name="line.880"></a>
-<span class="sourceLineNo">881</span>            .setTableName(tableName)<a name="line.881"></a>
-<span class="sourceLineNo">882</span>            .setRowAccess(rm.getMutations())<a name="line.882"></a>
-<span class="sourceLineNo">883</span>            .setResults(results)<a name="line.883"></a>
-<span class="sourceLineNo">884</span>            .setCallable(callable)<a name="line.884"></a>
-<span class="sourceLineNo">885</span>            // TODO any better timeout?<a name="line.885"></a>
-<span class="sourceLineNo">886</span>            .setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))<a name="line.886"></a>
-<span class="sourceLineNo">887</span>            .setOperationTimeout(operationTimeout)<a name="line.887"></a>
-<span class="sourceLineNo">888</span>            .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)<a name="line.888"></a>
-<span class="sourceLineNo">889</span>            .build();<a name="line.889"></a>
-<span class="sourceLineNo">890</span>    AsyncRequestFuture ars = multiAp.submit(task);<a name="line.890"></a>
-<span class="sourceLineNo">891</span>    ars.waitUntilDone();<a name="line.891"></a>
-<span class="sourceLineNo">892</span>    if (ars.hasError()) {<a name="line.892"></a>
-<span class="sourceLineNo">893</span>      throw ars.getErrors();<a name="line.893"></a>
-<span class="sourceLineNo">894</span>    }<a name="line.894"></a>
-<span class="sourceLineNo">895</span><a name="line.895"></a>
-<span class="sourceLineNo">896</span>    return ((Result)results[0]).getExists();<a name="line.896"></a>
-<span class="sourceLineNo">897</span>  }<a name="line.897"></a>
-<span class="sourceLineNo">898</span><a name="line.898"></a>
-<span class="sourceLineNo">899</span>  /**<a name="line.899"></a>
-<span class="sourceLineNo">900</span>   * {@inheritDoc}<a name="line.900"></a>
-<span class="sourceLineNo">901</span>   */<a name="line.901"></a>
-<span class="sourceLineNo">902</span>  @Override<a name="line.902"></a>
-<span class="sourceLineNo">903</span>  public boolean exists(final Get get) throws IOException {<a name="line.903"></a>
-<span class="sourceLineNo">904</span>    Result r = get(get, true);<a name="line.904"></a>
-<span class="sourceLineNo">905</span>    assert r.getExists() != null;<a name="line.905"></a>
-<span class="sourceLineNo">906</span>    return r.getExists();<a name="line.906"></a>
-<span class="sourceLineNo">907</span>  }<a name="line.907"></a>
-<span class="sourceLineNo">908</span><a name="line.908"></a>
-<span class="sourceLineNo">909</span>  /**<a name="line.909"></a>
-<span class="sourceLineNo">910</span>   * {@inheritDoc}<a name="line.910"></a>
-<span class="sourceLineNo">911</span>   */<a name="line.911"></a>
-<span class="sourceLineNo">912</span>  @Override<a name="line.912"></a>
-<span class="sourceLineNo">913</span>  public boolean[] existsAll(final List&lt;Get&gt; gets) throws IOException {<a name="line.913"></a>
-<span class="sourceLineNo">914</span>    if (gets.isEmpty()) return new boolean[]{};<a name="line.914"></a>
-<span class="sourceLineNo">915</span>    if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};<a name="line.915"></a>
-<span class="sourceLineNo">916</span><a name="line.916"></a>
-<span class="sourceLineNo">917</span>    ArrayList&lt;Get&gt; exists = new ArrayList&lt;&gt;(gets.size());<a name="line.917"></a>
-<span class="sourceLineNo">918</span>    for (Get g: gets){<a name="line.918"></a>
-<span class="sourceLineNo">919</span>      Get ge = new Get(g);<a name="line.919"></a>
-<span class="sourceLineNo">920</span>      ge.setCheckExistenceOnly(true);<a name="line.920"></a>
-<span class="sourceLineNo">921</span>      exists.add(ge);<a name="line.921"></a>
-<span class="sourceLineNo">922</span>    }<a name="line.922"></a>
-<span class="sourceLineNo">923</span><a name="line.923"></a>
-<span class="sourceLineNo">924</span>    Object[] r1= new Object[exists.size()];<a name="line.924"></a>
-<span class="sourceLineNo">925</span>    try {<a name="line.925"></a>
-<span class="sourceLineNo">926</span>      batch(exists, r1, readRpcTimeout);<a name="line.926"></a>
-<span class="sourceLineNo">927</span>    } catch (InterruptedException e) {<a name="line.927"></a>
-<span class="sourceLineNo">928</span>      throw (InterruptedIOException)new InterruptedIOException().initCause(e);<a name="line.928"></a>
-<span class="sourceLineNo">929</span>    }<a name="line.929"></a>
-<span class="sourceLineNo">930</span><a name="line.930"></a>
-<span class="sourceLineNo">931</span>    // translate.<a name="line.931"></a>
-<span class="sourceLineNo">932</span>    boolean[] results = new boolean[r1.length];<a name="line.932"></a>
-<span class="sourceLineNo">933</span>    int i = 0;<a name="line.933"></a>
-<span class="sourceLineNo">934</span>    for (Object o : r1) {<a name="line.934"></a>
-<span class="sourceLineNo">935</span>      // batch ensures if there is a failure we get an exception instead<a name="line.935"></a>
-<span class="sourceLineNo">936</span>      results[i++] = ((Result)o).getExists();<a name="line.936"></a>
-<span class="sourceLineNo">937</span>    }<a name="line.937"></a>
-<span class="sourceLineNo">938</span><a name="line.938"></a>
-<span class="sourceLineNo">939</span>    return results;<a name="line.939"></a>
-<span class="sourceLineNo">940</span>  }<a name="line.940"></a>
-<span class="sourceLineNo">941</span><a name="line.941"></a>
-<span class="sourceLineNo">942</span>  /**<a name="line.942"></a>
-<span class="sourceLineNo">943</span>   * @throws IOException<a name="line.943"></a>
-<span class="sourceLineNo">944</span>   */<a name="line.944"></a>
-<span class="sourceLineNo">945</span>  void flushCommits() throws IOException {<a name="line.945"></a>
-<span class="sourceLineNo">946</span>    if (mutator == null) {<a name="line.946"></a>
-<span class="sourceLineNo">947</span>      // nothing to flush if there's no mutator; don't bother creating one.<a name="line.947"></a>
-<span class="sourceLineNo">948</span>      return;<a name="line.948"></a>
-<span class="sourceLineNo">949</span>    }<a name="line.949"></a>
-<span class="sourceLineNo">950</span>    getBufferedMutator().flush();<a name="line.950"></a>
-<span class="sourceLineNo">951</span>  }<a name="line.951"></a>
-<span class="sourceLineNo">952</span><a name="line.952"></a>
-<span class="sourceLineNo">953</span>  /**<a name="line.953"></a>
-<span class="sourceLineNo">954</span>   * Process a mixed batch of Get, Put and Delete actions. All actions for a<a name="line.954"></a>
-<span class="sourceLineNo">955</span>   * RegionServer are forwarded in one RPC call. Queries are executed in parallel.<a name="line.955"></a>
-<span class="sourceLineNo">956</span>   *<a name="line.956"></a>
-<span class="sourceLineNo">957</span>   * @param list The collection of actions.<a name="line.957"></a>
-<span class="sourceLineNo">958</span>   * @param results An empty array, same size as list. If an exception is thrown,<a name="line.958"></a>
-<span class="sourceLineNo">959</span>   *   you can test here for partial results, and to determine which actions<a name="line.959"></a>
-<span class="sourceLineNo">960</span>   *   processed successfully.<a name="line.960"></a>
-<span class="sourceLineNo">961</span>   * @throws IOException if there are problems talking to META. Per-item<a name="line.961"></a>
-<span class="sourceLineNo">962</span>   *   exceptions are stored in the results array.<a name="line.962"></a>
-<span class="sourceLineNo">963</span>   */<a name="line.963"></a>
-<span class="sourceLineNo">964</span>  public &lt;R&gt; void processBatchCallback(<a name="line.964"></a>
-<span class="sourceLineNo">965</span>    final List&lt;? extends Row&gt; list, final Object[] results, final Batch.Callback&lt;R&gt; callback)<a name="line.965"></a>
-<span class="sourceLineNo">966</span>    throws IOException, InterruptedException {<a name="line.966"></a>
-<span class="sourceLineNo">967</span>    this.batchCallback(list, results, callback);<a name="line.967"></a>
-<span class="sourceLineNo">968</span>  }<a name="line.968"></a>
-<span class="sourceLineNo">969</span><a name="line.969"></a>
-<span class="sourceLineNo">970</span>  @Override<a name="line.970"></a>
-<span class="sourceLineNo">971</span>  public void close() throws IOException {<a name="line.971"></a>
-<span class="sourceLineNo">972</span>    if (this.closed) {<a name="line.972"></a>
-<span class="sourceLineNo">973</span>      return;<a name="line.973"></a>
-<span class="sourceLineNo">974</span>    }<a name="line.974"></a>
-<span class="sourceLineNo">975</span>    flushCommits();<a name="line.975"></a>
-<span class="sourceLineNo">976</span>    if (mutator != null) {<a name="line.976"></a>
-<span class="sourceLineNo">977</span>      mutator.close();<a name="line.977"></a>
-<span class="sourceLineNo">978</span>      mutator = null;<a name="line.978"></a>
-<span class="sourceLineNo">979</span>    }<a name="line.979"></a>
-<span class="sourceLineNo">980</span>    if (cleanupPoolOnClose) {<a name="line.980"></a>
-<span class="sourceLineNo">981</span>      this.pool.shutdown();<a name="line.981"></a>
-<span class="sourceLineNo">982</span>      try {<a name="line.982"></a>
-<span class="sourceLineNo">983</span>        boolean terminated = false;<a name="line.983"></a>
-<span class="sourceLineNo">984</span>        do {<a name="line.984"></a>
-<span class="sourceLineNo">985</span>          // wait until the pool has terminated<a name="line.985"></a>
-<span class="sourceLineNo">986</span>          terminated = this.pool.awaitTermination(60, TimeUnit.SECONDS);<a name="line.986"></a>
-<span class="sourceLineNo">987</span>        } while (!terminated);<a name="line.987"></a>
-<span class="sourceLineNo">988</span>      } catch (InterruptedException e) {<a name="line.988"></a>
-<span class="sourceLineNo">989</span>        this.pool.shutdownNow();<a name="line.989"></a>
-<span class="sourceLineNo">990</span>        LOG.warn("waitForTermination interrupted");<a name="line.990"></a>
-<span class="sourceLineNo">991</span>      }<a name="line.991"></a>
-<span class="sourceLineNo">992</span>    }<a name="line.992"></a>
-<span class="sourceLineNo">993</span>    this.closed = true;<a name="line.993"></a>
-<span class="sourceLineNo">994</span>  }<a name="line.994"></a>
-<span class="sourceLineNo">995</span><a name="line.995"></a>
-<span class="sourceLineNo">996</span>  // validate for well-formedness<a name="line.996"></a>
-<span class="sourceLineNo">997</span>  public void validatePut(final Put put) throws IllegalArgumentException {<a name="line.997"></a>
-<span class="sourceLineNo">998</span>    validatePut(put, connConfiguration.getMaxKeyValueSize());<a name="line.998"></a>
-<span class="sourceLineNo">999</span>  }<a name="line.999"></a>
-<span class="sourceLineNo">1000</span><a name="line.1000"></a>
-<span class="sourceLineNo">1001</span>  // validate for well-formedness<a name="line.1001"></a>
-<span class="sourceLineNo">1002</span>  public static void validatePut(Put put, int maxKeyValueSize) throws IllegalArgumentException {<a name="line.1002"></a>
-<span class="sourceLineNo">1003</span>    if (put.isEmpty()) {<a name="line.1003"></a>
-<span class="sourceLineNo">1004</span>      throw new IllegalArgumentException("No columns to insert");<a name="line.1004"></a>
-<span class="sourceLineNo">1005</span>    }<a name="line.1005"></a>
-<span class="sourceLineNo">1006</span>    if (maxKeyValueSize &gt; 0) {<a name="line.1006"></a>
-<span class="sourceLineNo">1007</span>      for (List&lt;Cell&gt; list : put.getFamilyCellMap().values()) {<a name="line.1007"></a>
-<span class="sourceLineNo">1008</span>        for (Cell cell : list) {<a name="line.1008"></a>
-<span class="sourceLineNo">1009</span>          if (KeyValueUtil.length(cell) &gt; maxKeyValueSize) {<a name="line.1009"></a>
-<span class="sourceLineNo">1010</span>            throw new IllegalArgumentException("KeyValue size too large");<a name="line.1010"></a>
-<span class="sourceLineNo">1011</span>          }<a name="line.1011"></a>
-<span class="sourceLineNo">1012</span>        }<a name="line.1012"></a>
-<span class="sourceLineNo">1013</span>      }<a name="line.1013"></a>
-<span class="sourceLineNo">1014</span>    }<a name="line.1014"></a>
-<span class="sourceLineNo">1015</span>  }<a name="line.1015"></a>
-<span class="sourceLineNo">1016</span><a name="line.1016"></a>
-<span class="sourceLineNo">1017</span>  /**<a name="line.1017"></a>
-<span class="sourceLineNo">1018</span>   * Returns the maximum size in bytes of the write buffer for this HTable.<a name="line.1018"></a>
-<span class="sourceLineNo">1019</span>   * &lt;p&gt;<a name="line.1019"></a>
-<span class="sourceLineNo">1020</span>   * The default value comes from the configuration parameter<a name="line.1020"></a>
-<span class="sourceLineNo">1021</span>   * {@code hbase.client.write.buffer}.<a name="line.1021"></a>
-<span class="sourceLineNo">1022</span>   * @return The size of the write buffer in bytes.<a name="line.1022"></a>
-<span class="sourceLineNo">1023</span>   */<a name="line.1023"></a>
-<span class="sourceLineNo">1024</span>  @Override<a name="line.1024"></a>
-<span class="sourceLineNo">1025</span>  public long getWriteBufferSize() {<a name="line.1025"></a>
-<span class="sourceLineNo">1026</span>    if (mutator == null) {<a name="line.1026"></a>
-<span class="sourceLineNo">1027</span>      return connConfiguration.getWriteBufferSize();<a name="line.1027"></a>
-<span class="sourceLineNo">1028</span>    } else {<a name="line.1028"></a>
-<span class="sourceLineNo">1029</span>      return mutator.getWriteBufferSize();<a name="line.1029"></a>
-<span class="sourceLineNo">1030</span>    }<a name="line.1030"></a>
-<span class="sourceLineNo">1031</span>  }<a name="line.1031"></a>
-<span class="sourceLineNo">1032</span><a name="line.1032"></a>
-<span class="sourceLineNo">1033</span>  /**<a name="line.1033"></a>
-<span class="sourceLineNo">1034</span>   * Sets the size of the buffer in bytes.<a name="line.1034"></a>
-<span class="sourceLineNo">1035</span>   * &lt;p&gt;<a name="line.1035"></a>
-<span class="sourceLineNo">1036</span>   * If the new size is less than the current amount of data in the<a name="line.1036"></a>
-<span class="sourceLineNo">1037</span>   * write buffer, the buffer gets flushed.<a name="line.1037"></a>
-<span class="sourceLineNo">1038</span>   * @param writeBufferSize The new write buffer size, in bytes.<a name="line.1038"></a>
-<span class="sourceLineNo">1039</span>   * @throws IOException if a remote or network exception occurs.<a name="line.1039"></a>
-<span class="sourceLineNo">1040</span>   */<a name="line.1040"></a>
-<span class="sourceLineNo">1041</span>  @Override<a name="line.1041"></a>
-<span class="sourceLineNo">1042</span>  @Deprecated<a name="line.1042"></a>
-<span class="sourceLineNo">1043</span>  public void setWriteBufferSize(long writeBufferSize) throws IOException {<a name="line.1043"></a>
-<span class="sourceLineNo">1044</span>    getBufferedMutator();<a name="line.1044"></a>
-<span class="sourceLineNo">1045</span>    mutator.setWriteBufferSize(writeBufferSize);<a name="line.1045"></a>
-<span class="sourceLineNo">1046</span>  }<a name="line.1046"></a>
-<span class="sourceLineNo">1047</span><a name="line.1047"></a>
-<span class="sourceLineNo">1048</span>  /**<a name="line.1048"></a>
-<span class="sourceLineNo">1049</span>   * The pool is used for mutli requests for this HTable<a name="line.1049"></a>
-<span class="sourceLineNo">1050</span>   * @return the pool used for mutli<a name="line.1050"></a>
-<span class="sourceLineNo">1051</span>   */<a name="line.1051"></a>
-<span class="sourceLineNo">1052</span>  ExecutorService getPool() {<a name="line.1052"></a>
-<span class="sourceLineNo">1053</span>    return this.pool;<a name="line.1053"></a>
-<span class="sourceLineNo">1054</span>  }<a name="line.1054"></a>
-<span class="sourceLineNo">1055</span><a name="line.1055"></a>
-<span class="sourceLineNo">1056</span>  /**<a name="line.1056"></a>
-<span class="sourceLineNo">1057</span>   * Explicitly clears the region cache to fetch the latest value from META.<a name="line.1057"></a>
-<span class="sourceLineNo">1058</span>   * This is a power user function: avoid unless you know the ramifications.<a name="line.1058"></a>
-<span class="sourceLineNo">1059</span>   */<a name="line.1059"></a>
-<span class="sourceLineNo">1060</span>  public void clearRegionCache() {<a name="line.1060"></a>
-<span class="sourceLineNo">1061</span>    this.connection.clearRegionCache();<a name="line.1061"></a>
-<span class="sourceLineNo">1062</span>  }<a name="line.1062"></a>
-<span class="sourceLineNo">1063</span><a name="line.1063"></a>
-<span class="sourceLineNo">1064</span>  /**<a name="line.1064"></a>
-<span class="sourceLineNo">1065</span>   * {@inheritDoc}<a name="line.1065"></a>
-<span class="sourceLineNo">1066</span>   */<a name="line.1066"></a>
-<span class="sourceLineNo">1067</span>  @Override<a name="line.1067"></a>
-<span class="sourceLineNo">1068</span>  public CoprocessorRpcChannel coprocessorService(byte[] row) {<a name="line.1068"></a>
-<span class="sourceLineNo">1069</span>    return new RegionCoprocessorRpcChannel(connection, tableName, row);<a name="line.1069"></a>
-<span class="sourceLineNo">1070</span>  }<a name="line.1070"></a>
-<span class="sourceLineNo">1071</span><a name="line.1071"></a>
-<span class="sourceLineNo">1072</span>  /**<a name="line.1072"></a>
-<span class="sourceLineNo">1073</span>   * {@inheritDoc}<a name="line.1073"></a>
-<span class="sourceLineNo">1074</span>   */<a name="line.1074"></a>
-<span class="sourceLineNo">1075</span>  @Override<a name="line.1075"></a>
-<span class="sourceLineNo">1076</span>  public &lt;T extends Service, R&gt; Map&lt;byte[],R&gt; coprocessorService(final Class&lt;T&gt; service,<a name="line.1076"></a>
-<span class="sourceLineNo">1077</span>      byte[] startKey, byte[] endKey, final Batch.Call&lt;T,R&gt; callable)<a name="line.1077"></a>
-<span class="sourceLineNo">1078</span>      throws ServiceException, Throwable {<a name="line.1078"></a>
-<span class="sourceLineNo">1079</span>    final Map&lt;byte[],R&gt; results =  Collections.synchronizedMap(<a name="line.1079"></a>
-<span class="sourceLineNo">1080</span>        new TreeMap&lt;byte[], R&gt;(Bytes.BYTES_COMPARATOR));<a name="line.1080"></a>
-<span class="sourceLineNo">1081</span>    coprocessorService(service, startKey, endKey, callable, new Batch.Callback&lt;R&gt;() {<a name="line.1081"></a>
-<span class="sourceLineNo">1082</span>      @Override<a name="line.1082"></a>
-<span class="sourceLineNo">1083</span>      public void update(byte[] region, byte[] row, R value) {<a name="line.1083"></a>
-<span class="sourceLineNo">1084</span>        if (region != null) {<a name="line.1084"></a>
-<span class="sourceLineNo">1085</span>          results.put(region, value);<a name="line.1085"></a>
-<span class="sourceLineNo">1086</span>        }<a name="line.1086"></a>
-<span class="sourceLineNo">1087</span>      }<a name="line.1087"></a>
-<span class="sourceLineNo">1088</span>    });<a name="line.1088"></a>
-<span class="sourceLineNo">1089</span>    return results;<a name="line.1089"></a>
-<span class="sourceLineNo">1090</span>  }<a name="line.1090"></a>
-<span class="sourceLineNo">1091</span><a name="line.1091"></a>
-<span class="sourceLineNo">1092</span>  /**<a name="line.1092"></a>
-<span class="sourceLineNo">1093</span>   * {@inheritDoc}<a name="line.1093"></a>
-<span class="sourceLineNo">1094</span>   */<a name="line.1094"></a>
-<span class="sourceLineNo">1095</span>  @Override<a name="line.1095"></a>
-<span class="sourceLineNo">1096</span>  public &lt;T extends Service, R&gt; void coprocessorService(final Class&lt;T&gt; service,<a name="line.1096"></a>
-<span class="sourceLineNo">1097</span>      byte[] startKey, byte[] endKey, final Batch.Call&lt;T,R&gt; callable,<a name="line.1097"></a>
-<span class="sourceLineNo">1098</span>      final Batch.Callback&lt;R&gt; callback) throws ServiceException, Throwable {<a name="line.1098"></a>
-<span class="sourceLineNo">1099</span>    // get regions covered by the row range<a name="line.1099"></a>
-<span class="sourceLineNo">1100</span>    List&lt;byte[]&gt; keys = getStartKeysInRange(startKey, endKey);<a name="line.1100"></a>
-<span class="sourceLineNo">1101</span>    Map&lt;byte[],Future&lt;R&gt;&gt; futures = new TreeMap&lt;&gt;(Bytes.BYTES_COMPARATOR);<a name="line.1101"></a>
-<span class="sourceLineNo">1102</span>    for (final byte[] r : keys) {<a name="line.1102"></a>
-<span class="sourceLineNo">1103</span>      final RegionCoprocessorRpcChannel channel =<a name="line.1103"></a>
-<span class="sourceLineNo">1104</span>          new RegionCoprocessorRpcChannel(connection, tableName, r);<a name="line.1104"></a>
-<span class="sourceLineNo">1105</span>      Future&lt;R&gt; future = pool.submit(new Callable&lt;R&gt;() {<a name="line.1105"></a>
-<span class="sourceLineNo">1106</span>        @Override<a name="line.1106"></a>
-<span class="sourceLineNo">1107</span>        public R call() throws Exception {<a name="line.1107"></a>
-<span class="sourceLineNo">1108</span>          T instance =<a name="line.1108"></a>
-<span class="sourceLineNo">1109</span>              org.apache.hadoop.hbase.protobuf.ProtobufUtil.newServiceStub(service, channel);<a name="line.1109"></a>
-<span class="sourceLineNo">1110</span>          R result = callable.call(instance);<a name="line.1110"></a>
-<span class="sourceLineNo">1111</span>          byte[] region = channel.getLastRegion();<a name="line.1111"></a>
-<span class="sourceLineNo">1112</span>          if (callback != null) {<a name="line.1112"></a>
-<span class="sourceLineNo">1113</span>            callback.update(region, r, result);<a name="line.1113"></a>
-<span class="sourceLineNo">1114</span>          }<a name="line.1114"></a>
-<span class="sourceLineNo">1115</span>          return result;<a name="line.1115"></a>
-<span class="sourceLineNo">1116</span>        }<a name="line.1116"></a>
-<span class="sourceLineNo">1117</span>      });<a name="line.1117"></a>
-<span class="sourceLineNo">1118</span>      futures.put(r, future);<a name="line.1118"></a>
-<span class="sourceLineNo">1119</span>    }<a name="line.1119"></a>
-<span class="sourceLineNo">1120</span>    for (Map.Entry&lt;byte[],Future&lt;R&gt;&gt; e : futures.entrySet()) {<a name="line.1120"></a>
-<span class="sourceLineNo">1121</span>      try {<a name="line.1121"></a>
-<span class="sourceLineNo">1122</span>        e.getValue().get();<a name="line.1122"></a>
-<span class="sourceLineNo">1123</span>      } catch (ExecutionException ee) {<a name="line.1123"></a>
-<span class="sourceLineNo">1124</span>        LOG.warn("Error calling coprocessor service " + service.getName() + " for row "<a name="line.1124"></a>
-<span class="sourceLineNo">1125</span>            + Bytes.toStringBinary(e.getKey()), ee);<a name="line.1125"></a>
-<span class="sourceLineNo">1126</span>        throw ee.getCause();<a name="line.1126"></a>
-<span class="sourceLineNo">1127</span>      } catch (InterruptedException ie) {<a name="line.1127"></a>
-<span class="sourceLineNo">1128</span>        throw new InterruptedIOException("Interrupted calling coprocessor service "<a name="line.1128"></a>
-<span class="sourceLineNo">1129</span>            + service.getName() + " for row " + Bytes.toStringBinary(e.getKey())).initCause(ie);<a name="line.1129"></a>
-<span class="sourceLineNo">1130</span>      }<a name="line.1130"></a>
-<span class="sourceLineNo">1131</span>    }<a name="line.1131"></a>
-<span class="sourceLineNo">1132</span>  }<a name="line.1132"></a>
-<span class="sourceLineNo">1133</span><a name="line.1133"></a>
-<span class="sourceLineNo">1134</span>  private List&lt;byte[]&gt; getStartKeysInRange(byte[] start, byte[] end)<a name="line.1134"></a>
-<span class="sourceLineNo">1135</span>  throws IOException {<a name="line.1135"></a>
-<span class="sourceLineNo">1136</span>    if (start == null) {<a name="line.1136"></a>
-<span class="sourceLineNo">1137</span>      start = HConstants.EMPTY_START_ROW;<a name="line.1137"></a>
-<span class="sourceLineNo">1138</span>    }<a name="line.1138"></a>
-<span class="sourceLineNo">1139</span>    if (end == null) {<a name="line.1139"></a>
-<span class="sourceLineNo">1140</span>      end = HConstants.EMPTY_END_ROW;<a name="line.1140"></a>
-<span class="sourceLineNo">1141</span>    }<a name="line.1141"></a>
-<span class="sourceLineNo">1142</span>    return getKeysAndRegionsInRange(start, end, true).getFirst();<a name="line.1142"></a>
-<span class="sourceLineNo">1143</span>  }<a name="line.1143"></a>
-<span class="sourceLineNo">1144</span><a name="line.1144"></a>
-<span class="sourceLineNo">1145</span>  @Override<a name="line.1145"></a>
-<span class="sourceLineNo">1146</span>  @Deprecated<a name="line.1146"></a>
-<span class="sourceLineNo">1147</span>  public void setOperationTimeout(int operationTimeout) {<a name="line.1147"></a>
-<span class="sourceLineNo">1148</span>    this.operationTimeout = operationTimeout;<a name="line.1148"></a>
-<span class="sourceLineNo">1149</span>    if (mutator != null) {<a name="line.1149"></a>
-<span class="sourceLineNo">1150</span>      mutator.setOperationTimeout(operationTimeout);<a name="line.1150"></a>
-<span class="sourceLineNo">1151</span>    }<a name="line.1151"></a>
-<span class="sourceLineNo">1152</span>  }<a name="line.1152"></a>
-<span class="sourceLineNo">1153</span><a name="line.1153"></a>
-<span class="sourceLineNo">1154</span>  @Override<a name="line.1154"></a>
-<span class="sourceLineNo">1155</span>  public int getOperationTimeout() {<a name="line.1155"></a>
-<span class="sourceLineNo">1156</span>    return operationTimeout;<a name="line.1156"></a>
-<span class="sourceLineNo">1157</span>  }<a name="line.1157"></a>
-<span class="sourceLineNo">1158</span><a name="line.1158"></a>
-<span class="sourceLineNo">1159</span>  @Override<a name="line.1159"></a>
-<span class="sourceLineNo">1160</span>  @Deprecated<a name="line.1160"></a>
-<span class="sourceLineNo">1161</span>  public int getRpcTimeout() {<a name="line.1161"></a>
-<span class="sourceLineNo">1162</span>    return rpcTimeout;<a name="line.1162"></a>
-<span class="sourceLineNo">1163</span>  }<a name="line.1163"></a>
-<span class="sourceLineNo">1164</span><a name="line.1164"></a>
-<span class="sourceLineNo">1165</span>  @Override<a name="line.1165"></a>
-<span class="sourceLineNo">1166</span>  @Deprecated<a name="line.1166"></a>
-<span class="sourceLineNo">1167</span>  public void setRpcTimeout(int rpcTimeout) {<a name="line.1167"></a>
-<span class="sourceLineNo">1168</span>    setReadRpcTimeout(rpcTimeout);<a name="line.1168"></a>
-<span class="sourceLineNo">1169</span>    setWriteRpcTimeout(rpcTimeout);<a name="line.1169"></a>
-<span class="sourceLineNo">1170</span>  }<a name="line.1170"></a>
-<span class="sourceLineNo">1171</span><a name="line.1171"></a>
-<span class="sourceLineNo">1172</span>  @Override<a name="line.1172"></a>
-<span class="sourceLineNo">1173</span>  public int getWriteRpcTimeout() {<a name="line.1173"></a>
-<span class="sourceLineNo">1174</span>    return writeRpcTimeout;<a name="line.1174"></a>
-<span class="sourceLineNo">1175</span>  }<a name="line.1175"></a>
-<span class="sourceLineNo">1176</span><a name="line.1176"></a>
-<span class="sourceLineNo">1177</span>  @Override<a name="line.1177"></a>
-<span class="sourceLineNo">1178</span>  @Deprecated<a name="line.1178"></a>
-<span class="sourceLineNo">1179</span>  public void setWriteRpcTimeout(int writeRpcTimeout) {<a name="line.1179"></a>
-<span class="sourceLineNo">1180</span>    this.writeRpcTimeout = writeRpcTimeout;<a name="line.1180"></a>
-<span class="sourceLineNo">1181</span>    if (mutator != null) {<a name="line.1181"></a>
-<span class="sourceLineNo">1182</span>      mutator.setRpcTimeout(writeRpcTimeout);<a name="line.1182"></a>
-<span class="sourceLineNo">1183</span>    }<a name="line.1183"></a>
-<span class="sourceLineNo">1184</span>  }<a name="line.1184"></a>
-<span class="sourceLineNo">1185</span><a name="line.1185"></a>
-<span class="sourceLineNo">1186</span>  @Override<a name="line.1186"></a>
-<span class="sourceLineNo">1187</span>  public int getReadRpcTimeout() { return readRpcTimeout; }<a name="line.1187"></a>
-<span class="sourceLineNo">1188</span><a name="line.1188"></a>
-<span class="sourceLineNo">1189</span>  @Override<a name="line.1189"></a>
-<span class="sourceLineNo">1190</span>  @Deprecated<a name="line.1190"></a>
-<span class="sourceLineNo">1191</span>  public void setReadRpcTimeout(int readRpcTimeout) {<a name="line.1191"></a>
-<span class="sourceLineNo">1192</span>    this.readRpcTimeout = readRpcTimeout;<a name="line.1192"></a>
-<span class="sourceLineNo">1193</span>  }<a name="line.1193"></a>
-<span class="sourceLineNo">1194</span><a name="line.1194"></a>
-<span class="sourceLineNo">1195</span>  @Override<a name="line.1195"></a>
-<span class="sourceLineNo">1196</span>  public String toString() {<a name="line.1196"></a>
-<span class="sourceLineNo">1197</span>    return tableName + ";" + connection;<a name="line.1197"></a>
-<span class="sourceLineNo">1198</span>  }<a name="line.1198"></a>
-<span class="sourceLineNo">1199</span><a name="line.1199"></a>
-<span class="sourceLineNo">1200</span>  @Override<a name="line.1200"></a>
-<span class="sourceLineNo">1201</span>  public &lt;R extends Message&gt; Map&lt;byte[], R&gt; batchCoprocessorService(<a name="line.1201"></a>
-<span class="sourceLineNo">1202</span>      Descriptors.MethodDescriptor methodDescriptor, Message request,<a name="line.1202"></a>
-<span class="sourceLineNo">1203</span>      byte[] startKey, byte[] endKey, R responsePrototype) throws ServiceException, Throwable {<a name="line.1203"></a>
-<span class="sourceLineNo">1204</span>    final Map&lt;byte[], R&gt; results = Collections.synchronizedMap(new TreeMap&lt;byte[], R&gt;(<a name="line.1204"></a>
-<span class="sourceLineNo">1205</span>        Bytes.BYTES_COMPARATOR));<a name="line.1205"></a>
-<span class="sourceLineNo">1206</span>    batchCoprocessorService(methodDescriptor, request, startKey, endKey, responsePrototype,<a name="line.1206"></a>
-<span class="sourceLineNo">1207</span>        new Callback&lt;R&gt;() {<a name="line.1207"></a>
-<span class="sourceLineNo">1208</span>      @Override<a name="line.1208"></a>
-<span class="sourceLineNo">1209</span>      public void update(byte[] region, byte[] row, R result) {<a name="line.1209"></a>
-<span class="sourceLineNo">1210</span>        if (region != null) {<a name="line.1210"></a>
-<span class="sourceLineNo">1211</span>          results.put(region, result);<a name="line.1211"></a>
-<span class="sourceLineNo">1212</span>        }<a name="line.1212"></a>
-<span class="sourceLineNo">1213</span>      }<a name="line.1213"></a>
-<span class="sourceLineNo">1214</span>    });<a name="line.1214"></a>
-<span class="sourceLineNo">1215</span>    return results;<a name="line.1215"></a>
-<span class="sourceLineNo">1216</span>  }<a name="line.1216"></a>
-<span class="sourceLineNo">1217</span><a name="line.1217"></a>
-<span class="sourceLineNo">1218</span>  /**<a name="line.1218"></a>
-<span class="sourceLineNo">1219</span>   * {@inheritDoc}<a name="line.1219"></a>
-<span class="sourceLineNo">1220</span>   */<a name="line.1220"></a>
-<span class="sourceLineNo">1221</span>  @Override<a name="line.1221"></a>
-<span class="sourceLineNo">1222</span>  public &lt;R extends Message&gt; void batchCoprocessorService(<a name="line.1222"></a>
-<span class="sourceLineNo">1223</span>      final Descriptors.MethodDescriptor methodDescriptor, final Message request,<a name="line.1223"></a>
-<span class="sourceLineNo">1224</span>      byte[] startKey, byte[] endKey, final R responsePrototype, final Callback&lt;R&gt; callback)<a name="line.1224"></a>
-<span class="sourceLineNo">1225</span>      throws ServiceException, Throwable {<a name="line.1225"></a>
-<span class="sourceLineNo">1226</span><a name="line.1226"></a>
-<span class="sourceLineNo">1227</span>    if (startKey == null) {<a name="line.1227"></a>
-<span class="sourceLineNo">1228</span>      startKey = HConstants.EMPTY_START_ROW;<a name="line.1228"></a>
-<span class="sourceLineNo">1229</span>    }<a name="line.1229"></a>
-<span class="sourceLineNo">1230</span>    if (endKey == null) {<a name="line.1230"></a>
-<span class="sourceLineNo">1231</span>      endKey = HConstants.EMPTY_END_ROW;<a name="line.1231"></a>
-<span class="sourceLineNo">1232</span>    }<a name="line.1232"></a>
-<span class="sourceLineNo">1233</span>    // get regions covered by the row range<a name="line.1233"></a>
-<span class="sourceLineNo">1234</span>    Pair&lt;List&lt;byte[]&gt;, List&lt;HRegionLocation&gt;&gt; keysAndRegions =<a name="line.1234"></a>
-<span class="sourceLineNo">1235</span>        getKeysAndRegionsInRange(startKey, endKey, true);<a name="line.1235"></a>
-<span class="sourceLineNo">1236</span>    List&lt;byte[]&gt; keys = keysAndRegions.getFirst();<a name="line.1236"></a>
-<span class="sourceLineNo">1237</span>    List&lt;HRegionLocation&gt; regions = keysAndRegions.getSecond();<a name="line.1237"></a>
-<span class="sourceLineNo">1238</span><a name="line.1238"></a>
-<span class="sourceLineNo">1239</span>    // check if we have any calls to make<a name="line.1239"></a>
-<span class="sourceLineNo">1240</span>    if (keys.isEmpty()) {<a name="line.1240"></a>
-<span class="sourceLineNo">1241</span>      LOG.info("No regions were selected by key range start=" + Bytes.toStringBinary(startKey) +<a name="line.1241"></a>
-<span class="sourceLineNo">1242</span>          ", end=" + Bytes.toStringBinary(endKey));<a name="line.1242"></a>
-<span class="sourceLineNo">1243</span>      return;<a name="line.1243"></a>
-<span class="sourceLineNo">1244</span>    }<a name="line.1244"></a>
-<span class="sourceLineNo">1245</span><a name="line.1245"></a>
-<span class="sourceLineNo">1246</span>    List&lt;RegionCoprocessorServiceExec&gt; execs = new ArrayList&lt;&gt;(keys.size());<a name="line.1246"></a>
-<span class="sourceLineNo">1247</span>    final Map&lt;byte[], RegionCoprocessorServiceExec&gt; execsByRow = new TreeMap&lt;&gt;(Bytes.BYTES_COMPARATOR);<a name="line.1247"></a>
-<span class="sourceLineNo">1248</span>    for (int i = 0; i &lt; keys.size(); i++) {<a name="line.1248"></a>
-<span class="sourceLineNo">1249</span>      final byte[] rowKey = keys.get(i);<a name="line.1249"></a>
-<span class="sourceLineNo">1250</span>      final byte[] region = regions.get(i).getRegionInfo().getRegionName();<a name="line.1250"></a>
-<span class="sourceLineNo">1251</span>      RegionCoprocessorServiceExec exec =<a name="line.1251"></a>
-<span class="sourceLineNo">1252</span>          new RegionCoprocessorServiceExec(region, rowKey, methodDescriptor, request);<a name="line.1252"></a>
-<span class="sourceLineNo">1253</span>      execs.add(exec);<a name="line.1253"></a>
-<span class="sourceLineNo">1254</span>      execsByRow.put(rowKey, exec);<a name="line.1254"></a>
-<span class="sourceLineNo">1255</span>    }<a name="line.1255"></a>
-<span class="sourceLineNo">1256</span><a name="line.1256"></a>
-<span class="sourceLineNo">1257</span>    // tracking for any possible deserialization errors on success callback<a name="line.1257"></a>
-<span class="sourceLineNo">1258</span>    // TODO: it would be better to be able to reuse AsyncProcess.BatchErrors here<a name="line.1258"></a>
-<span class="sourceLineNo">1259</span>    final List&lt;Throwable&gt; callbackErrorExceptions = new ArrayList&lt;&gt;();<a name="line.1259"></a>
-<span class="sourceLineNo">1260</span>    final List&lt;Row&gt; callbackErrorActions = new ArrayList&lt;&gt;();<a name="line.1260"></a>
-<span class="sourceLineNo">1261</span>    final List&lt;String&gt; callbackErrorServers = new ArrayList&lt;&gt;();<a name="line.1261"></a>
-<span class="sourceLineNo">1262</span>    Object[] results = new Object[execs.size()];<a name="line.1262"></a>
-<span class="sourceLineNo">1263</span><a name="line.1263"></a>
-<span class="sourceLineNo">1264</span>    AsyncProcess asyncProcess =<a name="line.1264"></a>
-<span class="sourceLineNo">1265</span>        new AsyncProcess(connection, configuration,<a name="line.1265"></a>
-<span class="sourceLineNo">1266</span>            RpcRetryingCallerFactory.instantiate(configuration, connection.getStatisticsTracker()),<a name="line.1266"></a>
-<span class="sourceLineNo">1267</span>            true, RpcControllerFactory.instantiate(configuration));<a name="line.1267"></a>
-<span class="sourceLineNo">1268</span><a name="line.1268"></a>
-<span class="sourceLineNo">1269</span>    Callback&lt;ClientProtos.CoprocessorServiceResult&gt; resultsCallback<a name="line.1269"></a>
-<span class="sourceLineNo">1270</span>    = (byte[] region, byte[] row, ClientProtos.CoprocessorServiceResult serviceResult) -&gt; {<a name="line.1270"></a>
-<span class="sourceLineNo">1271</span>      if (LOG.isTraceEnabled()) {<a name="line.1271"></a>
-<span class="sourceLineNo">1272</span>        LOG.trace("Received result for endpoint " + methodDescriptor.getFullName() +<a name="line.1272"></a>
-<span class="sourceLineNo">1273</span>            ": region=" + Bytes.toStringBinary(region) +<a name="line.1273"></a>
-<span class="sourceLineNo">1274</span>            ", row=" + Bytes.toStringBinary(row) +<a name="line.1274"></a>
-<span class="sourceLineNo">1275</span>            ", value=" + serviceResult.getValue().getValue());<a name="line.1275"></a>
-<span class="sourceLineNo">1276</span>      }<a name="line.1276"></a>
-<span class="sourceLineNo">1277</span>      try {<a name="line.1277"></a>
-<span class="sourceLineNo">1278</span>        Message.Builder builder = responsePrototype.newBuilderForType();<a name="line.1278"></a>
-<span class="sourceLineNo">1279</span>        org.apache.hadoop.hbase.protobuf.ProtobufUtil.mergeFrom(builder,<a name="line.1279"></a>
-<span class="sourceLineNo">1280</span>            serviceResult.getValue().getValue().toByteArray());<a name="line.1280"></a>
-<span class="sourceLineNo">1281</span>        callback.update(region, row, (R) builder.build());<a name="line.1281"></a>
-<span class="sourceLineNo">1282</span>      } catch (IOException e) {<a name="line.1282"></a>
-<span class="sourceLineNo">1283</span>        LOG.error("Unexpected response type from endpoint " + methodDescriptor.getFullName(),<a name="line.1283"></a>
-<span class="sourceLineNo">1284</span>            e);<a name="line.1284"></a>
-<span class="sourceLineNo">1285</span>        callbackErrorExceptions.add(e);<a name="line.1285"></a>
-<span class="sourceLineNo">1286</span>        callbackErrorActions.add(execsByRow.get(row));<a name="line.1286"></a>
-<span class="sourceLineNo">1287</span>        callbackErrorServers.add("null");<a name="line.1287"></a>
-<span class="sourceLineNo">1288</span>      }<a name="line.1288"></a>
-<span class="sourceLineNo">1289</span>    };<a name="line.1289"></a>
-<span class="sourceLineNo">1290</span>    AsyncProcessTask&lt;ClientProtos.CoprocessorServiceResult&gt; task = AsyncProcessTask.newBuilder(resultsCallback)<a name="line.1290"></a>
-<span class="sourceLineNo">1291</span>            .setPool(pool)<a name="line.1291"></a>
-<span class="sourceLineNo">1292</span>            .setTableName(tableName)<a name="line.1292"></a>
-<span class="sourceLineNo">1293</span>            .setRowAccess(execs)<a name="line.1293"></a>
-<span class="sourceLineNo">1294</span>            .setResults(results)<a name="line.1294"></a>
-<span class="sourceLineNo">1295</span>            .setRpcTimeout(readRpcTimeout)<a name="line.1295"></a>
-<span class="sourceLineNo">1296</span>            .setOperationTimeout(operationTimeout)<a name="line.1296"></a>
-<span class="sourceLineNo">1297</span>            .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)<a name="line.1297"></a>
-<span class="sourceLineNo">1298</span>            .build();<a name="line.1298"></a>
-<span class="sourceLineNo">1299</span>    AsyncRequestFuture future = asyncProcess.submit(task);<a name="line.1299"></a>
-<span class="sourceLineNo">1300</span>    future.waitUntilDone();<a name="line.1300"></a>
-<span class="sourceLineNo">1301</span><a name="line.1301"></a>
-<span class="sourceLineNo">1302</span>    if (future.hasError()) {<a name="line.1302"></a>
-<span class="sourceLineNo">1303</span>      throw future.getErrors();<a name="line.1303"></a>
-<span class="sourceLineNo">1304</span>    } else if (!callbackErrorExceptions.isEmpty()) {<a name="line.1304"></a>
-<span class="sourceLineNo">1305</span>      throw new RetriesExhaustedWithDetailsException(callbackErrorExceptions, callbackErrorActions,<a name="line.1305"></a>
-<span class="sourceLineNo">1306</span>          callbackErrorServers);<a name="line.1306"></a>
-<span class="sourceLineNo">1307</span>    }<a name="line.1307"></a>
-<span class="sourceLineNo">1308</span>  }<a name="line.1308"></a>
-<span class="sourceLineNo">1309</span><a name="line.1309"></a>
-<span class="sourceLineNo">1310</span>  public RegionLocator getRegionLocator() {<a name="line.1310"></a>
-<span class="sourceLineNo">1311</span>    return this.locator;<a name="line.1311"></a>
-<span class="sourceLineNo">1312</span>  }<a name="line.1312"></a>
-<span class="sourceLineNo">1313</span><a name="line.1313"></a>
-<span class="sourceLineNo">1314</span>  @VisibleForTesting<a name="line.1314"></a>
-<span class="sourceLineNo">1315</span>  BufferedMutator getBufferedMutator() throws IOException {<a name="line.1315"></a>
-<span class="sourceLineNo">1316</span>    if (mutator == null) {<a name="line.1316"></a>
-<span class="sourceLineNo">1317</span>      synchronized (mutatorLock) {<a name="line.1317"></a>
-<span class="sourceLineNo">1318</span>        if (mutator == null) {<a name="line.1318"></a>
-<span class="sourceLineNo">1319</span>          this.mutator = (BufferedMutatorImpl) connection.getBufferedMutator(<a name="line.1319"></a>
-<span class="sourceLineNo">1320</span>            new BufferedMutatorParams(tableName).pool(pool).writeBufferSize(writeBufferSize)<a name="line.1320"></a>
-<span class="sourceLineNo">1321</span>                .maxKeyValueSize(connConfiguration.getMaxKeyValueSize())<a name="line.1321"></a>
-<span class="sourceLineNo">1322</span>                .opertationTimeout(operationTimeout).rpcTimeout(writeRpcTimeout));<a name="line.1322"></a>
-<span class="sourceLineNo">1323</span>        }<a name="line.1323"></a>
-<span class="sourceLineNo">1324</span>      }<a name="line.1324"></a>
-<span class="sourceLineNo">1325</span>    }<a name="line.1325"></a>
-<span class="sourceLineNo">1326</span>    return mutator;<a name="line.1326"></a>
-<span class="sourceLineNo">1327</span>  }<a name="line.1327"></a>
-<span class="sourceLineNo">1328</span>}<a name="line.1328"></a>
+<span class="sourceLineNo">719</span>    }<a name="line.719"></a>
+<span class="sourceLineNo">720</span>    if (npe != null) {<a name="line.720"></a>
+<span class="sourceLineNo">721</span>      throw new IOException(<a name="line.721"></a>
+<span class="sourceLineNo">722</span>          "Invalid arguments to incrementColumnValue", npe);<a name="line.722"></a>
+<span class="sourceLineNo">723</span>    }<a name="line.723"></a>
+<span class="sourceLineNo">724</span><a name="line.724"></a>
+<span class="sourceLineNo">725</span>    NoncedRegionServerCallable&lt;Long&gt; callable =<a name="line.725"></a>
+<span class="sourceLineNo">726</span>        new NoncedRegionServerCallable&lt;Long&gt;(this.connection, getName(), row,<a name="line.726"></a>
+<span class="sourceLineNo">727</span>            this.rpcControllerFactory.newController()) {<a name="line.727"></a>
+<span class="sourceLineNo">728</span>      @Override<a name="line.728"></a>
+<span class="sourceLineNo">729</span>      protected Long rpcCall() throws Exception {<a name="line.729"></a>
+<span class="sourceLineNo">730</span>        MutateRequest request = RequestConverter.buildIncrementRequest(<a name="line.730"></a>
+<span class="sourceLineNo">731</span>          getLocation().getRegionInfo().getRegionName(), row, family,<a name="line.731"></a>
+<span class="sourceLineNo">732</span>          qualifier, amount, durability, getNonceGroup(), getNonce());<a name="line.732"></a>
+<span class="sourceLineNo">733</span>        MutateResponse response = doMutate(request);<a name="line.733"></a>
+<span class="sourceLineNo">734</span>        Result result = ProtobufUtil.toResult(response.getResult(), getRpcControllerCellScanner());<a name="line.734"></a>
+<span class="sourceLineNo">735</span>        return Long.valueOf(Bytes.toLong(result.getValue(family, qualifier)));<a name="line.735"></a>
+<span class="sourceLineNo">736</span>      }<a name="line.736"></a>
+<span class="sourceLineNo">737</span>    };<a name="line.737"></a>
+<span class="sourceLineNo">738</span>    return rpcCallerFactory.&lt;Long&gt; newCaller(this.writeRpcTimeout).<a name="line.738"></a>
+<span class="sourceLineNo">739</span>        callWithRetries(callable, this.operationTimeout);<a name="line.739"></a>
+<span class="sourceLineNo">740</span>  }<a name="line.740"></a>
+<span class="sourceLineNo">741</span><a name="line.741"></a>
+<span class="sourceLineNo">742</span>  /**<a name="line.742"></a>
+<span class="sourceLineNo">743</span>   * {@inheritDoc}<a name="line.743"></a>
+<span class="sourceLineNo">744</span>   */<a name="line.744"></a>
+<span class="sourceLineNo">745</span>  @Override<a name="line.745"></a>
+<span class="sourceLineNo">746</span>  public boolean checkAndPut(final byte [] row,<a name="line.746"></a>
+<span class="sourceLineNo">747</span>      final byte [] family, final byte [] qualifier, final byte [] value,<a name="line.747"></a>
+<span class="sourceLineNo">748</span>      final Put put)<a name="line.748"></a>
+<span class="sourceLineNo">749</span>  throws IOException {<a name="line.749"></a>
+<span class="sourceLineNo">750</span>    ClientServiceCallable&lt;Boolean&gt; callable = new ClientServiceCallable&lt;Boolean&gt;(this.connection, getName(), row,<a name="line.750"></a>
+<span class="sourceLineNo">751</span>        this.rpcControllerFactory.newController()) {<a name="line.751"></a>
+<span class="sourceLineNo">752</span>      @Override<a name="line.752"></a>
+<span class="sourceLineNo">753</span>      protected Boolean rpcCall() throws Exception {<a name="line.753"></a>
+<span class="sourceLineNo">754</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.754"></a>
+<span class="sourceLineNo">755</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.755"></a>
+<span class="sourceLineNo">756</span>          new BinaryComparator(value), CompareType.EQUAL, put);<a name="line.756"></a>
+<span class="sourceLineNo">757</span>        MutateResponse response = doMutate(request);<a name="line.757"></a>
+<span class="sourceLineNo">758</span>        return Boolean.valueOf(response.getProcessed());<a name="line.758"></a>
+<span class="sourceLineNo">759</span>      }<a name="line.759"></a>
+<span class="sourceLineNo">760</span>    };<a name="line.760"></a>
+<span class="sourceLineNo">761</span>    return rpcCallerFactory.&lt;Boolean&gt; newCaller(this.writeRpcTimeout).<a name="line.761"></a>
+<span class="sourceLineNo">762</span>        callWithRetries(callable, this.operationTimeout);<a name="line.762"></a>
+<span class="sourceLineNo">763</span>  }<a name="line.763"></a>
+<span class="sourceLineNo">764</span><a name="line.764"></a>
+<span class="sourceLineNo">765</span>  /**<a name="line.765"></a>
+<span class="sourceLineNo">766</span>   * {@inheritDoc}<a name="line.766"></a>
+<span class="sourceLineNo">767</span>   */<a name="line.767"></a>
+<span class="sourceLineNo">768</span>  @Override<a name="line.768"></a>
+<span class="sourceLineNo">769</span>  public boolean checkAndPut(final byte [] row, final byte [] family,<a name="line.769"></a>
+<span class="sourceLineNo">770</span>      final byte [] qualifier, final CompareOp compareOp, final byte [] value,<a name="line.770"></a>
+<span class="sourceLineNo">771</span>      final Put put)<a name="line.771"></a>
+<span class="sourceLineNo">772</span>  throws IOException {<a name="line.772"></a>
+<span class="sourceLineNo">773</span>    ClientServiceCallable&lt;Boolean&gt; callable =<a name="line.773"></a>
+<span class="sourceLineNo">774</span>        new ClientServiceCallable&lt;Boolean&gt;(this.connection, getName(), row,<a name="line.774"></a>
+<span class="sourceLineNo">775</span>            this.rpcControllerFactory.newController()) {<a name="line.775"></a>
+<span class="sourceLineNo">776</span>      @Override<a name="line.776"></a>
+<span class="sourceLineNo">777</span>      protected Boolean rpcCall() throws Exception {<a name="line.777"></a>
+<span class="sourceLineNo">778</span>        CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.778"></a>
+<span class="sourceLineNo">779</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.779"></a>
+<span class="sourceLineNo">780</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.780"></a>
+<span class="sourceLineNo">781</span>          new BinaryComparator(value), compareType, put);<a name="line.781"></a>
+<span class="sourceLineNo">782</span>        MutateResponse response = doMutate(request);<a name="line.782"></a>
+<span class="sourceLineNo">783</span>        return Boolean.valueOf(response.getProcessed());<a name="line.783"></a>
+<span class="sourceLineNo">784</span>      }<a name="line.784"></a>
+<span class="sourceLineNo">785</span>    };<a name="line.785"></a>
+<span class="sourceLineNo">786</span>    return rpcCallerFactory.&lt;Boolean&gt; newCaller(this.writeRpcTimeout).<a name="line.786"></a>
+<span class="sourceLineNo">787</span>        callWithRetries(callable, this.operationTimeout);<a name="line.787"></a>
+<span class="sourceLineNo">788</span>  }<a name="line.788"></a>
+<span class="sourceLineNo">789</span><a name="line.789"></a>
+<span class="sourceLineNo">790</span>  /**<a name="line.790"></a>
+<span class="sourceLineNo">791</span>   * {@inheritDoc}<a name="line.791"></a>
+<span class="sourceLineNo">792</span>   */<a name="line.792"></a>
+<span class="sourceLineNo">793</span>  @Override<a name="line.793"></a>
+<span class="sourceLineNo">794</span>  public boolean checkAndDelete(final byte [] row, final byte [] family, final byte [] qualifier,<a name="line.794"></a>
+<span class="sourceLineNo">795</span>      final byte [] value, final Delete delete) throws IOException {<a name="line.795"></a>
+<span class="sourceLineNo">796</span>    return checkAndDelete(row, family, qualifier, CompareOp.EQUAL, value, delete);<a name="line.796"></a>
+<span class="sourceLineNo">797</span>  }<a name="line.797"></a>
+<span class="sourceLineNo">798</span><a name="line.798"></a>
+<span class="sourceLineNo">799</span>  /**<a name="line.799"></a>
+<span class="sourceLineNo">800</span>   * {@inheritDoc}<a name="line.800"></a>
+<span class="sourceLineNo">801</span>   */<a name="line.801"></a>
+<span class="sourceLineNo">802</span>  @Override<a name="line.802"></a>
+<span class="sourceLineNo">803</span>  public boolean checkAndDelete(final byte [] row, final byte [] family,<a name="line.803"></a>
+<span class="sourceLineNo">804</span>      final byte [] qualifier, final CompareOp compareOp, final byte [] value,<a name="line.804"></a>
+<span class="sourceLineNo">805</span>      final Delete delete)<a name="line.805"></a>
+<span class="sourceLineNo">806</span>  throws IOException {<a name="line.806"></a>
+<span class="sourceLineNo">807</span>    CancellableRegionServerCallable&lt;SingleResponse&gt; callable =<a name="line.807"></a>
+<span class="sourceLineNo">808</span>        new CancellableRegionServerCallable&lt;SingleResponse&gt;(<a name="line.808"></a>
+<span class="sourceLineNo">809</span>            this.connection, getName(), row, this.rpcControllerFactory.newController(),<a name="line.809"></a>
+<span class="sourceLineNo">810</span>            writeRpcTimeout, new RetryingTimeTracker().start()) {<a name="line.810"></a>
+<span class="sourceLineNo">811</span>      @Override<a name="line.811"></a>
+<span class="sourceLineNo">812</span>      protected SingleResponse rpcCall() throws Exception {<a name="line.812"></a>
+<span class="sourceLineNo">813</span>        CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.813"></a>
+<span class="sourceLineNo">814</span>        MutateRequest request = RequestConverter.buildMutateRequest(<a name="line.814"></a>
+<span class="sourceLineNo">815</span>          getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.815"></a>
+<span class="sourceLineNo">816</span>          new BinaryComparator(value), compareType, delete);<a name="line.816"></a>
+<span class="sourceLineNo">817</span>        MutateResponse response = doMutate(request);<a name="line.817"></a>
+<span class="sourceLineNo">818</span>        return ResponseConverter.getResult(request, response, getRpcControllerCellScanner());<a name="line.818"></a>
+<span class="sourceLineNo">819</span>      }<a name="line.819"></a>
+<span class="sourceLineNo">820</span>    };<a name="line.820"></a>
+<span class="sourceLineNo">821</span>    List&lt;Delete&gt; rows = Collections.singletonList(delete);<a name="line.821"></a>
+<span class="sourceLineNo">822</span>    Object[] results = new Object[1];<a name="line.822"></a>
+<span class="sourceLineNo">823</span>    AsyncProcessTask task = AsyncProcessTask.newBuilder()<a name="line.823"></a>
+<span class="sourceLineNo">824</span>            .setPool(pool)<a name="line.824"></a>
+<span class="sourceLineNo">825</span>            .setTableName(tableName)<a name="line.825"></a>
+<span class="sourceLineNo">826</span>            .setRowAccess(rows)<a name="line.826"></a>
+<span class="sourceLineNo">827</span>            .setCallable(callable)<a name="line.827"></a>
+<span class="sourceLineNo">828</span>            // TODO any better timeout?<a name="line.828"></a>
+<span class="sourceLineNo">829</span>            .setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))<a name="line.829"></a>
+<span class="sourceLineNo">830</span>            .setOperationTimeout(operationTimeout)<a name="line.830"></a>
+<span class="sourceLineNo">831</span>            .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)<a name="line.831"></a>
+<span class="sourceLineNo">832</span>            .setResults(results)<a name="line.832"></a>
+<span class="sourceLineNo">833</span>            .build();<a name="line.833"></a>
+<span class="sourceLineNo">834</span>    AsyncRequestFuture ars = multiAp.submit(task);<a name="line.834"></a>
+<span class="sourceLineNo">835</span>    ars.waitUntilDone();<a name="line.835"></a>
+<span class="sourceLineNo">836</span>    if (ars.hasError()) {<a name="line.836"></a>
+<span class="sourceLineNo">837</span>      throw ars.getErrors();<a name="line.837"></a>
+<span class="sourceLineNo">838</span>    }<a name="line.838"></a>
+<span class="sourceLineNo">839</span>    return ((SingleResponse.Entry)results[0]).isProcessed();<a name="line.839"></a>
+<span class="sourceLineNo">840</span>  }<a name="line.840"></a>
+<span class="sourceLineNo">841</span><a name="line.841"></a>
+<span class="sourceLineNo">842</span>  /**<a name="line.842"></a>
+<span class="sourceLineNo">843</span>   * {@inheritDoc}<a name="line.843"></a>
+<span class="sourceLineNo">844</span>   */<a name="line.844"></a>
+<span class="sourceLineNo">845</span>  @Override<a name="line.845"></a>
+<span class="sourceLineNo">846</span>  public boolean checkAndMutate(final byte [] row, final byte [] family, final byte [] qualifier,<a name="line.846"></a>
+<span class="sourceLineNo">847</span>    final CompareOp compareOp, final byte [] value, final RowMutations rm)<a name="line.847"></a>
+<span class="sourceLineNo">848</span>    throws IOException {<a name="line.848"></a>
+<span class="sourceLineNo">849</span>    CancellableRegionServerCallable&lt;MultiResponse&gt; callable =<a name="line.849"></a>
+<span class="sourceLineNo">850</span>      new CancellableRegionServerCallable&lt;MultiResponse&gt;(connection, getName(), rm.getRow(),<a name="line.850"></a>
+<span class="sourceLineNo">851</span>        rpcControllerFactory.newController(), writeRpcTimeout, new RetryingTimeTracker().start()) {<a name="line.851"></a>
+<span class="sourceLineNo">852</span>        @Override<a name="line.852"></a>
+<span class="sourceLineNo">853</span>        protected MultiResponse rpcCall() throws Exception {<a name="line.853"></a>
+<span class="sourceLineNo">854</span>          CompareType compareType = CompareType.valueOf(compareOp.name());<a name="line.854"></a>
+<span class="sourceLineNo">855</span>          MultiRequest request = RequestConverter.buildMutateRequest(<a name="line.855"></a>
+<span class="sourceLineNo">856</span>            getLocation().getRegionInfo().getRegionName(), row, family, qualifier,<a name="line.856"></a>
+<span class="sourceLineNo">857</span>            new BinaryComparator(value), compareType, rm);<a name="line.857"></a>
+<span class="sourceLineNo">858</span>          ClientProtos.MultiResponse response = doMulti(request);<a name="line.858"></a>
+<span class="sourceLineNo">859</span>          ClientProtos.RegionActionResult res = response.getRegionActionResultList().get(0);<a name="line.859"></a>
+<span class="sourceLineNo">860</span>          if (res.hasException()) {<a name="line.860"></a>
+<span class="sourceLineNo">861</span>            Throwable ex = ProtobufUtil.toException(res.getException());<a name="line.861"></a>
+<span class="sourceLineNo">862</span>            if (ex instanceof IOException) {<a name="line.862"></a>
+<span class="sourceLineNo">863</span>              throw (IOException)ex;<a name="line.863"></a>
+<span class="sourceLineNo">864</span>            }<a name="line.864"></a>
+<span class="sourceLineNo">865</span>            throw new IOException("Failed to checkAndMutate row: "+<a name="line.865"></a>
+<span class="sourceLineNo">866</span>              Bytes.toStringBinary(rm.getRow()), ex);<a name="line.866"></a>
+<span class="sourceLineNo">867</span>          }<a name="line.867"></a>
+<span class="sourceLineNo">868</span>          return ResponseConverter.getResults(request, response, getRpcControllerCellScanner());<a name="line.868"></a>
+<span class="sourceLineNo">869</span>        }<a name="line.869"></a>
+<span class="sourceLineNo">870</span>      };<a name="line.870"></a>
+<span class="sourceLineNo">871</span><a name="line.871"></a>
+<span class="sourceLineNo">872</span>    /**<a name="line.872"></a>
+<span class="sourceLineNo">873</span>     *  Currently, we use one array to store 'processed' flag which is returned by server.<a name="line.873"></a>
+<span class="sourceLineNo">874</span>     *  It is excessive to send such a large array, but that is required by the framework right now<a name="line.874"></a>
+<span class="sourceLineNo">875</span>     * */<a name="line.875"></a>
+<span class="sourceLineNo">876</span>    Object[] results = new Object[rm.getMutations().size()];<a name="line.876"></a>
+<span class="sourceLineNo">877</span>    AsyncProcessTask task = AsyncProcessTask.newBuilder()<a name="line.877"></a>
+<span class="sourceLineNo">878</span>            .setPool(pool)<a name="line.878"></a>
+<span class="sourceLineNo">879</span>            .setTableName(tableName)<a name="line.879"></a>
+<span class="sourceLineNo">880</span>            .setRowAccess(rm.getMutations())<a name="line.880"></a>
+<span class="sourceLineNo">881</span>            .setResults(results)<a name="line.881"></a>
+<span class="sourceLineNo">882</span>            .setCallable(callable)<a name="line.882"></a>
+<span class="sourceLineNo">883</span>            // TODO any better timeout?<a name="line.883"></a>
+<span class="sourceLineNo">884</span>            .setRpcTimeout(Math.max(readRpcTimeout, writeRpcTimeout))<a name="line.884"></a>
+<span class="sourceLineNo">885</span>            .setOperationTimeout(operationTimeout)<a name="line.885"></a>
+<span class="sourceLineNo">886</span>            .setSubmittedRows(AsyncProcessTask.SubmittedRows.ALL)<a name="line.886"></a>
+<span class="sourceLineNo">887</span>            .build();<a name="line.887"></a>
+<span class="sourceLineNo">888</span>    AsyncRequestFuture ars = multiAp.submit(task);<a name="line.888"></a>
+<span class="sourceLineNo">889</span>    ars.waitUntilDone();<a name="line.889"></a>
+<span class="sourceLineNo">890</span>    if (ars.hasError()) {<a name="line.890"></a>
+<span class="sourceLineNo">891</span>      throw ars.getErrors();<a name="line.891"></a>
+<span class="sourceLineNo">892</span>    }<a name="line.892"></a>
+<span class="sourceLineNo">893</span><a name="line.893"></a>
+<span class="sourceLineNo">894</span>    return ((Result)results[0]).getExists();<a name="line.894"></a>
+<span class="sourceLineNo">895</span>  }<a name="line.895"></a>
+<span class="sourceLineNo">896</span><a name="line.896"></a>
+<span class="sourceLineNo">897</span>  /**<a name="line.897"></a>
+<span class="sourceLineNo">898</span>   * {@inheritDoc}<a name="line.898"></a>
+<span class="sourceLineNo">899</span>   */<a name="line.899"></a>
+<span class="sourceLineNo">900</span>  @Override<a name="line.900"></a>
+<span class="sourceLineNo">901</span>  public boolean exists(final Get get) throws IOException {<a name="line.901"></a>
+<span class="sourceLineNo">902</span>    Result r = get(get, true);<a name="line.902"></a>
+<span class="sourceLineNo">903</span>    assert r.getExists() != null;<a name="line.903"></a>
+<span class="sourceLineNo">904</span>    return r.getExists();<a name="line.904"></a>
+<span class="sourceLineNo">905</span>  }<a name="line.905"></a>
+<span class="sourceLineNo">906</span><a name="line.906"></a>
+<span class="sourceLineNo">907</span>  /**<a name="line.907"></a>
+<span class="sourceLineNo">908</span>   * {@inheritDoc}<a name="line.908"></a>
+<span class="sourceLineNo">909</span>   */<a name="line.909"></a>
+<span class="sourceLineNo">910</span>  @Override<a name="line.910"></a>
+<span class="sourceLineNo">911</span>  public boolean[] existsAll(final List&lt;Get&gt; gets) throws IOException {<a name="line.911"></a>
+<span class="sourceLineNo">912</span>    if (gets.isEmpty()) return new boolean[]{};<a name="line.912"></a>
+<span class="sourceLineNo">913</span>    if (gets.size() == 1) return new boolean[]{exists(gets.get(0))};<a name="line.913"></a>
+<span class="sourceLineNo">914</span><a name="line.914"></a>
+<span class="sourceLineNo">915</span>    ArrayList&lt;Get&gt; exists = new ArrayList&lt;&gt;(gets.size());<a name="line.915"></a>
+<span class="sourceLineNo">916</span>    for (Get g: gets){<a name="line.916"></a>
+<span class="sourceLineNo">917</span>      Get ge = new Get(g);<a name="line.917"></a>
+<span class="sourceLineNo">918</span>      ge.setCheckExistenceOnly(true);<a name="line.918"></a>
+<span class="sourceLineNo">919</span>      exists.add(ge);<a name="line.919"></a>
+<span class="sourceLineNo">920</span>    }<a name="line.920"></a>
+<span class="sourceLineNo">921</span><a name="line.921"></a>
+<span class="sourceLineNo">922</span>    Object[] r1= new Object[exists.size()];<a name="line.922"></a>
+<span class="sourceLineNo">923</span>    try {<a name="line.923"></a>
+<span class="sourceLineNo">924</span>      batch(exists, r1, readRpcTimeout);<a name="line.924"></a>
+<span class="sourceLineNo">925</span>    } catch (InterruptedException e) {<a name="line.925"></a>
+<span class="sourceLineNo">926</span>      throw (InterruptedIOException)new InterruptedIOException().initCause(e);<a name="line.926"></a>
+<span class="sourceLineNo">927</span>    }<a name="line.927"></a>
+<span class="sourceLineNo">928</span><a name="line.928"></a>
+<span class="sourceLineNo">929</span>    // translate.<a name="line.929"></a>
+<span class="sourceLineNo">930</span>    boolean[] results = new boolean[r1.length];<a name="line.930"></a>
+<span class="sourceLineNo">931</span>    int i = 0;<a name="line.931"></a>
+<span class="sourceLineNo">932</span>    for (Object o : r1) {<a name="line.932"></a>
+<span class="sourceLineNo">933</span>      // batch ensures if there is a failure we get an exception instead<a name="line.933"></a>
+<span class="sourceLineNo">934</span>      results[i++] = ((Result)o).getExists();<a name="line.934"></a>
+<span class="sourceLineNo">935</span>    }<a name="line.935"></a>
+<span class="sourceLineNo">936</span><a name="line.936"></a>
+<span class="sourceLineNo">937</span>    return results;<a name="line.937"></a>
+<span class="sourceLineNo">938</span>  }<a name="line.938"></a>
+<span class="sourceLineNo">939</span><a name="line.939"></a>
+<span class="sourceLineNo">940</span>  /**<a name="line.940"></a>
+<span class="sourceLineNo">941</span>   * @throws IOException<a name="line.941"></a>
+<span class="sourceLineNo">942</span>   */<a name="line.942"></a>
+<span class="sourceLineNo">943</span>  void flushCommits() throws IOException {<a name="line.943"></a>
+<span class="sourceLineNo">944</span>    if (mutator == null) {<a name="line.944"></a>
+<span class="sourceLineNo">945</span>      // nothing to flush if there's no mutator; don't bother creating one.<a name="line.945"></a>
+<span class="sourceLineNo">946</span>      return;<a name="line.946"></a>
+<span class="sourceLineNo">947</span>    }<a name="line.947"></a>
+<span class="sourceLineNo">948</span>    getBufferedMutator().flush();<a name="line.948"></a>
+<span class="sourceLineNo">949</span>  }<a name="line.949"></a>
+<span class="sourceLineNo">950</span><a name="line.950"></a>
+<span class="sourceLineNo">951</span>  /**<a name="line.951"></a>
+<span class="sourceLineNo">952</span>   * Process a mixed batch of Get, Put and Delete actions. All actions for a<a name="line.952"></a>
+<span class="sourceLineNo">953</span>   * RegionServer are forwarded in one RPC call. Queries are executed in parallel.<a name="line.953"></a>
+<span class="sourceLineNo">954</span>   *<a name="line.954"></a>
+<span class="sourceLineNo">955</span>   * @param list The collection of actions.<a name="line.955"></a>
+<span class="sourceLineNo">956</span>   * @param results An empty array, same size as list. If an exception is thrown,<a name="line.956"></a>
+<span class="sourceLineNo">957</span>   *   you can test here for partial results, and to determine which actions<a name="line.957"></a>
+<span class="sourceLineNo">958</span>   *   processed successfully.<a name="line.958"></a>
+<span class="sourceLineNo">959</span>   * @throws IOException if there are problems talking to META. Per-item<a name="line.959"></a>
+<span class="sourceLineNo">960</span>   *   exceptions are stored in the results array.<a name="line.960"></a>
+<span class="sourceLineNo">961</span>   */<a name="line.961"></a>
+<span class="sourceLineNo">962</span>  public &lt;R&gt; void processBatchCallback(<a name="line.962"></a>
+<span class="sourceLineNo">963</span>    final List&lt;? extends Row&gt; list, final Object[] results, final Batch.Callback&lt;R&gt; callback)<a name="line.963"></a>
+<span class="sourceLineNo">964</span>    throws IOException, InterruptedException {<a name="line.964"></a>
+<span class="sourceLineNo">965</span>    this.batchCallback(list, results, callback);<a name="line.965"></a>
+<span class="sourceLineNo">966</span>  }<a name="line.966"></a>
+<span class="sourceLineNo">967</span><a name="line.967"></a>
+<span class="sourceLineNo">968</span>  @Override<a name="line.968"></a>
+<span class="sourceLineNo">969</span>  public void close() throws IOException {<a name="line.969"></a>
+<span class="sourceLineNo">970</span>    if (this.closed) {<a name="line.970"></a>
+<span class="sourceLineNo">971</span>      return;<a name="line.971"></a>
+<span class="sourceLineNo">972</span>    }<a name="line.972"></a>
+<span class="sourceLineNo">973</span>    flushCommits();<a name="line.973"></a>
+<span class="sourceLineNo">974</span>    if (mutator != null) {<a name="line.974"></a>
+<span class="sourceLineNo">975</span>      mutator.close();<a name="line.975"></a>
+<span class="sourceLineNo">976</span>      mutator = null;<a name="line.976"></a>
+<span class="sourceLineNo">977</span>    }<a name="line.977"></a>
+<span class="sourceLineNo">978</span>    if (cleanupPoolOnClose) {<a name="line.978"></a>
+<span class="sourceLineNo">979</span>      this.pool.shutdown();<a name="line.979"></a>
+<span class="sourceLineNo">980</span>      try {<a name="line.980"></a>
+<span class="sourceLineNo">981</span>        boolean terminated = false;<a name="line.981"></a>
+<span class="sourceLineNo">982</span>        do {<a name="line.982"></a>
+<span class="sourceLineNo">983</span>          // wait until the pool has terminated<a name="line.983"></a>
+<span class="sourceLineNo">984</span>          terminated = this.pool.awaitTermination(60, TimeUnit.SECONDS);<a name="line.984"></a>
+<span class="sourceLineNo">985</span>        } while (!terminated);<a name="line.985"></a>
+<span class="sourceLineNo">986</span>      } catch (InterruptedException e) {<a name="line.986"></a>
+<span class="sourceLineNo">987</span>        this.pool.shutdownNow();<a name="line.987"></a>
+<span class="sourceLineNo">988</span>        LOG.warn("waitForTermination interrupted");<a name="line.988"></a>
+<span class="sourceLineNo">989</span>      }<a name="line.989"></a>
+<span class="sourceLineNo">990</span>    }<a name="line.990"></a>
+<span class="sourceLineNo">991</span>    this.closed = true;<a name="line.991"></a>
+<span class="sourceLineNo">992</span>  }<a name="line.992"></a>
+<span class="sourceLineNo">993</span><a name="line.993"></a>
+<span class="sourceLineNo">994</span>  // validate for well-formedness<a name="line.994"></a>
+<span class="sourceLineNo">995</span>  public void validatePut(final Put put) throws IllegalArgumentException {<a name="line.995"></a>
+<span class="sourceLineNo">996</span>    validatePut(put, connConfiguration.getMaxKeyValueSize());<a name="line.996"></a>
+<span class="sourceLineNo">997</span>  }<a name="line.997"></a>
+<span class="sourceLineNo">998</span><a name="line.998"></a>
+<span class="sourceLineNo">999</span>  // validate for well-formedness<a name="line.999"></a>
+<span class="sourceLineNo">1000</span>  public static void validatePut(Put put, int maxKeyValueSize) throws IllegalArgumentException {<a name="line.1000"></a>
+<span class="sourceLineNo">1001</span>    if (put.isEmpty()) {<a name="line.1001"></a>
+<span class="sourceLineNo">1002</span>      throw new IllegalArgumentException("No columns to insert");<a name="line.1002"></a>
+<span class="sourceLineNo">1003</span>    }<a name="line.1003"></a>
+<span class="sourceLineNo">1004</span>    if (maxKeyValueSize &gt; 0) {<a name="line.1004"></a>
+<span class="sourceLineNo">1005</span>      for (List&lt;Cell&gt; list : put.getFamilyCellMap().values()) {<a name="line.1005"></a>
+<span class="sourceLineNo">1006</span>        for (Cell cell : list) {<a name="line.1006"></a>
+<span class="sourceLineNo">1007</span>          if (KeyValueUtil.length(cell) &gt; maxKeyValueSize) {<a name="line.1007"></a>
+<span class="sourceLineNo">1008</span>            throw new IllegalArgumentException("KeyValue size too large");<a name="line.1008"></a>
+<span class="sourceLineNo">1009</span>          }<a name="line.1009"></a>
+<span class="sourceLineNo">1010</span>        

<TRUNCATED>

Mime
View raw message