congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AbstractNodeQueue$Node
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractNodeQueue$Node
in
akka.dispatch

Best Java code snippets using akka.dispatch.AbstractNodeQueue$Node (Showing top 20 results out of 315)

origin: org.spark-project.akka/akka-actor_2.11

public final void add(final T value) {
  final Node<T> n = new Node<T>(value);
  getAndSet(n).setNext(n);
}

origin: com.data-artisans/flakka-actor_2.10

/**
 * Pull one item from the queue, returning it within a queue node.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return queue node with element inside if there was one, or null if there was none
 */
@SuppressWarnings("unchecked")
public final Node<T> pollNode() {
 final Node<T> tail = (Node<T>) Unsafe.instance.getObjectVolatile(this, tailOffset);
 Node<T> next = tail.next();
 if (next == null && get() != tail) {
   // if tail != head this is not going to change until producer makes progress
   // we can avoid reading the head and just spin on next until it shows up
   do {
     next = tail.next();
   } while (next == null);
 }
 if (next == null) return null;
 else {
  tail.value = next.value;
  next.value = null;
  Unsafe.instance.putOrderedObject(this, tailOffset, next);
  tail.setNext(null);
  return tail;
 }
}
origin: com.data-artisans/flakka-actor_2.11

/**
 * Pull one item from the queue, returning it within a queue node.
 * 
 * Use this method only from the consumer thread!
 * 
 * @return queue node with element inside if there was one, or null if there was none
 */
@SuppressWarnings("unchecked")
public final Node<T> pollNode() {
 final Node<T> tail = (Node<T>) Unsafe.instance.getObjectVolatile(this, tailOffset);
 Node<T> next = tail.next();
 if (next == null && get() != tail) {
   // if tail != head this is not going to change until producer makes progress
   // we can avoid reading the head and just spin on next until it shows up
   do {
     next = tail.next();
   } while (next == null);
 }
 if (next == null) return null;
 else {
  tail.value = next.value;
  next.value = null;
  Unsafe.instance.putOrderedObject(this, tailOffset, next);
  tail.setNext(null);
  return tail;
 }
}
origin: com.data-artisans/flakka-actor_2.11

/**
 * This method returns an upper bound on the queue size at the time it
 * starts executing. It may spuriously return smaller values (including
 * zero) if the consumer pulls items out concurrently.
 * 
 * This method can be used from any thread.
 * 
 * @return an upper bound on queue length at some time in the past
 */
@SuppressWarnings("unchecked")
public final int count() {
  int count = 0;
  final Node<T> head = get();
  for(Node<T> n = ((Node<T>) Unsafe.instance.getObjectVolatile(this, tailOffset)).next();
    n != null && count < Integer.MAX_VALUE; 
    n = n.next()) {
   ++count;
   // only iterate up to the point where head was when starting: this is a moving queue!
   if (n == head) break;
  }
  return count;
}
origin: com.data-artisans/flakka-actor_2.10

/**
 * This method returns an upper bound on the queue size at the time it
 * starts executing. It may spuriously return smaller values (including
 * zero) if the consumer pulls items out concurrently.
 * 
 * This method can be used from any thread.
 * 
 * @return an upper bound on queue length at some time in the past
 */
@SuppressWarnings("unchecked")
public final int count() {
  int count = 0;
  final Node<T> head = get();
  for(Node<T> n = ((Node<T>) Unsafe.instance.getObjectVolatile(this, tailOffset)).next();
    n != null && count < Integer.MAX_VALUE; 
    n = n.next()) {
   ++count;
   // only iterate up to the point where head was when starting: this is a moving queue!
   if (n == head) break;
  }
  return count;
}
origin: org.spark-project.akka/akka-actor_2.10

@SuppressWarnings("unchecked")
public final Node<T> pollNode() {
 Node<T> tail;
 Node<T> next;
 for(;;) {
  tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
  next = tail.next();
  if (next != null || get() == tail)
   break;
 }
 if (next == null) return null;
 else {
  tail.value = next.value;
  next.value = null;
  Unsafe.instance.putOrderedObject(this, tailOffset, next);
  return tail;
 }
}
origin: org.spark-project.akka/akka-actor_2.11

@SuppressWarnings("unchecked")
public final Node<T> pollNode() {
 Node<T> tail;
 Node<T> next;
 for(;;) {
  tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
  next = tail.next();
  if (next != null || get() == tail)
   break;
 }
 if (next == null) return null;
 else {
  tail.value = next.value;
  next.value = null;
  Unsafe.instance.putOrderedObject(this, tailOffset, next);
  return tail;
 }
}
origin: com.data-artisans/flakka-actor_2.10

/**
 * Query the queue tail for the next element without dequeuing it.
 * 
 * Use this method only from the consumer thread!
 * 
 * !!! There is a copy of this code in pollNode() !!!
 * 
 * @return queue node with element inside if there was one, or null if there was none
 */
@SuppressWarnings("unchecked")
protected final Node<T> peekNode() {
  for(;;) {
   final Node<T> tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
   final Node<T> next = tail.next();
   if (next != null || get() == tail)
    return next;
  }
}

origin: com.data-artisans/flakka-actor_2.11

/**
 * Query the queue tail for the next element without dequeuing it.
 * 
 * Use this method only from the consumer thread!
 * 
 * !!! There is a copy of this code in pollNode() !!!
 * 
 * @return queue node with element inside if there was one, or null if there was none
 */
@SuppressWarnings("unchecked")
protected final Node<T> peekNode() {
  for(;;) {
   final Node<T> tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
   final Node<T> next = tail.next();
   if (next != null || get() == tail)
    return next;
  }
}

origin: org.spark-project.akka/akka-actor_2.10

public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: org.spark-project.akka/akka-actor_2.11

public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: com.data-artisans/flakka-actor_2.10

/**
 * Add an element to the head of the queue, providing the queue node to be used.
 * 
 * This method can be used from any thread.
 * 
 * @param n the node containing the element to be added; both must not be null
 */
public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: com.data-artisans/flakka-actor_2.11

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: org.spark-project.akka/akka-actor_2.11

@SuppressWarnings("unchecked")
protected final Node<T> peekNode() {
  for(;;) {
   final Node<T> tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
   final Node<T> next = tail.next();
   if (next != null || get() == tail)
    return next;
  }
}
origin: com.data-artisans/flakka-actor_2.11

/**
 * Add an element to the head of the queue, providing the queue node to be used.
 * 
 * This method can be used from any thread.
 * 
 * @param n the node containing the element to be added; both must not be null
 */
public final void addNode(final Node<T> n) {
  n.setNext(null);
  getAndSet(n).setNext(n);
}
origin: com.data-artisans/flakka-actor_2.10

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: com.data-artisans/flakka-actor_2.10

/**
 * Add an element to the head of the queue.
 * 
 * This method can be used from any thread.
 * 
 * @param value the element to be added; must not be null
 */
public final void add(final T value) {
  final Node<T> n = new Node<T>(value);
  getAndSet(n).setNext(n);
}

origin: org.spark-project.akka/akka-actor_2.10

@SuppressWarnings("unchecked")
protected final Node<T> peekNode() {
  for(;;) {
   final Node<T> tail = ((Node<T>)Unsafe.instance.getObjectVolatile(this, tailOffset));
   final Node<T> next = tail.next();
   if (next != null || get() == tail)
    return next;
  }
}
origin: org.spark-project.akka/akka-actor_2.10

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
origin: org.spark-project.akka/akka-actor_2.11

protected AbstractNodeQueue() {
  final Node<T> n = new Node<T>();
  _tailDoNotCallMeDirectly = n;
  set(n);
}
akka.dispatchAbstractNodeQueue$Node

Most used methods

  • <init>
  • next
  • setNext

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • getSystemService (Context)
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now