You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@accumulo.apache.org by "John Vines (Created) (JIRA)" <ji...@apache.org> on 2012/01/12 16:31:40 UTC

[jira] [Created] (ACCUMULO-309) MockBatchScanner is broken

MockBatchScanner is broken
--------------------------

                 Key: ACCUMULO-309
                 URL: https://issues.apache.org/jira/browse/ACCUMULO-309
             Project: Accumulo
          Issue Type: Bug
    Affects Versions: 1.4.0
            Reporter: John Vines


In my attempt to test a potential fix for ACCUMULO-175, I discovered the following code did not return any results-
{noformat}
public class TestRunningAgainstMock {
  public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException,
      InterruptedException
  {
    MockInstance mi = new MockInstance("test");
    Connector conn = mi.getConnector("root", new byte[0]);
    conn.tableOperations().create("testTable", true);
    Mutation m = new Mutation("row");
    m.put("cf", "cq", "val");
    BatchWriter bw = conn.createBatchWriter("testTable", 500, 500, 1);
    bw.addMutation(m);
    bw.flush();
    bw.close();
    Scanner bs = conn.createBatchScanner("testTable", new Authorizations(), 1);
    Iterator<Entry<Key,Value>> iter = bs.iterator();
    if (!iter.hasNext())
      System.out.println("No values");
    while (iter.hasNext())
      System.out.println(iter.next());
  }
}{noformat}

Switching it to a regular scanner did work though.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (ACCUMULO-309) MockBatchScanner is broken

Posted by "John Vines (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ACCUMULO-309?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Vines resolved ACCUMULO-309.
---------------------------------

    Resolution: Fixed
      Assignee: John Vines

Error was on my end, I never set the range. However, MockBatchScanner should more closely emulate the behavior of TabletServerBatchScanner, so I went ahead and changed it's setup behavior to error the same way the real batchScanner does.
                
> MockBatchScanner is broken
> --------------------------
>
>                 Key: ACCUMULO-309
>                 URL: https://issues.apache.org/jira/browse/ACCUMULO-309
>             Project: Accumulo
>          Issue Type: Bug
>    Affects Versions: 1.4.0
>            Reporter: John Vines
>            Assignee: John Vines
>
> In my attempt to test a potential fix for ACCUMULO-175, I discovered the following code did not return any results-
> {noformat}
> public class TestRunningAgainstMock {
>   public static void main(String[] args) throws AccumuloException, AccumuloSecurityException, TableExistsException, TableNotFoundException,
>       InterruptedException
>   {
>     MockInstance mi = new MockInstance("test");
>     Connector conn = mi.getConnector("root", new byte[0]);
>     conn.tableOperations().create("testTable", true);
>     Mutation m = new Mutation("row");
>     m.put("cf", "cq", "val");
>     BatchWriter bw = conn.createBatchWriter("testTable", 500, 500, 1);
>     bw.addMutation(m);
>     bw.flush();
>     bw.close();
>     Scanner bs = conn.createBatchScanner("testTable", new Authorizations(), 1);
>     Iterator<Entry<Key,Value>> iter = bs.iterator();
>     if (!iter.hasNext())
>       System.out.println("No values");
>     while (iter.hasNext())
>       System.out.println(iter.next());
>   }
> }{noformat}
> Switching it to a regular scanner did work though.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira