public static ByteBuffer serializeMetaData(int port) throws IOException {
    //TODO these bytes should be versioned
    DataOutputBuffer portDob = new DataOutputBuffer();
    portDob.writeInt(port);
    ByteBuffer buf = ByteBuffer.wrap(portDob.getData(), 0, portDob.getLength());
    portDob.close();
    return buf;
  }
Serialize the shuffle port into a ByteBuffer for use later on.
@param port the port to be sent to the ApplicationMaster
@return the serialized form of the port.
llap-server/src/java/org/apache/hadoop/hive/llap/shufflehandler/ShuffleHandler.java