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.
It's called a cas loop. Required to be thread safe.
On Nov 4, 2014 6:26 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));
>
> why add a while loop here?
>
> how about:
>
> long current = mEditTransactionId.get();
> current = math.Max(current, mJournal.loadEditLog(this));
> mEditTransactionId.set(current);
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/amplab/tachyon/pull/504/files#r19851781>.
>