當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。