List of usage examples for org.apache.thrift.protocol TType LIST
byte LIST
To view the source code for org.apache.thrift.protocol TType LIST.
Click Source Link
From source file:com.bigdata.dastor.thrift.KeySlice.java
License:Apache License
public void read(TProtocol iprot) throws TException { TField field;// w w w .ja va 2s .c o m iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // KEY if (field.type == TType.STRING) { this.key = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // COLUMNS if (field.type == TType.LIST) { { TList _list8 = iprot.readListBegin(); this.columns = new ArrayList<ColumnOrSuperColumn>(_list8.size); for (int _i9 = 0; _i9 < _list8.size; ++_i9) { ColumnOrSuperColumn _elem10; _elem10 = new ColumnOrSuperColumn(); _elem10.read(iprot); this.columns.add(_elem10); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); }
From source file:com.bigdata.dastor.thrift.SlicePredicate.java
License:Apache License
public void read(TProtocol iprot) throws TException { TField field;// ww w .j a v a2 s. c o m iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // COLUMN_NAMES if (field.type == TType.LIST) { { TList _list4 = iprot.readListBegin(); this.column_names = new ArrayList<byte[]>(_list4.size); for (int _i5 = 0; _i5 < _list4.size; ++_i5) { byte[] _elem6; _elem6 = iprot.readBinary(); this.column_names.add(_elem6); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // SLICE_RANGE if (field.type == TType.STRUCT) { this.slice_range = new SliceRange(); this.slice_range.read(iprot); } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); }
From source file:com.bigdata.dastor.thrift.SuperColumn.java
License:Apache License
public void read(TProtocol iprot) throws TException { TField field;/*ww w. j a va2 s .c om*/ iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // NAME if (field.type == TType.STRING) { this.name = iprot.readBinary(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // COLUMNS if (field.type == TType.LIST) { { TList _list0 = iprot.readListBegin(); this.columns = new ArrayList<Column>(_list0.size); for (int _i1 = 0; _i1 < _list0.size; ++_i1) { Column _elem2; _elem2 = new Column(); _elem2.read(iprot); this.columns.add(_elem2); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); }
From source file:com.bigdata.dastor.thrift.TokenRange.java
License:Apache License
public void read(TProtocol iprot) throws TException { TField field;/*from www . j a v a 2 s . c om*/ iprot.readStructBegin(); while (true) { field = iprot.readFieldBegin(); if (field.type == TType.STOP) { break; } switch (field.id) { case 1: // START_TOKEN if (field.type == TType.STRING) { this.start_token = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 2: // END_TOKEN if (field.type == TType.STRING) { this.end_token = iprot.readString(); } else { TProtocolUtil.skip(iprot, field.type); } break; case 3: // ENDPOINTS if (field.type == TType.LIST) { { TList _list12 = iprot.readListBegin(); this.endpoints = new ArrayList<String>(_list12.size); for (int _i13 = 0; _i13 < _list12.size; ++_i13) { String _elem14; _elem14 = iprot.readString(); this.endpoints.add(_elem14); } iprot.readListEnd(); } } else { TProtocolUtil.skip(iprot, field.type); } break; default: TProtocolUtil.skip(iprot, field.type); } iprot.readFieldEnd(); } iprot.readStructEnd(); // check for required fields of primitive type, which can't be checked in the validate method validate(); }
From source file:com.ebay.nest.io.sede.dynamic_type.DynamicSerDeTypeList.java
License:Apache License
@Override public byte getType() { return TType.LIST; }
From source file:com.ebay.nest.io.sede.thrift.TCTLSeparatedProtocol.java
License:Apache License
@Override public void writeMapBegin(TMap map) throws TException { // nesting not allowed! if (map.keyType == TType.STRUCT || map.keyType == TType.MAP || map.keyType == TType.LIST || map.keyType == TType.SET) { throw new TException("Not implemented: nested structures"); }// w ww. ja v a2 s. c om // nesting not allowed! if (map.valueType == TType.STRUCT || map.valueType == TType.MAP || map.valueType == TType.LIST || map.valueType == TType.SET) { throw new TException("Not implemented: nested structures"); } firstInnerField = true; isMap = true; inner = true; elemIndex = 0; }
From source file:com.ebay.nest.io.sede.thrift.TCTLSeparatedProtocol.java
License:Apache License
@Override public void writeListBegin(TList list) throws TException { if (list.elemType == TType.STRUCT || list.elemType == TType.MAP || list.elemType == TType.LIST || list.elemType == TType.SET) { throw new TException("Not implemented: nested structures"); }//from www.j a v a 2 s . c o m firstInnerField = true; inner = true; }
From source file:com.ebay.nest.io.sede.thrift.TCTLSeparatedProtocol.java
License:Apache License
@Override public void writeSetBegin(TSet set) throws TException { if (set.elemType == TType.STRUCT || set.elemType == TType.MAP || set.elemType == TType.LIST || set.elemType == TType.SET) { throw new TException("Not implemented: nested structures"); }//www .j av a 2 s. c om firstInnerField = true; inner = true; }
From source file:com.facebook.swift.codec.internal.TProtocolReader.java
License:Apache License
public boolean[] readBoolArrayField() throws TException { if (!checkReadState(TType.LIST)) { return null; }//from w w w .j a va2 s. co m currentField = null; boolean[] fieldValue = readBoolArray(); protocol.readFieldEnd(); return fieldValue; }
From source file:com.facebook.swift.codec.internal.TProtocolReader.java
License:Apache License
public short[] readI16ArrayField() throws TException { if (!checkReadState(TType.LIST)) { return null; }//from ww w .java 2 s . c o m currentField = null; short[] fieldValue = readI16Array(); protocol.readFieldEnd(); return fieldValue; }