Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 02BB2ED69 for ; Fri, 18 Jan 2013 23:14:13 +0000 (UTC) Received: (qmail 86568 invoked by uid 500); 18 Jan 2013 23:14:12 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 86465 invoked by uid 500); 18 Jan 2013 23:14:12 -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 86456 invoked by uid 99); 18 Jan 2013 23:14:12 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jan 2013 23:14:12 +0000 Date: Fri, 18 Jan 2013 23:14:12 +0000 (UTC) From: "stack (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-6907) KeyValue equals and compareTo methods should match MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-6907?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13557730#comment-13557730 ] stack commented on HBASE-6907: ------------------------------ +1 I tried to reason what would happen if we went in the other direction, ignoring mvcc and I could only see issues -- possibly returning older Cells. If it happens we need to compare minus mvcc, lets make a comparator that does that for those cases. I think this more strict equality check is what we want, or at least, lets try it. > KeyValue equals and compareTo methods should match > -------------------------------------------------- > > Key: HBASE-6907 > URL: https://issues.apache.org/jira/browse/HBASE-6907 > Project: HBase > Issue Type: Bug > Components: util > Reporter: Matt Corgan > Assignee: Ted Yu > Fix For: 0.96.0 > > Attachments: 6907-v1.txt, 6907-v2.txt, 6907-v3.txt, 6907-v4.txt, 6907-v5.txt > > > KeyValue.KVComparator includes the memstoreTS when comparing, however the KeyValue.equals() method ignores the memstoreTS. > The Comparator interface has always specified that comparator return 0 when equals would return true and vice versa. Obeying that rule has been sort of optional in the past, but Java 7 introduces a new default collection sorting algorithm called Tim Sort which relies on that behavior. http://bugs.sun.com/view_bug.do?bug_id=6804124 > Possible problem spots: > * there's a Collections.sort(KeyValues) in RedundantKVGenerator.generateTestKeyValues(..) > * TestColumnSeeking compares two collections of KeyValues using the containsAll method. It is intentionally ignoring memstoreTS, so will need an alternative method for comparing the two collections. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira