hbase-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jasper Rädisch <jas...@trakken.de>
Subject Re: HBase Shell iterating over & truncating tables
Date Wed, 07 Nov 2012 08:17:17 GMT
2012/11/6 Jeremy Carroll <phobos182@gmail.com>:
> the list() method does not return anything (returns nil). The method
> outputs to stdout. You cannot iterate over 'nil'. What are you attempting
> to accomplish via the shell? There is most likely an easier way.

I would like to iterate over all the table names and then truncate
those that are ending with a certain string (e.g. 'abc123'), so what I
am searching for is some kind of (Enumerable) object containing all
the table names.

> hbase(main):028:0> list.public_methods
> => ["|", "to_s", "to_f", "type", "to_a", "nil?", "^", "&", "inspect",
> "to_i", "handle_different_imports", "include_class", "java_kind_of?",
> "java_signature", "methods", "freeze", "extend", "==", "object_id",
> "method", "tainted?", "is_a?", "instance_variable_get",
> "instance_variable_defined?", "instance_variable_set", "hash", "display",
> "send", "private_methods", "enum_for", "equal?", "com", "to_java",
> "instance_of?", "id", "taint", "class", "java_annotation",
> "instance_variables", "org", "__send__", "=~", "protected_methods",
> "__id__", "java_implements", "tap", "frozen?", "java", "respond_to?",
> "instance_eval", "===", "java_package", "untaint", "clone", "java_name",
> "to_enum", "singleton_methods", "eql?", "instance_exec", "dup", "kind_of?",
> "java_require", "javax", "public_methods"]
>
> hbase(main):028:0> puts list.inspect
> nil
>
>
> On Tue, Nov 6, 2012 at 8:01 AM, Jasper Rädisch <jasper@trakken.de> wrote:
>
>> Hello everyone,
>>
>> Trying to truncate tables like this (from HBase shell) won't work:
>>
>> list.each{|name| truncate(name) if name.end_with?('abc123')}
>>
>> How would one approach this?
>>
>> Thanks,
>>
>> Jasper
>>
>> P.S.: I have also asked this at Stack Overflow here:
>>
>> http://stackoverflow.com/questions/13253643/hbase-shell-iterating-over-truncating-tables
>>



-- 
Jasper Rädisch
Developer at Trakken Technologies GmbH

Mime
View raw message