Neo4JConnection.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:visitmeta 作者:
/**
 * Clears all data in the DB and reconnects to it afterwards.
 */
public void ClearDatabase(){
    // Shutdown database before erasing it
    log.debug("Shutting down the database");
    mGraphDb.shutdown();
    try
       {
        log.debug("Erasing the database files");
           FileUtils.deleteRecursively( new File( mDbPath ) );
       }
       catch ( IOException e )
       {
           throw new RuntimeException( e );
       }
    // Restart database
    log.debug("Reconnecting to database");
    mGraphDb = new GraphDatabaseFactory().
            newEmbeddedDatabaseBuilder(mDbPath).
            setConfig( GraphDatabaseSettings.node_keys_indexable, KEY_HASH ).
            setConfig( GraphDatabaseSettings.node_auto_indexing, "true" ).
            newGraphDatabase();
    registerShutdownHook(mGraphDb);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号