congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
ProtobufTranslation.parseResponse
Code IndexAdd Tabnine to your IDE (free)

How to use
parseResponse
method
in
org.apache.calcite.avatica.remote.ProtobufTranslation

Best Java code snippets using org.apache.calcite.avatica.remote.ProtobufTranslation.parseResponse (Showing top 10 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: org.apache.calcite.avatica/avatica-core

 @Override public Response _apply(Request request) {
  final Response resp;
  byte[] response = null;
  try {
   response = client.send(translation.serializeRequest(request));
  } catch (IOException e) {
   LOG.debug("Failed to execute remote request: {}", request);
   // Failed to get a response from the server for the request.
   throw new RuntimeException(e);
  }

  try {
   resp = translation.parseResponse(response);
  } catch (IOException e) {
   LOG.debug("Failed to deserialize reponse to {}. '{}'", request,
     new String(response, StandardCharsets.UTF_8));
   // Not a protobuf that we could parse.
   throw new RuntimeException(e);
  }

  // The server had an error, throw an Exception for that.
  if (resp instanceof ErrorResponse) {
   throw ((ErrorResponse) resp).toException();
  }

  return resp;
 }
}
origin: apache/calcite-avatica

 @Override public Response _apply(Request request) {
  final Response resp;
  byte[] response = null;
  try {
   response = client.send(translation.serializeRequest(request));
  } catch (IOException e) {
   LOG.debug("Failed to execute remote request: {}", request);
   // Failed to get a response from the server for the request.
   throw new RuntimeException(e);
  }

  try {
   resp = translation.parseResponse(response);
  } catch (IOException e) {
   LOG.debug("Failed to deserialize reponse to {}. '{}'", request,
     new String(response, StandardCharsets.UTF_8));
   // Not a protobuf that we could parse.
   throw new RuntimeException(e);
  }

  // The server had an error, throw an Exception for that.
  if (resp instanceof ErrorResponse) {
   throw ((ErrorResponse) resp).toException();
  }

  return resp;
 }
}
origin: org.apache.calcite/calcite-avatica

 @Override public Response _apply(Request request) {
  final Response resp;
  try {
   byte[] response = client.send(translation.serializeRequest(request));
   resp = translation.parseResponse(response);
  } catch (IOException e) {
   // Not a protobuf that we could parse.
   throw new RuntimeException(e);
  }

  // The server had an error, throw an Exception for that.
  if (resp instanceof ErrorResponse) {
   throw ((ErrorResponse) resp).toException();
  }

  return resp;
 }
}
origin: org.apache.calcite.avatica/avatica-core

 public Response apply(Response response) throws IOException {
  // Serialize and then re-pare the response
  return translation.parseResponse(translation.serializeResponse(response));
 }
}
origin: org.apache.calcite/calcite-avatica

 public Response apply(Response response) throws IOException {
  // Serialize and then re-pare the response
  return translation.parseResponse(translation.serializeResponse(response));
 }
}
origin: apache/calcite-avatica

 public Response apply(Response response) throws IOException {
  // Serialize and then re-pare the response
  return translation.parseResponse(translation.serializeResponse(response));
 }
}
origin: org.apache.calcite.avatica/avatica-core

 @Override public Response _apply(Request request) {
  try {
   // Serialize the request to "send to the server"
   byte[] serializedRequest = translation.serializeRequest(request);

   // *some transport would normally happen here*

   // Fake deserializing that request somewhere else
   Request request2 = translation.parseRequest(serializedRequest);

   // Serialize the response from the service to "send to the client"
   byte[] serializedResponse = translation.serializeResponse(request2.accept(service));

   // *some transport would normally happen here*

   // Deserialize the response on "the client"
   return translation.parseResponse(serializedResponse);
  } catch (IOException e) {
   throw new RuntimeException(e);
  }
 }
}
origin: com.aliyun.phoenix/ali-phoenix-queryserver-client

  resp = translation.parseResponse(response);
} catch (IOException e) {
  LOG.warn("Failed to deserialize reponse to {}. '{}'", request,
origin: apache/calcite-avatica

 @Override public Response _apply(Request request) {
  try {
   // Serialize the request to "send to the server"
   byte[] serializedRequest = translation.serializeRequest(request);

   // *some transport would normally happen here*

   // Fake deserializing that request somewhere else
   Request request2 = translation.parseRequest(serializedRequest);

   // Serialize the response from the service to "send to the client"
   byte[] serializedResponse = translation.serializeResponse(request2.accept(service));

   // *some transport would normally happen here*

   // Deserialize the response on "the client"
   return translation.parseResponse(serializedResponse);
  } catch (IOException e) {
   throw new RuntimeException(e);
  }
 }
}
origin: org.apache.calcite/calcite-avatica

 @Override public Response _apply(Request request) {
  try {
   // Serialize the request to "send to the server"
   byte[] serializedRequest = translation.serializeRequest(request);

   // *some transport would normally happen here*

   // Fake deserializing that request somewhere else
   Request request2 = translation.parseRequest(serializedRequest);

   // Serialize the response from the service to "send to the client"
   byte[] serializedResponse = translation.serializeResponse(request2.accept(service));

   // *some transport would normally happen here*

   // Deserialize the response on "the client"
   return translation.parseResponse(serializedResponse);
  } catch (IOException e) {
   throw new RuntimeException(e);
  }
 }
}
org.apache.calcite.avatica.remoteProtobufTranslationparseResponse

Javadoc

Parses a serialized protocol buffer response into a Response.

Popular methods of ProtobufTranslation

  • serializeRequest
    Serializes a Request as a protocol buffer.
  • parseRequest
    Parses a serialized protocol buffer request into a Request.
  • serializeResponse
    Serializes a Response as a protocol buffer.

Popular in Java

  • Running tasks concurrently on multiple threads
  • getApplicationContext (Context)
  • getSystemService (Context)
  • setScale (BigDecimal)
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Runner (org.openjdk.jmh.runner)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now