You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "Sean Busbey (JIRA)" <ji...@apache.org> on 2014/03/25 08:38:43 UTC

[jira] [Comment Edited] (ACCUMULO-2544) Incorrect boundry matching for MockTableOperations.deleteRows

    [ https://issues.apache.org/jira/browse/ACCUMULO-2544?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13946122#comment-13946122 ] 

Sean Busbey edited comment on ACCUMULO-2544 at 3/25/14 7:38 AM:
----------------------------------------------------------------

Mike Drob,

Can you please add the following contributor row once the patch is accepted:

<tr><td>faganm</td><td>Mike Fagan</td><td><a href="http://www.arcus-research.com">Arcus Research</a></td><td>MT (<a href="http://www.timeanddate.com/library/abbreviations/timezones/na/mst.html">-7</a> / <a href="http://www.timeanddate.com/library/abbreviations/timezones/na/mdt.html">-6</a>)</td></tr>


was (Author: faganm):
Mike Drop,

Can you please add the following contributor row once the patch is accepted:

<tr><td>faganm</td><td>Mike Fagan</td><td><a href="http://www.arcus-research.com">Arcus Research</a></td><td>MT (<a href="http://www.timeanddate.com/library/abbreviations/timezones/na/mst.html">-7</a> / <a href="http://www.timeanddate.com/library/abbreviations/timezones/na/mdt.html">-6</a>)</td></tr>

> 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.6.1
>         Environment: Mac OS Mavericks; java 7
>            Reporter: Mike Fagan
>            Assignee: Mike Fagan
>              Labels: mock, newbie, patch
>             Fix For: 1.6.0
>
>         Attachments: ACCUMULO-2544.patch, ACCUMULO-2544.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<Key, Value> entry : scan) {
>       cnt++;
>     }
>     scan.close();
>     return cnt;
>   }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)