Tabnine Logo
Promise.reset
Code IndexAdd Tabnine to your IDE (free)

How to use
reset
method
in
org.jgroups.util.Promise

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

origin: wildfly/wildfly

/**
 * Causes all waiting threads to return
 */
public void reset() {
  reset(true);
}
origin: wildfly/wildfly

public synchronized AckCollector reset(Collection<Address> expected_acks, Address ... exclude) {
  suspected_mbrs.clear();
  missing_acks.clear();
  addAll(expected_acks, exclude);
  all_acks_received.reset();
  return this;
}
origin: wildfly/wildfly

public synchronized void reset(Collection<Address> members) {
  suspected_mbrs.clear();
  missing_acks.clear();
  addAll(members);
  all_acks_received.reset();
}
origin: wildfly/wildfly

public synchronized AckCollector reset(Collection<Address> expected_acks, Collection<Address> exclude) {
  suspected_mbrs.clear();
  missing_acks.clear();
  addAll(expected_acks, exclude);
  all_acks_received.reset();
  return this;
}
origin: wildfly/wildfly

public void init() throws Exception {
  super.init();
  leave_promise.reset();
}
origin: wildfly/wildfly

public void init() throws Exception {
  super.init();
  join_promise.reset();
}
origin: wildfly/wildfly

public T getResultWithTimeout(long timeout, boolean reset) throws TimeoutException {
  if(!reset)
    return _getResultWithTimeout(timeout);
  // the lock is acquired because we want to get the result and reset the promise in the same lock scope; if we had
  // to re-acquire the lock for reset(), some other thread could possibly set a new result before reset() is called !
  lock.lock();
  try {
    return _getResultWithTimeout(timeout);
  }
  finally {
    reset();
    lock.unlock();
  }
}
origin: wildfly/wildfly

private void waitForUnblock() {
  try {
    flush_unblock_promise.reset();
    flush_unblock_promise.getResultWithTimeout(end_flush_timeout);
  } catch (TimeoutException t) {
    if (log.isWarnEnabled())
      log.warn(localAddress + ": waiting for UNBLOCK timed out after " + end_flush_timeout + " ms");
  }
}
origin: wildfly/wildfly

forward_table.put(seqno, msg);
while(running && !flushing) {
  ack_promise.reset();
  forward(msg, seqno, true);
  if(!ack_mode || !running || flushing)
origin: wildfly/wildfly

private void startFlush(List<Address> flushParticipants) {
  if (!flushInProgress.get()) {
    flush_promise.reset();
    synchronized(sharedLock) {
      if(flushParticipants == null)
origin: wildfly/wildfly

/**
 * Sends a leave request to coord and blocks until a leave response has been received, or the leave timeout has elapsed
 */
protected void sendLeaveReqTo(Address coord) {
  leave_promise.reset();
  leaving=true;
  log.trace("%s: sending LEAVE request to %s", gms.local_addr, coord);
  long start=System.currentTimeMillis();
  sendLeaveMessage(coord, gms.local_addr);
  Boolean result=leave_promise.getResult(gms.leave_timeout);
  long time=System.currentTimeMillis()-start;
  if(result != null)
    log.trace("%s: got LEAVE response from %s in %d ms", gms.local_addr, coord, time);
  else
    log.trace("%s: timed out waiting for LEAVE response from %s (after %d ms)", gms.local_addr, coord, time);
}
origin: wildfly/wildfly

  System.out.printf(".");
promise.reset(false);
byte[] req_buf=new byte[PAYLOAD];
req_buf[0]=REQ;
origin: wildfly/wildfly

state_promise.reset();
StateTransferInfo state_info=new StateTransferInfo(target, timeout);
long start=System.currentTimeMillis();
origin: wildfly/wildfly

if(log.isTraceEnabled())
  log.trace(local_addr + ": flushing (forwarding) " + "::" + key + " to target " + target);
ack_promise.reset();
down_prot.down(forward_msg);
Long ack=ack_promise.getResult(500);
origin: wildfly/wildfly

flush_promise.reset();
ArrayList<Address> flushParticipants = null;
synchronized (sharedLock) {
origin: wildfly/wildfly

/**
 Attempts to obtain the ping_addr first from the cache, then by unicasting q request to {@code mbr},
 then by multicasting a request to all members.
 */
protected IpAddress fetchPingAddress(final Address mbr) {
  IpAddress ret;
  if(mbr == null)
    return null;
  // 1. Try to get the server socket address from the cache
  if((ret=cache.get(mbr)) != null)
    return ret;
  if(!isPingerThreadRunning()) return null;
  // 2. Try to get the server socket address from mbr (or all, as fallback)
  ping_addr_promise.reset();
  for(Address dest: Arrays.asList(mbr, null)) {
    Message msg=new Message(dest).setFlag(Message.Flag.INTERNAL)
     .putHeader(this.id, new FdHeader(FdHeader.WHO_HAS_SOCK, mbr));
    down_prot.down(msg);
    if((ret=ping_addr_promise.getResult(500)) != null)
      return ret;
    if(!isPingerThreadRunning()) return null;
  }
  return null;
}
origin: wildfly/wildfly

/**
 * Determines coordinator C. If C is null and we are the first member, return. Else loop: send GET_CACHE message
 * to coordinator and wait for GET_CACHE_RSP response. Loop until valid response has been received.
 */
protected void getCacheFromCoordinator() {
  Address coord;
  int attempts=num_tries;
  get_cache_promise.reset();
  while(attempts > 0 && isPingerThreadRunning()) {
    if((coord=determineCoordinator()) != null) {
      if(coord.equals(local_addr)) { // we are the first member --> empty cache
        return;
      }
      Message msg=new Message(coord).setFlag(Message.Flag.INTERNAL)
       .putHeader(this.id, new FdHeader(FdHeader.GET_CACHE));
      down_prot.down(msg);
      Map<Address,IpAddress> result=get_cache_promise.getResult(get_cache_timeout);
      if(result != null) {
        cache.addAll(result);
        log.trace("%s: got cache from %s: cache is %s", local_addr, coord, cache);
        return;
      }
    }
    --attempts;
  }
}
origin: wildfly/wildfly

if(log.isTraceEnabled())
  log.trace(local_addr + ": flushing (forwarding) " + local_addr + "::" + key + " to coord " + coord);
ack_promise.reset();
down_prot.down(forward_msg);
Long ack=ack_promise.getResult(500);
origin: wildfly/wildfly

long  join_attempts=0;
leaving=false;
join_promise.reset();
origin: org.jboss.eap/wildfly-client-all

public synchronized AckCollector reset(Collection<Address> expected_acks, Address ... exclude) {
  suspected_mbrs.clear();
  missing_acks.clear();
  addAll(expected_acks, exclude);
  all_acks_received.reset();
  return this;
}
org.jgroups.utilPromisereset

Javadoc

Causes all waiting threads to return

Popular methods of Promise

  • _getResultWithTimeout
    Blocks until a result is available, or timeout milliseconds have elapsed. Needs to be called with a
  • getResult
  • getResultWithTimeout
  • hasResult
    Checks whether result is available. Does not block.
  • setResult
    Sets the result and notifies any threads waiting for it
  • <init>
  • doWait

Popular in Java

  • Making http requests using okhttp
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JButton (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • 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