Package org.neo4j.com

Examples of org.neo4j.com.SlaveContext


        this.graphDb = graphDb;
    }
   
    public Response<Void> fullBackup( StoreWriter writer )
    {
        SlaveContext context = MasterUtil.rotateLogsAndStreamStoreFiles( graphDb, writer );
        writer.done();
        return MasterUtil.packResponse( graphDb, context, null, MasterUtil.ALL );
    }
View Full Code Here


        List<Pair<String, Long>> txs = new ArrayList<Pair<String,Long>>();
        for ( XaDataSource ds : dsManager.getAllRegisteredDataSources() )
        {
            txs.add( Pair.of( ds.getName(), ds.getLastCommittedTxId() ) );
        }
        return new SlaveContext( 0, 0, txs.toArray( new Pair[0] ) );
    }
View Full Code Here

    }

    private void copyStoreFromMaster( Pair<Master, Machine> master ) throws Exception
    {
        msgLog.logMessage( "Copying store from master" );
        Response<Void> response = master.first().copyStore( new SlaveContext( machineId, 0, new Pair[0] ),
                new ToFileStoreWriter( storeDir ) );
        EmbeddedGraphDatabase tempDb = new EmbeddedGraphDatabase( storeDir );
        try
        {
            MasterUtil.applyReceivedTransactions( response, tempDb, MasterUtil.txHandlerForFullCopy() );
View Full Code Here

        int i = 0;
        for ( XaDataSource dataSource : dataSources )
        {
            txs[i++] = Pair.of( dataSource.getName(), dataSource.getLastCommittedTxId() );
        }
        return new SlaveContext( machineId, eventIdentifier, txs );
    }
View Full Code Here

    }

    @SuppressWarnings( "unchecked" )
    public Response<Void> copyStore( SlaveContext context, final StoreWriter writer )
    {
        context = new SlaveContext( context.machineId(), context.getEventIdentifier(), new Pair[0] );

        return sendRequest( HaRequestType.COPY_STORE, context, EMPTY_SERIALIZER, new Protocol.FileStreamsDeserializer( writer ) );
    }
View Full Code Here

            else
            {
                txs.add( Pair.of( resourceName, dataSource.getLastCommittedTxId() ) );
            }
        }
        return new SlaveContext( context.machineId(), context.getEventIdentifier(),
                txs.toArray( new Pair[0] ) );

    }
View Full Code Here

TOP

Related Classes of org.neo4j.com.SlaveContext

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.