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

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


  @Override
  protected void setupEvals(EvaluatorFactory builder) throws SetupException {
    try {
      setupSink();
    } catch (IOException e) {
      throw new SetupException(String.format("failure setting up %s sink rop.", this.getClass()), e);
    }
  }
View Full Code Here


    map.putAll(op2, ops1);
  }
 
  public List<RecordIterator> getOperator(LogicalOperator o){
//    logger.debug("Getting iterator for Logical Operator {}", o);
    if(o == null) throw new SetupException("You requested a Iterator list for a null operator.  This doesn't make any sense.");
    List<ROP> refOps = map.get(o);
    List<RecordIterator> iterators = new ArrayList<RecordIterator>(refOps.size());
    for(ROP r : refOps){
      RecordIterator iterator = r.getOutput();
      if(iterator == null) throw new SetupException(String.format("The provided iterator for the reference operator %s is null.", r));
      iterators.add(iterator);
    }
    return iterators;
  }
View Full Code Here

  protected void setupIterators(IteratorRegistry registry) {
    List<RecordIterator> iters = registry.getOperator(config.getInput());
    if(iters.size() != 1) throw new IllegalArgumentException(String.format("Expected one input iterator for class %s.  Received %d", this.getClass().getCanonicalName(), iters.size()));
    RecordIterator i = iters.get(0);
    this.record = i.getRecordPointer();
    if(record == null) throw new SetupException(String.format("The %s op iterator return a null record pointer.", i.getParent()));
    setInput(i);
  }
View Full Code Here

    try{
      super.setupIterators(registry);
      reader = engine.getReader(entry, this);
      reader.setup();
    }catch(IOException e){
      throw new SetupException(String.format("Failure while setting up reader for Entry %s.", entry), e);
    }
  }
View Full Code Here

  /**
   * Return this single argument evaluator in this set of evaluators.  If there isn't exactly one, throw a SetupException
   * @return The single evaluator.
   */
  public BasicEvaluator getOnlyEvaluator() throws SetupException{
    if(ev.size() != 1) throw new SetupException(String.format("Looking for a single argument.  Received %d arguments.", ev.size()));
    return ev.get(0);
  }
View Full Code Here

 
  @Override
  protected void setupIterators(IteratorRegistry registry) throws SetupException {
    for(LogicalOperator op : config.getInputs()){
      List<RecordIterator> more = registry.getOperator(op);
      if(more.size() != 1) throw new SetupException("Iterator list was incorrect size.");
      incoming.addAll(more);
    }
  }
View Full Code Here

    map = Collections.unmodifiableMap(funcs);
  }

  public static BasicEvaluator getEvaluator(String name, FunctionArguments args, RecordPointer record) {
    Constructor<? extends BasicEvaluator> c = map.get(name);
    if (c == null) throw new SetupException(String.format("Unable to find requested basic evaluator %s.", name));
    try {
      try {
        BasicEvaluator e = c.newInstance(record, args);
        return e;
      } catch (InvocationTargetException e) {
        Throwable ex = e.getCause();
        if (ex instanceof SetupException) {
          throw (SetupException) ex;
        } else {
          if(ex instanceof RuntimeException){
            throw (RuntimeException) ex;
          }else{
            throw new SetupException(String.format("Failure while attempting to create a new evaluator of type '%s'.", name));
          }
        }
      }
    } catch (RuntimeException | IllegalAccessException | InstantiationException ex) {
      throw new SetupException(String.format("Failure while attempting to create a new evaluator of type '%s'.", name),
          ex);
    }

  }
View Full Code Here

    } catch (NoSuchMethodException | ClassNotFoundException | IllegalAccessException | InstantiationException e) {
      logger.debug("No {} class that accepts a single parameter or type {}.", name, o.getClass().getCanonicalName());
    } catch (InvocationTargetException e) {
      Throwable c = e.getCause();
      if (c instanceof SetupException) throw (SetupException) c;
      throw new SetupException("Failure while trying to run Convert node of type " + o.getClass().getSimpleName(), c);
    }

    throw new UnsupportedOperationException("Unable to convert Logical Operator of type "
        + o.getClass().getCanonicalName());
  }
View Full Code Here

        + o.getClass().getCanonicalName());
  }

  private ReferenceStorageEngine getEngine(String name){
    StorageEngineConfig config = plan.getStorageEngineConfig(name);
    if(config == null) throw new SetupException(String.format("Unable to find define storage engine of name [%s].", name));
    ReferenceStorageEngine engine = engineRegistry.getEngine(config);
    return engine;
  }
View Full Code Here

    ReferenceStorageEngine engine = engineRegistry.getEngine(engineConfig);
    Collection<ReadEntry> readEntries;
    try {
      readEntries = engine.getReadEntries(scan);
    } catch (IOException e1) {
      throw new SetupException("Failure reading input entries.", e1);
    }
   
    switch(readEntries.size()){
    case 0:
      throw new SetupException(String.format("Scan provided did not correspond to any available data.", scan));
    case 1:
      ScanROP scanner = new ScanROP(scan, readEntries.iterator().next(), engine);
      scanner.init(registry, builder);
      return;
    default:
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.