Removed masters Counters class and replaced it with normal Java Atomic i...

Counters is not a thread-safe class.  The edit log didn't get dependency counts since that was a different variable.

Deleted Counters and replaced all instances with AtomicLong or Integer.
Needs to reload if the state changes.
On Nov 4, 2014 6:29 PM, "Haoyuan Li" <notifications@github.com> wrote:

> In core/src/main/java/tachyon/master/MasterInfo.java:
>
> > @@ -1766,10 +1767,15 @@ private MasterWorkerInfo getWorkerInfo(long workerId) {
> >    }
> >
> >    public void init() throws IOException {
> > -    mCheckpointInfo.updateEditTransactionCounter(mJournal.loadEditLog(this));
> > +    long current;
> > +    long max;
> > +    do {
> > +      current = mEditTransactionId.get();
> > +      max = Math.max(current, mJournal.loadEditLog(this));
> > +    } while (!mEditTransactionId.compareAndSet(current, max));
>
> But "mJournal.loadEditLog(this)" is called multiple times.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/504/files#r19851846>.
>