congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
Table.getAdders
Code IndexAdd Tabnine to your IDE (free)

How to use
getAdders
method
in
org.jgroups.util.Table

Best Java code snippets using org.jgroups.util.Table.getAdders (Showing top 8 results out of 315)

origin: wildfly/wildfly

protected void processInternalMessage(final Table<Message> win, final Address sender) {
  // If there are other msgs, tell the regular thread pool to handle them (https://issues.jboss.org/browse/JGRP-1732)
  if(!win.isEmpty() && win.getAdders().get() == 0) // just a quick&dirty check, can also be incorrect
    getTransport().submitToThreadPool(() -> removeAndDeliver(win, sender), true);
}
origin: wildfly/wildfly

protected void removeAndDeliver(Table<Message> win, Address sender) {
  AtomicInteger adders=win.getAdders();
  if(adders.getAndIncrement() != 0)
    return;
  final MessageBatch     batch=new MessageBatch(win.size()).dest(local_addr).sender(sender).multicast(false);
  Supplier<MessageBatch> batch_creator=() -> batch;
  do {
    try {
      batch.reset();
      win.removeMany(true, 0, null, batch_creator, BATCH_ACCUMULATOR);
    }
    catch(Throwable t) {
      log.error("failed removing messages from table for " + sender, t);
    }
    if(!batch.isEmpty()) {
      // batch is guaranteed to NOT contain any OOB messages as the drop_oob_msgs_filter removed them
      deliverBatch(batch);
    }
  }
  while(adders.decrementAndGet() != 0);
}
origin: wildfly/wildfly

/** Efficient way of checking whether another thread is already processing messages from sender. If that's the case,
 *  we return immediately and let the existing thread process our message (https://jira.jboss.org/jira/browse/JGRP-829).
 *  Benefit: fewer threads blocked on the same lock, these threads can be returned to the thread pool
 */
protected void removeAndDeliver(Table<Message> buf, Address sender, boolean loopback, AsciiString cluster_name) {
  AtomicInteger adders=buf.getAdders();
  if(adders.getAndIncrement() != 0)
    return;
  boolean remove_msgs=discard_delivered_msgs && !loopback;
  MessageBatch batch=new MessageBatch(buf.size()).dest(null).sender(sender).clusterName(cluster_name).multicast(true);
  Supplier<MessageBatch> batch_creator=() -> batch;
  do {
    try {
      batch.reset();
      // Don't include DUMMY and OOB_DELIVERED messages in the removed set
      buf.removeMany(remove_msgs, 0, no_dummy_and_no_oob_delivered_msgs_and_no_dont_loopback_msgs,
              batch_creator, BATCH_ACCUMULATOR);
    }
    catch(Throwable t) {
      log.error("failed removing messages from table for " + sender, t);
    }
    if(!batch.isEmpty())
      deliverBatch(batch);
  }
  while(adders.decrementAndGet() != 0);
  if(rebroadcasting)
    checkForRebroadcasts();
}
origin: wildfly/wildfly

AtomicInteger adders=win.getAdders();
if(adders.getAndIncrement() != 0)
  return;
origin: org.jboss.eap/wildfly-client-all

protected void processInternalMessage(final Table<Message> win, final Address sender) {
  // If there are other msgs, tell the regular thread pool to handle them (https://issues.jboss.org/browse/JGRP-1732)
  if(!win.isEmpty() && win.getAdders().get() == 0) // just a quick&dirty check, can also be incorrect
    getTransport().submitToThreadPool(() -> removeAndDeliver(win, sender), true);
}
origin: org.jboss.eap/wildfly-client-all

protected void removeAndDeliver(Table<Message> win, Address sender) {
  AtomicInteger adders=win.getAdders();
  if(adders.getAndIncrement() != 0)
    return;
  final MessageBatch     batch=new MessageBatch(win.size()).dest(local_addr).sender(sender).multicast(false);
  Supplier<MessageBatch> batch_creator=() -> batch;
  do {
    try {
      batch.reset();
      win.removeMany(true, 0, null, batch_creator, BATCH_ACCUMULATOR);
    }
    catch(Throwable t) {
      log.error("failed removing messages from table for " + sender, t);
    }
    if(!batch.isEmpty()) {
      // batch is guaranteed to NOT contain any OOB messages as the drop_oob_msgs_filter removed them
      deliverBatch(batch);
    }
  }
  while(adders.decrementAndGet() != 0);
}
origin: org.jboss.eap/wildfly-client-all

/** Efficient way of checking whether another thread is already processing messages from sender. If that's the case,
 *  we return immediately and let the existing thread process our message (https://jira.jboss.org/jira/browse/JGRP-829).
 *  Benefit: fewer threads blocked on the same lock, these threads can be returned to the thread pool
 */
protected void removeAndDeliver(Table<Message> buf, Address sender, boolean loopback, AsciiString cluster_name) {
  AtomicInteger adders=buf.getAdders();
  if(adders.getAndIncrement() != 0)
    return;
  boolean remove_msgs=discard_delivered_msgs && !loopback;
  MessageBatch batch=new MessageBatch(buf.size()).dest(null).sender(sender).clusterName(cluster_name).multicast(true);
  Supplier<MessageBatch> batch_creator=() -> batch;
  do {
    try {
      batch.reset();
      // Don't include DUMMY and OOB_DELIVERED messages in the removed set
      buf.removeMany(remove_msgs, 0, no_dummy_and_no_oob_delivered_msgs_and_no_dont_loopback_msgs,
              batch_creator, BATCH_ACCUMULATOR);
    }
    catch(Throwable t) {
      log.error("failed removing messages from table for " + sender, t);
    }
    if(!batch.isEmpty())
      deliverBatch(batch);
  }
  while(adders.decrementAndGet() != 0);
  if(rebroadcasting)
    checkForRebroadcasts();
}
origin: org.jboss.eap/wildfly-client-all

AtomicInteger adders=win.getAdders();
if(adders.getAndIncrement() != 0)
  return;
org.jgroups.utilTablegetAdders

Popular methods of Table

  • add
    Adds elements from the list to the table
  • <init>
  • _add
  • _compact
    Moves the contents of matrix down by the number of purged rows and resizes the matrix accordingly. T
  • capacity
    Returns the total capacity in the matrix
  • compact
  • computeIndex
    Computes and returns the index within a row for seqno
  • computeRow
    Computes and returns the row index for seqno. The caller must hold the lock.
  • computeSize
    Iterate from low to hr and add up non-null values. Caller must hold the lock.
  • findHighestSeqno
  • forEach
    Iterates over the matrix with range [from .. to] (including from and to), and calls Visitor#visit(lo
  • get
    Returns an element at seqno
  • forEach,
  • get,
  • getDigest,
  • getHighestDeliverable,
  • getHighestDelivered,
  • getHighestReceived,
  • getLow,
  • getMissing,
  • getNumCompactions

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top 25 Plugins for Webstorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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