Skip to content

Commit

Permalink
icewind: fix DataSourfce close suppresion for initdb
Browse files Browse the repository at this point in the history
  • Loading branch information
pdowler committed Dec 18, 2024
1 parent 22eb3aa commit 2708757
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 31 deletions.
2 changes: 1 addition & 1 deletion icewind/VERSION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## deployable containers have a semantic and build tag
# semantic version tag: major.minor[.patch]
# build version tag: timestamp
VER=0.10.1
VER=0.10.2
TAGS="${VER} ${VER}-$(date --utc +"%Y%m%dT%H%M%S")"
unset VER
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public CaomHarvester(HarvestSource src, List<String> collections, HarvestDestina

ConnectionConfig cc = new ConnectionConfig(null, null, dest.getUsername(), dest.getPassword(),
HarvestDestination.POSTGRESQL_DRIVER, dest.getJdbcUrl());
DataSource ds = DBUtil.getDataSource(cc);
DataSource ds = DBUtil.getDataSource(cc, true, true);
this.initdb = new InitDatabase(ds, null, dest.getSchema());
}

Expand Down
2 changes: 0 additions & 2 deletions icewind/src/main/java/org/opencadc/icewind/Harvester.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ protected void initHarvestState(DataSource ds, Class c) {
log.debug("creating HarvestState tracker: " + cname + " in " + dest.getSchema());
this.harvestStateDAO = new PostgresqlHarvestStateDAO(ds, null, dest.getSchema());

log.debug("creating HarvestSkip tracker: " + cname + " in " + dest.getSchema());

this.source = src.getIdentifier(collection).toASCIIString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ private void init(int nthreads) {
this.destObservationDAO = new ObservationDAO();
destObservationDAO.setConfig(destConfig);
destObservationDAO.setOrigin(false); // copy as-is

initHarvestState(destObservationDAO.getDataSource(), Observation.class);
log.debug("creating HarvestSkip tracker: " + cname + " in " + dest.getSchema());
this.harvestSkipDAO = new HarvestSkipURIDAO(destObservationDAO.getDataSource(), null, dest.getSchema());

if (srcRepoClient.isObsAvailable()) {
ready = true;
Expand Down Expand Up @@ -834,31 +837,4 @@ public int compare(SkippedWrapperURI o1, SkippedWrapperURI o2) {
return o1.skip.getTryAfter().compareTo(o2.skip.getTryAfter());
}
}

/*
* private List<SkippedWrapperURI<ObservationState>> getSkippedState(Date
* start) { log.info("harvest window (skip): " + format(start) + " [" +
* batchSize + "]" + " source = " + source + " cname = " + cname);
* List<HarvestSkipURI> skip = harvestSkip.get(source, cname, start);
*
* List<SkippedWrapperURI<ObservationState>> ret = new
* ArrayList<SkippedWrapperURI<ObservationState>>(skip.size()); for
* (HarvestSkipURI hs : skip) { ObservationState o = null;
* log.debug("getSkipped: " + hs.getSkipID()); log.debug("start: " + start);
*
* ObservationResponse wr = srcObservationService.get(src.getCollection(),
* hs.getSkipID(), start);
*
* if (wr != null && wr.getObservationState() != null) o =
* wr.getObservationState();
*
* if (o != null) { ret.add(new SkippedWrapperURI<ObservationState>(o, hs));
* } } return ret; }
*/
@Override
protected void initHarvestState(DataSource ds, Class c) {
super.initHarvestState(ds, c);
this.harvestSkipDAO = new HarvestSkipURIDAO(ds, null, dest.getSchema());
}

}

0 comments on commit 2708757

Please sign in to comment.