public static Command deserializeCommand(String s) throws IOException {
    DataInput dataInput = new DataInputStream(new ByteArrayInputStream(Base64.getUrlDecoder().decode(s)));
    String clazz = (String) ReaderWriter.readDatum(dataInput);
    Command cmd;
    try {
      cmd = (Command)Class.forName(clazz).newInstance();
    } catch (Exception e) {
      throw new IOExceptionWithCause("Error instantiating class "+clazz,e);
    }
    cmd.readFields(dataInput);
    return cmd;
  }
Command implements Writable, but that's not terribly easy to use compared
to String, even if it plugs in easily into the rest of Hadoop. Provide
utility methods to easily serialize and deserialize Commands

deserializeCommand instantiates a concrete Command and initializes it,
given a base64 String representation of it.
hcatalog/webhcat/java-client/src/main/java/org/apache/hive/hcatalog/api/repl/ReplicationUtils.java