Codota Logo
SystemTimer.milliTime
Code IndexAdd Codota to your IDE (free)

How to use
milliTime
method
in
com.yahoo.concurrent.SystemTimer

Best Java code snippets using com.yahoo.concurrent.SystemTimer.milliTime (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: com.yahoo.vespa/messagebus

/**
 * Constructs a new instance of this class to maintain sending of a single message.
 *
 * @param mbus     The message bus that owns this.
 * @param net      The network layer to transmit through.
 * @param resender The resender to use.
 */
public SendProxy(MessageBus mbus, Network net, Resender resender) {
  this.mbus = mbus;
  this.net = net;
  this.resender = resender;
  sendTime = SystemTimer.INSTANCE.milliTime();
}
origin: com.yahoo.vespa/messagebus

/**
 * <p>Returns the number of milliseconds that remain right now before this message times out. This is a function of
 * {@link #getTimeReceived()}, {@link #getTimeRemaining()} and current time. Whenever a message is transmitted by
 * message bus, a new remaining time is calculated and serialized as <code>timeRemaining = timeRemaining -
 * (currentTime - timeReceived)</code>. This means that we are doing an over-estimate of remaining time, as we are
 * only factoring in the time used by the application above message bus.</p>
 *
 * @return The remaining time in milliseconds.
 */
public long getTimeRemainingNow() {
  return timeRemaining - (SystemTimer.INSTANCE.milliTime() - timeReceived);
}
origin: com.yahoo.vespa/messagebus

public void register(SendBlockedMessages sender) {
  blockedSenders.put(sender, SystemTimer.INSTANCE.milliTime());
}
origin: com.yahoo.vespa/messagebus

/**
 * <p>This is a convenience method to call {@link #setTimeReceived(long)} passing the current time as argument.</p>
 *
 * @return This, to allow chaining.
 */
public Message setTimeReceivedNow() {
  return setTimeReceived(SystemTimer.INSTANCE.milliTime());
}
origin: com.yahoo.vespa/messagebus

/**
 * Invokes {@link RoutingNode#send()} on all routing nodes that are applicable for sending at the current time.
 */
public void resendScheduled() {
  if (queue.isEmpty()) return;
  List<RoutingNode> sendList = new LinkedList<RoutingNode>();
  long now = SystemTimer.INSTANCE.milliTime();
  while (!queue.isEmpty() && queue.peek().time <= now) {
    sendList.add(queue.poll().node);
  }
  for (RoutingNode node : sendList) {
    node.getTrace().trace(TraceLevel.COMPONENT, "Resender resending message.");
    node.send();
  }
}
origin: com.yahoo.vespa/docproc

/**
 * Call the DocumentProcessor of this call.
 *
 * @param processing the Processing object to use
 * @return the progress of the DocumentProcessor that was called
 */
public DocumentProcessor.Progress call(Processing processing) {
  try {
    int numDocs = processing.getDocumentOperations().size();
    schemaMapProcessing(processing);
    long startTime = SystemTimer.INSTANCE.milliTime();
    DocumentProcessor.Progress retval = processor.process(processing);
    incrementProcTime(SystemTimer.INSTANCE.milliTime() - startTime);
    incrementDocs(numDocs);
    return retval;
  } finally {
    unwrapSchemaMapping(processing);
  }
}
origin: com.yahoo.vespa/container-search

long startTime = SystemTimer.INSTANCE.milliTime();
long timeLeft  = timeout;
    timeLeft = timeout - (SystemTimer.INSTANCE.milliTime() - startTime);
origin: com.yahoo.vespa/messagebus

/**
 * Schedules the given node for resending, if enabled. This will invoke {@link com.yahoo.messagebus.routing.RoutingNode#prepareForRetry()}
 * if the node was queued. This method is NOT thread-safe, and should only be called by the messenger thread.
 *
 * @param node  The node to resend.
 * @return True if the node was queued.
 */
public boolean scheduleRetry(RoutingNode node) {
  Message msg = node.getMessage();
  if (!msg.getRetryEnabled()) {
    return false;
  }
  int retry = msg.getRetry() + 1;
  double delay = node.getReply().getRetryDelay();
  if (delay < 0) {
    delay = retryPolicy.getRetryDelay(retry);
  }
  if (msg.getTimeRemainingNow() * 0.001 - delay <= 0) {
    node.addError(ErrorCode.TIMEOUT, "Timeout exceeded by resender, giving up.");
    return false;
  }
  node.prepareForRetry(); // consumes the reply
  node.getTrace().trace(TraceLevel.COMPONENT,
             "Message scheduled for retry " + retry + " in " + delay + " seconds.");
  msg.setRetry(retry);
  queue.add(new Entry(node, SystemTimer.INSTANCE.milliTime() + (long)(delay * 1000)));
  return true;
}
com.yahoo.concurrentSystemTimermilliTime

Popular methods of SystemTimer

    Popular in Java

    • Running tasks concurrently on multiple threads
    • scheduleAtFixedRate (ScheduledExecutorService)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • notifyDataSetChanged (ArrayAdapter)
    • GridLayout (java.awt)
      The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
    • FileReader (java.io)
      A specialized Reader that reads from a file in the file system. All read requests made by calling me
    • Executors (java.util.concurrent)
      Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
    • TimeUnit (java.util.concurrent)
      A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
    • JComboBox (javax.swing)
    • Response (javax.ws.rs.core)
      Defines the contract between a returned instance and the runtime when an application needs to provid
    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