[
https://issues.apache.org/jira/browse/HBASE-3375?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Andrew Purtell updated HBASE-3375:
----------------------------------
Fix Version/s: 0.92.0
Some suggestions that were recently made along these lines:
- Groovy: http://groovy.codehaus.org/
- gshell: https://github.com/sonatype/gshell
I'm not a fan of Groovy, it's quite verbose, but it can do a shell-like syntax
and variables and control flow like JRuby. Todd demonstrated:
{noformat}
import org.codehaus.groovy.tools.shell.*;
class Sum extends CommandSupport {
def Sum(Shell shell) {
super(shell, "sum", "\\sum");
}
def execute(List args) {
def x = 0
for (arg in args) {
x += Integer.valueOf(arg)
}
println("Sum is: " + x);
}
}
register Sum
{noformat}
which can be used as:
{noformat}
groovy:000> sum 1 2 3
Sum is: 6
{noformat}
However it looks like Groovy shell commands can receive only a list of strings.
That may barely be enough but how we represented schemas as a JRuby map was
nice. I believe it is also not possible to mix shell commands with script like
we could with JRuby.
Gshell can do a very basic shell syntax with variables but not any control flow
or conditional expressions. GShell also pulls in some jars that we don't
otherwise bundle now (doxia, gossip, guice, osgi, plexus, sisu) which weigh in
at 1.2M, not that bad. Implementing control flow would require hacking up a
real shell grammar and/or implementing 'if', 'for', 'while' commands, and so
forth. Might as well just build our own for that level of effort.
Looking around I found a couple of bash clones in various state but all GPL.
Perhaps it may be best to stay with an older yet unsupported version of jruby
if it suits our needs adequately. Otherwise I lean toward rolling our own. I
would not necessarily mind doing that.
> Move away from jruby; build our shell elsewise either on another foundation
> or build up our own
> -----------------------------------------------------------------------------------------------
>
> Key: HBASE-3375
> URL: https://issues.apache.org/jira/browse/HBASE-3375
> Project: HBase
> Issue Type: Task
> Components: shell
> Reporter: stack
> Fix For: 0.92.0
>
>
> JRuby has been sullied; its been shipping *GPL jars with a while now. A hack
> up to remove these jars is being done elsewhere (HBASE-3374). This issue is
> about casting our shell anew atop a foundation that is other than JRuby or
> writing a shell of our own from scratch.
> JRuby has gotten us this far. It provides a shell and it also was used
> scripting HBase. It would be nice if we could get scripting and shell in the
> redo.
> Apart from the licensing issue above and that the fix will be reverting our
> JRuby to a version that is no longer supported and that is old, other reasons
> to move off JRuby are that while its nice having ruby to hand when scripting,
> the JRuby complete jar is 10 or more MB in size. Its bloated at least from
> our small shell perspective.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.