hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Hsieh (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-15061) Refactor StoreFileScanner creation to builder pattern
Date Mon, 04 Jan 2016 19:00:40 GMT

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

Jonathan Hsieh commented on HBASE-15061:

[~anoopsamjohn], so what you are saying is that you want  withCacheEnabled(false) in before
every build/create invocation?  Do you want fields as well?  How do we decide get called out
and which can fall back to defaults?

For read point , read point could have a default of HConstants.LATEST_TIMESTAMP. Since it
putting different values changed the results,  it made sense to me to have it  required. 
 For all the others they always had the same settings except for 1 or 2 exceptions.

I'm basically ' -0' for the idea -- if we want to always set a value in every case. then the
field should be in the constructor and required.   If it is optional, and it is setting the
same as the default  Before we had to look up the method anyway to map the values with the
parameter and this way we have to look up for the defaults only which are set to be "safe"

> Refactor StoreFileScanner creation to builder pattern
> -----------------------------------------------------
>                 Key: HBASE-15061
>                 URL: https://issues.apache.org/jira/browse/HBASE-15061
>             Project: HBase
>          Issue Type: Improvement
>    Affects Versions: 2.0.0
>            Reporter: Jonathan Hsieh
>            Assignee: Jonathan Hsieh
>             Fix For: 2.0.0
>         Attachments: hbase-15061.patch, hbase-15061.v2.patch
> There are several falvors of  calls that creates a list of StoreFileScanners, and new
feature have been added to this recently.  This patch converts the somewhat difficult to read
(need to go to javadoc) call:
> {code}
> // which args are the most relevant to this?
> -      List<StoreFileScanner> sfScanners = StoreFileScanner.getScannersForStoreFiles(sfs,
> -        cacheMobBlocks, true, false, false, readPt);
> {code}
> into one that is more literate:
> {code}
> // ah, very clearly we are using defaults except for the caching settings
> +      List<StoreFileScanner> sfScanners = new StoreFileScanner.ListBuilder(sfs,
> +          .withCacheBlocks(cacheMobBlocks).build();
> {code}

This message was sent by Atlassian JIRA

View raw message