VirtualRelationshipHack( final VirtualNodeHack startNode, final VirtualNodeHack endNode, final String type ) { this.id = MIN_ID.getAndDecrement(); this.startNode = startNode; this.endNode = endNode; relationshipType = () -> type; }
@Override public long getAndDecrementFollowerCounter() { return followerCounter.getAndDecrement(); }
@Override public long getAndDecrementFollowerCounter() { return followerCounter.getAndDecrement(); }
@Override public long getAndDecrement() { return counter.getAndDecrement(); }
@Override public T remove() { Long id = currentId.getAndIncrement(); counter.getAndDecrement(); return objects.remove(id); }
static long getAndDecrement(AtomicLong al) { if (al instanceof BTraceAtomicLong) { return al.getAndDecrement(); } else { throw new IllegalArgumentException(); } }
@Override public void enableLimit() { limitDisableCounter.getAndDecrement(); }
VirtualNodeHack( final String label, Map<String,Object> properties ) { this.id = MIN_ID.getAndDecrement(); this.label = Label.label( label ); propertyMap.putAll( properties ); propertyMap.put( "name", label ); }
/** * Records the invocation of a certain method and indicates whether * it should be traced or not (sampling). * This method will be called when using the average sampling mode. * * @param methodId The method id - generated by the {@linkplain MethodID} class * @return {@code true} if the invocation should be traced */ public static boolean hit(int methodId) { int mean = means[methodId]; if (mean == 0) { return true; } AtomicLong l = counters[methodId]; if (l.getAndDecrement() <= 0) { int inc = rndIntProvider.nextInt(mean) + 1; l.addAndGet(inc); return true; } return false; }
@Override public synchronized void close() throws IOException { if (_closeable) { flush(); release(); BufferContext bufferContext; synchronized (BUFFER_CONTEXT_MAP) { bufferContext = BUFFER_CONTEXT_MAP.remove(this); } if (bufferContext != null) { if (bufferContext._type == BufferContext.Type.DIRECT) { DIRECT_BUFFER_COUNT.getAndDecrement(); DIRECT_BUFFER_USAGE.getAndAdd(-bufferContext._size); } else { MMAP_BUFFER_COUNT.getAndDecrement(); MMAP_BUFFER_USAGE.getAndAdd(-bufferContext._size); } } _closeable = false; } }
/** * Records the invocation of a certain method alongside the timestamp * and indicates whether it should be traced or not (sampling). * This method will be called when using the average sampling mode. * * @param methodId The method id - generated by the {@linkplain MethodID} class * @return a positive number (invocation time stamp) if the invocation should be traced */ public static long hitTimed(int methodId) { int mean = means[methodId]; if (mean == 0) { long ts = System.nanoTime(); tsArray[methodId].set(ts); return ts; } AtomicLong l = counters[methodId]; if (l.getAndDecrement() <= 0) { long ts = System.nanoTime(); int inc = rndIntProvider.nextInt(mean) + 1; l.addAndGet(inc); tsArray[methodId].set(ts); return ts; } return 0L; }
int origMean = origMeans[methodId]; int mean = means[methodId]; if (cntr.getAndDecrement() <= 0) { long ts = System.nanoTime(); ThreadLocal<Long> tsRef = (ThreadLocal<Long>)tsArray[methodId];
int mean = means[methodId]; int origMean = origMeans[methodId]; if (cntr.getAndDecrement() <= 0) { long ts = System.nanoTime(); ThreadLocal<Long> tsRef = (ThreadLocal<Long>)tsArray[methodId];
sid = observerCounter.getAndDecrement(); LOG.info("Setting arbitrary identifier to observer: " + sid);
sid = observerCounter.getAndDecrement(); LOG.info("Setting arbitrary identifier to observer: " + sid);
logEmptyListing.set(3L); if (logEmptyListing.getAndDecrement() > 0) { getLogger().info("Obtained file listing in {} milliseconds; listing had {} items, {} of which were new", new Object[]{millis, listedFiles.size(), newItems});
logEmptyListing.set(3L); if (logEmptyListing.getAndDecrement() > 0) { getLogger().info( "Obtained file listing in {} milliseconds; listing had {} items, {} of which were new",
this.sid = leader.followerCounter.getAndDecrement();
public WrappedNode(Label[] labels, Map<String, Object> props, GraphDatabaseService db) { this.id = MIN_ID.getAndDecrement(); this.db = db; this.labels.addAll(asList(labels)); this.props.putAll(props); }
public VirtualNode(Label[] labels, Map<String, Object> props, GraphDatabaseService db) { this.id = MIN_ID.getAndDecrement(); this.db = db; this.labels.addAll(asList(labels)); this.props.putAll(props); }