Package org.neo4j.kernel.impl.nioneo.store

Examples of org.neo4j.kernel.impl.nioneo.store.StoreId


                    }
                    return result;
                }
            };
            R response = deserializer.read( dechunkingBuffer, channelContext.third() );
            StoreId storeId = readStoreId( dechunkingBuffer, channelContext.third() );
            if ( shouldCheckStoreId( type ) )
            {
                assertCorrectStoreId( storeId );
            }
            TransactionStream txStreams = readTransactionStreams( dechunkingBuffer );
View Full Code Here


        return true;
    }

    private void assertCorrectStoreId( StoreId storeId )
    {
        StoreId myStoreId = getMyStoreId();
        if ( !myStoreId.equals( storeId ) )
        {
            throw new ComException( storeId + " from response doesn't match my " + myStoreId );
        }
    }
View Full Code Here

                    };
                    stream.add( Triplet.of( resourceName, txId, extractor ) );
                }
            }
        }
        StoreId storeId = ((NeoStoreXaDataSource) dsManager.getXaDataSource( Config.DEFAULT_DATA_SOURCE_NAME )).getStoreId();
        return new Response<T>( response, storeId, TransactionStream.create( resourceNames, stream ) );
    }
View Full Code Here

    private StoreId storeIdToUse;
   
    @Before
    public void doBefore()
    {
        storeIdToUse = new StoreId();
        new File( PATH ).mkdirs();
    }
View Full Code Here

    @Test
    public void makeSureClientStoreIdsMustMatch() throws Exception
    {
        MadeUpImplementation serverImplementation = new MadeUpImplementation( storeIdToUse );
        MadeUpServer server = new MadeUpServer( serverImplementation, PORT );
        MadeUpClient client = new MadeUpClient( PORT, new StoreId( 10, 10 ) );
       
        try
        {
            client.multiply( 1, 2 );
            fail();
View Full Code Here

    }

    @Test
    public void makeSureServerStoreIdsMustMatch() throws Exception
    {
        MadeUpImplementation serverImplementation = new MadeUpImplementation( new StoreId( 10, 10 ) );
        MadeUpServer server = new MadeUpServer( serverImplementation, PORT );
        MadeUpClient client = new MadeUpClient( PORT, storeIdToUse );
       
        try
        {
View Full Code Here

   
    @Override
    protected void startup( Long[] creationTimeAndStoreId ) throws Throwable
    {
        MadeUpCommunicationInterface implementation = new MadeUpImplementation(
                new StoreId( creationTimeAndStoreId[0], creationTimeAndStoreId[1] ) );
        server = new MadeUpServer( implementation, 8888 );
    }
View Full Code Here

        return EmbeddedGraphDatabase.loadConfigurations( file );
    }

    private synchronized void startUp( boolean allowInit )
    {
        StoreId storeId = null;
        if ( !new File( storeDir, "neostore" ).exists() )
        {
            long endTime = System.currentTimeMillis()+10000;
            Exception exception = null;
            while ( System.currentTimeMillis() < endTime )
            {               
                // Check if the cluster is up
                Pair<Master, Machine> master = broker.getMaster();
                master = master.first() != null ? master : broker.getMasterReally();
                if ( master != null && master.first() != null )
                { // Join the existing cluster
                    try
                    {
                        copyStoreFromMaster( master );
                        msgLog.logMessage( "copied store from master" );
                        exception = null;
                        break;
                    }
                    catch ( Exception e )
                    {
                        exception = e;
                        broker.getMasterReally();
                        msgLog.logMessage( "Problems copying store from master", e );
                    }
                }
                else if ( allowInit )
                { // Try to initialize the cluster and become master
                    exception = null;
                    StoreId myStoreId = new StoreId();
                    storeId = broker.createCluster( myStoreId );
                    if ( storeId.equals( myStoreId ) )
                    { // I am master
                        break;
                    }
View Full Code Here

    public static <T> Response<T> packResponseWithoutTransactionStream( GraphDatabaseService graphDb,
            SlaveContext context, T response )
    {
        XaDataSource ds = ((AbstractGraphDatabase) graphDb).getConfig().getTxModule()
                .getXaDataSourceManager().getXaDataSource( Config.DEFAULT_DATA_SOURCE_NAME );
        StoreId storeId = ((NeoStoreXaDataSource) ds).getStoreId();
        return new Response<T>( response, storeId, TransactionStream.EMPTY );
    }
View Full Code Here

TOP

Related Classes of org.neo4j.kernel.impl.nioneo.store.StoreId

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.