org.neo4j.graphdb.schema.Schema.awaitIndexesOnline()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(180)

本文整理了Java中org.neo4j.graphdb.schema.Schema.awaitIndexesOnline()方法的一些代码示例,展示了Schema.awaitIndexesOnline()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Schema.awaitIndexesOnline()方法的具体详情如下:
包路径:org.neo4j.graphdb.schema.Schema
类名称:Schema
方法名:awaitIndexesOnline

Schema.awaitIndexesOnline介绍

[英]Wait until all indices comes online
[中]等到所有索引都上线

代码示例

代码示例来源:origin: neo4j/neo4j

public static Function<GraphDatabaseService,Void> awaitIndexesOnline( long timeout, TimeUnit unit )
  {
    return graphDb ->
    {
      graphDb.schema().awaitIndexesOnline( timeout, unit );
      return null;
    };
  }
}

代码示例来源:origin: neo4j/neo4j

@Description( "Wait for all indexes to come online (for example: CALL db.awaitIndexes(\"500\"))." )
@Procedure( name = "db.awaitIndexes", mode = READ )
public void awaitIndexes( @Name( value = "timeOutSeconds", defaultValue = "300" ) long timeout )
{
  graphDatabaseAPI.schema().awaitIndexesOnline( timeout, TimeUnit.SECONDS );
}

代码示例来源:origin: neo4j/neo4j

private void waitIndexesOnline( GraphDatabaseService database )
{
  try ( Transaction ignored = database.beginTx() )
  {
    database.schema().awaitIndexesOnline( 5, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

private void awaitIndexesOnline()
{
  try ( Transaction ignored = db.beginTx() )
  {
    db.schema().awaitIndexesOnline(3, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

public static void waitForIndexes( GraphDatabaseService beansAPI )
{
  try ( Transaction ignored = beansAPI.beginTx() )
  {
    beansAPI.schema().awaitIndexesOnline( 30, SECONDS );
  }
}

代码示例来源:origin: neo4j/neo4j

private static void awaitIndexes()
  {
    try ( Transaction tx = db.beginTx() )
    {
      db.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
      tx.success();
    }
  }
}

代码示例来源:origin: neo4j/neo4j

private void awaitIndexesOnline()
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void awaitIndexesOnline( int timeout, TimeUnit unit )
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( timeout, unit );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void waitForOnlineIndexes()
{
  try ( Transaction transaction = database.beginTx() )
  {
    database.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
    transaction.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void awaitIndexesOnline( GraphDatabaseService db )
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 10, TimeUnit.SECONDS );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void awaitIndexes()
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 30, SECONDS );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

void createIndex( DatabaseRule db )
{
  try ( Transaction tx = db.beginTx() )
  {
    doCreateIndex( db );
    tx.success();
  }
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private static void createIndexes( GraphDatabaseService database, String propertyName, Label testLabel )
{
  try ( Transaction transaction = database.beginTx() )
  {
    database.schema().indexFor( testLabel ).on( propertyName ).create();
    transaction.success();
  }
  try ( Transaction ignored = database.beginTx() )
  {
    database.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex( Label label, String propertyKey )
{
  try ( Transaction transaction = databaseRule.beginTx() )
  {
    databaseRule.schema().indexFor( label ).on( propertyKey ).create();
    transaction.success();
  }
  try ( Transaction ignored = databaseRule.beginTx() )
  {
    databaseRule.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex()
{
  try ( org.neo4j.graphdb.Transaction tx = graphDb.beginTx() )
  {
    graphDb.schema().indexFor( Label.label( "Node" ) ).on( "prop" ).create();
    tx.success();
  }
  try ( org.neo4j.graphdb.Transaction tx = graphDb.beginTx() )
  {
    graphDb.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

private void index( GraphDatabaseService db )
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().indexFor( label ).on( propKey ).create();
    tx.success();
  }
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex()
{
  try ( org.neo4j.graphdb.Transaction tx = graphDb.beginTx() )
  {
    graphDb.schema().indexFor( Label.label( "Node" ) ).on( "prop" ).create();
    tx.success();
  }
  try ( org.neo4j.graphdb.Transaction tx = graphDb.beginTx() )
  {
    graphDb.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex( Label label, String key )
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().indexFor( label ).on( key ).create();
    tx.success();
  }
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 10, SECONDS );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex()
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().indexFor( LABEL_ONE ).on( propKey ).create();
    tx.success();
  }
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 1, TimeUnit.MINUTES );
    tx.success();
  }
}

代码示例来源:origin: neo4j/neo4j

private void createIndex()
{
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().indexFor( Label.label( "User" ) ).on( "userId" ).create();
    tx.success();
  }
  try ( Transaction tx = db.beginTx() )
  {
    db.schema().awaitIndexesOnline( 10, SECONDS );
    tx.success();
  }
}

相关文章