org.apache.hadoop.io.SequenceFile.CompressionType#valueOf ( )源码实例Demo

下面列出了org.apache.hadoop.io.SequenceFile.CompressionType#valueOf ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: pxf   文件: SequenceFileAccessor.java
/**
 * Compression: based on compression codec and compression type (default
 * value RECORD). If there is no codec, compression type is ignored, and
 * NONE is used.
 *
 * @param context - container where compression codec and type are held
 */
private void getCompressionCodec(RequestContext context) {

    String userCompressCodec = context.getOption("COMPRESSION_CODEC");
    String userCompressType = context.getOption("COMPRESSION_TYPE");
    String parsedCompressType = parseCompressionType(userCompressType);

    compressionType = CompressionType.NONE;
    codec = null;
    if (userCompressCodec != null) {
        codec = codecFactory.getCodec(userCompressCodec, configuration);

        try {
            compressionType = CompressionType.valueOf(parsedCompressType);
        } catch (IllegalArgumentException e) {
            throw new IllegalArgumentException(
                    String.format("Illegal value for compression type '%s'", parsedCompressType));
        }
        LOG.debug("Compression ON: compression codec: {}, compression type: {}",
                userCompressCodec, compressionType);
    }
}
 
源代码2 项目: hadoop   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param conf the {@link JobConf}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobConf conf) {
  String val = conf.get(org.apache.hadoop.mapreduce.lib.output.
    FileOutputFormat.COMPRESS_TYPE, CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码3 项目: hadoop   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param job the {@link Job}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobContext job) {
  String val = job.getConfiguration().get(FileOutputFormat.COMPRESS_TYPE, 
                                          CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码4 项目: big-c   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param conf the {@link JobConf}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobConf conf) {
  String val = conf.get(org.apache.hadoop.mapreduce.lib.output.
    FileOutputFormat.COMPRESS_TYPE, CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码5 项目: big-c   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param job the {@link Job}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobContext job) {
  String val = job.getConfiguration().get(FileOutputFormat.COMPRESS_TYPE, 
                                          CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码6 项目: RDFS   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param conf the {@link JobConf}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobConf conf) {
  String val = conf.get("mapred.output.compression.type", 
                        CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码7 项目: RDFS   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param job the {@link Job}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobContext job) {
  String val = job.getConfiguration().get("mapred.output.compression.type", 
                                          CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码8 项目: hadoop-gpu   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param conf the {@link JobConf}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobConf conf) {
  String val = conf.get("mapred.output.compression.type", 
                        CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}
 
源代码9 项目: hadoop-gpu   文件: SequenceFileOutputFormat.java
/**
 * Get the {@link CompressionType} for the output {@link SequenceFile}.
 * @param job the {@link Job}
 * @return the {@link CompressionType} for the output {@link SequenceFile}, 
 *         defaulting to {@link CompressionType#RECORD}
 */
public static CompressionType getOutputCompressionType(JobContext job) {
  String val = job.getConfiguration().get("mapred.output.compression.type", 
                                          CompressionType.RECORD.toString());
  return CompressionType.valueOf(val);
}