Examples of DrillConfigurationException


Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    return new DrillConfig(c);
  }
 
  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if(className == null) throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
    try{
      Class<?> c = Class.forName(className);
      if(clazz.isAssignableFrom(c)){
        @SuppressWarnings("unchecked") Class<T> t = (Class<T>) c;
        return t;
      }else{
        throw new DrillConfigurationException(String.format("The class [%s] listed at location '%s' should be of type [%s].  It isn't.", className, location, clazz.getCanonicalName()));
      }
    }catch(Exception ex){
      if(ex instanceof DrillConfigurationException) throw (DrillConfigurationException) ex;
      throw new DrillConfigurationException(String.format("Failure while initializing class [%s] described at configuration value '%s'.", className, location), ex);
    }
   
  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    Class<T> c = getClassAt(location, clazz);
    try{
      T t = c.newInstance();
      return t;
    }catch(Exception ex){
      throw new DrillConfigurationException(String.format("Failure while instantiating class [%s] located at '%s.", clazz.getCanonicalName(), location), ex);
    }
  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if (className == null) {
      throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
    }
    try{
      Class<?> c = Class.forName(className);
      if (clazz.isAssignableFrom(c)) {
        @SuppressWarnings("unchecked") Class<T> t = (Class<T>) c;
        return t;
      } else {
        throw new DrillConfigurationException(String.format("The class [%s] listed at location '%s' should be of type [%s].  It isn't.", className, location, clazz.getCanonicalName()));
      }
    } catch (Exception ex) {
      if (ex instanceof DrillConfigurationException) {
        throw (DrillConfigurationException) ex;
      }
      throw new DrillConfigurationException(String.format("Failure while initializing class [%s] described at configuration value '%s'.", className, location), ex);
    }

  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    Class<T> c = getClassAt(location, clazz);
    try {
      T t = c.newInstance();
      return t;
    } catch (Exception ex) {
      throw new DrillConfigurationException(String.format("Failure while instantiating class [%s] located at '%s.", clazz.getCanonicalName(), location), ex);
    }
  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    return new DrillConfig(effectiveConfig.resolve(), enableServerConfigs);
  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if(className == null) throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
    try{
      Class<?> c = Class.forName(className);
      if(clazz.isAssignableFrom(c)){
        @SuppressWarnings("unchecked") Class<T> t = (Class<T>) c;
        return t;
      }else{
        throw new DrillConfigurationException(String.format("The class [%s] listed at location '%s' should be of type [%s].  It isn't.", className, location, clazz.getCanonicalName()));
      }
    }catch(Exception ex){
      if(ex instanceof DrillConfigurationException) throw (DrillConfigurationException) ex;
      throw new DrillConfigurationException(String.format("Failure while initializing class [%s] described at configuration value '%s'.", className, location), ex);
    }

  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    Class<T> c = getClassAt(location, clazz);
    try{
      T t = c.newInstance();
      return t;
    }catch(Exception ex){
      throw new DrillConfigurationException(String.format("Failure while instantiating class [%s] located at '%s.", clazz.getCanonicalName(), location), ex);
    }
  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    return new DrillConfig(effectiveConfig.resolve(), enableServerConfigs);
  }

  public <T> Class<T> getClassAt(String location, Class<T> clazz) throws DrillConfigurationException{
    String className = this.getString(location);
    if(className == null) throw new DrillConfigurationException(String.format("No class defined at location '%s'.  Expected a definition of the class []", location, clazz.getCanonicalName()));
    try{
      Class<?> c = Class.forName(className);
      if(clazz.isAssignableFrom(c)){
        @SuppressWarnings("unchecked") Class<T> t = (Class<T>) c;
        return t;
      }else{
        throw new DrillConfigurationException(String.format("The class [%s] listed at location '%s' should be of type [%s].  It isn't.", className, location, clazz.getCanonicalName()));
      }
    }catch(Exception ex){
      if(ex instanceof DrillConfigurationException) throw (DrillConfigurationException) ex;
      throw new DrillConfigurationException(String.format("Failure while initializing class [%s] described at configuration value '%s'.", className, location), ex);
    }

  }
View Full Code Here

Examples of org.apache.drill.common.exceptions.DrillConfigurationException

    Class<T> c = getClassAt(location, clazz);
    try{
      T t = c.newInstance();
      return t;
    }catch(Exception ex){
      throw new DrillConfigurationException(String.format("Failure while instantiating class [%s] located at '%s.", clazz.getCanonicalName(), location), ex);
    }
  }
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.