Created
July 12, 2016 06:51
-
-
Save kristofmeixner/8703ea098bcec52a2233537aaecc9f20 to your computer and use it in GitHub Desktop.
Retrieving the dataset commit and re-executing the query
This file contains hidden or 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
String workingTreeDir = getWorkingTreeDir(); | |
Git git = new Git(repository)); | |
// Checking out the query branch and loading the query | |
git.checkout().setName("refs/heads/queries").call(); | |
Path path = Paths.get(workingTreeDir, DigestUtils.sha1Hex(pid) + ".query"); | |
Properties properties = properties.load(Files.newBufferedReader(path)) | |
// Extracting the commit hash from the metadata file | |
Query query = new DefaultQuery(properties.getProperty("commit")); | |
String revision = query.getCommit().getRevisionId(); | |
// Retrieving the correct commit that contains the dataset | |
git.checkout().setName(revision).call(); | |
ObjectId head = repository.resolve(Constants.HEAD); | |
// Re-executing the query on the dataset | |
TableModel tableModel = retrieveDatasetForQuery(workingTreeDir, query.getQuery(), head); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment