Tabnine Logo
Table.removeMany
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: wildfly/wildfly

public List<T> removeMany(boolean nullify, int max_results) {
  return removeMany(nullify, max_results, null);
}
origin: wildfly/wildfly

public List<T> removeMany(boolean nullify, int max_results, Predicate<T> filter) {
  return removeMany(nullify, max_results, filter, LinkedList::new, LinkedList::add);
}
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

try {
  win.removeMany(true, 0, drop_oob_and_dont_loopback_msgs_filter,
          batch_creator, BATCH_ACCUMULATOR);
origin: org.jboss.eap/wildfly-client-all

public List<T> removeMany(boolean nullify, int max_results) {
  return removeMany(nullify, max_results, null);
}
origin: org.jboss.eap/wildfly-client-all

public List<T> removeMany(boolean nullify, int max_results, Predicate<T> filter) {
  return removeMany(nullify, max_results, filter, LinkedList::new, LinkedList::add);
}
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

try {
  win.removeMany(true, 0, drop_oob_and_dont_loopback_msgs_filter,
          batch_creator, BATCH_ACCUMULATOR);
org.jgroups.utilTableremoveMany

Javadoc

Removes elements from the table and adds them to the result created by result_creator. Between 0 and max_results elements are removed. If no elements were removed, processing will be set to true while the table lock is held.

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,
  • getAdders,
  • getDigest,
  • getHighestDeliverable,
  • getHighestDelivered,
  • getHighestReceived,
  • getLow,
  • getMissing,
  • getNumCompactions

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • getSharedPreferences (Context)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Top 12 Jupyter Notebook Extensions
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