hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "stack (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HADOOP-1375) a simple parser for hbase.
Date Tue, 29 May 2007 19:21:15 GMT

    [ https://issues.apache.org/jira/browse/HADOOP-1375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12499896

stack commented on HADOOP-1375:

JLine looks like its a dead project with outstanding issues unaddressed by the project maintainer.
 But it does seem to do the basic arrow-key navigations and have an amenable license so +1
on using it for line reading (I wrote the project owner to see if I get a response.).  We
can make a separate issue to add support for plugging in line readers other than JLine such
as the java ReadLine or bsh JConsole. 

Here are some issues w/ the latest patch:

I like the addition of ColumnFamiliies listing to the 'TABLES' output.  Perhaps add versions?

You've lost the banner you used to print out on instantiation of the shell (i.e. "Copyright
Udanax.... licensed to ASF... type 'help;' for usage", etc).  Can you put it back?

I typed in a lonely 'one' on shell setup and it exited with the below exception.  Entering
a command that is missing all of its required arguments will exit the shell with an ugly exception:
e.g. {{create table;}}.  Also, entering an empty line -- i.e. a carriage-return without any
text -- exits the shell.  Can you catch the exceptions and the empty-line printing an appropriate
message and not exit the shell?

durruti $ ./src/contrib/hbase/bin/hbase org.apache.hadoop.hbase.shell.HBaseShell
HBase > one
Exception in thread "main" org.apache.hadoop.hbase.shell.parser.ParseException: Encountered
"<EOF>" at line 1, column 3.
Was expecting one of:
    ";" ...
    <ID> ...
        at org.apache.hadoop.hbase.shell.parser.Parser.generateParseException(Parser.java:495)
        at org.apache.hadoop.hbase.shell.parser.Parser.jj_consume_token(Parser.java:431)
        at org.apache.hadoop.hbase.shell.parser.Parser.errMsg(Parser.java:282)
        at org.apache.hadoop.hbase.shell.parser.Parser.parse(Parser.java:134)
        at org.apache.hadoop.hbase.shell.HBaseShell.main(HBaseShell.java:41)

I'd suggest you not include JLine classes in your patch.  Rather, lets start a lib directory
in hbase and put the JLine jar therein. There follows a patch to the hbase build.xml to include
the lib dir at hbase compile time (if you run your HBaseShell using the hbase command as in
{{./src/contrib/hbase/bin/hbase org.apache.hadoop.hbase.shell.HBaseShell}} then the hbase
lib content will be on the CLASSPATH.  You will also need to change the import on your HBaseShell.

Index: src/contrib/hbase/build.xml
--- src/contrib/hbase/build.xml (revision 541804)
+++ src/contrib/hbase/build.xml (working copy)
@@ -8,6 +8,23 @@
   <import file="../build-contrib.xml"/>
+  <!-- Override compile target to add in local lib directory
+       Bulk of below copied from ../build-contrib.xml
+  -->
+  <target name="compile" depends="init">
+    <echo message="contrib: ${name}"/>
+    <javac
+     encoding="${build.encoding}"
+     srcdir="${src.dir}"
+     includes="**/*.java"
+     destdir="${build.classes}"
+     debug="${javac.debug}"
+     deprecation="${javac.deprecation}">
+      <classpath refid="classpath"/>
+      <classpath path="path"/>
+    </javac>
+  </target>
   <!-- Override jar target to specify main class -->

You do not say if you intend to address the item noted in the comment above in ??25/May/07
11:09 AM?? comment starting at {{Would it be hard to add 'startRow' and 'endRow'...}}

Finally, before commit, we'll have to remove the javacc generated classes and add a javacc
target to the hbase ant build file like the one in top-level hadoop build.xml  -- perhaps
I can help with this?

Good stuff Edward.

> a simple parser for hbase.
> --------------------------
>                 Key: HADOOP-1375
>                 URL: https://issues.apache.org/jira/browse/HADOOP-1375
>             Project: Hadoop
>          Issue Type: Improvement
>          Components: contrib/hbase
>         Environment: All environments 
>            Reporter: udanax
>            Priority: Minor
>         Attachments: patch.txt, patch.txt, patch.txt, patch.txt, patch.txt, patch.txt,
patch.txt, patch.txt, patch.txt
> this is a simple parser for hbase test.
> i just write it.
> you can use this syntax to create and set.
> {code}
> [# root@localhost] ./bin/hadoop jar ./build/hadoop-hbase org.apache.hadoop.hbase.parser.HbaseShell
> Hbase > help;
> blah blah...
> Hbase > create webtable 
>      --> columnfamilies('anchors', 'language') limit=3;
> Hbase > set webtable values('anchors:http://www.udanax.org/','opensource') where row="http://www.hadoop.co.kr";
> Hbase > scan webtable where row="http://www.hadoop.co.kr";
> blah blah...
> Hbase > set webtable values('language:kr','euc-kr') where row="http://www.hadoop.co.kr";
> Hbase > scan webtable where row="http://www.hadoop.co.kr" and column="language:kr";
> blah blah...
> Hbase > exit
> [# root@localhost] 
> {code}

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message