public void validateNotifyList() { List<String> notifyList = getNotifyList(); if (notifyList != null && !notifyList.isEmpty()) { EmailValidator emailValidator = EmailValidator.getInstance(); for (String email : notifyList) { if (!emailValidator.isValid(email)) { throw new IllegalArgumentException("Email [" + email + "] is not validation."); } } } }
private static LookupSnapshotBuildJob initJob(CubeInstance cube, String tableName, String submitter, KylinConfig kylinConfig) { List<ProjectInstance> projList = ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(), cube.getName()); if (projList == null || projList.size() == 0) { throw new RuntimeException("Cannot find the project containing the cube " + cube.getName() + "!!!"); } else if (projList.size() >= 2) { String msg = "Find more than one project containing the cube " + cube.getName() + ". It does't meet the uniqueness requirement!!! "; throw new RuntimeException(msg); } LookupSnapshotBuildJob result = new LookupSnapshotBuildJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss", Locale.ROOT); format.setTimeZone(TimeZone.getTimeZone(kylinConfig.getTimeZone())); result.setDeployEnvName(kylinConfig.getDeployEnv()); result.setProjectName(projList.get(0).getName()); CubingExecutableUtil.setCubeName(cube.getName(), result.getParams()); result.setName(JOB_TYPE + " CUBE - " + cube.getName() + " - " + " TABLE - " + tableName + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(cube.getDescriptor().getNotifyList()); return result; }
+ format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(seg.getCubeInstance().getDescriptor().getNotifyList()); return result;
private CubingJob initialJob(CubeSegment seg, String type) { CubingJob result = new CubingJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone(engineConfig.getTimeZone())); result.setCubeName(seg.getCubeInstance().getName()); result.setSegmentId(seg.getUuid()); result.setName(seg.getCubeInstance().getName() + " - " + seg.getName() + " - " + type + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(seg.getCubeInstance().getDescriptor().getNotifyList()); return result; }
newCubeDesc.setHbaseMapping(cubeDesc.getHbaseMapping()); newCubeDesc.setSignature(cubeDesc.getSignature()); newCubeDesc.setNotifyList(cubeDesc.getNotifyList()); newCubeDesc.setStatusNeedNotify(cubeDesc.getStatusNeedNotify()); newCubeDesc.setAutoMergeTimeRanges(cubeDesc.getAutoMergeTimeRanges());
public void validateNotifyList() { List<String> notifyList = getNotifyList(); if (notifyList != null && !notifyList.isEmpty()) { EmailValidator emailValidator = EmailValidator.getInstance(); for (String email : notifyList) { if (!emailValidator.isValid(email)) { throw new IllegalArgumentException("Email [" + email + "] is not validation."); } } } }
private CubingJob initialJob(CubeSegment seg, String type) { CubingJob result = new CubingJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss"); format.setTimeZone(TimeZone.getTimeZone(engineConfig.getTimeZone())); result.setCubeName(seg.getCubeInstance().getName()); result.setSegmentId(seg.getUuid()); result.setName(seg.getCubeInstance().getName() + " - " + seg.getName() + " - " + type + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(seg.getCubeInstance().getDescriptor().getNotifyList()); return result; }
private static LookupSnapshotBuildJob initJob(CubeInstance cube, String tableName, String submitter, KylinConfig kylinConfig) { List<ProjectInstance> projList = ProjectManager.getInstance(kylinConfig).findProjects(cube.getType(), cube.getName()); if (projList == null || projList.size() == 0) { throw new RuntimeException("Cannot find the project containing the cube " + cube.getName() + "!!!"); } else if (projList.size() >= 2) { String msg = "Find more than one project containing the cube " + cube.getName() + ". It does't meet the uniqueness requirement!!! "; throw new RuntimeException(msg); } LookupSnapshotBuildJob result = new LookupSnapshotBuildJob(); SimpleDateFormat format = new SimpleDateFormat("z yyyy-MM-dd HH:mm:ss", Locale.ROOT); format.setTimeZone(TimeZone.getTimeZone(kylinConfig.getTimeZone())); result.setDeployEnvName(kylinConfig.getDeployEnv()); result.setProjectName(projList.get(0).getName()); CubingExecutableUtil.setCubeName(cube.getName(), result.getParams()); result.setName(JOB_TYPE + " CUBE - " + cube.getName() + " - " + " TABLE - " + tableName + " - " + format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(cube.getDescriptor().getNotifyList()); return result; }
+ format.format(new Date(System.currentTimeMillis()))); result.setSubmitter(submitter); result.setNotifyList(seg.getCubeInstance().getDescriptor().getNotifyList()); return result;
public static CubeDesc getCopyOf(CubeDesc cubeDesc) { CubeDesc newCubeDesc = new CubeDesc(); newCubeDesc.setName(cubeDesc.getName()); newCubeDesc.setModelName(cubeDesc.getModelName()); newCubeDesc.setDescription(cubeDesc.getDescription()); newCubeDesc.setNullStrings(cubeDesc.getNullStrings()); newCubeDesc.setDimensions(cubeDesc.getDimensions()); newCubeDesc.setMeasures(cubeDesc.getMeasures()); newCubeDesc.setRowkey(cubeDesc.getRowkey()); newCubeDesc.setHbaseMapping(cubeDesc.getHbaseMapping()); newCubeDesc.setSignature(cubeDesc.getSignature()); newCubeDesc.setNotifyList(cubeDesc.getNotifyList()); newCubeDesc.setAutoMergeTimeRanges(cubeDesc.getAutoMergeTimeRanges()); newCubeDesc.setRetentionRange(cubeDesc.getRetentionRange()); newCubeDesc.setConfig(cubeDesc.getConfig()); newCubeDesc.updateRandomUuid(); return newCubeDesc; }
newCubeDesc.setHbaseMapping(cubeDesc.getHbaseMapping()); newCubeDesc.setSignature(cubeDesc.getSignature()); newCubeDesc.setNotifyList(cubeDesc.getNotifyList()); newCubeDesc.setStatusNeedNotify(cubeDesc.getStatusNeedNotify()); newCubeDesc.setAutoMergeTimeRanges(cubeDesc.getAutoMergeTimeRanges());