Examples of TJSONProtocol


Examples of com.facebook.presto.hive.shaded.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 com.facebook.presto.hive.shaded.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 com.facebook.thrift.protocol.TJSONProtocol

      b.type = 5;
      b.message = "nevermore";
      hm.bonks.put("poe", stage2);

      TMemoryBuffer buffer = new TMemoryBuffer(1024);
      TJSONProtocol proto = new TJSONProtocol(buffer);

      System.out.println("Writing ooe");
      ooe.write(proto);
      System.out.println("Reading ooe");
      OneOfEach ooe2 = new OneOfEach();
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

   * @throws IOException
   */
  public static void setTableDescriptor(Job job, 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

      }

      @SuppressWarnings("rawtypes")
      private String getArgsStr(TBase o, LoggerArgsState loggerArgsState) {
        ResetableTMemoryBuffer buffer = loggerArgsState._buffer;
        TJSONProtocol tjsonProtocol = loggerArgsState._tjsonProtocol;
        buffer.resetBuffer();
        tjsonProtocol.reset();
        try {
          o.write(tjsonProtocol);
        } catch (TException e) {
          LOG.error("Unknown error tyring to write object [{0}] to json.", e, o);
        }
View Full Code Here

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

  public static final Term PRIME_DOC_TERM = new Term(BlurConstants.PRIME_DOC, BlurConstants.PRIME_DOC_VALUE);

  static class LoggerArgsState {
    public LoggerArgsState(int 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

  }

  @SuppressWarnings("rawtypes")
  public static String getArgsStr(TBase o, LoggerArgsState loggerArgsState) {
    ResetableTMemoryBuffer buffer = loggerArgsState._buffer;
    TJSONProtocol tjsonProtocol = loggerArgsState._tjsonProtocol;
    buffer.resetBuffer();
    tjsonProtocol.reset();
    try {
      o.write(tjsonProtocol);
    } catch (TException e) {
      LOG.error("Unknown error tyring to write object [{0}] to json.", e, o);
    }
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.