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;
}