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

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

Introduction

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

Prototype

public abstract TMap readMapBegin() throws TException;

Source Link

Usage

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();//from   w  w w  .  ja v  a 2  s.c  o m
    while (true) {
        field = iprot.readFieldBegin();
        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.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();//from www  .j  a  va2 s .  com
    while (true) {
        field = iprot.readFieldBegin();
        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();/* w  w w. jav  a  2 s . c  o  m*/
    while (true) {
        field = iprot.readFieldBegin();
        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.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();/* www  .  j  a  v a  2  s.co  m*/
    while (true) {
        field = iprot.readFieldBegin();
        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();
}

From source file:backtype.storm.generated.RebalanceOptions.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();//from   www .j  a  va 2 s. co m
    while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // WAIT_SECS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.wait_secs = iprot.readI32();
                set_wait_secs_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // NUM_WORKERS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.num_workers = iprot.readI32();
                set_num_workers_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // NUM_EXECUTORS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map158 = iprot.readMapBegin();
                    this.num_executors = new HashMap<String, Integer>(2 * _map158.size);
                    for (int _i159 = 0; _i159 < _map158.size; ++_i159) {
                        String _key160; // required
                        int _val161; // required
                        _key160 = iprot.readString();
                        _val161 = iprot.readI32();
                        this.num_executors.put(_key160, _val161);
                    }
                    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.SpoutStats.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();/*from w w w.j  a  va2s. c o  m*/
    while (true) {
        field = iprot.readFieldBegin();
        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 _map95 = iprot.readMapBegin();
                    this.acked = new HashMap<String, Map<String, Long>>(2 * _map95.size);
                    for (int _i96 = 0; _i96 < _map95.size; ++_i96) {
                        String _key97; // required
                        Map<String, Long> _val98; // required
                        _key97 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map99 = iprot.readMapBegin();
                            _val98 = new HashMap<String, Long>(2 * _map99.size);
                            for (int _i100 = 0; _i100 < _map99.size; ++_i100) {
                                String _key101; // required
                                long _val102; // required
                                _key101 = iprot.readString();
                                _val102 = iprot.readI64();
                                _val98.put(_key101, _val102);
                            }
                            iprot.readMapEnd();
                        }
                        this.acked.put(_key97, _val98);
                    }
                    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 _map103 = iprot.readMapBegin();
                    this.failed = new HashMap<String, Map<String, Long>>(2 * _map103.size);
                    for (int _i104 = 0; _i104 < _map103.size; ++_i104) {
                        String _key105; // required
                        Map<String, Long> _val106; // required
                        _key105 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map107 = iprot.readMapBegin();
                            _val106 = new HashMap<String, Long>(2 * _map107.size);
                            for (int _i108 = 0; _i108 < _map107.size; ++_i108) {
                                String _key109; // required
                                long _val110; // required
                                _key109 = iprot.readString();
                                _val110 = iprot.readI64();
                                _val106.put(_key109, _val110);
                            }
                            iprot.readMapEnd();
                        }
                        this.failed.put(_key105, _val106);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // COMPLETE_MS_AVG
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map111 = iprot.readMapBegin();
                    this.complete_ms_avg = new HashMap<String, Map<String, Double>>(2 * _map111.size);
                    for (int _i112 = 0; _i112 < _map111.size; ++_i112) {
                        String _key113; // required
                        Map<String, Double> _val114; // required
                        _key113 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TMap _map115 = iprot.readMapBegin();
                            _val114 = new HashMap<String, Double>(2 * _map115.size);
                            for (int _i116 = 0; _i116 < _map115.size; ++_i116) {
                                String _key117; // required
                                double _val118; // required
                                _key117 = iprot.readString();
                                _val118 = iprot.readDouble();
                                _val114.put(_key117, _val118);
                            }
                            iprot.readMapEnd();
                        }
                        this.complete_ms_avg.put(_key113, _val114);
                    }
                    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.StormTopology.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();//from ww  w. j  av a  2 s .  c o  m
    while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // SPOUTS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map22 = iprot.readMapBegin();
                    this.spouts = new HashMap<String, SpoutSpec>(2 * _map22.size);
                    for (int _i23 = 0; _i23 < _map22.size; ++_i23) {
                        String _key24; // required
                        SpoutSpec _val25; // required
                        _key24 = iprot.readString();
                        _val25 = new SpoutSpec();
                        _val25.read(iprot);
                        this.spouts.put(_key24, _val25);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // BOLTS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map26 = iprot.readMapBegin();
                    this.bolts = new HashMap<String, Bolt>(2 * _map26.size);
                    for (int _i27 = 0; _i27 < _map26.size; ++_i27) {
                        String _key28; // required
                        Bolt _val29; // required
                        _key28 = iprot.readString();
                        _val29 = new Bolt();
                        _val29.read(iprot);
                        this.bolts.put(_key28, _val29);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // STATE_SPOUTS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map30 = iprot.readMapBegin();
                    this.state_spouts = new HashMap<String, StateSpoutSpec>(2 * _map30.size);
                    for (int _i31 = 0; _i31 < _map30.size; ++_i31) {
                        String _key32; // required
                        StateSpoutSpec _val33; // required
                        _key32 = iprot.readString();
                        _val33 = new StateSpoutSpec();
                        _val33.read(iprot);
                        this.state_spouts.put(_key32, _val33);
                    }
                    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.TopologyInfo.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();//from   w ww .ja  va2 s  .  c om
    while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // ID
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.id = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // NAME
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.name = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // UPTIME_SECS
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.uptime_secs = iprot.readI32();
                set_uptime_secs_isSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 4: // EXECUTORS
            if (field.type == org.apache.thrift.protocol.TType.LIST) {
                {
                    org.apache.thrift.protocol.TList _list145 = iprot.readListBegin();
                    this.executors = new ArrayList<ExecutorSummary>(_list145.size);
                    for (int _i146 = 0; _i146 < _list145.size; ++_i146) {
                        ExecutorSummary _elem147; // required
                        _elem147 = new ExecutorSummary();
                        _elem147.read(iprot);
                        this.executors.add(_elem147);
                    }
                    iprot.readListEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 5: // STATUS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.status = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 6: // ERRORS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map148 = iprot.readMapBegin();
                    this.errors = new HashMap<String, List<ErrorInfo>>(2 * _map148.size);
                    for (int _i149 = 0; _i149 < _map148.size; ++_i149) {
                        String _key150; // required
                        List<ErrorInfo> _val151; // required
                        _key150 = iprot.readString();
                        {
                            org.apache.thrift.protocol.TList _list152 = iprot.readListBegin();
                            _val151 = new ArrayList<ErrorInfo>(_list152.size);
                            for (int _i153 = 0; _i153 < _list152.size; ++_i153) {
                                ErrorInfo _elem154; // required
                                _elem154 = new ErrorInfo();
                                _elem154.read(iprot);
                                _val151.add(_elem154);
                            }
                            iprot.readListEnd();
                        }
                        this.errors.put(_key150, _val151);
                    }
                    iprot.readMapEnd();
                }
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 513: // SCHED_STATUS
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.sched_status = iprot.readString();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 514: // OWNER
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.owner = 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:com.bigdata.dastor.thrift.AuthenticationRequest.java

License:Apache License

public void read(TProtocol iprot) throws TException {
    TField field;/*w w w .jav  a  2  s  . co  m*/
    iprot.readStructBegin();
    while (true) {
        field = iprot.readFieldBegin();
        if (field.type == TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // CREDENTIALS
            if (field.type == TType.MAP) {
                {
                    TMap _map16 = iprot.readMapBegin();
                    this.credentials = new HashMap<String, String>(2 * _map16.size);
                    for (int _i17 = 0; _i17 < _map16.size; ++_i17) {
                        String _key18;
                        String _val19;
                        _key18 = iprot.readString();
                        _val19 = iprot.readString();
                        this.credentials.put(_key18, _val19);
                    }
                    iprot.readMapEnd();
                }
            } 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.cloudera.flume.handlers.thrift.ThriftFlumeEvent.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();/*from  w w  w.  j  ava  2s.  co m*/
    while (true) {
        field = iprot.readFieldBegin();
        if (field.type == org.apache.thrift.protocol.TType.STOP) {
            break;
        }
        switch (field.id) {
        case 1: // TIMESTAMP
            if (field.type == org.apache.thrift.protocol.TType.I64) {
                this.timestamp = iprot.readI64();
                setTimestampIsSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 2: // PRIORITY
            if (field.type == org.apache.thrift.protocol.TType.I32) {
                this.priority = Priority.findByValue(iprot.readI32());
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 3: // BODY
            if (field.type == org.apache.thrift.protocol.TType.STRING) {
                this.body = iprot.readBinary();
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 4: // NANOS
            if (field.type == org.apache.thrift.protocol.TType.I64) {
                this.nanos = iprot.readI64();
                setNanosIsSet(true);
            } else {
                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);
            }
            break;
        case 5: // 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 6: // FIELDS
            if (field.type == org.apache.thrift.protocol.TType.MAP) {
                {
                    org.apache.thrift.protocol.TMap _map0 = iprot.readMapBegin();
                    this.fields = new HashMap<String, ByteBuffer>(2 * _map0.size);
                    for (int _i1 = 0; _i1 < _map0.size; ++_i1) {
                        String _key2;
                        ByteBuffer _val3;
                        _key2 = iprot.readString();
                        _val3 = iprot.readBinary();
                        this.fields.put(_key2, _val3);
                    }
                    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();

    // check for required fields of primitive type, which can't be checked in the validate method
    validate();
}