bq. ruby script will run on same machine ( I have only one node cluster ) ,so there wont be any network calls
I don't think the above is true: ruby script would still need to contact zookeeper to find the location of -ROOT-. There is no short circuit read for ruby script. Normal RPC is used to communicate with region server. Approach #2 is possible but you need to escape the row keys properly. Cheers On Thu, Oct 16, 2014 at 1:54 AM, Vimal Jain <[email protected]> wrote: > There will be around 2 million rows in test1. > Any specific reason for approach #1 being more efficient ? > I thought approach #-2 being efficient as the ruby script will run on same > machine ( I have only one node cluster ) ,so there wont be any network > calls whereas in approach # 1 , i was planning to write java code and > deploy it on different machine so this will involve network calls. > Even if i choose approach # 1 , is there a possibility of doing this via > Jruby script , i mean is it even possible ? > > On Thu, Oct 16, 2014 at 1:57 PM, Ted Yu <[email protected]> wrote: > > > How many rows are there in test1 table ? > > > > Please consider approach #1 for efficiency. > > > > Cheers > > > > On Oct 15, 2014, at 10:24 PM, Vimal Jain <[email protected]> wrote: > > > > > Hi, > > > I have a hbase table( say test1) with 3 cfs ( a,b,c) and i have bunch > of > > > cqs in each of these cf. > > > I also have one more table ( say test2) with some cfs on same cluster. > > > My requirement is to move data from test1 to test2 through my custom > > logic > > > ( as in which cf:cq from test1 will go to which cf:cq in test2). > > > I thought there are ways 2 achieve this. > > > > > > 1) Writing some Java client code to perform "get" on test1 and perform > > > "put" on test2. > > > 2) Through writing a Jruby script and executing it on hbase shell. > > > > > > I preferred the 2nd way and started writing the script. > > > i wrote something like this > > > > > > for ( all rowkeys in test1) > > > do > > > somevariable = get 'test1' , '1' ,'a:abc' > > > put 'test2' ,'1','a:abc',somevariable > > > done > > > > > > > > > But its not working(Sometimes syntax error , sometimes empty value is > put > > > into test2 ) .I am new to Jruby scripting , so please redirect me to > any > > > tutorial/blog which can help me achieve this. > > > > > > I am using hbase 0.94.17. > > > > > > -- > > > Thanks and Regards, > > > Vimal Jain > > > > > > -- > Thanks and Regards, > Vimal Jain >
