File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
core/src/main/scala/com/salesforce/op Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -268,6 +268,8 @@ private object WorkflowFileReader {
268268 val rawModel = " rawModel"
269269 val zipModel = " Model.zip"
270270 def modelStagingDir : String = s " modelStagingDir/model- ${System .currentTimeMillis}"
271+ val confWithDefaultCodec = new Configuration (false )
272+ val codecFactory = new CompressionCodecFactory (confWithDefaultCodec)
271273
272274 def loadFile (pathString : String )(implicit conf : Configuration ): String = {
273275 Try {
@@ -290,11 +292,10 @@ private object WorkflowFileReader {
290292 }
291293
292294 private def readAsString (path : Path )(implicit conf : Configuration ): String = {
293- val codecFactory = new CompressionCodecFactory (conf)
294- val codec = Option (codecFactory.getCodec(path))
295295 val in = FileSystem .getLocal(conf).open(path)
296296 try {
297- val read = codec.map(c => Source .fromInputStream(c.createInputStream(in)).mkString)
297+ val read = Option (codecFactory.getCodec(path))
298+ .map(c => Source .fromInputStream(c.createInputStream(in)).mkString)
298299 .getOrElse(IOUtils .toString(in, " UTF-8" ))
299300 read
300301 } finally {
You can’t perform that action at this time.
0 commit comments