Skip to content

Commit

Permalink
Rename NewIndexDescriptor->IndexDescriptor, schema_new->schema.
Browse files Browse the repository at this point in the history
  • Loading branch information
ragadeeshu committed Apr 10, 2017
1 parent 918977f commit a0a725b
Show file tree
Hide file tree
Showing 298 changed files with 1,669 additions and 1,737 deletions.
Expand Up @@ -25,9 +25,9 @@
import org.neo4j.consistency.report.ConsistencyReport; import org.neo4j.consistency.report.ConsistencyReport;
import org.neo4j.consistency.store.RecordAccess; import org.neo4j.consistency.store.RecordAccess;
import org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException; import org.neo4j.kernel.api.exceptions.schema.MalformedSchemaRuleException;
import org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor; import org.neo4j.kernel.api.schema.LabelSchemaDescriptor;
import org.neo4j.kernel.api.schema_new.RelationTypeSchemaDescriptor; import org.neo4j.kernel.api.schema.RelationTypeSchemaDescriptor;
import org.neo4j.kernel.api.schema_new.SchemaProcessor; import org.neo4j.kernel.api.schema.SchemaProcessor;
import org.neo4j.kernel.impl.store.SchemaRuleAccess; import org.neo4j.kernel.impl.store.SchemaRuleAccess;
import org.neo4j.kernel.impl.store.record.ConstraintRule; import org.neo4j.kernel.impl.store.record.ConstraintRule;
import org.neo4j.kernel.impl.store.record.DynamicRecord; import org.neo4j.kernel.impl.store.record.DynamicRecord;
Expand Down
Expand Up @@ -29,9 +29,9 @@
import org.neo4j.consistency.RecordType; import org.neo4j.consistency.RecordType;
import org.neo4j.consistency.report.ConsistencyReport; import org.neo4j.consistency.report.ConsistencyReport;
import org.neo4j.consistency.report.ConsistencyReporter; import org.neo4j.consistency.report.ConsistencyReporter;
import org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor; import org.neo4j.kernel.api.schema.LabelSchemaDescriptor;
import org.neo4j.kernel.api.schema_new.RelationTypeSchemaDescriptor; import org.neo4j.kernel.api.schema.RelationTypeSchemaDescriptor;
import org.neo4j.kernel.api.schema_new.SchemaProcessor; import org.neo4j.kernel.api.schema.SchemaProcessor;
import org.neo4j.kernel.impl.store.SchemaStorage; import org.neo4j.kernel.impl.store.SchemaStorage;
import org.neo4j.kernel.impl.store.StoreAccess; import org.neo4j.kernel.impl.store.StoreAccess;
import org.neo4j.kernel.impl.store.record.ConstraintRule; import org.neo4j.kernel.impl.store.record.ConstraintRule;
Expand Down
Expand Up @@ -36,8 +36,8 @@
import org.neo4j.consistency.report.ConsistencyReport; import org.neo4j.consistency.report.ConsistencyReport;
import org.neo4j.consistency.store.RecordAccess; import org.neo4j.consistency.store.RecordAccess;
import org.neo4j.kernel.api.exceptions.index.IndexNotApplicableKernelException; import org.neo4j.kernel.api.exceptions.index.IndexNotApplicableKernelException;
import org.neo4j.kernel.api.schema_new.IndexQuery; import org.neo4j.kernel.api.schema.IndexQuery;
import org.neo4j.kernel.api.schema_new.LabelSchemaDescriptor; import org.neo4j.kernel.api.schema.LabelSchemaDescriptor;
import org.neo4j.kernel.impl.api.LookupFilter; import org.neo4j.kernel.impl.api.LookupFilter;
import org.neo4j.kernel.impl.store.record.IndexRule; import org.neo4j.kernel.impl.store.record.IndexRule;
import org.neo4j.kernel.impl.store.record.NodeRecord; import org.neo4j.kernel.impl.store.record.NodeRecord;
Expand Down
Expand Up @@ -20,8 +20,8 @@
package org.neo4j.consistency.checking; package org.neo4j.consistency.checking;


import org.neo4j.kernel.api.index.SchemaIndexProvider; import org.neo4j.kernel.api.index.SchemaIndexProvider;
import org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptorFactory; import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory;
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory; import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory;
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 All @@ -48,20 +48,20 @@ public static ConstraintRule relPropertyExistenceConstraintRule( long ruleId, in
public static IndexRule indexRule( long ruleId, int labelId, int propertyId, SchemaIndexProvider.Descriptor public static IndexRule indexRule( long ruleId, int labelId, int propertyId, SchemaIndexProvider.Descriptor
descriptor ) descriptor )
{ {
return IndexRule.indexRule( ruleId, NewIndexDescriptorFactory.forLabel( labelId, propertyId ), descriptor ); return IndexRule.indexRule( ruleId, IndexDescriptorFactory.forLabel( labelId, propertyId ), descriptor );
} }


public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId, public static IndexRule constraintIndexRule( long ruleId, int labelId, int propertyId,
SchemaIndexProvider.Descriptor descriptor, long constraintId ) SchemaIndexProvider.Descriptor descriptor, long constraintId )
{ {
return IndexRule.constraintIndexRule( ruleId, NewIndexDescriptorFactory.uniqueForLabel( labelId, propertyId ), return IndexRule.constraintIndexRule( ruleId, IndexDescriptorFactory.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,
SchemaIndexProvider.Descriptor descriptor ) SchemaIndexProvider.Descriptor descriptor )
{ {
return IndexRule.indexRule( ruleId, NewIndexDescriptorFactory.uniqueForLabel( labelId, propertyId ), return IndexRule.indexRule( ruleId, IndexDescriptorFactory.uniqueForLabel( labelId, propertyId ),
descriptor ); descriptor );
} }
} }
Expand Up @@ -73,8 +73,8 @@
import org.neo4j.kernel.api.labelscan.LabelScanStore; import org.neo4j.kernel.api.labelscan.LabelScanStore;
import org.neo4j.kernel.api.labelscan.LabelScanWriter; import org.neo4j.kernel.api.labelscan.LabelScanWriter;
import org.neo4j.kernel.api.labelscan.NodeLabelUpdate; import org.neo4j.kernel.api.labelscan.NodeLabelUpdate;
import org.neo4j.kernel.api.schema_new.SchemaDescriptorFactory; import org.neo4j.kernel.api.schema.SchemaDescriptorFactory;
import org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptorFactory; import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory;
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 @@ -129,8 +129,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_new.index.NewIndexDescriptorFactory.forLabel; import static org.neo4j.kernel.api.schema.index.IndexDescriptorFactory.forLabel;
import static org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory.uniqueForLabel; import static org.neo4j.kernel.api.schema.index.IndexDescriptorFactory.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 @@ -53,7 +53,7 @@
import org.neo4j.consistency.store.synthetic.LabelScanDocument; import org.neo4j.consistency.store.synthetic.LabelScanDocument;
import org.neo4j.kernel.api.impl.labelscan.LuceneNodeLabelRange; import org.neo4j.kernel.api.impl.labelscan.LuceneNodeLabelRange;
import org.neo4j.kernel.api.index.SchemaIndexProvider; import org.neo4j.kernel.api.index.SchemaIndexProvider;
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory; import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory;
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 @@ -395,7 +395,7 @@ private Object parameter( Class<?> type )
} }
if ( type == IndexRule.class ) if ( type == IndexRule.class )
{ {
return IndexRule.indexRule( 1, NewIndexDescriptorFactory.forLabel( 2, 3 ), return IndexRule.indexRule( 1, IndexDescriptorFactory.forLabel( 2, 3 ),
new SchemaIndexProvider.Descriptor( "provider", "version" ) ); new SchemaIndexProvider.Descriptor( "provider", "version" ) );
} }
if ( type == RelationshipGroupRecord.class ) if ( type == RelationshipGroupRecord.class )
Expand Down
Expand Up @@ -20,13 +20,12 @@
package org.neo4j.cypher.internal.spi.v2_3 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_new.constaints.{NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor} import org.neo4j.kernel.api.schema.constaints.{NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor}
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory import org.neo4j.kernel.api.schema.index.{IndexDescriptorFactory, IndexDescriptor => KernelIndexDescriptor}
import org.neo4j.kernel.api.schema_new.index.{NewIndexDescriptor => KernelIndexDescriptor}


trait SchemaDescriptorTranslation { trait SchemaDescriptorTranslation {
implicit def cypherToKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor = implicit def cypherToKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor =
NewIndexDescriptorFactory.forLabel(index.labelId, index.propertyId) IndexDescriptorFactory.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_new.index.NewIndexDescriptorFactory import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory


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 = NewIndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = IndexDescriptorFactory.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 = NewIndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = IndexDescriptorFactory.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 @@ -28,9 +28,9 @@ import org.neo4j.graphdb.Node
import org.neo4j.kernel.api.exceptions.KernelException import org.neo4j.kernel.api.exceptions.KernelException
import org.neo4j.kernel.api.exceptions.schema.SchemaKernelException import org.neo4j.kernel.api.exceptions.schema.SchemaKernelException
import org.neo4j.kernel.api.index.InternalIndexState import org.neo4j.kernel.api.index.InternalIndexState
import org.neo4j.kernel.api.schema_new.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptor import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor
import org.neo4j.kernel.api.schema_new.index.{NewIndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{IndexDescriptor => 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,9 +47,9 @@ import org.neo4j.graphdb.traversal.{Evaluators, TraversalDescription, Uniqueness
import org.neo4j.kernel.GraphDatabaseQueryService 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.index.InternalIndexState import org.neo4j.kernel.api.index.InternalIndexState
import org.neo4j.kernel.api.schema_new.{IndexQuery, SchemaDescriptorFactory} import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptorFactory
import org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptorFactory import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory import org.neo4j.kernel.api.schema.{IndexQuery, SchemaDescriptorFactory}
import org.neo4j.kernel.api.{exceptions, _} import org.neo4j.kernel.api.{exceptions, _}
import org.neo4j.kernel.impl.core.NodeManager import org.neo4j.kernel.impl.core.NodeManager


Expand Down Expand Up @@ -464,7 +464,7 @@ final class TransactionBoundQueryContext(tc: TransactionalContextWrapper)
} }


def dropIndexRule(labelId: Int, propertyKeyId: Int) = def dropIndexRule(labelId: Int, propertyKeyId: Int) =
tc.statement.schemaWriteOperations().indexDrop(NewIndexDescriptorFactory.forLabel( labelId, propertyKeyId )) tc.statement.schemaWriteOperations().indexDrop(IndexDescriptorFactory.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 @@ -20,13 +20,13 @@
package org.neo4j.cypher.internal.spi.v3_1 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.kernel.api.schema_new.SchemaDescriptor import org.neo4j.kernel.api.schema.SchemaDescriptor
import org.neo4j.kernel.api.schema_new.constaints.{ConstraintDescriptorFactory, NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor => KernelUniquenessConstraint} import org.neo4j.kernel.api.schema.constaints.{ConstraintDescriptorFactory, NodeExistenceConstraintDescriptor, RelExistenceConstraintDescriptor, UniquenessConstraintDescriptor => KernelUniquenessConstraint}
import org.neo4j.kernel.api.schema_new.index.{NewIndexDescriptorFactory, NewIndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{NewIndexDescriptorFactory, NewIndexDescriptor => KernelIndexDescriptor}


trait SchemaDescriptorTranslation { trait SchemaDescriptorTranslation {
implicit def toKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor = implicit def toKernel(index: SchemaTypes.IndexDescriptor): KernelIndexDescriptor =
NewIndexDescriptorFactory.forLabel(index.labelId, index.propertyId) IndexDescriptorFactory.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_new.index.NewIndexDescriptorFactory import org.neo4j.kernel.api.schema.index.IndexDescriptorFactory


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 = NewIndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = IndexDescriptorFactory.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 = NewIndexDescriptorFactory.forLabel( label, property ) val indexDescriptor = IndexDescriptorFactory.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 @@ -36,9 +36,9 @@ import org.neo4j.kernel.api.exceptions.schema.SchemaKernelException
import org.neo4j.kernel.api.index.InternalIndexState import org.neo4j.kernel.api.index.InternalIndexState
import org.neo4j.kernel.api.proc.Neo4jTypes.AnyType import org.neo4j.kernel.api.proc.Neo4jTypes.AnyType
import org.neo4j.kernel.api.proc.{Neo4jTypes, QualifiedName => KernelQualifiedName} import org.neo4j.kernel.api.proc.{Neo4jTypes, QualifiedName => KernelQualifiedName}
import org.neo4j.kernel.api.schema_new.SchemaDescriptorFactory import org.neo4j.kernel.api.schema.SchemaDescriptorFactory
import org.neo4j.kernel.api.schema_new.constaints.ConstraintDescriptor import org.neo4j.kernel.api.schema.constaints.ConstraintDescriptor
import org.neo4j.kernel.api.schema_new.index.{NewIndexDescriptor => KernelIndexDescriptor} import org.neo4j.kernel.api.schema.index.{IndexDescriptor => KernelIndexDescriptor}
import org.neo4j.kernel.impl.proc.Neo4jValue import org.neo4j.kernel.impl.proc.Neo4jValue
import org.neo4j.procedure.Mode import org.neo4j.procedure.Mode


Expand Down
Expand Up @@ -53,9 +53,9 @@ import org.neo4j.kernel.api.exceptions.ProcedureException
import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException} import org.neo4j.kernel.api.exceptions.schema.{AlreadyConstrainedException, AlreadyIndexedException}
import org.neo4j.kernel.api.index.InternalIndexState import org.neo4j.kernel.api.index.InternalIndexState
import org.neo4j.kernel.api.proc.{QualifiedName => KernelQualifiedName} import org.neo4j.kernel.api.proc.{QualifiedName => KernelQualifiedName}
import org.neo4j.kernel.api.schema_new.{IndexQuery, RelationTypeSchemaDescriptor, SchemaDescriptorFactory} import org.neo4j.kernel.api.schema.{IndexQuery, RelationTypeSchemaDescriptor, SchemaDescriptorFactory}
import org.neo4j.kernel.api.schema_new.constaints.{ConstraintBoundary, ConstraintDescriptor, ConstraintDescriptorFactory, UniquenessConstraintDescriptor} import org.neo4j.kernel.api.schema.constaints.{ConstraintBoundary, ConstraintDescriptor, ConstraintDescriptorFactory, UniquenessConstraintDescriptor}
import org.neo4j.kernel.api.schema_new.index.NewIndexDescriptorFactory import org.neo4j.kernel.api.schema.index.NewIndexDescriptorFactory
import org.neo4j.kernel.impl.core.NodeManager import org.neo4j.kernel.impl.core.NodeManager
import org.neo4j.kernel.impl.locking.ResourceTypes import org.neo4j.kernel.impl.locking.ResourceTypes


Expand Down Expand Up @@ -468,7 +468,7 @@ final class TransactionBoundQueryContext(txContext: TransactionalContextWrapper)
} }


override def dropIndexRule(labelId: Int, propertyKeyId: Int) = override def dropIndexRule(labelId: Int, propertyKeyId: Int) =
txContext.statement.schemaWriteOperations().indexDrop(NewIndexDescriptorFactory.forLabel( labelId, propertyKeyId )) txContext.statement.schemaWriteOperations().indexDrop(IndexDescriptorFactory.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 @@ -38,7 +38,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_new.index.{NewIndexDescriptor, NewIndexDescriptorFactory} import org.neo4j.kernel.api.schema.index.{IndexDescriptor, IndexDescriptorFactory}
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 @@ -737,9 +737,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[NewIndexDescriptorFactory, NewIndexDescriptor]("forLabel", typeRef[Int], typeRef[Array[Int]]) val getIndexDescriptor = method[IndexDescriptorFactory, IndexDescriptor]("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[NewIndexDescriptor], descriptorVar, generator.assign(typeRef[IndexDescriptor], 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_new.index.NewIndexDescriptor import org.neo4j.kernel.api.schema.index.IndexDescriptor
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.{NodeManager, NodeProxy, RelationshipProxy} import org.neo4j.kernel.impl.core.{NodeManager, NodeProxy, RelationshipProxy}
Expand Down Expand Up @@ -80,8 +80,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, Object]("nodeGetProperty", typeRef[Long], typeRef[Int]) val nodeGetProperty = method[ReadOperations, Object]("nodeGetProperty", typeRef[Long], typeRef[Int])
val nodesGetFromIndexLookup = method[ReadOperations, PrimitiveLongIterator]("nodesGetFromIndexSeek", typeRef[NewIndexDescriptor], typeRef[Object]) val nodesGetFromIndexLookup = method[ReadOperations, PrimitiveLongIterator]("nodesGetFromIndexSeek", typeRef[IndexDescriptor], typeRef[Object])
val nodeGetUniqueFromIndexLookup = method[ReadOperations, Long]("nodeGetFromUniqueIndexSeek", typeRef[NewIndexDescriptor], typeRef[Object]) val nodeGetUniqueFromIndexLookup = method[ReadOperations, Long]("nodeGetFromUniqueIndexSeek", typeRef[IndexDescriptor], typeRef[Object])
val relationshipGetProperty = method[ReadOperations, Object]("relationshipGetProperty", typeRef[Long], typeRef[Int]) val relationshipGetProperty = method[ReadOperations, Object]("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

0 comments on commit a0a725b

Please sign in to comment.