[TACHYON-115] Share client threads

Use a fixed threadpool per file system for the heartbeat threads.  
We don't need all those threads.  And when the clients owned the threats,
that was the issue.  If it's at fs and server level we don't have to worry
about spinning off too many
On Sep 17, 2014 11:59 AM, "Haoyuan Li" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/client/TachyonFS.java:
>
> > @@ -129,8 +133,12 @@ private TachyonFS(InetSocketAddress masterAddress, boolean zookeeperMode) throws
> >      mZookeeperMode = zookeeperMode;
> >      mAvailableSpaceBytes = 0L;
> >
> > -    mMasterClient = new MasterClient(mMasterAddress, mZookeeperMode);
> > -    mWorkerClient = new WorkerClient(mMasterClient);
> > +    mExecutorService = Executors.newFixedThreadPool(2,
> > +        new ThreadFactoryBuilder().setDaemon(true)
> > +            .setNameFormat("heartbeat-client-" + masterAddress + "-%d").build());
> > +
> > +    mMasterClient = new MasterClient(mMasterAddress, mZookeeperMode, mExecutorService);
>
> why not have separated ExecutorServices for master client and worker
> client? In that case, master client and worker client don't need an
> executor service from outside of the class.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/399/files#r17685745>.
>