@Override
  public long createLineage(
      List<String> inputFiles, List<String> outputFiles, CommandLineJobInfo jobInfo)
      throws AlluxioTException, ThriftIOException {
    // deserialization
    List<AlluxioURI> inputFilesUri = Lists.newArrayList();
    for (String inputFile : inputFiles) {
      inputFilesUri.add(new AlluxioURI(inputFile));
    }
    List<AlluxioURI> outputFilesUri = Lists.newArrayList();
    for (String outputFile : outputFiles) {
      outputFilesUri.add(new AlluxioURI(outputFile));
    }

    CommandLineJob job =
        new CommandLineJob(jobInfo.getCommand(), new JobConf(jobInfo.getConf().getOutputFile()));
    try {
      return mLineageMaster.createLineage(inputFilesUri, outputFilesUri, job);
    } catch (AlluxioException e) {
      throw e.toAlluxioTException();
    } catch (IOException e) {
      throw new ThriftIOException(e.getMessage());
    }
  }
예제 #2
0
 /**
  * Creates a new instance of {@link CommandLineJobInfo} from a thrift representation.
  *
  * @param commandLineJobInfo the thrift representation of a lineage command-line job descriptor
  */
 protected CommandLineJobInfo(alluxio.thrift.CommandLineJobInfo commandLineJobInfo) {
   mCommand = commandLineJobInfo.getCommand();
   mConf = new JobConfInfo(commandLineJobInfo.getConf());
 }