当前位置: 首页>>代码示例>>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;未经允许,请勿转载。