本文整理汇总了Java中org.apache.kylin.metadata.project.ProjectInstance.DEFAULT_PROJECT_NAME属性的典型用法代码示例。如果您正苦于以下问题:Java ProjectInstance.DEFAULT_PROJECT_NAME属性的具体用法?Java ProjectInstance.DEFAULT_PROJECT_NAME怎么用?Java ProjectInstance.DEFAULT_PROJECT_NAME使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.apache.kylin.metadata.project.ProjectInstance
的用法示例。
在下文中一共展示了ProjectInstance.DEFAULT_PROJECT_NAME属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setupAll
protected static void setupAll() throws Exception {
//setup env
HBaseMetadataTestCase.staticCreateTestMetadata();
config = KylinConfig.getInstanceFromEnv();
//setup cube conn
String project = ProjectInstance.DEFAULT_PROJECT_NAME;
cubeConnection = QueryConnection.getConnection(project);
//setup h2
h2Connection = DriverManager.getConnection("jdbc:h2:mem:db" + (h2InstanceCount++) + ";CACHE_SIZE=32072", "sa",
"");
// Load H2 Tables (inner join)
H2Database h2DB = new H2Database(h2Connection, config, project);
h2DB.loadAllTables();
}
示例2: saveCubeDesc
/**
* save cubeDesc
*
* @return Table metadata array
* @throws IOException
*/
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/json" })
@ResponseBody
public CubeRequest saveCubeDesc(@RequestBody CubeRequest cubeRequest) {
CubeDesc desc = deserializeCubeDesc(cubeRequest);
if (desc == null) {
cubeRequest.setMessage("CubeDesc is null.");
return cubeRequest;
}
String name = desc.getName();
if (StringUtils.isEmpty(name)) {
logger.info("Cube name should not be empty.");
throw new BadRequestException("Cube name should not be empty.");
}
if (!StringUtils.containsOnly(name, VALID_CUBENAME)) {
logger.info("Invalid Cube name {}, only letters, numbers and underline supported.", name);
throw new BadRequestException("Invalid Cube name, only letters, numbers and underline supported.");
}
try {
desc.setUuid(UUID.randomUUID().toString());
String projectName = (null == cubeRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME
: cubeRequest.getProject();
ProjectInstance project = cubeService.getProjectManager().getProject(projectName);
if (project == null) {
throw new BadRequestException("Project " + projectName + " doesn't exist");
}
cubeService.createCubeAndDesc(project, desc);
} catch (Exception e) {
logger.error("Failed to deal with the request.", e);
throw new InternalErrorException(e.getLocalizedMessage(), e);
}
cubeRequest.setUuid(desc.getUuid());
cubeRequest.setSuccessful(true);
return cubeRequest;
}
示例3: saveModelDesc
/**
*
* create model
* @throws java.io.IOException
*/
@RequestMapping(value = "", method = { RequestMethod.POST }, produces = { "application/json" })
@ResponseBody
public ModelRequest saveModelDesc(@RequestBody ModelRequest modelRequest) {
//Update Model
DataModelDesc modelDesc = deserializeDataModelDesc(modelRequest);
if (modelDesc == null || StringUtils.isEmpty(modelDesc.getName())) {
return modelRequest;
}
if (StringUtils.isEmpty(modelDesc.getName())) {
logger.info("Model name should not be empty.");
throw new BadRequestException("Model name should not be empty.");
}
if (!StringUtils.containsOnly(modelDesc.getName(), VALID_MODELNAME)) {
logger.info("Invalid Model name {}, only letters, numbers and underline supported.", modelDesc.getName());
throw new BadRequestException("Invalid Model name, only letters, numbers and underline supported.");
}
try {
modelDesc.setUuid(UUID.randomUUID().toString());
String projectName = (null == modelRequest.getProject()) ? ProjectInstance.DEFAULT_PROJECT_NAME : modelRequest.getProject();
modelService.createModelDesc(projectName, modelDesc);
} catch (IOException e) {
// TODO Auto-generated catch block
logger.error("Failed to deal with the request:" + e.getLocalizedMessage(), e);
throw new InternalErrorException("Failed to deal with the request: " + e.getLocalizedMessage());
}
modelRequest.setUuid(modelDesc.getUuid());
modelRequest.setSuccessful(true);
return modelRequest;
}
示例4: setup
@Before
public void setup() throws Exception {
super.createTestMetadata();
System.setProperty("kylin.source.jdbc.connection-url", "jdbc:h2:mem:db" + "_jdbc_table_reader");
System.setProperty("kylin.source.jdbc.driver", "org.h2.Driver");
System.setProperty("kylin.source.jdbc.user", "sa");
System.setProperty("kylin.source.jdbc.pass", "");
config = KylinConfig.getInstanceFromEnv();
h2Connection = DriverManager.getConnection("jdbc:h2:mem:db" + "_jdbc_table_reader", "sa", "");
String project = ProjectInstance.DEFAULT_PROJECT_NAME;
H2Database h2DB = new H2Database(h2Connection, config, project);
DataModelManager mgr = DataModelManager.getInstance(KylinConfig.getInstanceFromEnv());
ModelDataGenerator gen = new ModelDataGenerator(mgr.getDataModelDesc("ci_left_join_model"), 10000);
gen.generate();
h2DB.loadAllTables();
}
示例5: setup
@Before
public void setup() throws Exception {
super.createTestMetadata();
System.setProperty("kylin.source.jdbc.connection-url", "jdbc:h2:mem:db" + "_jdbc_source_table_loader");
System.setProperty("kylin.source.jdbc.driver", "org.h2.Driver");
System.setProperty("kylin.source.jdbc.user", "sa");
System.setProperty("kylin.source.jdbc.pass", "");
config = KylinConfig.getInstanceFromEnv();
h2Connection = DriverManager.getConnection("jdbc:h2:mem:db" + "_jdbc_source_table_loader", "sa", "");
String project = ProjectInstance.DEFAULT_PROJECT_NAME;
H2Database h2DB = new H2Database(h2Connection, config, project);
DataModelManager mgr = DataModelManager.getInstance(KylinConfig.getInstanceFromEnv());
ModelDataGenerator gen = new ModelDataGenerator(mgr.getDataModelDesc("ci_left_join_model"), 10000);
gen.generate();
h2DB.loadAllTables();
}