Beispiel #1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeEach void setUp()
        internal virtual void SetUp()
        {
            PartitionedIndexStorage indexStorage = new PartitionedIndexStorage(DirectoryFactory.PERSISTENT, _fileSystem, _testDirectory.directory());
            Config config = Config.defaults();
            IndexSamplingConfig samplingConfig = new IndexSamplingConfig(config);

            _luceneSchemaIndex = new ReadOnlyDatabaseSchemaIndex(indexStorage, TestIndexDescriptorFactory.forLabel(0, 0), samplingConfig, new ReadOnlyIndexPartitionFactory());
        }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: private boolean indexIsOnline(org.neo4j.kernel.api.impl.index.storage.PartitionedIndexStorage indexStorage, org.neo4j.storageengine.api.schema.IndexDescriptor descriptor) throws java.io.IOException
        private bool IndexIsOnline(PartitionedIndexStorage indexStorage, IndexDescriptor descriptor)
        {
            using (SchemaIndex index = LuceneSchemaIndexBuilder.Create(descriptor, _config).withIndexStorage(indexStorage).build())
            {
                if (index.exists())
                {
                    index.open();
                    return(index.Online);
                }
                return(false);
            }
        }
Beispiel #3
0
        public override InternalIndexState GetInitialState(StoreIndexDescriptor descriptor)
        {
            PartitionedIndexStorage indexStorage = GetIndexStorage(descriptor.Id);
            string failure = indexStorage.StoredIndexFailure;

            if (!string.ReferenceEquals(failure, null))
            {
                return(InternalIndexState.FAILED);
            }
            try
            {
                return(IndexIsOnline(indexStorage, descriptor) ? InternalIndexState.ONLINE : InternalIndexState.POPULATING);
            }
            catch (IOException e)
            {
                _monitor.failedToOpenIndex(descriptor, "Requesting re-population.", e);
                return(InternalIndexState.POPULATING);
            }
        }
Beispiel #4
0
 /// <summary>
 /// Specify index storage
 /// </summary>
 /// <param name="indexStorage"> index storage </param>
 /// <returns> index builder </returns>
 public virtual T WithIndexStorage(PartitionedIndexStorage indexStorage)
 {
     StorageBuilder.withIndexStorage(indexStorage);
     return(( T )this);
 }