Modify  TachyonWorker Heartbeat sleeping to ScheduledExecutorService 

TachyonWorker's heartbeat thread is sleeping several milliseconds . 
JDK API ScheduledExecutorService's scheduleAtFixedRate method running a task after initial delay and subsequently with the given period. It's more fit for the heartbeat task .
And a TODO : split heartbeat thread into another class.
thanks 
More like recursion than loop
On Oct 6, 2014 9:24 AM, "David Capwell" <dcapwell@gmail.com> wrote:

> You can always submit the same task to the executor with a different
> delay.  This is the same effect as sleeping but doesn't rely on thread
> sleep
> On Oct 6, 2014 9:22 AM, "yaphet" <notifications@github.com> wrote:
>
>> In core/src/main/java/tachyon/worker/TachyonWorker.java:
>>
>> >    }
>> >
>> >    /**
>> >     * Start the data server thread and heartbeat thread of this TachyonWorker.
>> >     */
>> >    public void start() {
>> > -    mHeartbeatThread.start();
>> > +    mHeartbeatService.scheduleWithFixedDelay(this, 0, WorkerConf.get().TO_MASTER_HEARTBEAT_INTERVAL_MS,
>>
>> sleep several ms for send a heartbeat message maybe work fine but seems
>> not a good idea . while-true loop will do a lot work which could be avoid.
>> using scheduled service could running task after specified ms . I think
>> it's same with sleeping base interval and scheduled service .
>>
>> —
>> Reply to this email directly or view it on GitHub
>> <https://github.com/amplab/tachyon/pull/448/files#r18466963>.
>>
>