Java Code Examples for org.apache.kylin.metadata.model.DataModelDesc#getName()

The following examples show how to use org.apache.kylin.metadata.model.DataModelDesc#getName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ModelService.java    From kylin-on-parquet-v2 with Apache License 2.0 6 votes vote down vote up
public void primaryCheck(DataModelDesc modelDesc) {
    Message msg = MsgPicker.getMsg();

    if (modelDesc == null) {
        throw new BadRequestException(msg.getINVALID_MODEL_DEFINITION());
    }

    String modelName = modelDesc.getName();

    if (StringUtils.isEmpty(modelName)) {
        logger.info("Model name should not be empty.");
        throw new BadRequestException(msg.getEMPTY_MODEL_NAME());
    }
    if (!ValidateUtil.isAlphanumericUnderscore(modelName)) {
        logger.info("Invalid model name {}, only letters, numbers and underscore supported.", modelDesc.getName());
        throw new BadRequestException(String.format(Locale.ROOT, msg.getINVALID_MODEL_NAME(), modelName));
    }
}
 
Example 2
Source File: ModelService.java    From kylin with Apache License 2.0 6 votes vote down vote up
public void primaryCheck(DataModelDesc modelDesc) {
    Message msg = MsgPicker.getMsg();

    if (modelDesc == null) {
        throw new BadRequestException(msg.getINVALID_MODEL_DEFINITION());
    }

    String modelName = modelDesc.getName();

    if (StringUtils.isEmpty(modelName)) {
        logger.info("Model name should not be empty.");
        throw new BadRequestException(msg.getEMPTY_MODEL_NAME());
    }
    if (!ValidateUtil.isAlphanumericUnderscore(modelName)) {
        logger.info("Invalid model name {}, only letters, numbers and underscore supported.", modelDesc.getName());
        throw new BadRequestException(String.format(Locale.ROOT, msg.getINVALID_MODEL_NAME(), modelName));
    }
}
 
Example 3
Source File: MetadataManager.java    From Kylin with Apache License 2.0 5 votes vote down vote up
public DataModelDesc createDataModelDesc(DataModelDesc dataModelDesc) throws IOException {
    String name = dataModelDesc.getName();
    if (dataModelDescMap.containsKey(name))
        throw new IllegalArgumentException("DataModelDesc '" + name + "' already exists");

    return saveDataModelDesc(dataModelDesc);
}
 
Example 4
Source File: MetadataManager.java    From Kylin with Apache License 2.0 5 votes vote down vote up
public DataModelDesc updateDataModelDesc(DataModelDesc desc) throws IOException {
    String name = desc.getName();
    if (!dataModelDescMap.containsKey(name)) {
        throw new IllegalArgumentException("DataModelDesc '" + name + "' does not exist.");
    }

    return saveDataModelDesc(desc);
}
 
Example 5
Source File: ModelDataGenerator.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
private String path(DataModelDesc model) {
    return outputPath + "/" + "ddl_" + model.getName() + ".sql";
}
 
Example 6
Source File: HybridController.java    From kylin-on-parquet-v2 with Apache License 2.0 4 votes vote down vote up
private HybridRespone hybridInstance2response(HybridInstance hybridInstance){
    DataModelDesc modelDesc = hybridInstance.getModel();
    return new HybridRespone(modelDesc == null ? HybridRespone.NO_PROJECT : modelDesc.getProject(), modelDesc == null ? HybridRespone.NO_MODEL : modelDesc.getName(), hybridInstance);
}
 
Example 7
Source File: ModelDataGenerator.java    From kylin with Apache License 2.0 4 votes vote down vote up
private String path(DataModelDesc model) {
    return outputPath + "/" + "ddl_" + model.getName() + ".sql";
}
 
Example 8
Source File: HybridController.java    From kylin with Apache License 2.0 4 votes vote down vote up
private HybridRespone hybridInstance2response(HybridInstance hybridInstance){
    DataModelDesc modelDesc = hybridInstance.getModel();
    return new HybridRespone(modelDesc == null ? HybridRespone.NO_PROJECT : modelDesc.getProject(), modelDesc == null ? HybridRespone.NO_MODEL : modelDesc.getName(), hybridInstance);
}