| 644 | } |
| 645 | |
| 646 | void received(queue<Event> events) |
| 647 | { |
| 648 | while (!events.empty()) { |
| 649 | Event event = events.front(); |
| 650 | events.pop(); |
| 651 | |
| 652 | switch (event.type()) { |
| 653 | case Event::SUBSCRIBED: { |
| 654 | frameworkInfo.mutable_id()-> |
| 655 | CopyFrom(event.subscribed().framework_id()); |
| 656 | |
| 657 | state = SUBSCRIBED; |
| 658 | |
| 659 | cout << "Subscribed with ID " << frameworkInfo.id() << endl; |
| 660 | break; |
| 661 | } |
| 662 | |
| 663 | case Event::OFFERS: { |
| 664 | offers(google::protobuf::convert(event.offers().offers())); |
| 665 | break; |
| 666 | } |
| 667 | |
| 668 | case Event::UPDATE: { |
| 669 | update(event.update().status()); |
| 670 | break; |
| 671 | } |
| 672 | |
| 673 | case Event::ERROR: { |
| 674 | EXIT(EXIT_FAILURE) |
| 675 | << "Received an ERROR event: " << event.error().message(); |
| 676 | |
| 677 | break; |
| 678 | } |
| 679 | |
| 680 | case Event::HEARTBEAT: |
| 681 | case Event::INVERSE_OFFERS: |
| 682 | case Event::FAILURE: |
| 683 | case Event::RESCIND: |
| 684 | case Event::RESCIND_INVERSE_OFFER: |
| 685 | case Event::UPDATE_OPERATION_STATUS: |
| 686 | case Event::MESSAGE: { |
| 687 | break; |
| 688 | } |
| 689 | |
| 690 | case Event::UNKNOWN: { |
| 691 | LOG(WARNING) << "Received an UNKNOWN event and ignored"; |
| 692 | break; |
| 693 | } |
| 694 | } |
| 695 | } |
| 696 | } |
| 697 | |
| 698 | void update(const TaskStatus& status) |
| 699 | { |
nothing calls this directly
no test coverage detected