if (serialized == null || serialized.isEmpty()) {
return bwConfig;
} else {
try {
ByteArrayInputStream bais = new ByteArrayInputStream(serialized.getBytes(Charset.forName("UTF-8")));
bwConfig.readFields(new DataInputStream(bais));
bais.close();
return bwConfig;
} catch (IOException e) {
throw new IllegalArgumentException("unable to serialize " + BatchWriterConfig.class.getName());
}