MigrateTask.java
3.35 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
package io.mycat.migrate;
import io.mycat.route.function.PartitionByCRC32PreSlot;
import io.mycat.route.function.PartitionByCRC32PreSlot.Range;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* Created by magicdoom on 2016/9/15.
*/
public class MigrateTask implements Serializable {
private String from;
private String to;
private String table;
private List<Range> slots=new ArrayList<>();
private String method;
private String fclass=PartitionByCRC32PreSlot.class.getName();
private String schema;
private int slaveId;
private transient String zkpath;
private transient String binlogFile;
private transient int pos;
private transient volatile Date lastBinlogDate;
private transient volatile boolean haserror=false;
private transient volatile int status;
private transient volatile boolean hasExecute=false;
public int getStatus() {
return status;
}
public void setStatus(int status) {
this.status = status;
}
public boolean isHaserror() {
return haserror;
}
public void setHaserror(boolean haserror) {
this.haserror = haserror;
}
public List<Range> getSlots() {
return slots;
}
public void setSlots(List<Range> slots) {
this.slots = slots;
}
public int getSize()
{ int size=0;
for (Range slot : slots) {
size=size+slot.size;
}
return size;
}
public boolean isHasExecute() {
return hasExecute;
}
public void setHasExecute(boolean hasExecute) {
this.hasExecute = hasExecute;
}
public String getBinlogFile() {
return binlogFile;
}
public void setBinlogFile(String binlogFile) {
this.binlogFile = binlogFile;
}
public int getPos() {
return pos;
}
public void setPos(int pos) {
this.pos = pos;
}
public String getFrom() {
return from;
}
public Date getLastBinlogDate() {
return lastBinlogDate;
}
public void setLastBinlogDate(Date lastBinlogDate) {
this.lastBinlogDate = lastBinlogDate;
}
public void setFrom(String from) {
this.from = from;
}
public String getTo() {
return to;
}
public void setTo(String to) {
this.to = to;
}
public String getTable() {
return table;
}
public void setTable(String table) {
this.table = table;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getFclass() {
return fclass;
}
public void setFclass(String fclass) {
this.fclass = fclass;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public int getSlaveId() {
return slaveId;
}
public void setSlaveId(int slaveId) {
this.slaveId = slaveId;
}
public String getZkpath() {
return zkpath;
}
public void setZkpath(String zkpath) {
this.zkpath = zkpath;
}
public void addSlots(Range range)
{
slots.add(range);
}
public void addSlots(List<Range> ranges)
{
slots.addAll(ranges);
}
}