Java Code Examples for com.xxl.job.admin.core.trigger.XxlJobTrigger#runExecutor()

The following examples show how to use com.xxl.job.admin.core.trigger.XxlJobTrigger#runExecutor() . 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: ExecutorRouteLFU.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 2
Source File: ExecutorRouteRound.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 3
Source File: ExecutorRouteFirst.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 4
Source File: ExecutorRouteConsistentHash.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {
    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 5
Source File: ExecutorRouteFailover.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    StringBuffer beatResultSB = new StringBuffer();
    for (String address : addressList) {
        // beat
        ReturnT<String> beatResult = null;
        try {
            ExecutorBiz executorBiz = XxlJobDynamicScheduler.getExecutorBiz(address);
            beatResult = executorBiz.beat();
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            beatResult = new ReturnT<String>(ReturnT.FAIL_CODE, ""+e );
        }
        beatResultSB.append( (beatResultSB.length()>0)?"<br><br>":"")
                .append(I18nUtil.getString("jobconf_beat") + ":")
                .append("<br>address:").append(address)
                .append("<br>code:").append(beatResult.getCode())
                .append("<br>msg:").append(beatResult.getMsg());

        // beat success
        if (beatResult.getCode() == ReturnT.SUCCESS_CODE) {

            ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
            beatResultSB.append("<br><br>").append(runResult.getMsg());

            // result
            runResult.setMsg(beatResultSB.toString());
            runResult.setContent(address);
            return runResult;
        }
    }
    return new ReturnT<String>(ReturnT.FAIL_CODE, beatResultSB.toString());

}
 
Example 6
Source File: ExecutorRouteRandom.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {
    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 7
Source File: ExecutorRouteBusyover.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    StringBuffer idleBeatResultSB = new StringBuffer();
    for (String address : addressList) {
        // beat
        ReturnT<String> idleBeatResult = null;
        try {
            ExecutorBiz executorBiz = XxlJobDynamicScheduler.getExecutorBiz(address);
            idleBeatResult = executorBiz.idleBeat(triggerParam.getJobId());
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            idleBeatResult = new ReturnT<String>(ReturnT.FAIL_CODE, ""+e );
        }
        idleBeatResultSB.append( (idleBeatResultSB.length()>0)?"<br><br>":"")
                .append(I18nUtil.getString("jobconf_idleBeat") + ":")
                .append("<br>address:").append(address)
                .append("<br>code:").append(idleBeatResult.getCode())
                .append("<br>msg:").append(idleBeatResult.getMsg());

        // beat success
        if (idleBeatResult.getCode() == ReturnT.SUCCESS_CODE) {

            ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
            idleBeatResultSB.append("<br><br>").append(runResult.getMsg());

            // result
            runResult.setMsg(idleBeatResultSB.toString());
            runResult.setContent(address);
            return runResult;
        }
    }

    return new ReturnT<String>(ReturnT.FAIL_CODE, idleBeatResultSB.toString());
}
 
Example 8
Source File: ExecutorRouteLast.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {
    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}
 
Example 9
Source File: ExecutorRouteLRU.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
@Override
public ReturnT<String> routeRun(TriggerParam triggerParam, ArrayList<String> addressList) {

    // address
    String address = route(triggerParam.getJobId(), addressList);

    // run executor
    ReturnT<String> runResult = XxlJobTrigger.runExecutor(triggerParam, address);
    runResult.setContent(address);
    return runResult;
}