Search in sources :

Example 1 with DISTRIBUTED

use of org.apache.ignite.configuration.annotation.ConfigurationType.DISTRIBUTED in project ignite-3 by apache.

the class SchemaConfigurationConverterTest method createRegistry.

/**
 * Prepare configuration registry for test.
 *
 * @throws ExecutionException If failed.
 * @throws InterruptedException If failed.
 */
@BeforeEach
public void createRegistry() throws ExecutionException, InterruptedException {
    confRegistry = new ConfigurationRegistry(List.of(TablesConfiguration.KEY, DataStorageConfiguration.KEY), Map.of(TableValidator.class, Set.of(TableValidatorImpl.INSTANCE)), new TestConfigurationStorage(DISTRIBUTED), List.of(), List.of(HashIndexConfigurationSchema.class, SortedIndexConfigurationSchema.class, PartialIndexConfigurationSchema.class, RocksDbDataRegionConfigurationSchema.class));
    confRegistry.start();
    tblBuilder = SchemaBuilders.tableBuilder("SNAME", "TNAME").columns(SchemaBuilders.column("COL1", ColumnType.DOUBLE).build(), SchemaBuilders.column("COL2", ColumnType.DOUBLE).build(), SchemaBuilders.column("A", ColumnType.INT8).build(), SchemaBuilders.column("B", ColumnType.INT8).build(), SchemaBuilders.column("C", ColumnType.INT8).build()).withPrimaryKey("COL1");
    TableDefinition tbl = tblBuilder.build();
    confRegistry.getConfiguration(TablesConfiguration.KEY).change(ch -> SchemaConfigurationConverter.createTable(tbl, ch).changeTables(tblsCh -> tblsCh.createOrUpdate(tbl.canonicalName(), tblCh -> tblCh.changeReplicas(1)))).get();
}
Also used : TestConfigurationStorage(org.apache.ignite.internal.configuration.storage.TestConfigurationStorage) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) HashIndexConfigurationSchema(org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema) SortedIndexDefinitionBuilder(org.apache.ignite.schema.definition.builder.SortedIndexDefinitionBuilder) BeforeEach(org.junit.jupiter.api.BeforeEach) IndexColumnDefinition(org.apache.ignite.schema.definition.index.IndexColumnDefinition) SortOrder(org.apache.ignite.schema.definition.index.SortOrder) HashIndexDefinition(org.apache.ignite.schema.definition.index.HashIndexDefinition) DISTRIBUTED(org.apache.ignite.configuration.annotation.ConfigurationType.DISTRIBUTED) TableConfiguration(org.apache.ignite.configuration.schemas.table.TableConfiguration) PartialIndexConfigurationSchema(org.apache.ignite.configuration.schemas.table.PartialIndexConfigurationSchema) SortedIndexConfigurationSchema(org.apache.ignite.configuration.schemas.table.SortedIndexConfigurationSchema) HashIndexDefinitionBuilder(org.apache.ignite.schema.definition.builder.HashIndexDefinitionBuilder) Disabled(org.junit.jupiter.api.Disabled) Map(java.util.Map) RocksDbDataRegionConfigurationSchema(org.apache.ignite.configuration.schemas.store.RocksDbDataRegionConfigurationSchema) SortedIndexDefinition(org.apache.ignite.schema.definition.index.SortedIndexDefinition) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) IndexDefinition(org.apache.ignite.schema.definition.index.IndexDefinition) TableDefinition(org.apache.ignite.schema.definition.TableDefinition) Collection(java.util.Collection) DataStorageConfiguration(org.apache.ignite.configuration.schemas.store.DataStorageConfiguration) TablesConfiguration(org.apache.ignite.configuration.schemas.table.TablesConfiguration) PartialIndexDefinition(org.apache.ignite.schema.definition.index.PartialIndexDefinition) Set(java.util.Set) PartialIndexDefinitionBuilder(org.apache.ignite.schema.definition.builder.PartialIndexDefinitionBuilder) TableValidator(org.apache.ignite.configuration.schemas.table.TableValidator) ColumnType(org.apache.ignite.schema.definition.ColumnType) Collectors(java.util.stream.Collectors) ExecutionException(java.util.concurrent.ExecutionException) Test(org.junit.jupiter.api.Test) TableDefinitionBuilder(org.apache.ignite.schema.definition.builder.TableDefinitionBuilder) List(java.util.List) AfterEach(org.junit.jupiter.api.AfterEach) ConfigurationRegistry(org.apache.ignite.internal.configuration.ConfigurationRegistry) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) TestConfigurationStorage(org.apache.ignite.internal.configuration.storage.TestConfigurationStorage) SchemaBuilders(org.apache.ignite.schema.SchemaBuilders) Collections(java.util.Collections) ConfigurationRegistry(org.apache.ignite.internal.configuration.ConfigurationRegistry) TableDefinition(org.apache.ignite.schema.definition.TableDefinition) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

Collection (java.util.Collection)1 Collections (java.util.Collections)1 List (java.util.List)1 Map (java.util.Map)1 Set (java.util.Set)1 ExecutionException (java.util.concurrent.ExecutionException)1 Collectors (java.util.stream.Collectors)1 DISTRIBUTED (org.apache.ignite.configuration.annotation.ConfigurationType.DISTRIBUTED)1 DataStorageConfiguration (org.apache.ignite.configuration.schemas.store.DataStorageConfiguration)1 RocksDbDataRegionConfigurationSchema (org.apache.ignite.configuration.schemas.store.RocksDbDataRegionConfigurationSchema)1 HashIndexConfigurationSchema (org.apache.ignite.configuration.schemas.table.HashIndexConfigurationSchema)1 PartialIndexConfigurationSchema (org.apache.ignite.configuration.schemas.table.PartialIndexConfigurationSchema)1 SortedIndexConfigurationSchema (org.apache.ignite.configuration.schemas.table.SortedIndexConfigurationSchema)1 TableConfiguration (org.apache.ignite.configuration.schemas.table.TableConfiguration)1 TableValidator (org.apache.ignite.configuration.schemas.table.TableValidator)1 TablesConfiguration (org.apache.ignite.configuration.schemas.table.TablesConfiguration)1 ConfigurationRegistry (org.apache.ignite.internal.configuration.ConfigurationRegistry)1 TestConfigurationStorage (org.apache.ignite.internal.configuration.storage.TestConfigurationStorage)1 SchemaBuilders (org.apache.ignite.schema.SchemaBuilders)1 ColumnType (org.apache.ignite.schema.definition.ColumnType)1