-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
101 additions
and
279 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
205 changes: 0 additions & 205 deletions
205
...o-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/server/tasks/DumpChangelogsTask.java
This file was deleted.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
...uctoo-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/server/tasks/RemoveOldStore.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
package nl.knaw.huygens.timbuctoo.server.tasks; | ||
|
||
import com.sleepycat.je.DatabaseNotFoundException; | ||
import io.dropwizard.servlets.tasks.Task; | ||
import nl.knaw.huygens.timbuctoo.v5.berkeleydb.BdbEnvironmentCreator; | ||
import nl.knaw.huygens.timbuctoo.v5.dataset.DataSetRepository; | ||
import nl.knaw.huygens.timbuctoo.v5.dataset.dto.DataSet; | ||
|
||
import java.io.PrintWriter; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class RemoveOldStore extends Task { | ||
private final BdbEnvironmentCreator dataStoreFactory; | ||
private final DataSetRepository dataSetRepository; | ||
|
||
public RemoveOldStore(BdbEnvironmentCreator dataStoreFactory, DataSetRepository dataSetRepository) { | ||
super("removeOldStore"); | ||
this.dataStoreFactory = dataStoreFactory; | ||
this.dataSetRepository = dataSetRepository; | ||
} | ||
|
||
@Override | ||
public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception { | ||
for (DataSet dataSet : dataSetRepository.getDataSets()) { | ||
output.println("Remove old store from dataset: " + dataSet.getMetadata().getCombinedId()); | ||
output.flush(); | ||
|
||
try { | ||
dataStoreFactory.removeDatabase( | ||
dataSet.getMetadata().getOwnerId(), | ||
dataSet.getMetadata().getDataSetId(), | ||
"rdfDataOld" | ||
); | ||
} catch (DatabaseNotFoundException e) { | ||
e.printStackTrace(output); | ||
} | ||
|
||
output.println("Removed old store from dataset: " + dataSet.getMetadata().getCombinedId()); | ||
output.flush(); | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...stancev4/src/main/java/nl/knaw/huygens/timbuctoo/v5/berkeleydb/BdbEnvironmentCreator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.