Ejemplo n.º 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPersistFulltextIndexSettings() throws java.io.IOException
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
        internal virtual void ShouldPersistFulltextIndexSettings()
        {
            // Given
            File   indexFolder           = Directory.directory("indexFolder");
            string analyzerName          = "simple";
            string eventuallyConsistency = "true";
            string defaultAnalyzer       = "defaultAnalyzer";

            int[] propertyIds = new int[] { 1, 2, 3 };
            MultiTokenSchemaDescriptor schema = SchemaDescriptorFactory.multiToken(new int[] { 1, 2 }, EntityType.NODE, propertyIds);

            // A fulltext index descriptor with configurations
            Properties properties = properties(analyzerName, eventuallyConsistency);
            FulltextSchemaDescriptor fulltextSchemaDescriptor = new FulltextSchemaDescriptor(schema, properties);
            StoreIndexDescriptor     storeIndexDescriptor     = StoreIndexDescriptorFromSchema(fulltextSchemaDescriptor);
            TokenRegistry            tokenRegistry            = SimpleTokenHolder.CreatePopulatedTokenRegistry(Org.Neo4j.Kernel.impl.core.TokenHolder_Fields.TYPE_PROPERTY_KEY, propertyIds);
            SimpleTokenHolder        tokenHolder             = new SimpleTokenHolder(tokenRegistry);
            FulltextIndexDescriptor  fulltextIndexDescriptor = readOrInitialiseDescriptor(storeIndexDescriptor, defaultAnalyzer, tokenHolder, indexFolder, Fs);

            assertEquals(analyzerName, fulltextIndexDescriptor.AnalyzerName());
            assertEquals(bool.Parse(eventuallyConsistency), fulltextIndexDescriptor.EventuallyConsistent);

            // When persisting it
            FulltextIndexSettings.SaveFulltextIndexSettings(fulltextIndexDescriptor, indexFolder, Fs);

            // Then we should be able to load it back with settings being the same
            StoreIndexDescriptor    loadingIndexDescriptor = StoreIndexDescriptorFromSchema(schema);
            FulltextIndexDescriptor loadedDescriptor       = readOrInitialiseDescriptor(loadingIndexDescriptor, defaultAnalyzer, tokenHolder, indexFolder, Fs);

            assertEquals(fulltextIndexDescriptor.AnalyzerName(), loadedDescriptor.AnalyzerName());
            assertEquals(fulltextIndexDescriptor.EventuallyConsistent, loadedDescriptor.EventuallyConsistent);
        }
Ejemplo n.º 2
0
 public ReplicatedRelationshipTypeTokenHolder(TokenRegistry registry, RaftReplicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, RELATIONSHIP_TYPE_TOKEN, storageEngineSupplier, RELATIONSHIP, TransactionState.relationshipTypeDoCreateForName)
 {
 }
Ejemplo n.º 3
0
 public ReplicatedLabelTokenHolder(TokenRegistry registry, Replicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, IdType.LABEL_TOKEN, storageEngineSupplier, TokenType.Label, TransactionState.labelDoCreateForName)
 {
 }
Ejemplo n.º 4
0
 public ReplicatedPropertyKeyTokenHolder(TokenRegistry registry, RaftReplicator replicator, IdGeneratorFactory idGeneratorFactory, System.Func <StorageEngine> storageEngineSupplier) : base(registry, replicator, idGeneratorFactory, IdType.PROPERTY_KEY_TOKEN, storageEngineSupplier, TokenType.Property, TransactionState.propertyKeyDoCreateForName)
 {
 }