Codota Logo
Common$WireMessage.newBuilder
Code IndexAdd Codota to your IDE (free)

How to use
newBuilder
method
in
org.apache.calcite.avatica.proto.Common$WireMessage

Best Java code snippets using org.apache.calcite.avatica.proto.Common$WireMessage.newBuilder (Showing top 8 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: org.apache.calcite/calcite-avatica

void serializeMessage(OutputStream out, Message msg) throws IOException {
 ByteArrayOutputStream baos = new ByteArrayOutputStream();
 msg.writeTo(baos);
 // TODO Using ByteString is copying the bytes of the message which sucks. Could try to
 // lift the ZeroCopy implementation from HBase.
 WireMessage wireMsg = WireMessage.newBuilder().setName(msg.getClass().getName()).
   setWrappedMessage(ByteString.copyFrom(baos.toByteArray())).build();
 wireMsg.writeTo(out);
}
origin: org.apache.calcite.avatica/avatica-core

void serializeMessage(OutputStream out, Message msg) throws IOException {
 // Serialize the protobuf message
 UnsynchronizedBuffer buffer = threadLocalBuffer.get();
 ByteString serializedMsg;
 try {
  msg.writeTo(buffer);
  // Make a bytestring from it
  serializedMsg = UnsafeByteOperations.unsafeWrap(buffer.toArray());
 } finally {
  buffer.reset();
 }
 // Wrap the serialized message in a WireMessage
 WireMessage wireMsg = WireMessage.newBuilder().setNameBytes(getClassNameBytes(msg.getClass()))
   .setWrappedMessage(serializedMsg).build();
 // Write the WireMessage to the provided OutputStream
 wireMsg.writeTo(out);
}
origin: apache/calcite-avatica

void serializeMessage(OutputStream out, Message msg) throws IOException {
 // Serialize the protobuf message
 UnsynchronizedBuffer buffer = threadLocalBuffer.get();
 ByteString serializedMsg;
 try {
  msg.writeTo(buffer);
  // Make a bytestring from it
  serializedMsg = UnsafeByteOperations.unsafeWrap(buffer.toArray());
 } finally {
  buffer.reset();
 }
 // Wrap the serialized message in a WireMessage
 WireMessage wireMsg = WireMessage.newBuilder().setNameBytes(getClassNameBytes(msg.getClass()))
   .setWrappedMessage(serializedMsg).build();
 // Write the WireMessage to the provided OutputStream
 wireMsg.writeTo(out);
}
origin: apache/calcite-avatica

@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
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.avatica/avatica-core

@java.lang.Override
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
origin: org.apache.calcite/calcite-avatica

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
org.apache.calcite.avatica.protoCommon$WireMessagenewBuilder

Popular methods of Common$WireMessage

  • writeTo
  • <init>
  • getDefaultInstance
  • getName
    string name = 1;
  • getNameBytes
    optional string name = 1;
  • getWrappedMessage
    optional bytes wrapped_message = 2;
  • isInitialized
  • makeExtensionsImmutable
  • parseFrom
  • toBuilder
  • getDescriptor
  • parseUnknownFieldProto3
  • getDescriptor,
  • parseUnknownFieldProto3

Popular in Java

  • Making http requests using okhttp
  • onRequestPermissionsResult (Fragment)
  • setContentView (Activity)
  • runOnUiThread (Activity)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • ImageIO (javax.imageio)
  • JOptionPane (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now