Package org.apache.crunch

Examples of org.apache.crunch.CrunchRuntimeException


        if (localPath.toString().endsWith(path.getName())) {
          return localPath.makeQualified(FileSystem.getLocal(conf));
        }
      }
    } catch (IOException e) {
      throw new CrunchRuntimeException(e);
    }
    return null;
  }
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(), registry).build();
      } catch (InvalidProtocolBufferException e) {
        throw new CrunchRuntimeException(e);
      }
    }
View Full Code Here

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

        for (Pair<K, V> joinPair : readable.read(getContext())) {
          Pair<K, V> detachedPair = tableType.getDetachedValue(joinPair);
          joinMap.put(detachedPair.first(), detachedPair.second());
        }
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error reading map-side join data", e);
      }
    }
View Full Code Here

  protected abstract FileReaderFactory<T> getFileReaderFactory();

  private Path getCacheFilePath(String input, Configuration conf) {
    Path local = DistCache.getPathToCacheFile(new Path(input), conf);
    if (local == null) {
      throw new CrunchRuntimeException("Can't find local cache file for '" + input + "'");
    }
    return local;
  }
View Full Code Here

      Iterable<BloomFilter> iterable;
      try {
        iterable = bloomData.read(getContext());
      } catch (IOException e) {
        throw new CrunchRuntimeException("Error reading right-side of map side join: ", e);
      }

      bloomFilter = new BloomFilter(vectorSize, nbHash, Hash.MURMUR_HASH);
      for (BloomFilter subFilter : iterable) {
        bloomFilter.or(subFilter);
View Full Code Here

      dataOutputBuffer.reset();
      Writable writable = (Writable) ptype.getOutputMapFn().map(input);
      try {
        writable.write(dataOutputBuffer);
      } catch (IOException e) {
        throw new CrunchRuntimeException(e);
      }
      byte[] output = new byte[dataOutputBuffer.getLength()];
      System.arraycopy(dataOutputBuffer.getData(), 0, output, 0, dataOutputBuffer.getLength());
      return output;
    }
View Full Code Here

      encoder = EncoderFactory.get().binaryEncoder(byteArrayOutputStream, encoder);
      try {
        datumWriter.write(datum, encoder);
        encoder.flush();
      } catch (IOException e) {
        throw new CrunchRuntimeException(e);
      }
      return byteArrayOutputStream.toByteArray();
    }
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.