@Override public void configure(Configuration jobConf) { if (parameters == null) { ParameteredGeneralizations.configureParameters(this, jobConf); } try { if (weightsFile.get() != null) { FileSystem fs = FileSystem.get(weightsFile.get().toUri(), jobConf); VectorWritable weights = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(weightsFile.get())) { throw new FileNotFoundException(weightsFile.get().toString()); } DataInputStream in = fs.open(weightsFile.get()); try { weights.readFields(in); } finally { Closeables.close(in, true); } this.weights = weights.get(); } } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void configure(Configuration jobConf) { if (parameters == null) { ParameteredGeneralizations.configureParameters(this, jobConf); } try { if (weightsFile.get() != null) { FileSystem fs = FileSystem.get(weightsFile.get().toUri(), jobConf); VectorWritable weights = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(weightsFile.get())) { throw new FileNotFoundException(weightsFile.get().toString()); } DataInputStream in = fs.open(weightsFile.get()); try { weights.readFields(in); } finally { Closeables.close(in, true); } this.weights = weights.get(); } } catch (IOException e) { throw new IllegalStateException(e); } }
@Override public void configure(Configuration jobConf) { if (parameters == null) { ParameteredGeneralizations.configureParameters(this, jobConf); } try { if (weightsFile.get() != null) { FileSystem fs = FileSystem.get(weightsFile.get().toUri(), jobConf); VectorWritable weights = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(weightsFile.get())) { throw new FileNotFoundException(weightsFile.get().toString()); } try (DataInputStream in = fs.open(weightsFile.get())){ weights.readFields(in); } this.weights = weights.get(); } } catch (IOException e) { throw new IllegalStateException(e); } }
if (inverseCovarianceFile.get() != null) { FileSystem fs = FileSystem.get(inverseCovarianceFile.get().toUri(), jobConf); MatrixWritable inverseCovarianceMatrix = ClassUtils.instantiateAs((Class<? extends MatrixWritable>) matrixClass.get(), MatrixWritable.class); if (!fs.exists(inverseCovarianceFile.get())) { throw new FileNotFoundException(inverseCovarianceFile.get().toString()); DataInputStream in = fs.open(inverseCovarianceFile.get()); try { inverseCovarianceMatrix.readFields(in); if (meanVectorFile.get() != null) { FileSystem fs = FileSystem.get(meanVectorFile.get().toUri(), jobConf); VectorWritable meanVector = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(meanVectorFile.get())) { throw new FileNotFoundException(meanVectorFile.get().toString()); DataInputStream in = fs.open(meanVectorFile.get()); try { meanVector.readFields(in);
if (inverseCovarianceFile.get() != null) { FileSystem fs = FileSystem.get(inverseCovarianceFile.get().toUri(), jobConf); MatrixWritable inverseCovarianceMatrix = ClassUtils.instantiateAs((Class<? extends MatrixWritable>) matrixClass.get(), MatrixWritable.class); if (!fs.exists(inverseCovarianceFile.get())) { throw new FileNotFoundException(inverseCovarianceFile.get().toString()); try (DataInputStream in = fs.open(inverseCovarianceFile.get())){ inverseCovarianceMatrix.readFields(in); if (meanVectorFile.get() != null) { FileSystem fs = FileSystem.get(meanVectorFile.get().toUri(), jobConf); VectorWritable meanVector = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(meanVectorFile.get())) { throw new FileNotFoundException(meanVectorFile.get().toString()); try (DataInputStream in = fs.open(meanVectorFile.get())){ meanVector.readFields(in);
if (inverseCovarianceFile.get() != null) { FileSystem fs = FileSystem.get(inverseCovarianceFile.get().toUri(), jobConf); MatrixWritable inverseCovarianceMatrix = ClassUtils.instantiateAs((Class<? extends MatrixWritable>) matrixClass.get(), MatrixWritable.class); if (!fs.exists(inverseCovarianceFile.get())) { throw new FileNotFoundException(inverseCovarianceFile.get().toString()); DataInputStream in = fs.open(inverseCovarianceFile.get()); try { inverseCovarianceMatrix.readFields(in); if (meanVectorFile.get() != null) { FileSystem fs = FileSystem.get(meanVectorFile.get().toUri(), jobConf); VectorWritable meanVector = ClassUtils.instantiateAs((Class<? extends VectorWritable>) vectorClass.get(), VectorWritable.class); if (!fs.exists(meanVectorFile.get())) { throw new FileNotFoundException(meanVectorFile.get().toString()); DataInputStream in = fs.open(meanVectorFile.get()); try { meanVector.readFields(in);