[
https://issues.apache.org/jira/browse/HBASE-15061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075688#comment-15075688
]
Anoop Sam John commented on HBASE-15061:
----------------------------------------
{code}
Build a list of StoreFileScanners form a list of store files and a given read
point.
90 *
91 * Extended this to handle new scanner creation options. By default,
caching is false,
92 * pread is used, the read is not in compaction mode, dropBehind is
disabled,
93 * is assumed to be the primary replica, and a null scan query
matcher is being used.
{code}
It would have been better that at creator places, we call methods to set them
like withCache(true/false). I mean not having assumption of default value.
Again for a reader, to go here at the builder javadoc to know what is default.
So set them explicitly at create places even if it is default value? Being a
reader that gives better idea for me :-)
> 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, readPt)
> + .withCacheBlocks(cacheMobBlocks).build();
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)