Track which types of data are stored in which files

This sets us up to pre-load timestamps but not data when sorting log
files by recording the types of messages in each log file.  The goal is
to be able to load all timestamps and remote timestamps completely into
RAM at the beginning if they are in separate files, and then reduce our
data buffers to something small.  By loading all timestamps into RAM at
the beginning efficiently, we should be able to solve the entire class
of frozen bugs.

Change-Id: Ib21f9d3b39356abad6b912dd5108f971a9ed12ce
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/events/logging/log_writer.cc b/aos/events/logging/log_writer.cc
index 1e0f7c8..69b0542 100644
--- a/aos/events/logging/log_writer.cc
+++ b/aos/events/logging/log_writer.cc
@@ -708,7 +708,8 @@
         static_cast<int>(node_index_) != f.data_node_index
             ? f.fetcher->context().monotonic_remote_time
             : f.fetcher->context().monotonic_event_time;
-    writer->CopyMessage(&coppier, source_node_boot_uuid, start, message_time);
+    writer->CopyDataMessage(&coppier, source_node_boot_uuid, start,
+                            message_time);
     RecordCreateMessageTime(start, coppier.end_time(), f);
 
     VLOG(2) << "Wrote data as node " << FlatbufferToJson(node_)
@@ -733,8 +734,9 @@
     ContextDataCopier coppier(f.fetcher->context(), f.channel_index,
                               LogType::kLogDeliveryTimeOnly, event_loop_);
 
-    timestamp_writer->CopyMessage(&coppier, event_loop_->boot_uuid(), start,
-                                  f.fetcher->context().monotonic_event_time);
+    timestamp_writer->CopyTimestampMessage(
+        &coppier, event_loop_->boot_uuid(), start,
+        f.fetcher->context().monotonic_event_time);
     RecordCreateMessageTime(start, coppier.end_time(), f);
 
     VLOG(2) << "Wrote timestamps as node " << FlatbufferToJson(node_)
@@ -784,7 +786,7 @@
     RemoteMessageCopier coppier(msg, channel_index, monotonic_timestamp_time,
                                 event_loop_);
 
-    contents_writer->CopyMessage(
+    contents_writer->CopyRemoteTimestampMessage(
         &coppier, UUID::FromVector(msg->boot_uuid()), start,
         monotonic_clock::time_point(
             chrono::nanoseconds(msg->monotonic_sent_time())));