|
|
|
@ -8,13 +8,15 @@ import com.xxl.job.core.handler.IJobHandler;
|
|
|
|
|
import com.xxl.job.core.log.XxlJobFileAppender;
|
|
|
|
|
import com.xxl.job.core.log.XxlJobLogger;
|
|
|
|
|
import com.xxl.job.core.util.ShardingUtil;
|
|
|
|
|
import org.eclipse.jetty.util.ConcurrentHashSet;
|
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
|
|
|
|
|
import java.io.PrintWriter;
|
|
|
|
|
import java.io.StringWriter;
|
|
|
|
|
import java.util.Collections;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.HashSet;
|
|
|
|
|
import java.util.Set;
|
|
|
|
|
import java.util.concurrent.LinkedBlockingQueue;
|
|
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
|
@ -28,7 +30,7 @@ public class JobThread extends Thread{
|
|
|
|
|
private int jobId;
|
|
|
|
|
private IJobHandler handler;
|
|
|
|
|
private LinkedBlockingQueue<TriggerParam> triggerQueue;
|
|
|
|
|
private ConcurrentHashSet<Integer> triggerLogIdSet; // avoid repeat trigger for the same TRIGGER_LOG_ID
|
|
|
|
|
private Set<Integer> triggerLogIdSet; // avoid repeat trigger for the same TRIGGER_LOG_ID
|
|
|
|
|
|
|
|
|
|
private volatile boolean toStop = false;
|
|
|
|
|
private String stopReason;
|
|
|
|
@ -41,7 +43,7 @@ public class JobThread extends Thread{
|
|
|
|
|
this.jobId = jobId;
|
|
|
|
|
this.handler = handler;
|
|
|
|
|
this.triggerQueue = new LinkedBlockingQueue<TriggerParam>();
|
|
|
|
|
this.triggerLogIdSet = new ConcurrentHashSet<Integer>();
|
|
|
|
|
this.triggerLogIdSet = Collections.synchronizedSet(new HashSet<Integer>());
|
|
|
|
|
}
|
|
|
|
|
public IJobHandler getHandler() {
|
|
|
|
|
return handler;
|
|
|
|
|