Skip to content
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

Persist zoom factor = 1 cells in MongoDB and support VSI messages #1

Open
wants to merge 60 commits into
base: master
Choose a base branch
from

Conversation

johnmartel
Copy link

The Canadian Coast Guard is using this project and wanted to have data persisted in Mongo so that coverage data is not lost when the computer running the software crashes.

The simple mechanism provided in this PR simply uses a background thread to persist every X minutes, which is configurable in the coverage-sample.xml file used to configure the system. The whole state of coverage data, along with a timestamp, is persisted as a Mongo document in the coverageData collection of the configured database. Therefore, data can grow rather fast as the software runs for longer period of times. No prune mechanism has been added yet. Only the sliding windows pruning mechanism already there exists.

Connection to the MongoDB server is kept as simple as possible: no authentication mechanism is supported right now.

When merging this PR, one should be aware that the version number in pom.xml now assumes that semantic versioning is used and that the CCG pre-release identifier has been added to identify my current builds as being from the fork. I think you should keep the version number as is (unless you have your own reasons for changing the version number), but get rid of the pre-release identifier, as this will be merged in the original, official repo. A new official distribution with these changes would be greatly appreciated.

Please reach out with any comments/questions :)

Thanks!

johnmartel and others added 30 commits February 21, 2017 10:03
Any `GET` request to `/coverage/rest/status` would fail with an NPE
until a first message was received, preventing usage such as dragging
the map around.
This assumes [semantic versioning](http://semver.org/) is used. The
pre-release identifier `CCG` means `Canadian Coast Guard`.
Tests sometimes timeout on Travis, so this tries to fix the issue by
allowing more time to complete operations.
This allows the user to see the coverage as it was when the coverage
data was last saved.
After discussion with the CCG engineer, it has been agreed that minutes
are fine-grained enough for their needs.
The thread pool created with
`Executors#newSingleThreadScheduledExecutor()` ensured that if the
thread dies, a new one will be created for future task execution.
The previous filter would filter out too many messages, creating gaps in
the canadian coverage. During winter, in the Saint-Lawrence Seaway,
ships could be slowed down dramatically or stopped due to ice, but there
is still a need to receive the messages and calculate coverage for
these.
The canadian data shows that many messages are received with a CoG of
360, which is basically the same as 0. Since we do not filter CoGs of 0,
I fail to see why we would filter out those messages with 360.
…d of processing 10000 times the same message
Modify ExportCell and JsonConverter to support VSI messages
Handle display of VSI messages in map
@johnmartel
Copy link
Author

johnmartel commented Mar 26, 2017

The DMA logo was moved to bottom right corner, as it was sometimes getting in the way when the left panels were expanded on a small screen.

Canadian Coast Guard prefers to have Red < 20% < Yellow <= 50% for
number of messages received and Red < -107dBm < Yellow <= -101dBm for
VSI coverage.
Also increase lightly side panel's size to show VSI thresholds on single
line.
The previous range was too broad for actually plausible values, making
slight corrections using the slider difficult to do.
The AisBus can overflow quite fast with the default configuration, so it
may prove useful to configure the queue size.
Some data-related errors can be clogging logs if they happen for every
packet received, making logs impossible to read. By separating errors
from other log messages, it is easier to go through the logs.
This gives an idea when reading the logs about the state of the loaded
data at startup.
Large window sizes such as `1000` would trigger an incorrect trimmed
window size due to int arithmetic overflow.
Handling AIS packets takes time, as an AIS custom message is extracted
from the packet and is added to a buffer that records the source of the
message. Over time, this can lead to overflow on the AisBus side as
packets are not consumed as fast as they are being received.

This introduces a `received but yet unhandled` buffer on the receiver
side and uses a fixed thread pool to process and remove packets stored
in that buffer. A configuration option is also introduced to restrain
this buffer in size and allow overflowing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants