OpenTSDB/asynchbase

Should buffering gets be possible?

jasonculverhouse opened this issue · 1 comments

https://github.com/OpenTSDB/asynchbase/blob/master/src/RegionClient.java#L987

It seems like this code prevents the buffering but the comment indicates no buffering on the retry.

Should the conditions be change to?

      && !(rpc instanceof GetRequest && rpc.attempts > 1)
  void sendRpc(HBaseRpc rpc) {
    if (chan != null) {
      // Now {@link GetRequest} is also a {@link BatchableRpc}, we don't want to retry 
      // the get request once it fails.
      if (rpc instanceof BatchableRpc 
          && !(rpc instanceof GetRequest)
          && (server_version >= SERVER_VERSION_092_OR_ABOVE  // Before 0.92,
              || rpc instanceof PutRequest)) {  // we could only batch "put".
        final BatchableRpc edit = (BatchableRpc) rpc;
        if (edit.canBuffer() && hbase_client.getFlushInterval() > 0) {
          bufferEdit(edit);
          return;
        }
        addSingleEditCallbacks(edit);
      } else if (rpc instanceof MultiAction) {

Yeah we'd like to be able to buffer those. Thanks for catching it!