def logFailureList(): todaycode = SynchUtil.get_today() failpath = "/var/log/cronlogs/hdfs/lzoindexer/nolzolist_%s.txt" % (todaycode) hadJavaCall.runHadoopCall(FINDER_CLASS, [LZO_PATTERN, failpath])
def getPixelLogPath(pixid, opcode): logdir = "/mnt/data/userindex/%s/" % (SynchUtil.get_today()) if not os.path.exists(logdir): os.system("mkdir %s" % (logdir)) logpath = "%slog_%s_%s.txt" % (logdir, opcode, pixid) return logpath
for subpixdir in listset: pixpref = pixprefFromDir(subpixdir) hdfsdir = "/userindex/adaclass/%s/" % (pixpref) #rmcall = "hadoop fs -rmr %s hadcall = "hadoop fs -put %s%s/*.ser %s" % (locdir, subpixdir, hdfsdir) print "Upload call is %s" % (hadcall) os.system(hadcall) if __name__ == "__main__": daycode = SynchUtil.get_today() if len(sys.argv) < 2 else sys.argv[1] print "\nCalling for daycode %s" % (daycode) locadadir = "/mnt/data/userindex/%s/" % (daycode) listset = set() for onedir in os.listdir(locadadir): if "adaclass_" in onedir: serfiles = [onefile for onefile in os.listdir(locadadir + "/" + onedir) if ".ser" in onefile] if len(serfiles) > 0: print "Found directory %s with %d serfiles" % (onedir, len(serfiles))