Package org.apache.crunch.impl.mr.run

Examples of org.apache.crunch.impl.mr.run.CrunchRuntimeException


      ByteArrayInputStream byteInStream = new ByteArrayInputStream(byteOutStream.toByteArray());
      DataInput dataInput = new DataInputStream(byteInStream);
      copiedValue = writableClass.newInstance();
      copiedValue.readFields(dataInput);
    } catch (Exception e) {
      throw new CrunchRuntimeException("Error while deep copying " + source, e);
    }
    return copiedValue;
  }
View Full Code Here


      Path targetPath = new Path(target.toString());
      ObjectInputStream ois = new ObjectInputStream(targetPath.getFileSystem(conf).open(targetPath));
      try {
        value = ois.readObject();
      } catch (ClassNotFoundException e) {
        throw new CrunchRuntimeException(e);
      }
      ois.close();
    }
    return value;
  }
View Full Code Here

    @Override
    public T map(String input) {
      try {
        return mapper.readValue(input, clazz);
      } catch (Exception e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

    @Override
    public String map(T input) {
      try {
        return mapper.writeValueAsString(input);
      } catch (Exception e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

    @Override
    public T map(ByteBuffer bb) {
      try {
        return (T) instance.newBuilderForType().mergeFrom(bb.array(), bb.position(), bb.limit()).build();
      } catch (InvalidProtocolBufferException e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

      }
      System.arraycopy(bb.array(), bb.position(), bytes, 0, len);
      try {
        deserializer.deserialize(next, bytes);
      } catch (TException e) {
        throw new CrunchRuntimeException(e);
      }
      return next;
    }
View Full Code Here

    @Override
    public ByteBuffer map(T t) {
      try {
        return ByteBuffer.wrap(serializer.serialize(t));
      } catch (TException e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

    @Override
    public void initialize() {
      try {
        constructor = clazz.getConstructor(typeArgs);
      } catch (Exception e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

    @Override
    public T makeTuple(Object... values) {
      try {
        return constructor.newInstance(values);
      } catch (Exception e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

  public void materialize() {
    try {
      materialized = sourceTarget.read(pipeline.getConfiguration());
    } catch (IOException e) {
      LOG.error("Could not materialize: " + sourceTarget, e);
      throw new CrunchRuntimeException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.crunch.impl.mr.run.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.