...
|
...
|
@@ -139,6 +139,7 @@ public class YohoIndexDataLoader implements ApplicationContextAware { |
|
|
INDEX_REBUILD_LOG.info("loadAllData for index=[{}],with minId={},maxId={}",yohoIndexName,defaultMinId,defaultMaxId);
|
|
|
int minId = defaultMinId;
|
|
|
int maxId = minId+limit;
|
|
|
int tmpMaxId;
|
|
|
// 3、分配任务、并包装异步执行结果
|
|
|
List<Future<Boolean>> futureResults = new ArrayList<Future<Boolean>>();
|
|
|
do{
|
...
|
...
|
@@ -158,9 +159,10 @@ public class YohoIndexDataLoader implements ApplicationContextAware { |
|
|
}
|
|
|
});
|
|
|
futureResults.add(futureResult);
|
|
|
tmpMaxId = maxId;
|
|
|
minId = maxId+1;
|
|
|
maxId = minId+limit;
|
|
|
}while(maxId<=defaultMaxId);
|
|
|
}while(tmpMaxId<=defaultMaxId);
|
|
|
|
|
|
// 4.等待全部任务执行完成,并获取执行结果
|
|
|
boolean result = true;
|
...
|
...
|
@@ -210,12 +212,14 @@ public class YohoIndexDataLoader implements ApplicationContextAware { |
|
|
INDEX_REBUILD_LOG.info("loadAppendedData for index=[{}],with minId={},maxId={}",yohoIndexName,defaultMinId,defaultMaxId);
|
|
|
int minId = defaultMinId;
|
|
|
int maxId = minId+limit;
|
|
|
int taskMaxId;
|
|
|
int tmpMaxId;
|
|
|
do{
|
|
|
tmpMaxId = doLoadAppendedData(yohoIndexName, indexAppender, client, minId, limit);
|
|
|
minId = tmpMaxId!=0?tmpMaxId+1:maxId+1;
|
|
|
taskMaxId = doLoadAppendedData(yohoIndexName, indexAppender, client, minId, limit);
|
|
|
tmpMaxId = maxId;
|
|
|
minId = taskMaxId!=0?taskMaxId+1:maxId+1;
|
|
|
maxId = minId+limit;
|
|
|
}while(maxId<=defaultMaxId);
|
|
|
}while(tmpMaxId<=defaultMaxId);
|
|
|
|
|
|
return true;
|
|
|
}
|
...
|
...
|
|