예제 #1
0
    def processItems(self):
        crs = CachedResultSet(crsName)
        crs.restart()
        crsi = CachedResultSetIterator.wrapResultSet(crs)
        while crsi.hasNext():
            rs = crsi.next()
            if str(rs.getLong(1)) in self.myList:
                # at this point, we have a match! get to work
                self.processItem(rs)

        # now make sure our queue is empty... if it isn't, we failed validation
        for unfoundItem in self.myList:
            printErrorToRemigrate(unfoundItem, "Message passed in via command line file but NOT found in the CachedResultSet!")
예제 #2
0
    wThread = WorkerThread("Thread" + str(i), threadQueue)
    wThread.start()
    threadList.append(wThread)

# start a PrintThread
printThread = PrintThread(printQueue)
printThread.start()

infile = open(idFile,'r')
index = old_index = 0
runningCount = 0
queueToBuild = []

crs = CachedResultSet(crsName)
crs.restart()
crsi = CachedResultSetIterator.wrapResultSet(crs)
rs = crsi.next()
for line in infile:
    # first advance pointer thru CRS
    while rs.getLong(1) < long(str.strip(line)):
        if crsi.hasNext():
            rs = crsi.next()
        else:
            # if we get here, we're looking for something in the file that is greater
            # than anything in the CRS. This means failure. print message below
            continue

    # next, see if they now match. if they do, get to work. if not, throw an error
    if rs.getLong(1) == long(str.strip(line)):
        # build up a StoredMessage
        msgID = rs.getLong(1)