Commit 818172ee authored by Daniel Eggert's avatar Daniel Eggert
Browse files

streamlined scene update impl

parent 42afbb42
......@@ -43,7 +43,6 @@ public class DbUtils {
if (cli.hasOption(OP_TRANSFER_CONFIG)) {
transferConfig();
} else if (cli.hasOption(OP_SCENE_STATE)) {
System.err.println("not yet implemented");
transferSceneState();
} else {
printHelp(options);
......@@ -89,10 +88,11 @@ public class DbUtils {
Connection dstDb = getDstDb();
// reset proc_level to metadata for all scenes in dst db
dstDb.prepareStatement("update scenes set proc_level='METADATA'::proc_level;").executeUpdate();
PreparedStatement updateScene = dstDb.prepareStatement("update scenes set proc_level='DOWNLOADED'::proc_level, filename=? where entityid=? and datasetid=?;");
PreparedStatement updateSentinelScene = dstDb.prepareStatement("update scenes set proc_level='DOWNLOADED'::proc_level, entityid=? where filename=? and datasetid=?;");
dstDb.prepareStatement("update scenes set proc_level='METADATA'::proc_level where id in (select id from scenes where proc_level!='METADATA'::proc_level);").executeUpdate();
dstDb.commit();
PreparedStatement updateScene = dstDb.prepareStatement("update scenes set proc_level='DOWNLOADED'::proc_level, filename=? where id in (select id from scenes where entityid=? and datasetid=? limit 1);");
PreparedStatement updateSentinelScene = dstDb.prepareStatement("update scenes set proc_level='DOWNLOADED'::proc_level, entityid=? where id in (select id form scenes where filename=? and datasetid=? limit 1);");
// get list of downloaded scenes from src database
ResultSet rs = srcDb.prepareStatement("select filename, entityid, datasetid from scenes where proc_level='DOWNLOADED'::proc_level;").executeQuery();
......
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