code: public void upload() {
      try {
        writer.flush();
        if (compress)
          zipCompress(filename);
        String remoteName = "failmon-";
        if ("true".equalsIgnoreCase(Environment.getProperty("anonymizer.hash.hostnames")))
          remoteName += Anonymizer.getMD5Hash(InetAddress.getLocalHost().getCanonicalHostName()) + "-";
        else
          remoteName += InetAddress.getLocalHost().getCanonicalHostName() + "-"; 
        remoteName += Calendar.getInstance().getTimeInMillis();//.toString();
        if (compress)
  	copyToHDFS(filename + COMPRESSION_SUFFIX, hdfsDir + "/" + remoteName + COMPRESSION_SUFFIX);
        else
  	copyToHDFS(filename, hdfsDir + "/" + remoteName);
      } catch (IOException e) {
        e.printStackTrace();
      }
  
      // delete and re-open
      try {
        fw.close();
        fw = new FileWriter(filename);
        writer = new BufferedWriter(fw);
      } catch (IOException e) {
        e.printStackTrace();
      }
    }
docs: Upload the local file store into HDFS, after it
  compressing it. Then a new local file is created
  as a temporary record store.