org.neo4j.graphdb.Result.getQueryExecutionType()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(106)

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

Result.getQueryExecutionType介绍

[英]Indicates what kind of query execution produced this result.
[中]指示产生此结果的查询执行类型。

代码示例

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

@Override
public QueryExecutionType getQueryExecutionType()
{
  return originalResult.getQueryExecutionType();
}

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

@Override
public QueryExecutionType executionType()
{
  return originalResult.getQueryExecutionType();
}

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

@SafeVarargs
private static Result mockExecutionResult( ExecutionPlanDescription planDescription,
    Iterable<Notification> notifications, Map<String, Object>... rows )
{
  Set<String> keys = new TreeSet<>();
  for ( Map<String, Object> row : rows )
  {
    keys.addAll( row.keySet() );
  }
  Result executionResult = mock( Result.class );
  when( executionResult.columns() ).thenReturn( new ArrayList<>( keys ) );
  final Iterator<Map<String, Object>> inner = asList( rows ).iterator();
  when( executionResult.hasNext() ).thenAnswer( invocation -> inner.hasNext() );
  when( executionResult.next() ).thenAnswer( invocation -> inner.next() );
  when( executionResult.getQueryExecutionType() )
      .thenReturn( null != planDescription
             ? QueryExecutionType.profiled( QueryExecutionType.QueryType.READ_WRITE )
             : QueryExecutionType.query( QueryExecutionType.QueryType.READ_WRITE ) );
  if ( executionResult.getQueryExecutionType().requestedExecutionPlanDescription() )
  {
    when( executionResult.getExecutionPlanDescription() ).thenReturn( planDescription );
  }
  mockAccept( executionResult );
  when( executionResult.getNotifications() ).thenReturn( notifications );
  return executionResult;
}

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

includePlan = result.getQueryExecutionType().requestedExecutionPlanDescription();

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

@Test
public void eagerResultContainsExecutionType()
{
  Result result = database.execute( "MATCH (n) RETURN n.c" );
  assertEquals( 1, testCursorContext.getAdditionalAttempts() );
  assertEquals( QueryExecutionType.query( QueryExecutionType.QueryType.READ_ONLY ), result.getQueryExecutionType() );
}

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

if ( result.getQueryExecutionType().requestedExecutionPlanDescription() )

代码示例来源:origin: org.neo4j/neo4j-cypher

@Override
public QueryExecutionType getQueryExecutionType()
{
  return originalResult.getQueryExecutionType();
}

代码示例来源:origin: org.neo4j/neo4j-cypher

@Override
public QueryExecutionType executionType()
{
  return originalResult.getQueryExecutionType();
}

代码示例来源:origin: org.neo4j/neo4j-shell

private void printResult( Output out, Result result, long startTime ) throws RemoteException
{
  result.writeAsStringTo( new PrintWriter( new OutputAsWriter( out ) ) );
  out.println( (now() - startTime) + " ms" );
  if ( result.getQueryExecutionType().requestedExecutionPlanDescription() )
  {
    out.println();
    out.println( result.getExecutionPlanDescription().toString() );
  }
}

代码示例来源:origin: org.neo4j.app/neo4j-server

includePlan = result.getQueryExecutionType().requestedExecutionPlanDescription();

代码示例来源:origin: org.neo4j.doc/neo4j-cypher-docs

@Test
public void explain_returns_plan() throws Exception
{
  // START SNIPPET: explain_returns_plan
  Result result = db.execute( "EXPLAIN CREATE (user:User{name:{name}}) RETURN user" );
  assert result.getQueryExecutionType().isExplained();
  assert result.getQueryExecutionType().requestedExecutionPlanDescription();
  assert !result.hasNext();
  assert !result.getQueryStatistics().containsUpdates();
  assert result.columns().isEmpty();
  assert !result.getExecutionPlanDescription().hasProfilerStatistics();
  // END SNIPPET: explain_returns_plan
}

代码示例来源:origin: org.neo4j.app/neo4j-server

if ( result.getQueryExecutionType().requestedExecutionPlanDescription() )

相关文章