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

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

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

origin: wildfly/wildfly

/**
 * Adds elements from list to the table
 * @param list
 * @return True if at least 1 element was added successfully
 */
public boolean add(final List<LongTuple<T>> list) {
  return add(list, false);
}
origin: wildfly/wildfly

/**
 * Adds elements from list to the table, removes elements from list that were not added to the table
 * @param list
 * @return True if at least 1 element was added successfully. This guarantees that the list has at least 1 element
 */
public boolean add(final List<LongTuple<T>> list, boolean remove_added_elements) {
  return add(list, remove_added_elements, null);
}
origin: wildfly/wildfly

protected void deliver(Message msg, SequencerHeader hdr) {
  Address sender=msg.getSrc();
  if(sender == null) {
    if(log.isErrorEnabled())
      log.error(local_addr + ": sender is null, cannot deliver " + "::" + hdr.getSeqno());
    return;
  }
  
  final Table<Message> win=received_msgs;
  win.add(hdr.seqno, msg);
  removeAndDeliver(win, sender);
}

origin: wildfly/wildfly

msg.putHeader(this.id,UnicastHeader3.createDataHeader(seqno,send_conn_id,seqno == DEFAULT_FIRST_SEQNO));
entry.msgs.add(seqno, msg, dont_loopback_set? dont_loopback_filter : null);
if(conn_expiry_timeout > 0)
  entry.update();
origin: wildfly/wildfly

boolean added=loopback || buf.add(msgs, oob, oob? DUMMY_OOB_MSG : null);
origin: wildfly/wildfly

try {
  msg.putHeader(this.id, NakAckHeader2.createMessageHeader(msg_id));
  buf.add(msg_id, msg, dont_loopback_set? dont_loopback_filter : null);
  break;
origin: wildfly/wildfly

protected void handleBatchReceived(final ReceiverEntry entry, Address sender, List<LongTuple<Message>> msgs, boolean oob) {
  if(is_trace)
    log.trace("%s <-- DATA(%s: %s)", local_addr, sender, printMessageList(msgs));
  int batch_size=msgs.size();
  Table<Message> win=entry.msgs;
  // adds all messages to the table, removing messages from 'msgs' which could not be added (already present)
  boolean added=win.add(msgs, oob, oob? DUMMY_OOB_MSG : null);
  update(entry, batch_size);
  if(batch_size >= ack_threshold)
    sendAck(sender, win.getHighestDeliverable(), entry.connId());
  else
    entry.sendAck(true);
  // OOB msg is passed up. When removed, we discard it. Affects ordering: http://jira.jboss.com/jira/browse/JGRP-379
  if(added && oob) {
    MessageBatch oob_batch=new MessageBatch(local_addr, sender, null, false, MessageBatch.Mode.OOB, msgs.size());
    for(LongTuple<Message> tuple: msgs)
      oob_batch.add(tuple.getVal2());
    deliverBatch(oob_batch);
  }
  removeAndDeliver(win, sender);
}
origin: wildfly/wildfly

boolean added=loopback || buf.add(hdr.seqno, msg.isFlagSet(Message.Flag.OOB)? DUMMY_OOB_MSG : msg);
origin: wildfly/wildfly

/**
 * Check whether the hashtable contains an entry e for {@code sender} (create if not). If
 * e.received_msgs is null and {@code first} is true: create a new AckReceiverWindow(seqno) and
 * add message. Set e.received_msgs to the new window. Else just add the message.
 */
protected void handleDataReceived(final Address sender, long seqno, short conn_id,  boolean first, final Message msg) {
  ReceiverEntry entry=getReceiverEntry(sender, seqno, first, conn_id);
  if(entry == null)
    return;
  update(entry, 1);
  boolean oob=msg.isFlagSet(Message.Flag.OOB);
  final Table<Message> win=entry.msgs;
  boolean added=win.add(seqno, oob? DUMMY_OOB_MSG : msg); // adding the same dummy OOB msg saves space (we won't remove it)
  if(ack_threshold <= 1)
    sendAck(sender, win.getHighestDeliverable(), entry.connId());
  else
    entry.sendAck(true); // will be sent delayed (on the next xmit_interval)
  // An OOB message is passed up immediately. Later, when remove() is called, we discard it. This affects ordering !
  // http://jira.jboss.com/jira/browse/JGRP-377
  if(oob) {
    if(added)
      deliverMessage(msg, sender, seqno);
    // we don't steal work if the message is internal (https://issues.jboss.org/browse/JGRP-1733)
    if(msg.isFlagSet(Message.Flag.INTERNAL)) {
      processInternalMessage(win, sender);
      return;
    }
  }
  removeAndDeliver(win, sender);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Adds elements from list to the table, removes elements from list that were not added to the table
 * @param list
 * @return True if at least 1 element was added successfully. This guarantees that the list has at least 1 element
 */
public boolean add(final List<LongTuple<T>> list, boolean remove_added_elements) {
  return add(list, remove_added_elements, null);
}
origin: org.jboss.eap/wildfly-client-all

/**
 * Adds elements from list to the table
 * @param list
 * @return True if at least 1 element was added successfully
 */
public boolean add(final List<LongTuple<T>> list) {
  return add(list, false);
}
origin: stackoverflow.com

 //Pixmap with one pixel
Pixmap pm1 = new Pixmap(1, 1, Format.RGB565);
pm1.setColor(Color.GREEN);
pm1.fill();

Pixmap pm2 = new Pixmap(1, 1, Format.RGB565);
pm2.setColor(Color.RED);
pm2.fill();

dialogueWindow = getWindow();

dialogueWindow.setTitle("New Game");
// The table that will have the green color 
Table row1 = new Table(mySkin);
row1.add(nameStation);
row1.add(nameStationField);
row1.setBackground(new TextureRegionDrawable(new TextureRegion(new Texture(pm1))));
dialogueWindow.add(row1);
dialogueWindow.row();

// The table that will have  the green color
Table row2 = new Table(mySkin);
row2.setBackground(new TextureRegionDrawable(new TextureRegion(new Texture(pm2))));
row2.add(cancel).size(120, 60);
row2.add(ok).size(100, 60);

dialogueWindow.add(row2).fillX();
dialogueWindow.row();
origin: org.jboss.eap/wildfly-client-all

protected void deliver(Message msg, SequencerHeader hdr) {
  Address sender=msg.getSrc();
  if(sender == null) {
    if(log.isErrorEnabled())
      log.error(local_addr + ": sender is null, cannot deliver " + "::" + hdr.getSeqno());
    return;
  }
  
  final Table<Message> win=received_msgs;
  win.add(hdr.seqno, msg);
  removeAndDeliver(win, sender);
}

origin: org.jboss.eap/wildfly-client-all

msg.putHeader(this.id,UnicastHeader3.createDataHeader(seqno,send_conn_id,seqno == DEFAULT_FIRST_SEQNO));
entry.msgs.add(seqno, msg, dont_loopback_set? dont_loopback_filter : null);
if(conn_expiry_timeout > 0)
  entry.update();
origin: org.jboss.eap/wildfly-client-all

boolean added=loopback || buf.add(msgs, oob, oob? DUMMY_OOB_MSG : null);
origin: org.jboss.eap/wildfly-client-all

try {
  msg.putHeader(this.id, NakAckHeader2.createMessageHeader(msg_id));
  buf.add(msg_id, msg, dont_loopback_set? dont_loopback_filter : null);
  break;
origin: org.jboss.eap/wildfly-client-all

protected void handleBatchReceived(final ReceiverEntry entry, Address sender, List<LongTuple<Message>> msgs, boolean oob) {
  if(is_trace)
    log.trace("%s <-- DATA(%s: %s)", local_addr, sender, printMessageList(msgs));
  int batch_size=msgs.size();
  Table<Message> win=entry.msgs;
  // adds all messages to the table, removing messages from 'msgs' which could not be added (already present)
  boolean added=win.add(msgs, oob, oob? DUMMY_OOB_MSG : null);
  update(entry, batch_size);
  if(batch_size >= ack_threshold)
    sendAck(sender, win.getHighestDeliverable(), entry.connId());
  else
    entry.sendAck(true);
  // OOB msg is passed up. When removed, we discard it. Affects ordering: http://jira.jboss.com/jira/browse/JGRP-379
  if(added && oob) {
    MessageBatch oob_batch=new MessageBatch(local_addr, sender, null, false, MessageBatch.Mode.OOB, msgs.size());
    for(LongTuple<Message> tuple: msgs)
      oob_batch.add(tuple.getVal2());
    deliverBatch(oob_batch);
  }
  removeAndDeliver(win, sender);
}
origin: org.jboss.eap/wildfly-client-all

boolean added=loopback || buf.add(hdr.seqno, msg.isFlagSet(Message.Flag.OOB)? DUMMY_OOB_MSG : msg);
origin: stackoverflow.com

filler.add(hGroup).fill().center();
origin: org.jboss.eap/wildfly-client-all

/**
 * Check whether the hashtable contains an entry e for {@code sender} (create if not). If
 * e.received_msgs is null and {@code first} is true: create a new AckReceiverWindow(seqno) and
 * add message. Set e.received_msgs to the new window. Else just add the message.
 */
protected void handleDataReceived(final Address sender, long seqno, short conn_id,  boolean first, final Message msg) {
  ReceiverEntry entry=getReceiverEntry(sender, seqno, first, conn_id);
  if(entry == null)
    return;
  update(entry, 1);
  boolean oob=msg.isFlagSet(Message.Flag.OOB);
  final Table<Message> win=entry.msgs;
  boolean added=win.add(seqno, oob? DUMMY_OOB_MSG : msg); // adding the same dummy OOB msg saves space (we won't remove it)
  if(ack_threshold <= 1)
    sendAck(sender, win.getHighestDeliverable(), entry.connId());
  else
    entry.sendAck(true); // will be sent delayed (on the next xmit_interval)
  // An OOB message is passed up immediately. Later, when remove() is called, we discard it. This affects ordering !
  // http://jira.jboss.com/jira/browse/JGRP-377
  if(oob) {
    if(added)
      deliverMessage(msg, sender, seqno);
    // we don't steal work if the message is internal (https://issues.jboss.org/browse/JGRP-1733)
    if(msg.isFlagSet(Message.Flag.INTERNAL)) {
      processInternalMessage(win, sender);
      return;
    }
  }
  removeAndDeliver(win, sender);
}
org.jgroups.utilTableadd

Javadoc

Adds an element if the element at the given index is null. Returns true if no element existed at the given index, else returns false and doesn't set the element.

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

Popular in Java

  • Start an intent from android
  • putExtra (Intent)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • findViewById (Activity)
  • Menu (java.awt)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • Collectors (java.util.stream)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Best IntelliJ 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