Support nodes rebooting
We have log files which span a reboot. We want to be able to replay the
timeline across that reboot so we can run simulations and everything
else interesting.
This requires a bunch of stuff, unfortunately.
The most visible one is that we need to be able to "reboot" a node.
This means we need a way of starting it up and stopping it. There are
now OnStartup and OnShutdown handlers in NodeEventLoopFactory to serve
this purpose, and better application context tracking to make it easier
to start and stop applications through a virtual starter.
This requires LogReader and the simulated network bridge to be
refactored to support nodes coming and going while the main application
continues to run.
From there, everything else is just a massive amount of plumbing of the
BootTimestamp through everything just short of the user. Boot UUIDs
were put in TimeConverter so everything related to rebooting is all
nicely together.
Change-Id: I2cfb659c5764c1dd80dc66f33cfab3937159e324
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/configuration.cc b/aos/configuration.cc
index 24e15d9..2b9ac6d 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -1122,6 +1122,13 @@
LOG(FATAL) << "Unknown logger config " << static_cast<int>(channel->logger());
}
+size_t ConnectionCount(const Channel *channel) {
+ if (!channel->has_destination_nodes()) {
+ return 0;
+ }
+ return channel->destination_nodes()->size();
+}
+
const Connection *ConnectionToNode(const Channel *channel, const Node *node) {
if (!channel->has_destination_nodes()) {
return nullptr;