You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by Sergey Belousov <se...@gmail.com> on 2015/04/11 02:18:36 UTC

HBase shell (JRuby) access to internal classes for schema management

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!

Re: HBase shell (JRuby) access to internal classes for schema management

Posted by Sergey Belousov <se...@gmail.com>.
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 <es...@cloudera.com>
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 <
> sergey.belousov@gmail.com>
> 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!
> >
>

Re: HBase shell (JRuby) access to internal classes for schema management

Posted by Esteban Gutierrez <es...@cloudera.com>.
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 <se...@gmail.com>
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!
>