Package org.apache.crunch

Examples of org.apache.crunch.CrunchRuntimeException


    }
    if (materializedAt != null && (materializedAt instanceof ReadableSource)) {
      try {
        return ((ReadableSource<S>) materializedAt).read(getPipeline().getConfiguration());
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error reading materialized data", e);
      }
    }
    materialized = true;
    return pipeline.materialize(this);
  }
View Full Code Here


      W instance = (W) WritableFactories.newInstance(clazz);
      BytesWritable bytes = (BytesWritable) writable;
      try {
        instance.readFields(new DataInputStream(new ByteArrayInputStream(bytes.getBytes())));
      } catch (IOException e) {
        throw new CrunchRuntimeException(e);
      }
      return instance;
    }
  }
View Full Code Here

    @Override
    public void configure(Configuration conf) {
      try {
        serializeWritableComparableCodes(conf);
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error serializing writable comparable codes", e);
      }

      for (MapFn fn : fns) {
        fn.configure(conf);
      }
View Full Code Here

    @Override
    public void configure(Configuration conf) {
      try {
        serializeWritableComparableCodes(conf);
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error serializing writable comparable codes", e);
      }
      for (MapFn fn : fns) {
        fn.configure(conf);
      }
    }
View Full Code Here

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    try {
      KeyValue.write(input, dos);
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }
    return new BytesWritable(baos.toByteArray());
  }
View Full Code Here

    ByteArrayInputStream bais = new ByteArrayInputStream(array, offset, limit);
    DataInputStream dis = new DataInputStream(bais);
    try {
      return KeyValue.create(dis);
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }
  }
View Full Code Here

    @Override
    public void initialize() {
      this.deserializer = ReflectionUtils.newInstance(serClazz, null).getDeserializer(clazz);
      if (deserializer == null) {
        throw new CrunchRuntimeException("No Hadoop deserializer for class: " + clazz);
      }
    }
View Full Code Here

        deserializer.open(bais);
        T ret = deserializer.deserialize(null);
        deserializer.close();
        return ret;
      } catch (Exception e) {
        throw new CrunchRuntimeException("Deserialization errror", e);
      }
    }
View Full Code Here

    @Override
    public void initialize() {
      this.serializer = ReflectionUtils.newInstance(serClazz, null).getSerializer(clazz);
      if (serializer == null) {
        throw new CrunchRuntimeException("No Hadoop serializer for class: " + clazz);
      }
    }
View Full Code Here

        serializer.open(baos);
        serializer.serialize(out);
        serializer.close();
        return ByteBuffer.wrap(baos.toByteArray());
      } catch (Exception e) {
        throw new CrunchRuntimeException("Serialization errror", e);
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.crunch.CrunchRuntimeException

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.