-
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
22 changed files
with
505 additions
and
140 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
38 changes: 38 additions & 0 deletions
38
...oo-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/server/tasks/RebuildSchemaTask.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,38 @@ | ||
package nl.knaw.huygens.timbuctoo.server.tasks; | ||
|
||
import io.dropwizard.servlets.tasks.Task; | ||
import nl.knaw.huygens.timbuctoo.v5.dataset.DataSetRepository; | ||
import nl.knaw.huygens.timbuctoo.v5.dataset.dto.DataSet; | ||
import nl.knaw.huygens.timbuctoo.v5.datastores.implementations.bdb.BdbQuadStore; | ||
import nl.knaw.huygens.timbuctoo.v5.datastores.implementations.bdb.BdbSchemaStore; | ||
|
||
import java.io.PrintWriter; | ||
import java.util.List; | ||
import java.util.Map; | ||
|
||
public class RebuildSchemaTask extends Task { | ||
private final DataSetRepository dataSetRepository; | ||
|
||
public RebuildSchemaTask(DataSetRepository dataSetRepository) { | ||
super("rebuildSchema"); | ||
this.dataSetRepository = dataSetRepository; | ||
} | ||
|
||
@Override | ||
public void execute(Map<String, List<String>> parameters, PrintWriter output) throws Exception { | ||
for (DataSet dataSet : dataSetRepository.getDataSets()) { | ||
rebuildSchemaFor(dataSet, output); | ||
} | ||
} | ||
|
||
private void rebuildSchemaFor(DataSet dataSet, PrintWriter output) { | ||
output.println("Rebuilding schema for dataset: " + dataSet.getMetadata().getCombinedId()); | ||
output.flush(); | ||
|
||
BdbSchemaStore schemaStore = (BdbSchemaStore) dataSet.getSchemaStore(); | ||
schemaStore.rebuildSchema((BdbQuadStore) dataSet.getQuadStore()); | ||
|
||
output.println("Finished rebuilding schema of dataset: " + dataSet.getMetadata().getCombinedId()); | ||
output.flush(); | ||
} | ||
} |
21 changes: 18 additions & 3 deletions
21
timbuctoo-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/util/Streams.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
6 changes: 3 additions & 3 deletions
6
timbuctoo-instancev4/src/main/java/nl/knaw/huygens/timbuctoo/v5/dataset/ChangeFetcher.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 |
---|---|---|
@@ -1,14 +1,14 @@ | ||
package nl.knaw.huygens.timbuctoo.v5.dataset; | ||
|
||
import nl.knaw.huygens.timbuctoo.v5.datastores.quadstore.dto.CursorQuad; | ||
import nl.knaw.huygens.timbuctoo.v5.datastores.quadstore.dto.Direction; | ||
import nl.knaw.huygens.timbuctoo.v5.datastores.quadstore.dto.QuadGraphs; | ||
|
||
import java.util.stream.Stream; | ||
|
||
public interface ChangeFetcher { | ||
|
||
Stream<CursorQuad> getPredicates(String subject, boolean getRetracted, boolean getUnchanged, boolean getAsserted); | ||
Stream<QuadGraphs> getPredicates(String subject, boolean getRetracted, boolean getUnchanged, boolean getAsserted); | ||
|
||
Stream<CursorQuad> getPredicates(String subject, String predicate, Direction direction, boolean getRetracted, | ||
Stream<QuadGraphs> getPredicates(String subject, String predicate, Direction direction, boolean getRetracted, | ||
boolean getUnchanged, boolean getAsserted); | ||
} |
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
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.