Tabnine Logo
STATE_TRANSFER.openBarrierAndResumeStable
Code IndexAdd Tabnine to your IDE (free)

How to use
openBarrierAndResumeStable
method
in
org.jgroups.protocols.pbcast.STATE_TRANSFER

Best Java code snippets using org.jgroups.protocols.pbcast.STATE_TRANSFER.openBarrierAndResumeStable (Showing top 6 results out of 315)

origin: wildfly/wildfly

protected void handleViewChange(View v) {
  Address       old_coord;
  List<Address> new_members=v.getMembers();
  boolean       send_up_exception=false;
  this.view=v;
  synchronized(members) {
    old_coord=(!members.isEmpty()? members.get(0) : null);
    members.clear();
    members.addAll(new_members);
    // this handles the case where a coord dies during a state transfer; prevents clients from hanging forever
    // Note this only takes a coordinator crash into account, a getState(target, timeout), where target is not
    // null is not handled ! (Usually we get the state from the coordinator)
    // http://jira.jboss.com/jira/browse/JGRP-148
    if(waiting_for_state_response && old_coord != null && !members.contains(old_coord))
      send_up_exception=true;
  }
  if(send_up_exception) {
    log.warn("%s: discovered that the state provider (%s) left", local_addr, old_coord);
    waiting_for_state_response=false;
    Exception ex=new EOFException("state provider " + old_coord + " left");
    up_prot.up(new Event(Event.GET_STATE_OK, new StateTransferResult(ex)));
    openBarrierAndResumeStable();
  }
  // remove non members from list of members requesting state
  state_requesters.retainAll(new_members);
}
origin: wildfly/wildfly

protected void handleException(Throwable exception) {
  if(isDigestNeeded())
    openBarrierAndResumeStable();
  up_prot.up(new Event(Event.GET_STATE_OK, new StateTransferResult(exception)));
}
origin: wildfly/wildfly

/** Set the digest and the send the state up to the application */
protected void handleStateRsp(final Digest digest, Address sender, byte[] state) {
  try {
    if(isDigestNeeded()) {
      punchHoleFor(sender);
      closeBarrierAndSuspendStable(); // fix for https://jira.jboss.org/jira/browse/JGRP-1013
      if(digest != null)
        down_prot.down(new Event(Event.OVERWRITE_DIGEST, digest)); // set the digest (e.g. in NAKACK)
    }
    waiting_for_state_response=false;
    stop=System.currentTimeMillis();
    log.debug("%s: received state, size=%s, time=%d milliseconds", local_addr,
         (state == null? "0" : Util.printBytes(state.length)), stop - start);
    StateTransferResult result=new StateTransferResult(state);
    up_prot.up(new Event(Event.GET_STATE_OK, result));
    down_prot.down(new Event(Event.GET_VIEW_FROM_COORD)); // https://issues.jboss.org/browse/JGRP-1751
  }
  catch(Throwable t) {
    handleException(t);
  }
  finally {
    if(isDigestNeeded()) {
      closeHoleFor(sender);
      openBarrierAndResumeStable();
    }
  }
}
origin: org.jboss.eap/wildfly-client-all

protected void handleViewChange(View v) {
  Address       old_coord;
  List<Address> new_members=v.getMembers();
  boolean       send_up_exception=false;
  this.view=v;
  synchronized(members) {
    old_coord=(!members.isEmpty()? members.get(0) : null);
    members.clear();
    members.addAll(new_members);
    // this handles the case where a coord dies during a state transfer; prevents clients from hanging forever
    // Note this only takes a coordinator crash into account, a getState(target, timeout), where target is not
    // null is not handled ! (Usually we get the state from the coordinator)
    // http://jira.jboss.com/jira/browse/JGRP-148
    if(waiting_for_state_response && old_coord != null && !members.contains(old_coord))
      send_up_exception=true;
  }
  if(send_up_exception) {
    log.warn("%s: discovered that the state provider (%s) left", local_addr, old_coord);
    waiting_for_state_response=false;
    Exception ex=new EOFException("state provider " + old_coord + " left");
    up_prot.up(new Event(Event.GET_STATE_OK, new StateTransferResult(ex)));
    openBarrierAndResumeStable();
  }
  // remove non members from list of members requesting state
  state_requesters.retainAll(new_members);
}
origin: org.jboss.eap/wildfly-client-all

protected void handleException(Throwable exception) {
  if(isDigestNeeded())
    openBarrierAndResumeStable();
  up_prot.up(new Event(Event.GET_STATE_OK, new StateTransferResult(exception)));
}
origin: org.jboss.eap/wildfly-client-all

/** Set the digest and the send the state up to the application */
protected void handleStateRsp(final Digest digest, Address sender, byte[] state) {
  try {
    if(isDigestNeeded()) {
      punchHoleFor(sender);
      closeBarrierAndSuspendStable(); // fix for https://jira.jboss.org/jira/browse/JGRP-1013
      if(digest != null)
        down_prot.down(new Event(Event.OVERWRITE_DIGEST, digest)); // set the digest (e.g. in NAKACK)
    }
    waiting_for_state_response=false;
    stop=System.currentTimeMillis();
    log.debug("%s: received state, size=%s, time=%d milliseconds", local_addr,
         (state == null? "0" : Util.printBytes(state.length)), stop - start);
    StateTransferResult result=new StateTransferResult(state);
    up_prot.up(new Event(Event.GET_STATE_OK, result));
    down_prot.down(new Event(Event.GET_VIEW_FROM_COORD)); // https://issues.jboss.org/browse/JGRP-1751
  }
  catch(Throwable t) {
    handleException(t);
  }
  finally {
    if(isDigestNeeded()) {
      closeHoleFor(sender);
      openBarrierAndResumeStable();
    }
  }
}
org.jgroups.protocols.pbcastSTATE_TRANSFERopenBarrierAndResumeStable

Popular methods of STATE_TRANSFER

  • determineCoordinator
    Return the first element of members which is not me. Otherwise return null.
  • handleStateReq
    If a state transfer is in progress, we don't need to send a GET_APPLSTATE event to the application,
  • handleStateRsp
    Set the digest and the send the state up to the application
  • handleViewChange
  • isDigestNeeded
    When FLUSH is used we do not need to pass digests between members see JGroups/doc/design/PartialStat
  • closeBarrierAndSuspendStable
  • closeHoleFor
  • down
  • getId
  • getStateFromApplication
  • handleException
  • openBarrier
  • handleException,
  • openBarrier,
  • punchHoleFor,
  • resumeStable,
  • sendException,
  • getAverageStateSize,
  • getNumberOfStateBytesSent,
  • getNumberOfStateRequests,
  • requestApplicationStates

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • getApplicationContext (Context)
  • getResourceAsStream (ClassLoader)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Reference (javax.naming)
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for Android Studio
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