[ https://issues.apache.org/jira/browse/HBASE-20710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16521367#comment-16521367 ]
stack commented on HBASE-20710: ------------------------------- Pushed a checkstyle addendum to branch-2.0+ commit 959d9c16f305fbed0298e6da4fab43f4c1a5e478 (HEAD -> m, origin/master, origin/HEAD) Author: Michael Stack <st...@apache.org> Date: Sat Jun 23 20:41:47 2018 -0700 HBASE-20710 extra cloneFamily() in Mutation.add(Cell); ADDENDUM checkstyle diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java index 3d935011dd..dc8199df72 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java @@ -115,10 +115,10 @@ public abstract class Mutation extends OperationWithAttributes implements Row, C super(clone); this.row = clone.getRow(); this.ts = clone.getTimestamp(); - this.familyMap = clone.getFamilyCellMap().entrySet().stream() - .collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()), (k, v) -> { - throw new RuntimeException("collisions!!!"); - }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR))); + this.familyMap = clone.getFamilyCellMap().entrySet().stream(). + collect(Collectors.toMap(e -> e.getKey(), e -> new ArrayList<>(e.getValue()), (k, v) -> { + throw new RuntimeException("collisions!!!"); + }, () -> new TreeMap<>(Bytes.BYTES_COMPARATOR))); } > extra cloneFamily() in Mutation.add(Cell) > ----------------------------------------- > > Key: HBASE-20710 > URL: https://issues.apache.org/jira/browse/HBASE-20710 > Project: HBase > Issue Type: Sub-task > Components: regionserver > Affects Versions: 2.0.1 > Reporter: huaxiang sun > Assignee: huaxiang sun > Priority: Minor > Fix For: 3.0.0, 2.1.0, 2.0.2 > > Attachments: 2.0621.2.12782.alloc.svg, 2.0623.111354.alloc.svg, > HBASE-20710-master-v001.patch, HBASE-20710-master-v002.patch, > HBASE-20710-master-v002.patch, HBASE-20710.master.001.patch, > alloc-put-fix.svg, alloc-put-orig.svg > > > The cpu profiling shows that during PE randomWrite testing, about 1 percent > of time is spent in cloneFamily. Reviewing code found that when a cell is DBB > backed ByteBuffKeyValueCell (which is default with Netty Rpc), > cell.getFamilyArray() will call cloneFamily() and there is again a > cloneFamily() in the following line of the code. since this is the critical > write path processing, this needs to be optimized. > https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java#L791 > https://github.com/apache/hbase/blob/master/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Mutation.java#L795 -- This message was sent by Atlassian JIRA (v7.6.3#76005)