def purgeMessage(mc, msg, custid): print "purgeMessage()" whereClause = "md.customer_id = " + str(custid) + " and md.m1_message_id=" + str(msg.getMessageId()) print "calling purge with", whereClause, "on part", msg.getPartitionId() partition = mc.getPartitionManager().getPartition(msg.getPartitionId()) pc = PurgeController(partition, whereClause) rc = pc.execute()
def purgeCleanUp(): try: log('purgeCleanUp(): invoking purge cleanup task(s)') PurgeController.afterPurges() except: log('Exception caught in PurgeController.afterPurges',sys.exc_info(),traceback.print_exc(file=sys.stderr)) log('purgeCleanUp(): done')
def runPurge(self,partition,purgeId,workDir): mc = ManagementContainer.getInstance() amsm = mc.getActiveMailboxStoreManager() spoolDir = PurgeController(partition,None).getSpoolDirectory().getCanonicalPath() start = int(time.time()) success = ps_SUCCESS try: # bring the remote job to the local directory where purge does its work self.importJobDirectory(spoolDir,workDir) # get expected size and report items = self.getNumItemsInJob(purgeId, workDir) log('Purge partition =',partition.getId(),'purgeId =',purgeId,'Expected Deletions =',items) # execute the purge if amsm.purgeExpiredMessagesV2(partition,PurgeController.getConfiguredPurgeStages(),purgeId,False): mc.getStatManager().logStat("purge-client-run-time-succeeded-" + str(partition.getId()), int(time.time()) - start) success = ps_SUCCESS # handles generic failure (including EMSDEV-10100) in purgeExpiredMessagesV2() else: mc.getStatManager().logStat("purge-client-run-time-failed-" + str(partition.getId()), int(time.time()) - start) log('Purge reported failure. Cleaning',workDir,'in preparation for redispatch...') success = ps_SHOULDDELETE # handles EMSDEV-10100 failure before purgeExpiredMessagesV2() except IllegalStateException, FileNotFoundException: mc.getStatManager().logStat("purge-client-run-time-failed-" + str(partition.getId()), int(time.time()) - start) log('Purge reported failure. Cleaning',workDir,'in preparation for redispatch...') success = ps_SHOULDDELETE
def purgeMessage(mc, msg, custid): whereClause = "md.customer_id = " + str(custid) + " and md.m1_message_id=" + str(msg.getMessageId()) partition = mc.getPartitionManager().getPartition(msg.getPartitionId()) pc = PurgeController(partition, whereClause) rc = pc.execute()