Package org.neo4j.batchimport.structs

Examples of org.neo4j.batchimport.structs.Relationship


                throw new IllegalStateException(String.format("relationship-rows not pre-sorted found id %d less than node-id %d", min, nodeId));
            if (min > nodeId) break; // keep already parsed data

            long target = Math.max(from, to);
            final boolean outgoing = from == min;
            final Relationship rel = nodeStruct.addRel(target, outgoing, type(relChunker.nextWord()));

            addProperties(rel, relChunker, relPropIds,relPropCount, relPropertyTypes);
            from = -1;
            to = -1;
        }
View Full Code Here


        // long prevId = futureNodeRelInfo.done(nodeId, getFirstOwnRelationshipId(event));
        long prevId = event.prevId;

        for (int i = 0; i < count; i++) {
            long nextId = i+1 < count ? event.getRelationship(i+1).id : followingNextRelationshipId;
            Relationship relationship = event.getRelationship(i);
            relationshipWriter.create(nodeId,event, relationship, prevId, nextId);
            prevId = relationship.id;
            // storeFutureRelId(nodeId, relationship,prevId);

            counter++;
View Full Code Here

public class RelationshipIdHandler implements EventHandler<NodeStruct> {
    volatile long relId = 0;

    public void onEvent(NodeStruct event, long nodeId, boolean endOfBatch) throws Exception {
        for (int i = 0; i < event.relationshipCount; i++) {
            Relationship relationship = event.getRelationship(i);
            relationship.id = relId++;
        }
    }
View Full Code Here

        event.prevId = futureNodeRelInfo.done(nodeId, getFirstOwnRelationshipId(event));

        int count = event.relationshipCount;

        for (int i = 0; i < count; i++) {
            Relationship relationship = event.getRelationship(i);
            storeFutureRelId(nodeId, relationship);

            counter++;
        }
    }
View Full Code Here

                                                            Record.NO_NEXT_RELATIONSHIP.intValue();

        long prevId = Record.NO_PREV_RELATIONSHIP.intValue();
        for (int i = 0; i < count; i++) {
            long nextId = i+1 < count ? event.getRelationship(i+1).id : followingNextRelationshipId;
            Relationship relationship = event.getRelationship(i);
            relationshipWriter.create(nodeId,event, relationship, prevId, nextId);
            prevId = relationship.id;
            counter++;
        }
View Full Code Here

    //final ReverseRelationshipMap futureModeRelIdQueueOutgoing = new ConcurrentReverseRelationshipMap(RELS_PER_NODE);
    //final ReverseRelationshipMap futureModeRelIdQueueIncoming = new ConcurrentReverseRelationshipMap(RELS_PER_NODE);

    public void onEvent(NodeStruct event, long nodeId, boolean endOfBatch) throws Exception {
        for (int i = 0; i < event.relationshipCount; i++) {
            Relationship relationship = event.getRelationship(i);
            long relId = this.relId++;
            relationship.id = relId;
            storeFutureRelId(nodeId, relationship,relId);
        }
View Full Code Here

    public static final int NODE_ONE = 1;
    private Relationship rel;

    @Before
    public void setUp() throws Exception {
        rel = new Relationship(0);
    }
View Full Code Here

TOP

Related Classes of org.neo4j.batchimport.structs.Relationship

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.