/** * @return the {@link RevTree} that represents the indexed tree */ public RevTree indexTree() { return indexdb.getTree(indexTree); }
/** * @return the {@link RevTree} that represents the indexed tree */ public RevTree indexTree() { return indexdb.getTree(indexTree); }
protected @Override void compute() { List<TreeCopyTask> treeTasks = new ArrayList<>(); Set<IndexTreeMapping> mappings = new HashSet<>(); try (AutoCloseableIterator<IndexTreeMapping> indexMappings = src .resolveIndexedTrees(index)) { mappings = Sets.newHashSet(indexMappings); } for (IndexTreeMapping mapping : mappings) { ObjectId indexTreeId = mapping.indexTree; if (!target.exists(indexTreeId)) { TreeCopyTask task = new TreeCopyTask(src.getTree(indexTreeId), src, target); treeTasks.add(task); } } super.invokeAll(treeTasks); IndexInfo targetIndex = target.createIndexInfo(index.getTreeName(), index.getAttributeName(), index.getIndexType(), index.getMetadata()); mappings.forEach(m -> target.addIndexedTree(targetIndex, m.featureTree, m.indexTree)); }
oldCanonicalTree.getId()); if (oldIndexTreeId.isPresent()) { oldIndexTree = indexDatabase.getTree(oldIndexTreeId.get()); } else { oldIndexTree = RevTree.EMPTY;
oldCanonicalTree.getId()); if (oldIndexTreeId.isPresent()) { oldIndexTree = indexDatabase.getTree(oldIndexTreeId.get()); } else { oldIndexTree = RevTree.EMPTY;
@SuppressWarnings("unchecked") @Then("^the ([^\"]*) repository's \"([^\"]*)\" index should not track the extra attribute \"([^\"]*)\"$") public void verifyIndexNotExtraAttributes(String repositoryName, String headRef, String attributeName) throws Throwable { Repository repo = context.getRepo(repositoryName); Optional<ObjectId> indexTreeId = resolveIndexTreeId(repositoryName, headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); if (extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)) { Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertFalse(attributeData.containsKey(attributeName)); } } // add the repo to the set so it can be closed openedRepos.add(repositoryName); }
@SuppressWarnings("unchecked") @Then("^the ([^\"]*) repository's \"([^\"]*)\" index should track the extra attribute \"([^\"]*)\"$") public void verifyIndexExtraAttributes(String repositoryName, String headRef, String attributeName) throws Throwable { Repository repo = context.getRepo(repositoryName); Optional<ObjectId> indexTreeId = resolveIndexTreeId(repositoryName, headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); assertTrue(extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)); Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertTrue(attributeData.containsKey(attributeName)); } // add the repo to the set so it can be closed openedRepos.add(repositoryName); }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should not track the extra attribute \"([^\"]*)\"$") public void verifyIndexNotExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); if (extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)) { Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertFalse(attributeData.containsKey(attributeName)); } } }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should not track the extra attribute \"([^\"]*)\"$") public void verifyIndexNotExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); if (extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)) { Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertFalse(attributeData.containsKey(attributeName)); } } }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should not track the extra attribute \"([^\"]*)\"$") public void verifyIndexNotExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); if (extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)) { Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertFalse(attributeData.containsKey(attributeName)); } } }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should track the extra attribute \"([^\"]*)\"$") public void verifyIndexExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); assertTrue(extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)); Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertTrue(attributeData.containsKey(attributeName)); } }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should track the extra attribute \"([^\"]*)\"$") public void verifyIndexExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); assertTrue(extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)); Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertTrue(attributeData.containsKey(attributeName)); } }
@SuppressWarnings("unchecked") @Then("^the repository's \"([^\"]*)\" index should track the extra attribute \"([^\"]*)\"$") public void verifyIndexExtraAttributes(String headRef, String attributeName) throws Throwable { Repository repo = localRepo.geogigCLI.getGeogig().getRepository(); Optional<ObjectId> indexTreeId = resolveIndexTreeId(headRef, null); assertTrue(indexTreeId.isPresent()); RevTree indexTree = repo.indexDatabase().getTree(indexTreeId.get()); Set<org.locationtech.geogig.model.Node> nodes = RevObjectTestSupport.getTreeNodes(indexTree, repo.indexDatabase()); for (org.locationtech.geogig.model.Node n : nodes) { Map<String, Object> extraData = n.getExtraData(); assertTrue(extraData.containsKey(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA)); Map<String, Object> attributeData = (Map<String, Object>) extraData .get(IndexInfo.FEATURE_ATTRIBUTES_EXTRA_DATA); assertTrue(attributeData.containsKey(attributeName)); } }