hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Reid Chan (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (HBASE-18554) Append#add doesn't check the row of passed cell
Date Sat, 12 Aug 2017 10:52:00 GMT

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

Reid Chan edited comment on HBASE-18554 at 8/12/17 10:51 AM:
-------------------------------------------------------------

Remove {code}@SuppressWarnings("unchecked"){code}
for it's no longer unchecked; add a row check for a passed cell and ignore it if fails the
check;
{code}
if (!Bytes.equals(this.row, CellUtil.cloneRow(cell))) {
      // If not the same row, just ignore it and return.
      return this;
}
{code}
no unit test provided.


was (Author: reidchan):
Remove {code@SuppressWarnings("unchecked")}
for it's no longer unchecked; add a row check for a passed cell and ignore it if fails the
check; no unit test provided.

> Append#add doesn't check the row of passed cell
> -----------------------------------------------
>
>                 Key: HBASE-18554
>                 URL: https://issues.apache.org/jira/browse/HBASE-18554
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Chia-Ping Tsai
>              Labels: beginner
>         Attachments: HBASE-18554.master.001.patch
>
>
> {code}
>   @SuppressWarnings("unchecked")
>   public Append add(final Cell cell) {
>     // Presume it is KeyValue for now.
>     byte [] family = CellUtil.cloneFamily(cell);
>     List<Cell> list = this.familyMap.get(family);
>     if (list == null) {
>       list  = new ArrayList<>(1);
>     }
>     // find where the new entry should be placed in the List
>     list.add(cell);
>     this.familyMap.put(family, list);
>     return this;
>   }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message