Tabnine Logo
ProtobufTranslation.parseRequest
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.apache.calcite/calcite-avatica

@Override Service.Request decode(byte[] serializedRequest) throws IOException {
 return translation.parseRequest(serializedRequest);
}
origin: org.apache.calcite.avatica/avatica-core

@Override Service.Request decode(byte[] serializedRequest) throws IOException {
 try (final Context ctx = serializationTimer.start()) {
  return translation.parseRequest(serializedRequest);
 }
}
origin: apache/calcite-avatica

@Override Service.Request decode(byte[] serializedRequest) throws IOException {
 try (final Context ctx = serializationTimer.start()) {
  return translation.parseRequest(serializedRequest);
 }
}
origin: org.apache.calcite.avatica/avatica-core

 public Request apply(Request request) throws IOException {
  // Serialize and then re-parse the request
  return translation.parseRequest(translation.serializeRequest(request));
 }
}
origin: apache/calcite-avatica

 public Request apply(Request request) throws IOException {
  // Serialize and then re-parse the request
  return translation.parseRequest(translation.serializeRequest(request));
 }
}
origin: org.apache.calcite/calcite-avatica

 public Request apply(Request request) throws IOException {
  // Serialize and then re-parse the request
  return translation.parseRequest(translation.serializeRequest(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.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: 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);
  }
 }
}
origin: org.apache.calcite.avatica/avatica-core

@Test public void testExecuteSerialization() throws Exception {
 Service.ExecuteRequest executeRequest = new Service.ExecuteRequest(
   new StatementHandle("connection", 12345, getSignature()), getTypedValues(), 0);
 Requests.ExecuteRequest pbExecuteRequest = executeRequest.serialize();
 ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
 pbExecuteRequest.writeTo(baos);
 byte[] serialized = baos.toByteArray();
 baos.reset();
 WireMessage wireMsg = WireMessage.newBuilder().setName(Requests.ExecuteRequest.class.getName())
   .setWrappedMessage(UnsafeByteOperations.unsafeWrap(serialized)).build();
 wireMsg.writeTo(baos);
 serialized = baos.toByteArray();
 ProtobufTranslation translator = new ProtobufTranslationImpl();
 Request newRequest = translator.parseRequest(serialized);
 Assert.assertEquals(executeRequest, newRequest);
}
origin: apache/calcite-avatica

@Test public void testExecuteSerialization() throws Exception {
 Service.ExecuteRequest executeRequest = new Service.ExecuteRequest(
   new StatementHandle("connection", 12345, getSignature()), getTypedValues(), 0);
 Requests.ExecuteRequest pbExecuteRequest = executeRequest.serialize();
 ByteArrayOutputStream baos = new ByteArrayOutputStream(1024);
 pbExecuteRequest.writeTo(baos);
 byte[] serialized = baos.toByteArray();
 baos.reset();
 WireMessage wireMsg = WireMessage.newBuilder().setName(Requests.ExecuteRequest.class.getName())
   .setWrappedMessage(UnsafeByteOperations.unsafeWrap(serialized)).build();
 wireMsg.writeTo(baos);
 serialized = baos.toByteArray();
 ProtobufTranslation translator = new ProtobufTranslationImpl();
 Request newRequest = translator.parseRequest(serialized);
 Assert.assertEquals(executeRequest, newRequest);
}
origin: org.apache.calcite/calcite-avatica

FetchResponse response = new FetchResponse(frame, false, false, metadata);
when(translation.parseRequest(serializedRequest)).thenReturn(request);
when(service.apply(request)).thenReturn(response);
when(translation.serializeResponse(response))
origin: org.apache.calcite.avatica/avatica-core

FetchResponse response = new FetchResponse(frame, false, false, metadata);
when(translation.parseRequest(serializedRequest)).thenReturn(request);
when(service.apply(request)).thenReturn(response);
when(translation.serializeResponse(response))
origin: apache/calcite-avatica

FetchResponse response = new FetchResponse(frame, false, false, metadata);
when(translation.parseRequest(serializedRequest)).thenReturn(request);
when(service.apply(request)).thenReturn(response);
when(translation.serializeResponse(response))
org.apache.calcite.avatica.remoteProtobufTranslationparseRequest

Javadoc

Parses a serialized protocol buffer request into a Request.

Popular methods of ProtobufTranslation

  • parseResponse
    Parses a serialized protocol buffer response into a Response.
  • serializeRequest
    Serializes a Request as a protocol buffer.
  • serializeResponse
    Serializes a Response as a protocol buffer.

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • setContentView (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Option (scala)
  • Top plugins for Android Studio
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