Package org.apache.crunch

Examples of org.apache.crunch.CrunchRuntimeException


        // Hacking this for Hadoop1 and Hadoop2
        getConfiguration().set("mapreduce.job.cache.local.files", sparkFiles);
        getConfiguration().set("mapred.cache.localFiles", sparkFiles);
      }
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }
  }
View Full Code Here


      try {
        Job job = new Job(ctxt.getConfiguration());
        ptype.configureShuffle(job, options);
        cmp = ReflectionUtils.newInstance(options.getGroupingComparatorClass(), job.getConfiguration());
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error configuring grouping comparator", e);
      }
    }
    return cmp;
  }
View Full Code Here

          if (cmp == null) {
            cmp = new ByteWritable.Comparator();
          }
        }
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error configuring sort comparator", e);
      }
    }
    return cmp;
  }
View Full Code Here

        ptype.initialize(runtimeContext.getConfiguration());
        Job job = new Job(runtimeContext.getConfiguration());
        ptype.configureShuffle(job, GroupingOptions.builder().partitionerClass(partitionerClass).build());
        partitioner = ReflectionUtils.newInstance(partitionerClass, job.getConfiguration());
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error configuring partitioner", e);
      }
    }
    return partitioner;
  }
View Full Code Here

   
    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

    }
    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

      }
      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

      try {
        Class<?> keyClass = Class.forName(fields.get(2));
        Class<?> valueClass = Class.forName(fields.get(3));
        out.put(name, new OutputConfig(bundle, keyClass, valueClass));
      } catch (ClassNotFoundException e) {
        throw new CrunchRuntimeException(e);
      }
    }
    return out;
  }
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

      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

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.