-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[21413] Record data in SQL #173
base: main
Are you sure you want to change the base?
Conversation
d43dff9
to
1cee82a
Compare
1cee82a
to
7b12ed7
Compare
9a05ffd
to
85807da
Compare
7a10ed7
to
c1ec0ab
Compare
c1ec0ab
to
d27b19c
Compare
d27b19c
to
057bb4a
Compare
3fad8fa
to
52f80f4
Compare
52f80f4
to
fc38df2
Compare
fc38df2
to
e6572a8
Compare
e6572a8
to
c285f07
Compare
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
e2f98d6
to
70bce7a
Compare
70bce7a
to
8d2f52a
Compare
8d2f52a
to
74d9110
Compare
Signed-off-by: Juan Lopez Fernandez <juanlopez@eprosima.com>
74d9110
to
d74fe42
Compare
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
@@ -16,8 +16,10 @@ | |||
# CMake build rules for DDS Recorder Submodule | |||
############################################################################### | |||
cmake_minimum_required(VERSION 3.5) | |||
set(CMAKE_SYSTEM_VERSION 10.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is the best approach. First, apparently this only makes sense in Windows, so it should be within an if. I also wonder if we should be imposing the sdk version here or we should investigate which versions are compatible with sqlite and warn the user she should be compiling with one of those (and specify it via cmake args). Otherwise, we could be forcing a version not available in a user's machine when another compatible one is present.
|
||
# Done this to set machine architecture and be able to call cmake_utils | ||
enable_language(C) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this, and the new statement above should only be added to blackbox tests using sqlite.
if(!config_loaded) | ||
{ | ||
configuration = eprosima::ddsrecorder::yaml::RecorderConfiguration(commandline_args.file_path); | ||
} | ||
else | ||
{ | ||
config_loaded = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is an improvement. I agree it would be better to avoid two immediate consecutive configuration loads, as it is the case when the initial state is running or paused. But a long time might have passed when coming from a stopped state, and the user might have changed the allowlist in the meantime.
@@ -47,8 +46,8 @@ ENUMERATION_BUILDER( | |||
DdsRecorderStateCode, | |||
STOPPED, //! Internal entities are not created and thus no messages are received. | |||
SUSPENDED, //! Messages are received (internal entities created) but discarded. | |||
RUNNING, //! Messages are stored in MCAP file. | |||
PAUSED //! Messages are stored in buffer and stored in MCAP file if event triggered. | |||
RUNNING, //! Messages are stored in MCAP/SQL file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NIT: SQL file? or database?
@@ -81,15 +82,16 @@ class DdsRecorder | |||
* | |||
* @param configuration: Structure encapsulating all recorder configuration options. | |||
* @param init_state: Initial instance state (RUNNING/PAUSED/SUSPENDED/STOPPED). | |||
* @param event_handler: Reference to event handler used for thread synchronization in main application. | |||
* @param file_tracker: Reference to file tracker used to manage mcap files. | |||
* @param mcap_file_tracker: Reference to file tracker used to manage mcap files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please restore event_handler.
publishTime = to_mcap_timestamp(publish_time); | ||
logTime = to_mcap_timestamp(log_time); | ||
|
||
if (log_publish_time) | ||
{ | ||
log_time = publish_time; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
publishTime = to_mcap_timestamp(publish_time); | |
logTime = to_mcap_timestamp(log_time); | |
if (log_publish_time) | |
{ | |
log_time = publish_time; | |
} | |
publishTime = to_mcap_timestamp(publish_time); | |
if (log_publish_time) | |
{ | |
logTime = publishTime; | |
} | |
else | |
{ | |
logTime = to_mcap_timestamp(log_time); | |
} |
|
||
pending_samples.pop_front(); | ||
} | ||
process_new_sample_nts_(std::make_shared<const McapMessage>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the fact that you create the message for dropping it later on if state is stopped.
} | ||
else | ||
{ | ||
// No schema available + no pending samples -> Add to buffer with blank schema |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally prefer to have the explicit comment to make clear that doing nothing is the intended purpose.
// NOTE: the outdated pending samples are not removed since they must be written as soon as they receive their type. | ||
|
||
// Buffer | ||
samples_buffer_.remove_if([&](const auto sample) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why pass by value now? Avoid copy.
if (pending_samples_.find(type_name) != pending_samples_.end() || | ||
(state_ == BaseHandlerStateCode::PAUSED && | ||
pending_samples_paused_.find(type_name) != pending_samples_paused_.end())) | ||
{ | ||
add_pending_samples_nts_(type_name); | ||
dump_pending_samples_nts_(type_name); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please encapsulate this in a parent method?
Signed-off-by: Eugenio Collado <eugeniocollado@eprosima.com>
3c78a92
to
a462998
Compare
Code improvements:
Configuration improvements:
Bug fixes:
Potential TODOs: