Beispiel #1
0
        public override string PrettyPrint(TokenNameLookup tokenNameLookup)
        {
            string labelName = EscapeLabelOrRelTyp(tokenNameLookup.LabelGetName(_schema.LabelId));
            string nodeName  = labelName.ToLower();

            return(string.Format("CONSTRAINT ON ( {0}:{1} ) ASSERT {2} IS {3}", nodeName, labelName, FormatProperties(_schema.PropertyIds, tokenNameLookup, nodeName), ConstraintTypeText()));
        }
Beispiel #2
0
 public IndexEntryProcessor(ConsistencyReporter reporter, IndexCheck indexCheck, StoreIndexDescriptor indexDescriptor, TokenNameLookup tokenNameLookup)
 {
     this._reporter        = reporter;
     this._indexCheck      = indexCheck;
     this._indexDescriptor = indexDescriptor;
     this._tokenNameLookup = tokenNameLookup;
 }
Beispiel #3
0
 internal IndexProxyCreator(IndexSamplingConfig samplingConfig, IndexStoreView storeView, IndexProviderMap providerMap, TokenNameLookup tokenNameLookup, LogProvider logProvider)
 {
     this._samplingConfig  = samplingConfig;
     this._storeView       = storeView;
     this._providerMap     = providerMap;
     this._tokenNameLookup = tokenNameLookup;
     this._logProvider     = logProvider;
 }
        public override string PrettyPrint(TokenNameLookup tokenNameLookup)
        {
            string typeName     = EscapeLabelOrRelTyp(tokenNameLookup.RelationshipTypeGetName(_schema.RelTypeId));
            string relName      = typeName.ToLower();
            string propertyName = tokenNameLookup.PropertyKeyGetName(_schema.PropertyId);

            return(string.Format("CONSTRAINT ON ()-[ {0}:{1} ]-() ASSERT exists({2}.{3})", relName, typeName, relName, propertyName));
        }
        public override string PrettyPrint(TokenNameLookup tokenNameLookup)
        {
            string labelName  = EscapeLabelOrRelTyp(tokenNameLookup.LabelGetName(_schema.LabelId));
            string nodeName   = labelName.ToLower();
            string properties = SchemaUtil.niceProperties(tokenNameLookup, _schema.PropertyIds, nodeName + ".", false);

            return(string.Format("CONSTRAINT ON ( {0}:{1} ) ASSERT exists({2})", nodeName, labelName, properties));
        }
Beispiel #6
0
        public virtual string ToString(TokenNameLookup tokenNameLookup)
        {
            string ownerString = "";

            if (CanSupportUniqueConstraint())
            {
                ownerString = ", owner=" + _owningConstraintId;
            }

            return("IndexRule[id=" + _id + ", descriptor=" + this.UserDescription(tokenNameLookup) +
                   ", provider=" + this.ProviderDescriptor() + ownerString + "]");
        }
Beispiel #7
0
        private static string ConstructUserMessage(OperationContext context, TokenNameLookup tokenNameLookup, ConstraintDescriptor constraint)
        {
            switch (context)
            {
            case SchemaKernelException.OperationContext.INDEX_CREATION:
                return(MessageWithLabelAndPropertyName(tokenNameLookup, _indexContextFormat, constraint.Schema()));

            case SchemaKernelException.OperationContext.CONSTRAINT_CREATION:
                return(ALREADY_CONSTRAINED_MESSAGE_PREFIX + constraint.PrettyPrint(tokenNameLookup));

            default:
                return(format(NO_CONTEXT_FORMAT, constraint));
            }
        }
        private static string ConstructUserMessage(OperationContext context, TokenNameLookup tokenNameLookup, SchemaDescriptor descriptor)
        {
            switch (context)
            {
            case SchemaKernelException.OperationContext.INDEX_CREATION:
                return(MessageWithLabelAndPropertyName(tokenNameLookup, INDEX_CONTEXT_FORMAT, descriptor));

            case SchemaKernelException.OperationContext.CONSTRAINT_CREATION:
                return(MessageWithLabelAndPropertyName(tokenNameLookup, _constraintContextFormat, descriptor));

            default:
                return(string.format(NO_CONTEXT_FORMAT, descriptor));
            }
        }
Beispiel #9
0
 protected internal virtual string FormatProperties(int[] propertyIds, TokenNameLookup tokenNameLookup, string nodeName)
 {
     return(SchemaUtil.niceProperties(tokenNameLookup, propertyIds, nodeName + ".", propertyIds.Length > 1));
 }
 public OnlineIndexSamplingJobFactory(IndexStoreView storeView, TokenNameLookup nameLookup, LogProvider logProvider)
 {
     this._storeView   = storeView;
     this._logProvider = logProvider;
     this._nameLookup  = nameLookup;
 }
 public override string GetUserMessage(TokenNameLookup tokenNameLookup)
 {
     return(format(MESSAGE, _constraint.userDescription(tokenNameLookup)));
 }
Beispiel #12
0
 public KernelExceptionUserMessageMatcher(TokenNameLookup tokenNameLookup, string expectedMessage)
 {
     this._tokenNameLookup = tokenNameLookup;
     this._expectedMessage = expectedMessage;
 }
Beispiel #13
0
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(_schema.userDescription(tokenNameLookup));
 }
Beispiel #14
0
 internal ExtendedRecordStorageEngine(DatabaseLayout databaseLayout, Config config, PageCache pageCache, FileSystemAbstraction fs, LogProvider logProvider, LogProvider userLogProvider, TokenHolders tokenHolders, SchemaState schemaState, ConstraintSemantics constraintSemantics, JobScheduler scheduler, TokenNameLookup tokenNameLookup, LockService lockService, IndexProviderMap indexProviderMap, IndexingService.Monitor indexingServiceMonitor, DatabaseHealth databaseHealth, ExplicitIndexProvider explicitIndexProviderLookup, IndexConfigStore indexConfigStore, IdOrderingQueue explicitIndexTransactionOrdering, IdGeneratorFactory idGeneratorFactory, IdController idController, System.Func <BatchTransactionApplierFacade, BatchTransactionApplierFacade> transactionApplierTransformer, Monitors monitors, RecoveryCleanupWorkCollector recoveryCleanupWorkCollector, OperationalMode operationalMode) : base(databaseLayout, config, pageCache, fs, logProvider, userLogProvider, tokenHolders, schemaState, constraintSemantics, scheduler, tokenNameLookup, lockService, indexProviderMap, indexingServiceMonitor, databaseHealth, explicitIndexProviderLookup, indexConfigStore, explicitIndexTransactionOrdering, idGeneratorFactory, idController, monitors, recoveryCleanupWorkCollector, operationalMode, EmptyVersionContextSupplier.EMPTY)
 {
     this.TransactionApplierTransformer = transactionApplierTransformer;
 }
Beispiel #15
0
 /// <summary>
 /// Returns a user friendly description of what this index indexes.
 /// </summary>
 /// <param name="tokenNameLookup"> used for looking up names for token ids. </param>
 /// <returns> a user friendly description of what this index indexes. </returns>
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(format("Index( %s, %s )", TypeConflict.name(), SchemaConflict.userDescription(tokenNameLookup)));
 }
Beispiel #16
0
 public IndexEntry(StoreIndexDescriptor indexDescriptor, TokenNameLookup tokenNameLookup, long nodeId) : base(nodeId)
 {
     this._indexDescriptor = indexDescriptor;
     this._tokenNameLookup = tokenNameLookup;
     InUse = true;
 }
Beispiel #17
0
 public abstract string PrettyPrint(TokenNameLookup tokenNameLookup);
        public override string GetUserMessage(TokenNameLookup tokenNameLookup)
        {
            string propertyNoun = (_schema.PropertyIds.length > 1) ? "properties" : "property";

            return(format("Node(%d) with label `%s` must have the %s `%s`", _nodeId, tokenNameLookup.LabelGetName(_schema.LabelId), propertyNoun, SchemaUtil.niceProperties(tokenNameLookup, _schema.PropertyIds)));
        }
Beispiel #19
0
 /// <param name="tokenNameLookup"> used for looking up names for token ids. </param>
 /// <returns> a user friendly description of this constraint. </returns>
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(format("Constraint( %s, %s )", _type.name(), Schema().userDescription(tokenNameLookup)));
 }
Beispiel #20
0
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(string.Format("-[:{0}({1})]-", tokenNameLookup.RelationshipTypeGetName(_relTypeId), SchemaUtil.niceProperties(tokenNameLookup, _propertyIds)));
 }
Beispiel #21
0
 public AlreadyConstrainedException(ConstraintDescriptor constraint, OperationContext context, TokenNameLookup tokenNameLookup) : base(org.neo4j.kernel.api.exceptions.Status_Schema.ConstraintAlreadyExists, ConstructUserMessage(context, tokenNameLookup, constraint))
 {
     this._constraint = constraint;
     this._context    = context;
 }
Beispiel #22
0
 public override string GetUserMessage(TokenNameLookup tokenNameLookup)
 {
     return(format("%s has no property with propertyKey=\"%s\".", _entity, tokenNameLookup.PropertyKeyGetName(_propertyKeyId)));
 }
 public override string GetUserMessage(TokenNameLookup tokenNameLookup)
 {
     return(format(MESSAGE, _descriptor.userDescription(tokenNameLookup), (( KernelException )Cause).getUserMessage(tokenNameLookup)));
 }
Beispiel #24
0
 public override string GetUserMessage(TokenNameLookup tokenNameLookup)
 {
     return(ConstructUserMessage(_context, tokenNameLookup, _constraint));
 }
 public override string GetUserMessage(TokenNameLookup tokenNameLookup)
 {
     return(format("Relationship(%s) with type `%s` must have the property `%s`", _relationshipId, tokenNameLookup.RelationshipTypeGetName(_schema.RelTypeId), tokenNameLookup.PropertyKeyGetName(_schema.PropertyId)));
 }
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(string.format(_entityType + ":%s(%s)", string.join(", ", tokenNameLookup.EntityTokensGetNames(_entityType, _entityTokens)), SchemaUtil.niceProperties(tokenNameLookup, _propertyIds)));
 }
 public override string UserDescription(TokenNameLookup tokenNameLookup)
 {
     return(string.Format(":{0}({1})", tokenNameLookup.LabelGetName(_labelId), SchemaUtil.niceProperties(tokenNameLookup, _propertyIds)));
 }