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 
http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/ScheduledExecutorService.html#schedule(java.lang.Runnable,
long, java.util.concurrent.TimeUnit)

On Mon, Oct 6, 2014 at 10: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,
>
> ScheduledExecutorService base heartbeat using scheduleAtFixedRate to
> report . In JDK1.7 API ,heartbeat task running after initialDelay then
> initialDelay+period, then initialDelay + 2 * period, and so on. It's same
> with sleeping base heartbeat
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/448/files#r18470447>.
>