本文整理汇总了Java中org.neo4j.helpers.collection.MapUtil.stringMap方法的典型用法代码示例。如果您正苦于以下问题:Java MapUtil.stringMap方法的具体用法?Java MapUtil.stringMap怎么用?Java MapUtil.stringMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.neo4j.helpers.collection.MapUtil
的用法示例。
在下文中一共展示了MapUtil.stringMap方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: recoveryForRelationshipCommandsOnly
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
@Test
public void recoveryForRelationshipCommandsOnly() throws Throwable
{
// shutdown db here
String storeDir = db.getStoreDir();
File path = new File( storeDir );
shutdownDB();
// NB: AddRelToIndex will start and shutdown the db
Process process = Runtime.getRuntime().exec( new String[]{
"java", "-Xdebug", "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005", "-cp",
System.getProperty( "java.class.path" ),
AddRelToIndex.class.getName(), storeDir
} );
assertEquals( 0, new ProcessStreamHandler( process, false ).waitForResult() );
FileSystemAbstraction fileSystem = new DefaultFileSystemAbstraction();
Config config = new Config( MapUtil.stringMap(), GraphDatabaseSettings.class );
LuceneDataSource ds = new LuceneDataSource( path, config, new IndexConfigStore( path, fileSystem ), fileSystem );
ds.start();
ds.stop();
}
示例2: makeSureSlightDifferencesInIndexConfigCanBeSupplied
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
@Test
public void makeSureSlightDifferencesInIndexConfigCanBeSupplied()
{
Map<String, String> config = MapUtil.stringMap( IndexManager.PROVIDER, "lucene", "type", "fulltext" );
String name = currentIndexName();
nodeIndex( name, config );
nodeIndex( name, MapUtil.stringMap( new HashMap<>( config ), "to_lower_case", "true" ) );
try
{
nodeIndex( name, MapUtil.stringMap( new HashMap<>( config ), "to_lower_case", "false" ) );
fail( "Shouldn't be able to get index with these kinds of differences in config" );
}
catch ( IllegalArgumentException e ) { /* */ }
nodeIndex( name, MapUtil.stringMap( new HashMap<>( config ), "whatever", "something" ) );
}
示例3: constructIndices
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private void constructIndices(IndexManager indexManager) {
Map<String, String> indexConfig = MapUtil.stringMap(IndexManager.PROVIDER, "lucene", "type", "fulltext");
//construct all quicksearchIndices
vres.getVres().values().stream()
.flatMap(vre -> vre.getCollections().values().stream())
.forEach((collection) -> {
indexManager.forNodes(collection.getCollectionName(), indexConfig);
});
//construct id index
indexManager.forNodes("idIndex");
//construct edge index
indexManager.forNodes("edgeIdIndex");
}
示例4: providerGetsFilledInAutomatically
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
@Test
public void providerGetsFilledInAutomatically()
{
Map<String, String> correctConfig = MapUtil.stringMap( "type", "exact", IndexManager.PROVIDER, "lucene" );
File storeDir = new File( "target/var/index" );
Neo4jTestCase.deleteFileOrDirectory( storeDir );
GraphDatabaseService graphDb = startDatabase( storeDir );
try ( Transaction transaction = graphDb.beginTx() )
{
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "wo-provider", MapUtil.stringMap( "type", "exact" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "w-provider", MapUtil.stringMap( "type", "exact", IndexManager.PROVIDER, "lucene" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "wo-provider", MapUtil.stringMap( "type", "exact" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "w-provider", MapUtil.stringMap( "type", "exact", IndexManager.PROVIDER, "lucene" ) ) ) );
transaction.success();
}
graphDb.shutdown();
removeProvidersFromIndexDbFile( storeDir );
graphDb = startDatabase( storeDir );
try ( Transaction transaction = graphDb.beginTx() )
{
// Getting the index w/o exception means that the provider has been reinstated
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "wo-provider", MapUtil.stringMap( "type", "exact" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "w-provider",
MapUtil.stringMap( "type", "exact", IndexManager.PROVIDER, "lucene" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "wo-provider", MapUtil.stringMap( "type", "exact" ) ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "w-provider", MapUtil.stringMap( "type", "exact", IndexManager.PROVIDER, "lucene" ) ) ) );
}
graphDb.shutdown();
removeProvidersFromIndexDbFile( storeDir );
graphDb = startDatabase( storeDir );
try ( Transaction transaction = graphDb.beginTx() )
{
// Getting the index w/o exception means that the provider has been reinstated
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "wo-provider" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forNodes( "w-provider" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "default" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "wo-provider" ) ) );
assertEquals( correctConfig, graphDb.index().getConfiguration( graphDb.index().forRelationships( "w-provider" ) ) );
}
graphDb.shutdown();
}
示例5: config
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private Map<String, String> config()
{
return MapUtil.stringMap( "store_dir", directory.directory().getPath() );
}
示例6: getQuickSearchIndex
import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private Index<Node> getQuickSearchIndex(Collection collection) {
// Add the config below, to make sure the index is case insensitive.
Map<String, String> indexConfig = MapUtil.stringMap(IndexManager.PROVIDER, "lucene", "type", "fulltext");
return indexManager().forNodes(getQuicksearchIndexName(collection), indexConfig);
}