Package org.neo4j.kernel.impl.batchinsert

Examples of org.neo4j.kernel.impl.batchinsert.BatchInserter.createNode()


        Map<String, Object> relationshipProperties =
                map( "string", "A long string, which is longer than shortstring boundaries" );
        long i = 0;
        for ( ; i < max; i++ )
        {
            long second = inserter.createNode( nodeProperties );
            inserter.createRelationship( first, second, TYPE, relationshipProperties );
            if ( i > 0 && i % 1000000 == 0 ) System.out.println( (i/1000000) + "M" );
            first = second;
        }
        inserter.shutdown();
View Full Code Here


        BatchInserterIndexProvider indexProvider = new LuceneBatchInserterIndexProvider( inserter );
        BatchInserterIndex actors = indexProvider.nodeIndex( "actors", MapUtil.stringMap( "type", "exact" ) );
        actors.setCacheCapacity( "name", 100000 );

        Map<String, Object> properties = MapUtil.map( "name", "Keanu Reeves" );
        long node = inserter.createNode( properties );
        actors.add( node, properties );

        // Make sure to shut down the index provider
        indexProvider.shutdown();
        inserter.shutdown();
View Full Code Here

   
    @Test
    public void testSimple()
    {
        BatchInserter graphDb = newBatchInserter();
        long node1 = graphDb.createNode( null );
        long node2 = graphDb.createNode( null );
        long rel1 = graphDb.createRelationship( node1, node2, RelTypes.BATCH_TEST,
            null );
        SimpleRelationship rel = graphDb.getRelationshipById( rel1 );
        assertEquals( rel.getStartNode(), node1 );
View Full Code Here

    @Test
    public void testSimple()
    {
        BatchInserter graphDb = newBatchInserter();
        long node1 = graphDb.createNode( null );
        long node2 = graphDb.createNode( null );
        long rel1 = graphDb.createRelationship( node1, node2, RelTypes.BATCH_TEST,
            null );
        SimpleRelationship rel = graphDb.getRelationshipById( rel1 );
        assertEquals( rel.getStartNode(), node1 );
        assertEquals( rel.getEndNode(), node2 );
View Full Code Here

   
    @Test
    public void testMore()
    {
        BatchInserter graphDb = newBatchInserter();
        long startNode = graphDb.createNode( properties );
        long endNodes[] = new long[25];
        Set<Long> rels = new HashSet<Long>();
        for ( int i = 0; i < 25; i++ )
        {
            endNodes[i] = graphDb.createNode( properties );
View Full Code Here

        long startNode = graphDb.createNode( properties );
        long endNodes[] = new long[25];
        Set<Long> rels = new HashSet<Long>();
        for ( int i = 0; i < 25; i++ )
        {
            endNodes[i] = graphDb.createNode( properties );
            rels.add( graphDb.createRelationship( startNode, endNodes[i],
                relTypeArray[i % 5], properties ) );
        }
        for ( SimpleRelationship rel : graphDb.getRelationships( startNode ) )
        {
View Full Code Here

   
    @Test
    public void testBadStuff()
    {
        BatchInserter graphDb = newBatchInserter();
        long startNode = graphDb.createNode( properties );
        try
        {
            graphDb.createRelationship( startNode, startNode, relTypeArray[0],
                    properties );
            fail( "Could create relationship with same start and end node" );
View Full Code Here

        BatchInserter inserter = new BatchInserterImpl( PATH );
        BatchInserterIndexProvider provider = new LuceneBatchInserterIndexProvider(
                inserter );
        BatchInserterIndex index = provider.nodeIndex( "users",
                LuceneIndexImplementation.EXACT_CONFIG );
        long id = inserter.createNode( null );
        index.add( id, map( "name", "Joe", "other", "Schmoe" ) );
        provider.shutdown();
        provider = new LuceneBatchInserterIndexProvider(
                inserter );
        index = provider.nodeIndex( "users",
View Full Code Here

                inserter );
        BatchInserterIndex index = provider.nodeIndex( "users", EXACT_CONFIG );
        Map<Integer, Long> ids = new HashMap<Integer, Long>();
        for ( int i = 0; i < 100; i++ )
        {
            long id = inserter.createNode( null );
            index.add( id, map( "name", "Joe" + i, "other", "Schmoe" ) );
            ids.put( i, id );
        }

        for ( int i = 0; i < 100; i++ )
View Full Code Here

                inserter );
        String name = "users";
        BatchInserterIndex index = provider.nodeIndex( name,
                stringMap( "type", "fulltext" ) );

        long id1 = inserter.createNode( null );
        index.add( id1, map( "name", "Mattias Persson", "email",
                "something@somewhere", "something", "bad" ) );
        long id2 = inserter.createNode( null );
        index.add( id2, map( "name", "Lars PerssoN" ) );
        index.flush();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.