Package org.neo4j.kernel.impl.util

Examples of org.neo4j.kernel.impl.util.RelIdArray$RelIdIterator


            }
            else
            {
                type = relImpl.getType();
            }
            RelIdArray relationshipSet = newRelationshipMap.get(
                type.name() );
            if ( relationshipSet == null )
            {
                relationshipSet = new RelIdArray();
                newRelationshipMap.put( type.name(), relationshipSet );
            }
            relationshipSet.add( relId );
        }
        // relCache.putAll( relsMap );
        return Pair.of( newRelationshipMap, relsMap );
    }
View Full Code Here


        {
            addMap = nodeManager.getCowRelationshipAddMap( this );
        }
        for ( String type : relationshipMap.keySet() )
        {
            RelIdArray src = relationshipMap.get( type );
            RelIdArray remove = null;
            RelIdArray add = null;
            if ( hasModifications )
            {
                remove = nodeManager.getCowRelationshipRemoveMap( this, type );
                if ( addMap != null )
                {
                    add = addMap.get( type );
                }
            }
//            if ( src != null || add != null )
//            {
                relTypeList.add( RelTypeElement.create( type, this, src, add, remove ) );
//            }
        }
        if ( addMap != null )
        {
            for ( String type : addMap.keySet() )
            {
                if ( relationshipMap.get( type ) == null )
                {
                    RelIdArray remove = nodeManager.getCowRelationshipRemoveMap( this, type );
                    RelIdArray add = addMap.get( type );
                    relTypeList.add( RelTypeElement.create( type, this, null, add, remove ) );
                }
            }
        }
        return relTypeList;
View Full Code Here

        List<RelTypeElementIterator> relTypeList =
            new LinkedList<RelTypeElementIterator>();
        boolean hasModifications = nodeManager.getLockReleaser().hasRelationshipModifications( this );
        for ( RelationshipType type : types )
        {
            RelIdArray src = relationshipMap.get( type.name() );
            RelIdArray remove = null;
            RelIdArray add = null;
            if ( hasModifications )
            {
                remove = nodeManager.getCowRelationshipRemoveMap( this, type.name() );
                add = nodeManager.getCowRelationshipAddMap( this, type.name() );
            }
View Full Code Here

    // caller is responsible for acquiring lock
    // this method is only called when a relationship is created or
    // a relationship delete is undone or when the full node is loaded
    void addRelationship( NodeManager nodeManager, RelationshipType type, long relId )
    {
        RelIdArray relationshipSet = nodeManager.getCowRelationshipAddMap(
            this, type.name(), true );
        relationshipSet.add( relId );
    }
View Full Code Here

    // caller is responsible for acquiring lock
    // this method is only called when a undo create relationship or
    // a relationship delete is invoked.
    void removeRelationship( NodeManager nodeManager, RelationshipType type, long relId )
    {
        RelIdArray relationshipSet = nodeManager.getCowRelationshipRemoveMap(
            this, type.name(), true );
        relationshipSet.add( relId );
    }
View Full Code Here

        {
            return null;
        }
        for ( String type : addMap.keySet() )
        {
            RelIdArray addRels = addMap.get( type );
            RelIdArray srcRels = tmpRelMap.get( type );
            if ( srcRels == null )
            {
                tmpRelMap.put( type, addRels );
            }
            else
            {
                srcRels.addAll( addRels );
            }
        }
        return pair.other();
        // nodeManager.putAllInRelCache( pair.other() );
    }
View Full Code Here

            {
                return false;
            }
            for ( String type : addMap.keySet() )
            {
                RelIdArray addRels = addMap.get( type );
                // IntArray srcRels = tmpRelMap.get( type );
                RelIdArray srcRels = relationshipMap.get( type );
                if ( srcRels == null )
                {
                    relationshipMap.put( type, addRels );
                }
                else
                {
                    srcRels.addAll( addRels );
                }
            }
        }
        nodeManager.putAllInRelCache( pair.other() );
        return true;
View Full Code Here

        }
        if ( cowRelationshipAddMap != null )
        {
            for ( String type : cowRelationshipAddMap.keySet() )
            {
                RelIdArray add = cowRelationshipAddMap.get( type );
                RelIdArray remove = null;
                if ( cowRelationshipRemoveMap != null )
                {
                    remove = cowRelationshipRemoveMap.get( type );
                }
                RelIdArray src = relationshipMap.get( type );
                relationshipMap.put( type, RelIdArray.from( src, add, remove ) );
            }
        }
        if ( cowRelationshipRemoveMap != null )
        {
            for ( String type : cowRelationshipRemoveMap.keySet() )
            {
                if ( cowRelationshipAddMap != null &&
                    cowRelationshipAddMap.get( type ) != null )
                {
                    continue;
                }
                RelIdArray src = relationshipMap.get( type );
                RelIdArray remove = cowRelationshipRemoveMap.get( type );
                relationshipMap.put( type, RelIdArray.from( src, null, remove ) );
            }
        }
    }
View Full Code Here

            return readTransaction.getMoreRelationships( nodeId, position );
        }

        public RelIdArray getCreatedNodes()
        {
            return new RelIdArray();
        }
View Full Code Here

public class TestRelIdArray
{
    @Test
    public void testBasic() throws Exception
    {
        RelIdArray array = new RelIdArray();
        array.add( 1 );
        array.add( 2 );
        array.add( 3 );
        RelIdIterator itr = array.iterator();
        assertTrue( itr.hasNext() );
        assertTrue( itr.hasNext() );
        assertEquals( 1L, itr.next() );
        assertTrue( itr.hasNext() );
        assertEquals( 2L, itr.next() );
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.impl.util.RelIdArray$RelIdIterator

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.