Package org.apache.blur.thirdparty.thrift_0_9_0.protocol

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


  private static class RowMutationTupleScheme extends TupleScheme<RowMutation> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, RowMutation struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTable()) {
        optionals.set(0);
      }
      if (struct.isSetRowId()) {
        optionals.set(1);
      }
      if (struct.isSetWal()) {
        optionals.set(2);
      }
      if (struct.isSetRowMutationType()) {
        optionals.set(3);
      }
      if (struct.isSetRecordMutations()) {
        optionals.set(4);
      }
      if (struct.isSetWaitToBeVisible()) {
        optionals.set(5);
      }
      oprot.writeBitSet(optionals, 6);
      if (struct.isSetTable()) {
        oprot.writeString(struct.table);
      }
      if (struct.isSetRowId()) {
        oprot.writeString(struct.rowId);
      }
      if (struct.isSetWal()) {
        oprot.writeBool(struct.wal);
      }
      if (struct.isSetRowMutationType()) {
        oprot.writeI32(struct.rowMutationType.getValue());
      }
      if (struct.isSetRecordMutations()) {
        {
          oprot.writeI32(struct.recordMutations.size());
          for (RecordMutation _iter88 : struct.recordMutations)
          {
            _iter88.write(oprot);
          }
        }
      }
      if (struct.isSetWaitToBeVisible()) {
        oprot.writeBool(struct.waitToBeVisible);
      }
    }
View Full Code Here


      }
    }

    @Override
    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, RowMutation struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(6);
      if (incoming.get(0)) {
        struct.table = iprot.readString();
        struct.setTableIsSet(true);
      }
      if (incoming.get(1)) {
        struct.rowId = iprot.readString();
        struct.setRowIdIsSet(true);
      }
      if (incoming.get(2)) {
        struct.wal = iprot.readBool();
        struct.setWalIsSet(true);
      }
      if (incoming.get(3)) {
        struct.rowMutationType = RowMutationType.findByValue(iprot.readI32());
        struct.setRowMutationTypeIsSet(true);
      }
      if (incoming.get(4)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list89 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRUCT, iprot.readI32());
          struct.recordMutations = new ArrayList<RecordMutation>(_list89.size);
          for (int _i90 = 0; _i90 < _list89.size; ++_i90)
          {
            RecordMutation _elem91; // required
            _elem91 = new RecordMutation();
            _elem91.read(iprot);
            struct.recordMutations.add(_elem91);
          }
        }
        struct.setRecordMutationsIsSet(true);
      }
      if (incoming.get(5)) {
        struct.waitToBeVisible = iprot.readBool();
        struct.setWaitToBeVisibleIsSet(true);
      }
    }
View Full Code Here

  private static class SchemaTupleScheme extends TupleScheme<Schema> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, Schema struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTable()) {
        optionals.set(0);
      }
      if (struct.isSetFamilies()) {
        optionals.set(1);
      }
      oprot.writeBitSet(optionals, 2);
      if (struct.isSetTable()) {
        oprot.writeString(struct.table);
      }
      if (struct.isSetFamilies()) {
        {
          oprot.writeI32(struct.families.size());
          for (Map.Entry<String, Map<String,ColumnDefinition>> _iter122 : struct.families.entrySet())
          {
            oprot.writeString(_iter122.getKey());
            {
              oprot.writeI32(_iter122.getValue().size());
              for (Map.Entry<String, ColumnDefinition> _iter123 : _iter122.getValue().entrySet())
              {
                oprot.writeString(_iter123.getKey());
                _iter123.getValue().write(oprot);
              }
            }
          }
        }
View Full Code Here

    shardServer.init();

    Iface iface = BlurUtil.recordMethodCallsAndAverageTimes(shardServer, Iface.class, false);
    if (httpServer != null) {
      WebAppContext context = httpServer.getContext();
      context.addServlet(new ServletHolder(new TServlet(new Blur.Processor<Blur.Iface>(iface),
          new TJSONProtocol.Factory())), "/blur");
      context.addServlet(new ServletHolder(new JSONReporterServlet()), "/livemetrics");
      if (enableJsonReporter) {
        JSONReporter.enable("json-reporter", 1, TimeUnit.SECONDS, 60);
      }
View Full Code Here

    socket.setTcpNoDelay(true);
    socket.setSoTimeout(timeout);
    socket.connect(new InetSocketAddress(host, port), timeout);
    trans = new TSocket(socket);

    TProtocol proto = new TBinaryProtocol(new TFramedTransport(trans));
    Client client = new Client(proto);
    return client;
  }
View Full Code Here

      buffer_ = ByteBuffer.allocate(4);

      frameTrans_ = new TMemoryInputTransport();
      response_ = new TByteArrayOutputStream();
      inTrans_ = inputTransportFactory_.getTransport(frameTrans_);
      outTrans_ = outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
      inProt_ = inputProtocolFactory_.getProtocol(inTrans_);
      outProt_ = outputProtocolFactory_.getProtocol(outTrans_);

      if (eventHandler_ != null) {
        context_ = eventHandler_.createContext(inProt_, outProt_, selectionKey);
View Full Code Here

    String tableDesStr = configuration.get(BLUR_TABLE_DESCRIPTOR);
    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);
    }
    transport.close();
    return descriptor;
  }
View Full Code Here

   *          the {@link TableDescriptor}.
   * @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);
    }
    transport.close();
    Configuration configuration = job.getConfiguration();
    configuration.set(BLUR_TABLE_DESCRIPTOR, new String(outputStream.toByteArray()));
    setOutputPath(job, new Path(tableDescriptor.getTableUri()));
  }
View Full Code Here

    /**
     * Get the transport that should be used by the invoker for responding.
     */
    private TTransport getOutputTransport() {
      response_ = new TByteArrayOutputStream();
      return outputTransportFactory_.getTransport(new TIOStreamTransport(response_));
    }
View Full Code Here

        }
      }
      InputStream in = request.getInputStream();
      OutputStream out = response.getOutputStream();

      TTransport transport = new TIOStreamTransport(in, out);
      inTransport = transport;
      outTransport = transport;

      TProtocol inProtocol = inProtocolFactory.getProtocol(inTransport);
      TProtocol outProtocol = outProtocolFactory.getProtocol(outTransport);
View Full Code Here

TOP

Related Classes of org.apache.blur.thirdparty.thrift_0_9_0.protocol.TJSONProtocol$LookaheadReader

Copyright © 2018 www.massapicom. 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.