Details
-
Sub-task
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
Description
ted_yu is graciously reviewing the hbase writer related code and has some recommendations. (more to come as review progresses). I will keep track of those in this jira and perhaps spin off other jira(s) depending on the scope of changes.
For FlowRunCoprocessor.java :
- private HRegion region;
Try to declare as Region - the interface. This way, you are to call methods that are stable across future releases.
- private long getCellTimestamp(long timestamp, List<Tag> tags)
{
tags is not used, remove the parameter.
For FlowScanner:
- private final InternalScanner flowRunScanner;
Currently InternalScanner is Private. If you must use it, try surfacing your case to hbase so that it can be marked:
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.COPROC)
@InterfaceStability.Evolving
w.r.t. regionScanner :
{code}
if (internalScanner instanceof RegionScanner)
{ this.regionScanner = (RegionScanner) internalScanner; }I see IllegalStateException being thrown in some methods when regionScanner is null. Better bail out early in the ctor.
public static AggregationOperation getAggregationOperationFromTagsList(
{ return aggOp; {code}
List<Tag> tags) {
for (AggregationOperation aggOp : AggregationOperation.values()) {
for (Tag tag : tags) {
if (tag.getType() == aggOp.getTagType())
The above nested loop can be improved (a lot):
values() returns an array. If you pre-generate a Set (https://docs.oracle.com/javase/7/docs/api/java/util/EnumSet.html) containing all the values, the outer loop can be omitted.
You iterate through tags and see if tag.getType() is in the Set.
Attachments
Issue Links
- relates to
-
HBASE-16048 Tag InternalScanner with LimitedPrivate(HBaseInterfaceAudience.COPROC)
- Resolved