MCPcopy Create free account
hub / github.com/apache/orc / getCodec

Method getCodec

java/core/src/java/org/apache/orc/impl/OrcCodecPool.java:45–63  ·  view source on GitHub ↗
(CompressionKind kind)

Source from the content-addressed store, hash-verified

43 private static final int MAX_PER_KIND = 32;
44
45 public static CompressionCodec getCodec(CompressionKind kind) {
46 if (kind == CompressionKind.NONE) return null;
47 CompressionCodec codec = null;
48 List<CompressionCodec> codecList = POOL.get(kind);
49 if (codecList != null) {
50 synchronized (codecList) {
51 if (!codecList.isEmpty()) {
52 codec = codecList.remove(codecList.size() - 1);
53 }
54 }
55 }
56 if (codec == null) {
57 codec = WriterImpl.createCodec(kind);
58 LOG.debug("Got brand-new codec {}", kind);
59 } else {
60 LOG.debug("Got recycled codec");
61 }
62 return codec;
63 }
64
65 /**
66 * Returns the codec to the pool or closes it, suppressing exceptions.

Callers 15

testCodecPoolMethod · 0.95
testSeekMethod · 0.95
testCompleteBuildMethod · 0.95
testZstdCodecMethod · 0.95
getStatisticsMethod · 0.95
extractFileTailMethod · 0.95
getStripeStatisticsMethod · 0.95
PhysicalFsWriterMethod · 0.95
RecordReaderImplMethod · 0.95

Calls 3

createCodecMethod · 0.95
sizeMethod · 0.65
getMethod · 0.45

Tested by 6

testCodecPoolMethod · 0.76
testSeekMethod · 0.76
testCompleteBuildMethod · 0.76
testZstdCodecMethod · 0.76
createRowIndexMethod · 0.36