Skip to content

Commit 28d5b0f

Browse files
committed
fix
Conflicts: chill-avro/src/main/scala/com/twitter/chill/avro/AvroSerializer.scala
1 parent 8cdbc82 commit 28d5b0f

1 file changed

Lines changed: 12 additions & 9 deletions

File tree

chill-hadoop/src/main/java/com/twitter/chill/hadoop/KryoSerialization.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,18 @@ public KryoSerialization( Configuration conf ) {
6565

6666
@Override
6767
public void setConf(Configuration conf) {
68-
try {
69-
KryoInstantiator kryoInst = new ConfiguredInstantiator(new HadoopConfig(conf));
70-
testKryo = kryoInst.newKryo();
71-
kryoPool = KryoPool.withByteArrayOutputStream(MAX_CACHED_KRYO, kryoInst);
72-
}
73-
catch(ConfigurationException cx) {
74-
// This interface can't throw
75-
throw new RuntimeException(cx);
76-
}
68+
// null check is to handle when calling the defaul constructor, in Configured, it calls super which calls setConf with a null Configuration
69+
if (conf != null) {
70+
try {
71+
KryoInstantiator kryoInst = new ConfiguredInstantiator(new HadoopConfig(conf));
72+
testKryo = kryoInst.newKryo();
73+
kryoPool = KryoPool.withByteArrayOutputStream(MAX_CACHED_KRYO, kryoInst);
74+
}
75+
catch(ConfigurationException cx) {
76+
// This interface can't throw
77+
throw new RuntimeException(cx);
78+
}
79+
}
7780
}
7881

7982
/**

0 commit comments

Comments
 (0)