当前位置: 首页>>代码示例>>Java>>正文


Java ProjectInstance.DEFAULT_PROJECT_NAME属性代码示例

本文整理汇总了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();
}
 
开发者ID:apache,项目名称:kylin,代码行数:16,代码来源:KylinTestBase.java

示例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;
}
 
开发者ID:apache,项目名称:kylin,代码行数:44,代码来源:CubeController.java

示例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;
}
 
开发者ID:apache,项目名称:kylin,代码行数:38,代码来源:ModelController.java

示例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();

}
 
开发者ID:apache,项目名称:kylin,代码行数:24,代码来源:ITJdbcTableReaderTest.java

示例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();

}
 
开发者ID:apache,项目名称:kylin,代码行数:24,代码来源:ITJdbcSourceTableLoaderTest.java


注:本文中的org.apache.kylin.metadata.project.ProjectInstance.DEFAULT_PROJECT_NAME属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。