public long get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
/** * Retrieves the value for <tt>key</tt> * * @param key an <code>Object</code> value * @return the value of <tt>key</tt> or null if no such mapping exists. */ public Long get( Object key ) { long v = _map.get( key ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
public long get( Object key ) { return m.get( key ); }
&& recentlyRequestedWorkers.get(graphId) >= System.currentTimeMillis() - WORKER_STARTUP_TIME){ LOG.info("workers still starting on graph {}, not starting more", graphId); return;
/** * Returns the number of times the specified object has been seen by this * counter. */ public long getCount(T obj) { return counts.get(obj); }
public long get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
@Override public long get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
public long get( Object key ) { return m.get( key ); }
public long get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
public long get( Object key ) { synchronized( mutex ) { return m.get( key ); } }
@Override public long get( Object key ) { return m.get( key ); }
public long get( Object key ) { return m.get( key ); }
/** * Adds the counts from the provided {@code Counter} to the current counts, * adding new elements as needed. */ public void add(Counter<? extends T> counter) { for (Map.Entry<? extends T,Integer> e : counter) { T t = e.getKey(); Long cur = counts.get(t); counts.put(t, (cur == null) ? e.getValue() : cur + e.getValue()); } }
/** * Adds the counts from the provided {@code Counter} to the current counts, * adding new elements as needed. */ public void add(BigCounter<? extends T> counter) { for (Map.Entry<? extends T,Long> e : counter) { T t = e.getKey(); Long cur = counts.get(t); counts.put(t, (cur == null) ? e.getValue() : cur + e.getValue()); } }
public static long getGCTimeDiff(final List<GarbageCollectorMXBean> gcBeans, final TObjectLongMap lastValues) { long gcTime = 0; for (GarbageCollectorMXBean gcBean : gcBeans) { long prevVal = lastValues.get(gcBean); long currVal = gcBean.getCollectionTime(); gcTime += currVal - prevVal; lastValues.put(gcBean, currVal); } return gcTime; }
/** * Counts the object, increasing its total count by 1. */ public long count(T obj) { long count = counts.get(obj); count++; counts.put(obj, count); sum++; return count; }
public static synchronized long getId(@Nonnull final MeasurementsInfo info) { long id = INFO2ID.get(info); if (id <= 0) { id = idSeq++; INFO2ID.put(info, id); ID2INFO.put(id, info); } return id; }
public boolean equals(Object o) { if (o instanceof Counter) { BigCounter<?> c = (BigCounter<?>)o; if (counts.size() != c.size() || sum != c.sum()) return false; for (Map.Entry<?,Long> e : c) { long i = counts.get(e.getKey()); if (i != e.getValue()) return false; } return true; } return false; }