Skip to content

Commit

Permalink
Rename IndexDescriptor to SchemaIndexDescriptor. Likewise for IndexDe…
Browse files Browse the repository at this point in the history
…scriptorFactory to SchemaIndexDescriptorFactory.
  • Loading branch information
chrisvest committed Mar 9, 2018
1 parent f7d2b5a commit 504e053
Show file tree
Hide file tree
Showing 276 changed files with 1,687 additions and 1,679 deletions.
Expand Up @@ -21,7 +21,7 @@


import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory; import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory;
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory; import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory;
import org.neo4j.kernel.impl.store.record.ConstraintRule; import org.neo4j.kernel.impl.store.record.ConstraintRule;
import org.neo4j.kernel.impl.store.record.IndexRule; import org.neo4j.kernel.impl.store.record.IndexRule;


Expand Down Expand Up @@ -52,20 +52,20 @@ public static ConstraintRule relPropertyExistenceConstraintRule( long ruleId, in
public static IndexRule indexRule( long ruleId, int labelId, int propertyId, IndexProvider.Descriptor public static IndexRule indexRule( long ruleId, int labelId, int propertyId, IndexProvider.Descriptor
descriptor ) descriptor )
{ {
return IndexRule.indexRule( ruleId, IndexDescriptorFactory.forLabel( labelId, propertyId ), descriptor ); return IndexRule.indexRule( ruleId, SchemaIndexDescriptorFactory.forLabel( labelId, propertyId ), descriptor );
} }


public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId, public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId,
IndexProvider.Descriptor descriptor, long constraintId ) IndexProvider.Descriptor descriptor, long constraintId )
{ {
return IndexRule.constraintIndexRule( ruleId, IndexDescriptorFactory.uniqueForLabel( labelId, propertyId ), return IndexRule.constraintIndexRule( ruleId, SchemaIndexDescriptorFactory.uniqueForLabel( labelId, propertyId ),
descriptor, constraintId ); descriptor, constraintId );
} }


public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId, public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId,
IndexProvider.Descriptor descriptor ) IndexProvider.Descriptor descriptor )
{ {
return IndexRule.indexRule( ruleId, IndexDescriptorFactory.uniqueForLabel( labelId, propertyId ), return IndexRule.indexRule( ruleId, SchemaIndexDescriptorFactory.uniqueForLabel( labelId, propertyId ),
descriptor ); descriptor );
} }
} }
Expand Up @@ -75,7 +75,7 @@
import org.neo4j.kernel.api.labelscan.NodeLabelUpdate; import org.neo4j.kernel.api.labelscan.NodeLabelUpdate;
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory; import org.neo4j.kernel.api.schema.SchemaDescriptorFactory;
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory; import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory;
import org.neo4j.kernel.api.schema.index.IndexDescriptor; import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptor;
import org.neo4j.kernel.configuration.Config; import org.neo4j.kernel.configuration.Config;
import org.neo4j.kernel.impl.annotations.Documented; import org.neo4j.kernel.impl.annotations.Documented;
import org.neo4j.kernel.impl.api.KernelStatement; import org.neo4j.kernel.impl.api.KernelStatement;
Expand Down Expand Up @@ -135,8 +135,8 @@
import static org.neo4j.kernel.api.ReadOperations.ANY_LABEL; import static org.neo4j.kernel.api.ReadOperations.ANY_LABEL;
import static org.neo4j.kernel.api.ReadOperations.ANY_RELATIONSHIP_TYPE; import static org.neo4j.kernel.api.ReadOperations.ANY_RELATIONSHIP_TYPE;
import static org.neo4j.kernel.api.labelscan.NodeLabelUpdate.labelChanges; import static org.neo4j.kernel.api.labelscan.NodeLabelUpdate.labelChanges;
import static org.neo4j.kernel.api.schema.index.IndexDescriptorFactory.forLabel; import static org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory.forLabel;
import static org.neo4j.kernel.api.schema.index.IndexDescriptorFactory.uniqueForLabel; import static org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory.uniqueForLabel;
import static org.neo4j.kernel.impl.store.AbstractDynamicStore.readFullByteArrayFromHeavyRecords; import static org.neo4j.kernel.impl.store.AbstractDynamicStore.readFullByteArrayFromHeavyRecords;
import static org.neo4j.kernel.impl.store.DynamicArrayStore.allocateFromNumbers; import static org.neo4j.kernel.impl.store.DynamicArrayStore.allocateFromNumbers;
import static org.neo4j.kernel.impl.store.DynamicArrayStore.getRightArray; import static org.neo4j.kernel.impl.store.DynamicArrayStore.getRightArray;
Expand Down Expand Up @@ -568,7 +568,7 @@ public void shouldReportNodesThatAreNotIndexed() throws Exception
while ( indexRuleIterator.hasNext() ) while ( indexRuleIterator.hasNext() )
{ {
IndexRule indexRule = indexRuleIterator.next(); IndexRule indexRule = indexRuleIterator.next();
IndexDescriptor descriptor = indexRule.getIndexDescriptor(); SchemaIndexDescriptor descriptor = indexRule.getIndexDescriptor();
IndexAccessor accessor = fixture.directStoreAccess().indexes(). IndexAccessor accessor = fixture.directStoreAccess().indexes().
apply( indexRule.getProviderDescriptor() ).getOnlineAccessor( apply( indexRule.getProviderDescriptor() ).getOnlineAccessor(
indexRule.getId(), descriptor, samplingConfig ); indexRule.getId(), descriptor, samplingConfig );
Expand Down
Expand Up @@ -55,7 +55,7 @@
import org.neo4j.internal.kernel.api.schema.SchemaDescriptor; import org.neo4j.internal.kernel.api.schema.SchemaDescriptor;
import org.neo4j.kernel.api.index.IndexProvider; import org.neo4j.kernel.api.index.IndexProvider;
import org.neo4j.kernel.api.labelscan.NodeLabelRange; import org.neo4j.kernel.api.labelscan.NodeLabelRange;
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory; import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory;
import org.neo4j.kernel.impl.store.record.AbstractBaseRecord; import org.neo4j.kernel.impl.store.record.AbstractBaseRecord;
import org.neo4j.kernel.impl.store.record.DynamicRecord; import org.neo4j.kernel.impl.store.record.DynamicRecord;
import org.neo4j.kernel.impl.store.record.IndexRule; import org.neo4j.kernel.impl.store.record.IndexRule;
Expand Down Expand Up @@ -389,7 +389,7 @@ private Object parameter( Class<?> type )
} }
if ( type == IndexRule.class ) if ( type == IndexRule.class )
{ {
return IndexRule.indexRule( 1, IndexDescriptorFactory.forLabel( 2, 3 ), return IndexRule.indexRule( 1, SchemaIndexDescriptorFactory.forLabel( 2, 3 ),
new IndexProvider.Descriptor( "provider", "version" ) ); new IndexProvider.Descriptor( "provider", "version" ) );
} }
if ( type == SchemaRule.class ) if ( type == SchemaRule.class )
Expand Down
Expand Up @@ -21,11 +21,11 @@ package org.neo4j.cypher.internal.spi.v2_3


import org.neo4j.cypher.internal.compiler.v2_3.spi.SchemaTypes import org.neo4j.cypher.internal.compiler.v2_3.spi.SchemaTypes
import org.neo4j.kernel.api.schema.constaints.{NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor} import org.neo4j.kernel.api.schema.constaints.{NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor}
import org.neo4j.kernel.api.schema.index.{IndexDescriptorFactory, IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptorFactory, SchemaIndexDescriptor => KernelIndexDescriptor}


trait SchemaDescriptorTranslation { trait SchemaDescriptorTranslation {
implicit def cypherToKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor = implicit def cypherToKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor =
IndexDescriptorFactory.forLabel(index.labelId, index.propertyId) SchemaIndexDescriptorFactory.forLabel(index.labelId, index.propertyId)


implicit def kernelToCypher(index: KernelIndexDescriptor): SchemaTypes.IndexDescriptor = implicit def kernelToCypher(index: KernelIndexDescriptor): SchemaTypes.IndexDescriptor =
if (index.schema().getPropertyIds.length == 1) if (index.schema().getPropertyIds.length == 1)
Expand Down
Expand Up @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compiler.v2_3.spi.{GraphStatistics, StatisticsC
import org.neo4j.cypher.internal.frontend.v2_3.{LabelId, NameId, PropertyKeyId, RelTypeId} import org.neo4j.cypher.internal.frontend.v2_3.{LabelId, NameId, PropertyKeyId, RelTypeId}
import org.neo4j.kernel.api.ReadOperations import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory


object TransactionBoundGraphStatistics { object TransactionBoundGraphStatistics {
def apply(ops: ReadOperations) = new StatisticsCompletingGraphStatistics(new BaseTransactionBoundGraphStatistics(ops)) def apply(ops: ReadOperations) = new StatisticsCompletingGraphStatistics(new BaseTransactionBoundGraphStatistics(ops))
Expand All @@ -35,7 +35,7 @@ object TransactionBoundGraphStatistics {


def indexSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] = def indexSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] =
try { try {
val indexDescriptor = IndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = SchemaIndexDescriptorFactory.forLabel( label, property )
val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble


// Probability of any node with the given label, to have a property with a given value // Probability of any node with the given label, to have a property with a given value
Expand All @@ -51,7 +51,7 @@ object TransactionBoundGraphStatistics {


def indexPropertyExistsSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] = def indexPropertyExistsSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] =
try { try {
val indexDescriptor = IndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = SchemaIndexDescriptorFactory.forLabel( label, property )
val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble


// Probability of any node with the given label, to have a given property // Probability of any node with the given label, to have a given property
Expand Down
Expand Up @@ -29,7 +29,7 @@ import org.neo4j.internal.kernel.api.InternalIndexState
import org.neo4j.internal.kernel.api.exceptions.KernelException import org.neo4j.internal.kernel.api.exceptions.KernelException
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor
import org.neo4j.kernel.api.schema.index.{IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptor => KernelIndexDescriptor}
import org.neo4j.kernel.impl.transaction.log.TransactionIdStore import org.neo4j.kernel.impl.transaction.log.TransactionIdStore


import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
Expand Down
Expand Up @@ -47,7 +47,7 @@ import org.neo4j.kernel.GraphDatabaseQueryService
import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException} import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException}
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory
import org.neo4j.kernel.api.{SilentTokenNameLookup, StatementConstants} import org.neo4j.kernel.api.{SilentTokenNameLookup, StatementConstants}
import org.neo4j.kernel.impl.core.EmbeddedProxySPI import org.neo4j.kernel.impl.core.EmbeddedProxySPI
import org.neo4j.values.storable.Values import org.neo4j.values.storable.Values
Expand Down Expand Up @@ -480,7 +480,7 @@ final class TransactionBoundQueryContext(tc: TransactionalContextWrapper)
} }


def dropIndexRule(labelId: Int, propertyKeyId: Int) = def dropIndexRule(labelId: Int, propertyKeyId: Int) =
tc.statement.schemaWriteOperations().indexDrop(IndexDescriptorFactory.forLabel( labelId, propertyKeyId )) tc.statement.schemaWriteOperations().indexDrop(SchemaIndexDescriptorFactory.forLabel( labelId, propertyKeyId ))


def createUniqueConstraint(labelId: Int, propertyKeyId: Int): IdempotentResult[SchemaTypes.UniquenessConstraint] = try { def createUniqueConstraint(labelId: Int, propertyKeyId: Int): IdempotentResult[SchemaTypes.UniquenessConstraint] = try {
IdempotentResult( IdempotentResult(
Expand Down
Expand Up @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.spi.v3_1
import org.neo4j.cypher.internal.compiler.v3_1.spi.SchemaTypes import org.neo4j.cypher.internal.compiler.v3_1.spi.SchemaTypes
import org.neo4j.internal.kernel.api.schema.SchemaDescriptor import org.neo4j.internal.kernel.api.schema.SchemaDescriptor
import org.neo4j.kernel.api.schema.constaints.{ConstraintDescriptorFactory, NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor => KernelUniquenessConstraint} import org.neo4j.kernel.api.schema.constaints.{ConstraintDescriptorFactory, NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor => KernelUniquenessConstraint}
import org.neo4j.kernel.api.schema.index.{IndexDescriptorFactory, IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptorFactory, SchemaIndexDescriptor => KernelIndexDescriptor}


trait SchemaDescriptorTranslation { trait SchemaDescriptorTranslation {
implicit def toKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor = implicit def toKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor =
IndexDescriptorFactory.forLabel(index.labelId, index.propertyId) SchemaIndexDescriptorFactory.forLabel(index.labelId, index.propertyId)


implicit def toCypher(index: KernelIndexDescriptor): SchemaTypes.IndexDescriptor = { implicit def toCypher(index: KernelIndexDescriptor): SchemaTypes.IndexDescriptor = {
assertSingleProperty(index.schema()) assertSingleProperty(index.schema())
Expand Down
Expand Up @@ -24,7 +24,7 @@ import org.neo4j.cypher.internal.compiler.v3_1.spi.{GraphStatistics, StatisticsC
import org.neo4j.cypher.internal.frontend.v3_1.{LabelId, NameId, PropertyKeyId, RelTypeId} import org.neo4j.cypher.internal.frontend.v3_1.{LabelId, NameId, PropertyKeyId, RelTypeId}
import org.neo4j.kernel.api.ReadOperations import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException import org.neo4j.kernel.api.exceptions.index.IndexNotFoundKernelException
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory


object TransactionBoundGraphStatistics { object TransactionBoundGraphStatistics {
def apply(ops: ReadOperations) = new StatisticsCompletingGraphStatistics(new BaseTransactionBoundGraphStatistics(ops)) def apply(ops: ReadOperations) = new StatisticsCompletingGraphStatistics(new BaseTransactionBoundGraphStatistics(ops))
Expand All @@ -35,7 +35,7 @@ object TransactionBoundGraphStatistics {


def indexSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] = def indexSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] =
try { try {
val indexDescriptor = IndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = SchemaIndexDescriptorFactory.forLabel( label, property )
val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble


// Probability of any node with the given label, to have a property with a given value // Probability of any node with the given label, to have a property with a given value
Expand All @@ -51,7 +51,7 @@ object TransactionBoundGraphStatistics {


def indexPropertyExistsSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] = def indexPropertyExistsSelectivity(label: LabelId, property: PropertyKeyId): Option[Selectivity] =
try { try {
val indexDescriptor = IndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = SchemaIndexDescriptorFactory.forLabel( label, property )
val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble val labeledNodes = operations.countsForNodeWithoutTxState( label ).toDouble


// Probability of any node with the given label, to have a given property // Probability of any node with the given label, to have a given property
Expand Down
Expand Up @@ -37,7 +37,7 @@ import org.neo4j.internal.kernel.api.procs.{DefaultParameterValue, Neo4jTypes}
import org.neo4j.internal.kernel.api.{InternalIndexState, procs} import org.neo4j.internal.kernel.api.{InternalIndexState, procs}
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor
import org.neo4j.kernel.api.schema.index.{IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptor => KernelIndexDescriptor}
import org.neo4j.procedure.Mode import org.neo4j.procedure.Mode


import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
Expand Down
Expand Up @@ -53,7 +53,7 @@ import org.neo4j.kernel.api.dbms.DbmsOperations
import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException} import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException}
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory
import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptorFactory
import org.neo4j.kernel.impl.core.EmbeddedProxySPI import org.neo4j.kernel.impl.core.EmbeddedProxySPI
import org.neo4j.kernel.impl.locking.ResourceTypes import org.neo4j.kernel.impl.locking.ResourceTypes
import org.neo4j.kernel.impl.util.ValueUtils import org.neo4j.kernel.impl.util.ValueUtils
Expand Down Expand Up @@ -490,7 +490,7 @@ final class TransactionBoundQueryContext(txContext: TransactionalContextWrapper)
} }


override def dropIndexRule(labelId: Int, propertyKeyId: Int) = override def dropIndexRule(labelId: Int, propertyKeyId: Int) =
txContext.statement.schemaWriteOperations().indexDrop(IndexDescriptorFactory.forLabel( labelId, propertyKeyId )) txContext.statement.schemaWriteOperations().indexDrop(SchemaIndexDescriptorFactory.forLabel( labelId, propertyKeyId ))


override def createUniqueConstraint(labelId: Int, propertyKeyId: Int): IdempotentResult[UniquenessConstraint] = try { override def createUniqueConstraint(labelId: Int, propertyKeyId: Int): IdempotentResult[UniquenessConstraint] = try {
IdempotentResult( IdempotentResult(
Expand Down
Expand Up @@ -36,7 +36,7 @@ import org.neo4j.cypher.internal.frontend.v3_1.{ParameterNotFoundException, Sema
import org.neo4j.cypher.internal.spi.v3_1.codegen.Methods._ import org.neo4j.cypher.internal.spi.v3_1.codegen.Methods._
import org.neo4j.cypher.internal.spi.v3_1.codegen.Templates.{createNewInstance, handleKernelExceptions, newRelationshipDataExtractor, tryCatch} import org.neo4j.cypher.internal.spi.v3_1.codegen.Templates.{createNewInstance, handleKernelExceptions, newRelationshipDataExtractor, tryCatch}
import org.neo4j.graphdb.Direction import org.neo4j.graphdb.Direction
import org.neo4j.kernel.api.schema.index.{IndexDescriptor, IndexDescriptorFactory} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptor, SchemaIndexDescriptorFactory}
import org.neo4j.kernel.impl.api.RelationshipDataExtractor import org.neo4j.kernel.impl.api.RelationshipDataExtractor
import org.neo4j.kernel.impl.api.store.RelationshipIterator import org.neo4j.kernel.impl.api.store.RelationshipIterator


Expand Down Expand Up @@ -750,9 +750,9 @@ case class GeneratedMethodStructure(fields: Fields, generator: CodeBlock, aux: A
generator.assign(typeRef[Int], propIdVar, invoke(readOperations, propertyKeyGetForName, constant(propName))) generator.assign(typeRef[Int], propIdVar, invoke(readOperations, propertyKeyGetForName, constant(propName)))


override def newIndexDescriptor(descriptorVar: String, labelVar: String, propKeyVar: String) = { override def newIndexDescriptor(descriptorVar: String, labelVar: String, propKeyVar: String) = {
val getIndexDescriptor = method[IndexDescriptorFactory, IndexDescriptor]("forLabel", typeRef[Int], typeRef[Array[Int]]) val getIndexDescriptor = method[SchemaIndexDescriptorFactory, SchemaIndexDescriptor]("forLabel", typeRef[Int], typeRef[Array[Int]])
val propertyIdsExpr = Expression.newArray(typeRef[Int], generator.load(propKeyVar)) val propertyIdsExpr = Expression.newArray(typeRef[Int], generator.load(propKeyVar))
generator.assign(typeRef[IndexDescriptor], descriptorVar, generator.assign(typeRef[SchemaIndexDescriptor], descriptorVar,
invoke(getIndexDescriptor, generator.load(labelVar), propertyIdsExpr)) invoke(getIndexDescriptor, generator.load(labelVar), propertyIdsExpr))
} }


Expand Down
Expand Up @@ -30,7 +30,7 @@ import org.neo4j.cypher.internal.compiler.v3_1.spi.{InternalResultRow, InternalR
import org.neo4j.graphdb.Direction import org.neo4j.graphdb.Direction
import org.neo4j.helpers.collection.MapUtil import org.neo4j.helpers.collection.MapUtil
import org.neo4j.kernel.api.ReadOperations import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.api.schema.index.IndexDescriptor import org.neo4j.kernel.api.schema.index.SchemaIndexDescriptor
import org.neo4j.kernel.impl.api.store.RelationshipIterator import org.neo4j.kernel.impl.api.store.RelationshipIterator
import org.neo4j.kernel.impl.api.{RelationshipDataExtractor, RelationshipVisitor} import org.neo4j.kernel.impl.api.{RelationshipDataExtractor, RelationshipVisitor}
import org.neo4j.kernel.impl.core.{EmbeddedProxySPI, NodeProxy, RelationshipProxy} import org.neo4j.kernel.impl.core.{EmbeddedProxySPI, NodeProxy, RelationshipProxy}
Expand Down Expand Up @@ -81,8 +81,8 @@ object Methods {
val nodeExists = method[ReadOperations, Boolean]("nodeExists", typeRef[Long]) val nodeExists = method[ReadOperations, Boolean]("nodeExists", typeRef[Long])
val nodesGetAll = method[ReadOperations, PrimitiveLongIterator]("nodesGetAll") val nodesGetAll = method[ReadOperations, PrimitiveLongIterator]("nodesGetAll")
val nodeGetProperty = method[ReadOperations, Value]("nodeGetProperty", typeRef[Long], typeRef[Int]) val nodeGetProperty = method[ReadOperations, Value]("nodeGetProperty", typeRef[Long], typeRef[Int])
val nodesGetFromIndexLookup = method[ReadOperations, PrimitiveLongIterator]("nodesGetFromIndexSeek", typeRef[IndexDescriptor], typeRef[Object]) val nodesGetFromIndexLookup = method[ReadOperations, PrimitiveLongIterator]("nodesGetFromIndexSeek", typeRef[SchemaIndexDescriptor], typeRef[Object])
val nodeGetUniqueFromIndexLookup = method[ReadOperations, Long]("nodeGetFromUniqueIndexSeek", typeRef[IndexDescriptor], typeRef[Object]) val nodeGetUniqueFromIndexLookup = method[ReadOperations, Long]("nodeGetFromUniqueIndexSeek", typeRef[SchemaIndexDescriptor], typeRef[Object])
val relationshipGetProperty = method[ReadOperations, Value]("relationshipGetProperty", typeRef[Long], typeRef[Int]) val relationshipGetProperty = method[ReadOperations, Value]("relationshipGetProperty", typeRef[Long], typeRef[Int])
val nodesGetForLabel = method[ReadOperations, PrimitiveLongIterator]("nodesGetForLabel", typeRef[Int]) val nodesGetForLabel = method[ReadOperations, PrimitiveLongIterator]("nodesGetForLabel", typeRef[Int])
val nodeHasLabel = method[ReadOperations, Boolean]("nodeHasLabel", typeRef[Long], typeRef[Int]) val nodeHasLabel = method[ReadOperations, Boolean]("nodeHasLabel", typeRef[Long], typeRef[Int])
Expand Down
Expand Up @@ -21,12 +21,12 @@ package org.neo4j.cypher.internal.spi.v3_3


import org.neo4j.cypher.internal.compiler.v3_3.{IndexDescriptor => CypherIndexDescriptor} import org.neo4j.cypher.internal.compiler.v3_3.{IndexDescriptor => CypherIndexDescriptor}
import org.neo4j.internal.kernel.api.schema.LabelSchemaDescriptor import org.neo4j.internal.kernel.api.schema.LabelSchemaDescriptor
import org.neo4j.kernel.api.schema.index.{IndexDescriptorFactory, IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptorFactory, SchemaIndexDescriptor => KernelIndexDescriptor}
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory


trait IndexDescriptorCompatibility { trait IndexDescriptorCompatibility {
def cypherToKernel(index: CypherIndexDescriptor): KernelIndexDescriptor = def cypherToKernel(index: CypherIndexDescriptor): KernelIndexDescriptor =
IndexDescriptorFactory.forLabel(index.label.id, index.properties.map(_.id):_*) SchemaIndexDescriptorFactory.forLabel(index.label.id, index.properties.map(_.id):_*)


def kernelToCypher(index: KernelIndexDescriptor): CypherIndexDescriptor = def kernelToCypher(index: KernelIndexDescriptor): CypherIndexDescriptor =
CypherIndexDescriptor(index.schema().getLabelId, index.schema().getPropertyIds) CypherIndexDescriptor(index.schema().getLabelId, index.schema().getPropertyIds)
Expand Down
Expand Up @@ -34,7 +34,7 @@ import org.neo4j.internal.kernel.api.procs.{DefaultParameterValue, Neo4jTypes}
import org.neo4j.internal.kernel.api.{InternalIndexState, procs} import org.neo4j.internal.kernel.api.{InternalIndexState, procs}
import org.neo4j.kernel.api.ReadOperations import org.neo4j.kernel.api.ReadOperations
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.index.{IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptor => KernelIndexDescriptor}
import org.neo4j.procedure.Mode import org.neo4j.procedure.Mode


import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
Expand Down
Expand Up @@ -22,11 +22,11 @@ package org.neo4j.cypher.internal.runtime.interpreted
import org.neo4j.cypher.internal.planner.v3_4.spi.{IndexDescriptor => CypherIndexDescriptor} import org.neo4j.cypher.internal.planner.v3_4.spi.{IndexDescriptor => CypherIndexDescriptor}
import org.neo4j.internal.kernel.api.schema.LabelSchemaDescriptor import org.neo4j.internal.kernel.api.schema.LabelSchemaDescriptor
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.index.{IndexDescriptorFactory, IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptorFactory, SchemaIndexDescriptor => KernelIndexDescriptor}


trait IndexDescriptorCompatibility { trait IndexDescriptorCompatibility {
def cypherToKernel(index: CypherIndexDescriptor): KernelIndexDescriptor = def cypherToKernel(index: CypherIndexDescriptor): KernelIndexDescriptor =
IndexDescriptorFactory.forLabel(index.label.id, index.properties.map(_.id):_*) SchemaIndexDescriptorFactory.forLabel(index.label.id, index.properties.map(_.id):_*)


def kernelToCypher(index: KernelIndexDescriptor): CypherIndexDescriptor = def kernelToCypher(index: KernelIndexDescriptor): CypherIndexDescriptor =
CypherIndexDescriptor(index.schema().getLabelId, index.schema().getPropertyIds) CypherIndexDescriptor(index.schema().getLabelId, index.schema().getPropertyIds)
Expand Down
Expand Up @@ -32,7 +32,7 @@ import org.neo4j.internal.kernel.api.procs.Neo4jTypes.AnyType
import org.neo4j.internal.kernel.api.procs.{DefaultParameterValue, Neo4jTypes} import org.neo4j.internal.kernel.api.procs.{DefaultParameterValue, Neo4jTypes}
import org.neo4j.internal.kernel.api.{InternalIndexState, procs} import org.neo4j.internal.kernel.api.{InternalIndexState, procs}
import org.neo4j.kernel.api.schema.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema.index.{IndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{SchemaIndexDescriptor => KernelIndexDescriptor}
import org.neo4j.procedure.Mode import org.neo4j.procedure.Mode


import scala.collection.JavaConverters._ import scala.collection.JavaConverters._
Expand Down

0 comments on commit 504e053

Please sign in to comment.