@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); } }
@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); } }
@Setup(Level.Trial) public void benchSetup(BenchmarkParams params) throws TException { testObject = new ThriftTestObject(); testObject.setField1("1"); testObject.setField2("2"); testObject.setField3("3"); testObject.setField4("4"); testObject.setField5("5"); testObject.setField6("6"); testObject.setField7("7"); testObject.setField8("8"); testObject.setField9("9"); testObject.setField10("10"); serializer = new TSerializer(new TCompactProtocol.Factory()); deserializer = new TDeserializer(new TCompactProtocol.Factory()); testData = serializer.serialize(testObject); }
@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); } }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, isTableEnabled_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.writeBool(struct.success); } if (struct.isSetIo()) { struct.io.write(oprot); } }
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(); }
@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); }
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(); }
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); } }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, getRows_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(3); if (incoming.get(0)) { struct.tableName = iprot.readBinary(); struct.setTableNameIsSet(true); } if (incoming.get(1)) { { org.apache.thrift.protocol.TList _list237 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.rows = new ArrayList<ByteBuffer>(_list237.size); ByteBuffer _elem238; for (int _i239 = 0; _i239 < _list237.size; ++_i239) { _elem238 = iprot.readBinary(); struct.rows.add(_elem238); } } struct.setRowsIsSet(true); } if (incoming.get(2)) { { org.apache.thrift.protocol.TMap _map240 = new org.apache.thrift.protocol.TMap(org.apache.thrift.protocol.TType.STRING, org.apache.thrift.protocol.TType.STRING, iprot.readI32()); struct.attributes = new HashMap<ByteBuffer,ByteBuffer>(2*_map240.size); ByteBuffer _key241; ByteBuffer _val242; for (int _i243 = 0; _i243 < _map240.size; ++_i243) { _key241 = iprot.readBinary(); _val242 = iprot.readBinary(); struct.attributes.put(_key241, _val242); } } struct.setAttributesIsSet(true); } }
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(); }
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(); }
@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); } }
@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); } }
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(); }
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(); }}); }
@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); }
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(); }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, TSGetOperationStatusResp struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); if (struct.status != null) { oprot.writeFieldBegin(STATUS_FIELD_DESC); struct.status.write(oprot); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public void recv_disableTable() throws IOError, org.apache.thrift.TException { disableTable_result result = new disableTable_result(); receiveBase(result, "disableTable"); if (result.io != null) { throw result.io; } return; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (TException te) { throw new java.io.IOException(te); } }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("executeStatement", org.apache.thrift.protocol.TMessageType.CALL, 0)); executeStatement_args args = new executeStatement_args(); args.setReq(req); args.write(prot); prot.writeMessageEnd(); }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, pushMessageSync_args struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(1); if (incoming.get(0)) { struct.packet = new Message(); struct.packet.read(iprot); struct.setPacketIsSet(true); } }
public void write(org.apache.thrift.protocol.TProtocol oprot, SyncError struct) throws org.apache.thrift.TException { struct.validate(); oprot.writeStructBegin(STRUCT_DESC); oprot.writeFieldBegin(ERROR_CODE_FIELD_DESC); oprot.writeI32(struct.errorCode); oprot.writeFieldEnd(); if (struct.message != null) { oprot.writeFieldBegin(MESSAGE_FIELD_DESC); oprot.writeString(struct.message); oprot.writeFieldEnd(); } oprot.writeFieldStop(); oprot.writeStructEnd(); }
public getTableNames_result getResult(I iface, getTableNames_args args) throws org.apache.thrift.TException { getTableNames_result result = new getTableNames_result(); try { result.success = iface.getTableNames(); } catch (IOError io) { result.io = io; } return result; }
@Loggable(value = Loggable.DEBUG, skipResult = true, name = INVOCATION_LOG_NAME) @Override public Partition add_partition(Partition new_part) throws InvalidObjectException, AlreadyExistsException, MetaException, TException { DatabaseMapping mapping = checkWritePermissions(new_part.getDbName()); Partition result = mapping.getClient().add_partition(mapping.transformInboundPartition(new_part)); return mapping.transformOutboundPartition(result); }
public TResult getResult() throws TIOError, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_increment(); }
public int getResult() throws TIOError, org.apache.thrift.TException { if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) { throw new IllegalStateException("Method call not finished!"); } org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array()); org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport); return (new Client(prot)).recv_openScanner(); }
public void validate() throws org.apache.thrift.TException { // check for required fields if (statusCode == null) { throw new org.apache.thrift.protocol.TProtocolException("Required field 'statusCode' was not present! Struct: " + toString()); } // check for sub-struct validity }
@Override public void write(org.apache.thrift.protocol.TProtocol prot, TRowResult struct) throws org.apache.thrift.TException { TTupleProtocol oprot = (TTupleProtocol) prot; BitSet optionals = new BitSet(); if (struct.isSetRow()) { optionals.set(0); } if (struct.isSetColumns()) { optionals.set(1); } if (struct.isSetSortedColumns()) { optionals.set(2); } oprot.writeBitSet(optionals, 3); if (struct.isSetRow()) { oprot.writeBinary(struct.row); } if (struct.isSetColumns()) { { oprot.writeI32(struct.columns.size()); for (Map.Entry<ByteBuffer, TCell> _iter17 : struct.columns.entrySet()) { oprot.writeBinary(_iter17.getKey()); _iter17.getValue().write(oprot); } } } if (struct.isSetSortedColumns()) { { oprot.writeI32(struct.sortedColumns.size()); for (TColumn _iter18 : struct.sortedColumns) { _iter18.write(oprot); } } } }