当前位置: 首页>>代码示例>>Java>>正文


Java TException类代码示例

本文整理汇总了Java中org.apache.thrift.TException的典型用法代码示例。如果您正苦于以下问题:Java TException类的具体用法?Java TException怎么用?Java TException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TException类属于org.apache.thrift包,在下文中一共展示了TException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: read

import org.apache.thrift.TException; //导入依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, incrementRows_args struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  BitSet incoming = iprot.readBitSet(1);
  if (incoming.get(0)) {
    {
      org.apache.thrift.protocol.TList _list453 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32());
      struct.increments = new ArrayList<TIncrement>(_list453.size);
      TIncrement _elem454;
      for (int _i455 = 0; _i455 < _list453.size; ++_i455)
      {
        _elem454 = new TIncrement();
        _elem454.read(iprot);
        struct.increments.add(_elem454);
      }
    }
    struct.setIncrementsIsSet(true);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:Hbase.java

示例2: write

import org.apache.thrift.TException; //导入依赖的package包/类
@Override
public void write(org.apache.thrift.protocol.TProtocol prot, scannerOpenWithStopTs_result struct) throws org.apache.thrift.TException {
  TTupleProtocol oprot = (TTupleProtocol) prot;
  BitSet optionals = new BitSet();
  if (struct.isSetSuccess()) {
    optionals.set(0);
  }
  if (struct.isSetIo()) {
    optionals.set(1);
  }
  oprot.writeBitSet(optionals, 2);
  if (struct.isSetSuccess()) {
    oprot.writeI32(struct.success);
  }
  if (struct.isSetIo()) {
    struct.io.write(oprot);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:Hbase.java

示例3: readCounter

import org.apache.thrift.TException; //导入依赖的package包/类
@Override
public Pair<Long, Long> readCounter(String counterName, int index) throws Bmv2RuntimeException {

    log.debug("Reading table entry counters... > deviceId={}, counterName={}, index={}",
              deviceId, counterName, index);

    try {
        BmCounterValue counterValue = standardClient.bm_counter_read(CONTEXT_ID, counterName, index);
        log.debug("Table entry counters retrieved! >deviceId={}, counterName={}, index={}, bytes={}, packets={}",
                  deviceId, counterName, index, counterValue.bytes, counterValue.packets);
        return Pair.of(counterValue.bytes, counterValue.packets);
    } catch (TException e) {
        log.debug("Exception while reading table counters: {} > deviceId={}, counterName={}, index={}",
                  e.toString(), deviceId);
        throw parseTException(e);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:18,代码来源:Bmv2DeviceThriftClient.java

示例4: write

import org.apache.thrift.TException; //导入依赖的package包/类
public void write(org.apache.thrift.protocol.TProtocol oprot, updateTaskProgressRate_args struct) throws TException {
    struct.validate();

    oprot.writeStructBegin(STRUCT_DESC);
    if (struct.taskId != null) {
        oprot.writeFieldBegin(TASK_ID_FIELD_DESC);
        oprot.writeString(struct.taskId);
        oprot.writeFieldEnd();
    }
    oprot.writeFieldBegin(NEW_PROGRESS_RATE_FIELD_DESC);
    oprot.writeI32(struct.newProgressRate);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(MARKUP_FIELD_DESC);
    oprot.writeI32(struct.markup);
    oprot.writeFieldEnd();
    oprot.writeFieldBegin(STATUS_FIELD_DESC);
    oprot.writeByte(struct.status);
    oprot.writeFieldEnd();
    oprot.writeFieldStop();
    oprot.writeStructEnd();
}
 
开发者ID:xiongbeer,项目名称:Cobweb,代码行数:22,代码来源:LocalWorkerCrawlerServiceBase.java

示例5: benchSetup

import org.apache.thrift.TException; //导入依赖的package包/类
@Setup(Level.Trial)
public void benchSetup(BenchmarkParams params) throws TException {
    testObject = new ThriftTestObject();
    testObject.addToField1(31.415926);
    testObject.addToField1(61.415923);
    testObject.addToField1(31.415269);
    testObject.addToField1(53.141926);
    testObject.addToField1(13.145926);
    testObject.addToField1(43.115926);
    testObject.addToField1(31.419265);
    testObject.addToField1(23.141596);
    testObject.addToField1(43.161592);
    testObject.addToField1(0.112);
    serializer = new TSerializer(new TCompactProtocol.Factory());
    deserializer = new TDeserializer(new TCompactProtocol.Factory());
    testData = serializer.serialize(testObject);
}
 
开发者ID:json-iterator,项目名称:java-benchmark,代码行数:18,代码来源:DeserThrift.java

示例6: write

import org.apache.thrift.TException; //导入依赖的package包/类
public void write(org.apache.thrift.protocol.TProtocol oprot, VersionedValue struct) throws org.apache.thrift.TException {
  struct.validate();

  oprot.writeStructBegin(STRUCT_DESC);
  if (struct.value != null) {
    if (struct.isSetValue()) {
      oprot.writeFieldBegin(VALUE_FIELD_DESC);
      oprot.writeBinary(struct.value);
      oprot.writeFieldEnd();
    }
  }
  if (struct.version != null) {
    oprot.writeFieldBegin(VERSION_FIELD_DESC);
    struct.version.write(oprot);
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:VersionedValue.java

示例7: writeObject

import org.apache.thrift.TException; //导入依赖的package包/类
private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException {
  try {
    write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out)));
  } catch (org.apache.thrift.TException te) {
    throw new java.io.IOException(te);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:8,代码来源:TIllegalArgument.java

示例8: read

import org.apache.thrift.TException; //导入依赖的package包/类
public void read(org.apache.thrift.protocol.TProtocol iprot, deleteSingle_result struct) throws org.apache.thrift.TException {
  org.apache.thrift.protocol.TField schemeField;
  iprot.readStructBegin();
  while (true)
  {
    schemeField = iprot.readFieldBegin();
    if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { 
      break;
    }
    switch (schemeField.id) {
      case 1: // IO
        if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) {
          struct.io = new TIOError();
          struct.io.read(iprot);
          struct.setIoIsSet(true);
        } else { 
          org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        break;
      default:
        org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
    }
    iprot.readFieldEnd();
  }
  iprot.readStructEnd();

  // check for required fields of primitive type, which can't be checked in the validate method
  struct.validate();
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:30,代码来源:THBaseService.java

示例9: write

import org.apache.thrift.TException; //导入依赖的package包/类
public void write(org.apache.thrift.protocol.TProtocol oprot, TSQueryDataSet struct) throws org.apache.thrift.TException {
  struct.validate();

  oprot.writeStructBegin(STRUCT_DESC);
  if (struct.keys != null) {
    oprot.writeFieldBegin(KEYS_FIELD_DESC);
    {
      oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.keys.size()));
      for (String _iter122 : struct.keys)
      {
        oprot.writeString(_iter122);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  if (struct.values != null) {
    oprot.writeFieldBegin(VALUES_FIELD_DESC);
    {
      oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.values.size()));
      for (TSDynamicOneColumnData _iter123 : struct.values)
      {
        _iter123.write(oprot);
      }
      oprot.writeListEnd();
    }
    oprot.writeFieldEnd();
  }
  oprot.writeFieldStop();
  oprot.writeStructEnd();
}
 
开发者ID:thulab,项目名称:iotdb-jdbc,代码行数:32,代码来源:TSQueryDataSet.java

示例10: mutateRow

import org.apache.thrift.TException; //导入依赖的package包/类
@Override
public void mutateRow(ByteBuffer table, TRowMutations rowMutations) throws TIOError, TException {
  Table htable = getTable(table);
  try {
    htable.mutateRow(rowMutationsFromThrift(rowMutations));
  } catch (IOException e) {
    throw getTIOError(e);
  } finally {
    closeTable(htable);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:ThriftHBaseServiceHandler.java

示例11: read

import org.apache.thrift.TException; //导入依赖的package包/类
@Override
public void read(org.apache.thrift.protocol.TProtocol prot, TColumn struct) throws org.apache.thrift.TException {
  TTupleProtocol iprot = (TTupleProtocol) prot;
  struct.family = iprot.readBinary();
  struct.setFamilyIsSet(true);
  BitSet incoming = iprot.readBitSet(2);
  if (incoming.get(0)) {
    struct.qualifier = iprot.readBinary();
    struct.setQualifierIsSet(true);
  }
  if (incoming.get(1)) {
    struct.timestamp = iprot.readI64();
    struct.setTimestampIsSet(true);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:16,代码来源:TColumn.java

示例12: write_args

import org.apache.thrift.TException; //导入依赖的package包/类
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws TException {
    prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("finishTask", org.apache.thrift.protocol.TMessageType.CALL, 0));
    finishTask_args args = new finishTask_args();
    args.setTaskId(taskId);
    args.write(prot);
    prot.writeMessageEnd();
}
 
开发者ID:xiongbeer,项目名称:Cobweb,代码行数:8,代码来源:LocalWorkerCrawlerServiceBase.java

示例13: getDatabases

import org.apache.thrift.TException; //导入依赖的package包/类
List<String> getDatabases(boolean ignoreAuthzErrors) throws TException{
  return doCommand(new RetryableClientCommand<List<String>>(){
    @Override
    public List<String> run(HiveMetaStoreClient client) throws TException {
      return client.getAllDatabases();
    }});
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:8,代码来源:HiveClient.java

示例14: delete_table_column_statistics

import org.apache.thrift.TException; //导入依赖的package包/类
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME)
@Override
public boolean delete_table_column_statistics(String db_name, String tbl_name, String col_name)
  throws NoSuchObjectException, MetaException, InvalidObjectException, InvalidInputException, TException {
  DatabaseMapping mapping = checkWritePermissions(db_name);
  return mapping.getClient().delete_table_column_statistics(mapping.transformInboundDatabaseName(db_name), tbl_name,
      col_name);
}
 
开发者ID:HotelsDotCom,项目名称:waggle-dance,代码行数:9,代码来源:FederatedHMSHandler.java

示例15: read

import org.apache.thrift.TException; //导入依赖的package包/类
public void read(org.apache.thrift.protocol.TProtocol iprot, finishTask_result struct) throws TException {
    org.apache.thrift.protocol.TField schemeField;
    iprot.readStructBegin();
    while (true) {
        schemeField = iprot.readFieldBegin();
        if (schemeField.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (schemeField.id) {
            case 0: // SUCCESS
                if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) {
                    struct.success = iprot.readBool();
                    struct.setSuccessIsSet(true);
                } else {
                    org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
                }
                break;
            default:
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();

    // check for required fields of primitive type, which can't be checked in the validate method
    struct.validate();
}
 
开发者ID:xiongbeer,项目名称:Cobweb,代码行数:28,代码来源:LocalWorkerCrawlerServiceBase.java


注:本文中的org.apache.thrift.TException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。