IScheduleDataManager.java
7.31 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
package com.taobao.pamirs.schedule.taskmanager;
import java.util.List;
import java.util.Map;
import org.apache.zookeeper.data.Stat;
import com.taobao.pamirs.schedule.TaskItemDefine;
/**
* �����������Ŀͻ��˽ӿڣ������л������ݿ��ʵ�֣������л���ConfigServer��ʵ��
*
* @author xuannan
*
*/
public interface IScheduleDataManager{
public long getSystemTime();
/**
* ����װ�ص�ǰserver��Ҫ��������ݶ���
*
* @param taskType
* ��������
* @param uuid
* ��ǰserver��UUID
* @return
* @throws Exception
*/
public List<TaskItemDefine> reloadDealTaskItem(String taskType, String uuid) throws Exception;
/**
* װ�����е����������Ϣ
* @param taskType
* @return
* @throws Exception
*/
public List<ScheduleTaskItem> loadAllTaskItem(String taskType) throws Exception;
/**
* �ͷ��Լ��ѳ֣���������Ķ���
*
* @param taskType
* @param uuid
* @return
* @throws Exception
*/
public void releaseDealTaskItem(String taskType, String uuid) throws Exception;
/**
* ��ȡһ���������͵Ĵ����������
*
* @param taskType
* @return
* @throws Exception
*/
public int queryTaskItemCount(String taskType) throws Exception;
/**
* װ���������������Ϣ
*
* @param taskType
* @throws Exception
*/
public ScheduleTaskType loadTaskTypeBaseInfo(String taskType) throws Exception;
/**
* ����Ѿ����ڵĵ��ȷ�������Ϣ
*
* @param taskInfo
* @throws Exception
*/
public int clearExpireScheduleServer(String taskType, long expireTime) throws Exception;
/**
* ���������Ϣ���������Ѿ������ڵ�ʱ��
*
* @param taskInfo
* @throws Exception
*/
public int clearTaskItem(String taskType, List<String> serverList) throws Exception;
/**
* ��ȡ���е���Ч��������Ϣ
*
* @param taskInfo
* @return
* @throws Exception
*/
public List<ScheduleServer> selectAllValidScheduleServer(String taskType) throws Exception;
public List<String> loadScheduleServerNames(String taskType)throws Exception;
/**
* ���·�������Item
*
* @param taskType
* @param serverList
* @throws Exception
*/
public void assignTaskItem(String taskType, String currentUuid, int maxNumOfOneServer, List<String> serverList) throws Exception;
/**
* ����������Ϣ
*
* @param server
* @throws Exception
*/
public boolean refreshScheduleServer(ScheduleServer server) throws Exception;
/**
* ע�������
*
* @param server
* @throws Exception
*/
public void registerScheduleServer(ScheduleServer server) throws Exception;
/**
* ע��������
* @param serverUUID
* @throws Exception
*/
public void unRegisterScheduleServer(String taskType, String serverUUID) throws Exception;
/**
* ����Ѿ����ڵ�OWN_SIGN���Զ����ɵ�����
* @param taskType ��������
* @param serverUUID ������
* @param expireDateInternal ����ʱ�䣬����Ϊ��λ
* @throws Exception
*/
public void clearExpireTaskTypeRunningInfo(String baseTaskType, String serverUUID, double expireDateInternal)throws Exception;
public boolean isLeader(String uuid, List<String> serverList);
public void pauseAllServer(String baseTaskType)throws Exception;
public void resumeAllServer(String baseTaskType)throws Exception;
public List<ScheduleTaskType> getAllTaskTypeBaseInfo()throws Exception ;
/**
* ���һ���������͵���������Ϣ
* @param baseTaskType
* @throws Exception
*/
public void clearTaskType(String baseTaskType) throws Exception;
/**
* ����һ���µ���������
* @param baseTaskType
* @throws Exception
*/
public void createBaseTaskType(ScheduleTaskType baseTaskType) throws Exception ;
public void updateBaseTaskType(ScheduleTaskType baseTaskType) throws Exception ;
public List<ScheduleTaskTypeRunningInfo> getAllTaskTypeRunningInfo(String baseTaskType) throws Exception;
/**
* ɾ��һ����������
* @param baseTaskType
* @throws Exception
*/
public void deleteTaskType(String baseTaskType) throws Exception;
/**
* ����������ѯ��ǰ���ȷ���
* @param baseTaskType
* @param ownSign
* @param ip
* @param orderStr
* @return
* @throws Exception
*/
public List<ScheduleServer> selectScheduleServer(String baseTaskType, String ownSign, String ip, String orderStr)
throws Exception;
/**
* ��ѯ���ȷ������ʷ��¼
* @param baseTaskType
* @param ownSign
* @param ip
* @param orderStr
* @return
* @throws Exception
*/
public List<ScheduleServer> selectHistoryScheduleServer(String baseTaskType, String ownSign, String ip, String orderStr)
throws Exception;
public List<ScheduleServer> selectScheduleServerByManagerFactoryUUID(String factoryUUID) throws Exception;
/**
* ���������ע�����е� CurrentSever��RequestServer����������
* @param taskItems
* @throws Exception
*/
public void createScheduleTaskItem(ScheduleTaskItem[] taskItems) throws Exception;
/**
* ���������״̬�ʹ�����Ϣ
* @param taskType
* @param sts
* @param message
*/
public void updateScheduleTaskItemStatus(String taskType, String taskItem, ScheduleTaskItem.TaskItemSts sts, String message)throws Exception;
/**
* ɾ��������
* @param taskType
* @param taskItem
*/
public void deleteScheduleTaskItem(String taskType, String taskItem) throws Exception;
/**
* ��ʼ��������ȵ�����Ϣ�;�̬������Ϣ
* @param baseTaskType
* @param ownSign
* @param serverUUID
* @throws Exception
*/
public void initialRunningInfo4Static(String baseTaskType, String ownSign, String uuid)throws Exception;
public void initialRunningInfo4Dynamic(String baseTaskType, String ownSign)throws Exception;
/**
* ��������Ϣ�Ƿ��ʼ���ɹ�
* @param baseTaskType
* @param ownSign
* @param serverUUID
* @return
* @throws Exception
*/
public boolean isInitialRunningInfoSucuss(String baseTaskType, String ownSign) throws Exception;
public void setInitialRunningInfoSucuss(String baseTaskType, String taskType, String uuid) throws Exception;
public String getLeader(List<String> serverList);
public long updateReloadTaskItemFlag(String taskType) throws Exception;
public long getReloadTaskItemFlag(String taskType) throws Exception;
/**
* ͨ��taskType��ȡ��ǰ���е�serverList��Ϣ��
* @param taskType
* @return
* @throws Exception
*/
public Map<String ,Stat> getCurrentServerStatList(String taskType) throws Exception;
}