Package org.apache.drill.exec.ref.exceptions

Examples of org.apache.drill.exec.ref.exceptions.SetupException


 
  public ReferenceStorageEngine getEngine(StorageEngineConfig engineConfig) throws SetupException{
    ReferenceStorageEngine engine = activeEngines.get(engineConfig);
    if(engine != null) return engine;
    Constructor<? extends ReferenceStorageEngine> c = availableEngines.get(engineConfig.getClass());
    if(c == null) throw new SetupException(String.format("Failure finding StorageEngine constructor for config %s", engineConfig));
    try {
      engine = c.newInstance(engineConfig, config);
      activeEngines.put(engineConfig,engine);
      return engine;
    } catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) {
      Throwable t = e instanceof InvocationTargetException ? ((InvocationTargetException)e).getTargetException() : e;
      if(t instanceof SetupException) throw ((SetupException) t);
      throw new SetupException(String.format("Failure setting up new storage engine configuration for config %s", engineConfig), t);
    }
  }
View Full Code Here


   
    try {
      URI u = new URI(engineConfig.root);
      String path = u.getPath();
     
      if(path.charAt(path.length()-1) != '/') throw new SetupException(String.format("The file root provided of %s included a file '%s'.  This must be a base path.", engineConfig.root, u.getPath()));
      fs = FileSystem.get(u, new Configuration());
      basePath = new Path(u.getPath());
    } catch (URISyntaxException | IOException e) {
      throw new SetupException("Failure while reading setting up file system root path.", e);
    }
  }
View Full Code Here

      evals.add(e.accept(this, null));
    }
    FunctionArguments args = new FunctionArguments(onlyConstants, includesAggregates, evals, call);

    if(call.getDefinition().isAggregating()){
      if(args.includesAggregates()) throw new SetupException(String.format("The call for %s contains one or more arguments that also contain aggregating functions.  An aggregating function cannot contain aggregating expressions.", call.getDefinition()));
      BasicEvaluator e = FunctionEvaluatorRegistry.getEvaluator(call.getDefinition().getName(), args, record);
      if(!(e instanceof AggregatingEvaluator ) ){
        throw new SetupException(String.format("Function %s is an aggregating function.  However, the provided evaluator (%s) is not an aggregating evaluator.", call.getDefinition(), e.getClass()));
      }
     
      aggregators.add( (AggregatingEvaluator) e);
      return e;
    }else{
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.ref.exceptions.SetupException

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.