Skip to content

Commit

Permalink
Move deprecated cypher classes to internal packages
Browse files Browse the repository at this point in the history
  • Loading branch information
davidegrohmann committed Feb 16, 2016
1 parent 1ce1ebc commit 3f680d6
Show file tree
Hide file tree
Showing 46 changed files with 112 additions and 133 deletions.
Expand Up @@ -20,6 +20,7 @@
package org.neo4j.internal.cypher.acceptance

import org.neo4j.cypher._
import org.neo4j.cypher.internal.QueryStatistics
import org.neo4j.graphdb.{Node, Path, Relationship}

import scala.collection.JavaConverters._
Expand Down
Expand Up @@ -22,6 +22,7 @@ package org.neo4j.internal.cypher.acceptance
import java.io.{File, PrintWriter}
import java.net.{URLConnection, URLStreamHandler, URLStreamHandlerFactory, URL}
import org.neo4j.cypher._
import org.neo4j.cypher.internal.ExecutionEngine
import org.neo4j.cypher.internal.compiler.v3_0.test_helpers.CreateTempFileTestSupport
import org.neo4j.cypher.internal.frontend.v3_0.helpers.StringHelper.RichString
import org.neo4j.graphdb.factory.GraphDatabaseSettings
Expand Down
Expand Up @@ -22,6 +22,7 @@ package org.neo4j.internal.cypher.acceptance
import java.util

import org.neo4j.cypher._
import org.neo4j.cypher.internal.{PlanDescription, ExecutionEngine}
import org.neo4j.cypher.internal.compiler.v3_0.planner.logical.idp.IDPSolverMonitor
import org.neo4j.graphdb.GraphDatabaseService
import org.neo4j.graphdb.config.Setting
Expand Down
Expand Up @@ -19,9 +19,10 @@
*/
package org.neo4j.internal.cypher.acceptance

import org.neo4j.cypher.internal.ExtendedExecutionResult
import org.neo4j.cypher.internal.compatibility.CompatibilityPlanDescriptionFor3_0
import org.neo4j.cypher.internal.compiler.v3_0._
import org.neo4j.cypher.{ExecutionEngineFunSuite, ExtendedExecutionResult}
import org.neo4j.cypher.ExecutionEngineFunSuite
import org.scalatest.matchers.{MatchResult, Matcher}

class PreParsingAcceptanceTest extends ExecutionEngineFunSuite {
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.javacompat;
package org.neo4j.cypher.javacompat.internal;

import scala.collection.JavaConversions;

Expand All @@ -28,17 +28,18 @@
import java.util.NoSuchElementException;
import java.util.Set;

import org.neo4j.cypher.ExtendedPlanDescription;
import org.neo4j.cypher.internal.ExtendedPlanDescription;
import org.neo4j.cypher.ProfilerStatisticsNotReadyException;
import org.neo4j.cypher.internal.PlanDescription;
import org.neo4j.graphdb.ExecutionPlanDescription;

import static org.neo4j.helpers.Exceptions.withCause;

class Description implements ExecutionPlanDescription
{
private final org.neo4j.cypher.PlanDescription description;
private final org.neo4j.cypher.internal.PlanDescription description;

public Description( org.neo4j.cypher.PlanDescription description )
public Description( PlanDescription description )
{
this.description = description;
}
Expand All @@ -59,7 +60,7 @@ public String getName()
public List<ExecutionPlanDescription> getChildren()
{
List<ExecutionPlanDescription> result = new ArrayList<>();
for ( org.neo4j.cypher.PlanDescription child : JavaConversions.asJavaIterable( description.children() ) )
for ( PlanDescription child : JavaConversions.asJavaIterable( description.children() ) )
{
result.add( new Description( child ) );
}
Expand Down Expand Up @@ -91,7 +92,7 @@ public boolean hasProfilerStatistics()
@Override
public ProfilerStatistics getProfilerStatistics()
{
final org.neo4j.cypher.javacompat.ProfilerStatistics statistics;
final org.neo4j.cypher.javacompat.internal.ProfilerStatistics statistics;
try
{
statistics = description.asJava().getProfilerStatistics();
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.javacompat;
package org.neo4j.cypher.javacompat.internal;

import java.util.Map;

Expand All @@ -33,12 +33,10 @@
* This class construct and initialize both the cypher compiler and the cypher runtime, which is a very expensive
* operation so please make sure this will be constructed only once and properly reused.
*
* @deprecated use {@link org.neo4j.graphdb.GraphDatabaseService#execute(String)} instead.
*/
@Deprecated
public class ExecutionEngine
{
private org.neo4j.cypher.ExecutionEngine inner;
private org.neo4j.cypher.internal.ExecutionEngine inner;

/**
* Creates an execution engine around the give graph database
Expand All @@ -59,10 +57,9 @@ public ExecutionEngine( GraphDatabaseService database, LogProvider logProvider )
inner = createInnerEngine( database, logProvider );
}

protected
org.neo4j.cypher.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider )
protected org.neo4j.cypher.internal.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider )
{
return new org.neo4j.cypher.ExecutionEngine( database, logProvider );
return new org.neo4j.cypher.internal.ExecutionEngine( database, logProvider );
}

/**
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.javacompat;
package org.neo4j.cypher.javacompat.internal;

import scala.collection.JavaConversions;

Expand All @@ -28,6 +28,7 @@
import java.util.stream.Stream;

import org.neo4j.cypher.CypherException;
import org.neo4j.cypher.internal.ExtendedExecutionResult;
import org.neo4j.graphdb.ExecutionPlanDescription;
import org.neo4j.graphdb.Notification;
import org.neo4j.graphdb.QueryExecutionException;
Expand All @@ -49,14 +50,10 @@
* Either iterate directly over the ExecutionResult to retrieve each row of the result
* set, or use <code>columnAs()</code> to access a single column with result objects
* cast to a type.
*
* @deprecated See {@link org.neo4j.graphdb.Result}, and use
* {@link org.neo4j.graphdb.GraphDatabaseService#execute(String, Map)} instead.
*/
@Deprecated
public class ExecutionResult implements ResourceIterable<Map<String,Object>>, Result
{
private final org.neo4j.cypher.ExtendedExecutionResult inner;
private final ExtendedExecutionResult inner;

/**
* Initialized lazily and should be accessed with {@link #innerIterator()} method
Expand All @@ -68,10 +65,10 @@ public class ExecutionResult implements ResourceIterable<Map<String,Object>>, Re
* Constructor used by the Cypher framework. End-users should not
* create an ExecutionResult directly, but instead use the result
* returned from calling {@link ExecutionEngine#execute(String)}.
*
*
* @param projection Execution result projection to use.
*/
public ExecutionResult( org.neo4j.cypher.ExtendedExecutionResult projection )
public ExecutionResult( ExtendedExecutionResult projection )
{
inner = Objects.requireNonNull( projection );
//if updating query we must fetch the iterator right away in order to eagerly perform updates
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.javacompat;
package org.neo4j.cypher.javacompat.internal;


import java.util.List;
Expand All @@ -30,17 +30,13 @@
* Instances describe single execution steps in a Cypher query execution plan
*
* Execution plans form a tree of execution steps. Each step is described by a PlanDescription object.
*
* @deprecated See {@link org.neo4j.graphdb.ExecutionPlanDescription} which you can get from {@link org.neo4j.graphdb.Result}
* when using {@link org.neo4j.graphdb.GraphDatabaseService#execute(String, Map)}.
*/
@Deprecated
public interface PlanDescription
{
/**
* @return descriptive name for this kind of execution step
*/
public String getName();
String getName();

/**
* Retrieve argument map for the associated execution step
Expand All @@ -50,21 +46,21 @@ public interface PlanDescription
*
* @return a map containing arguments that describe this execution step in more detail
*/
public Map<String, Object> getArguments();
Map<String, Object> getArguments();

/**
* @return list of previous (child) execution step descriptions
*/
public List<PlanDescription> getChildren();
List<PlanDescription> getChildren();

/**
* @return true, if ProfilerStatistics are available for this execution step
*/
public boolean hasProfilerStatistics();
boolean hasProfilerStatistics();

/**
* @return profiler statistics for this execution step iff available
* @throws ProfilerStatisticsNotReadyException iff profiler statistics are not available
*/
public ProfilerStatistics getProfilerStatistics() throws ProfilerStatisticsNotReadyException;
ProfilerStatistics getProfilerStatistics() throws ProfilerStatisticsNotReadyException;
}
Expand Up @@ -17,17 +17,11 @@
* 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.javacompat;

import java.util.Map;
package org.neo4j.cypher.javacompat.internal;

/**
* Profiler statistics for a single execution step of a Cypher query execution plan
*
* @deprecated See {@link org.neo4j.graphdb.ExecutionPlanDescription.ProfilerStatistics} which you can get from an {@link org.neo4j.graphdb.ExecutionPlanDescription}
* when using {@link org.neo4j.graphdb.GraphDatabaseService#execute(String, Map)}.
*/
@Deprecated
public interface ProfilerStatistics
{
/**
Expand Down
Expand Up @@ -17,22 +17,16 @@
* 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.javacompat;

import java.util.Map;
package org.neo4j.cypher.javacompat.internal;

/**
* Holds statistics for the execution of a query.
*
* @deprecated See {@link org.neo4j.graphdb.QueryStatistics} which you can get from {@link org.neo4j.graphdb.Result}
* when using {@link org.neo4j.graphdb.GraphDatabaseService#execute(String, Map)}.
*/
@Deprecated
public class QueryStatistics implements org.neo4j.graphdb.QueryStatistics
{
private final org.neo4j.cypher.QueryStatistics inner;
private final org.neo4j.cypher.internal.QueryStatistics inner;

QueryStatistics( org.neo4j.cypher.QueryStatistics inner )
QueryStatistics( org.neo4j.cypher.internal.QueryStatistics inner )
{
this.inner = inner;
}
Expand Down
Expand Up @@ -22,8 +22,6 @@
import java.util.Map;

import org.neo4j.cypher.CypherException;
import org.neo4j.cypher.javacompat.ExecutionEngine;
import org.neo4j.cypher.javacompat.ExecutionResult;
import org.neo4j.graphdb.GraphDatabaseService;
import org.neo4j.graphdb.Result;
import org.neo4j.kernel.impl.query.QueryExecutionEngine;
Expand All @@ -47,8 +45,7 @@ public ServerExecutionEngine( GraphDatabaseService database, LogProvider logProv
}

@Override
protected
org.neo4j.cypher.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider )
protected org.neo4j.cypher.internal.ExecutionEngine createInnerEngine( GraphDatabaseService database, LogProvider logProvider )
{
return serverExecutionEngine = new org.neo4j.cypher.internal.ServerExecutionEngine( database, logProvider );
}
Expand Down
Expand Up @@ -21,6 +21,8 @@ package org.neo4j.cypher

import java.util.concurrent.atomic.AtomicLong

import org.neo4j.cypher.internal.StringCacheMonitor

class PlanCacheMetricsMonitor extends StringCacheMonitor {
private val counter = new AtomicLong()
override def cacheDiscard(ignored1: String, ignored2: String): Unit = {
Expand Down
Expand Up @@ -22,8 +22,8 @@ package org.neo4j.cypher.internal
import java.util

import org.neo4j.cypher.internal.compiler.v3_0.{RuntimeName, PlannerName}
import org.neo4j.cypher.{ExtendedPlanDescription, CypherVersion, PlanDescription}
import org.neo4j.cypher.javacompat.{PlanDescription => JPlanDescription}
import org.neo4j.cypher.javacompat.internal
import org.neo4j.cypher.CypherVersion


class AmendedRootPlanDescription(inner: ExtendedPlanDescription, version: CypherVersion, planner: PlannerName, runtime: RuntimeName)
Expand All @@ -35,7 +35,7 @@ class AmendedRootPlanDescription(inner: ExtendedPlanDescription, version: Cypher

def name = inner.name

def asJava = new JPlanDescription {
def asJava = new internal.PlanDescription {
val getName = name

val getProfilerStatistics = childAsJava.getProfilerStatistics
Expand Down
Expand Up @@ -17,16 +17,16 @@
* 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
package org.neo4j.cypher.internal

import java.lang.Boolean.FALSE
import java.util.{Map => JavaMap}

import org.neo4j.cypher._
import org.neo4j.cypher.internal.compiler.v3_0.helpers.JavaResultValueConverter
import org.neo4j.cypher.internal.compiler.v3_0.prettifier.Prettifier
import org.neo4j.cypher.internal.compiler.v3_0.{LRUCache => LRUCachev3_0, _}
import org.neo4j.cypher.internal.tracing.{CompilationTracer, TimingCompilationTracer}
import org.neo4j.cypher.internal.{CypherCompiler, _}
import org.neo4j.graphdb.GraphDatabaseService
import org.neo4j.graphdb.config.Setting
import org.neo4j.graphdb.factory.GraphDatabaseSettings
Expand All @@ -43,10 +43,7 @@ trait StringCacheMonitor extends CypherCacheMonitor[String, api.Statement]
/**
* This class construct and initialize both the cypher compiler and the cypher runtime, which is a very expensive
* operation so please make sure this will be constructed only once and properly reused.
*
* @deprecated use { @link org.neo4j.graphdb.GraphDatabaseService#execute(String)} instead.
*/
@Deprecated
class ExecutionEngine(graph: GraphDatabaseService, logProvider: LogProvider = NullLogProvider.getInstance()) {

require(graph != null, "Can't work with a null graph database")
Expand Down
Expand Up @@ -19,7 +19,6 @@
*/
package org.neo4j.cypher.internal

import org.neo4j.cypher.ExtendedExecutionResult
import org.neo4j.graphdb.Transaction
import org.neo4j.kernel.GraphDatabaseAPI
import org.neo4j.kernel.api.Statement
Expand Down
Expand Up @@ -17,7 +17,21 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* Execute Cypher queries from Java code.
*/
package org.neo4j.cypher.javacompat;
package org.neo4j.cypher.internal

import java.io.PrintWriter

import org.neo4j.graphdb.ResourceIterator

trait ExecutionResult extends Iterator[Map[String, Any]] {
def columns: List[String]
def javaColumns: java.util.List[String]
def javaColumnAs[T](column: String): ResourceIterator[T]
def columnAs[T](column: String): Iterator[T]
def javaIterator: ResourceIterator[java.util.Map[String, Any]]
def dumpToString(writer: PrintWriter)
def dumpToString(): String
def queryStatistics(): QueryStatistics
def executionPlanDescription(): PlanDescription
def close()
}
Expand Up @@ -17,16 +17,11 @@
* 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
package org.neo4j.cypher.internal

import org.neo4j.graphdb.Result.ResultVisitor
import org.neo4j.graphdb._
import org.neo4j.graphdb.{Notification, QueryExecutionType}

/**
* @deprecated See { @link org.neo4j.graphdb.Result}, and use
* { @link org.neo4j.graphdb.GraphDatabaseService#execute(String, Map)} instead.
*/
@Deprecated
trait ExtendedExecutionResult extends ExecutionResult {
def planDescriptionRequested: Boolean
def executionType: QueryExecutionType
Expand Down

0 comments on commit 3f680d6

Please sign in to comment.