Example usage for org.apache.thrift.protocol TProtocol readStructBegin

List of usage examples for org.apache.thrift.protocol TProtocol readStructBegin

Introduction

In this page you can find the example usage for org.apache.thrift.protocol TProtocol readStructBegin.

Prototype

public abstract TStruct readStructBegin() throws TException;

Source Link

Usage

From source file:backtype.storm.generated.AlreadyAliveException.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();/*  w  w  w.  j  a v a2  s. c  o m*/
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // MSG
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.msg = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.Bolt.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//from   ww  w.  j  a v  a2  s .c o  m
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // BOLT_OBJECT
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
                this.bolt_object = new ComponentObject();
                this.bolt_object.read(iprot);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // COMMON
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
                this.common = new ComponentCommon();
                this.common.read(iprot);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.BoltStats.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//from  w w  w.  ja v  a  2 s.  c o  m
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // ACKED
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map45 = iprot.readMapBegin();
                    this.acked = new HashMap<String, Map<GlobalStreamId, Long>>(2 * _map45.size);
                    for (int _i46 = 0; _i46 < _map45.size; ++_i46) {
                        String _key47; // required
                        Map<GlobalStreamId, Long> _val48; // required
                        _key47 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map49 = iprot.readMapBegin();
                            _val48 = new HashMap<GlobalStreamId, Long>(2 * _map49.size);
                            for (int _i50 = 0; _i50 < _map49.size; ++_i50) {
                                GlobalStreamId _key51; // required
                                long _val52; // required
                                _key51 = new GlobalStreamId();
                                _key51.read(iprot);
                                _val52 = iprot.readI64();
                                _val48.put(_key51, _val52);
                            }
                            iprot.readMapEnd();
                        }
                        this.acked.put(_key47, _val48);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // FAILED
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map53 = iprot.readMapBegin();
                    this.failed = new HashMap<String, Map<GlobalStreamId, Long>>(2 * _map53.size);
                    for (int _i54 = 0; _i54 < _map53.size; ++_i54) {
                        String _key55; // required
                        Map<GlobalStreamId, Long> _val56; // required
                        _key55 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map57 = iprot.readMapBegin();
                            _val56 = new HashMap<GlobalStreamId, Long>(2 * _map57.size);
                            for (int _i58 = 0; _i58 < _map57.size; ++_i58) {
                                GlobalStreamId _key59; // required
                                long _val60; // required
                                _key59 = new GlobalStreamId();
                                _key59.read(iprot);
                                _val60 = iprot.readI64();
                                _val56.put(_key59, _val60);
                            }
                            iprot.readMapEnd();
                        }
                        this.failed.put(_key55, _val56);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // PROCESS_MS_AVG
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map61 = iprot.readMapBegin();
                    this.process_ms_avg = new HashMap<String, Map<GlobalStreamId, Double>>(2 * _map61.size);
                    for (int _i62 = 0; _i62 < _map61.size; ++_i62) {
                        String _key63; // required
                        Map<GlobalStreamId, Double> _val64; // required
                        _key63 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map65 = iprot.readMapBegin();
                            _val64 = new HashMap<GlobalStreamId, Double>(2 * _map65.size);
                            for (int _i66 = 0; _i66 < _map65.size; ++_i66) {
                                GlobalStreamId _key67; // required
                                double _val68; // required
                                _key67 = new GlobalStreamId();
                                _key67.read(iprot);
                                _val68 = iprot.readDouble();
                                _val64.put(_key67, _val68);
                            }
                            iprot.readMapEnd();
                        }
                        this.process_ms_avg.put(_key63, _val64);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 4: // EXECUTED
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map69 = iprot.readMapBegin();
                    this.executed = new HashMap<String, Map<GlobalStreamId, Long>>(2 * _map69.size);
                    for (int _i70 = 0; _i70 < _map69.size; ++_i70) {
                        String _key71; // required
                        Map<GlobalStreamId, Long> _val72; // required
                        _key71 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map73 = iprot.readMapBegin();
                            _val72 = new HashMap<GlobalStreamId, Long>(2 * _map73.size);
                            for (int _i74 = 0; _i74 < _map73.size; ++_i74) {
                                GlobalStreamId _key75; // required
                                long _val76; // required
                                _key75 = new GlobalStreamId();
                                _key75.read(iprot);
                                _val76 = iprot.readI64();
                                _val72.put(_key75, _val76);
                            }
                            iprot.readMapEnd();
                        }
                        this.executed.put(_key71, _val72);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 5: // EXECUTE_MS_AVG
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map77 = iprot.readMapBegin();
                    this.execute_ms_avg = new HashMap<String, Map<GlobalStreamId, Double>>(2 * _map77.size);
                    for (int _i78 = 0; _i78 < _map77.size; ++_i78) {
                        String _key79; // required
                        Map<GlobalStreamId, Double> _val80; // required
                        _key79 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map81 = iprot.readMapBegin();
                            _val80 = new HashMap<GlobalStreamId, Double>(2 * _map81.size);
                            for (int _i82 = 0; _i82 < _map81.size; ++_i82) {
                                GlobalStreamId _key83; // required
                                double _val84; // required
                                _key83 = new GlobalStreamId();
                                _key83.read(iprot);
                                _val84 = iprot.readDouble();
                                _val80.put(_key83, _val84);
                            }
                            iprot.readMapEnd();
                        }
                        this.execute_ms_avg.put(_key79, _val80);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.ClusterSummary.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();/*from   w ww.  j a  v a  2s  .  co  m*/
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // SUPERVISORS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
                {
                    org.apache.thrift.protocol.TList _list37 = iprot.readListBegin();
                    this.supervisors = new ArrayList<SupervisorSummary>(_list37.size);
                    for (int _i38 = 0; _i38 < _list37.size; ++_i38) {
                        SupervisorSummary _elem39; // required
                        _elem39 = new SupervisorSummary();
                        _elem39.read(iprot);
                        this.supervisors.add(_elem39);
                    }
                    iprot.readListEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // NIMBUS_UPTIME_SECS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.nimbus_uptime_secs = iprot.readI32();
                set_nimbus_uptime_secs_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // TOPOLOGIES
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
                {
                    org.apache.thrift.protocol.TList _list40 = iprot.readListBegin();
                    this.topologies = new ArrayList<TopologySummary>(_list40.size);
                    for (int _i41 = 0; _i41 < _list40.size; ++_i41) {
                        TopologySummary _elem42; // required
                        _elem42 = new TopologySummary();
                        _elem42.read(iprot);
                        this.topologies.add(_elem42);
                    }
                    iprot.readListEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.ComponentCommon.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();/*from  ww  w  .  java2s .c om*/
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // INPUTS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map12 = iprot.readMapBegin();
                    this.inputs = new HashMap<GlobalStreamId, Grouping>(2 * _map12.size);
                    for (int _i13 = 0; _i13 < _map12.size; ++_i13) {
                        GlobalStreamId _key14; // required
                        Grouping _val15; // required
                        _key14 = new GlobalStreamId();
                        _key14.read(iprot);
                        _val15 = new Grouping();
                        _val15.read(iprot);
                        this.inputs.put(_key14, _val15);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // STREAMS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map16 = iprot.readMapBegin();
                    this.streams = new HashMap<String, StreamInfo>(2 * _map16.size);
                    for (int _i17 = 0; _i17 < _map16.size; ++_i17) {
                        String _key18; // required
                        StreamInfo _val19; // required
                        _key18 = iprot.readString();
                        _val19 = new StreamInfo();
                        _val19.read(iprot);
                        this.streams.put(_key18, _val19);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // PARALLELISM_HINT
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.parallelism_hint = iprot.readI32();
                set_parallelism_hint_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 4: // JSON_CONF
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.json_conf = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.Credentials.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();/*from   ww w.j a va 2s.c o m*/
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // CREDS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map163 = iprot.readMapBegin();
                    this.creds = new HashMap<String, String>(2 * _map163.size);
                    for (int _i164 = 0; _i164 < _map163.size; ++_i164) {
                        String _key165; // required
                        String _val166; // required
                        _key165 = iprot.readString();
                        _val166 = iprot.readString();
                        this.creds.put(_key165, _val166);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.DRPCRequest.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//from  www.ja va  2 s  . c om
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // FUNC_ARGS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.func_args = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // REQUEST_ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.request_id = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.ErrorInfo.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//w w w  .j  a  v a2  s . c o m
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // ERROR
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.error = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // ERROR_TIME_SECS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.error_time_secs = iprot.readI32();
                set_error_time_secs_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // HOST
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.host = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 4: // PORT
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.port = iprot.readI32();
                set_port_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.ExecutorInfo.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//from   w  ww.j  av  a  2s  .co  m
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // TASK_START
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.task_start = iprot.readI32();
                set_task_start_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // TASK_END
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.task_end = iprot.readI32();
                set_task_end_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}

From source file:backtype.storm.generated.ExecutorStats.java

License:Apache License

public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException {
    org.apache.thrift.protocol.TField field;
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();//from   ww w . j  a v a  2s.  c  om
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // EMITTED
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map125 = iprot.readMapBegin();
                    this.emitted = new HashMap<String, Map<String, Long>>(2 * _map125.size);
                    for (int _i126 = 0; _i126 < _map125.size; ++_i126) {
                        String _key127; // required
                        Map<String, Long> _val128; // required
                        _key127 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map129 = iprot.readMapBegin();
                            _val128 = new HashMap<String, Long>(2 * _map129.size);
                            for (int _i130 = 0; _i130 < _map129.size; ++_i130) {
                                String _key131; // required
                                long _val132; // required
                                _key131 = iprot.readString();
                                _val132 = iprot.readI64();
                                _val128.put(_key131, _val132);
                            }
                            iprot.readMapEnd();
                        }
                        this.emitted.put(_key127, _val128);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // TRANSFERRED
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map133 = iprot.readMapBegin();
                    this.transferred = new HashMap<String, Map<String, Long>>(2 * _map133.size);
                    for (int _i134 = 0; _i134 < _map133.size; ++_i134) {
                        String _key135; // required
                        Map<String, Long> _val136; // required
                        _key135 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map137 = iprot.readMapBegin();
                            _val136 = new HashMap<String, Long>(2 * _map137.size);
                            for (int _i138 = 0; _i138 < _map137.size; ++_i138) {
                                String _key139; // required
                                long _val140; // required
                                _key139 = iprot.readString();
                                _val140 = iprot.readI64();
                                _val136.put(_key139, _val140);
                            }
                            iprot.readMapEnd();
                        }
                        this.transferred.put(_key135, _val136);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // SPECIFIC
            if (field.type == org.apache.thrift.protocol.TType.STRUCT) {
                this.specific = new ExecutorSpecificStats();
                this.specific.read(iprot);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        default:
            org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
        }
        iprot.readFieldEnd();
    }
    iprot.readStructEnd();
    validate();
}