HCE Project Python language Distributed Tasks Manager Application, Distributed Crawler Application and client API bindings.  2.0.0-chaika
Hierarchical Cluster Engine Python language binding
dc_db.ProxyDeleteTask.ProxyDeleteTask Class Reference
Inheritance diagram for dc_db.ProxyDeleteTask.ProxyDeleteTask:
Collaboration diagram for dc_db.ProxyDeleteTask.ProxyDeleteTask:

Public Member Functions

def __init__ (self)
 
def process (self, proxyDeletes, queryCallback)
 
def deleteProxy (self, localProxy, queryCallback)
 
- Public Member Functions inherited from dc_db.BaseTask.BaseTask
def isSiteExist (self, siteId, queryCallback, userId=None)
 
def generateCriterionSQL (self, criterions, additionWhere=None, siteId=None)
 
def fetchByCriterions (self, criterions, queryCallback)
 
def dbLock (self, mutexName, queryCallback, sleepTime=1, mutexLockTTL=Constants.DEFAULT_LOCK_TTL)
 
def dbUnlock (self, mutexName, queryCallback)
 
def createUrlsInsertQuery (self, siteId, localKeys, localValues)
 
def copyUrlsToDcUrls (self, siteId, queryCallback)
 
def statisticLogUpdate (self, localObj, urlMd5, siteId, status, queryCallback, isInsert=False)
 
def calculateMd5FormUrl (self, url, urlType, useNormilize=False)
 

Additional Inherited Members

- Static Public Member Functions inherited from dc_db.BaseTask.BaseTask
def readValueFromSiteProp (siteId, propName, queryCallback, urlMd5=None)
 

Detailed Description

Definition at line 22 of file ProxyDeleteTask.py.

Constructor & Destructor Documentation

◆ __init__()

def dc_db.ProxyDeleteTask.ProxyDeleteTask.__init__ (   self)

Definition at line 27 of file ProxyDeleteTask.py.

27  def __init__(self):
28  super(ProxyDeleteTask, self).__init__()
29 
30 
def __init__(self)
constructor
Definition: UIDGenerator.py:19

Member Function Documentation

◆ deleteProxy()

def dc_db.ProxyDeleteTask.ProxyDeleteTask.deleteProxy (   self,
  localProxy,
  queryCallback 
)

Definition at line 65 of file ProxyDeleteTask.py.

65  def deleteProxy(self, localProxy, queryCallback):
66  DELETE_PROXY_TEMPLATE = "DELETE FROM `sites_proxy` WHERE `Site_Id` = '%s' AND `Host` = '%s'"
67  query = DELETE_PROXY_TEMPLATE % (localProxy.siteId, localProxy.host)
68  queryCallback(query, Constants.PRIMARY_DB_ID)
69  return True
70 
Here is the caller graph for this function:

◆ process()

def dc_db.ProxyDeleteTask.ProxyDeleteTask.process (   self,
  proxyDeletes,
  queryCallback 
)

Definition at line 36 of file ProxyDeleteTask.py.

36  def process(self, proxyDeletes, queryCallback):
37  generalResponse = GeneralResponse()
38  for proxyDelete in proxyDeletes:
39  localProxyDeletes = []
40  if proxyDelete.siteId is None or proxyDelete.host is None and proxyDelete.criterions is not None:
41  result = ProxyStatusTask.execCriterion(proxyDelete, queryCallback, proxyDelete.siteId)
42  for elem in result:
43  localProxy = copy.deepcopy(proxyDelete)
44  if localProxy.siteId is None:
45  localProxy.siteId = elem["Site_Id"]
46  if localProxy.host is None:
47  localProxy.host = elem["Host"]
48  localProxyDeletes.append(localProxy)
49  else:
50  localProxyDeletes.append(proxyDelete)
51  logger.debug(">>> len(localProxyStatuses) = " + str(len(localProxyDeletes)))
52  for localProxy in localProxyDeletes:
53  if self.deleteProxy(localProxy, queryCallback):
54  generalResponse.statuses.append(True)
55  else:
56  generalResponse.statuses.append(False)
57  return generalResponse
58 
59 
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: