accumulo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Keith Turner (JIRA)" <j...@apache.org>
Subject [jira] [Created] (ACCUMULO-735) Add hooks to shell for transforming scan range
Date Wed, 22 Aug 2012 15:23:42 GMT
Keith Turner created ACCUMULO-735:
-------------------------------------

             Summary: Add hooks to shell for transforming scan range
                 Key: ACCUMULO-735
                 URL: https://issues.apache.org/jira/browse/ACCUMULO-735
             Project: Accumulo
          Issue Type: New Feature
            Reporter: Keith Turner
            Assignee: Keith Turner
             Fix For: 1.5.0


Hooks in the shell that can manipulate the range and columns passed to a scan range would
be nice.   

My use case for this wanting to undo what a formatter did.  For example, suppose I use the
new HexFormatter to view a table that has binary data like the following.

Below, I scan my table w/o the hex formatter. And its hard to read.

{noformat}
root@test15 graph> scan
\x06\x07)d\x7F\x08\xA1\x00\x08\x01\x02\xEFd@\xC3\xD2S\xC8 edge:count []    1
\x06\x07)d\x7F\x08\xA1\x00\x08\x08\x1C\xCE>\x8Ed\xE7\xDA edge:count []    1
\x06\x07)d\x7F\x08\xA1\x00\x08\x0A\xC7\xCED\xA54\xC0, edge:count []    1
\x06\x07)d\x7F\x08\xA1\x00\x08\x0C\x04\\Nz\x12}\x92 edge:count []    1
\x06\x07)d\x7F\x08\xA1\x00\x08\x0E\x95\x80\x1A\xA6\xEE\xEF, edge:count []    1
\x06\x07)d\x7F\x08\xA1\x00\x08\x0E\xCDBHYeP\xE0 edge:count []    1

{noformat}


So I add the HexFormatter and scan again, now its easier to read.

{noformat}
root@test15 graph> formatter -t graph -f org.apache.accumulo.core.util.format.HexFormatter
       
root@test15 graph> scan
0607-2964-7f08-a100-0801-02ef-6440-c3d2-53c8  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-0808-1cce-3e8e-64e7-da  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-080a-c7ce-44a5-34c0-2c  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-080c-045c-4e7a-127d-92  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-080e-9580-1aa6-eeef-2c  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-080e-cd42-4859-6550-e0  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-0816-ccf8-3526-daf4-27  6564-6765  636f-756e-74 [] 31
0607-2964-7f08-a100-0817-b645-dcf2-b73b-65  6564-6765  636f-756e-74 [] 31
{noformat}

However, if I want to scan a range of the table I have to use the \xXX convention which is
cumbersome.  I would like to do the following : 

{noformat}
scan -b 0607-2964-7f08-a100 -e 0607-2964-7f08-a101
{noformat}  

To do this I propose adding the following hook to the shell. A user could configure a scan
interpreter on the shell like they configure a formatter.   The scan interpreter would take
the command line arguments and translate or interpret them.   For example, a HexScanInterpeter
could take in 0607-2964-7f08-a100 and output the binary representation for that hex string.

{code:java}
public interface ScanInterpreter {
  
  public Text interpretRow(Text row);

  public Text interpretBeginRow(Text row);
  
  public Text interpretEndRow(Text row);
  
  public Text interpretColumnFamily(Text cf);
  
  public Text interpretColumnQualifier(Text cq);
}
{code}

Originally I was thinking of adding the methods above to the Formatter interface.  However
Christopher Tubbs convinced me to create a separate interface.  His argument was that you
may want to use something like the HexScanInterpreter with different Formatters.  Inorder
to make configuration easier we discussed adding a '-i' option to the shell formatter command.
 This option would configure a Formatter that also implements the ScanInterpreter interface,
saving the user from entering two commands.

--
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

        

Mime
View raw message