示例#1
0
        internal void RemoveUniquenessConstraint(long constraintId)
        {
            IndexBackedConstraintDescriptor constraint = _uniquenessConstraintsById.remove(constraintId);

            if (constraint != null)
            {
                SelectConstraintsByEntityType(constraint.Schema().entityType()).remove(constraint);
            }
        }
示例#2
0
        public virtual void Remove(StoreIndexDescriptor descriptor)
        {
            IndexAccessor remove = _accessors.remove(descriptor.Id);

            if (remove != null)
            {
                remove.Dispose();
            }
            _onlineIndexRules.Remove(descriptor);
            _notOnlineIndexRules.Remove(descriptor);
        }
示例#3
0
        internal IndexProxy RemoveIndexProxy(long indexId)
        {
            IndexProxy removedProxy = _indexesById.remove(indexId);

            if (removedProxy == null)
            {
                return(null);
            }

            SchemaDescriptor schema = removedProxy.Descriptor.schema();

            _indexesByDescriptor.Remove(schema);
            SelectIndexesByEntityType(Schema.entityType()).remove(schema);

            return(removedProxy);
        }
示例#4
0
 internal virtual void RemoveProperty(int propertyKeyId)
 {
     if (_addedProperties != null && _addedProperties.remove(propertyKeyId) != null)
     {
         return;
     }
     if (_removedProperties == null)
     {
         _removedProperties = CollectionsFactory.newLongSet();
     }
     _removedProperties.add(propertyKeyId);
     if (_changedProperties != null)
     {
         _changedProperties.remove(propertyKeyId);
     }
 }
示例#5
0
            internal virtual void RemoveSchemaRule(long id)
            {
                if (ConstraintRuleById.containsKey(id))
                {
                    ConstraintRule rule = ConstraintRuleById.remove(id);
                    ConstraintsConflict.remove(rule.ConstraintDescriptor);
                }
                else if (IndexDescriptorById.containsKey(id))
                {
                    CapableIndexDescriptor index  = IndexDescriptorById.remove(id);
                    SchemaDescriptor       schema = index.Schema();
                    IndexDescriptorsConflict.Remove(schema);
                    IndexDescriptorsByName.Remove(index.Name, index);

                    foreach (int entityTokenId in Schema.EntityTokenIds)
                    {
                        ISet <CapableIndexDescriptor> forLabel = IndexDescriptorsByLabel.get(entityTokenId);

                        /* Previously, a bug made it possible to create fulltext indexes with repeated labels or relationship types
                         * which would cause us to try and remove the same entity token twice which could cause a NPE if the 'forLabel'
                         * set would be empty after the first removal such that the set would be completely removed from 'indexDescriptorsByLabel'.
                         * Fixed as of 3.5.10 */
                        if (forLabel != null)
                        {
                            forLabel.remove(index);
                            if (forLabel.Count == 0)
                            {
                                IndexDescriptorsByLabel.remove(entityTokenId);
                            }
                        }
                    }

                    foreach (int propertyId in index.Schema().PropertyIds)
                    {
                        IList <CapableIndexDescriptor> forProperty = IndexByProperty.get(propertyId);
                        forProperty.Remove(index);
                        if (forProperty.Count == 0)
                        {
                            IndexByProperty.remove(propertyId);
                        }
                    }
                }
            }
示例#6
0
        public override void ReleaseExclusive(ResourceType resourceType, params long[] resourceIds)
        {
            _stateHolder.incrementActiveClients(this);
            try
            {
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.collections.api.map.primitive.MutableLongObjectMap<LockResource> localLocks = localExclusive(resourceType);
                MutableLongObjectMap <LockResource> localLocks = LocalExclusive(resourceType);
                foreach (long resourceId in resourceIds)
                {
                    LockResource resource = localLocks.get(resourceId);
                    if (resource.ReleaseReference() == 0)
                    {
                        localLocks.remove(resourceId);
                        _manager.releaseWriteLock(new LockResource(resourceType, resourceId), _lockTransaction);
                    }
                }
            }
            finally
            {
                _stateHolder.decrementActiveClients();
            }
        }