hbase-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HBASE-11503) Inconsistency in CP between HRegion#batchMutate() and MultiRowMutation()
Date Fri, 11 Jul 2014 07:16:05 GMT
Anoop Sam John created HBASE-11503:
--------------------------------------

             Summary: Inconsistency in CP between HRegion#batchMutate() and MultiRowMutation()
                 Key: HBASE-11503
                 URL: https://issues.apache.org/jira/browse/HBASE-11503
             Project: HBase
          Issue Type: Bug
          Components: Coprocessors, regionserver
            Reporter: Anoop Sam John
            Assignee: Anoop Sam John


>From users perspective both are almost same except in MultiRowMutation all Mutations are
applied in one transaction. So the call and behavior of CPs during both of these execution
should be consistent.  Now after HBASE-11423, all hooks are getting called.
But in case of HRegion#batchMutate() when a prePut/Delete() call for one Mutation do a bypass,
the actual Mutation we are not applying but will continue with other Mutations. But in case
of MultiRowMutation, when prePut/Delete() call for one Mutation do a bypass, we just stop
calling pre hooks for remaining Mutations but will end up applying those Mutations to Region.

{code}
public void preProcess(HRegion region, WALEdit walEdit) throws IOException {
    RegionCoprocessorHost coprocessorHost = region.getCoprocessorHost();
    if (coprocessorHost != null) {
      for (Mutation m : mutations) {
        if (m instanceof Put) {
          if (coprocessorHost.prePut((Put) m, walEdit, m.getDurability())) {
            // by pass everything
            return;
          }
        } else if (m instanceof Delete) {
          Delete d = (Delete) m;
          region.prepareDelete(d);
          if (coprocessorHost.preDelete(d, walEdit, d.getDurability())) {
            // by pass everything
            return;
          }
        }
      }
    }
}
{code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message