Skip to content

Commit

Permalink
Merge f670d64 into cd324fa
Browse files Browse the repository at this point in the history
  • Loading branch information
Technoboy- committed Aug 17, 2020
2 parents cd324fa + f670d64 commit 4641465
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 19 deletions.
Expand Up @@ -30,7 +30,7 @@
@NoArgsConstructor
@Data
@ToString
public class JobDagConfiguration {
public final class JobDagConfiguration {
/** DAG name. */
private String dagName;

Expand Down
Expand Up @@ -92,9 +92,9 @@ public void execute() {
jobFacade.dagStatesCheck();
jobFacade.dagJobDependenciesCheck();
//CHECKSTYLE:OFF
} catch (Exception e) {
} catch (final Exception ex) {
//CHECKSTYLE:ON
log.error("DAG job - {} exception! Check !", jobConfig.getJobName(), e);
log.error("DAG job - {} exception! Check !", jobConfig.getJobName(), ex);
return;
}
}
Expand Down
Expand Up @@ -21,7 +21,7 @@
* Dag runtime exception.
*
**/
public class DagRuntimeException extends RuntimeException {
public final class DagRuntimeException extends RuntimeException {
private static final long serialVersionUID = 3244908974343209468L;

public DagRuntimeException(final String errorMessage, final Object... args) {
Expand Down
Expand Up @@ -31,7 +31,7 @@
**/
@Getter
@ToString
public class DagJobExecutionEvent implements JobEvent {
public final class DagJobExecutionEvent implements JobEvent {
private String id;

private String dagName;
Expand Down
Expand Up @@ -52,7 +52,7 @@
* retry/ {jobName}
*/
@Slf4j
public class DagNodeStorage {
public final class DagNodeStorage {

private static final String DAG_ROOT = "/dag/%s";

Expand Down Expand Up @@ -406,7 +406,7 @@ public void triggerJob(final String job) {
}
rawClient.transaction().forOperations(opList);
//CHECKSTYLE:OFF
} catch (Exception exp) {
} catch (final Exception exp) {
//CHECKSTYLE:ON
log.debug("Dag-{}[{}] trigger job in transaction Exception!", dagName, job, exp);
}
Expand Down Expand Up @@ -472,11 +472,11 @@ public int getJobRetryTimes() {
* Add dag retry job times.
* Persist jobName to path '/dag/dagName/retry'
*
* @param i retry times.
* @param retryTimes retry times.
*/
public void updateJobRetryTimes(final int i) {
public void updateJobRetryTimes(final int retryTimes) {
regCenter.persist(pathOfDagRetryJob(jobName), "");
regCenter.persist(pathOfDagGraphJobRetryTimes(), "" + i);
regCenter.persist(pathOfDagGraphJobRetryTimes(), "" + retryTimes);
}

/**
Expand Down
Expand Up @@ -63,5 +63,4 @@ public static DagStates of(final String value) {
public String getValue() {
return value;
}

}
Expand Up @@ -47,13 +47,13 @@ public void consumeMessage(final String message) throws Exception {
// message format: dagName||jobName
// trigger the job only when dag state is running
if (StringUtils.isEmpty(message)) {
log.info("Dag-{} Retry job Receive message is empty, return!", dagName);
log.warn("Dag-{} Retry job Receive message is empty, return!", dagName);
return;
}

List<String> strings = Splitter.on("||").splitToList(message);
if (strings.size() != 2) {
log.info("Dag-{} Retry job message format not right! {}", dagName, message);
log.warn("Dag-{} Retry job message format not right! {}", dagName, message);
return;
}

Expand All @@ -63,7 +63,7 @@ public void consumeMessage(final String message) throws Exception {

DagStates dagState = DagStates.of(dagNodeStorage.currentDagStates());
if (dagState != DagStates.RUNNING) {
log.info("Dag-{} retry job, dag state-{} not RUNNING, quit!", dagName, jobName, dagState);
log.warn("Dag-{} retry job, dag state-{} not RUNNING, quit!", dagName, jobName, dagState);
return;
}

Expand All @@ -74,5 +74,4 @@ public void consumeMessage(final String message) throws Exception {
public void stateChanged(final CuratorFramework client, final ConnectionState newState) {

}

}
Expand Up @@ -127,7 +127,6 @@ public void registerJobCompleted(final ShardingContexts shardingContexts, final
jobNodeStorage.removeJobNodeIfExisted(JobStateNode.getRooProcFail());
jobNodeStorage.removeJobNodeIfExisted(JobStateNode.getRooProcSucc());
}

}

/**
Expand Down
Expand Up @@ -63,5 +63,4 @@ public static JobStateEnum of(final String value) {
public String getValue() {
return value;
}

}
Expand Up @@ -23,7 +23,7 @@
* Job state state node path.
*
**/
public class JobStateNode {
public final class JobStateNode {
public static final String ROOT_STATE = "state/state";

public static final String ROOT_STATE_FOR_CACHE = "state";
Expand Down
Expand Up @@ -26,7 +26,7 @@
**/
@Data
@ToString
public class DagBriefInfo {
public final class DagBriefInfo {
private String dagName;

private String jobName;
Expand Down

0 comments on commit 4641465

Please sign in to comment.