From f3fd6cdef6bc36048c9042a96f762d0ae0f91de5 Mon Sep 17 00:00:00 2001 From: gaojuan Date: Wed, 9 Jun 2021 14:17:22 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=9B=91=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fangjia/script/gj/GaoDeMapCrawl.groovy | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy index 2ba2cdf53..e93f98720 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/gj/GaoDeMapCrawl.groovy @@ -3,6 +3,9 @@ package com.fangjia.script.gj import com.fangjia.core.ProvinceData import com.fangjia.core.RegionData import com.fangjia.httpclient.UserAgents +import com.fangjia.script.BaseBatch +import com.fangjia.script.BatchOwner +import com.fangjia.script.Watcher import com.fangjia.script.gj.paimai.GaoDeUtils import com.fangjia.script.util.CommonUtils import com.fangjia.script.util.JacksonUtil @@ -30,14 +33,15 @@ import java.util.regex.Matcher import java.util.regex.Pattern import java.util.zip.GZIPInputStream -class GaoDeMapCrawl { +@BatchOwner(Watcher.GaoJuan) +class GaoDeMapCrawl extends BaseBatch{ DBCollection BOUNDS_COLL = MongoUtils.getCollectionByName("fangjia_base", "city_bounds_box", "192.168.0.235", 27018) - static def targetUrl = "http://192.168.0.206:9200/amap_poi/_doc" + def targetUrl = "http://192.168.0.206:9200/amap_poi/_doc" - public static final def dbUrl = "mongodb://192.168.0.235:27018"; + final def dbUrl = "mongodb://192.168.0.235:27018"; - public static ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1) + ExecutorService fixedThreadPool = Executors.newFixedThreadPool(1) final AtomicInteger count = new AtomicInteger() def updateLists = [] def updateErrorLists = [] @@ -50,19 +54,13 @@ class GaoDeMapCrawl { def totalCount = new AtomicLong() static main(args) { - def task = new GaoDeMapCrawl(); - -// def citys = CommonUtils.findAllCity() -// def i =1 -// for(def city : citys){ -// i++ -// println i+" "+ city -// } - - task.run() -// task.allRun(); + runBatch(new GaoDeMapCrawl(), args) } + @Override + void process(Object args) { + run() + } def allRun(){ def cityLations = null; def stop = false;