Search in sources :

Example 1 with DefaultMetaService

use of com.alibaba.graphscope.groot.meta.DefaultMetaService in project GraphScope by alibaba.

the class DefaultMetaServiceTest method testMeta.

@Test
void testMeta() {
    Configs configs = Configs.newBuilder().put("partition.count", "10").put("ingestor.queue.count", "3").put("store.node.count", "4").build();
    /**
     * Partitions assignment
     *
     * <p>| storeID | Partitions | | 0 | 0, 1, 2 | | 1 | 3, 4, 5 | | 2 | 6, 7 | | 3 | 8, 9 |
     */
    MetaService metaService = new DefaultMetaService(configs);
    metaService.start();
    Assertions.assertAll(() -> assertEquals(metaService.getPartitionCount(), 10), () -> assertEquals(metaService.getStoreIdByPartition(0), 0), () -> assertEquals(metaService.getStoreIdByPartition(5), 1), () -> assertEquals(metaService.getStoreIdByPartition(6), 2), () -> assertEquals(metaService.getStoreIdByPartition(8), 3), () -> assertEquals(metaService.getPartitionsByStoreId(2), Arrays.asList(6, 7)), () -> assertEquals(metaService.getQueueCount(), 3), () -> assertEquals(metaService.getQueueIdsForIngestor(2), Arrays.asList(2)), () -> assertEquals(metaService.getIngestorIdForQueue(1), 1));
    metaService.stop();
}
Also used : DefaultMetaService(com.alibaba.graphscope.groot.meta.DefaultMetaService) DefaultMetaService(com.alibaba.graphscope.groot.meta.DefaultMetaService) MetaService(com.alibaba.graphscope.groot.meta.MetaService) Configs(com.alibaba.maxgraph.common.config.Configs) Test(org.junit.jupiter.api.Test)

Aggregations

DefaultMetaService (com.alibaba.graphscope.groot.meta.DefaultMetaService)1 MetaService (com.alibaba.graphscope.groot.meta.MetaService)1 Configs (com.alibaba.maxgraph.common.config.Configs)1 Test (org.junit.jupiter.api.Test)1