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

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


    try {
      TableMapReduceUtil.addDependencyJars(job);
      FileOutputFormat.setOutputPath(job, outputPath);
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }

    if (null == name) {
      job.setOutputFormatClass(TableOutputFormat.class);
      job.setOutputKeyClass(ImmutableBytesWritable.class);
View Full Code Here


      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

    @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

      // Protobuf 2.4.x
      try {
        Message.Builder mb = (Message.Builder) clazz.getDeclaredMethod("newBuilder").invoke(null);
        return (M) mb.getDefaultInstanceForType();
      } catch (Exception e) {
        throw new CrunchRuntimeException(e);
     
    }
  }
View Full Code Here

  public MRExecutor plan() {
    MSCRPlanner planner = new MSCRPlanner(this, outputTargets);
    try {
      return planner.plan(jarClass, conf);
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }
  }
View Full Code Here

      binaryEncoder.flush();
      binaryDecoder = DecoderFactory.get()
          .binaryDecoder(byteOutStream.toByteArray(), binaryDecoder);
      datumReader.read(target, binaryDecoder);
    } catch (Exception e) {
      throw new CrunchRuntimeException("Error while deep copying avro value " + source, e);
    }

    return target;
  }
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.