本文整理汇总了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;
}
示例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!");
}
示例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());
}
示例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);
}
示例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());
}
示例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!");
}
示例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);
}
示例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;
}
示例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);
}
示例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()));
}
示例11: getEntities
import org.apache.kylin.common.persistence.RootPersistentEntity; //导入依赖的package包/类
public RootPersistentEntity[] getEntities() {
return draftEntities;
}
示例12: setEntities
import org.apache.kylin.common.persistence.RootPersistentEntity; //导入依赖的package包/类
public void setEntities(RootPersistentEntity[] draftEntities) {
this.draftEntities = draftEntities;
}
示例13: getEntity
import org.apache.kylin.common.persistence.RootPersistentEntity; //导入依赖的package包/类
public RootPersistentEntity getEntity() {
return getEntities()[0];
}
示例14: setEntity
import org.apache.kylin.common.persistence.RootPersistentEntity; //导入依赖的package包/类
public void setEntity(RootPersistentEntity entity) {
setEntities(new RootPersistentEntity[] { entity });
}
示例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;
}