Tabnine Logo
SuccessCallback
Code IndexAdd Tabnine to your IDE (free)

How to use
SuccessCallback
in
com.yahoo.bard.webservice.druid.client

Best Java code snippets using com.yahoo.bard.webservice.druid.client.SuccessCallback (Showing top 6 results out of 315)

origin: yahoo/fili

@Override
public Future<JsonNode> executeQuery(
    DruidQuery<?> druidQuery,
    SuccessCallback successCallback,
    FailureCallback failureCallback
) {
  RequestLog logCtx = RequestLog.dump();
  //todo eventually stop/start RequestLog phases
  return CompletableFuture.supplyAsync(() -> {
        try {
          JsonNode jsonNode = executeAndProcessQuery((DruidAggregationQuery) druidQuery);
          if (successCallback != null) {
            successCallback.invoke(jsonNode);
          }
          return jsonNode;
        } catch (Throwable t) {
          LOG.warn("Failed while querying ", t);
          if (failureCallback != null) {
            failureCallback.dispatch(t);
          }
        } finally {
          RequestLog.restore(logCtx);
        }
        return null;
      }
  );
}
origin: yahoo/fili

@Override
public Response onCompleted(Response response) {
  String druidQueryId = response.getHeader("X-Druid-Query-Id");
  Status status = Status.fromStatusCode(response.getStatusCode());
  logRequest(logCtx, timerName, outstanding, druidQueryId, status);
  if (hasError(status)) {
    markError(status, response, druidQueryId, error);
  } else {
    try {
      success.invoke(jsonNodeBuilderStrategy.apply(response));
    } catch (RuntimeException e) {
      failure.invoke(e);
    }
  }
  // we consumed this response, so pass null to any chains
  return null;
}
origin: com.yahoo.fili/fili-core

  success.invoke(mapper.readTree(weightResponse));
} else if (statusCode == 200) {
  success.invoke(mapper.readTree(jsonResponse.call()));
} else {
  error.invoke(statusCode, reasonPhrase, jsonResponse.call());
origin: yahoo/fili

  success.invoke(mapper.readTree(jsonResponse.call()));
} else {
  error.invoke(statusCode, reasonPhrase, jsonResponse.call());
origin: yahoo/fili

  success.invoke(mapper.readTree(weightResponse));
} else if (statusCode == 200) {
  success.invoke(mapper.readTree(jsonResponse.call()));
} else {
  error.invoke(statusCode, reasonPhrase, jsonResponse.call());
origin: com.yahoo.fili/fili-core

  success.invoke(mapper.readTree(jsonResponse.call()));
} else {
  error.invoke(statusCode, reasonPhrase, jsonResponse.call());
com.yahoo.bard.webservice.druid.clientSuccessCallback

Javadoc

Callback from the async HTTP client on success.

Most used methods

  • invoke

Popular in Java

  • Start an intent from android
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • getApplicationContext (Context)
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JFrame (javax.swing)
  • Top plugins for WebStorm
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