/** * Serializes the given {@link CConfiguration} to the give file. */ private Path saveCConf(CConfiguration cConf, Path file) throws IOException { try (Writer writer = Files.newBufferedWriter(file, Charsets.UTF_8)) { cConf.writeXml(writer); } return file; }
public String getCConfXMLString() throws IOException { StringWriter stringWriter = new StringWriter(); cConf.writeXml(stringWriter); return stringWriter.toString(); }
public String getCConfXMLString() throws IOException { StringWriter stringWriter = new StringWriter(); cConf.writeXml(stringWriter); return stringWriter.toString(); }
private File saveCConf(CConfiguration cConf, File file) throws IOException { try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { cConf.writeXml(writer); } return file; }
@Override public byte[] encode(CConfiguration object) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); object.writeXml(bos); bos.close(); return bos.toByteArray(); }
private File saveCConf(CConfiguration cConf, File file) throws IOException { try (Writer writer = Files.newBufferedWriter(file.toPath(), StandardCharsets.UTF_8)) { cConf.writeXml(writer); } return file; }
@Override public byte[] encode(CConfiguration object) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); object.writeXml(bos); bos.close(); return bos.toByteArray(); }
private void setConf(CConfiguration conf) { StringWriter stringWriter = new StringWriter(); try { conf.writeXml(stringWriter); } catch (IOException e) { LOG.error("Unable to serialize CConfiguration into xml"); throw Throwables.propagate(e); } hConf.set(HCONF_ATTR_CCONF, stringWriter.toString()); }
private void setConf(CConfiguration conf) { StringWriter stringWriter = new StringWriter(); try { conf.writeXml(stringWriter); } catch (IOException e) { LOG.error("Unable to serialize CConfiguration into xml"); throw Throwables.propagate(e); } hConf.set(HCONF_ATTR_CCONF, stringWriter.toString()); }
/** * Serialize {@link CConfiguration} to a file. * * @return The {@link File} of the serialized configuration in the given target directory. */ private File saveCConf(CConfiguration cConf, File targetDir) throws IOException { File file = new File(targetDir, SparkRuntimeContextProvider.CCONF_FILE_NAME); try (Writer writer = Files.newWriter(file, Charsets.UTF_8)) { cConf.writeXml(writer); } return file; }
/** * Serialize {@link CConfiguration} to a file. * * @return The {@link File} of the serialized configuration in the given target directory. */ private File saveCConf(CConfiguration cConf, File targetDir) throws IOException { File file = new File(targetDir, SparkRuntimeContextProvider.CCONF_FILE_NAME); try (Writer writer = Files.newWriter(file, Charsets.UTF_8)) { cConf.writeXml(writer); } return file; }
/** * Serialize {@link CConfiguration} to a file. * * @return The {@link File} of the serialized configuration in the given target directory. */ private File saveCConf(CConfiguration cConf, File targetDir) throws IOException { File file = new File(targetDir, SparkRuntimeContextProvider.CCONF_FILE_NAME); try (Writer writer = Files.newWriter(file, Charsets.UTF_8)) { cConf.writeXml(writer); } return file; }
this.cConf.writeXml(writer);