diff --git a/deliverables/k8s/fangjia-open.yaml b/deliverables/k8s/fangjia-open.yaml index 09660e137..b05a98219 100644 --- a/deliverables/k8s/fangjia-open.yaml +++ b/deliverables/k8s/fangjia-open.yaml @@ -21,6 +21,15 @@ spec: project: fangjia-open app: fangjia spec: + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: NotIn + values: + - "sha-216" imagePullSecrets: - name: nexus-registry-secret containers: diff --git a/projects/fangjia-script/src/main/groovy/com/fangjia/script/dataAna/CityInfoAnaBatch.groovy b/projects/fangjia-script/src/main/groovy/com/fangjia/script/dataAna/CityInfoAnaBatch.groovy index 004acafbe..7ed60d3aa 100644 --- a/projects/fangjia-script/src/main/groovy/com/fangjia/script/dataAna/CityInfoAnaBatch.groovy +++ b/projects/fangjia-script/src/main/groovy/com/fangjia/script/dataAna/CityInfoAnaBatch.groovy @@ -370,7 +370,7 @@ class CityInfoAnaBatch extends BaseBatch { @Override void run() { try { - DSCursor dsCursor = SEAWEED.find(new BasicDBObject('visible', 0).append('cat', 'district').append('city', city), new BasicDBObject("city", 1).append("region", 1).append("name", 1).append("alias", 1)).batchSize(1000) + def dsCursor = SEAWEED.find(new BasicDBObject('visible', 0).append('cat', 'district').append('city', city), new BasicDBObject("city", 1).append("region", 1).append("name", 1).append("alias", 1)).batchSize(1000) Iterator iter = dsCursor.iterator(); while(iter.hasNext()){ DBObject obj = iter.next() @@ -428,7 +428,7 @@ class CityInfoAnaBatch extends BaseBatch { queryDistrict.put('city', city) - DSCursor dsCursor = SEAWEED.find(queryDistrict, new BasicDBObject("city", 1).append("region", 1).append("name", 1).append("alias", 1)).batchSize(2000) + def dsCursor = SEAWEED.find(queryDistrict, new BasicDBObject("city", 1).append("region", 1).append("name", 1).append("alias", 1)).batchSize(2000) Iterator iter = dsCursor.iterator(); List findDistricts = Lists.newArrayList() while(iter.hasNext()){ @@ -1007,7 +1007,7 @@ class CityInfoAnaBatch extends BaseBatch { query.put('visible', 0); DBObject fields = new BasicDBObject() fields.put("alias", 1) - DSCursor cur = SEAWEED.find(query, fields).batchSize(2000) + def cur = SEAWEED.find(query, fields).batchSize(2000) Iterator iter = cur.iterator() def aliasCount = 0 while(iter.hasNext()) { @@ -1030,7 +1030,7 @@ class CityInfoAnaBatch extends BaseBatch { fields.put(key, 1) } - DSCursor cur = SEAWEED.find(query, fields).batchSize(2000) + def cur = SEAWEED.find(query, fields).batchSize(2000) Iterator iter = cur.iterator() def countMap = [:] while(iter.hasNext()) { @@ -1089,7 +1089,7 @@ class CityInfoAnaBatch extends BaseBatch { fields.put("name", 1) def facilityMap = findFacilityByCity(cityName) - DSCursor cur = SEAWEED.find(query, fields).batchSize(2000) + def cur = SEAWEED.find(query, fields).batchSize(2000) Iterator iter = cur.iterator() def countMap = [:]