Package org.springframework.data.hadoop.store.codec

Examples of org.springframework.data.hadoop.store.codec.CodecInfo


  protected SequenceFileWriterHolder<Writer> getOutput() throws IOException {
    FileSystem fs = FileSystem.get(getConfiguration());

    SequenceFileWriterHolder<Writer> holder;
    Writer writer;
    CodecInfo codecInfo = getCodec();
    Path p = getResolvedPath();
    if (codecInfo == null) {
      writer = SequenceFile.createWriter(
          fs, getConfiguration(), getResolvedPath(),
          Text.class, Text.class, CompressionType.NONE, (CompressionCodec) null);
      holder = new SequenceFileWriterHolder<SequenceFile.Writer>(writer, p);
    }
    else {
      Class<?> clazz = ClassUtils.resolveClassName(codecInfo.getCodecClass(), getClass().getClassLoader());
      CompressionCodec compressionCodec = (CompressionCodec) ReflectionUtils.newInstance(clazz,
          getConfiguration());
      writer = SequenceFile.createWriter(fs,
          getConfiguration(), getResolvedPath(),
          Text.class, Text.class, CompressionType.RECORD, compressionCodec);
View Full Code Here


  @Override
  public Path resolve(Path path) {
    if (!isEnabled()) {
      return path;
    }
    CodecInfo c = getCodecInfo();
    String suffix = c != null ? "." + c.getDefaultSuffix() : "";
    if (path != null) {
      return path.suffix(suffix);
    } else if (StringUtils.hasText(suffix)){
      return new Path(suffix);
    } else {
View Full Code Here

  @Override
  public Path init(Path path) {
    path = super.init(path);
    log.debug("Initialising from path=" + path);

    CodecInfo c = getCodecInfo();
    String suffix = c != null ? "." + c.getDefaultSuffix() : "";

    if (path != null && StringUtils.hasText(suffix)) {
      if (path.getName().startsWith(suffix)) {
        String name = path.getName().substring(suffix.length());
        if (StringUtils.hasText(name)) {
View Full Code Here

TOP

Related Classes of org.springframework.data.hadoop.store.codec.CodecInfo

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.