You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hbase.apache.org by Stuti Awasthi <st...@hcl.com> on 2011/09/15 08:08:03 UTC

Issues in Scheduling CopyTable from java.

Hi Friends,
I wanted to write a scheduler which will take backup of Hbase tables by timestamp using CopyTable utility. I created a thread which will get timestamp range required and call CopyTable.main(arg). Then I keep this thread on sleep for 10 mins. I wanted this to be executed after every 10 mins but actually after calling CopyTable first time, it executed MR job and then exit. The process is not going back to the calling thread and wait for 10 mins and then again execute CopyTable.

Code Structure :

Run()
{
While(true){
Get starttimestamp()
Get endtimestamp()
CopyTable.main(arg)
Thread.sleep(10*60*1000)

}

}

Please help me in running this as daemon process which will execute in every 10 mins.

Thanks & Regards


________________________________
::DISCLAIMER::
-----------------------------------------------------------------------------------------------------------------------

The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
received this email in error please delete it and notify the sender immediately. Before opening any mail and
attachments please check them for viruses and defect.

-----------------------------------------------------------------------------------------------------------------------

Re: Issues in Scheduling CopyTable from java.

Posted by Joey Echeverria <jo...@cloudera.com>.
I wouldn't bother with a daemon process. It's more to monitor. I'd
recommend cron or oozie if you want to change the host the code runs
on.

-Joey

On Fri, Sep 16, 2011 at 1:30 AM, Stuti Awasthi <st...@hcl.com> wrote:
> Hi Jean,
>
> I can cron it but I wanted to do something similar as we run other Hadoop daemons as Namenode, datanode etc. Wondering if we can get this working programmatically.
> Any suggestions
>
> Thanks
> -----Original Message-----
> From: jdcryans@gmail.com [mailto:jdcryans@gmail.com] On Behalf Of Jean-Daniel Cryans
> Sent: Friday, September 16, 2011 4:27 AM
> To: user@hbase.apache.org
> Subject: Re: Issues in Scheduling CopyTable from java.
>
> Why not just cron it?
>
> J-D
>
> On Wed, Sep 14, 2011 at 11:08 PM, Stuti Awasthi <st...@hcl.com> wrote:
>> Hi Friends,
>> I wanted to write a scheduler which will take backup of Hbase tables by timestamp using CopyTable utility. I created a thread which will get timestamp range required and call CopyTable.main(arg). Then I keep this thread on sleep for 10 mins. I wanted this to be executed after every 10 mins but actually after calling CopyTable first time, it executed MR job and then exit. The process is not going back to the calling thread and wait for 10 mins and then again execute CopyTable.
>>
>> Code Structure :
>>
>> Run()
>> {
>> While(true){
>> Get starttimestamp()
>> Get endtimestamp()
>> CopyTable.main(arg)
>> Thread.sleep(10*60*1000)
>>
>> }
>>
>> }
>>
>> Please help me in running this as daemon process which will execute in every 10 mins.
>>
>> Thanks & Regards
>>
>>
>> ________________________________
>> ::DISCLAIMER::
>> ----------------------------------------------------------------------
>> -------------------------------------------------
>>
>> The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
>> It shall not attach any liability on the originator or HCL or its
>> affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
>> Any form of reproduction, dissemination, copying, disclosure,
>> modification, distribution and / or publication of this message
>> without the prior written consent of the author of this e-mail is
>> strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.
>>
>> ----------------------------------------------------------------------
>> -------------------------------------------------
>>
>



-- 
Joseph Echeverria
Cloudera, Inc.
443.305.9434

RE: Issues in Scheduling CopyTable from java.

Posted by Stuti Awasthi <st...@hcl.com>.
Hi Jean,

I can cron it but I wanted to do something similar as we run other Hadoop daemons as Namenode, datanode etc. Wondering if we can get this working programmatically.
Any suggestions

Thanks
-----Original Message-----
From: jdcryans@gmail.com [mailto:jdcryans@gmail.com] On Behalf Of Jean-Daniel Cryans
Sent: Friday, September 16, 2011 4:27 AM
To: user@hbase.apache.org
Subject: Re: Issues in Scheduling CopyTable from java.

Why not just cron it?

J-D

On Wed, Sep 14, 2011 at 11:08 PM, Stuti Awasthi <st...@hcl.com> wrote:
> Hi Friends,
> I wanted to write a scheduler which will take backup of Hbase tables by timestamp using CopyTable utility. I created a thread which will get timestamp range required and call CopyTable.main(arg). Then I keep this thread on sleep for 10 mins. I wanted this to be executed after every 10 mins but actually after calling CopyTable first time, it executed MR job and then exit. The process is not going back to the calling thread and wait for 10 mins and then again execute CopyTable.
>
> Code Structure :
>
> Run()
> {
> While(true){
> Get starttimestamp()
> Get endtimestamp()
> CopyTable.main(arg)
> Thread.sleep(10*60*1000)
>
> }
>
> }
>
> Please help me in running this as daemon process which will execute in every 10 mins.
>
> Thanks & Regards
>
>
> ________________________________
> ::DISCLAIMER::
> ----------------------------------------------------------------------
> -------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its 
> affiliates. Any views or opinions presented in this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure, 
> modification, distribution and / or publication of this message 
> without the prior written consent of the author of this e-mail is 
> strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any mail and attachments please check them for viruses and defect.
>
> ----------------------------------------------------------------------
> -------------------------------------------------
>

Re: Issues in Scheduling CopyTable from java.

Posted by Jean-Daniel Cryans <jd...@apache.org>.
Why not just cron it?

J-D

On Wed, Sep 14, 2011 at 11:08 PM, Stuti Awasthi <st...@hcl.com> wrote:
> Hi Friends,
> I wanted to write a scheduler which will take backup of Hbase tables by timestamp using CopyTable utility. I created a thread which will get timestamp range required and call CopyTable.main(arg). Then I keep this thread on sleep for 10 mins. I wanted this to be executed after every 10 mins but actually after calling CopyTable first time, it executed MR job and then exit. The process is not going back to the calling thread and wait for 10 mins and then again execute CopyTable.
>
> Code Structure :
>
> Run()
> {
> While(true){
> Get starttimestamp()
> Get endtimestamp()
> CopyTable.main(arg)
> Thread.sleep(10*60*1000)
>
> }
>
> }
>
> Please help me in running this as daemon process which will execute in every 10 mins.
>
> Thanks & Regards
>
>
> ________________________________
> ::DISCLAIMER::
> -----------------------------------------------------------------------------------------------------------------------
>
> The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only.
> It shall not attach any liability on the originator or HCL or its affiliates. Any views or opinions presented in
> this email are solely those of the author and may not necessarily reflect the opinions of HCL or its affiliates.
> Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of
> this message without the prior written consent of the author of this e-mail is strictly prohibited. If you have
> received this email in error please delete it and notify the sender immediately. Before opening any mail and
> attachments please check them for viruses and defect.
>
> -----------------------------------------------------------------------------------------------------------------------
>