Package co.cask.cdap.api.dataset.module

Examples of co.cask.cdap.api.dataset.module.DatasetModule


          throw Throwables.propagate(e);
        }
      }

      try {
        DatasetModule module = DatasetModules.getDatasetModule(moduleClass);
        module.register(registry);
      } catch (Exception e) {
        LOG.error("Was not able to load dataset module class {} while trying to load type {}",
                  moduleMeta.getClassName(), implementationInfo, e);
        throw Throwables.propagate(e);
      }
View Full Code Here


   * @return {@link DatasetModule} instance
   */
  public static DatasetModule getDatasetModule(Class clazz)
    throws ClassNotFoundException, InstantiationException, IllegalAccessException {

    DatasetModule module;
    if (DatasetModule.class.isAssignableFrom(clazz)) {
      module = (DatasetModule) clazz.newInstance();
    } else if (Dataset.class.isAssignableFrom(clazz)) {
      module = new SingleTypeModule(clazz);
    } else {
View Full Code Here

          throw Throwables.propagate(e);
        }
      }

      try {
        DatasetModule module = DatasetModules.getDatasetModule(moduleClass);
        module.register(registry);
      } catch (Exception e) {
        LOG.error("Was not able to load dataset module class {}", moduleClassName, e);
        throw Throwables.propagate(e);
      }
    }
View Full Code Here

            LOG.warn(msg);
            throw new DatasetModuleConflictException(msg);
          }

          ClassLoader cl;
          DatasetModule module;
          File unpackedLocation = Files.createTempDir();
          DependencyTrackingRegistry reg;
          try {
            // NOTE: if jarLocation is null, we assume that this is a system module, ie. always present in classpath
            if (jarLocation != null) {
              BundleJarUtil.unpackProgramJar(jarLocation, unpackedLocation);
            }
            cl = jarLocation == null ? this.getClass().getClassLoader() :
              ClassLoaders.newProgramClassLoader(unpackedLocation, ApiResourceListHolder.getResourceList(),
                                                 this.getClass().getClassLoader());
            @SuppressWarnings("unchecked")
            Class clazz = ClassLoaders.loadClass(className, cl, this);
            module = DatasetModules.getDatasetModule(clazz);
            reg = new DependencyTrackingRegistry(datasets);
            module.register(reg);
          } catch (Exception e) {
            LOG.error("Could not instantiate instance of dataset module class {} for module {} using jarLocation {}",
                      className, name, jarLocation);
            throw Throwables.propagate(e);
          } finally {
View Full Code Here

          BundleJarUtil.unpackProgramJar(locationFactory.create(moduleMeta.getJarLocation()), temp);
          classLoader = ClassLoaders.newProgramClassLoader(temp, ApiResourceListHolder.getResourceList(),
                                                           this.getClass().getClassLoader());
        }
        Class<?> moduleClass = ClassLoaders.loadClass(moduleMeta.getClassName(), classLoader, this);
        DatasetModule module = DatasetModules.getDatasetModule(moduleClass);
        module.register(registry);
      }
    } catch (Exception e) {
      LOG.warn("Exception while loading DatasetDefinition for DatasetTypeMeta : {}", meta.getName());
    } finally {
      try {
View Full Code Here

TOP

Related Classes of co.cask.cdap.api.dataset.module.DatasetModule

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.