Package org.apache.sqoop.model

Examples of org.apache.sqoop.model.MSubmission


    }
  }

  @Override
  public boolean inUseJob(long jobId, Connection conn) {
    MSubmission submission = findSubmissionLastForJob(jobId, conn);

    // We have no submissions and thus job can't be in use
    if(submission == null) {
      return false;
    }

    // We can't remove running job
    if(submission.getStatus().isRunning()) {
      return true;
    }

    return false;
  }
View Full Code Here


   * @param conn Connection to metastore
   * @return Created MSubmission structure
   * @throws SQLException
   */
  private MSubmission loadSubmission(ResultSet rs, Connection conn) throws SQLException {
    MSubmission submission = new MSubmission();

    submission.setPersistenceId(rs.getLong(1));
    submission.setJobId(rs.getLong(2));
    submission.setStatus(SubmissionStatus.valueOf(rs.getString(3)));
    submission.setCreationDate(rs.getTimestamp(4));
    submission.setLastUpdateDate(rs.getTimestamp(5));
    submission.setExternalId(rs.getString(6));
    submission.setExternalLink(rs.getString(7));
    submission.setExceptionInfo(rs.getString(8));
    submission.setExceptionStackTrace(rs.getString(9));

    Counters counters = loadCountersSubmission(rs.getLong(1), conn);
    submission.setCounters(counters);

    return submission;
  }
View Full Code Here

    if (!line.hasOption(Constants.OPT_JID)) {
      printlnResource(Constants.RES_ARGS_JID_MISSING);
      return null;
    }

    MSubmission submission = client.startSubmission(getLong(line, Constants.OPT_JID));
    SubmissionDisplayer.display(submission);

    // Poll until finished
    if (line.hasOption(Constants.OPT_SYNCHRONOUS)) {
      long pollTimeout = POLL_TIMEOUT;
      if (line.hasOption(Constants.OPT_POLL_TIMEOUT)) {
        pollTimeout = Long.getLong(line.getOptionValue(Constants.OPT_POLL_TIMEOUT)).longValue();
      }
      while (submission.getStatus().isRunning()) {
        submission = client.getSubmissionStatus(getLong(line, Constants.OPT_JID));
        SubmissionDisplayer.display(submission);

        // Wait some time
        try {
View Full Code Here

    if (!line.hasOption(Constants.OPT_JID)) {
      printlnResource(Constants.RES_ARGS_JID_MISSING);
      return null;
    }

    MSubmission submission = client.getSubmissionStatus(getLong(line, Constants.OPT_JID));
    SubmissionDisplayer.display(submission);
    return null;
  }
View Full Code Here

    if (!line.hasOption(Constants.OPT_JID)) {
      printlnResource(Constants.RES_ARGS_JID_MISSING);
      return null;
    }

    MSubmission submission = client.stopSubmission(getLong(line, Constants.OPT_JID));
    SubmissionDisplayer.display(submission);
    return null;
  }
View Full Code Here

TOP

Related Classes of org.apache.sqoop.model.MSubmission

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.