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 CC295177D3 for ; Tue, 19 May 2015 22:35:00 +0000 (UTC) Received: (qmail 320 invoked by uid 500); 19 May 2015 22:35:00 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 279 invoked by uid 500); 19 May 2015 22:35:00 -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 263 invoked by uid 99); 19 May 2015 22:35:00 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 May 2015 22:35:00 +0000 Date: Tue, 19 May 2015 22:35:00 +0000 (UTC) From: "Stephen Yuan Jiang (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-13711) Provide an API to set min and max versions in HColumnDescriptor 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-13711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Stephen Yuan Jiang updated HBASE-13711: --------------------------------------- Attachment: HBASE-13711.v1-branch-1.1.patch > Provide an API to set min and max versions in HColumnDescriptor > --------------------------------------------------------------- > > Key: HBASE-13711 > URL: https://issues.apache.org/jira/browse/HBASE-13711 > Project: HBase > Issue Type: Bug > Affects Versions: 2.0.0, 1.1.0, 1.2.0 > Reporter: Stephen Yuan Jiang > Assignee: Stephen Yuan Jiang > Priority: Minor > Fix For: 2.0.0, 0.98.14, 1.2.0 > > Attachments: HBASE-13711-v2.patch, HBASE-13711.patch, HBASE-13711.v1-branch-1.1.patch > > > In org.apache.hadoop.hbase.chaos.actions.ChangeVersionsAction#perform(), it tries to update the max and min versions in a column descriptor: > {code} > for(HColumnDescriptor descriptor:columnDescriptors) { > descriptor.setMaxVersions(versions); > descriptor.setMinVersions(versions); > } > {code} > If the current minimum version is greater than the new max version, an IllegalArgumentException would throw from org.apache.hadoop.hbase.HColumnDescriptor#setMaxVersions(). > Here is an example (trying to set max version to 1 while currently min version is 2): > {noformat} > java.lang.IllegalArgumentException: Set MaxVersion to 1 while minVersion is 2. Maximum versions must be >= minimum versions > at org.apache.hadoop.hbase.HColumnDescriptor.setMaxVersions(HColumnDescriptor.java:634) > at org.apache.hadoop.hbase.chaos.actions.ChangeVersionsAction.perform(ChangeVersionsAction.java:62) > {noformat} > One solution is to change the order of set - set min version first and then set max version (note: the current implement of org.apache.hadoop.hbase.HColumnDescriptor#setMinVersions() does not check the min version value and blindly set the version. Not sure whether this is by-design). > Another solution is to provide an API to set both min and max version in one function call. -- This message was sent by Atlassian JIRA (v6.3.4#6332)