Пример #1
0
    @Override
    public void map(
        LongWritable key, Text value, OutputCollector<Writable, Writable> out, Reporter reporter)
        throws IOException {
      try {
        String task = value.toString();
        LOG.info("Running cleanup task: " + task + " (" + _dir + ") ... ");

        int count = LocalFileUtils.cleanupRcWorkingDirectory(_dir);
        LOG.info("Done - deleted " + count + " files.");
      } catch (Exception ex) {
        // throw IO exception to adhere to API specification
        throw new IOException("Failed to execute cleanup task.", ex);
      }
    }