[
https://issues.apache.org/jira/browse/HBASE-17393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15793021#comment-15793021
]
huaxiang sun edited comment on HBASE-17393 at 1/2/17 5:37 PM:
--------------------------------------------------------------
Hi [~ram_krish], I think this is not the right equation as it excludes the
possibility that tr.getMax() can be > getMax(). I think the right equation is
return getMin() < tr.getMax() && getMax() > tr.getMin(). Like the following
diagrams
{code}
1)
A ---------o
B ----------o
2)
A ---------o
B ----------o
{code}
To tell if there is overlap between Line A and B, we need to see B.Max is at
the right side A's left side (B.max > A.min), If B's left side is beyond A's
right side (like 2), then there is no overlap so need to add A.max > B.min, it
cannot be A.max >= B.min as A.max is not included.
was (Author: huaxiang):
Hi [~ram_krish], I think this is not the right equation as it excludes the
possibility that tr.getMax() can be > getMax(). I think the right equation is
return getMin() < tr.getMax() && getMax() > tr.getMin(). Like the following
diagrams
1)
A ---------o
B ----------o
2)
A ---------o
B ----------o
To tell if there is overlap between Line A and B, we need to see B.Max is at
the right side A's left side (B.max > A.min), If B's left side is beyond A's
right side (like 2), then there is no overlap so need to add A.max > B.min, it
cannot be A.max >= B.min as A.max is not included.
> Logic in TimeRange#includesTimeRange is incorrect
> -------------------------------------------------
>
> Key: HBASE-17393
> URL: https://issues.apache.org/jira/browse/HBASE-17393
> Project: HBase
> Issue Type: Bug
> Components: regionserver
> Reporter: huaxiang sun
> Assignee: huaxiang sun
> Priority: Minor
>
> In the code,
> https://github.com/apache/hbase/blob/master/hbase-common/src/main/java/org/apache/hadoop/hbase/io/TimeRange.java#L181
>
> return getMin() < tr.getMax() && getMax() >= tr.getMin();
> Given that TimeRange is defined as [minStamp,maxStamp),
> Assume that TimeRange(4, 5). includesTimeRange(TimeRange(5,6)).
> So it will be (4 < 6) && (5 >=5), the result is true.
> Same for TimeRangeTracker#includesTimeRange
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)