add
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.fangjia.job.basicdata;
|
package com.fangjia.job.basicdata;
|
||||||
|
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.fangjia.job.basicdata.config;
|
package com.fangjia.job.basicdata.config;
|
||||||
|
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.fangjia.job.basicdata.config;
|
package com.fangjia.job.basicdata.config;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package org.fangjia.job.basicdata.job;
|
package com.fangjia.job.basicdata.job;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ public class EsfDealPriceSyncEsJob implements SimpleJob {
|
|||||||
@Override
|
@Override
|
||||||
public void execute(ShardingContext shardingContext) {
|
public void execute(ShardingContext shardingContext) {
|
||||||
DBCollection collection = businessMongoTemplate.getCollection("esf_deal_price_fj");
|
DBCollection collection = businessMongoTemplate.getCollection("esf_deal_price_fj");
|
||||||
DBCursor cursor = collection.find().batchSize(500).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
|
DBCursor cursor = collection.find().batchSize(1000).addOption(Bytes.QUERYOPTION_NOTIMEOUT);
|
||||||
BulkRequestBuilder bulkRequest = transportClient.prepareBulk();
|
BulkRequestBuilder bulkRequest = transportClient.prepareBulk();
|
||||||
int index = 0;
|
int index = 0;
|
||||||
AtomicInteger ac = new AtomicInteger();
|
AtomicInteger ac = new AtomicInteger();
|
||||||
@@ -52,7 +52,7 @@ public class EsfDealPriceSyncEsJob implements SimpleJob {
|
|||||||
.setSource(JsonUtils.toJson(data), XContentType.JSON)
|
.setSource(JsonUtils.toJson(data), XContentType.JSON)
|
||||||
.setId(id));
|
.setId(id));
|
||||||
index++;
|
index++;
|
||||||
if (index % 10000 == 0) {
|
if (index % 50000 == 0) {
|
||||||
bulkRequest.execute().actionGet();
|
bulkRequest.execute().actionGet();
|
||||||
logger.info("已导入:" + index);
|
logger.info("已导入:" + index);
|
||||||
// 清空数据
|
// 清空数据
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package org.fangjia.job.basicdata.job;
|
package com.fangjia.job.basicdata.job;
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<!-- 企业统计任务 每天0点1分执行 -->
|
<!-- 企业统计任务 每天0点1分执行 -->
|
||||||
<job:simple id="esfDealPriceSyncEsJob" class="org.fangjia.job.basicdata.job.EsfDealPriceSyncEsJob" registry-center-ref="regCenter"
|
<job:simple id="esfDealPriceSyncEsJob" class="com.fangjia.job.basicdata.job.EsfDealPriceSyncEsJob" registry-center-ref="regCenter"
|
||||||
sharding-total-count="1" cron="0/10 * * * * ?" sharding-item-parameters=""
|
sharding-total-count="1" cron="0/10 * * * * ?" sharding-item-parameters=""
|
||||||
failover="true" description="【基础数据处理任务】企业统计任务,每天0点1分开始执行,主要统计企业相关的数据,统计内容参考 EnterpriseStat"
|
failover="true" description="【基础数据处理任务】企业统计任务,每天0点1分开始执行,主要统计企业相关的数据,统计内容参考 EnterpriseStat"
|
||||||
overwrite="true" event-trace-rdb-data-source="elasticJobLog">
|
overwrite="true" event-trace-rdb-data-source="elasticJobLog">
|
||||||
|
|||||||
Reference in New Issue
Block a user