Codota Logo
STABLE
Code IndexAdd Codota to your IDE (free)

How to use
STABLE
in
org.jgroups.protocols.pbcast

Best Java code snippets using org.jgroups.protocols.pbcast.STABLE (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: wildfly/wildfly

lock.lock();
try {
  int rank=getRank(sender, view);
  if(rank < 0 || votes.get(rank))  // already received gossip from sender; discard it
    return;
  num_stable_msgs_received++;
  updateLocalDigest(d, sender);
  if(addVote(rank)) {       // votes from all members have been received
    resetDigest();        // sets digest
  resetNumBytes();
  sendStabilityMessage(stable_digest, stable_view_id);
origin: wildfly/wildfly

/**
 * Adds mbr to votes and returns true if we have all the votes, otherwise false.
 * @param rank
 */
@GuardedBy("lock")
protected boolean addVote(int rank) {
  try {
    return votes.set(rank) && allVotesReceived(votes);
  }
  catch(Throwable t) {
    return false;
  }
}
origin: wildfly/wildfly

final MutableDigest d=new MutableDigest(current_view.getMembersRaw()).set(getDigest());
Address dest=send_stable_msgs_to_coord_only? coordinator : null;
if(d.allSet() || d.set(getDigest()).allSet()) // try once more if the first digest didn't match
  log.trace("%s: sending stable msg to %s: %s",
       local_addr, (send_stable_msgs_to_coord_only? coordinator : "cluster"), printDigest(d));
else {
  log.trace("%s: could not find matching digest for view %s, missing members: %s", local_addr, current_view, d.getNonSetMembers());
 .setFlag(Message.Flag.OOB,Message.Flag.INTERNAL,Message.Flag.NO_RELIABILITY)
 .putHeader(this.id, new StableHeader(StableHeader.STABLE_GOSSIP, current_view.getViewId()))
 .setBuffer(marshal(d));
try {
  if(!send_in_background) {
  timer.execute(r, getTransport() instanceof TCP);
origin: wildfly/wildfly

protected void handleUpEvent(StableHeader hdr, Address sender, Digest digest) {
  switch(hdr.type) {
    case StableHeader.STABLE_GOSSIP:
      handleStableMessage(digest, sender, hdr.view_id);
      break;
    case StableHeader.STABILITY:
      handleStabilityMessage(digest, sender, hdr.view_id);
      break;
    default:
      log.error("%s: StableHeader type %s not known", local_addr, hdr.type);
  }
}
origin: wildfly/wildfly

protected void resume() {
  lock.lock();
  try {
    resetDigest(); // start from scratch
    suspended=false;
  }
  finally {
    lock.unlock();
  }
  log.debug("resuming message garbage collection");
  stopResumeTask();
}

origin: wildfly/wildfly

public Object up(Message msg) {
  StableHeader hdr=msg.getHeader(this.id);
  if(hdr == null) {
    handleRegularMessage(msg);
    return up_prot.up(msg);
  }
  handleUpEvent(hdr, msg.getSrc(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength()));
  return null;  // don't pass STABLE or STABILITY messages up the stack
}
origin: wildfly/wildfly

public Object down(Event evt) {
  switch(evt.getType()) {
    case Event.VIEW_CHANGE:
      Object retval=down_prot.down(evt);
      handleViewChange(evt.getArg());
      return retval;
    case Event.SUSPEND_STABLE:
      long timeout=MAX_SUSPEND_TIME;
      Object t=evt.getArg();
      if(t != null && t instanceof Long)
        timeout=(Long)t;
      suspend(timeout);
      break;
    case Event.RESUME_STABLE:
      resume();
      break;
    case Event.SET_LOCAL_ADDRESS:
      local_addr=evt.getArg();
      break;
  }
  return down_prot.down(evt);
}
origin: org.jgroups/com.springsource.org.jgroups

hdr=(StableHeader)msg.getHeader(name);
if(hdr == null) {
  handleRegularMessage(msg);
  return up_prot.up(evt);
  handleStableMessage(msg.getSrc(), hdr.stableDigest);
  break;
case StableHeader.STABILITY:
  handleStabilityMessage(hdr.stableDigest, msg.getSrc());
  break;
default:
Object retval=up_prot.up(evt);
View view=(View)evt.getArg();
handleViewChange(view);
return retval;
origin: wildfly/wildfly

stopStabilityTask();
  log.trace("%s: received stability msg from %s: %s", local_addr, sender, printDigest(stable_digest));
  resetDigest();
resetNumBytes();
down_prot.down(new Event(Event.STABLE, stable_digest)); // pass STABLE down, so NAKACK{2} can purge stable messages
origin: org.jgroups/com.springsource.org.jgroups

  return;
num_stable_msgs_received++;
boolean success=updateLocalDigest(d, sender);
if(!success) // we can only add the sender to votes if *all* elements of my digest were updated
  return;
all_votes_received=addVote(sender);
if(all_votes_received)
  copy=digest.copy();
sendStabilityMessage(copy);
origin: org.jgroups/com.springsource.org.jgroups

public void runMessageGarbageCollection() {
  Digest copy=getDigest();
  sendStableMessage(copy);
}
origin: org.jgroups/com.springsource.org.jgroups

stopStabilityTask();
         this.digest + "): ignoring digest and re-initializing own digest");
   resetDigest();
   return;
 resetDigest();
origin: wildfly/wildfly

protected void handleViewChange(View v) {
  lock.lock();
  try {
    this.view=v;
    coordinator=v.getCoord();
    resetDigest();
    if(!initialized)
      initialized=true;
  }
  finally {
    lock.unlock();
  }
}
origin: wildfly/wildfly

public Object up(Event evt) {
  switch(evt.getType()) {
    case Event.VIEW_CHANGE:
      Object retval=up_prot.up(evt);
      handleViewChange(evt.getArg());
      return retval;
  }
  return up_prot.up(evt);
}
origin: wildfly/wildfly

public void run() {
  if(suspended)
    log.warn("ResumeTask resumed message garbage collection - this should be done by a RESUME_STABLE event; " +
          "check why this event was not received (or increase max_suspend_time for large state transfers)");
  resume();
}
public String toString() {return STABLE.class.getSimpleName() + ": ResumeTask";}
origin: org.jgroups/com.springsource.org.jgroups

@GuardedBy("lock")
private void resetDigest() {
  Digest tmp=getDigest();
  digest.replace(tmp);
  if(log.isTraceEnabled())
    log.trace("resetting digest from NAKACK: " + digest.printHighestDeliveredSeqnos());
  votes.clear();
}
origin: org.jgroups/com.springsource.org.jgroups

public Object down(Event evt) {
  switch(evt.getType()) {
    case Event.VIEW_CHANGE:
      Object retval=down_prot.down(evt);
      View v=(View)evt.getArg();
      handleViewChange(v);
    return retval;
  case Event.SUSPEND_STABLE:
    long timeout=0;
    Object t=evt.getArg();
    if(t != null && t instanceof Long)
      timeout=(Long)t;
    suspend(timeout);
    break;
  case Event.RESUME_STABLE:
    resume();
    break;
  }
  return down_prot.down(evt);
}
origin: org.jboss.eap/wildfly-client-all

stopStabilityTask();
  log.trace("%s: received stability msg from %s: %s", local_addr, sender, printDigest(stable_digest));
  resetDigest();
resetNumBytes();
down_prot.down(new Event(Event.STABLE, stable_digest)); // pass STABLE down, so NAKACK{2} can purge stable messages
origin: org.jgroups/com.springsource.org.jgroups

private void resume() {
  lock.lock();
  try {
    resetDigest(); // start from scratch
    suspended=false;
  }
  finally {
    lock.unlock();
  }
  if(log.isDebugEnabled())
    log.debug("resuming message garbage collection");
  stopResumeTask();
}
origin: org.jboss.eap/wildfly-client-all

public Object up(Message msg) {
  StableHeader hdr=msg.getHeader(this.id);
  if(hdr == null) {
    handleRegularMessage(msg);
    return up_prot.up(msg);
  }
  handleUpEvent(hdr, msg.getSrc(), readDigest(msg.getRawBuffer(), msg.getOffset(), msg.getLength()));
  return null;  // don't pass STABLE or STABILITY messages up the stack
}
org.jgroups.protocols.pbcastSTABLE

Javadoc

Computes the broadcast messages that are stable; i.e., have been delivered by all members. Sends STABLE events down the stack when this is the case. This allows NAKACK{2,3} to garbage collect messages that have been seen by all members.

Works as follows: periodically (desired_avg_gossip) or when having received a number of bytes (max_bytes), every member sends its digest (highest seqno delivered, received) to the cluster (send_stable_msgs_to_coord_only=false) or the current coordinator (send_stable_msgs_to_coord_only=true).

The recipient updates a stability vector, which maintains the highest seqno delivered/receive for each member and initially contains no data, when such a message is received.

When messages from all members have been received, a stability message is mcast, which causes all members to send a STABLE event down the stack (triggering garbage collection in the NAKACK{2,3} layer).

When send_stable_msgs_to_coord_only is true, far fewer messages are exchanged, as members don't multicast STABLE messages, but instead send them only to the coordinator.

Most used methods

  • addVote
    Adds mbr to votes and returns true if we have all the votes, otherwise false.
  • allVotesReceived
    Votes is already locked and guaranteed to be non-null
  • getDigest
  • handleRegularMessage
  • handleStabilityMessage
  • handleStableMessage
    Digest d contains (a) the highest seqnos deliverable for each sender and (b) the highest seqnosseen
  • handleViewChange
  • resetDigest
  • resume
  • sendStabilityMessage
    Schedules a stability message to be mcast after a random number of milliseconds (range [1-stability_
  • sendStableMessage
    Broadcasts a STABLE message of the current digest to all members (or the coordinator only). The mess
  • startResumeTask
  • sendStableMessage,
  • startResumeTask,
  • startStabilityTask,
  • startStableTask,
  • stopResumeTask,
  • stopStabilityTask,
  • stopStableTask,
  • suspend,
  • updateLocalDigest,
  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • putExtra (Intent)
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • DataSource (javax.sql)
    A factory for connections to the physical data source that this DataSource object represents. An alt
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now