/** * @return the id of the old version id of the object, or {@link ObjectId#NULL} if * {@link #changeType()} is {@code ADD} */ public ObjectId oldObjectId() { return oldObject == null ? ObjectId.NULL : oldObject.getObjectId(); }
/** * @return the id of the new version id of the object, or {@link ObjectId#NULL} if * {@link #changeType()} is {@code DELETE} */ public ObjectId newObjectId() { return newObject == null ? ObjectId.NULL : newObject.getObjectId(); }
/** * @return the id of the old version id of the object, or {@link ObjectId#NULL} if * {@link #changeType()} is {@code ADD} */ public ObjectId oldObjectId() { return oldObject == null ? ObjectId.NULL : oldObject.getObjectId(); }
/** * @return the id of the new version id of the object, or {@link ObjectId#NULL} if * {@link #changeType()} is {@code DELETE} */ public ObjectId newObjectId() { return newObject == null ? ObjectId.NULL : newObject.getObjectId(); }
private @Nullable RevObject getObject(@Nullable NodeRef node, ObjectStore source) { if (node == null) { return null; } RevObject obj = source.get(node.getObjectId()); return obj; }
public @Override boolean tree(@Nullable NodeRef left, @Nullable NodeRef right) { if (right == null) { // not interested in purely deleted content return false; } // which "old" object the "new" bucket is being compared against. ObjectId leftId = left == null ? RevTree.EMPTY_TREE_ID : left.getObjectId(); boolean r = addTree(progress, leftId, right); return r; }
public @Override boolean tree(@Nullable NodeRef left, @Nullable NodeRef right) { if (right == null) { // not interested in purely deleted content return false; } // which "old" object the "new" bucket is being compared against. ObjectId leftId = left == null ? RevTree.EMPTY_TREE_ID : left.getObjectId(); boolean r = addTree(progress, leftId, right); return r; }
private Array toJDBCArray(Connection cx, final Collection<NodeRef> queryIds) throws SQLException { Array array; Object[] arr = new Object[queryIds.size()]; Iterator<NodeRef> it = queryIds.iterator(); for (int i = 0; it.hasNext(); i++) { ObjectId id = it.next().getObjectId(); arr[i] = Integer.valueOf(PGId.valueOf(id).hash1()); } array = cx.createArrayOf("integer", arr); return array; } }
public Iterator<FeatureInfo> apply(List<NodeRef> refs) { Map<ObjectId, RevFeature> correlationIndex = new HashMap<>(refs.size()); ArrayList<ObjectId> ids = new ArrayList<>(refs.size()); refs.forEach(ref->ids.add(ref.getObjectId())); Iterator<RevFeature> all = odb.getAll(ids, NOOP_LISTENER, RevFeature.class); all.forEachRemaining(revFeature -> correlationIndex.put(revFeature.getId(),revFeature)); ArrayList<FeatureInfo> result = new ArrayList<>(refs.size()); refs.forEach( ref-> result.add(FeatureInfo.insert(correlationIndex.get(ref.getObjectId()), ref.getMetadataId(), ref.path() ))); return (result.iterator() ); } }
public @Override boolean tree(NodeRef left, NodeRef right) { boolean passthru = RevTree.EMPTY_TREE_ID.equals(left.getObjectId()) || RevTree.EMPTY_TREE_ID.equals(right.getObjectId()); treePassThru = passthru; return super.tree(left, right); }
@Override public boolean feature(@Nullable NodeRef left, @Nullable NodeRef right) { listener.feature(right); checkExists(right.getObjectId(), right, odb); return true; }
@Override public boolean feature(@Nullable NodeRef left, @Nullable NodeRef right) { listener.feature(right); checkExists(right.getObjectId(), right, odb); return true; }
private boolean addTree(ObjectReporter progress, ObjectId left, NodeRef right) { if (visitPair(left, right.getObjectId())) { if (consume(right.getObjectId())) { progress.addTree(); } addMetadataId(progress, right); return true; } return false; }
public @Override boolean feature(@Nullable NodeRef left, @Nullable NodeRef right) { if (right != null && consume(right.getObjectId())) { progress.addFeature(); addMetadataId(progress, right); } return true; }
public @Override boolean feature(@Nullable NodeRef left, @Nullable NodeRef right) { if (reportFeatures) { if (right != null && consume(right.getObjectId())) { progress.addFeature(); addMetadataId(progress, right); } } return true; }
private boolean addTree(ObjectReporter progress, ObjectId left, NodeRef right) { if (visitPair(left, right.getObjectId())) { if (consume(right.getObjectId())) { progress.addTree(); } addMetadataId(progress, right); return true; } return false; }
@Override @Nullable public Feature apply(@Nullable NodeRef ref) { RevFeature revFeature = parseCommand.setObjectId(ref.getObjectId()) .call(RevFeature.class).get(); final String parentPath = ref.getParentPath(); FeatureBuilder featureBuilder = builders.get(parentPath); String fid = ref.name(); Feature feature = featureBuilder.build(fid, revFeature); return feature; }
@Test public void testIgnoreIndex() { createIndex(); builder.ignoreIndex().build(); NodeRef typeRef = context.workingTree().getFeatureTypeTrees().get(0); ObjectId canonicalTreeId = typeRef.getObjectId(); verify(difftree).setNewTree(eq(canonicalTreeId)); }
@Test public void testIgnoreIndex() { createIndex(); builder.ignoreIndex().build(); NodeRef typeRef = context.workingTree().getFeatureTypeTrees().get(0); ObjectId canonicalTreeId = typeRef.getObjectId(); verify(difftree).setNewTree(eq(canonicalTreeId)); }
@Test public void testTree() { ObjectId oId = ObjectId.valueOf("abc123000000000000001234567890abcdef0000"); ObjectId metadataId = ObjectId.valueOf("abc123000000000000001234567890abcdef0001"); NodeRef nodeRef = NodeRef.tree("Points", oId, metadataId); assertEquals(oId, nodeRef.getObjectId()); assertEquals(metadataId, nodeRef.getMetadataId()); assertEquals("Points", nodeRef.getNode().getName()); }