Skip to content
This repository has been archived by the owner on Apr 4, 2019. It is now read-only.

Commit

Permalink
more logging of slow operations #250
Browse files Browse the repository at this point in the history
  • Loading branch information
abyrd committed Nov 23, 2015
1 parent 6e24894 commit 072356c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/main/java/models/Bundle.java
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public void save() {

bundleData.save(id, this);

LOG.info("saved bundle " +id);
LOG.info("Saved bundle {} and committed data.", id);
}

@JsonIgnore
Expand Down Expand Up @@ -210,7 +210,11 @@ public void processGtfs(final File gtfsFile, final String bundleType, final Stri
}

public void writeToClusterCache () throws IOException {
// These log messages should be clearer and located down inside the ClusterGraphService,
// but that class is in the OTP project so I'm just logging the operation at a higher stack frame.
LOG.info("Adding network inputs to cluster cache and uploading to S3 (if needed).");
clusterGraphService.addGraphFile(getBundleDataPath());
LOG.info("Done adding network inputs to cluster cache and uploading to S3 (if needed).");
}

public void processGtfs () {
Expand Down Expand Up @@ -363,7 +367,7 @@ static public LocalDate fromInt (int date) {
int day = date % 100;
return LocalDate.of(year, month, day);
}

static public void writeAllToClusterCache () throws IOException {
// two pass loop to avoid concurrent modification
List<String> bundlesToReprocess = new ArrayList<>();
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/models/Shapefile.java
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,14 @@ public Integer getFeatureCount() {
}

private STRtree buildIndex() {
LOG.info("building index for shapefile " + this.id);

LOG.info("Building index for shapefile " + this.id);
// it's not possible to make an R-tree with only one node, so we make an r-tree with two
// nodes and leave one empty.
STRtree spatialIndex = new STRtree(Math.max(getShapeFeatureStore().size(), 2));

for(ShapeFeature feature : getShapeFeatureStore().getAll()) {
spatialIndex.insert(feature.geom.getEnvelopeInternal(), feature);
}

LOG.info("Done building index for shapefile " + this.id);
return spatialIndex;
}

Expand Down

0 comments on commit 072356c

Please sign in to comment.