Esempio n. 1
0
 internal override Value[] extractValues(SpatialIndexKey key)
 {
     try
     {
         return(new Value[] { _propertyAccessor.getNodePropertyValue(key.EntityId, descriptor.schema().PropertyId) });
     }
     catch (EntityNotFoundException)
     {
         // We couldn't get the value due to the entity not being there. Concurrently deleted?
         return(null);
     }
 }
Esempio n. 2
0
        public override int Compare(KEY k1, KEY k2)
        {
            int comparison = _schemaLayout.compareValue(k1, k2);

            if (comparison != 0)
            {
                return(comparison);
            }
            try
            {
                return(Values.COMPARATOR.Compare(_propertyAccessor.getNodePropertyValue(k1.EntityId, _propertyKeyId), _propertyAccessor.getNodePropertyValue(k2.EntityId, _propertyKeyId)));
            }
            catch (EntityNotFoundException)
            {
                // We don't want this operation to fail since it's merely counting distinct values.
                // This entity not being there is most likely a result of a concurrent deletion happening as we speak.
                return(comparison);
            }
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldFailAtVerificationStageWithAlreadyIndexedStringValue() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void ShouldFailAtVerificationStageWithAlreadyIndexedStringValue()
        {
            // given
            _populator = NewPopulator();

            string value = "value1";

            AddUpdate(_populator, 1, value);
            AddUpdate(_populator, 2, "value2");
            AddUpdate(_populator, 3, value);

            when(_nodePropertyAccessor.getNodePropertyValue(1, PROPERTY_KEY_ID)).thenReturn(Values.of(value));
            when(_nodePropertyAccessor.getNodePropertyValue(3, PROPERTY_KEY_ID)).thenReturn(Values.of(value));

            // when
            try
            {
                _populator.verifyDeferredConstraints(_nodePropertyAccessor);

                fail("should have thrown exception");
            }
            // then
            catch (IndexEntryConflictException conflict)
            {
                assertEquals(1, conflict.ExistingNodeId);
                assertEquals(Values.of(value), conflict.SinglePropertyValue);
                assertEquals(3, conflict.AddedNodeId);
            }
        }