Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7A95B200BF2 for ; Mon, 2 Jan 2017 21:12:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 79102160B22; Mon, 2 Jan 2017 20:12:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 6D7E6160B16 for ; Mon, 2 Jan 2017 21:12:02 +0100 (CET) Received: (qmail 34406 invoked by uid 500); 2 Jan 2017 20:11:59 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 34383 invoked by uid 99); 2 Jan 2017 20:11:59 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Jan 2017 20:11:59 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 99BCC2C1F56 for ; Mon, 2 Jan 2017 20:11:58 +0000 (UTC) Date: Mon, 2 Jan 2017 20:11:58 +0000 (UTC) From: "huaxiang sun (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-17393) Logic in TimeRange#includesTimeRange is incorrect MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 02 Jan 2017 20:12:12 -0000 [ https://issues.apache.org/jira/browse/HBASE-17393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15793423#comment-15793423 ] huaxiang sun commented on HBASE-17393: -------------------------------------- Reading code bit more, actually it assumes that at the Region Server side, the embedded TimeRange is [min, max]. [min, max) is only for the client side. Given this assumption, the logic TimeRange#includesTimeRange is correct, though this makes code reading hard. > 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)