def __init__(self, mq, conn): self.mq = mq self.cpuPool = Pool(ncpu) self.conn = conn self.resultMap = {} infolog.info('WordAnalyzing Initialized')
def __init__(self, dirpath, qOut, threadID, fileFilterFunc=None): threading.Thread.__init__(self) self.dirpath = dirpath self.fileFilterFunc = fileFilterFunc self.qOut = qOut self.threadID = threadID infolog.info('FileObtainer Initialized')
def __init__(self, qIn, qOut, threadID): threading.Thread.__init__(self) self.qIn = qIn self.qOut = qOut self.threadID = threadID self.threads = [] infolog.info('WordReading Initialized')
def __init__(self, qIn, threadID): threading.Thread.__init__(self) self.qIn = qIn self.threadID = threadID self.resultMap = {} self.pool = Pool(cpu_count()) infolog.info('WordAnalyzing Initialized')
def readFile(filename, qOut): try: f = open(filename, 'r') lines = f.readlines() infolog.info('[successful read file %s]\n' % filename) f.close() except IOError, err: errorInfo = 'file %s Not found \n' % filename errlog.error(errorInfo)
class WordReading(threading.Thread): def __init__(self, qIn, qOut, threadID): threading.Thread.__init__(self) self.qIn = qIn self.qOut = qOut self.threadID = threadID infolog.info('WordReading Initialized') def readFileInternal(self): lines = [] try: filename = self.qIn.get(True, timeoutInSecs) #print filename except Queue.Empty, emp: errlog.error('In WordReading:' + str(emp)) return None try: f = open(filename, 'r') lines = f.readlines() infolog.info('[successful read file %s]\n' % filename) f.close() except IOError, err: errorInfo = 'file %s Not found \n' % filename errlog.error(errorInfo)
def __init__(self, allFiles, mq): self.allFiles = allFiles self.mq = mq self.ioPool = Pool(ncpu*3) infolog.info('WordReading Initialized')
def __init__(self, qIn, threadID): threading.Thread.__init__(self) self.qIn = qIn self.threadID = threadID self.result = {} infolog.info('WordAnalyzing Initialized')