Exemple #1
0
 @Override
 public String constructKey(BSPJobID jobId, String... args) {
   StringBuffer keyBuffer = new StringBuffer(100);
   keyBuffer.append(bspRoot);
   if (jobId != null) keyBuffer.append("/").append(jobId.toString());
   for (String arg : args) {
     keyBuffer.append("/").append(arg);
   }
   return keyBuffer.toString();
 }
Exemple #2
0
 public JobLog(BSPJobID jobId) {
   try {
     this.jobId = jobId.toString();
     this.sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     File file = new File(LOG_DIR, this.jobId);
     if (!file.exists()) {
       file.createNewFile();
     }
     FileWriter fw = new FileWriter(file, true);
     bw = new BufferedWriter(fw);
   } catch (IOException ioe) {
     // TODO
   }
 }