Java Code Examples for org.apache.kylin.common.persistence.ResourceStore#getAllResources()

The following examples show how to use org.apache.kylin.common.persistence.ResourceStore#getAllResources() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DictionaryManager.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
private DictionaryInfo findLargestDictInfo(DictionaryInfo dictInfo) throws IOException {
    final ResourceStore store = getStore();
    final List<DictionaryInfo> allResources = store.getAllResources(dictInfo.getResourceDir(),
            DictionaryInfoSerializer.INFO_SERIALIZER);

    DictionaryInfo largestDict = null;
    for (DictionaryInfo dictionaryInfo : allResources) {
        if (largestDict == null) {
            largestDict = dictionaryInfo;
            continue;
        }

        if (largestDict.getCardinality() < dictionaryInfo.getCardinality()) {
            largestDict = dictionaryInfo;
        }
    }
    return largestDict;
}
 
Example 2
Source File: DictionaryManager.java    From kylin with Apache License 2.0 6 votes vote down vote up
private DictionaryInfo findLargestDictInfo(DictionaryInfo dictInfo) throws IOException {
    final ResourceStore store = getStore();
    final List<DictionaryInfo> allResources = store.getAllResources(dictInfo.getResourceDir(),
            DictionaryInfoSerializer.INFO_SERIALIZER);

    DictionaryInfo largestDict = null;
    for (DictionaryInfo dictionaryInfo : allResources) {
        if (largestDict == null) {
            largestDict = dictionaryInfo;
            continue;
        }

        if (largestDict.getCardinality() < dictionaryInfo.getCardinality()) {
            largestDict = dictionaryInfo;
        }
    }
    return largestDict;
}
 
Example 3
Source File: DictionaryManager.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
private String checkDupByInfo(DictionaryInfo dictInfo) throws IOException {
    final ResourceStore store = getStore();
    final List<DictionaryInfo> allResources = store.getAllResources(dictInfo.getResourceDir(),
            DictionaryInfoSerializer.INFO_SERIALIZER);

    TableSignature input = dictInfo.getInput();

    for (DictionaryInfo dictionaryInfo : allResources) {
        if (input.equals(dictionaryInfo.getInput())) {
            return dictionaryInfo.getResourcePath();
        }
    }
    return null;
}
 
Example 4
Source File: CubeManagerTest.java    From kylin-on-parquet-v2 with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetAllCubes() throws Exception {
    final ResourceStore store = ResourceStore.getStore(getTestConfig());
    final NavigableSet<String> cubePath = store.listResources(ResourceStore.CUBE_RESOURCE_ROOT);
    assertTrue(cubePath.size() > 1);

    final List<CubeInstance> cubes = store.getAllResources(ResourceStore.CUBE_RESOURCE_ROOT,
            CubeManager.CUBE_SERIALIZER);
    assertEquals(cubePath.size(), cubes.size());
}
 
Example 5
Source File: DictionaryManager.java    From kylin with Apache License 2.0 5 votes vote down vote up
private String checkDupByInfo(DictionaryInfo dictInfo) throws IOException {
    final ResourceStore store = getStore();
    final List<DictionaryInfo> allResources = store.getAllResources(dictInfo.getResourceDir(),
            DictionaryInfoSerializer.INFO_SERIALIZER);

    TableSignature input = dictInfo.getInput();

    for (DictionaryInfo dictionaryInfo : allResources) {
        if (input.equals(dictionaryInfo.getInput())) {
            return dictionaryInfo.getResourcePath();
        }
    }
    return null;
}
 
Example 6
Source File: CubeManagerTest.java    From kylin with Apache License 2.0 5 votes vote down vote up
@Test
public void testGetAllCubes() throws Exception {
    final ResourceStore store = ResourceStore.getStore(getTestConfig());
    final NavigableSet<String> cubePath = store.listResources(ResourceStore.CUBE_RESOURCE_ROOT);
    assertTrue(cubePath.size() > 1);

    final List<CubeInstance> cubes = store.getAllResources(ResourceStore.CUBE_RESOURCE_ROOT,
            CubeManager.CUBE_SERIALIZER);
    assertEquals(cubePath.size(), cubes.size());
}
 
Example 7
Source File: ExtTableSnapshotInfoManager.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
public List<ExtTableSnapshotInfo> getSnapshots(String tableName) throws IOException {
    String tableSnapshotsPath = ExtTableSnapshotInfo.getResourceDir(tableName);
    ResourceStore store = TableMetadataManager.getInstance(this.config).getStore();
    return store.getAllResources(tableSnapshotsPath, SNAPSHOT_SERIALIZER);
}
 
Example 8
Source File: ExtTableSnapshotInfoManager.java    From kylin with Apache License 2.0 4 votes vote down vote up
public List<ExtTableSnapshotInfo> getSnapshots(String tableName) throws IOException {
    String tableSnapshotsPath = ExtTableSnapshotInfo.getResourceDir(tableName);
    ResourceStore store = TableMetadataManager.getInstance(this.config).getStore();
    return store.getAllResources(tableSnapshotsPath, SNAPSHOT_SERIALIZER);
}