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

ASF GitHub Bot updated HBASE-29004:
-----------------------------------
    Labels: pull-request-available  (was: )

> Optimize unnecessary type castings in Scan and Get setter methods
> -----------------------------------------------------------------
>
>                 Key: HBASE-29004
>                 URL: https://issues.apache.org/jira/browse/HBASE-29004
>             Project: HBase
>          Issue Type: Improvement
>          Components: Performance
>            Reporter: Chandra Sekhar K
>            Assignee: Chandra Sekhar K
>            Priority: Major
>              Labels: pull-request-available
>
> In the setter methods of Scan and Get, we invoke the super class method, type 
> cast and return the object.
> {code:java}
> public Scan setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) 
> {
> return (Scan) super.setColumnFamilyTimeRange(cf, minStamp, maxStamp);
> }{code}
>  
> In profiler reports it's observed that this typecasting does take some 
> additional cpu cycles. we can optimize this  by adding an explicit return 
> statement with current object. 
> {code:java}
> public Scan setColumnFamilyTimeRange(byte[] cf, long minStamp, long maxStamp) 
> {
> super.setColumnFamilyTimeRange(cf, minStamp, maxStamp);
> return this;
> }{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to