hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiang Li (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-16183) Correct errors in example program of coprocessor in Ref Guide
Date Tue, 12 Jul 2016 06:48:10 GMT

    [ https://issues.apache.org/jira/browse/HBASE-16183?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15372276#comment-15372276
] 

Xiang Li commented on HBASE-16183:
----------------------------------

Hi [~jerryhe], [~carp84], would you please review the patch v1 at your most convenience?
The only divergence could be that I proposed the following code could be all removed when
overriding preGetOp() in class RegionObserverExample in section 90.1
{code}
List kvs = new ArrayList(results.size());
for (Cell c : results) {
  kvs.add(KeyValueUtil.ensureKeyValue(c));
}
preGet(e, get, kvs);
results.clear();
results.addAll(kvs);
{code}
to make it as
{code}
@Override
public void preGetOp(final ObserverContext<RegionCoprocessorEnvironment> e, final Get
get, final List<Cell> results)
throws IOException {

  if (Bytes.equals(get.getRow(),ADMIN)) {
    Cell c = CellUtil.createCell(get.getRow(),COLUMN _FAMILY, COLUMN,
    System.currentTimeMillis(), (byte)4, VALUE);
    results.add(c);
    e.bypass();
  }
}
{code}

> Correct errors in example program of coprocessor in Ref Guide
> -------------------------------------------------------------
>
>                 Key: HBASE-16183
>                 URL: https://issues.apache.org/jira/browse/HBASE-16183
>             Project: HBase
>          Issue Type: Bug
>          Components: documentation
>            Reporter: Xiang Li
>            Assignee: Xiang Li
>            Priority: Minor
>         Attachments: HBASE-16183-master-v1.patch, HBASE-16183.patch
>
>
> There are some errors in the example programs for coprocessor in Ref Guide. Such as using
deprecated APIs, generic...



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

Mime
View raw message