Examples of TJSONProtocol


Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

  public static byte[] read(TBase<?, ?> base) {
    if (base == null) {
      return null;
    }
    TMemoryBuffer trans = new TMemoryBuffer(1024);
    TJSONProtocol protocol = new TJSONProtocol(trans);
    try {
      base.write(protocol);
    } catch (TException e) {
      throw new RuntimeException(e);
    }
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

  }

  public static void write(byte[] data, TBase<?, ?> base) {
    nullCheck(null, "Data cannot be null.");
    TMemoryBuffer trans = new TMemoryBuffer(1024);
    TJSONProtocol protocol = new TJSONProtocol(trans);
    try {
      trans.write(data);
      base.read(protocol);
    } catch (TException e) {
      throw new RuntimeException(e);
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

    if (tableDesStr == null) {
      return null;
    }
    ByteArrayInputStream inputStream = new ByteArrayInputStream(tableDesStr.getBytes());
    TIOStreamTransport transport = new TIOStreamTransport(inputStream);
    TJSONProtocol protocol = new TJSONProtocol(transport);
    TableDescriptor descriptor = new TableDescriptor();
    try {
      descriptor.read(protocol);
    } catch (TException e) {
      throw new IOException(e);
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

   */
  public static void setTableDescriptor(Configuration configuration, TableDescriptor tableDescriptor)
      throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    TIOStreamTransport transport = new TIOStreamTransport(outputStream);
    TJSONProtocol protocol = new TJSONProtocol(transport);
    try {
      tableDescriptor.write(protocol);
    } catch (TException e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

    if (tableDesStr == null) {
      return null;
    }
    ByteArrayInputStream inputStream = new ByteArrayInputStream(tableDesStr.getBytes());
    TIOStreamTransport transport = new TIOStreamTransport(inputStream);
    TJSONProtocol protocol = new TJSONProtocol(transport);
    TableDescriptor descriptor = new TableDescriptor();
    try {
      descriptor.read(protocol);
    } catch (TException e) {
      throw new IOException(e);
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

   */
  public static void setTableDescriptor(Configuration configuration, TableDescriptor tableDescriptor)
      throws IOException {
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    TIOStreamTransport transport = new TIOStreamTransport(outputStream);
    TJSONProtocol protocol = new TJSONProtocol(transport);
    try {
      tableDescriptor.write(protocol);
    } catch (TException e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

    final int _size;

    LoggerArgsState(int size) {
      _size = size;
      _buffer = new ResetableTMemoryBuffer(_size);
      _tjsonProtocol = new TJSONProtocol(_buffer);
    }
View Full Code Here

Examples of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol

    }

    void reset() {
      if (_buffer.getArray().length >= MAX_BUFFER_SIZE) {
        _buffer = new ResetableTMemoryBuffer(_size);
        _tjsonProtocol = new TJSONProtocol(_buffer);
      }
      if (_builder.length() >= MAX_BUILDER_SIZE) {
        _builder = new StringBuilder();
      }
    }
View Full Code Here

Examples of org.apache.thrift.protocol.TJSONProtocol

  }

  public String toThriftJSONString() throws IOException {
    org.apache.hadoop.hive.ql.plan.api.Query q = getQueryPlan();
    TMemoryBuffer tmb = new TMemoryBuffer(q.toString().length() * 5);
    TJSONProtocol oprot = new TJSONProtocol(tmb);
    try {
      q.write(oprot);
    } catch (TException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of org.apache.thrift.protocol.TJSONProtocol

    protected TProtocol createThriftProtocol(TTransport transport) {
        switch(this.protocol) {
            case BINARY:
                return new TBinaryProtocol(transport);
            case JSON:
                return new TJSONProtocol(transport);
            case SIMPLE_JSON:
                return new TSimpleJSONProtocol(transport);
            default:
                throw new IllegalArgumentException("Unknown Thrift Protocol.");
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.