Exemplo n.º 1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void accept(final org.neo4j.bolt.runtime.BoltResult_Visitor visitor) throws Exception
//JAVA TO C# CONVERTER WARNING: 'final' parameters are ignored unless the option to convert to C# 7.2 'in' parameters is selected:
        public override void Accept(Org.Neo4j.Bolt.runtime.BoltResult_Visitor visitor)
        {
            long start = _clock.millis();

            @delegate.Accept(row =>
            {
                visitor.Visit(row);
                return(true);
            });
            AddRecordStreamingTime(visitor, _clock.millis() - start);
            QueryExecutionType qt = @delegate.ExecutionType();

            visitor.AddMetadata("type", Values.stringValue(QueryTypeCode(qt.QueryType())));

            if (@delegate.QueryStatistics().containsUpdates())
            {
                MapValue stats = QueryStats(@delegate.QueryStatistics());
                visitor.AddMetadata("stats", stats);
            }
            if (qt.RequestedExecutionPlanDescription())
            {
                ExecutionPlanDescription rootPlanTreeNode = @delegate.ExecutionPlanDescription();
                string metadataFieldName = rootPlanTreeNode.HasProfilerStatistics() ? "profile" : "plan";
                visitor.AddMetadata(metadataFieldName, ExecutionPlanConverter.Convert(rootPlanTreeNode));
            }

            IEnumerable <Notification> notifications = @delegate.Notifications;

            if (notifications.GetEnumerator().hasNext())
            {
                visitor.AddMetadata("notifications", NotificationConverter.Convert(notifications));
            }
        }
Exemplo n.º 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void eagerResultContainsExecutionType()
        public virtual void EagerResultContainsExecutionType()
        {
            Result result = _database.execute("MATCH (n) RETURN n.c");

            assertEquals(1, _testCursorContext.AdditionalAttempts);
            assertEquals(QueryExecutionType.query(QueryExecutionType.QueryType.READ_ONLY), result.QueryExecutionType);
        }
Exemplo n.º 3
0
        internal static string ToSerializedValue(this QueryExecutionType value)
        {
            switch (value)
            {
            case QueryExecutionType.Any:
                return("any");

            case QueryExecutionType.Regular:
                return("regular");

            case QueryExecutionType.Irregular:
                return("irregular");

            case QueryExecutionType.Aborted:
                return("aborted");

            case QueryExecutionType.Exception:
                return("exception");
            }
            return(null);
        }