/** * Ensure codec is created for the split, to decode values from cache. Can only be called * after initializing fileMetadata. */ private void ensureCodecFromFileMetadata() { if (codec != null) return; codec = WriterImpl.createCodec(fileMetadata.getCompressionKind()); }
public void setFileMetadata(ConsumerFileMetadata f) { assert fileMetadata == null; fileMetadata = f; stripes = new ArrayList<>(f.getStripeCount()); codec = WriterImpl.createCodec(fileMetadata.getCompressionKind()); }
public EncodedReaderImpl(Object fileKey, List<OrcProto.Type> types, TypeDescription fileSchema, org.apache.orc.CompressionKind kind, WriterVersion version, int bufferSize, long strideRate, DataCache cacheWrapper, DataReader dataReader, PoolFactory pf, IoTrace trace, boolean useCodecPool, String tag) throws IOException { this.fileKey = fileKey; this.compressionKind = kind; this.isCompressed = kind != org.apache.orc.CompressionKind.NONE; this.isCodecFromPool = useCodecPool; this.codec = useCodecPool ? OrcCodecPool.getCodec(kind) : WriterImpl.createCodec(kind); this.types = types; this.fileSchema = fileSchema; // Note: this is redundant with types this.version = version; this.bufferSize = bufferSize; this.rowIndexStride = strideRate; this.cacheWrapper = cacheWrapper; Allocator alloc = cacheWrapper.getAllocator(); this.allocator = alloc instanceof StoppableAllocator ? (StoppableAllocator) alloc : null; this.dataReader = dataReader; this.trace = trace; this.tag = tag; if (POOLS != null) return; if (pf == null) { pf = new NoopPoolFactory(); } Pools pools = createPools(pf); synchronized (POOLS_CREATION_LOCK) { if (POOLS != null) return; POOLS = pools; } }
CompressionCodec codec = isPool ? OrcCodecPool.getCodec(kind) : WriterImpl.createCodec(kind); boolean isCodecError = true; try {
/** * Ensure codec is created for the split, to decode values from cache. Can only be called * after initializing fileMetadata. */ private void ensureCodecFromFileMetadata() { if (codec != null) return; codec = WriterImpl.createCodec(fileMetadata.getCompressionKind()); }
public static CompressionCodec getCodec(CompressionKind kind) { if (kind == CompressionKind.NONE) return null; CompressionCodec codec = null; List<CompressionCodec> codecList = POOL.get(kind); if (codecList != null) { synchronized (codecList) { if (!codecList.isEmpty()) { codec = codecList.remove(codecList.size() - 1); } } } if (codec == null) { codec = WriterImpl.createCodec(kind); LOG.info("Got brand-new codec " + kind); } else { LOG.debug("Got recycled codec"); } return codec; }
public void setFileMetadata(ConsumerFileMetadata f) { assert fileMetadata == null; fileMetadata = f; stripes = new ArrayList<>(f.getStripeCount()); codec = WriterImpl.createCodec(fileMetadata.getCompressionKind()); }
CompressionCodec codec = isPool ? OrcCodecPool.getCodec(kind) : WriterImpl.createCodec(kind); boolean isCodecError = true; try {