當前位置: 首頁>>代碼示例>>Java>>正文


Java RootPersistentEntity類代碼示例

本文整理匯總了Java中org.apache.kylin.common.persistence.RootPersistentEntity的典型用法代碼示例。如果您正苦於以下問題:Java RootPersistentEntity類的具體用法?Java RootPersistentEntity怎麽用?Java RootPersistentEntity使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


RootPersistentEntity類屬於org.apache.kylin.common.persistence包,在下文中一共展示了RootPersistentEntity類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: listModelDrafts

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public List<Draft> listModelDrafts(String modelName, String projectName) throws IOException {
    ProjectInstance project = (null != projectName) ? getProjectManager().getProject(projectName) : null;
    if (null == project) {
        aclEvaluate.checkIsGlobalAdmin();
    } else {
        aclEvaluate.hasProjectReadPermission(project);
    }

    List<Draft> result = new ArrayList<>();

    for (Draft d : getDraftManager().list(projectName)) {
        RootPersistentEntity e = d.getEntity();
        if (e instanceof DataModelDesc) {
            DataModelDesc m = (DataModelDesc) e;
            if (modelName == null || modelName.equals(m.getName()))
                result.add(d);
        }
    }

    return result;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:22,代碼來源:ModelService.java

示例2: createAclEntity

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public static RootPersistentEntity createAclEntity(String entityType, String uuid) {
    if ("CubeInstance".equals(entityType)) {
        CubeInstance cubeInstance = new CubeInstance();
        cubeInstance.setUuid(uuid);

        return cubeInstance;
    }

    if ("JobInstance".equals(entityType)) {
        JobInstance jobInstance = new JobInstance();
        jobInstance.setUuid(uuid);

        return jobInstance;
    }

    if ("ProjectInstance".equals(entityType)) {
        ProjectInstance projectInstance = new ProjectInstance();
        projectInstance.setUuid(uuid);

        return projectInstance;
    }

    throw new RuntimeException("Unsupported entity type!");
}
 
開發者ID:KylinOLAP,項目名稱:Kylin,代碼行數:25,代碼來源:AclEntityFactory.java

示例3: saveSystemCubeMetadataToFile

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
private <T extends RootPersistentEntity> void saveSystemCubeMetadataToFile(String fileName, T metadata,
        Serializer serializer) throws IOException {
    ByteArrayOutputStream buf = new ByteArrayOutputStream();
    DataOutputStream dout = new DataOutputStream(buf);
    serializer.serialize(metadata, dout);
    dout.close();
    buf.close();

    saveToFile(fileName, buf.toString());
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:11,代碼來源:SCCreator.java

示例4: save

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public void save(String project, String uuid, RootPersistentEntity... entities) throws IOException {
    Draft draft = new Draft();
    draft.setProject(project);
    draft.setUuid(uuid);
    draft.setEntities(entities);
    save(draft);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:8,代碼來源:DraftManager.java

示例5: testRevokeProjectPermission

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
@Test
public void testRevokeProjectPermission() throws IOException {
    List<ProjectInstance> projects = projectService.listProjects(10000, 0);
    assertTrue(projects.size() > 0);
    ProjectInstance project = projects.get(0);
    PrincipalSid sid = new PrincipalSid("ANALYST");
    RootPersistentEntity ae = accessService.getAclEntity(PROJECT_INSTANCE, project.getUuid());
    accessService.grant(ae, AclPermission.ADMINISTRATION, sid);
    Assert.assertEquals(1, accessService.getAcl(ae).getEntries().size());
    accessService.revokeProjectPermission("ANALYST", MetadataConstants.TYPE_USER);
    Assert.assertEquals(0, accessService.getAcl(ae).getEntries().size());
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:13,代碼來源:AccessServiceTest.java

示例6: createAclEntity

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public static RootPersistentEntity createAclEntity(String entityType, String uuid) {
    if (CUBE_INSTANCE.equals(entityType)) {
        CubeInstance cubeInstance = new CubeInstance();
        cubeInstance.setUuid(uuid);

        return cubeInstance;
    }

    if (DATA_MODEL_DESC.equals(entityType)) {
        DataModelDesc modelInstance = new DataModelDesc();
        modelInstance.setUuid(uuid);

        return modelInstance;
    }

    if (JOB_INSTANCE.equals(entityType)) {
        JobInstance jobInstance = new JobInstance();
        jobInstance.setUuid(uuid);

        return jobInstance;
    }

    if (PROJECT_INSTANCE.equals(entityType)) {
        ProjectInstance projectInstance = new ProjectInstance();
        projectInstance.setUuid(uuid);

        return projectInstance;
    }

    throw new RuntimeException("Unsupported entity type!");
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:32,代碼來源:AclEntityFactory.java

示例7: hasPermission

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
@PreAuthorize(Constant.ACCESS_HAS_ROLE_ADMIN
        + " or hasPermission(#project, 'ADMINISTRATION') or hasPermission(#project, 'MANAGEMENT')")
public void saveDraft(ProjectInstance project, CubeInstance cube, String uuid, RootPersistentEntity... entities)
        throws IOException {
    Draft draft = new Draft();
    draft.setProject(project.getName());
    draft.setUuid(uuid);
    draft.setEntities(entities);
    getDraftManager().save(draft);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:11,代碼來源:CubeService.java

示例8: listCubeDrafts

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public List<Draft> listCubeDrafts(String cubeName, String modelName, String project, boolean exactMatch)
        throws IOException {
    if (null == project) {
        aclEvaluate.checkIsGlobalAdmin();
    } else {
        aclEvaluate.hasProjectReadPermission(getProjectManager().getProject(project));
    }
    List<Draft> result = new ArrayList<>();

    for (Draft d : getDraftManager().list(project)) {
        RootPersistentEntity e = d.getEntity();
        if (e instanceof CubeDesc) {
            CubeDesc c = (CubeDesc) e;
            if ((cubeName == null || (exactMatch && cubeName.toLowerCase().equals(c.getName().toLowerCase()))
                    || (!exactMatch && c.getName().toLowerCase().contains(cubeName.toLowerCase())))
                    && (modelName == null || modelName.toLowerCase().equals(c.getModelName().toLowerCase()))) {
                // backward compability for percentile
                if (c.getMeasures() != null) {
                    for (MeasureDesc m : c.getMeasures()) {
                        FunctionDesc f = m.getFunction();
                        if (f.getExpression().equals(PercentileMeasureType.FUNC_PERCENTILE)) {
                            f.setExpression(PercentileMeasureType.FUNC_PERCENTILE_APPROX);
                        }
                    }
                }
                result.add(d);
            }
        }
    }
    return result;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:32,代碼來源:CubeService.java

示例9: getAclEntity

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public RootPersistentEntity getAclEntity(String entityType, String uuid) {
    if (null == uuid) {
        return null;
    }

    return AclEntityFactory.createAclEntity(entityType, uuid);
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:8,代碼來源:AccessService.java

示例10: compare

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
@Override
public int compare(RootPersistentEntity e1, RootPersistentEntity e2) {
    return -(Long.compare(e1.getLastModified(), e2.getLastModified()));
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:5,代碼來源:ModifiedOrder.java

示例11: getEntities

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public RootPersistentEntity[] getEntities() {
    return draftEntities;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:4,代碼來源:Draft.java

示例12: setEntities

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public void setEntities(RootPersistentEntity[] draftEntities) {
    this.draftEntities = draftEntities;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:4,代碼來源:Draft.java

示例13: getEntity

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public RootPersistentEntity getEntity() {
    return getEntities()[0];
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:4,代碼來源:Draft.java

示例14: setEntity

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
public void setEntity(RootPersistentEntity entity) {
    setEntities(new RootPersistentEntity[] { entity });
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:4,代碼來源:Draft.java

示例15: getSampleModel

import org.apache.kylin.common.persistence.RootPersistentEntity; //導入依賴的package包/類
private RootPersistentEntity getSampleModel() {
    DataModelManager metaMgr = DataModelManager.getInstance(getTestConfig());
    DataModelDesc model = metaMgr.getDataModelDesc("ci_left_join_model");
    return model;
}
 
開發者ID:apache,項目名稱:kylin,代碼行數:6,代碼來源:DraftManagerTest.java


注:本文中的org.apache.kylin.common.persistence.RootPersistentEntity類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。