Package org.apache.drill.exec.exception

Examples of org.apache.drill.exec.exception.ClassTransformationException


  private class ClassBytesCacheLoader extends CacheLoader<String, byte[]> {
    public byte[] load(String path) throws ClassTransformationException, IOException {
      URL u = this.getClass().getResource(path);
      if (u == null)
        throw new ClassTransformationException(String.format("Unable to find TemplateClass at path %s", path));
      return Resources.toByteArray(u);
    }
View Full Code Here


      final LogicalExpression leftFieldExpr = condition.getLeft();

      // materialize value vector readers from join expression
      final LogicalExpression materializedLeftExpr = ExpressionTreeMaterializer.materialize(leftFieldExpr, left, collector, context.getFunctionRegistry());
      if (collector.hasErrors()) {
        throw new ClassTransformationException(String.format(
            "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));
      }

      // generate compareNextLeftKey()
      ////////////////////////////////
View Full Code Here

          materializedLeftExpr = ExpressionTreeMaterializer.materialize(leftFieldExpr, left, collector, context.getFunctionRegistry());
        } else {
          materializedLeftExpr = new TypedNullConstant(Types.optional(MinorType.INT));
        }
        if (collector.hasErrors()) {
          throw new ClassTransformationException(String.format(
              "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));
        }

        LogicalExpression materializedRightExpr;
        if (worker == null || status.isRightPositionAllowed()) {
          materializedRightExpr = ExpressionTreeMaterializer.materialize(rightFieldExpr, right, collector, context.getFunctionRegistry());
        } else {
          materializedRightExpr = new TypedNullConstant(Types.optional(MinorType.INT));
        }
        if (collector.hasErrors()) {
          throw new ClassTransformationException(String.format(
              "Failure while trying to materialize incoming right field.  Errors:\n %s.", collector.toErrorString()));
        }

        // generate compare()
        ////////////////////////
View Full Code Here

        throw (ClassTransformationException) c;
      }
      if (c instanceof IOException) {
        throw (IOException) c;
      }
      throw new ClassTransformationException(c);
    }
  }
View Full Code Here

  private class ClassBytesCacheLoader extends CacheLoader<String, byte[]> {
    @Override
    public byte[] load(String path) throws ClassTransformationException, IOException {
      URL u = this.getClass().getResource(path);
      if (u == null) {
        throw new ClassTransformationException(String.format("Unable to find TemplateClass at path %s", path));
      }
      return Resources.toByteArray(u);
    }
View Full Code Here

    cg.generate();
    try {
      GeneratedClassEntry ce = cache.get(cg);
      return (T) ce.clazz.newInstance();
    } catch (ExecutionException | InstantiationException | IllegalAccessException e) {
      throw new ClassTransformationException(e);
    }
  }
View Full Code Here

      Class<?> c = classLoader.findClass(set.generated.dot);
      if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
        logger.debug("Done compiling (bytecode size={}, time:{} millis).", DrillStringUtils.readable(totalBytecodeSize), (System.nanoTime() - t1) / 1000000);
        return c;
      } else {
        throw new ClassTransformationException("The requested class did not implement the expected interface.");
      }
    } catch (CompileException | IOException | ClassNotFoundException e) {
      throw new ClassTransformationException(String.format("Failure generating transformation classes for value: \n %s", entireClass), e);
    }

  }
View Full Code Here

      final LogicalExpression leftFieldExpr = condition.getLeft();

      // materialize value vector readers from join expression
      final LogicalExpression materializedLeftExpr = ExpressionTreeMaterializer.materialize(leftFieldExpr, left, collector, context.getFunctionRegistry());
      if (collector.hasErrors())
        throw new ClassTransformationException(String.format(
            "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));

      // generate compareNextLeftKey()
      ////////////////////////////////
      cg.setMappingSet(compareLeftMapping);
View Full Code Here

        materializedLeftExpr = ExpressionTreeMaterializer.materialize(leftFieldExpr, left, collector, context.getFunctionRegistry());
      } else {
        materializedLeftExpr = new TypedNullConstant(Types.optional(MinorType.INT));
      }
      if (collector.hasErrors())
        throw new ClassTransformationException(String.format(
            "Failure while trying to materialize incoming left field.  Errors:\n %s.", collector.toErrorString()));

      LogicalExpression materializedRightExpr;
      if (worker == null || status.isRightPositionAllowed()) {
        materializedRightExpr = ExpressionTreeMaterializer.materialize(rightFieldExpr, right, collector, context.getFunctionRegistry());
      } else {
        materializedRightExpr = new TypedNullConstant(Types.optional(MinorType.INT));
      }
      if (collector.hasErrors())
        throw new ClassTransformationException(String.format(
            "Failure while trying to materialize incoming right field.  Errors:\n %s.", collector.toErrorString()));

      // generate compare()
      ////////////////////////
      cg.setMappingSet(compareMapping);
View Full Code Here

      Class<?> c = classLoader.findClass(set.generated.dot);
      if (templateDefinition.getExternalInterface().isAssignableFrom(c)) {
        logger.debug("Done compiling (bytecode size={}, time:{} millis).", DrillStringUtils.readable(totalBytecodeSize), (System.nanoTime() - t1) / 1000000);
        return c;
      } else {
        throw new ClassTransformationException("The requested class did not implement the expected interface.");
      }
    } catch (CompileException | IOException | ClassNotFoundException e) {
      throw new ClassTransformationException(String.format("Failure generating transformation classes for value: \n %s", entireClass), e);
    }

  }
View Full Code Here

TOP

Related Classes of org.apache.drill.exec.exception.ClassTransformationException

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.