def __init__(self, mq, conn):
        self.mq = mq
        self.cpuPool = Pool(ncpu)
        self.conn = conn
        self.resultMap = {}

        infolog.info('WordAnalyzing Initialized')
示例#2
0
    def __init__(self, mq, conn):
        self.mq = mq
        self.cpuPool = Pool(ncpu)
        self.conn = conn
        self.resultMap = {}

        infolog.info('WordAnalyzing Initialized')
示例#3
0
 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')
示例#6
0
 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')
示例#7
0
 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)
示例#9
0
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)
示例#10
0
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)
示例#11
0
 def __init__(self, allFiles, mq):
     self.allFiles = allFiles
     self.mq = mq
     self.ioPool = Pool(ncpu*3)
     infolog.info('WordReading Initialized')
示例#12
0
 def __init__(self, qIn, threadID):
     threading.Thread.__init__(self)
     self.qIn = qIn
     self.threadID = threadID
     self.result = {}
     infolog.info('WordAnalyzing Initialized')
示例#13
0
 def __init__(self, allFiles, mq):
     self.allFiles = allFiles
     self.mq = mq
     self.ioPool = Pool(ncpu*3)
     infolog.info('WordReading Initialized')