Package co.cask.cdap.api.data

Examples of co.cask.cdap.api.data.DataSetInstantiationException


      try {
        Dataset dataset = datasetFramework.getDataset(name, arguments,
                                                      programClassLoader);
        if (dataset == null) {
          throw new DataSetInstantiationException(String.format("Dataset %s does not exist.", name));
        }
        context.addTransactionAware((TransactionAware) dataset);
        return (T) dataset;
      } catch (DatasetManagementException e) {
        LOG.error("Could not get dataset metainfo.");
View Full Code Here


    throws DataSetInstantiationException {

    T dataset;
    try {
      if (!datasetFramework.hasInstance(datasetName)) {
        throw new DataSetInstantiationException("Trying to access dataset that does not exist: " + datasetName);
      }

      dataset = datasetFramework.getDataset(datasetName, arguments, classLoader);
      if (dataset == null) {
        throw new DataSetInstantiationException("Failed to access dataset: " + datasetName);
      }

    } catch (Exception e) {
      throw new DataSetInstantiationException("Failed to access dataset: " + datasetName, e);
    }

    if (dataset instanceof TransactionAware) {
      txAware.add((TransactionAware) dataset);
      txAwareToMetricNames.put((TransactionAware) dataset, datasetName);
View Full Code Here

   * responsible for throwing the exception.
   */
  private DataSetInstantiationException logAndException(Throwable e, String message, Object... params)
    throws DataSetInstantiationException {
    String msg;
    DataSetInstantiationException exn;
    if (e == null) {
      msg = String.format("Error instantiating data set: %s", String.format(message, params));
      exn = new DataSetInstantiationException(msg);
      LOG.error(msg);
    } else {
      msg = String.format("Error instantiating data set: %s. %s", String.format(message, params), e.getMessage());
      if (e instanceof DataSetInstantiationException) {
        exn = (DataSetInstantiationException) e;
      } else {
        exn = new DataSetInstantiationException(msg, e);
      }
      LOG.error(msg, e);
    }
    return exn;
  }
View Full Code Here

TOP

Related Classes of co.cask.cdap.api.data.DataSetInstantiationException

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.