Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2002-2013 "Neo Technology,"
* Network Engine for Objects in Lund AB [http://neotechnology.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.neo4j.kernel;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.NotFoundException;
import org.neo4j.graphdb.PropertyContainer;
import org.neo4j.graphdb.Relationship;
import org.neo4j.graphdb.Transaction;
import org.neo4j.graphdb.TransactionFailureException;
import org.neo4j.graphdb.index.AutoIndexer;
import org.neo4j.graphdb.index.Index;
import org.neo4j.graphdb.index.IndexImplementation;
import org.neo4j.graphdb.index.IndexManager;
import org.neo4j.graphdb.index.IndexProviders;
import org.neo4j.graphdb.index.RelationshipAutoIndexer;
import org.neo4j.graphdb.index.RelationshipIndex;
import org.neo4j.helpers.Pair;
import org.neo4j.helpers.collection.MapUtil;
import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.index.IndexStore;
import org.neo4j.kernel.impl.index.IndexXaConnection;
import org.neo4j.kernel.impl.transaction.AbstractTransactionManager;
import org.neo4j.kernel.impl.transaction.XaDataSourceManager;
import org.neo4j.kernel.impl.transaction.xaframework.XaDataSource;
class IndexManagerImpl implements IndexManager, IndexProviders
{
private final IndexStore indexStore;
private final Map indexProviders = new HashMap();
private NodeAutoIndexerImpl nodeAutoIndexer;
private RelationshipAutoIndexerImpl relAutoIndexer;
private final Config config;
private final XaDataSourceManager xaDataSourceManager;
private final AbstractTransactionManager txManager;
private final GraphDatabaseAPI graphDatabaseAPI;
IndexManagerImpl( Config config, IndexStore indexStore,
XaDataSourceManager xaDataSourceManager, AbstractTransactionManager txManager,
GraphDatabaseAPI graphDatabaseAPI
)
{
this.graphDatabaseAPI = graphDatabaseAPI;
this.config = config;
this.xaDataSourceManager = xaDataSourceManager;
this.txManager = txManager;
this.indexStore = indexStore;
}
private IndexImplementation getIndexProvider( String provider )
{
if ( provider == null )
{
throw new IllegalArgumentException( "No 'provider' given in configuration map" );
}
synchronized ( this.indexProviders )
{
IndexImplementation result = this.indexProviders.get( provider );
if ( result != null )
{
return result;
}
throw new IllegalArgumentException( "No index provider '" + provider +
"' found. Maybe the intended provider (or one more of its dependencies) " +
"aren't on the classpath or it failed to load." );
}
}
@Override
public void registerIndexProvider( String name, IndexImplementation provider )
{
this.indexProviders.put( name, provider );
}
@Override
public boolean unregisterIndexProvider( String name )
{
return this.indexProviders.remove( name ) != null;
}
private Pair