Esempio n. 1
0
        public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor accessor)
        {
            LazyInstanceSelector <IndexUpdater> updaterSelector = new LazyInstanceSelector <IndexUpdater>(slot => InstanceSelector.select(slot).newPopulatingUpdater(accessor));

            return(new FusionIndexUpdater(SlotSelector, updaterSelector));
        }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyDeferredConstraints(org.neo4j.storageengine.api.NodePropertyAccessor accessor) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException, java.io.IOException
        public override void VerifyDeferredConstraints(NodePropertyAccessor accessor)
        {
            Delegate.verifyDeferredConstraints(accessor);
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyDeferredConstraints(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
            public override void VerifyDeferredConstraints(NodePropertyAccessor nodePropertyAccessor)
            {
                SpatialVerifyDeferredConstraint.Verify(nodePropertyAccessor, Layout, tree, Descriptor);
                base.VerifyDeferredConstraints(nodePropertyAccessor);
            }
Esempio n. 4
0
 /// <summary>
 /// OBS this implementation can only provide values for properties of type <seealso cref="string"/>.
 /// Other property types will still be counted as distinct, but {@code client} won't receive <seealso cref="Value"/>
 /// instances for those. </summary>
 /// <param name="client"> <seealso cref="IndexProgressor.NodeValueClient"/> to get initialized with this progression. </param>
 /// <param name="propertyAccessor"> <seealso cref="NodePropertyAccessor"/> for reading property values. </param>
 /// <param name="needsValues"> whether or not to load string values. </param>
 public override void DistinctValues(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient client, NodePropertyAccessor propertyAccessor, bool needsValues)
 {
     try
     {
         IndexQuery[]            noQueries       = new IndexQuery[0];
         BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(client, _descriptor.schema().PropertyIds);
         Fields fields = MultiFields.getFields(IndexSearcher.IndexReader);
         foreach (ValueEncoding valueEncoding in ValueEncoding.values())
         {
             Terms terms = fields.terms(valueEncoding.key());
             if (terms != null)
             {
                 System.Func <BytesRef, Value> valueMaterializer = valueEncoding == ValueEncoding.String && needsValues ? term => Values.stringValue(term.utf8ToString()) : term => null;
                 TermsEnum termsIterator = terms.GetEnumerator();
                 if (valueEncoding == ValueEncoding.Number)
                 {
                     termsIterator = NumericUtils.filterPrefixCodedLongs(termsIterator);
                 }
                 multiProgressor.Initialize(_descriptor, new LuceneDistinctValuesProgressor(termsIterator, client, valueMaterializer), noQueries, IndexOrder.NONE, needsValues);
             }
         }
         client.Initialize(_descriptor, multiProgressor, noQueries, IndexOrder.NONE, needsValues);
     }
     catch (IOException e)
     {
         throw new UncheckedIOException(e);
     }
 }
Esempio n. 5
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyDeferredConstraints(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void VerifyDeferredConstraints(NodePropertyAccessor nodePropertyAccessor)
        {
        }
Esempio n. 6
0
 public override void distinctValues(IndexProgressor_NodeValueClient client, NodePropertyAccessor propertyAccessor, bool needsValues)
 {
 }
Esempio n. 7
0
        public override void DistinctValues(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient client, NodePropertyAccessor propertyAccessor, bool needsValues)
        {
            KEY lowest = Layout.newKey();

            lowest.initialize(long.MinValue);
            lowest.initValuesAsLowest();
            KEY highest = Layout.newKey();

            highest.initialize(long.MaxValue);
            highest.initValuesAsHighest();
            try
            {
                RawCursor <Hit <KEY, VALUE>, IOException> seeker = Tree.seek(lowest, highest);
                client.Initialize(Descriptor, new NativeDistinctValuesProgressor <>(seeker, client, OpenSeekers, Layout, Layout.compareValue), new IndexQuery[0], IndexOrder.NONE, needsValues);
            }
            catch (IOException e)
            {
                throw new UncheckedIOException(e);
            }
        }
Esempio n. 8
0
 public NativeDistinctValuesProgressorAnonymousInnerClass(SpatialIndexPartReader <VALUE> outerInstance, RawCursor <Hit <SpatialIndexKey, VALUE>, IOException> seeker, Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient client, UnknownType openSeekers, UnknownType layout, IComparer <SpatialIndexKey> comparator, NodePropertyAccessor propertyAccessor) : base(seeker, client, openSeekers, layout, comparator)
 {
     this.outerInstance     = outerInstance;
     this._propertyAccessor = propertyAccessor;
 }
Esempio n. 9
0
 public override void VerifyDeferredConstraints(NodePropertyAccessor accessor)
 {
     throw new System.NotSupportedException("Should not be called directly");
 }
Esempio n. 10
0
 public override void DistinctValues(IndexProgressor_NodeValueClient client, NodePropertyAccessor propertyAccessor, bool needsValues)
 {
     _actual.distinctValues(client, propertyAccessor, needsValues);
 }
Esempio n. 11
0
        public override void DistinctValues(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient client, NodePropertyAccessor propertyAccessor, bool needsValues)
        {
            // This is basically a version of the basic implementation, but with added consulting of the PropertyAccessor
            // since these are lossy spatial values.
            SpatialIndexKey lowest = layout.newKey();

            lowest.initialize(long.MinValue);
            lowest.initValuesAsLowest();
            SpatialIndexKey highest = layout.newKey();

            highest.initialize(long.MaxValue);
            highest.initValuesAsHighest();
            try
            {
                RawCursor <Hit <SpatialIndexKey, VALUE>, IOException> seeker = tree.seek(lowest, highest);
                IComparer <SpatialIndexKey> comparator = new PropertyLookupFallbackComparator <SpatialIndexKey>(layout, propertyAccessor, descriptor.schema().PropertyId);
                NativeDistinctValuesProgressor <SpatialIndexKey, VALUE> progressor = new NativeDistinctValuesProgressorAnonymousInnerClass(this, seeker, client, openSeekers, layout, comparator, propertyAccessor);
                client.Initialize(descriptor, progressor, new IndexQuery[0], IndexOrder.NONE, false);
            }
            catch (IOException e)
            {
                throw new UncheckedIOException(e);
            }
        }
Esempio n. 12
0
 public override void VerifyDeferredConstraints(NodePropertyAccessor propertyAccessor)
 {
     //The fulltext index does not care about constraints.
 }
Esempio n. 13
0
 public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor accessor)
 {
     return(new PopulatingFulltextIndexUpdater(this));
 }
Esempio n. 14
0
 public ConstraintIndexCreator(System.Func <Kernel> kernelSupplier, IndexingService indexingService, NodePropertyAccessor nodePropertyAccessor, LogProvider logProvider)
 {
     this._kernelSupplier       = kernelSupplier;
     this._indexingService      = indexingService;
     this._nodePropertyAccessor = nodePropertyAccessor;
     this._log = logProvider.GetLog(typeof(ConstraintIndexCreator));
 }
Esempio n. 15
0
        /// <summary>
        /// {@inheritDoc}
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyUniqueness(org.neo4j.storageengine.api.NodePropertyAccessor accessor, int[] propertyKeyIds) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void VerifyUniqueness(NodePropertyAccessor accessor, int[] propertyKeyIds)
        {
            luceneIndex.verifyUniqueness(accessor, propertyKeyIds);
        }
Esempio n. 16
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public abstract void verifyDeferredConstraints(org.neo4j.storageengine.api.NodePropertyAccessor propertyAccessor) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException;
        public override abstract void VerifyDeferredConstraints(NodePropertyAccessor propertyAccessor);
Esempio n. 17
0
        /// <summary>
        /// {@inheritDoc}
        /// </summary>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyUniqueness(org.neo4j.storageengine.api.NodePropertyAccessor accessor, int[] propertyKeyIds, java.util.List<org.neo4j.values.storable.Value[]> updatedValueTuples) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void VerifyUniqueness(NodePropertyAccessor accessor, int[] propertyKeyIds, IList <Value[]> updatedValueTuples)
        {
            luceneIndex.verifyUniqueness(accessor, propertyKeyIds, updatedValueTuples);
        }
Esempio n. 18
0
 public override void VerifyDeferredConstraints(NodePropertyAccessor nodePropertyAccessor)
 {
     // No-op, uniqueness is checked for each update in add(IndexEntryUpdate)
 }
Esempio n. 19
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void verifyDeferredConstraints(org.neo4j.storageengine.api.NodePropertyAccessor nodePropertyAccessor) throws org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        public override void VerifyDeferredConstraints(NodePropertyAccessor nodePropertyAccessor)
        {          // Not needed since uniqueness is verified automatically w/o cost for every update.
        }
Esempio n. 20
0
 public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor accessor)
 {
     return(new TemporalIndexPopulatingUpdater(this, accessor));
 }
Esempio n. 21
0
 public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor nodePropertyAccessor)
 {
     return(NewUpdater(IndexUpdateMode.Online));
 }
Esempio n. 22
0
 public void verifyDeferredConstraints(NodePropertyAccessor nodePropertyAccessor)
 {
 }
Esempio n. 23
0
 public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor accessor)
 {
     return(SwallowingIndexUpdater.INSTANCE);
 }
 public override IndexUpdater NewPopulatingUpdater(NodePropertyAccessor accessor)
 {
     return(_actual.newPopulatingUpdater(accessor));
 }
Esempio n. 25
0
 internal PropertyLookupFallbackComparator(IndexLayout <KEY, VALUE> schemaLayout, NodePropertyAccessor propertyAccessor, int propertyKeyId)
 {
     this._schemaLayout     = schemaLayout;
     this._propertyAccessor = propertyAccessor;
     this._propertyKeyId    = propertyKeyId;
 }
Esempio n. 26
0
 private DuplicateCheckingCollector GetDuplicateCollector(NodePropertyAccessor accessor, int[] propertyKeyIds)
 {
     return(DuplicateCheckingCollector.ForProperties(accessor, propertyKeyIds));
 }
Esempio n. 27
0
 public override IndexUpdater newPopulatingUpdater(NodePropertyAccessor accessor)
 {
     return(new IndexUpdaterAnonymousInnerClass(this));
 }
Esempio n. 28
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private static void updatePopulator(org.neo4j.kernel.api.index.IndexPopulator populator, Iterable<org.neo4j.kernel.api.index.IndexEntryUpdate<?>> updates, org.neo4j.storageengine.api.NodePropertyAccessor accessor) throws java.io.IOException, org.neo4j.kernel.api.exceptions.index.IndexEntryConflictException
        private static void UpdatePopulator <T1>(IndexPopulator populator, IEnumerable <T1> updates, NodePropertyAccessor accessor)
        {
            using (IndexUpdater updater = populator.NewPopulatingUpdater(accessor))
            {
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (org.neo4j.kernel.api.index.IndexEntryUpdate<?> update : updates)
                foreach (IndexEntryUpdate <object> update in updates)
                {
                    updater.Process(update);
                }
            }
        }
Esempio n. 29
0
        public override void DistinctValues(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient cursor, NodePropertyAccessor propertyAccessor, bool needsValues)
        {
            BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(cursor, _descriptor.schema().PropertyIds);

            cursor.Initialize(_descriptor, multiProgressor, new IndexQuery[0], IndexOrder.NONE, needsValues);
            InstanceSelector.forAll(reader => reader.distinctValues(multiProgressor, propertyAccessor, needsValues));
        }
Esempio n. 30
0
        public override void DistinctValues(Org.Neo4j.Storageengine.Api.schema.IndexProgressor_NodeValueClient cursor, NodePropertyAccessor propertyAccessor, bool needsValues)
        {
            LoadAll();
            BridgingIndexProgressor multiProgressor = new BridgingIndexProgressor(cursor, _descriptor.schema().PropertyIds);

            cursor.Initialize(_descriptor, multiProgressor, new IndexQuery[0], IndexOrder.NONE, false);
//JAVA TO C# CONVERTER WARNING: Java wildcard generics have no direct equivalent in .NET:
//ORIGINAL LINE: for (NativeIndexReader<?,NativeIndexValue> reader : this)
            foreach (NativeIndexReader <object, NativeIndexValue> reader in this)
            {
                reader.DistinctValues(multiProgressor, propertyAccessor, needsValues);
            }
        }