Thank you Esteban for reply
I tried to do @hbase.hbase_admin but I could not call any methods from
HBaseAdmin,
for example when I do
hbase(main):001:0> @shell.hbase_admin
I got
=> #<Hbase::Admin:0x43fda8d9
@conf=#<Java::OrgApacheHadoopConf::Configuration:0x7318daf8>,
@formatter=#<Shell::Formatter::Console:0x600f5704 @out=Kernel,
@max_width=236, @row_count=0>,
@admin=#<Java::OrgApacheHadoopHbaseClient::HBaseAdmin:0x2503ec73>>
but
@shell.hbase_admin.listTables
NoMethodError: undefined method `listTables' for #<Hbase::Admin:0x79b2852b>
or
@shell.hbase_admin.getTableRegions('t')
NoMethodError: undefined method `getTableRegions' for
#<Hbase::Admin:0x79b2852b>
shell is more or interactive tool from what I see but as I mentioned I want
to use it in a scripts for our schema updates
starting with checking for table exist. than need to check regions and
create new base on some conditions etc...
How I can get to full admin/table class in the shell without duplicating
all code in my scripts? I am very new to JRuby and I looks like I just
missing something here...
thank you,
S
On Sun, Apr 12, 2015 at 11:32 PM, Esteban Gutierrez <[email protected]>
wrote:
> Hello Sergey,
>
> Yes, its totally doable. However, it would be great if you could let us
> know any feature that you consider missing from the hbase shell that would
> be nice to have. Or you just can open a HBASE JIRA[1] for further
> discussion.
>
> Thanks,
> Esteban.
>
> [1] http://issues.apache.org/jira/browse/HBASE
>
>
> --
> Cloudera, Inc.
>
>
> On Fri, Apr 10, 2015 at 5:18 PM, Sergey Belousov <
> [email protected]>
> wrote:
>
> > Hi All
> >
> > We having our DDL scripts for HBase in JRuby an run the using HBase
> shell.
> >
> > Considering that HBase shell is nothing else but JRuby interpreter and
> you
> > can do all you can in JRuby there (or may be almost all) I am wondering
> if
> > I can access internal clases like Admin from shell so I will rely on code
> > in HBase shell to do my DDL scripts and do do all that in DDL scripts.
> >
> >
> > Thank you!
> >
>