当前位置: 首页>>代码示例>>Java>>正文


Java MapUtil.stringMap方法代码示例

本文整理汇总了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();
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:23,代码来源:RecoveryTest.java

示例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" ) );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:16,代码来源:TestLuceneIndex.java

示例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");
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:16,代码来源:MoveIndicesToIsLatestVertexMigration.java

示例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();
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:54,代码来源:TestMigration.java

示例5: config

import org.neo4j.helpers.collection.MapUtil; //导入方法依赖的package包/类
private Map<String, String> config()
{
    return MapUtil.stringMap( "store_dir", directory.directory().getPath() );
}
 
开发者ID:neo4j-contrib,项目名称:neo4j-lucene5-index,代码行数:5,代码来源:LuceneDataSourceTest.java

示例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);
}
 
开发者ID:HuygensING,项目名称:timbuctoo,代码行数:6,代码来源:Neo4jIndexHandler.java


注:本文中的org.neo4j.helpers.collection.MapUtil.stringMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。