Examples of ExportException


Examples of com.cloudera.sqoop.util.ExportException

      throws IOException, ExportException {
    if (options.getNumMappers() > 1) {
      String msg = "Netezza update with multiple mappers can lead to "
          + "inconsistencies - Please set num-mappers option to 1 in the SQOOP "
          + "command line for update jobs with Netezza and SQOOP";
      throw new ExportException(msg);
    }

    if (!options.isBatchMode()) {
      if (!NetezzaManager.batchModeWarningPrinted) {
        LOG.warn("It looks like you are exporting to Netezza in non-batch ");
View Full Code Here

Examples of com.cloudera.sqoop.util.ExportException

      cacheJars(job, context.getConnManager());
      setJob(job);

      boolean success = runJob(job);
      if (!success) {
        throw new ExportException("Export job failed!");
      }
    } catch (InterruptedException ie) {
      throw new IOException(ie);
    } catch (ClassNotFoundException cnfe) {
      throw new IOException(cnfe);
View Full Code Here

Examples of com.cloudera.sqoop.util.ExportException

   * Export data stored in HDFS into a table in a database.
   * This inserts new rows into the target table.
   */
  public void exportTable(com.cloudera.sqoop.manager.ExportJobContext context)
      throws IOException, ExportException {
    throw new ExportException("This database does not support exports");
  }
View Full Code Here

Examples of com.cloudera.sqoop.util.ExportException

   * Export data stored in HDFS into a table in a database. This calls a stored
   * procedure to insert rows into the target table.
   */
  public void callTable(com.cloudera.sqoop.manager.ExportJobContext context)
      throws IOException, ExportException {
    throw new ExportException("This database does not support exports "
        + "using stored procedures");
  }
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    String exportFormat = htmlTable.getTableConfiguration().getCurrentExportFormat();
    ExportConf exportConf = htmlTable.getTableConfiguration().getExportConfiguration().get(exportFormat);

    String exportClassName = exportConf.getExportClass();
    if (exportClassName == null) {
      throw new ExportException("No export class has been configured for the '" + exportFormat
          + "' format. Please configure it before exporting.");
    }
    logger.debug("Selected export class: {}", exportClassName);

    // Check that the class can be instantiated
    if (!ClassUtils.isPresent(exportClassName)) {
      StringBuilder sb = new StringBuilder("Unable to export in the ");
      sb.append(exportFormat);
      sb.append(" format because either the export class '");
      sb.append(exportClassName);
      sb.append("' or some other librairies ");
      sb.append(" imported in the export class is not present in the classpath.");
      sb.append("Did you forget to add a dependency?");
      throw new ExportException(sb.toString());
    }

    // Instantiates the export class and processes the export
    Class<?> exportClass = null;
    Object obj = null;
    try {
      exportClass = ClassUtils.getClass(exportClassName);
      obj = ClassUtils.getNewInstance(exportClass);
    } catch (ClassNotFoundException e) {
      throw new ExportException("Unable to load the class '" + exportClassName + "'", e);
    } catch (InstantiationException e) {
      throw new ExportException("Unable to instanciate the class '" + exportClassName + "'", e);
    } catch (IllegalAccessException e) {
      throw new ExportException("Unable to access the class '" + exportClassName + "'", e);
    }

    ((DatatablesExport) obj).initExport(htmlTable);
    ((DatatablesExport) obj).processExport(stream);
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    } catch (XMLStreamException e) {
      StringBuilder sb = new StringBuilder("Something went wrong during the XML generation of the table '");
      sb.append(table.getOriginalId());
      sb.append("' and with the following export configuration: ");
      sb.append(exportConf.toString());
      throw new ExportException(sb.toString(), e);
    }
    finally {
      try {
        writer.close();
      } catch (XMLStreamException e) {
        StringBuilder sb = new StringBuilder("Something went wrong during the XML generation of the table '");
        sb.append(table.getOriginalId());
        sb.append("' and with the following export configuration: ");
        sb.append(exportConf.toString());
        throw new ExportException(sb.toString(), e);
      }
    }
  }
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    } catch (IOException e) {
      StringBuilder sb = new StringBuilder("Something went wrong during the CSV generation of the table '");
      sb.append(table.getOriginalId());
      sb.append("' and with the following export configuration: ");
      sb.append(exportConf.toString());
      throw new ExportException(sb.toString(), e);
    }
  }
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    ByteArrayOutputStream stream = new ByteArrayOutputStream();
    String exportClass = exportConf.getExportClass();

    // Check whether the class can be instantiated
    if (!ClassUtils.isPresent(exportClass)) {
      throw new ExportException("Unable to export in " + exportConf.getFormat()
          + " format because the export class cannot be found. Did you forget to add an extra dependency?");
    }

    Class<?> klass = null;
    DatatablesExport export = null;
    try {
      klass = ClassUtils.getClass(exportClass);
      export = (DatatablesExport) ClassUtils.getNewInstance(klass);
    } catch (ClassNotFoundException e) {
      throw new ExportException("Unable to load the class '" + exportClass + "'", e);
    } catch (InstantiationException e) {
      throw new ExportException("Unable to instanciate the class '" + exportClass + "'", e);
    } catch (IllegalAccessException e) {
      throw new ExportException("Unable to access the class '" + exportClass + "'", e);
    }
   
    export.initExport(table);
    export.processExport(stream);
       
    try {
      writeToResponse(response, stream, exportConf.getFileName() + "." + exportConf.getFileExtension(),
          exportConf.getMimeType());
    } catch (IOException e) {
      throw new ExportException(
          "Unable to write to response using the " + exportClass.getClass().getSimpleName(), e);
    }
  }
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    } catch (DocumentException e) {
      StringBuilder sb = new StringBuilder("Something went wrong during the PDF generation of the table '");
      sb.append(table.getOriginalId());
      sb.append("' and with the following export configuration: ");
      sb.append(exportConf.toString());
      throw new ExportException(sb.toString(), e);
    } finally {
      document.close();
    }
  }
View Full Code Here

Examples of com.github.dandelion.datatables.core.exception.ExportException

    } catch (IOException e) {
      StringBuilder sb = new StringBuilder("Something went wrong during the XLS generation of the table '");
      sb.append(table.getOriginalId());
      sb.append("' and with the following export configuration: ");
      sb.append(exportConf.toString());
      throw new ExportException(sb.toString(), e);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.