Cherry picked the Hive Thrift server