shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package com.walker.store.task;
 
import com.walker.store.Storeable;
import com.walker.store.Task;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
 
public abstract class AbstractTask implements Task {
 
    protected transient final Logger logger = LoggerFactory.getLogger(getClass());
    
    public static final String DEFAULT_RESULT = "OK";
    
    Storeable store = null;
    
    String name; // 任务名称
    
    public AbstractTask(Storeable store, String name){
        if(store == null){
            throw new IllegalArgumentException("请先设置参数:'AbstractStore'");
        }
//        this.reposityory = reposityory;
//        this.metaDataEngine = metaDataEngine;
        this.store = store;
        this.name = name;
    }
    
    public String getName() {
        return name;
    }
    
//    public class LogInfo {
//        private long spanTime = 0;
//        private int writeCount = 0;
//        
//        /**
//         * 返回本次日志的记录时间,秒
//         * @return
//         */
//        public long getSpanTime() {
//            return spanTime;
//        }
//        public LogInfo setSpanTime(long spanTime) {
//            this.spanTime = spanTime;
//            return this;
//        }
//        
//        /**
//         * 返回本次记录的采集数据量
//         * @return
//         */
//        public int getWriteCount() {
//            return writeCount;
//        }
//        public LogInfo setWriteCount(int writeCount) {
//            this.writeCount = writeCount;
//            return this;
//        }
//        
//        @Override
//        public String toString(){
//            return new StringBuilder().append("[spanTime=").append(this.spanTime)
//                    .append(", writeCount=").append(this.writeCount)
//                    .append("]").toString();
//        }
//    }
    
}