Search in sources :

Example 1 with StarTreeMetadata

use of io.hetu.core.cube.startree.tree.StarTreeMetadata in project hetu-core by openlookeng.

the class TestStarTreeMetaStore method setup.

@BeforeClass
public void setup() {
    FeaturesConfig featuresConfig = new FeaturesConfig();
    featuresConfig.setCubeMetadataCacheTtl(Duration.valueOf("5m"));
    featuresConfig.setCubeMetadataCacheSize(1000);
    Properties properties = new Properties();
    properties.setProperty("cache-ttl", Long.toString(featuresConfig.getCubeMetadataCacheTtl().toMillis()));
    properties.setProperty("cache-size", Long.toString(featuresConfig.getCubeMetadataCacheSize()));
    metaStore = new MockMetaStore();
    cubeMetadataService = new StarTreeProvider().getCubeMetaStore(metaStore, properties);
    cubeMetadata1 = new StarTreeMetadata("star1", "a", 1000, ImmutableList.of(new AggregateColumn("sum_cost", "SUM", "cost", false), new DimensionColumn("value", "value")), ImmutableList.of(ImmutableSet.of("value")), null, 10000, CubeStatus.READY);
    cubeMetadata2 = new StarTreeMetadata("star2", "a", 1000, ImmutableList.of(new AggregateColumn("sum_cost", "SUM", "cost", false), new DimensionColumn("value", "value")), ImmutableList.of(ImmutableSet.of("value")), null, 10000, CubeStatus.READY);
}
Also used : StarTreeProvider(io.hetu.core.cube.startree.StarTreeProvider) StarTreeMetadata(io.hetu.core.cube.startree.tree.StarTreeMetadata) FeaturesConfig(io.prestosql.sql.analyzer.FeaturesConfig) DimensionColumn(io.hetu.core.cube.startree.tree.DimensionColumn) Properties(java.util.Properties) AggregateColumn(io.hetu.core.cube.startree.tree.AggregateColumn) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with StarTreeMetadata

use of io.hetu.core.cube.startree.tree.StarTreeMetadata in project hetu-core by openlookeng.

the class TestStarTreeMetaStore method testUpdateMetadata.

@Test
public void testUpdateMetadata() {
    cubeMetadataService.persist(cubeMetadata1);
    StarTreeMetadata starTreeMetadata = (StarTreeMetadata) cubeMetadata1;
    StarTreeMetadataBuilder builder = new StarTreeMetadataBuilder(starTreeMetadata);
    builder.setCubeLastUpdatedTime(System.currentTimeMillis());
    CubeMetadata updated = builder.build();
    assertNotEquals(cubeMetadata1, updated);
}
Also used : StarTreeMetadataBuilder(io.hetu.core.cube.startree.tree.StarTreeMetadataBuilder) StarTreeMetadata(io.hetu.core.cube.startree.tree.StarTreeMetadata) CubeMetadata(io.hetu.core.spi.cube.CubeMetadata) Test(org.testng.annotations.Test)

Aggregations

StarTreeMetadata (io.hetu.core.cube.startree.tree.StarTreeMetadata)2 StarTreeProvider (io.hetu.core.cube.startree.StarTreeProvider)1 AggregateColumn (io.hetu.core.cube.startree.tree.AggregateColumn)1 DimensionColumn (io.hetu.core.cube.startree.tree.DimensionColumn)1 StarTreeMetadataBuilder (io.hetu.core.cube.startree.tree.StarTreeMetadataBuilder)1 CubeMetadata (io.hetu.core.spi.cube.CubeMetadata)1 FeaturesConfig (io.prestosql.sql.analyzer.FeaturesConfig)1 Properties (java.util.Properties)1 BeforeClass (org.testng.annotations.BeforeClass)1 Test (org.testng.annotations.Test)1