Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setUp()
        public virtual void SetUp()
        {
            File folder = _testDir.directory("folder");

            _indexStorage     = new PartitionedIndexStorage(_directoryFactory, _fileSystemRule.get(), folder);
            _index            = LuceneSchemaIndexBuilder.create(_descriptor, Config.defaults()).withIndexStorage(_indexStorage).build();
            _schemaDescriptor = _descriptor.schema();
        }
Esempio n. 2
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()
        {
            File folder = _testDir.directory("folder");
            PartitionedIndexStorage indexStorage = new PartitionedIndexStorage(_dirFactory, _fileSystem, folder);

            IndexDescriptor descriptor = IndexDescriptorFactory.forSchema(_labelSchemaDescriptor);

            _index = LuceneSchemaIndexBuilder.create(descriptor, Config.defaults()).withIndexStorage(indexStorage).build();
        }
Esempio n. 3
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @BeforeEach void setPartitionSize() throws Exception
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void SetPartitionSize()
        {
            System.setProperty("luceneSchemaIndex.maxPartitionSize", _docsPerPartition.ToString());

            Factory <IndexWriterConfig> configFactory = new TestConfigFactory();

            _index = LuceneSchemaIndexBuilder.create(_descriptor, Config.defaults()).withFileSystem(_fileSystem).withIndexRootFolder(new File(_testDir.directory("uniquenessVerification"), "index")).withWriterConfig(configFactory).withDirectoryFactory(DirectoryFactory.PERSISTENT).build();

            _index.create();
            _index.open();
        }
Esempio n. 4
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.StoreIndexDescriptor descriptor) throws java.io.IOException
        private bool IndexIsOnline(PartitionedIndexStorage indexStorage, StoreIndexDescriptor descriptor)
        {
            using (SchemaIndex index = LuceneSchemaIndexBuilder.create(descriptor, _config).withIndexStorage(indexStorage).build())
            {
                if (index.exists())
                {
                    index.open();
                    return(index.Online);
                }
                return(false);
            }
        }
Esempio n. 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Before public void setup() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        public virtual void Setup()
        {
            _index = LuceneSchemaIndexBuilder.create(IndexDescriptorFactory.forSchema(SchemaDescriptorFactory.forLabel(1, 1)), Config.defaults()).withFileSystem(Fs).withIndexRootFolder(Directory.directory()).build();
            _index.create();
            _index.open();
        }