Tabnine Logo
ThreadLocalDirectory.fetch
Code IndexAdd Tabnine to your IDE (free)

How to use
fetch
method
in
com.yahoo.concurrent.ThreadLocalDirectory

Best Java code snippets using com.yahoo.concurrent.ThreadLocalDirectory.fetch (Showing top 4 results out of 315)

origin: com.yahoo.vespa/simplemetrics

private Bucket updateBuffer() {
  List<Bucket> buckets = metricsCollection.fetch();
  final long toMillis = System.currentTimeMillis();
  final int bucketIndex = generation++ % buffer.length;
  Bucket bucketToDelete = buffer[bucketIndex];
  Bucket latest = new Bucket(fromMillis, toMillis);
  for (Bucket b : buckets) {
    latest.merge(b, true);
  }
  buffer[bucketIndex] = latest;
  this.fromMillis = toMillis;
  return bucketToDelete;
}
origin: com.yahoo.vespa/simplemetrics

/** gathers all data since last snapshot */
public Bucket getSnapshot() {
  final Bucket merged = new Bucket();
  for (Bucket b : collection.fetch()) {
    merged.merge(b, true);
  }
  return merged;
}
/** utility method for testing */
origin: com.yahoo.vespa/container-search

  @Override
  public void run(Handle h, boolean firstRun) {
    List<Deque<QueryRatePerSecond>> data = directory.fetch();
    List<QueryRatePerSecond> chewed = merge(data);
    for (QueryRatePerSecond qps : chewed) {
      qpsStatistics.put((double) qps.howMany);
    }
  }
}
origin: com.yahoo.vespa/container-search

@Override
public Result search(Query query, Execution execution) {
  Result r;
  long when = query.getStartTime() / 1000L;
  Hit meta = null;
  directory.update(when);
  if (useMetaHit) {
    if (query.properties().getBoolean(propertyName, false)) {
      List<QueryRatePerSecond> l = merge(directory.fetch());
      Tuple2<Integer, Double> maxAndMean = maxAndMean(l);
      meta = new QpsHit(maxAndMean.first, maxAndMean.second);
    }
  }
  r = execution.search(query);
  if (meta != null) {
    r.hits().add(meta);
  }
  return r;
}
com.yahoo.concurrentThreadLocalDirectoryfetch

Javadoc

Fetch the current set of sampled data, and reset state of all thread local instances. The producer threads will not alter data in the list returned from this method.

Popular methods of ThreadLocalDirectory

  • update
    Update a value with a given thread local instance. If a producer thread is to insert a series of dat
  • <init>
  • getOrCreateLocal
  • put

Popular in Java

  • Making http post requests using okhttp
  • runOnUiThread (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Option (scala)
  • Github Copilot alternatives
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