Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 86344bc

Browse files
committed
Update for scheduler support (fixes)
1 parent 89a126c commit 86344bc

4 files changed

Lines changed: 9 additions & 10 deletions

File tree

  • eu.dariolucia.reatmetric.driver.spacecraft.test/src/main/java/eu/dariolucia/reatmetric/driver/spacecraft/test
  • eu.dariolucia.reatmetric.driver.spacecraft/src/main/java/eu/dariolucia/reatmetric/driver/spacecraft/packet
  • eu.dariolucia.reatmetric.persist/src/main/java/eu/dariolucia/reatmetric/persist/services
  • eu.dariolucia.reatmetric.processing/src/main/java/eu/dariolucia/reatmetric/processing/impl/processors

eu.dariolucia.reatmetric.driver.spacecraft.test/src/main/java/eu/dariolucia/reatmetric/driver/spacecraft/test/SpacecraftModel.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,6 @@ private void sample() {
186186
lastSampleGenerationTime = genTime;
187187
double numPacketsPerSecond = (numPackets / (millis/1000.0));
188188
double numFramesPerSecond = (numFrames / (millis/1000.0));
189-
// FIXME: Decomment once investigation finished
190189
System.out.println("Frames per second: " + (int) numFramesPerSecond + ", packets per second: " + numPacketsPerSecond);
191190
}
192191
}

eu.dariolucia.reatmetric.driver.spacecraft/src/main/java/eu/dariolucia/reatmetric/driver/spacecraft/packet/TmPacketProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public Instant toObt(Instant utc) {
100100
Thread t = new Thread(r, "TM Packet Processing - Decoder");
101101
t.setDaemon(true);
102102
return t;
103-
}); // TODO: make it configurable
103+
});
104104
private final ExecutorService notifierService = Executors.newFixedThreadPool(1, (r) -> {
105105
Thread t = new Thread(r, "TM Packet Processing - Notifier");
106106
t.setDaemon(true);

eu.dariolucia.reatmetric.persist/src/main/java/eu/dariolucia/reatmetric/persist/services/ScheduledActivityDataArchive.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ protected String buildRetrieveQuery(Instant startTime, IUniqueId internalId, int
173173
List<String> resourcesList = new ArrayList<>(filter.getResourceList());
174174
query.append("AND (");
175175
for(int i = 0; i < resourcesList.size(); ++i) {
176-
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'"); // TODO check if there is a contains function
176+
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'");
177177
if(i != resourcesList.size() - 1) {
178178
query.append(" OR ");
179179
}
@@ -284,7 +284,7 @@ private List<ScheduledActivityData> doRetrieve(Connection connection, Instant ti
284284
List<String> resourcesList = new ArrayList<>(filter.getResourceList());
285285
query.append("AND (");
286286
for(int i = 0; i < resourcesList.size(); ++i) {
287-
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'"); // TODO check if there is a contains function
287+
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'");
288288
if(i != resourcesList.size() - 1) {
289289
query.append(" OR ");
290290
}
@@ -344,7 +344,7 @@ protected String getRemoveQuery(IUniqueId id) {
344344
protected String getRemoveQuery(ScheduledActivityDataFilter filter) {
345345
StringBuilder query = new StringBuilder("DELETE " +
346346
"FROM SCHEDULED_ACTIVITY_DATA_TABLE " +
347-
"WHERE TRUE "); // TODO check if it works
347+
"WHERE TRUE "); // Use to simplify the cascade of conditions
348348
// process filter
349349
if(filter != null && !filter.isClear()) {
350350
if(filter.getParentPath() != null) {
@@ -366,7 +366,7 @@ protected String getRemoveQuery(ScheduledActivityDataFilter filter) {
366366
List<String> resourcesList = new ArrayList<>(filter.getResourceList());
367367
query.append("AND (");
368368
for(int i = 0; i < resourcesList.size(); ++i) {
369-
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'"); // TODO check if there is a contains function
369+
query.append("Resources LIKE '").append("% ").append(resourcesList.get(i)).append(" %'");
370370
if(i != resourcesList.size() - 1) {
371371
query.append(" OR ");
372372
}

eu.dariolucia.reatmetric.processing/src/main/java/eu/dariolucia/reatmetric/processing/impl/processors/EventProcessor.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,17 +167,17 @@ public List<AbstractDataItem> process(EventOccurrence newValue) {
167167
// Replace the state
168168
this.state = this.builder.build(new LongUniqueId(processor.getNextId(EventData.class)));
169169
generatedStates.add(this.state);
170-
// Log the event // FIXME: decomment once testing is done
170+
// Log the event
171171
switch(definition.getSeverity()) {
172172
case ALARM:
173173
case ERROR:
174-
// LOG.log(Level.SEVERE, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
174+
LOG.log(Level.SEVERE, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
175175
break;
176176
case WARN:
177-
// LOG.log(Level.WARNING, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
177+
LOG.log(Level.WARNING, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
178178
break;
179179
case INFO:
180-
// LOG.log(Level.INFO, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
180+
LOG.log(Level.INFO, "Event " + getPath() + " raised: " + getDefinition().getDescription() + " - Source: " + this.state.getSource());
181181
break;
182182
}
183183
}

0 commit comments

Comments
 (0)