use of org.neo4j.server.http.cypher.format.api.StatementEndEvent in project neo4j by neo4j.
the class LineDelimitedEventSourceJoltSerializer method handleEvent.
@Override
public final void handleEvent(OutputEvent event) {
switch(event.getType()) {
case STATEMENT_START:
StatementStartEvent statementStartEvent = (StatementStartEvent) event;
InputStatement inputStatement = JsonMessageBodyReader.getInputStatement(parameters, statementStartEvent.getStatement());
writeStatementStart(statementStartEvent, inputStatement);
break;
case RECORD:
writeRecord((RecordEvent) event);
break;
case STATEMENT_END:
StatementEndEvent statementEndEvent = (StatementEndEvent) event;
writeStatementEnd(statementEndEvent);
break;
case FAILURE:
FailureEvent failureEvent = (FailureEvent) event;
writeFailure(failureEvent);
break;
case TRANSACTION_INFO:
TransactionInfoEvent transactionInfoEvent = (TransactionInfoEvent) event;
writeErrorWrapper();
writeTransactionInfo(transactionInfoEvent);
break;
default:
throw new IllegalStateException("Unsupported event encountered:" + event.getType());
}
}
use of org.neo4j.server.http.cypher.format.api.StatementEndEvent in project neo4j by neo4j.
the class ExecutionResultSerializer method handleEvent.
public final void handleEvent(OutputEvent event) {
switch(event.getType()) {
case STATEMENT_START:
StatementStartEvent statementStartEvent = (StatementStartEvent) event;
InputStatement inputStatement = JsonMessageBodyReader.getInputStatement(parameters, statementStartEvent.getStatement());
writeStatementStart(statementStartEvent, inputStatement);
break;
case RECORD:
writeRecord((RecordEvent) event);
break;
case STATEMENT_END:
StatementEndEvent statementEndEvent = (StatementEndEvent) event;
writeStatementEnd(statementEndEvent);
break;
case FAILURE:
FailureEvent failureEvent = (FailureEvent) event;
writeFailure(failureEvent);
break;
case TRANSACTION_INFO:
TransactionInfoEvent transactionInfoEvent = (TransactionInfoEvent) event;
writeTransactionInfo(transactionInfoEvent);
break;
default:
throw new IllegalStateException("Unsupported event encountered:" + event.getType());
}
}
use of org.neo4j.server.http.cypher.format.api.StatementEndEvent in project neo4j by neo4j.
the class ExecutionResultSerializerTest method writeStatementEnd.
private static void writeStatementEnd(ExecutionResultSerializer serializer, ExecutionPlanDescription planDescription, Iterable<Notification> notifications) {
QueryExecutionType queryExecutionType = null != planDescription ? QueryExecutionType.profiled(QueryExecutionType.QueryType.READ_WRITE) : QueryExecutionType.query(QueryExecutionType.QueryType.READ_WRITE);
serializer.writeStatementEnd(new StatementEndEvent(queryExecutionType, null, planDescription, notifications));
}
use of org.neo4j.server.http.cypher.format.api.StatementEndEvent in project neo4j by neo4j.
the class AbstractEventSourceJoltSerializerTest method writeStatementEnd.
protected static void writeStatementEnd(LineDelimitedEventSourceJoltSerializer serializer, ExecutionPlanDescription planDescription, Iterable<Notification> notifications) {
QueryExecutionType queryExecutionType = null != planDescription ? QueryExecutionType.profiled(QueryExecutionType.QueryType.READ_WRITE) : QueryExecutionType.query(QueryExecutionType.QueryType.READ_WRITE);
serializer.writeStatementEnd(new StatementEndEvent(queryExecutionType, null, planDescription, notifications));
}
Aggregations