Skip to content

Commit

Permalink
Move AssertionRunner and iterator helpers to frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats-SX committed Feb 16, 2017
1 parent 5602aca commit dc403ea
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 21 deletions.
Expand Up @@ -19,12 +19,11 @@
*/
package org.neo4j.cypher.internal.compiler.v3_2.phases

import org.neo4j.cypher.internal.compiler.v3_2.AssertionRunner
import org.neo4j.cypher.internal.compiler.v3_2.AssertionRunner.Thunk
import org.neo4j.cypher.internal.frontend.v3_2.phases.CompilationPhaseTracer.CompilationPhase
import org.neo4j.cypher.internal.frontend.v3_2.phases.CompilationPhaseTracer.CompilationPhase.PIPE_BUILDING
import org.neo4j.cypher.internal.compiler.v3_2.helpers.closing
import org.neo4j.cypher.internal.frontend.v3_2.helpers.{AssertionRunner, closing}
import org.neo4j.cypher.internal.frontend.v3_2.InternalException
import org.neo4j.cypher.internal.frontend.v3_2.helpers.AssertionRunner.Thunk
import org.neo4j.cypher.internal.frontend.v3_2.phases.BaseContext

import scala.reflect.ClassTag
Expand Down
Expand Up @@ -19,7 +19,7 @@
*/
package org.neo4j.cypher.internal.compiler.v3_2.phases

import org.neo4j.cypher.internal.compiler.v3_2.AssertionRunner.{Thunk, runUnderAssertion}
import org.neo4j.cypher.internal.frontend.v3_2.helpers.AssertionRunner.{Thunk, runUnderAssertion}
import org.neo4j.cypher.internal.frontend.v3_2.test_helpers.CypherFunSuite

class AssertionsShouldBeEnabledTest extends CypherFunSuite {
Expand Down
Expand Up @@ -25,16 +25,16 @@ import java.util
import org.neo4j.codegen.CodeGeneratorOption._
import org.neo4j.codegen.TypeReference._
import org.neo4j.codegen.source.{SourceCode, SourceVisitor}
import org.neo4j.codegen.{CodeGenerator, _}
import org.neo4j.cypher.internal.compiler.v3_1.codegen._
import org.neo4j.cypher.internal.compiler.v3_1.codegen.ir.expressions.{CodeGenType, FloatType, IntType, ReferenceType}
import org.neo4j.cypher.internal.compiler.v3_1.executionplan._
import org.neo4j.cypher.internal.compiler.v3_1.helpers._
import org.neo4j.cypher.internal.compiler.v3_1.helpers.using
import org.neo4j.cypher.internal.compiler.v3_1.planDescription.{Id, InternalPlanDescription}
import org.neo4j.cypher.internal.compiler.v3_1.planner.CantCompileQueryException
import org.neo4j.cypher.internal.compiler.v3_1.spi.{InternalResultVisitor, QueryContext}
import org.neo4j.cypher.internal.compiler.v3_1.{ExecutionMode, TaskCloser}
import org.neo4j.cypher.internal.frontend.v3_1.symbols
import org.neo4j.codegen.{CodeGenerator, Parameter, _}
import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.impl.core.NodeManager

Expand Down Expand Up @@ -195,4 +195,4 @@ object GeneratedQueryStructure extends CodeStructure[GeneratedQuery] {
case CodeGenType(symbols.CTRelationship, IntType) => constant(-1L)
case _ => constant(null)
}
}
}
Expand Up @@ -23,8 +23,8 @@ import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeUnit.MILLISECONDS

import org.mockito.Mockito.verify
import org.neo4j.cypher.internal.frontend.v3_2.helpers.{closing, using}
import org.neo4j.cypher.internal.frontend.v3_2.phases.CompilationPhaseTracer.CompilationPhase.{LOGICAL_PLANNING, PARSING}
import org.neo4j.cypher.internal.compiler.v3_2.helpers.{closing, using}
import org.neo4j.cypher.internal.frontend.v3_2.test_helpers.CypherFunSuite
import org.neo4j.cypher.internal.tracing.CompilationTracer.NO_COMPILATION_TRACING
import org.neo4j.cypher.internal.tracing.TimingCompilationTracer.QueryEvent
Expand Down
Expand Up @@ -17,7 +17,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2;
package org.neo4j.cypher.internal.frontend.v3_2.helpers;

/*
Why is this here!?
Expand Down
Expand Up @@ -17,12 +17,10 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.neo4j.cypher.internal.compiler.v3_2
package org.neo4j.cypher.internal.frontend.v3_2

package object helpers {

type CountingIterator[T] = Counter#CountingIterator[T]

def closing[Resource <: AutoCloseable, Result](resource: Resource)(block: => Result)(
implicit onSuccess: Resource => Unit = (r: Resource) => {},
onError: (Resource, Throwable) => Unit = (r: Resource, t: Throwable) => {}): Result = {
Expand Down
Expand Up @@ -19,15 +19,14 @@
*/
package org.neo4j.cypher.internal.spi.v3_2.codegen


import org.neo4j.codegen.FieldReference.field
import org.neo4j.codegen.Parameter.param
import org.neo4j.codegen._
import org.neo4j.cypher.internal.codegen.{CompiledEquivalenceUtils, CompiledOrderabilityUtils}
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.CodeGenContext
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.ir.expressions.{CodeGenType, ReferenceType, RepresentationType}
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.spi._
import org.neo4j.cypher.internal.compiler.v3_2.helpers._
import org.neo4j.cypher.internal.frontend.v3_2.helpers._
import org.neo4j.cypher.internal.frontend.v3_2.symbols

import scala.collection.mutable
Expand Down
Expand Up @@ -34,18 +34,19 @@ import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.ir.expressions.{B
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.spi._
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.{CodeGenContext, QueryExecutionEvent}
import org.neo4j.cypher.internal.compiler.v3_2.ast.convert.commands.DirectionConverter.toGraphDb
import org.neo4j.cypher.internal.compiler.v3_2.helpers._
import org.neo4j.cypher.internal.compiler.v3_2.planDescription.Id
import org.neo4j.cypher.internal.frontend.v3_2.helpers._
import org.neo4j.cypher.internal.frontend.v3_2.symbols.{CTNode, CTRelationship, ListType}
import org.neo4j.cypher.internal.frontend.v3_2.{ParameterNotFoundException, SemanticDirection, symbols}
import org.neo4j.cypher.internal.spi.v3_2.codegen.GeneratedMethodStructure.CompletableFinalizer
import org.neo4j.cypher.internal.spi.v3_2.codegen.Methods._
import org.neo4j.cypher.internal.spi.v3_2.codegen.Templates.{createNewInstance, handleKernelExceptions, newRelationshipDataExtractor, tryCatch}
import org.neo4j.graphdb.Direction
import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.api.schema_new.index.{NewIndexDescriptor, NewIndexDescriptorFactory}
import org.neo4j.kernel.impl.api.RelationshipDataExtractor
import org.neo4j.kernel.impl.api.store.RelationshipIterator
import GeneratedMethodStructure.CompletableFinalizer

import scala.collection.mutable

object GeneratedMethodStructure {
Expand Down
Expand Up @@ -35,11 +35,11 @@ import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.ir.expressions._
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.spi.{CodeStructure, CodeStructureResult, MethodStructure}
import org.neo4j.cypher.internal.compiled_runtime.v3_2.executionplan.{GeneratedQuery, GeneratedQueryExecution}
import org.neo4j.cypher.internal.compiler.v3_2.executionplan._
import org.neo4j.cypher.internal.compiler.v3_2.helpers._
import org.neo4j.cypher.internal.compiler.v3_2.planDescription.{Id, InternalPlanDescription}
import org.neo4j.cypher.internal.compiler.v3_2.planner.CantCompileQueryException
import org.neo4j.cypher.internal.compiler.v3_2.spi.{InternalResultVisitor, QueryContext}
import org.neo4j.cypher.internal.compiler.v3_2.{ExecutionMode, ResultRowImpl, TaskCloser}
import org.neo4j.cypher.internal.frontend.v3_2.helpers.using
import org.neo4j.cypher.internal.frontend.v3_2.symbols
import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.impl.core.NodeManager
Expand Down
Expand Up @@ -30,11 +30,11 @@ import org.neo4j.collection.primitive.{Primitive, PrimitiveLongIntMap, Primitive
import org.neo4j.cypher.internal.codegen.{PrimitiveNodeStream, PrimitiveRelationshipStream}
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.QueryExecutionTracer
import org.neo4j.cypher.internal.compiler.v3_2.executionplan._
import org.neo4j.cypher.internal.compiler.v3_2.helpers.using
import org.neo4j.cypher.internal.compiler.v3_2.planDescription.InternalPlanDescription
import org.neo4j.cypher.internal.compiler.v3_2.spi.{QueryContext, QueryTransactionalContext}
import org.neo4j.cypher.internal.compiler.v3_2.{ExecutionMode, ResultRowImpl, TaskCloser, helpers}
import org.neo4j.cypher.internal.compiler.v3_2.{ExecutionMode, ResultRowImpl, TaskCloser}
import org.neo4j.cypher.internal.frontend.v3_2.CypherExecutionException
import org.neo4j.cypher.internal.frontend.v3_2.helpers.using
import org.neo4j.graphdb.Direction
import org.neo4j.kernel.api.exceptions.KernelException
import org.neo4j.kernel.api.{ReadOperations, StatementTokenNameLookup, TokenNameLookup}
Expand Down
Expand Up @@ -26,11 +26,11 @@ import org.neo4j.codegen.{CodeGenerationStrategy, CodeGenerator, Expression, Met
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.ir.expressions.{CodeGenType, ReferenceType}
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.spi._
import org.neo4j.cypher.internal.compiled_runtime.v3_2.codegen.{CodeGenContext, QueryExecutionTracer}
import org.neo4j.cypher.internal.compiler.v3_2.executionplan.{Provider, Completable}
import org.neo4j.cypher.internal.compiler.v3_2.helpers._
import org.neo4j.cypher.internal.compiler.v3_2.executionplan.{Completable, Provider}
import org.neo4j.cypher.internal.compiler.v3_2.planDescription.InternalPlanDescription
import org.neo4j.cypher.internal.compiler.v3_2.spi.QueryContext
import org.neo4j.cypher.internal.compiler.v3_2.{ExecutionMode, TaskCloser}
import org.neo4j.cypher.internal.frontend.v3_2.helpers._
import org.neo4j.cypher.internal.frontend.v3_2.test_helpers.CypherFunSuite
import org.neo4j.cypher.internal.frontend.v3_2.{SemanticDirection, SemanticTable, symbols}
import org.neo4j.cypher.internal.spi.v3_2.codegen.GeneratedQueryStructure.typeRef
Expand Down

0 comments on commit dc403ea

Please sign in to comment.