...
|
...
|
@@ -190,10 +190,10 @@ public class YohoIndexDataLoader implements ApplicationContextAware { |
|
|
boolean result = false;
|
|
|
while (tryCount <= retryCount && !result) {
|
|
|
long begin = System.currentTimeMillis();
|
|
|
INDEX_REBUILD_LOG.info("[yohoIndexName=[{}]],[pageNo={}],[tryCount={}],[begin={}]", yohoIndexName, pageNo, tryCount, begin);
|
|
|
INDEX_REBUILD_LOG.debug("[yohoIndexName=[{}]],[pageNo={}],[tryCount={}],[begin={}]", yohoIndexName, pageNo, tryCount, begin);
|
|
|
result = this.doLoadData(yohoIndexName, tempIndexRealName, indexBuilder, client, pageNo, limit, true);
|
|
|
long cost = System.currentTimeMillis() - begin;
|
|
|
INDEX_REBUILD_LOG.info("[yohoIndexName=[{}]],[pageNo={}],[tryCount={}],[begin={}],[cost={}ms],[{result={}]", yohoIndexName, pageNo, tryCount, begin, cost, result);
|
|
|
INDEX_REBUILD_LOG.debug("[yohoIndexName=[{}]],[pageNo={}],[tryCount={}],[begin={}],[cost={}ms],[{result={}]", yohoIndexName, pageNo, tryCount, begin, cost, result);
|
|
|
tryCount++;
|
|
|
}
|
|
|
return result;
|
...
|
...
|
@@ -210,11 +210,12 @@ public class YohoIndexDataLoader implements ApplicationContextAware { |
|
|
long begin = System.currentTimeMillis();
|
|
|
INDEX_REBUILD_LOG.info("[addDataToEs begin][yohoIndexName=[{}]],[pageNo={}],[selectCount={}][begin={}]", yohoIndexName, pageNo,dataList.size(), begin);
|
|
|
List<ESBluk> bluks = new ArrayList<>(dataList.size());
|
|
|
for(Object ob: dataList){
|
|
|
for(Object ob: dataList){
|
|
|
bluks.add(new ESBluk(JSONObject.toJSONString(ob),indexBuilder.getId(ob),tempIndexRealName,yohoIndexName,false));
|
|
|
}
|
|
|
BulkResponse bulkResponse = client.bulk(bluks);
|
|
|
if(bulkResponse.hasFailures()){
|
|
|
INDEX_REBUILD_LOG.error("addIndexDataBean has fail,[yohoIndexName=[%s]],[pageNo=%s],[failureMessage=%s]", yohoIndexName,pageNo,bulkResponse.buildFailureMessage());
|
|
|
throw new Exception(String.format("addIndexDataBean has fail,[yohoIndexName=[%s]],[pageNo=%s],[failureMessage=%s]", yohoIndexName,pageNo,bulkResponse.buildFailureMessage()));
|
|
|
}
|
|
|
long end = System.currentTimeMillis();
|
...
|
...
|
|