Commit f684b747 authored by neop's avatar neop
Browse files

reenable rest of sensor pipeline

parent 7e0f6e49
......@@ -2,7 +2,6 @@ package sensor2graph;
import java.io.*;
import java.time.Duration;
import java.time.Instant;
import java.util.concurrent.*;
import java.util.logging.*;
import java.util.stream.*;
......@@ -46,7 +45,7 @@ class DayUploader {
Main.glogger.info("uploading sensor " + file_uri);
try (var session = Main.driver.session(SessionConfig.forDatabase(Main.database_name))) {
// sensor.process(session, transaction_config);
sensor.process(session, transaction_config);
}
Main.glogger.fine("uploaded sensor " + file_uri);
......
......@@ -3,7 +3,6 @@ package sensor2graph;
import com.influxdb.client.*;
import org.neo4j.driver.*;
import org.neo4j.driver.Config.*;
import okhttp3.OkHttpClient;
......@@ -112,22 +111,9 @@ public class Main {
}
private static void run() throws Exception {
System.out.println("starting influx query");
var tables = influxDBClient.getQueryApi().query(String.format("from(bucket:\"%s\") |> range(start: -600d1m, stop: -600d)", Main.influxdb_database_name));
System.out.println("hello");
for (var fluxTable : tables) {
System.out.println("table " + fluxTable);
for (var record : fluxTable.getRecords()) {
System.out.println(String.format("%s %s: %s %s", record.getTime(), record.getMeasurement(), record.getField(), record.getValue()));
record.getValues().forEach((key, value) -> System.out.println(key + ":" + value));
}
}
System.out.println("finished influx query");
// try_uploading_failed_sensors();
// upload_all_days();
// try_uploading_failed_sensors();
try_uploading_failed_sensors();
upload_all_days();
try_uploading_failed_sensors();
}
private static void try_uploading_failed_sensors() throws Exception {
......@@ -332,7 +318,7 @@ public class Main {
private static void test_auth() {
Main.logger.fine("testing authentication");
Main.logger.fine("testing neo4j authentication");
try (Session session = Main.driver.session(SessionConfig.forDatabase(Main.database_name))) {
session.readTransaction(tx -> tx.run(new Query("match (n) return n limit 3")));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment