|
def | __init__ (self) |
|
def | process (self, attrFetches, queryCallback) |
|
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) |
|
Definition at line 20 of file AttrFetchTask.py.
◆ __init__()
def dc_db.AttrFetchTask.AttrFetchTask.__init__ |
( |
|
self | ) |
|
◆ fetchUrlsAttributes()
def dc_db.AttrFetchTask.AttrFetchTask.fetchUrlsAttributes |
( |
|
siteId, |
|
|
|
urlMd5, |
|
|
|
queryCallback |
|
) |
| |
|
static |
Definition at line 69 of file AttrFetchTask.py.
69 def fetchUrlsAttributes(siteId, urlMd5, queryCallback):
70 attrFetchTask = AttrFetchTask()
72 return attrFetchTask.process(attrFetches, queryCallback)
◆ fetchUrlsAttributesByNames()
def dc_db.AttrFetchTask.AttrFetchTask.fetchUrlsAttributesByNames |
( |
|
siteId, |
|
|
|
urlMd5, |
|
|
|
queryCallback, |
|
|
|
attributeNames |
|
) |
| |
|
static |
Definition at line 83 of file AttrFetchTask.py.
83 def fetchUrlsAttributesByNames(siteId, urlMd5, queryCallback, attributeNames):
87 attributes = AttrFetchTask.fetchUrlsAttributes(siteId, urlMd5, queryCallback)
88 if isinstance(attributeNames, list):
90 if '*' in attributeNames:
95 for attribute
in attributes:
96 if attribute.name
in attributeNames:
97 localAttributes.append(attribute)
◆ process()
def dc_db.AttrFetchTask.AttrFetchTask.process |
( |
|
self, |
|
|
|
attrFetches, |
|
|
|
queryCallback |
|
) |
| |
Definition at line 35 of file AttrFetchTask.py.
35 def process(self, attrFetches, queryCallback):
37 for attrFetch
in attrFetches:
38 if self.isSiteExist(attrFetch.siteId, queryCallback):
41 if attrFetch.name
is None:
42 additionWhere = self.generateCriterionSQL(attrFetch.criterions)
44 additionWhere = (
"WHERE `Name` = '%s'" % attrFetch.name)
45 logger.debug(
">>> additionWhere = " + str(additionWhere))
46 if additionWhere
is not None and len(additionWhere) > 0:
47 query = AttrFetchTask.ATTR_FETCH_TEMPLATE % (Constants.DC_ATT_TABLE_NAME_TEMPLATE % attrFetch.siteId)
48 res = queryCallback(query + additionWhere, Constants.ATT_DB_ID, Constants.EXEC_NAME)
49 if res
is not None and len(res) > 0:
52 attribute.urlMd5 = elem[
"URLMd5"]
53 attribute.value = elem[
"Value"]
54 attribute.cDate = elem[
"CDate"]
56 except Exception
as excp:
57 logger.debug(
">>> [AttributeFetch] Some Exception = " + str(
type(excp)) +
" " + str(excp))
◆ ATTR_FETCH_TEMPLATE
string dc_db.AttrFetchTask.AttrFetchTask.ATTR_FETCH_TEMPLATE = "SELECT * FROM `%s` " |
|
static |
The documentation for this class was generated from the following file: