Package org.apache.blur.thirdparty.thrift_0_9_0.transport

Examples of org.apache.blur.thirdparty.thrift_0_9_0.transport.TTransport


      }
    }

    @Override
    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, FetchResult struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(5);
      if (incoming.get(0)) {
        struct.exists = iprot.readBool();
        struct.setExistsIsSet(true);
      }
      if (incoming.get(1)) {
        struct.deleted = iprot.readBool();
        struct.setDeletedIsSet(true);
      }
      if (incoming.get(2)) {
        struct.table = iprot.readString();
        struct.setTableIsSet(true);
      }
      if (incoming.get(3)) {
        struct.rowResult = new FetchRowResult();
        struct.rowResult.read(iprot);
View Full Code Here


  private static class TableStatsTupleScheme extends TupleScheme<TableStats> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, TableStats struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetTableName()) {
        optionals.set(0);
      }
      if (struct.isSetBytes()) {
        optionals.set(1);
      }
      if (struct.isSetRecordCount()) {
        optionals.set(2);
      }
      if (struct.isSetRowCount()) {
        optionals.set(3);
      }
      oprot.writeBitSet(optionals, 4);
      if (struct.isSetTableName()) {
        oprot.writeString(struct.tableName);
      }
      if (struct.isSetBytes()) {
        oprot.writeI64(struct.bytes);
      }
      if (struct.isSetRecordCount()) {
        oprot.writeI64(struct.recordCount);
      }
      if (struct.isSetRowCount()) {
        oprot.writeI64(struct.rowCount);
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, TableStats struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(4);
      if (incoming.get(0)) {
        struct.tableName = iprot.readString();
        struct.setTableNameIsSet(true);
      }
      if (incoming.get(1)) {
        struct.bytes = iprot.readI64();
        struct.setBytesIsSet(true);
      }
      if (incoming.get(2)) {
        struct.recordCount = iprot.readI64();
        struct.setRecordCountIsSet(true);
      }
      if (incoming.get(3)) {
        struct.rowCount = iprot.readI64();
        struct.setRowCountIsSet(true);
      }
    }
View Full Code Here

  private static class TableDescriptorTupleScheme extends TupleScheme<TableDescriptor> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, TableDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetEnabled()) {
        optionals.set(0);
      }
      if (struct.isSetShardCount()) {
        optionals.set(1);
      }
      if (struct.isSetTableUri()) {
        optionals.set(2);
      }
      if (struct.isSetCluster()) {
        optionals.set(3);
      }
      if (struct.isSetName()) {
        optionals.set(4);
      }
      if (struct.isSetSimilarityClass()) {
        optionals.set(5);
      }
      if (struct.isSetBlockCaching()) {
        optionals.set(6);
      }
      if (struct.isSetBlockCachingFileTypes()) {
        optionals.set(7);
      }
      if (struct.isSetReadOnly()) {
        optionals.set(8);
      }
      if (struct.isSetPreCacheCols()) {
        optionals.set(9);
      }
      if (struct.isSetTableProperties()) {
        optionals.set(10);
      }
      if (struct.isSetStrictTypes()) {
        optionals.set(11);
      }
      if (struct.isSetDefaultMissingFieldType()) {
        optionals.set(12);
      }
      if (struct.isSetDefaultMissingFieldLessIndexing()) {
        optionals.set(13);
      }
      if (struct.isSetDefaultMissingFieldProps()) {
        optionals.set(14);
      }
      oprot.writeBitSet(optionals, 15);
      if (struct.isSetEnabled()) {
        oprot.writeBool(struct.enabled);
      }
      if (struct.isSetShardCount()) {
        oprot.writeI32(struct.shardCount);
      }
      if (struct.isSetTableUri()) {
        oprot.writeString(struct.tableUri);
      }
      if (struct.isSetCluster()) {
        oprot.writeString(struct.cluster);
      }
      if (struct.isSetName()) {
        oprot.writeString(struct.name);
      }
      if (struct.isSetSimilarityClass()) {
        oprot.writeString(struct.similarityClass);
      }
      if (struct.isSetBlockCaching()) {
        oprot.writeBool(struct.blockCaching);
      }
      if (struct.isSetBlockCachingFileTypes()) {
        {
          oprot.writeI32(struct.blockCachingFileTypes.size());
          for (String _iter150 : struct.blockCachingFileTypes)
          {
            oprot.writeString(_iter150);
          }
        }
      }
      if (struct.isSetReadOnly()) {
        oprot.writeBool(struct.readOnly);
      }
      if (struct.isSetPreCacheCols()) {
        {
          oprot.writeI32(struct.preCacheCols.size());
          for (String _iter151 : struct.preCacheCols)
          {
            oprot.writeString(_iter151);
          }
        }
      }
      if (struct.isSetTableProperties()) {
        {
          oprot.writeI32(struct.tableProperties.size());
          for (Map.Entry<String, String> _iter152 : struct.tableProperties.entrySet())
          {
            oprot.writeString(_iter152.getKey());
            oprot.writeString(_iter152.getValue());
          }
        }
      }
      if (struct.isSetStrictTypes()) {
        oprot.writeBool(struct.strictTypes);
      }
      if (struct.isSetDefaultMissingFieldType()) {
        oprot.writeString(struct.defaultMissingFieldType);
      }
      if (struct.isSetDefaultMissingFieldLessIndexing()) {
        oprot.writeBool(struct.defaultMissingFieldLessIndexing);
      }
      if (struct.isSetDefaultMissingFieldProps()) {
        {
          oprot.writeI32(struct.defaultMissingFieldProps.size());
          for (Map.Entry<String, String> _iter153 : struct.defaultMissingFieldProps.entrySet())
          {
            oprot.writeString(_iter153.getKey());
            oprot.writeString(_iter153.getValue());
          }
        }
      }
    }
View Full Code Here

      }
    }

    @Override
    public void read(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, TableDescriptor struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol iprot = (TTupleProtocol) prot;
      BitSet incoming = iprot.readBitSet(15);
      if (incoming.get(0)) {
        struct.enabled = iprot.readBool();
        struct.setEnabledIsSet(true);
      }
      if (incoming.get(1)) {
        struct.shardCount = iprot.readI32();
        struct.setShardCountIsSet(true);
      }
      if (incoming.get(2)) {
        struct.tableUri = iprot.readString();
        struct.setTableUriIsSet(true);
      }
      if (incoming.get(3)) {
        struct.cluster = iprot.readString();
        struct.setClusterIsSet(true);
      }
      if (incoming.get(4)) {
        struct.name = iprot.readString();
        struct.setNameIsSet(true);
      }
      if (incoming.get(5)) {
        struct.similarityClass = iprot.readString();
        struct.setSimilarityClassIsSet(true);
      }
      if (incoming.get(6)) {
        struct.blockCaching = iprot.readBool();
        struct.setBlockCachingIsSet(true);
      }
      if (incoming.get(7)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet _set154 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TSet(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32());
          struct.blockCachingFileTypes = new HashSet<String>(2*_set154.size);
          for (int _i155 = 0; _i155 < _set154.size; ++_i155)
          {
            String _elem156; // required
            _elem156 = iprot.readString();
            struct.blockCachingFileTypes.add(_elem156);
          }
        }
        struct.setBlockCachingFileTypesIsSet(true);
      }
      if (incoming.get(8)) {
        struct.readOnly = iprot.readBool();
        struct.setReadOnlyIsSet(true);
      }
      if (incoming.get(9)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList _list157 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TList(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32());
          struct.preCacheCols = new ArrayList<String>(_list157.size);
          for (int _i158 = 0; _i158 < _list157.size; ++_i158)
          {
            String _elem159; // required
            _elem159 = iprot.readString();
            struct.preCacheCols.add(_elem159);
          }
        }
        struct.setPreCacheColsIsSet(true);
      }
      if (incoming.get(10)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map160 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32());
          struct.tableProperties = new HashMap<String,String>(2*_map160.size);
          for (int _i161 = 0; _i161 < _map160.size; ++_i161)
          {
            String _key162; // required
            String _val163; // optional
            _key162 = iprot.readString();
            _val163 = iprot.readString();
            struct.tableProperties.put(_key162, _val163);
          }
        }
        struct.setTablePropertiesIsSet(true);
      }
      if (incoming.get(11)) {
        struct.strictTypes = iprot.readBool();
        struct.setStrictTypesIsSet(true);
      }
      if (incoming.get(12)) {
        struct.defaultMissingFieldType = iprot.readString();
        struct.setDefaultMissingFieldTypeIsSet(true);
      }
      if (incoming.get(13)) {
        struct.defaultMissingFieldLessIndexing = iprot.readBool();
        struct.setDefaultMissingFieldLessIndexingIsSet(true);
      }
      if (incoming.get(14)) {
        {
          org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap _map164 = new org.apache.blur.thirdparty.thrift_0_9_0.protocol.TMap(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, org.apache.blur.thirdparty.thrift_0_9_0.protocol.TType.STRING, iprot.readI32());
          struct.defaultMissingFieldProps = new HashMap<String,String>(2*_map164.size);
          for (int _i165 = 0; _i165 < _map164.size; ++_i165)
          {
            String _key166; // required
            String _val167; // optional
            _key166 = iprot.readString();
            _val167 = iprot.readString();
            struct.defaultMissingFieldProps.put(_key166, _val167);
          }
        }
        struct.setDefaultMissingFieldPropsIsSet(true);
      }
View Full Code Here

  private static class SelectorTupleScheme extends TupleScheme<Selector> {

    @Override
    public void write(org.apache.blur.thirdparty.thrift_0_9_0.protocol.TProtocol prot, Selector struct) throws org.apache.blur.thirdparty.thrift_0_9_0.TException {
      TTupleProtocol oprot = (TTupleProtocol) prot;
      BitSet optionals = new BitSet();
      if (struct.isSetRecordOnly()) {
        optionals.set(0);
      }
      if (struct.isSetLocationId()) {
        optionals.set(1);
      }
      if (struct.isSetRowId()) {
        optionals.set(2);
      }
      if (struct.isSetRecordId()) {
        optionals.set(3);
      }
      if (struct.isSetColumnFamiliesToFetch()) {
        optionals.set(4);
      }
      if (struct.isSetColumnsToFetch()) {
        optionals.set(5);
      }
      if (struct.isSetStartRecord()) {
        optionals.set(6);
      }
      if (struct.isSetMaxRecordsToFetch()) {
        optionals.set(7);
      }
      if (struct.isSetHighlightOptions()) {
        optionals.set(8);
      }
      oprot.writeBitSet(optionals, 9);
      if (struct.isSetRecordOnly()) {
        oprot.writeBool(struct.recordOnly);
      }
      if (struct.isSetLocationId()) {
        oprot.writeString(struct.locationId);
      }
      if (struct.isSetRowId()) {
        oprot.writeString(struct.rowId);
      }
      if (struct.isSetRecordId()) {
        oprot.writeString(struct.recordId);
      }
      if (struct.isSetColumnFamiliesToFetch()) {
        {
          oprot.writeI32(struct.columnFamiliesToFetch.size());
          for (String _iter29 : struct.columnFamiliesToFetch)
          {
            oprot.writeString(_iter29);
          }
        }
      }
      if (struct.isSetColumnsToFetch()) {
        {
          oprot.writeI32(struct.columnsToFetch.size());
          for (Map.Entry<String, Set<String>> _iter30 : struct.columnsToFetch.entrySet())
          {
            oprot.writeString(_iter30.getKey());
            {
              oprot.writeI32(_iter30.getValue().size());
              for (String _iter31 : _iter30.getValue())
              {
                oprot.writeString(_iter31);
              }
            }
          }
        }
      }
      if (struct.isSetStartRecord()) {
        oprot.writeI32(struct.startRecord);
      }
      if (struct.isSetMaxRecordsToFetch()) {
        oprot.writeI32(struct.maxRecordsToFetch);
      }
      if (struct.isSetHighlightOptions()) {
        struct.highlightOptions.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

TOP

Related Classes of org.apache.blur.thirdparty.thrift_0_9_0.transport.TTransport

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.