1 CacheHelper : 将任务用sublist分组,然后用java.util.concurrent.CountDownLatch来一起处理;
2 Module System.getProperties().putAll(prop);
3 CacheHelper: final AtomicBoolean isSucc = new AtomicBoolean(true); 在其他线程设置结果,不用普通的boolean
4 Executors.newScheduledThreadPool(1);;
缺点:
1 . DataStoreCleanFromStorageScheduler
static final long INTERVAL = 90 * 24 * 60 * 60 * 1000;
2 CollectionUtils.splitList2MapObject(List<T>, Class<T>, String)
m = c.getDeclaredMethod(name, new Class[0]);
3 CacheDao.batchDeleteNodeMessageById(long, long)
Delete from cache_sync_node t where t.id<=maxId and t.id<=minId
4 ExternalFileServiceImpl
public void removeFileStats(int durationHours, int maxCount)
throws ExternalException {
try {
fileStatsManager.removeFileStats(maxCount, durationHours);
6 QDTaskDispatcher
public final String ASYNTASK = "AsynTask";
5 MQUtil
private static String QUEUE_MIDDLE = "_q_";
6 TaskWorkerFactoryImpl
TaskWorkerDefinition workerDef = TaskWorkerConfig.getInstance().getTaskWorkerDef(workerId);
if(workerDef == null){
throw new Exception("need define " + workerId + " in taskWorkerDefinition.xml");
}
String className = TaskWorkerConfig.getInstance().getTaskWorkerDef(workerId).getClassName();
7 MetaDataStoreAction
eventList.clear();最好用finally
8 DMSMQC
assert eventList != null;
9 DMISNMPTimer
errorMessage = ("GSB");
10
com.webex.dms2.dmi.util.Compress
ByteArrayOutputStream baout = new ByteArrayOutputStream();
GZIPOutputStream gzout = new GZIPOutputStream(baout);
未用buffered类装饰
11
异常无任何处理
.DistCacheManagerImpl.internalRemove(String)
} catch (InterruptedException e) {
} catch (ExecutionException e) {
}
12
MSInitServiceImpl
smSubscribeKey = ModuleConfigFactory.getInstance().getMSserviceCofig().getSmSubscribeKey();
usSubscribeKey = ModuleConfigFactory.getInstance().getMSserviceCofig().getUsSubscribeKey();
_initMS
initMS区别尼,命名没有区分
13
.EventTaskConsumer
catch (Throwable e) {
logger.info
14
TraceDebugListenerImpl
new ArrayList<TraceDebugMessage>(COUNT_INSERT_DB + 1);
removeEldestEntry
15
String paramName="daysOfSavePeriod";
String value="#no_match#";
TraceDebugConfig traceDebugConfig = new TraceDebugConfig();
try {
BeanUtils.copyProperty(traceDebugConfig,
paramName, value);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
System.out.println(traceDebugConfig.getDaysOfSavePeriod());
:asz1dmi002:root > grep 'traceDebug.daysOfSavePeriod' *
module.xml: <param name="daysOfSavePeriod" value="${traceDebug.daysOfSavePeriod}" />
value = replacePlaceHold(value);
if (isDynamic) {
((DynamicModuleConfig) moduleConfig)
.putParamValue(paramName, value);
} else {
BeanUtils.copyProperty(moduleConfig,
paramName, value);
16
TaskCleanTimer 可以放到quartz框架里面统一管理
17
TaskCleanTimer
private volatile boolean isInit = false;
public void execut() {
if (!isInit) {
taskCleanExecutor.scheduleAtFixedRate(new TaskCleanTask(), 0, 1, TimeUnit.DAYS);
isInit = true;
}
}