congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RequestLog.getId
Code IndexAdd Tabnine to your IDE (free)

How to use
getId
method
in
com.yahoo.bard.webservice.logging.RequestLog

Best Java code snippets using com.yahoo.bard.webservice.logging.RequestLog.getId (Showing top 6 results out of 315)

origin: yahoo/fili

  @Override
  public void filter(ContainerRequestContext request, ContainerResponseContext response) throws IOException {
    response.getHeaders().putSingle(X_REQUEST_ID, RequestLog.getId());
  }
}
origin: yahoo/fili

/**
 * Prepend an id prefix to generated druid query id.
 *
 * @param idPrefix  Prefix for queryId sent to druid
 */
public static void addIdPrefix(String idPrefix) {
  RequestLog current = RLOG.get();
  String newId = idPrefix + getId();
  current.info = current.info.withUuid(newId);
  current.logId = newId;
  MDC.put(ID_KEY, newId);
}
origin: yahoo/fili

  /**
   * Gathers some interesting data from the request and builds a string out of it.
   *
   * @param requestContext The request context. Contains info we want to log
   * @return the StringBuilder containing our logging info
   */
  protected StringBuilder builderErrorResponseBody(ContainerRequestContext requestContext) {
    StringBuilder debugMsgBuilder = new StringBuilder();
    if (requestContext.getSecurityContext().getUserPrincipal() != null) {
      String user = requestContext.getSecurityContext().getUserPrincipal().getName();
      debugMsgBuilder.append("User=")
          .append(user)
          .append(System.lineSeparator());
    }
    debugMsgBuilder.append("Timestamp: ")
        .append(java.time.Clock.systemUTC().instant().toString())
        .append(System.lineSeparator());

    debugMsgBuilder.append("Request ID: ")
        .append(RequestLog.getId())
        .append(System.lineSeparator());

    return debugMsgBuilder;
  }
}
origin: yahoo/fili

/**
 * Constructor.
 *
 * @param queryType  The type of this query
 * @param dataSource  The datasource
 * @param context  The context
 * @param incrementQueryId  true to fork a new context and bump up the query id, or false to create an exact copy
 * of the context.
 */
protected AbstractDruidQuery(
    QueryType queryType,
    DataSource dataSource,
    QueryContext context,
    boolean incrementQueryId
) {
  this.queryType = queryType;
  this.dataSource = dataSource;
  this.context = context == null ?
      new QueryContext(Collections.<QueryContext.Param, Object>emptyMap(), null)
          .withQueryId(RequestLog.getId()) :
      incrementQueryId ? context.fork() : context;
}
origin: yahoo/fili

responseMap.put("description", description);
responseMap.put("druidQuery", druidQuery);
responseMap.put("requestId", RequestLog.getId());
origin: yahoo/fili

LOG.debug("Cache entry present but invalid for query with id: {}", RequestLog.getId());
CACHE_POTENTIAL_HITS.mark(1);
CACHE_MISSES.mark(1);
com.yahoo.bard.webservice.loggingRequestLoggetId

Javadoc

Returns the id of this request log as a string. If called on an empty request log context, it initializes it.

Popular methods of RequestLog

  • dump
  • restore
  • copy
    Exports a snapshot of the request log of the current thread without resetting the request log for th
  • log
  • startTiming
  • stopTiming
  • <init>
    Copy constructor is also private.
  • accumulate
    Accumulates timings and threads to current thread's request log context. It fills in the contents fo
  • addIdPrefix
    Prepend an id prefix to generated druid query id.
  • aggregateDurations
    Adds the durations in milliseconds of all the recorded timed phases to a map.
  • clear
    Resets the contents of a request log at the calling thread.
  • durations
    Adds the durations in milliseconds of all the recorded timed phases to a map.
  • clear,
  • durations,
  • export,
  • getLoginfoOrder,
  • init,
  • isRunning,
  • record,
  • registerTime,
  • retrieve

Popular in Java

  • Making http requests using okhttp
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • setScale (BigDecimal)
  • putExtra (Intent)
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Top PhpStorm plugins
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