hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anoop Sam John (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (HBASE-11919) Remove the deprecated pre/postGet CP hook
Date Tue, 09 Sep 2014 07:16:28 GMT

     [ https://issues.apache.org/jira/browse/HBASE-11919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Anoop Sam John updated HBASE-11919:
-----------------------------------
    Description: 
These hooks, dealing with List<KeyValue>, were deprecated since 0.96. We have 0.98,
one more major version after that. Suggest this can be removed from 0.99 time.

The impl in BaseRegionObserver is as below which can be very inefficient especially when we
read from a DBE files. There we return not KeyValue but a new Cell impl (here by avoiding
the need to copy value bytes) The KeyValueUtil.ensureKeyValue can kill this nice optimization
if we come across this.
{code}
public void preGetOp(final ObserverContext<RegionCoprocessorEnvironment> e,
      final Get get, final List<Cell> results) throws IOException {
    // By default we are executing the deprecated preGet to support legacy RegionObservers
    // We may use the results coming in and we may return the results going out.
    List<KeyValue> kvs = new ArrayList<KeyValue>(results.size());
    for (Cell c : results) {
      kvs.add(KeyValueUtil.ensureKeyValue(c));
    }
    preGet(e, get, kvs);
    results.clear();
    results.addAll(kvs);
  }
{code}


  was:
These were deprecated from 0.96. We have 0.98 one more major version after that. Suggest this
can be removed from 0.99 time.

The impl in BaseRegionObserver is as below which can be very inefficient especially when we
read from a DBE files. There we return not KeyValue but a new Cell impl (here by avoiding
the need to copy value bytes) The KeyValueUtil.ensureKeyValue can kill this nice optimization
if we come across this.
{code}
public void preGetOp(final ObserverContext<RegionCoprocessorEnvironment> e,
      final Get get, final List<Cell> results) throws IOException {
    // By default we are executing the deprecated preGet to support legacy RegionObservers
    // We may use the results coming in and we may return the results going out.
    List<KeyValue> kvs = new ArrayList<KeyValue>(results.size());
    for (Cell c : results) {
      kvs.add(KeyValueUtil.ensureKeyValue(c));
    }
    preGet(e, get, kvs);
    results.clear();
    results.addAll(kvs);
  }
{code}



> Remove the deprecated pre/postGet CP hook
> -----------------------------------------
>
>                 Key: HBASE-11919
>                 URL: https://issues.apache.org/jira/browse/HBASE-11919
>             Project: HBase
>          Issue Type: Sub-task
>          Components: regionserver
>            Reporter: Anoop Sam John
>            Assignee: Anoop Sam John
>             Fix For: 0.99.0, 2.0.0
>
>
> These hooks, dealing with List<KeyValue>, were deprecated since 0.96. We have 0.98,
one more major version after that. Suggest this can be removed from 0.99 time.
> The impl in BaseRegionObserver is as below which can be very inefficient especially when
we read from a DBE files. There we return not KeyValue but a new Cell impl (here by avoiding
the need to copy value bytes) The KeyValueUtil.ensureKeyValue can kill this nice optimization
if we come across this.
> {code}
> public void preGetOp(final ObserverContext<RegionCoprocessorEnvironment> e,
>       final Get get, final List<Cell> results) throws IOException {
>     // By default we are executing the deprecated preGet to support legacy RegionObservers
>     // We may use the results coming in and we may return the results going out.
>     List<KeyValue> kvs = new ArrayList<KeyValue>(results.size());
>     for (Cell c : results) {
>       kvs.add(KeyValueUtil.ensureKeyValue(c));
>     }
>     preGet(e, get, kvs);
>     results.clear();
>     results.addAll(kvs);
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message