Return-Path: X-Original-To: apmail-accumulo-notifications-archive@minotaur.apache.org Delivered-To: apmail-accumulo-notifications-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 200AB10944 for ; Thu, 27 Mar 2014 17:00:00 +0000 (UTC) Received: (qmail 99405 invoked by uid 500); 27 Mar 2014 16:59:52 -0000 Delivered-To: apmail-accumulo-notifications-archive@accumulo.apache.org Received: (qmail 99189 invoked by uid 500); 27 Mar 2014 16:59:43 -0000 Mailing-List: contact notifications-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: jira@apache.org Delivered-To: mailing list notifications@accumulo.apache.org Received: (qmail 98923 invoked by uid 99); 27 Mar 2014 16:59:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Mar 2014 16:59:33 +0000 Date: Thu, 27 Mar 2014 16:59:33 +0000 (UTC) From: "ASF subversion and git services (JIRA)" To: notifications@accumulo.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ACCUMULO-2544) Incorrect boundry matching for MockTableOperations.deleteRows 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/ACCUMULO-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13949589#comment-13949589 ] ASF subversion and git services commented on ACCUMULO-2544: ----------------------------------------------------------- Commit 7ec60f1bcac4c274653d2779f1996138f3a275b7 in accumulo's branch refs/heads/master from [~mikebfagan] [ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=7ec60f1 ] ACCUMULO-2544: Fix match boundaries for MockTableOperations.deleteRows to be consistent with actual accumulo instance Signed-off-by: Sean Busbey > Incorrect boundry matching for MockTableOperations.deleteRows > ------------------------------------------------------------- > > Key: ACCUMULO-2544 > URL: https://issues.apache.org/jira/browse/ACCUMULO-2544 > Project: Accumulo > Issue Type: Bug > Components: test > Affects Versions: 1.5.0, 1.5.1 > Environment: Mac OS Mavericks; java 7 > Reporter: Mike Fagan > Assignee: Mike Fagan > Labels: mock, newbie > Fix For: 1.5.2, 1.6.0 > > Attachments: ACCUMULO-2544.patch, ACCUMULO-2544.patch, ACCUMULO-2544_1.5.2.patch, ACCUMULO-2544_v2.patch > > > The api for deleteRows specifies: Delete rows between (start, end] but the current implementation for MockTableOperations.deleteRows is implemented as (start, end) > Here is the failing test case > {code:java} > public class TestDelete { > private static final String INSTANCE = "mock"; > private static final String TABLE = "foo"; > private static final String USER = "user"; > private static final String PASS = "password"; > private static final Authorizations AUTHS = new Authorizations(); > @Test > public void testDelete() throws TableNotFoundException, AccumuloException, > AccumuloSecurityException, TableExistsException { > MockInstance mockAcc = new MockInstance(INSTANCE); > Connector conn = mockAcc.getConnector(USER, new PasswordToken(PASS)); > conn.tableOperations().create(TABLE); > conn.securityOperations().grantTablePermission(USER, TABLE, TablePermission.READ); > conn.securityOperations().grantTablePermission(USER, TABLE, TablePermission.WRITE); > Mutation mut = new Mutation("2"); > mut.put("colfam", "colqual", "value"); > BatchWriter writer = conn.createBatchWriter(TABLE, new BatchWriterConfig()); > writer.addMutation(mut); > Scanner scan = conn.createScanner(TABLE, AUTHS); > scan.setRange(new Range("2", "2")); > assertEquals(1, countRecords(scan)); > > // this should delete (1,2] > conn.tableOperations().deleteRows(TABLE, new Text("1"), new Text("2")); > scan = conn.createScanner(TABLE, AUTHS); > scan.setRange(new Range("2", "2")); > > // this will fail if row 2 exists > assertEquals(0, countRecords(scan)); > } > private int countRecords(Scanner scan) { > int cnt = 0; > for (Entry entry : scan) { > cnt++; > } > scan.close(); > return cnt; > } > } > {code} -- This message was sent by Atlassian JIRA (v6.2#6252)