You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hawq.apache.org by es...@apache.org on 2016/09/08 05:20:40 UTC

[01/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Repository: incubator-hawq
Updated Branches:
  refs/heads/2.0.0.0-incubating 9bc040d92 -> 8eff60336


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
deleted file mode 100644
index 4d660e8..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.tcc
+++ /dev/null
@@ -1,824 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef _THRIFT_PROTOCOL_TCOMPACTPROTOCOL_TCC_
-#define _THRIFT_PROTOCOL_TCOMPACTPROTOCOL_TCC_ 1
-
-#include <limits>
-
-/*
- * TCompactProtocol::i*ToZigzag depend on the fact that the right shift
- * operator on a signed integer is an arithmetic (sign-extending) shift.
- * If this is not the case, the current implementation will not work.
- * If anyone encounters this error, we can try to figure out the best
- * way to implement an arithmetic right shift on their platform.
- */
-#if !defined(SIGNED_RIGHT_SHIFT_IS) || !defined(ARITHMETIC_RIGHT_SHIFT)
-# error "Unable to determine the behavior of a signed right shift"
-#endif
-#if SIGNED_RIGHT_SHIFT_IS != ARITHMETIC_RIGHT_SHIFT
-# error "TCompactProtocol currently only works if a signed right shift is arithmetic"
-#endif
-
-#ifdef __GNUC__
-#define UNLIKELY(val) (__builtin_expect((val), 0))
-#else
-#define UNLIKELY(val) (val)
-#endif
-
-namespace apache { namespace thrift { namespace protocol {
-
-namespace detail { namespace compact {
-
-enum Types {
-  CT_STOP           = 0x00,
-  CT_BOOLEAN_TRUE   = 0x01,
-  CT_BOOLEAN_FALSE  = 0x02,
-  CT_BYTE           = 0x03,
-  CT_I16            = 0x04,
-  CT_I32            = 0x05,
-  CT_I64            = 0x06,
-  CT_DOUBLE         = 0x07,
-  CT_BINARY         = 0x08,
-  CT_LIST           = 0x09,
-  CT_SET            = 0x0A,
-  CT_MAP            = 0x0B,
-  CT_STRUCT         = 0x0C
-};
-
-const int8_t TTypeToCType[16] = {
-  CT_STOP, // T_STOP
-  0, // unused
-  CT_BOOLEAN_TRUE, // T_BOOL
-  CT_BYTE, // T_BYTE
-  CT_DOUBLE, // T_DOUBLE
-  0, // unused
-  CT_I16, // T_I16
-  0, // unused
-  CT_I32, // T_I32
-  0, // unused
-  CT_I64, // T_I64
-  CT_BINARY, // T_STRING
-  CT_STRUCT, // T_STRUCT
-  CT_MAP, // T_MAP
-  CT_SET, // T_SET
-  CT_LIST, // T_LIST
-};
-
-}} // end detail::compact namespace
-
-
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeMessageBegin(
-    const std::string& name,
-    const TMessageType messageType,
-    const int32_t seqid) {
-  uint32_t wsize = 0;
-  wsize += writeByte(PROTOCOL_ID);
-  wsize += writeByte((VERSION_N & VERSION_MASK) | (((int32_t)messageType << TYPE_SHIFT_AMOUNT) & TYPE_MASK));
-  wsize += writeVarint32(seqid);
-  wsize += writeString(name);
-  return wsize;
-}
-
-/**
- * Write a field header containing the field id and field type. If the
- * difference between the current field id and the last one is small (< 15),
- * then the field id will be encoded in the 4 MSB as a delta. Otherwise, the
- * field id will follow the type header as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeFieldBegin(const char* name,
-                                                        const TType fieldType,
-                                                        const int16_t fieldId) {
-  if (fieldType == T_BOOL) {
-    booleanField_.name = name;
-    booleanField_.fieldType = fieldType;
-    booleanField_.fieldId = fieldId;
-  } else {
-    return writeFieldBeginInternal(name, fieldType, fieldId, -1);
-  }
-  return 0;
-}
-
-/**
- * Write the STOP symbol so we know there are no more fields in this struct.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeFieldStop() {
-  return writeByte(T_STOP);
-}
-
-/**
- * Write a struct begin. This doesn't actually put anything on the wire. We
- * use it as an opportunity to put special placeholder markers on the field
- * stack so we can get the field id deltas correct.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeStructBegin(const char* name) {
-  (void) name;
-  lastField_.push(lastFieldId_);
-  lastFieldId_ = 0;
-  return 0;
-}
-
-/**
- * Write a struct end. This doesn't actually put anything on the wire. We use
- * this as an opportunity to pop the last field from the current struct off
- * of the field stack.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeStructEnd() {
-  lastFieldId_ = lastField_.top();
-  lastField_.pop();
-  return 0;
-}
-
-/**
- * Write a List header.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeListBegin(const TType elemType,
-                                                       const uint32_t size) {
-  return writeCollectionBegin(elemType, size);
-}
-
-/**
- * Write a set header.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeSetBegin(const TType elemType,
-                                                      const uint32_t size) {
-  return writeCollectionBegin(elemType, size);
-}
-
-/**
- * Write a map header. If the map is empty, omit the key and value type
- * headers, as we don't need any additional information to skip it.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeMapBegin(const TType keyType,
-                                                      const TType valType,
-                                                      const uint32_t size) {
-  uint32_t wsize = 0;
-
-  if (size == 0) {
-    wsize += writeByte(0);
-  } else {
-    wsize += writeVarint32(size);
-    wsize += writeByte(getCompactType(keyType) << 4 | getCompactType(valType));
-  }
-  return wsize;
-}
-
-/**
- * Write a boolean value. Potentially, this could be a boolean field, in
- * which case the field header info isn't written yet. If so, decide what the
- * right type header is for the value and then write the field header.
- * Otherwise, write a single byte.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeBool(const bool value) {
-  uint32_t wsize = 0;
-
-  if (booleanField_.name != NULL) {
-    // we haven't written the field header yet
-    wsize
-      += writeFieldBeginInternal(booleanField_.name,
-                                 booleanField_.fieldType,
-                                 booleanField_.fieldId,
-                                 static_cast<int8_t>(value
-                                                     ? detail::compact::CT_BOOLEAN_TRUE
-                                                     : detail::compact::CT_BOOLEAN_FALSE));
-    booleanField_.name = NULL;
-  } else {
-    // we're not part of a field, so just write the value
-    wsize
-      += writeByte(static_cast<int8_t>(value
-                                       ? detail::compact::CT_BOOLEAN_TRUE
-                                       : detail::compact::CT_BOOLEAN_FALSE));
-  }
-  return wsize;
-}
-
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeByte(const int8_t byte) {
-  trans_->write((uint8_t*)&byte, 1);
-  return 1;
-}
-
-/**
- * Write an i16 as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeI16(const int16_t i16) {
-  return writeVarint32(i32ToZigzag(i16));
-}
-
-/**
- * Write an i32 as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeI32(const int32_t i32) {
-  return writeVarint32(i32ToZigzag(i32));
-}
-
-/**
- * Write an i64 as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeI64(const int64_t i64) {
-  return writeVarint64(i64ToZigzag(i64));
-}
-
-/**
- * Write a double to the wire as 8 bytes.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeDouble(const double dub) {
-  BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
-  BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
-
-  uint64_t bits = bitwise_cast<uint64_t>(dub);
-  bits = THRIFT_htolell(bits);
-  trans_->write((uint8_t*)&bits, 8);
-  return 8;
-}
-
-/**
- * Write a string to the wire with a varint size preceding.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeString(const std::string& str) {
-  return writeBinary(str);
-}
-
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeBinary(const std::string& str) {
-  if(str.size() > (std::numeric_limits<uint32_t>::max)())
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  uint32_t ssize = static_cast<uint32_t>(str.size());
-  uint32_t wsize = writeVarint32(ssize) ;
-  // checking ssize + wsize > uint_max, but we don't want to overflow while checking for overflows.
-  // transforming the check to ssize > uint_max - wsize
-  if(ssize > (std::numeric_limits<uint32_t>::max)() - wsize)
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  wsize += ssize;
-  trans_->write((uint8_t*)str.data(), ssize);
-  return wsize;
-}
-
-//
-// Internal Writing methods
-//
-
-/**
- * The workhorse of writeFieldBegin. It has the option of doing a
- * 'type override' of the type header. This is used specifically in the
- * boolean field case.
- */
-template <class Transport_>
-int32_t TCompactProtocolT<Transport_>::writeFieldBeginInternal(
-    const char* name,
-    const TType fieldType,
-    const int16_t fieldId,
-    int8_t typeOverride) {
-  (void) name;
-  uint32_t wsize = 0;
-
-  // if there's a type override, use that.
-  int8_t typeToWrite = (typeOverride == -1 ? getCompactType(fieldType) : typeOverride);
-
-  // check if we can use delta encoding for the field id
-  if (fieldId > lastFieldId_ && fieldId - lastFieldId_ <= 15) {
-    // write them together
-    wsize += writeByte(static_cast<int8_t>((fieldId - lastFieldId_)
-                                           << 4 | typeToWrite));
-  } else {
-    // write them separate
-    wsize += writeByte(typeToWrite);
-    wsize += writeI16(fieldId);
-  }
-
-  lastFieldId_ = fieldId;
-  return wsize;
-}
-
-/**
- * Abstract method for writing the start of lists and sets. List and sets on
- * the wire differ only by the type indicator.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeCollectionBegin(const TType elemType,
-                                                             int32_t size) {
-  uint32_t wsize = 0;
-  if (size <= 14) {
-    wsize += writeByte(static_cast<int8_t>(size
-                                           << 4 | getCompactType(elemType)));
-  } else {
-    wsize += writeByte(0xf0 | getCompactType(elemType));
-    wsize += writeVarint32(size);
-  }
-  return wsize;
-}
-
-/**
- * Write an i32 as a varint. Results in 1-5 bytes on the wire.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeVarint32(uint32_t n) {
-  uint8_t buf[5];
-  uint32_t wsize = 0;
-
-  while (true) {
-    if ((n & ~0x7F) == 0) {
-      buf[wsize++] = (int8_t)n;
-      break;
-    } else {
-      buf[wsize++] = (int8_t)((n & 0x7F) | 0x80);
-      n >>= 7;
-    }
-  }
-  trans_->write(buf, wsize);
-  return wsize;
-}
-
-/**
- * Write an i64 as a varint. Results in 1-10 bytes on the wire.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::writeVarint64(uint64_t n) {
-  uint8_t buf[10];
-  uint32_t wsize = 0;
-
-  while (true) {
-    if ((n & ~0x7FL) == 0) {
-      buf[wsize++] = (int8_t)n;
-      break;
-    } else {
-      buf[wsize++] = (int8_t)((n & 0x7F) | 0x80);
-      n >>= 7;
-    }
-  }
-  trans_->write(buf, wsize);
-  return wsize;
-}
-
-/**
- * Convert l into a zigzag long. This allows negative numbers to be
- * represented compactly as a varint.
- */
-template <class Transport_>
-uint64_t TCompactProtocolT<Transport_>::i64ToZigzag(const int64_t l) {
-  return (l << 1) ^ (l >> 63);
-}
-
-/**
- * Convert n into a zigzag int. This allows negative numbers to be
- * represented compactly as a varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::i32ToZigzag(const int32_t n) {
-  return (n << 1) ^ (n >> 31);
-}
-
-/**
- * Given a TType value, find the appropriate detail::compact::Types value
- */
-template <class Transport_>
-int8_t TCompactProtocolT<Transport_>::getCompactType(const TType ttype) {
-  return detail::compact::TTypeToCType[ttype];
-}
-
-//
-// Reading Methods
-//
-
-/**
- * Read a message header.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readMessageBegin(
-    std::string& name,
-    TMessageType& messageType,
-    int32_t& seqid) {
-  uint32_t rsize = 0;
-  int8_t protocolId;
-  int8_t versionAndType;
-  int8_t version;
-
-  rsize += readByte(protocolId);
-  if (protocolId != PROTOCOL_ID) {
-    throw TProtocolException(TProtocolException::BAD_VERSION, "Bad protocol identifier");
-  }
-
-  rsize += readByte(versionAndType);
-  version = (int8_t)(versionAndType & VERSION_MASK);
-  if (version != VERSION_N) {
-    throw TProtocolException(TProtocolException::BAD_VERSION, "Bad protocol version");
-  }
-
-  messageType = (TMessageType)((versionAndType >> TYPE_SHIFT_AMOUNT) & TYPE_BITS);
-  rsize += readVarint32(seqid);
-  rsize += readString(name);
-
-  return rsize;
-}
-
-/**
- * Read a struct begin. There's nothing on the wire for this, but it is our
- * opportunity to push a new struct begin marker on the field stack.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readStructBegin(std::string& name) {
-  name = "";
-  lastField_.push(lastFieldId_);
-  lastFieldId_ = 0;
-  return 0;
-}
-
-/**
- * Doesn't actually consume any wire data, just removes the last field for
- * this struct from the field stack.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readStructEnd() {
-  lastFieldId_ = lastField_.top();
-  lastField_.pop();
-  return 0;
-}
-
-/**
- * Read a field header off the wire.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readFieldBegin(std::string& name,
-                                                       TType& fieldType,
-                                                       int16_t& fieldId) {
-  (void) name;
-  uint32_t rsize = 0;
-  int8_t byte;
-  int8_t type;
-
-  rsize += readByte(byte);
-  type = (byte & 0x0f);
-
-  // if it's a stop, then we can return immediately, as the struct is over.
-  if (type == T_STOP) {
-    fieldType = T_STOP;
-    fieldId = 0;
-    return rsize;
-  }
-
-  // mask off the 4 MSB of the type header. it could contain a field id delta.
-  int16_t modifier = (int16_t)(((uint8_t)byte & 0xf0) >> 4);
-  if (modifier == 0) {
-    // not a delta, look ahead for the zigzag varint field id.
-    rsize += readI16(fieldId);
-  } else {
-    fieldId = (int16_t)(lastFieldId_ + modifier);
-  }
-  fieldType = getTType(type);
-
-  // if this happens to be a boolean field, the value is encoded in the type
-  if (type == detail::compact::CT_BOOLEAN_TRUE ||
-      type == detail::compact::CT_BOOLEAN_FALSE) {
-    // save the boolean value in a special instance variable.
-    boolValue_.hasBoolValue = true;
-    boolValue_.boolValue =
-      (type == detail::compact::CT_BOOLEAN_TRUE ? true : false);
-  }
-
-  // push the new field onto the field stack so we can keep the deltas going.
-  lastFieldId_ = fieldId;
-  return rsize;
-}
-
-/**
- * Read a map header off the wire. If the size is zero, skip reading the key
- * and value type. This means that 0-length maps will yield TMaps without the
- * "correct" types.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readMapBegin(TType& keyType,
-                                                     TType& valType,
-                                                     uint32_t& size) {
-  uint32_t rsize = 0;
-  int8_t kvType = 0;
-  int32_t msize = 0;
-
-  rsize += readVarint32(msize);
-  if (msize != 0)
-    rsize += readByte(kvType);
-
-  if (msize < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  } else if (container_limit_ && msize > container_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-
-  keyType = getTType((int8_t)((uint8_t)kvType >> 4));
-  valType = getTType((int8_t)((uint8_t)kvType & 0xf));
-  size = (uint32_t)msize;
-
-  return rsize;
-}
-
-/**
- * Read a list header off the wire. If the list size is 0-14, the size will
- * be packed into the element type header. If it's a longer list, the 4 MSB
- * of the element type header will be 0xF, and a varint will follow with the
- * true size.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readListBegin(TType& elemType,
-                                                      uint32_t& size) {
-  int8_t size_and_type;
-  uint32_t rsize = 0;
-  int32_t lsize;
-
-  rsize += readByte(size_and_type);
-
-  lsize = ((uint8_t)size_and_type >> 4) & 0x0f;
-  if (lsize == 15) {
-    rsize += readVarint32(lsize);
-  }
-
-  if (lsize < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  } else if (container_limit_ && lsize > container_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-
-  elemType = getTType((int8_t)(size_and_type & 0x0f));
-  size = (uint32_t)lsize;
-
-  return rsize;
-}
-
-/**
- * Read a set header off the wire. If the set size is 0-14, the size will
- * be packed into the element type header. If it's a longer set, the 4 MSB
- * of the element type header will be 0xF, and a varint will follow with the
- * true size.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readSetBegin(TType& elemType,
-                                                     uint32_t& size) {
-  return readListBegin(elemType, size);
-}
-
-/**
- * Read a boolean off the wire. If this is a boolean field, the value should
- * already have been read during readFieldBegin, so we'll just consume the
- * pre-stored value. Otherwise, read a byte.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readBool(bool& value) {
-  if (boolValue_.hasBoolValue == true) {
-    value = boolValue_.boolValue;
-    boolValue_.hasBoolValue = false;
-    return 0;
-  } else {
-    int8_t val;
-    readByte(val);
-    value = (val == detail::compact::CT_BOOLEAN_TRUE);
-    return 1;
-  }
-}
-
-/**
- * Read a single byte off the wire. Nothing interesting here.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readByte(int8_t& byte) {
-  uint8_t b[1];
-  trans_->readAll(b, 1);
-  byte = *(int8_t*)b;
-  return 1;
-}
-
-/**
- * Read an i16 from the wire as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readI16(int16_t& i16) {
-  int32_t value;
-  uint32_t rsize = readVarint32(value);
-  i16 = (int16_t)zigzagToI32(value);
-  return rsize;
-}
-
-/**
- * Read an i32 from the wire as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readI32(int32_t& i32) {
-  int32_t value;
-  uint32_t rsize = readVarint32(value);
-  i32 = zigzagToI32(value);
-  return rsize;
-}
-
-/**
- * Read an i64 from the wire as a zigzag varint.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readI64(int64_t& i64) {
-  int64_t value;
-  uint32_t rsize = readVarint64(value);
-  i64 = zigzagToI64(value);
-  return rsize;
-}
-
-/**
- * No magic here - just read a double off the wire.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readDouble(double& dub) {
-  BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
-  BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
-
-  union {
-    uint64_t bits;
-    uint8_t b[8];
-  } u;
-  trans_->readAll(u.b, 8);
-  u.bits = THRIFT_letohll(u.bits);
-  dub = bitwise_cast<double>(u.bits);
-  return 8;
-}
-
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readString(std::string& str) {
-  return readBinary(str);
-}
-
-/**
- * Read a byte[] from the wire.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readBinary(std::string& str) {
-  int32_t rsize = 0;
-  int32_t size;
-
-  rsize += readVarint32(size);
-  // Catch empty string case
-  if (size == 0) {
-    str = "";
-    return rsize;
-  }
-
-  // Catch error cases
-  if (size < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  }
-  if (string_limit_ > 0 && size > string_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-
-  // Use the heap here to prevent stack overflow for v. large strings
-  if (size > string_buf_size_ || string_buf_ == NULL) {
-    void* new_string_buf = std::realloc(string_buf_, (uint32_t)size);
-    if (new_string_buf == NULL) {
-      throw std::bad_alloc();
-    }
-    string_buf_ = (uint8_t*)new_string_buf;
-    string_buf_size_ = size;
-  }
-  trans_->readAll(string_buf_, size);
-  str.assign((char*)string_buf_, size);
-
-  return rsize + (uint32_t)size;
-}
-
-/**
- * Read an i32 from the wire as a varint. The MSB of each byte is set
- * if there is another byte to follow. This can read up to 5 bytes.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readVarint32(int32_t& i32) {
-  int64_t val;
-  uint32_t rsize = readVarint64(val);
-  i32 = (int32_t)val;
-  return rsize;
-}
-
-/**
- * Read an i64 from the wire as a proper varint. The MSB of each byte is set
- * if there is another byte to follow. This can read up to 10 bytes.
- */
-template <class Transport_>
-uint32_t TCompactProtocolT<Transport_>::readVarint64(int64_t& i64) {
-  uint32_t rsize = 0;
-  uint64_t val = 0;
-  int shift = 0;
-  uint8_t buf[10];  // 64 bits / (7 bits/byte) = 10 bytes.
-  uint32_t buf_size = sizeof(buf);
-  const uint8_t* borrowed = trans_->borrow(buf, &buf_size);
-
-  // Fast path.
-  if (borrowed != NULL) {
-    while (true) {
-      uint8_t byte = borrowed[rsize];
-      rsize++;
-      val |= (uint64_t)(byte & 0x7f) << shift;
-      shift += 7;
-      if (!(byte & 0x80)) {
-        i64 = val;
-        trans_->consume(rsize);
-        return rsize;
-      }
-      // Have to check for invalid data so we don't crash.
-      if (UNLIKELY(rsize == sizeof(buf))) {
-        throw TProtocolException(TProtocolException::INVALID_DATA, "Variable-length int over 10 bytes.");
-      }
-    }
-  }
-
-  // Slow path.
-  else {
-    while (true) {
-      uint8_t byte;
-      rsize += trans_->readAll(&byte, 1);
-      val |= (uint64_t)(byte & 0x7f) << shift;
-      shift += 7;
-      if (!(byte & 0x80)) {
-        i64 = val;
-        return rsize;
-      }
-      // Might as well check for invalid data on the slow path too.
-      if (UNLIKELY(rsize >= sizeof(buf))) {
-        throw TProtocolException(TProtocolException::INVALID_DATA, "Variable-length int over 10 bytes.");
-      }
-    }
-  }
-}
-
-/**
- * Convert from zigzag int to int.
- */
-template <class Transport_>
-int32_t TCompactProtocolT<Transport_>::zigzagToI32(uint32_t n) {
-  return (n >> 1) ^ static_cast<uint32_t>(-static_cast<int32_t>(n & 1));
-}
-
-/**
- * Convert from zigzag long to long.
- */
-template <class Transport_>
-int64_t TCompactProtocolT<Transport_>::zigzagToI64(uint64_t n) {
-  return (n >> 1) ^ static_cast<uint64_t>(-static_cast<int64_t>(n & 1));
-}
-
-template <class Transport_>
-TType TCompactProtocolT<Transport_>::getTType(int8_t type) {
-  switch (type) {
-    case T_STOP:
-      return T_STOP;
-    case detail::compact::CT_BOOLEAN_FALSE:
-    case detail::compact::CT_BOOLEAN_TRUE:
-      return T_BOOL;
-    case detail::compact::CT_BYTE:
-      return T_BYTE;
-    case detail::compact::CT_I16:
-      return T_I16;
-    case detail::compact::CT_I32:
-      return T_I32;
-    case detail::compact::CT_I64:
-      return T_I64;
-    case detail::compact::CT_DOUBLE:
-      return T_DOUBLE;
-    case detail::compact::CT_BINARY:
-      return T_STRING;
-    case detail::compact::CT_LIST:
-      return T_LIST;
-    case detail::compact::CT_SET:
-      return T_SET;
-    case detail::compact::CT_MAP:
-      return T_MAP;
-    case detail::compact::CT_STRUCT:
-      return T_STRUCT;
-    default:
-      throw TException(std::string("don't know what type: ") + (char)type);
-  }
-}
-
-}}} // apache::thrift::protocol
-
-#endif // _THRIFT_PROTOCOL_TCOMPACTPROTOCOL_TCC_


[31/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_javame_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_javame_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_javame_generator.cc
deleted file mode 100644
index b4a13fc..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_javame_generator.cc
+++ /dev/null
@@ -1,3289 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <sstream>
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <cctype>
-
-#include <sys/stat.h>
-#include <stdexcept>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Java code generator.
- *
- */
-class t_javame_generator : public t_oop_generator {
-public:
-  t_javame_generator(t_program* program,
-                     const std::map<std::string, std::string>& parsed_options,
-                     const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-    out_dir_base_ = "gen-javame";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_union(t_struct* tunion);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool in_static,
-                         bool defval = false);
-  std::string render_const_value(std::ofstream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_java_struct(t_struct* tstruct, bool is_exception);
-
-  void generate_java_struct_definition(std::ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_xception = false,
-                                       bool in_class = false,
-                                       bool is_result = false);
-  void generate_java_struct_equality(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_compare_to(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_java_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_tostring(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_clear(std::ofstream& out, t_struct* tstruct);
-  void generate_field_value_meta_data(std::ofstream& out, t_type* type);
-  std::string get_java_type_string(t_type* type);
-  void generate_reflection_setters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_reflection_getters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct);
-  void generate_java_bean_boilerplate(std::ofstream& out, t_struct* tstruct);
-
-  void generate_function_helpers(t_function* tfunction);
-  std::string get_cap_name(std::string name);
-  std::string generate_isset_check(t_field* field);
-  std::string generate_isset_check(std::string field);
-  void generate_isset_set(ofstream& out, t_field* field);
-  std::string isset_field_id(t_field* field);
-
-  void generate_primitive_service_interface(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  void generate_java_union(t_struct* tstruct);
-  void generate_union_constructor(ofstream& out, t_struct* tstruct);
-  void generate_union_getters_and_setters(ofstream& out, t_struct* tstruct);
-  void generate_union_abstract_methods(ofstream& out, t_struct* tstruct);
-  void generate_check_type(ofstream& out, t_struct* tstruct);
-  void generate_read_value(ofstream& out, t_struct* tstruct);
-  void generate_write_value(ofstream& out, t_struct* tstruct);
-  void generate_get_field_desc(ofstream& out, t_struct* tstruct);
-  void generate_get_struct_desc(ofstream& out, t_struct* tstruct);
-  void generate_get_field_name(ofstream& out, t_struct* tstruct);
-
-  void generate_union_comparisons(ofstream& out, t_struct* tstruct);
-  void generate_union_hashcode(ofstream& out, t_struct* tstruct);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_java_doc(std::ofstream& out, t_field* field);
-
-  void generate_java_doc(std::ofstream& out, t_doc* tdoc);
-
-  void generate_java_doc(std::ofstream& out, t_function* tdoc);
-
-  void generate_java_docstring_comment(std::ofstream& out, string contents);
-
-  void generate_deep_copy_container(std::ofstream& out,
-                                    std::string source_name_p1,
-                                    std::string source_name_p2,
-                                    std::string result_name,
-                                    t_type* type);
-  void generate_deep_copy_non_container(std::ofstream& out,
-                                        std::string source_name,
-                                        std::string dest_name,
-                                        t_type* type);
-
-  bool has_bit_vector(t_struct* tstruct);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string java_package();
-  std::string java_type_imports();
-  std::string java_thrift_imports();
-  std::string type_name(t_type* ttype,
-                        bool in_container = false,
-                        bool in_init = false,
-                        bool skip_generic = false);
-  std::string base_type_name(t_base_type* tbase, bool in_container = false);
-  std::string declare_field(t_field* tfield, bool init = false);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct, bool include_types = true);
-  std::string type_to_enum(t_type* ttype);
-  std::string get_enum_class_name(t_type* type);
-  void generate_struct_desc(ofstream& out, t_struct* tstruct);
-  void generate_field_descs(ofstream& out, t_struct* tstruct);
-  std::string box_type(t_type* type, string value);
-
-  bool type_can_be_null(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception() || ttype->is_string()
-           || ttype->is_enum();
-  }
-
-  std::string constant_name(std::string name);
-
-private:
-  /**
-   * File streams
-   */
-
-  std::string package_name_;
-  std::ofstream f_service_;
-  std::string package_dir_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_javame_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  package_name_ = program_->get_namespace("java");
-
-  string dir = package_name_;
-  string subdir = get_out_dir();
-  string::size_type loc;
-  while ((loc = dir.find(".")) != string::npos) {
-    subdir = subdir + "/" + dir.substr(0, loc);
-    MKDIR(subdir.c_str());
-    dir = dir.substr(loc + 1);
-  }
-  if (dir.size() > 0) {
-    subdir = subdir + "/" + dir;
-    MKDIR(subdir.c_str());
-  }
-
-  package_dir_ = subdir;
-}
-
-/**
- * Packages the generated file
- *
- * @return String of the package, i.e. "package org.apache.thriftdemo;"
- */
-string t_javame_generator::java_package() {
-  if (!package_name_.empty()) {
-    return string("package ") + package_name_ + ";\n\n";
-  }
-  return "";
-}
-
-/**
- * Prints standard java imports
- *
- * @return List of imports for Java types that are used in here
- */
-string t_javame_generator::java_type_imports() {
-  return string() + "import java.util.Hashtable;\n" + "import java.util.Vector;\n"
-         + "import java.util.Enumeration;\n\n";
-}
-
-/**
- * Prints standard java imports
- *
- * @return List of imports necessary for thrift
- */
-string t_javame_generator::java_thrift_imports() {
-  return string() + "import org.apache.thrift.*;\n" + "import org.apache.thrift.meta_data.*;\n"
-         + "import org.apache.thrift.transport.*;\n" + "import org.apache.thrift.protocol.*;\n\n";
-}
-
-/**
- * Nothing in Java
- */
-void t_javame_generator::close_generator() {
-}
-
-/**
- * Generates a typedef. This is not done in Java, since it does
- * not support arbitrary name replacements, and it'd be a wacky waste
- * of overhead to make wrapper classes.
- *
- * @param ttypedef The type definition
- */
-void t_javame_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Enums are a class with a set of static constants.
- *
- * @param tenum The enumeration
- */
-void t_javame_generator::generate_enum(t_enum* tenum) {
-  // Make output file
-  string f_enum_name = package_dir_ + "/" + (tenum->get_name()) + ".java";
-  ofstream f_enum;
-  f_enum.open(f_enum_name.c_str());
-
-  // Comment and package it
-  f_enum << autogen_comment() << java_package();
-
-  generate_java_doc(f_enum, tenum);
-  indent(f_enum) << "public class " << tenum->get_name() << " implements org.apache.thrift.TEnum ";
-  scope_up(f_enum);
-  f_enum << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    generate_java_doc(f_enum, *c_iter);
-    indent(f_enum) << "public static final " << tenum->get_name() << " " << (*c_iter)->get_name()
-                   << " = new " << tenum->get_name() << "(" << value << ");" << endl;
-  }
-  f_enum << endl;
-
-  // Field for thriftCode
-  indent(f_enum) << "private final int value;" << endl << endl;
-
-  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << endl;
-  indent(f_enum) << "  this.value = value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
-
-  indent(f_enum) << "/**" << endl;
-  indent(f_enum) << " * Get the integer value of this enum value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public int getValue() {" << endl;
-  indent(f_enum) << "  return value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
-
-  indent(f_enum) << "/**" << endl;
-  indent(f_enum) << " * Find a the enum type by its integer value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " * @return null if the value is not found." << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << endl;
-
-  indent_up();
-
-  indent(f_enum) << "switch (value) {" << endl;
-  indent_up();
-
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_enum) << "case " << value << ":" << endl;
-    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << endl;
-  }
-
-  indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;
-
-  indent_down();
-
-  indent(f_enum) << "}" << endl;
-
-  indent_down();
-
-  indent(f_enum) << "}" << endl;
-
-  scope_down(f_enum);
-
-  f_enum.close();
-}
-
-/**
- * Generates a class that holds all the constants.
- */
-void t_javame_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-
-  string f_consts_name = package_dir_ + "/" + program_name_ + "Constants.java";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  // Print header
-  f_consts << autogen_comment() << java_package() << java_type_imports();
-
-  f_consts << "public class " << program_name_ << "Constants {" << endl << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    print_const_value(f_consts,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value(),
-                      false);
-  }
-  indent_down();
-  indent(f_consts) << "}" << endl;
-  f_consts.close();
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-void t_javame_generator::print_const_value(std::ofstream& out,
-                                           string name,
-                                           t_type* type,
-                                           t_const_value* value,
-                                           bool in_static,
-                                           bool defval) {
-  type = get_true_type(type);
-
-  indent(out);
-  if (!defval) {
-    out << (in_static ? "" : "public static final ") << type_name(type) << " ";
-  }
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
-    out << name << " = " << v2 << ";" << endl << endl;
-  } else if (type->is_enum()) {
-    out << name << " = " << render_const_value(out, name, type, value) << ";" << endl << endl;
-  } else if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << ".";
-      std::string cap_name = get_cap_name(v_iter->first->get_string());
-      out << "set" << cap_name << "(" << val << ");" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_map()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << ".put(" << box_type(ktype, key) << ", " << box_type(vtype, val) << ");"
-                  << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_list() || type->is_set()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      if (type->is_list()) {
-        indent(out) << name << ".addElement(" << box_type(etype, val) << ");" << endl;
-      } else {
-        indent(out) << name << ".put(" << box_type(etype, val) << ", " << box_type(etype, val)
-                    << ");" << endl;
-      }
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else {
-    throw "compiler error: no const of type " + type->get_name();
-  }
-}
-
-string t_javame_generator::render_const_value(ofstream& out,
-                                              string name,
-                                              t_type* type,
-                                              t_const_value* value) {
-  (void)name;
-  type = get_true_type(type);
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-      render << "(byte)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I16:
-      render << "(short)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      render << value->get_integer() << "L";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << "(double)" << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << type_name(type, false, false) << "." << value->get_identifier();
-  } else {
-    string t = tmp("tmp");
-    print_const_value(out, t, type, value, true);
-    render << t;
-  }
-
-  return render.str();
-}
-
-string t_javame_generator::box_type(t_type* type, string value) {
-  if (type->is_base_type()) {
-    switch (((t_base_type*)type)->get_base()) {
-    case t_base_type::TYPE_BOOL:
-      return "new Boolean(" + value + ")";
-    case t_base_type::TYPE_BYTE:
-      return "new Byte(" + value + ")";
-    case t_base_type::TYPE_I16:
-      return "new Short(" + value + ")";
-    case t_base_type::TYPE_I32:
-      return "new Integer(" + value + ")";
-    case t_base_type::TYPE_I64:
-      return "new Long(" + value + ")";
-    case t_base_type::TYPE_DOUBLE:
-      return "new Double(" + value + ")";
-    default:
-      break;
-    }
-  }
-  return value;
-}
-
-/**
- * Generates a struct definition for a thrift data type. This will be a TBase
- * implementor.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_struct(t_struct* tstruct) {
-  if (tstruct->is_union()) {
-    generate_java_union(tstruct);
-  } else {
-    generate_java_struct(tstruct, false);
-  }
-}
-
-/**
- * Exceptions are structs, but they inherit from Exception
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_xception(t_struct* txception) {
-  generate_java_struct(txception, true);
-}
-
-/**
- * Java struct definition.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct(t_struct* tstruct, bool is_exception) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + (tstruct->get_name()) + ".java";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
-
-  generate_java_struct_definition(f_struct, tstruct, is_exception);
-  f_struct.close();
-}
-
-/**
- * Java union definition.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_union(t_struct* tstruct) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + (tstruct->get_name()) + ".java";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
-
-  generate_java_doc(f_struct, tstruct);
-
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  indent(f_struct) << "public " << (is_final ? "final " : "") << "class " << tstruct->get_name()
-                   << " extends TUnion ";
-
-  scope_up(f_struct);
-
-  generate_struct_desc(f_struct, tstruct);
-  generate_field_descs(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_constructor(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_abstract_methods(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_getters_and_setters(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_comparisons(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_hashcode(f_struct, tstruct);
-
-  f_struct << endl;
-
-  scope_down(f_struct);
-
-  f_struct.close();
-}
-
-void t_javame_generator::generate_union_constructor(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public " << type_name(tstruct) << "() {" << endl;
-  indent(out) << "  super();" << endl;
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, Object value) {" << endl;
-  indent(out) << "  super(setField, value);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "public " << type_name(tstruct) << "(" << type_name(tstruct) << " other) {"
-              << endl;
-  indent(out) << "  super(other);" << endl;
-  indent(out) << "}" << endl;
-
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  // generate "constructors" for each field
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name() << "("
-                << type_name((*m_iter)->get_type()) << " value) {" << endl;
-    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << endl;
-    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << endl;
-    indent(out) << "  return x;" << endl;
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-void t_javame_generator::generate_union_getters_and_setters(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  bool first = true;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (first) {
-      first = false;
-    } else {
-      out << endl;
-    }
-
-    t_field* field = (*m_iter);
-
-    generate_java_doc(out, field);
-    indent(out) << "public " << type_name(field->get_type()) << " get"
-                << get_cap_name(field->get_name()) << "() {" << endl;
-    indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                << endl;
-    indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();"
-                << endl;
-    indent(out) << "  } else {" << endl;
-    indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
-                << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
-
-    out << endl;
-
-    generate_java_doc(out, field);
-    indent(out) << "public void set" << get_cap_name(field->get_name()) << "("
-                << type_name(field->get_type()) << " value) {" << endl;
-    if (type_can_be_null(field->get_type())) {
-      indent(out) << "  if (value == null) throw new NullPointerException();" << endl;
-    }
-    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << endl;
-    indent(out) << "  value_ = value;" << endl;
-    indent(out) << "}" << endl;
-  }
-}
-
-void t_javame_generator::generate_union_abstract_methods(ofstream& out, t_struct* tstruct) {
-  generate_check_type(out, tstruct);
-  out << endl;
-  generate_read_value(out, tstruct);
-  out << endl;
-  generate_write_value(out, tstruct);
-  out << endl;
-  generate_get_field_desc(out, tstruct);
-  out << endl;
-  generate_get_struct_desc(out, tstruct);
-  out << endl;
-}
-
-void t_javame_generator::generate_check_type(ofstream& out, t_struct* tstruct) {
-  indent(out)
-      << "protected void checkType(_Fields setField, Object value) throws ClassCastException {"
-      << endl;
-  indent_up();
-
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true)
-                << ") {" << endl;
-    indent(out) << "    break;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "  throw new ClassCastException(\"Was expecting value of type "
-                << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
-                << "', but got \" + value.getClass().getSimpleName());" << endl;
-    // do the real check here
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_javame_generator::generate_read_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "protected Object readValue(TProtocol iprot, TField field) throws TException {"
-              << endl;
-
-  indent_up();
-
-  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
-  indent_up();
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << "if (field.type == " << constant_name(field->get_name()) << "_FIELD_DESC.type) {"
-                << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
-    generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
-    indent_down();
-    indent(out) << "} else {" << endl;
-    indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << endl;
-    indent(out) << "  return null;" << endl;
-    indent(out) << "}" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "} else {" << endl;
-  indent_up();
-  indent(out) << "TProtocolUtil.skip(iprot, field.type);" << endl;
-  indent(out) << "return null;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_javame_generator::generate_write_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "protected void writeValue(TProtocol oprot) throws TException {" << endl;
-
-  indent_up();
-
-  indent(out) << "switch (setField_) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
-    generate_serialize_field(out, field, "");
-    indent(out) << "return;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-
-  indent(out) << "}" << endl;
-}
-
-void t_javame_generator::generate_get_field_desc(ofstream& out, t_struct* tstruct) {
-  indent(out) << "protected TField getFieldDesc(_Fields setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << endl;
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_javame_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "protected TStruct getStructDesc() {" << endl;
-  indent(out) << "  return STRUCT_DESC;" << endl;
-  indent(out) << "}" << endl;
-}
-
-void t_javame_generator::generate_union_comparisons(ofstream& out, t_struct* tstruct) {
-  // equality
-  indent(out) << "public boolean equals(Object other) {" << endl;
-  indent(out) << "  if (other instanceof " << tstruct->get_name() << ") {" << endl;
-  indent(out) << "    return equals((" << tstruct->get_name() << ")other);" << endl;
-  indent(out) << "  } else {" << endl;
-  indent(out) << "    return false;" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl;
-
-  out << endl;
-
-  indent(out) << "public boolean equals(" << tstruct->get_name() << " other) {" << endl;
-  indent(out) << "  return other != null && getSetField() == other.getSetField() && "
-                 "getFieldValue().equals(other.getFieldValue());" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
-  indent(out) << "  int lastComparison = TBaseHelper.compareTo(getSetField(), other.getSetField());"
-              << endl;
-  indent(out) << "  if (lastComparison == 0) {" << endl;
-  indent(out) << "    return TBaseHelper.compareTo(getFieldValue(), other.getFieldValue());"
-              << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return lastComparison;" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-}
-
-void t_javame_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "/**" << endl;
-  indent(out)
-      << " * If you'd like this to perform more respectably, use the hashcode generator option."
-      << endl;
-  indent(out) << " */" << endl;
-  indent(out) << "public int hashCode() {" << endl;
-  indent(out) << "  return 0;" << endl;
-  indent(out) << "}" << endl;
-}
-
-/**
- * Java struct definition. This has various parameters, as it could be
- * generated standalone or inside another class as a helper. If it
- * is a helper than it is a static class.
- *
- * @param tstruct      The struct definition
- * @param is_exception Is this an exception?
- * @param in_class     If inside a class, needs to be static class
- * @param is_result    If this is a result it needs a different writer
- */
-void t_javame_generator::generate_java_struct_definition(ofstream& out,
-                                                         t_struct* tstruct,
-                                                         bool is_exception,
-                                                         bool in_class,
-                                                         bool is_result) {
-  generate_java_doc(out, tstruct);
-
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  indent(out) << "public " << (is_final ? "final " : "") << (in_class ? "static " : "") << "class "
-              << tstruct->get_name() << " ";
-
-  if (is_exception) {
-    out << "extends Exception ";
-  }
-  out << "implements TBase ";
-
-  scope_up(out);
-
-  generate_struct_desc(out, tstruct);
-
-  // Members are public for -java, private for -javabean
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  out << endl;
-
-  generate_field_descs(out, tstruct);
-
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "private ";
-    out << declare_field(*m_iter, false) << endl;
-  }
-
-  // isset data
-  if (members.size() > 0) {
-    out << endl;
-
-    indent(out) << "// isset id assignments" << endl;
-
-    int i = 0;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (!type_can_be_null((*m_iter)->get_type())) {
-        indent(out) << "private static final int " << isset_field_id(*m_iter) << " = " << i << ";"
-                    << endl;
-        i++;
-      }
-    }
-
-    if (i > 0) {
-      indent(out) << "private boolean[] __isset_vector = new boolean[" << i << "];" << endl;
-    }
-
-    out << endl;
-  }
-
-  bool all_optional_members = true;
-
-  // Default constructor
-  indent(out) << "public " << tstruct->get_name() << "() {" << endl;
-  indent_up();
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL) {
-      print_const_value(out,
-                        "this." + (*m_iter)->get_name(),
-                        t,
-                        (*m_iter)->get_value(),
-                        true,
-                        true);
-    }
-    if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-      all_optional_members = false;
-    }
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  if (!members.empty() && !all_optional_members) {
-    // Full constructor for all fields
-    indent(out) << "public " << tstruct->get_name() << "(" << endl;
-    indent_up();
-    bool first = true;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-        if (!first) {
-          out << "," << endl;
-        }
-        first = false;
-        indent(out) << type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name();
-      }
-    }
-    out << ")" << endl;
-    indent_down();
-    indent(out) << "{" << endl;
-    indent_up();
-    indent(out) << "this();" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-        indent(out) << "this." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << ";"
-                    << endl;
-        generate_isset_set(out, (*m_iter));
-      }
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-
-  // copy constructor
-  indent(out) << "/**" << endl;
-  indent(out) << " * Performs a deep copy on <i>other</i>." << endl;
-  indent(out) << " */" << endl;
-  indent(out) << "public " << tstruct->get_name() << "(" << tstruct->get_name() << " other) {"
-              << endl;
-  indent_up();
-
-  if (has_bit_vector(tstruct)) {
-    indent(out) << "System.arraycopy(other.__isset_vector, 0, __isset_vector, 0, "
-                   "other.__isset_vector.length);" << endl;
-  }
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-    std::string field_name = field->get_name();
-    t_type* type = field->get_type();
-    bool can_be_null = type_can_be_null(type);
-
-    if (can_be_null) {
-      indent(out) << "if (other." << generate_isset_check(field) << ") {" << endl;
-      indent_up();
-    }
-
-    if (type->is_container()) {
-      generate_deep_copy_container(out, "other", field_name, "__this__" + field_name, type);
-      indent(out) << "this." << field_name << " = __this__" << field_name << ";" << endl;
-    } else {
-      indent(out) << "this." << field_name << " = ";
-      generate_deep_copy_non_container(out, "other." + field_name, field_name, type);
-      out << ";" << endl;
-    }
-
-    if (can_be_null) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  // clone method, so that you can deep copy an object when you don't know its class.
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  generate_java_struct_clear(out, tstruct);
-
-  generate_java_bean_boilerplate(out, tstruct);
-  generate_generic_field_getters_setters(out, tstruct);
-
-  generate_java_struct_equality(out, tstruct);
-  generate_java_struct_compare_to(out, tstruct);
-
-  generate_java_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_java_struct_result_writer(out, tstruct);
-  } else {
-    generate_java_struct_writer(out, tstruct);
-  }
-  generate_java_struct_tostring(out, tstruct);
-  generate_java_validator(out, tstruct);
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generates equals methods and a hashCode method for a structure.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct_equality(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public boolean equals(Object that) {" << endl;
-  indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl
-      << indent() << "if (that instanceof " << tstruct->get_name() << ")" << endl << indent()
-      << "  return this.equals((" << tstruct->get_name() << ")that);" << endl << indent()
-      << "return false;" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "public boolean equals(" << tstruct->get_name() << " that) {" << endl;
-  indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
-
-    t_type* t = get_true_type((*m_iter)->get_type());
-    // Most existing Thrift code does not use isset or optional/required,
-    // so we treat "default" fields as required.
-    bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
-    bool can_be_null = type_can_be_null(t);
-    string name = (*m_iter)->get_name();
-
-    string this_present = "true";
-    string that_present = "true";
-    string unequal;
-
-    if (is_optional || can_be_null) {
-      this_present += " && this." + generate_isset_check(*m_iter);
-      that_present += " && that." + generate_isset_check(*m_iter);
-    }
-
-    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << endl
-        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << endl
-        << indent() << "if ("
-        << "this_present_" << name << " || that_present_" << name << ") {" << endl;
-    indent_up();
-    out << indent() << "if (!("
-        << "this_present_" << name << " && that_present_" << name << "))" << endl << indent()
-        << "  return false;" << endl;
-
-    if (t->is_base_type() && ((t_base_type*)t)->is_binary()) {
-      unequal = "TBaseHelper.compareTo(this." + name + ", that." + name + ") != 0";
-    } else if (can_be_null) {
-      unequal = "!this." + name + ".equals(that." + name + ")";
-    } else {
-      unequal = "this." + name + " != that." + name;
-    }
-
-    out << indent() << "if (" << unequal << ")" << endl << indent() << "  return false;" << endl;
-
-    scope_down(out);
-  }
-  out << endl;
-  indent(out) << "return true;" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "public int hashCode() {" << endl;
-  indent_up();
-  indent(out) << "return 0;" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_javame_generator::generate_java_struct_compare_to(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public int compareTo(Object otherObject) {" << endl;
-  //  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
-  indent_up();
-
-  indent(out) << "if (!getClass().equals(otherObject.getClass())) {" << endl;
-  indent(out) << "  return getClass().getName().compareTo(otherObject.getClass().getName());"
-              << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-  indent(out) << type_name(tstruct) << " other = (" << type_name(tstruct) << ")otherObject;";
-
-  indent(out) << "int lastComparison = 0;" << endl;
-  out << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = *m_iter;
-    indent(out) << "lastComparison = TBaseHelper.compareTo(" << generate_isset_check(field)
-                << ", other." << generate_isset_check(field) << ");" << endl;
-    indent(out) << "if (lastComparison != 0) {" << endl;
-    indent(out) << "  return lastComparison;" << endl;
-    indent(out) << "}" << endl;
-
-    indent(out) << "if (" << generate_isset_check(field) << ") {" << endl;
-    if (field->get_type()->is_struct() || field->get_type()->is_xception()) {
-      indent(out) << "  lastComparison = this." << field->get_name() << ".compareTo(other."
-                  << field->get_name() << ");" << endl;
-    } else {
-      indent(out) << "  lastComparison = TBaseHelper.compareTo(this." << field->get_name()
-                  << ", other." << field->get_name() << ");" << endl;
-    }
-
-    indent(out) << "  if (lastComparison != 0) {" << endl;
-    indent(out) << "    return lastComparison;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
-  }
-
-  indent(out) << "return 0;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to read all the fields of the struct.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct_reader(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public void read(TProtocol iprot) throws TException {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Declare stack tmp variables and read struct header
-  out << indent() << "TField field;" << endl << indent() << "iprot.readStructBegin();" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if (field.type == TType.STOP) { " << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Switch statement on the field we are reading
-  indent(out) << "switch (field.id) {" << endl;
-
-  indent_up();
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ": // "
-                << constant_name((*f_iter)->get_name()) << endl;
-    indent_up();
-    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    generate_deserialize_field(out, *f_iter, "this.");
-    generate_isset_set(out, *f_iter);
-    indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-        << endl << indent() << "}" << endl << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  TProtocolUtil.skip(iprot, field.type);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  out << indent() << "iprot.readStructEnd();" << endl;
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-// generates java method to perform various checks
-// (e.g. check that all required fields are set)
-void t_javame_generator::generate_java_validator(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public void validate() throws TException {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "// check for required fields" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl << indent()
-          << "  throw new TProtocolException(\"Required field '" << (*f_iter)->get_name()
-          << "' is unset! Struct:\" + toString());" << endl << indent() << "}" << endl << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public void write(TProtocol oprot) throws TException {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl << endl;
-
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool null_allowed = type_can_be_null((*f_iter)->get_type());
-    if (null_allowed) {
-      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << endl;
-      indent_up();
-    }
-    bool optional = (*f_iter)->get_req() == t_field::T_OPTIONAL;
-    if (optional) {
-      indent(out) << "if (" << generate_isset_check((*f_iter)) << ") {" << endl;
-      indent_up();
-    }
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    if (optional) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    if (null_allowed) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-  // Write the struct map
-  out << indent() << "oprot.writeFieldStop();" << endl << indent() << "oprot.writeStructEnd();"
-      << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct,
- * which is a function result. These fields are only written
- * if they are set in the Isset array, and only one of them
- * can be set at a time.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public void write(TProtocol oprot) throws TException {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << endl << indent() << "if ";
-    } else {
-      out << " else if ";
-    }
-
-    out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
-
-    indent_up();
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}";
-  }
-  // Write the struct map
-  out << endl << indent() << "oprot.writeFieldStop();" << endl << indent()
-      << "oprot.writeStructEnd();" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-void t_javame_generator::generate_reflection_getters(ostringstream& out,
-                                                     t_type* type,
-                                                     string field_name,
-                                                     string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
-  indent_up();
-
-  if (type->is_base_type() && !type->is_string()) {
-    t_base_type* base_type = (t_base_type*)type;
-
-    indent(out) << "return new " << type_name(type, true, false) << "("
-                << (base_type->is_bool() ? "is" : "get") << cap_name << "());" << endl << endl;
-  } else {
-    indent(out) << "return get" << cap_name << "();" << endl << endl;
-  }
-
-  indent_down();
-}
-
-void t_javame_generator::generate_reflection_setters(ostringstream& out,
-                                                     t_type* type,
-                                                     string field_name,
-                                                     string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
-  indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << endl;
-  indent(out) << "}" << endl;
-  indent(out) << "break;" << endl << endl;
-
-  indent_down();
-}
-
-void t_javame_generator::generate_generic_field_getters_setters(std::ofstream& out,
-                                                                t_struct* tstruct) {
-  (void)out;
-  std::ostringstream getter_stream;
-  std::ostringstream setter_stream;
-
-  // build up the bodies of both the getter and setter at once
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    indent_up();
-    generate_reflection_setters(setter_stream, type, field_name, cap_name);
-    generate_reflection_getters(getter_stream, type, field_name, cap_name);
-    indent_down();
-  }
-}
-
-/**
- * Generates a set of Java Bean boilerplate functions (setters, getters, etc.)
- * for the given struct.
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_bean_boilerplate(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    if (type->is_container()) {
-      // Method to return the size of the collection
-      indent(out) << "public int get" << cap_name;
-      out << get_cap_name("size() {") << endl;
-
-      indent_up();
-      indent(out) << "return (this." << field_name << " == null) ? 0 : "
-                  << "this." << field_name << ".size();" << endl;
-      indent_down();
-      indent(out) << "}" << endl << endl;
-    }
-
-    if (type->is_set() || type->is_list()) {
-
-      t_type* element_type;
-      if (type->is_set()) {
-        element_type = ((t_set*)type)->get_elem_type();
-      } else {
-        element_type = ((t_list*)type)->get_elem_type();
-      }
-
-      // Iterator getter for sets and lists
-      indent(out) << "public Enumeration get" << cap_name;
-      out << get_cap_name("Enumeration() {") << endl;
-
-      indent_up();
-      indent(out) << "return (this." << field_name << " == null) ? null : "
-                  << "this." << field_name << ".elements();" << endl;
-      indent_down();
-      indent(out) << "}" << endl << endl;
-
-      // Add to set or list, create if the set/list is null
-      indent(out);
-      out << "public void add" << get_cap_name("to");
-      out << cap_name << "(" << type_name(element_type) << " elem) {" << endl;
-
-      indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
-      indent_up();
-      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-      if (type->is_set()) {
-        indent(out) << "this." << field_name << ".put(" << box_type(element_type, "elem") << ", "
-                    << box_type(element_type, "elem") << ");" << endl;
-      } else {
-        indent(out) << "this." << field_name << ".addElement(" << box_type(element_type, "elem")
-                    << ");" << endl;
-      }
-      indent_down();
-      indent(out) << "}" << endl << endl;
-
-    } else if (type->is_map()) {
-      // Put to map
-      t_type* key_type = ((t_map*)type)->get_key_type();
-      t_type* val_type = ((t_map*)type)->get_val_type();
-
-      indent(out);
-      out << "public void putTo" << cap_name << "(" << type_name(key_type, true) << " key, "
-          << type_name(val_type, true) << " val) {" << endl;
-
-      indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
-      indent_up();
-      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".put(key, val);" << endl;
-      indent_down();
-      indent(out) << "}" << endl << endl;
-    }
-
-    // Simple getter
-    generate_java_doc(out, field);
-    indent(out) << "public " << type_name(type);
-    if (type->is_base_type() && ((t_base_type*)type)->get_base() == t_base_type::TYPE_BOOL) {
-      out << " is";
-    } else {
-      out << " get";
-    }
-    out << cap_name << "() {" << endl;
-    indent_up();
-    indent(out) << "return this." << field_name << ";" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Simple setter
-    generate_java_doc(out, field);
-    indent(out) << "public ";
-    out << "void";
-    out << " set" << cap_name << "(" << type_name(type) << " " << field_name << ") {" << endl;
-    indent_up();
-    indent(out) << "this." << field_name << " = " << field_name << ";" << endl;
-    generate_isset_set(out, field);
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Unsetter
-    indent(out) << "public void unset" << cap_name << "() {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
-    } else {
-      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = false;" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // isSet method
-    indent(out) << "/** Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise */" << endl;
-    indent(out) << "public boolean is" << get_cap_name("set") << cap_name << "() {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "return this." << field_name << " != null;" << endl;
-    } else {
-      indent(out) << "return __isset_vector[" << isset_field_id(field) << "];" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    indent(out) << "public void set" << cap_name << get_cap_name("isSet") << "(boolean value) {"
-                << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "if (!value) {" << endl;
-      indent(out) << "  this." << field_name << " = null;" << endl;
-      indent(out) << "}" << endl;
-    } else {
-      indent(out) << "__isset_vector[" << isset_field_id(field) << "] = value;" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a toString() method for the given struct
- *
- * @param tstruct The struct definition
- */
-void t_javame_generator::generate_java_struct_tostring(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public String toString() {" << endl;
-  indent_up();
-
-  out << indent() << "StringBuffer sb = new StringBuffer(\"" << tstruct->get_name() << "(\");"
-      << endl;
-  out << indent() << "boolean first = true;" << endl << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
-    if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
-      indent_up();
-    }
-
-    t_field* field = (*f_iter);
-
-    if (!first) {
-      indent(out) << "if (!first) sb.append(\", \");" << endl;
-    }
-    indent(out) << "sb.append(\"" << (*f_iter)->get_name() << ":\");" << endl;
-    bool can_be_null = type_can_be_null(field->get_type());
-    if (can_be_null) {
-      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << endl;
-      indent(out) << "  sb.append(\"null\");" << endl;
-      indent(out) << "} else {" << endl;
-      indent_up();
-    }
-
-    if (field->get_type()->is_base_type() && ((t_base_type*)(field->get_type()))->is_binary()) {
-      indent(out) << "TBaseHelper.toString(this." << field->get_name() << ", sb);" << endl;
-    } else {
-      indent(out) << "sb.append(this." << (*f_iter)->get_name() << ");" << endl;
-    }
-
-    if (can_be_null) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    indent(out) << "first = false;" << endl;
-
-    if (could_be_unset) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    first = false;
-  }
-  out << indent() << "sb.append(\")\");" << endl << indent() << "return sb.toString();" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Returns a string with the java representation of the given thrift type
- * (e.g. for the type struct it returns "TType.STRUCT")
- */
-std::string t_javame_generator::get_java_type_string(t_type* type) {
-  if (type->is_list()) {
-    return "TType.LIST";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_enum()) {
-    return "TType.ENUM";
-  } else if (type->is_typedef()) {
-    return get_java_type_string(((t_typedef*)type)->get_type());
-  } else if (type->is_base_type()) {
-    switch (((t_base_type*)type)->get_base()) {
-    case t_base_type::TYPE_VOID:
-      return "TType.VOID";
-      break;
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-      break;
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-      break;
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-      break;
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-      break;
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-      break;
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-      break;
-    default:
-      throw std::runtime_error("Unknown thrift type \"" + type->get_name()
-                               + "\" passed to t_javame_generator::get_java_type_string!");
-      break; // This should never happen!
-    }
-  } else {
-    throw std::runtime_error(
-        "Unknown thrift type \"" + type->get_name()
-        + "\" passed to t_javame_generator::get_java_type_string!"); // This should never happen!
-  }
-}
-
-void t_javame_generator::generate_field_value_meta_data(std::ofstream& out, t_type* type) {
-  out << endl;
-  indent_up();
-  indent_up();
-  if (type->is_struct()) {
-    indent(out) << "new StructMetaData(TType.STRUCT, " << type_name(type) << ".class";
-  } else if (type->is_container()) {
-    if (type->is_list()) {
-      indent(out) << "new ListMetaData(TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else if (type->is_set()) {
-      indent(out) << "new SetMetaData(TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else { // map
-      indent(out) << "new MapMetaData(TType.MAP, ";
-      t_type* key_type = ((t_map*)type)->get_key_type();
-      t_type* val_type = ((t_map*)type)->get_val_type();
-      generate_field_value_meta_data(out, key_type);
-      out << ", ";
-      generate_field_value_meta_data(out, val_type);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << "new EnumMetaData(TType.ENUM, " << type_name(type) << ".class";
-  } else {
-    indent(out) << "new FieldValueMetaData(" << get_java_type_string(type);
-    if (type->is_typedef()) {
-      indent(out) << ", \"" << ((t_typedef*)type)->get_symbolic() << "\"";
-    }
-  }
-  out << ")";
-  indent_down();
-  indent_down();
-}
-
-/**
- * Generates a thrift service. In C++, this comprises an entirely separate
- * header and source file. The header file defines the methods and includes
- * the data types defined in the main header file, and the implementation
- * file contains implementations of the basic printer and default interfaces.
- *
- * @param tservice The service definition
- */
-void t_javame_generator::generate_service(t_service* tservice) {
-  // Make output file
-  string f_service_name = package_dir_ + "/" + service_name_ + ".java";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
-
-  f_service_ << "public class " << service_name_ << " {" << endl << endl;
-  indent_up();
-
-  // Generate the three main parts of the service
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-
-  indent_down();
-  f_service_ << "}" << endl;
-  f_service_.close();
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_javame_generator::generate_primitive_service_interface(t_service* tservice) {
-  f_service_ << indent() << "public interface Iface extends " << service_name_ << "Iface { }"
-             << endl << endl;
-
-  string f_interface_name = package_dir_ + "/" + service_name_ + "Iface.java";
-  std::ofstream f_iface;
-  f_iface.open(f_interface_name.c_str());
-
-  string extends_iface = "";
-  if (tservice->get_extends() != NULL) {
-    extends_iface = " extends " + type_name(tservice->get_extends()) + "Iface";
-  }
-
-  f_iface << autogen_comment() << java_package() << java_type_imports() << java_thrift_imports();
-  generate_java_doc(f_iface, tservice);
-  f_iface << "public interface " << service_name_ << "Iface" << extends_iface << " {" << endl
-          << endl;
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_java_doc(f_iface, *f_iter);
-    f_iface << "  public " << function_signature(*f_iter) << ";" << endl << endl;
-  }
-  f_iface << "}" << endl << endl;
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_javame_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_iface = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_iface = " extends " + extends + ".Iface";
-  }
-
-  generate_java_doc(f_service_, tservice);
-  f_service_ << indent() << "public interface Iface" << extends_iface << " {" << endl << endl;
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_java_doc(f_service_, *f_iter);
-    indent(f_service_) << "public " << function_signature(*f_iter) << ";" << endl << endl;
-  }
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates structs for all the service args and return types
- *
- * @param tservice The service
- */
-void t_javame_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_java_struct_definition(f_service_, ts, false, true);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_javame_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_client = " extends " + extends + ".Client";
-  }
-
-  indent(f_service_) << "public static class Client" << extends_client
-                     << " implements TServiceClient, Iface {" << endl;
-  indent_up();
-
-  indent(f_service_) << "public Client(TProtocol prot)" << endl;
-  scope_up(f_service_);
-  indent(f_service_) << "this(prot, prot);" << endl;
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  indent(f_service_) << "public Client(TProtocol iprot, TProtocol oprot)" << endl;
-  scope_up(f_service_);
-  if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl << indent() << "oprot_ = oprot;" << endl;
-  } else {
-    f_service_ << indent() << "super(iprot, oprot);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected TProtocol iprot_;" << endl << indent()
-               << "protected TProtocol oprot_;" << endl << endl << indent()
-               << "protected int seqid_;" << endl << endl;
-
-    indent(f_service_) << "public TProtocol getInputProtocol()" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.iprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    indent(f_service_) << "public TProtocol getOutputProtocol()" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.oprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    indent(f_service_) << "public " << function_signature(*f_iter) << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "send_" << funname << "(";
-
-    // Get the struct of function call params
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-
-    // Declare the function arguments
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << (*fld_iter)->get_name();
-    }
-    f_service_ << ");" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "recv_" << funname << "();" << endl;
-    }
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    t_function send_function(g_type_void,
-                             string("send_") + (*f_iter)->get_name(),
-                             (*f_iter)->get_arglist());
-
-    string argsname = (*f_iter)->get_name() + "_args";
-
-    // Open function
-    indent(f_service_) << "public " << function_signature(&send_function) << endl;
-    scope_up(f_service_);
-
-    // Serialize the request
-    f_service_ << indent() << "oprot_.writeMessageBegin(new TMessage(\"" << funname << "\", "
-               << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-               << ", ++seqid_));" << endl << indent() << argsname << " args = new " << argsname
-               << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args.set" << get_cap_name((*fld_iter)->get_name()) << "("
-                 << (*fld_iter)->get_name() << ");" << endl;
-    }
-
-    f_service_ << indent() << "args.write(oprot_);" << endl << indent()
-               << "oprot_.writeMessageEnd();" << endl << indent()
-               << "oprot_.getTransport().flush();" << endl;
-
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      string resultname = (*f_iter)->get_name() + "_result";
-
-      t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs,
-                               (*f_iter)->get_xceptions());
-      // Open function
-      indent(f_service_) << "public " << function_signature(&recv_function) << endl;
-      scope_up(f_service_);
-
-      f_service_ << indent() << "TMessage msg = iprot_.readMessageBegin();" << endl << indent()
-                 << "if (msg.type == TMessageType.EXCEPTION) {" << endl << indent()
-                 << "  TApplicationException x = TApplicationException.read(iprot_);" << endl
-                 << indent() << "  iprot_.readMessageEnd();" << endl << indent() << "  throw x;"
-                 << endl << indent() << "}" << endl << indent() << "if (msg.seqid != seqid_) {"
-                 << endl << indent()
-                 << "  throw new TApplicationException(TApplicationException.BAD_SEQUENCE_ID, \""
-                 << (*f_iter)->get_name() << " failed: out of sequence response\");" << endl
-                 << indent() << "}" << endl << indent() << resultname << " result = new "
-                 << resultname << "();" << endl << indent() << "result.read(iprot_);" << endl
-                 << indent() << "iprot_.readMessageEnd();" << endl;
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << endl
-                   << indent() << "  return result.success;" << endl << indent() << "}" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (result." << (*x_iter)->get_name() << " != null) {" << endl
-                   << indent() << "  throw result." << (*x_iter)->get_name() << ";" << endl
-                   << indent() << "}" << endl;
-      }
-
-      // If you get here it's an exception, unless a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
-      } else {
-        f_service_ << indent()
-                   << "throw new TApplicationException(TApplicationException.MISSING_RESULT, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
-      }
-
-      // Close function
-      scope_down(f_service_);
-      f_service_ << endl;
-    }
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl;
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_javame_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  // Extends stuff
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_processor = " extends " + extends + ".Processor";
-  }
-
-  // Generate the header portion
-  indent(f_service_) << "public static class Processor" << extends_processor
-                     << " implements TProcessor {" << endl;
-  indent_up();
-
-  indent(f_service_) << "public Processor(Iface iface)" << endl;
-  scope_up(f_service_);
-  if (!extends.empty()) {
-    f_service_ << indent() << "super(iface);" << endl;
-  }
-  f_service_ << indent() << "iface_ = iface;" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "processMap_.put(\"" << (*f_iter)->get_name() << "\", new "
-               << (*f_iter)->get_name() << "());" << endl;
-  }
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_
-        << indent() << "protected static interface ProcessFunction {" << endl << indent()
-        << "  public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException;"
-        << endl << indent() << "}" << endl << endl;
-  }
-
-  f_service_ << indent() << "private Iface iface_;" << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected final Hashtable processMap_ = new Hashtable();" << endl;
-  }
-
-  f_service_ << endl;
-
-  // Generate the server implementation
-  indent(f_service_) << "public boolean process(TProtocol iprot, TProtocol oprot) throws TException"
-                     << endl;
-  scope_up(f_service_);
-
-  f_service_ << indent() << "TMessage msg = iprot.readMessageBegin();" << endl;
-
-  // TODO(mcslee): validate message, was the seqid etc. legit?
-
-  f_service_
-      << indent() << "ProcessFunction fn = (ProcessFunction)processMap_.get(msg.name);" << endl
-      << indent() << "if (fn == null) {" << endl << indent()
-      << "  TProtocolUtil.skip(iprot, TType.STRUCT);" << endl << indent()
-      << "  iprot.readMessageEnd();" << endl << indent()
-      << "  TApplicationException x = new "
-         "TApplicationException(TApplicationException.UNKNOWN_METHOD, \"Invalid method name: "
-         "'\"+msg.name+\"'\");" << endl << indent()
-      << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));"
-      << endl << indent() << "  x.write(oprot);" << endl << indent() << "  oprot.writeMessageEnd();"
-      << endl << indent() << "  oprot.getTransport().flush();" << endl << indent()
-      << "  return true;" << endl << indent() << "}" << endl << indent()
-      << "fn.process(msg.seqid, iprot, oprot);" << endl;
-
-  f_service_ << indent() << "return true;" << endl;
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl << endl;
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_javame_generator::generate_function_helpers(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return;
-  }
-
-  t_struct result(program_, tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_java_struct_definition(f_service_, &result, false, true, true);
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_javame_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open class
-  indent(f_service_) << "private class " << tfunction->get_name() << " implements ProcessFunction {"
-                     << endl;
-  indent_up();
-
-  // Open function
-  indent(f_service_)
-      << "public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException"
-      << endl;
-  scope_up(f_service_);
-
-  string argsname = tfunction->get_name() + "_args";
-  string resultname = tfunction->get_name() + "_result";
-
-  f_service_ << indent() << argsname << " args = new " << argsname << "();" << endl << indent()
-             << "try {" << endl;
-  indent_up();
-  f_service_ << indent() << "args.read(iprot);" << endl;
-  indent_down();
-  f_service_ << indent() << "} catch (TProtocolException e) {" << endl;
-  indent_up();
-  f_service_ << indent() << "iprot.readMessageEnd();" << endl << indent()
-             << "TApplicationException x = new "
-                "TApplicationException(TApplicationException.PROTOCOL_ERROR, e.getMessage());"
-             << endl << indent() << "oprot.writeMessageBegin(new TMessage(\""
-             << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << endl << indent()
-             << "x.write(oprot);" << endl << indent() << "oprot.writeMessageEnd();" << endl
-             << indent() << "oprot.getTransport().flush();" << endl << indent() << "return;"
-             << endl;
-  indent_down();
-  f_service_ << indent() << "}" << endl;
-  f_service_ << indent() << "iprot.readMessageEnd();" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << resultname << " result = new " << resultname << "();" << endl;
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
-    indent_up();
-  }
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_ << indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "result.success = ";
-  }
-  f_service_ << "iface_." << tfunction->get_name() << "(";
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_service_ << ", ";
-    }
-    f_service_ << "args." << (*f_iter)->get_name();
-  }
-  f_service_ << ");" << endl;
-
-  // Set isset on success field
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()
-      && !type_can_be_null(tfunction->get_returntype())) {
-    f_service_ << indent() << "result.set" << get_cap_name("success") << get_cap_name("isSet")
-               << "(true);" << endl;
-  }
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    indent_down();
-    f_service_ << indent() << "}";
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << " catch (" << type_name((*x_iter)->get_type(), false, false) << " "
-                 << (*x_iter)->get_name() << ") {" << endl;
-      if (!tfunction->is_oneway()) {
-        indent_up();
-        f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << ";" << endl;
-        indent_down();
-        f_service_ << indent() << "}";
-      } else {
-        f_service_ << "}";
-      }
-    }
-    f_service_ << " catch (Throwable th) {" << endl;
-    indent_up();
-    f_service_ << indent() << "TApplicationException x = new "
-                              "TApplicationException(TApplicationException.INTERNAL_ERROR, "
-                              "\"Internal error processing " << tfunction->get_name() << "\");"
-               << endl << indent() << "oprot.writeMessageBegin(new TMessage(\""
-               << tfunction->get_name() << "\", TMessageType.EXCEPTION, seqid));" << endl
-               << indent() << "x.write(oprot);" << endl << indent() << "oprot.writeMessageEnd();"
-               << endl << indent() << "oprot.getTransport().flush();" << endl << indent()
-               << "return;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    scope_down(f_service_);
-
-    // Close class
-    indent_down();
-    f_service_ << indent() << "}" << endl << endl;
-    return;
-  }
-
-  f_service_ << indent() << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.REPLY, seqid));" << endl << indent() << "result.write(oprot);"
-             << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-             << "oprot.getTransport().flush();" << endl;
-
-  // Close function
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Close class
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Deserializes a field of any type.
- *
- * @param tfield The field
- * @param prefix The variable name or container for this field
- */
-void t_javame_generator::generate_deserialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type()) {
-    indent(out) << name << " = iprot.";
-
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "compiler error: cannot serialize void field in a struct: " + name;
-      break;
-    case t_base_type::TYPE_STRING:
-      if (!((t_base_type*)type)->is_binary()) {
-        out << "readString();";
-      } else {
-        out << "readBinary();";
-      }
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << "readBool();";
-      break;
-    case t_base_type::TYPE_BYTE:
-      out << "readByte();";
-      break;
-    case t_base_type::TYPE_I16:
-      out << "readI16();";
-      break;
-    case t_base_type::TYPE_I32:
-      out << "readI32();";
-      break;
-    case t_base_type::TYPE_I64:
-      out << "readI64();";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      out << "readDouble();";
-      break;
-    default:
-      throw "compiler error: no Java name for base type " + t_base_type::t_base_name(tbase);
-    }
-    out << endl;
-  } else if (type->is_enum()) {
-    indent(out) << name << " = "
-                << type_name(tfield->get_type(), true, false) + ".findByValue(iprot.readI32());"
-                << endl;
-  } else {
-    printf("

<TRUNCATED>


[52/54] incubator-hawq git commit: HAWQ-960. Remove the file BUILD_INSTRUCTIONS.md and move the content in it to README.md.

Posted by es...@apache.org.
HAWQ-960. Remove the file BUILD_INSTRUCTIONS.md and move the content in it to README.md.


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/6c548648
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/6c548648
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/6c548648

Branch: refs/heads/2.0.0.0-incubating
Commit: 6c54864826b36fe66a3fbd6d4ffcedd0fb4ce438
Parents: 928eade
Author: amyrazz44 <ab...@pivotal.io>
Authored: Wed Sep 7 11:01:33 2016 +0800
Committer: EC2 Default User <ec...@ip-172-31-38-49.us-west-2.compute.internal>
Committed: Thu Sep 8 05:17:58 2016 +0000

----------------------------------------------------------------------
 BUILD_INSTRUCTIONS.md | 4 ----
 README.md             | 6 +++---
 2 files changed, 3 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6c548648/BUILD_INSTRUCTIONS.md
----------------------------------------------------------------------
diff --git a/BUILD_INSTRUCTIONS.md b/BUILD_INSTRUCTIONS.md
deleted file mode 100644
index 9c4e92c..0000000
--- a/BUILD_INSTRUCTIONS.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Build Instructions for Apache HAWQ
-
-Please see HAWQ wiki page:
-https://cwiki.apache.org/confluence/display/HAWQ/Build+and+Install

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/6c548648/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 5436483..bc61f0e 100644
--- a/README.md
+++ b/README.md
@@ -34,9 +34,9 @@ Apache HAWQ is a Hadoop native SQL query engine that combines the key technologi
  - Standard connectivity: JDBC/ODBC
 
 # Build & Install & Test
-Please refer to the [BUILD_INSTRUCTIONS][1] file.
-
-  [1]: https://github.com/apache/incubator-hawq/blob/master/BUILD_INSTRUCTIONS.md "BUILD_INSTRUCTIONS"
+---------------
+Please see HAWQ wiki page:
+https://cwiki.apache.org/confluence/display/HAWQ/Build+and+Install
 
 # Export Control
 ----------------


[53/54] incubator-hawq git commit: HAWQ-958, HAWQ-976, HAWQ-957. LICENSE & NOTICE updates

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pitlockfile.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pitlockfile.txt b/licenses/LICENSE-pitlockfile.txt
new file mode 100644
index 0000000..8def309
--- /dev/null
+++ b/licenses/LICENSE-pitlockfile.txt
@@ -0,0 +1,192 @@
+PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2
+--------------------------------------------
+
+1. This LICENSE AGREEMENT is between the Python Software Foundation
+("PSF"), and the Individual or Organization ("Licensee") accessing and
+otherwise using this software ("Python") in source or binary form and
+its associated documentation.
+
+2. Subject to the terms and conditions of this License Agreement, PSF
+hereby grants Licensee a nonexclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display publicly,
+prepare derivative works, distribute, and otherwise use Python
+alone or in any derivative version, provided, however, that PSF's
+License Agreement and PSF's notice of copyright, i.e., "Copyright (c)
+2001, 2002, 2003, 2004, 2005, 2006 Python Software Foundation; All Rights
+Reserved" are retained in Python alone or in any derivative version
+prepared by Licensee.
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python or any part thereof, and wants to make
+the derivative work available to others as provided herein, then
+Licensee hereby agrees to include in any such work a brief summary of
+the changes made to Python.
+
+4. PSF is making Python available to Licensee on an "AS IS"
+basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON
+FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS
+A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. Nothing in this License Agreement shall be deemed to create any
+relationship of agency, partnership, or joint venture between PSF and
+Licensee. This License Agreement does not grant permission to use PSF
+trademarks or trade name in a trademark sense to endorse or promote
+products or services of Licensee, or any third party.
+
+8. By copying, installing or otherwise using Python, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0
+-------------------------------------------
+
+BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1
+
+1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an
+office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the
+Individual or Organization ("Licensee") accessing and otherwise using
+this software in source or binary form and its associated
+documentation ("the Software").
+
+2. Subject to the terms and conditions of this BeOpen Python License
+Agreement, BeOpen hereby grants Licensee a non-exclusive,
+royalty-free, world-wide license to reproduce, analyze, test, perform
+and/or display publicly, prepare derivative works, distribute, and
+otherwise use the Software alone or in any derivative version,
+provided, however, that the BeOpen Python License is retained in the
+Software, alone or in any derivative version prepared by Licensee.
+
+3. BeOpen is making the Software available to Licensee on an "AS IS"
+basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS
+FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT
+INFRINGE ANY THIRD PARTY RIGHTS.
+
+4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS
+AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY
+DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF.
+
+5. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+6. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of California, excluding conflict of
+law provisions. Nothing in this License Agreement shall be deemed to
+create any relationship of agency, partnership, or joint venture
+between BeOpen and Licensee. This License Agreement does not grant
+permission to use BeOpen trademarks or trade names in a trademark
+sense to endorse or promote products or services of Licensee, or any
+third party. As an exception, the "BeOpen Python" logos available at
+http://www.pythonlabs.com/logos.html may be used according to the
+permissions granted on that web page.
+
+7. By copying, installing or otherwise using the software, Licensee
+agrees to be bound by the terms and conditions of this License
+Agreement.
+
+CNRI OPEN SOURCE LICENSE AGREEMENT (for Python 1.6b1)
+--------------------------------------------------
+
+IMPORTANT: PLEASE READ THE FOLLOWING AGREEMENT CAREFULLY.
+
+BY CLICKING ON "ACCEPT" WHERE INDICATED BELOW, OR BY COPYING,
+INSTALLING OR OTHERWISE USING PYTHON 1.6, beta 1 SOFTWARE, YOU ARE
+DEEMED TO HAVE AGREED TO THE TERMS AND CONDITIONS OF THIS LICENSE
+AGREEMENT.
+
+1. This LICENSE AGREEMENT is between the Corporation for National
+Research Initiatives, having an office at 1895 Preston White Drive,
+Reston, VA 20191 ("CNRI"), and the Individual or Organization
+("Licensee") accessing and otherwise using Python 1.6, beta 1
+software in source or binary form and its associated documentation,
+as released at the www.python.org Internet site on August 4, 2000
+("Python 1.6b1").
+
+2. Subject to the terms and conditions of this License Agreement, CNRI
+hereby grants Licensee a non-exclusive, royalty-free, world-wide
+license to reproduce, analyze, test, perform and/or display
+publicly, prepare derivative works, distribute, and otherwise use
+Python 1.6b1 alone or in any derivative version, provided, however,
+that CNRIs License Agreement is retained in Python 1.6b1, alone or
+in any derivative version prepared by Licensee.
+
+Alternately, in lieu of CNRIs License Agreement, Licensee may
+substitute the following text (omitting the quotes): "Python 1.6,
+beta 1, is made available subject to the terms and conditions in
+CNRIs License Agreement. This Agreement may be located on the
+Internet using the following unique, persistent identifier (known
+as a handle): 1895.22/1011. This Agreement may also be obtained
+from a proxy server on the Internet using the
+URL:http://hdl.handle.net/1895.22/1011".
+
+3. In the event Licensee prepares a derivative work that is based on
+or incorporates Python 1.6b1 or any part thereof, and wants to make
+the derivative work available to the public as provided herein,
+then Licensee hereby agrees to indicate in any such work the nature
+of the modifications made to Python 1.6b1.
+
+4. CNRI is making Python 1.6b1 available to Licensee on an "AS IS"
+basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR
+IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND
+DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR
+FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6b1
+WILL NOT INFRINGE ANY THIRD PARTY RIGHTS.
+
+5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE
+SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR
+LOSS AS A RESULT OF USING, MODIFYING OR DISTRIBUTING PYTHON 1.6b1,
+OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY
+THEREOF.
+
+6. This License Agreement will automatically terminate upon a material
+breach of its terms and conditions.
+
+7. This License Agreement shall be governed by and interpreted in all
+respects by the law of the State of Virginia, excluding conflict of
+law provisions. Nothing in this License Agreement shall be deemed
+to create any relationship of agency, partnership, or joint venture
+between CNRI and Licensee. This License Agreement does not grant
+permission to use CNRI trademarks or trade name in a trademark
+sense to endorse or promote products or services of Licensee, or
+any third party.
+
+8. By clicking on the "ACCEPT" button where indicated, or by copying,
+installing or otherwise using Python 1.6b1, Licensee agrees to be
+bound by the terms and conditions of this License Agreement.
+
+ACCEPT
+
+CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2
+--------------------------------------------------
+
+Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam,
+The Netherlands. All rights reserved.
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose and without fee is hereby granted,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of Stichting Mathematisch
+Centrum or CWI not be used in advertising or publicity pertaining to
+distribution of the software without specific, written prior
+permission.
+
+STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
+THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
+FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pljava.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pljava.txt b/licenses/LICENSE-pljava.txt
new file mode 100644
index 0000000..508c466
--- /dev/null
+++ b/licenses/LICENSE-pljava.txt
@@ -0,0 +1,33 @@
+PL/Java, a backend Java integration for PostgreSQL
+
+Java\ufffd is a registered trademark of Sun Microsystems, Inc. in the United
+States and other countries.
+
+PL/Java Copyright (c) 2003 - 2006 Tada AB - Taby Sweden
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in
+      the documentation and/or other materials provided with the
+      distribution.
+    * Neither the name Tada AB nor the names of its contributors may be
+      used to endorse or promote products derived from this software
+      without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-plperl.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-plperl.txt b/licenses/LICENSE-plperl.txt
new file mode 100644
index 0000000..4d6abf8
--- /dev/null
+++ b/licenses/LICENSE-plperl.txt
@@ -0,0 +1,135 @@
+Version 3.x, Copyright (c) 2004-2009, Marcus Holland-Moritz.
+
+Version 2.x, Copyright (C) 2001, Paul Marquess.
+
+Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
+
+The "Artistic License"
+
+Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+"Package" refers to the collection of files distributed by the
+Copyright Holder, and derivatives of that collection of files
+created through textual modification.
+
+"Standard Version" refers to such a Package if it has not been
+modified, or has been modified in accordance with the wishes
+of the Copyright Holder as specified below.
+
+"Copyright Holder" is whoever is named in the copyright or
+copyrights for the package.
+
+"You" is you, if you're thinking about copying or distributing
+this Package.
+
+"Reasonable copying fee" is whatever you can justify on the
+basis of media cost, duplication charges, time of people involved,
+and so on.  (You will not be required to justify it to the
+                 Copyright Holder, but only to the computing community at large
+                 as a market that must bear the fee.)
+
+"Freely Available" means that no fee is charged for the item
+itself, though there may be fees involved in handling the item.
+It also means that recipients of the item may redistribute it
+under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder.  A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+a) place your modifications in the Public Domain or otherwise make them
+Freely Available, such as by posting said modifications to Usenet or
+an equivalent medium, or placing the modifications on a major archive
+site such as uunet.uu.net, or by allowing the Copyright Holder to include
+your modifications in the Standard Version of the Package.
+
+b) use the modified Package only within your corporation or organization.
+
+c) rename any non-standard executables so the names do not conflict
+with standard executables, which must also be provided, and provide
+a separate manual page for each non-standard executable that clearly
+documents how it differs from the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+a) distribute a Standard Version of the executables and library files,
+together with instructions (in the manual page or equivalent) on where
+to get the Standard Version.
+
+b) accompany the distribution with the machine-readable source of
+the Package with your modifications.
+
+c) give non-standard executables non-standard names, and clearly
+document the differences in manual pages (or equivalent), together
+with instructions on where to get the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package.  You may charge any fee you choose for support of this
+Package.  You may not charge a fee for this Package itself.  However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own.  You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.  If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution.  Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+Contact GitHub API Training Shop Blog About
+� 2016 GitHub, Inc. Terms Privacy Security Status Help

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-port-gettimeofday.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-port-gettimeofday.txt b/licenses/LICENSE-port-gettimeofday.txt
new file mode 100644
index 0000000..4b558ea
--- /dev/null
+++ b/licenses/LICENSE-port-gettimeofday.txt
@@ -0,0 +1,20 @@
+ Copyright (c) 2003 SRA, Inc.
+ Copyright (c) 2003 SKC, Inc.
+ 
+ Permission to use, copy, modify, and distribute this software and
+ its documentation for any purpose, without fee, and without a
+ written agreement is hereby granted, provided that the above
+ copyright notice and this paragraph and the following two
+ paragraphs appear in all copies.
+ 
+ IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT,
+ INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+ LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+ DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED
+ OF THE POSSIBILITY OF SUCH DAMAGE.
+ 
+ THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS
+ IS" BASIS, AND THE AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE,
+ SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-port-rand.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-port-rand.txt b/licenses/LICENSE-port-rand.txt
new file mode 100644
index 0000000..6370439
--- /dev/null
+++ b/licenses/LICENSE-port-rand.txt
@@ -0,0 +1,10 @@
+ Copyright (c) 1993 Martin Birgmeier
+ All rights reserved.
+ 
+ You may redistribute unmodified or modified versions of this source
+ code provided that the above copyright notice and this and the
+ following conditions are retained.
+ 
+ This software is provided ``as is'', and comes with no warranties
+ of any kind. I shall in no event be liable for anything that happens
+ to anyone/anything when using this software.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-port.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-port.txt b/licenses/LICENSE-port.txt
new file mode 100644
index 0000000..8b201e0
--- /dev/null
+++ b/licenses/LICENSE-port.txt
@@ -0,0 +1,26 @@
+ Copyright (c) 1983, 1990, 1993
+      The Regents of the University of California.  All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-postgresql.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-postgresql.txt b/licenses/LICENSE-postgresql.txt
new file mode 100644
index 0000000..01b6e36
--- /dev/null
+++ b/licenses/LICENSE-postgresql.txt
@@ -0,0 +1,23 @@
+PostgreSQL Database Management System
+(formerly known as Postgres, then as Postgres95)
+
+Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+
+Portions Copyright (c) 1994, The Regents of the University of California
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pychecker.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pychecker.txt b/licenses/LICENSE-pychecker.txt
new file mode 100644
index 0000000..59e9b2f
--- /dev/null
+++ b/licenses/LICENSE-pychecker.txt
@@ -0,0 +1,31 @@
+Copyright (c) 2000-2001, MetaSlash Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ - Redistributions of source code must retain the above copyright
+   notice, this list of conditions and the following disclaimer.
+
+ - Redistributions in binary form must reproduce the above copyright
+   notice, this list of conditions and the following disclaimer in the
+   documentation and/or other materials provided with the
+   distribution.
+
+ - Neither name of MetaSlash Inc. nor the names of contributors
+   may be used to endorse or promote products derived
+   from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pygresql.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pygresql.txt b/licenses/LICENSE-pygresql.txt
new file mode 100644
index 0000000..7f8d013
--- /dev/null
+++ b/licenses/LICENSE-pygresql.txt
@@ -0,0 +1,28 @@
+Copyright notice
+================
+
+Written by D'Arcy J.M. Cain (darcy@druid.net)
+
+Based heavily on code written by Pascal Andre (andre@chimay.via.ecp.fr)
+
+Copyright (c) 1995, Pascal Andre
+
+Further modifications copyright (c) 1997-2008 by D'Arcy J.M. Cain
+(darcy@druid.net)
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies or in any
+new file that contains a substantial portion of this file.
+
+IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE
+AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
+TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE
+AUTHOR HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
+ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-regex.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-regex.txt b/licenses/LICENSE-regex.txt
new file mode 100644
index 0000000..e50cfb1
--- /dev/null
+++ b/licenses/LICENSE-regex.txt
@@ -0,0 +1,84 @@
+This regular expression package was originally developed by Henry Spencer.
+It bears the following copyright notice:
+
+**********************************************************************
+
+Copyright (c) 1998, 1999 Henry Spencer.  All rights reserved.
+
+Development of this software was funded, in part, by Cray Research Inc.,
+UUNET Communications Services Inc., Sun Microsystems Inc., and Scriptics
+Corporation, none of whom are responsible for the results.  The author
+thanks all of them. 
+
+Redistribution and use in source and binary forms -- with or without
+modification -- are permitted for any purpose, provided that
+redistributions in source form retain this entire copyright notice and
+indicate the origin and nature of any modifications.
+
+I'd appreciate being given credit for this package in the documentation
+of software which uses it, but that is not a requirement.
+
+THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+HENRY SPENCER BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+**********************************************************************
+
+PostgreSQL adopted the code out of Tcl 8.4.1.  Portions of regc_locale.c
+and re_syntax.n were developed by Tcl developers other than Henry; these
+files bear the Tcl copyright and license notice:
+
+**********************************************************************
+
+This software is copyrighted by the Regents of the University of
+California, Sun Microsystems, Inc., Scriptics Corporation, ActiveState
+Corporation and other parties.  The following terms apply to all files
+associated with the software unless explicitly disclaimed in
+individual files.
+
+The authors hereby grant permission to use, copy, modify, distribute,
+and license this software and its documentation for any purpose, provided
+that existing copyright notices are retained in all copies and that this
+notice is included verbatim in any distributions. No written agreement,
+license, or royalty fee is required for any of the authorized uses.
+Modifications to this software may be copyrighted by their authors
+and need not follow the licensing terms described here, provided that
+the new terms are clearly indicated on the first page of each file where
+they apply.
+
+IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY
+FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY
+DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.  THIS SOFTWARE
+IS PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE
+NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
+MODIFICATIONS.
+
+GOVERNMENT USE: If you are acquiring this software on behalf of the
+U.S. government, the Government shall have only "Restricted Rights"
+in the software and related documentation as defined in the Federal 
+Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2).  If you
+are acquiring the software on behalf of the Department of Defense, the
+software shall be classified as "Commercial Computer Software" and the
+Government shall have only "Restricted Rights" as defined in Clause
+252.227-7013 (c) (1) of DFARs.  Notwithstanding the foregoing, the
+authors grant the U.S. Government and others acting in its behalf
+permission to use and distribute the software in accordance with the
+terms specified in this license. 
+
+**********************************************************************
+
+Subsequent modifications to the code by the PostgreSQL project follow
+the same license terms as the rest of PostgreSQL.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-stream.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-stream.txt b/licenses/LICENSE-stream.txt
new file mode 100644
index 0000000..66b0502
--- /dev/null
+++ b/licenses/LICENSE-stream.txt
@@ -0,0 +1,32 @@
+*-----------------------------------------------------------------------
+* Copyright 1991-2003: John D. McCalpin
+*-----------------------------------------------------------------------
+* License:                                                              */
+*  1. You are free to use this program and/or to redistribute           */
+*     this program.                                                     */
+*  2. You are free to modify this program for your own use,             */
+*     including commercial use, subject to the publication              */
+*     restrictions in item 3.                                           */
+*  3. You are free to publish results obtained from running this        */
+*     program, or from works that you derive from this program,         */
+*     with the following limitations:                                   */
+*     3a. In order to be referred to as "STREAM benchmark results",     */
+*         published results must be in conformance to the STREAM        */
+*         Run Rules, (briefly reviewed below) published at              */
+*         http://www.cs.virginia.edu/stream/ref.html                    */
+*         and incorporated herein by reference.                         */
+*         As the copyright holder, John McCalpin retains the            */
+*         right to determine conformity with the Run Rules.             */
+*     3b. Results based on modified source code or on runs not in       */
+*         accordance with the STREAM Run Rules must be clearly          */
+*         labelled whenever they are published.  Examples of            */
+*         proper labelling include:                                     */
+*         "tuned STREAM benchmark results"                              */
+*         "based on a variant of the STREAM benchmark code"             */
+*         Other comparable, clear and reasonable labelling is           */
+*         acceptable.                                                   */
+*     3c. Submission of results to the STREAM benchmark web site        */
+*         is encouraged, but not required.                              */
+*  4. Use of this program or creation of derived works based on this    */
+*     program constitutes acceptance of these licensing restrictions.   */
+*  5. Absolutely no warranty is expressed or implied.                   */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-test-ctype.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-test-ctype.txt b/licenses/LICENSE-test-ctype.txt
new file mode 100644
index 0000000..06fb20a
--- /dev/null
+++ b/licenses/LICENSE-test-ctype.txt
@@ -0,0 +1,11 @@
+Written by Oleg BroytMann, phd2@earthling.net
+   with help from Oleg Bartunov, oleg@sai.msu.su
+Copyright (C) 1998 PhiloSoft Design
+
+This is copyrighted but free software. You can use it, modify and distribute
+in original or modified form providing that the author's names and the above
+copyright notice will remain.
+
+Disclaimer, legal notice and absence of warranty.
+   This software provided "as is" without any kind of warranty. In no event
+the author shall be liable for any damage, etc.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-unittest2.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-unittest2.txt b/licenses/LICENSE-unittest2.txt
new file mode 100644
index 0000000..855e800
--- /dev/null
+++ b/licenses/LICENSE-unittest2.txt
@@ -0,0 +1,32 @@
+Copyright (c) 2003-2010, Michael Foord
+All rights reserved.
+E-mail : fuzzyman AT voidspace DOT org DOT uk
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+
+    * Neither the name of Michael Foord nor the name of Voidspace
+      may be used to endorse or promote products derived from this
+      software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-wstrcmp.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-wstrcmp.txt b/licenses/LICENSE-wstrcmp.txt
new file mode 100644
index 0000000..8b201e0
--- /dev/null
+++ b/licenses/LICENSE-wstrcmp.txt
@@ -0,0 +1,26 @@
+ Copyright (c) 1983, 1990, 1993
+      The Regents of the University of California.  All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the University nor the names of its contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 7d67ed6..a5faf55 100644
--- a/pom.xml
+++ b/pom.xml
@@ -55,18 +55,16 @@
               <!-- Open-source packages with Apache license -->
               <exclude>depends/thirdparty/thrift/**</exclude>
 
+              <!-- CMake BSD 3-clause license -->
+
+              <exclude>depends/libhdfs3/CMake/**</exclude>
+              <exclude>depends/libyarn/CMake/**</exclude>
+              
               <!-- BSD license -->
-              <exclude>depends/libyarn/CMake/FindBoost.cmake</exclude>
-              <exclude>depends/libyarn/CMake/FindGSasl.cmake</exclude>
-              <exclude>depends/libyarn/CMake/FindKERBEROS.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/FindBoost.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/CodeCoverage.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/FindGSasl.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/FindKERBEROS.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/FindLibUUID.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/Functions.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/Options.cmake</exclude>
-			  <exclude>depends/libhdfs3/CMake/Platform.cmake</exclude>
+
+              <exclude>depends/libhdfs3/CMake/**</exclude>
+              <exclude>depends/libyarn/CMake/**</exclude>
+              
               <exclude>src/bin/gpfdist/src/gpfdist/glob.c</exclude>
               <exclude>src/bin/gpfdist/src/gpfdist/include/glob.h</exclude>
               <exclude>src/include/port/win32_msvc/glob.h</exclude>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/backend/port/dynloader/freebsd.c
----------------------------------------------------------------------
diff --git a/src/backend/port/dynloader/freebsd.c b/src/backend/port/dynloader/freebsd.c
index a65e7b0..ad43cad 100644
--- a/src/backend/port/dynloader/freebsd.c
+++ b/src/backend/port/dynloader/freebsd.c
@@ -13,10 +13,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *	  notice, this list of conditions and the following disclaimer in the
  *	  documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *	  must display the following acknowledgement:
- *		This product includes software developed by the University of
- *		California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *	  may be used to endorse or promote products derived from this software
  *	  without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/backend/port/dynloader/netbsd.c
----------------------------------------------------------------------
diff --git a/src/backend/port/dynloader/netbsd.c b/src/backend/port/dynloader/netbsd.c
index 10d11b8..6e874e3 100644
--- a/src/backend/port/dynloader/netbsd.c
+++ b/src/backend/port/dynloader/netbsd.c
@@ -13,10 +13,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *	  notice, this list of conditions and the following disclaimer in the
  *	  documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *	  must display the following acknowledgement:
- *		This product includes software developed by the University of
- *		California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *	  may be used to endorse or promote products derived from this software
  *	  without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/backend/port/dynloader/openbsd.c
----------------------------------------------------------------------
diff --git a/src/backend/port/dynloader/openbsd.c b/src/backend/port/dynloader/openbsd.c
index b3f53c2..51e873d 100644
--- a/src/backend/port/dynloader/openbsd.c
+++ b/src/backend/port/dynloader/openbsd.c
@@ -13,10 +13,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *	  notice, this list of conditions and the following disclaimer in the
  *	  documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *	  must display the following acknowledgement:
- *		This product includes software developed by the University of
- *		California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *	  may be used to endorse or promote products derived from this software
  *	  without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/bin/gpfdist/src/gpfdist/glob.c
----------------------------------------------------------------------
diff --git a/src/bin/gpfdist/src/gpfdist/glob.c b/src/bin/gpfdist/src/gpfdist/glob.c
index ec7f1b7..ff0af6d 100644
--- a/src/bin/gpfdist/src/gpfdist/glob.c
+++ b/src/bin/gpfdist/src/gpfdist/glob.c
@@ -13,10 +13,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/bin/gpfdist/src/gpfdist/include/glob.h
----------------------------------------------------------------------
diff --git a/src/bin/gpfdist/src/gpfdist/include/glob.h b/src/bin/gpfdist/src/gpfdist/include/glob.h
index f38778b..8e9e590 100644
--- a/src/bin/gpfdist/src/gpfdist/include/glob.h
+++ b/src/bin/gpfdist/src/gpfdist/include/glob.h
@@ -17,10 +17,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/include/port/win32_msvc/glob.h
----------------------------------------------------------------------
diff --git a/src/include/port/win32_msvc/glob.h b/src/include/port/win32_msvc/glob.h
index 827476b..039525e 100644
--- a/src/include/port/win32_msvc/glob.h
+++ b/src/include/port/win32_msvc/glob.h
@@ -17,10 +17,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/pl/plperl/plperl.c
----------------------------------------------------------------------
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c
index 77525f2..0e01d75 100644
--- a/src/pl/plperl/plperl.c
+++ b/src/pl/plperl/plperl.c
@@ -1,22 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 /**********************************************************************
  * plperl.c - perl as a procedural language for PostgreSQL
  *

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/pl/plperl/plperl.h
----------------------------------------------------------------------
diff --git a/src/pl/plperl/plperl.h b/src/pl/plperl/plperl.h
index 96bc14c..1739a27 100644
--- a/src/pl/plperl/plperl.h
+++ b/src/pl/plperl/plperl.h
@@ -1,22 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 /*-------------------------------------------------------------------------
  *
  * plperl.h

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/pl/plperl/plperl_helpers.h
----------------------------------------------------------------------
diff --git a/src/pl/plperl/plperl_helpers.h b/src/pl/plperl/plperl_helpers.h
index a0e2cf2..81c177b 100644
--- a/src/pl/plperl/plperl_helpers.h
+++ b/src/pl/plperl/plperl_helpers.h
@@ -1,23 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- *   http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
 #ifndef PL_PERL_HELPERS_H
 #define PL_PERL_HELPERS_H
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/src/port/glob.c
----------------------------------------------------------------------
diff --git a/src/port/glob.c b/src/port/glob.c
index 7423b47..79ab8f2 100644
--- a/src/port/glob.c
+++ b/src/port/glob.c
@@ -13,10 +13,8 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *	This product includes software developed by the University of
- *	California, Berkeley and its contributors.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
  * 4. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/__init__.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/__init__.py b/tools/bin/ext/figleaf/__init__.py
index 5761930..9508655 100644
--- a/tools/bin/ext/figleaf/__init__.py
+++ b/tools/bin/ext/figleaf/__init__.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 """
 figleaf is another tool to trace Python code coverage.
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/_lib.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/_lib.py b/tools/bin/ext/figleaf/_lib.py
index 3ee49f8..97e5e83 100644
--- a/tools/bin/ext/figleaf/_lib.py
+++ b/tools/bin/ext/figleaf/_lib.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 import os.path, sys
 libdir = os.path.join(os.path.dirname(__file__), '../')
 libdir = os.path.normpath(libdir)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/annotate.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/annotate.py b/tools/bin/ext/figleaf/annotate.py
index 43099f6..ed674d9 100644
--- a/tools/bin/ext/figleaf/annotate.py
+++ b/tools/bin/ext/figleaf/annotate.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 """
 Common functions for annotating files with figleaf coverage information.
 """

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/annotate_cover.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/annotate_cover.py b/tools/bin/ext/figleaf/annotate_cover.py
index ac72bfa..bf48bda 100644
--- a/tools/bin/ext/figleaf/annotate_cover.py
+++ b/tools/bin/ext/figleaf/annotate_cover.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 import figleaf
 import os
 import re

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/annotate_html.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/annotate_html.py b/tools/bin/ext/figleaf/annotate_html.py
index 594d07a..e9bf7f9 100644
--- a/tools/bin/ext/figleaf/annotate_html.py
+++ b/tools/bin/ext/figleaf/annotate_html.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 import figleaf
 import os
 import re

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/annotate_sections.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/annotate_sections.py b/tools/bin/ext/figleaf/annotate_sections.py
index 6d7fb89..167b391 100644
--- a/tools/bin/ext/figleaf/annotate_sections.py
+++ b/tools/bin/ext/figleaf/annotate_sections.py
@@ -1,20 +1,4 @@
 #! /usr/bin/env python
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 import figleaf
 from figleaf import internals
 from sets import Set as set

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/internals.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/internals.py b/tools/bin/ext/figleaf/internals.py
index 6a25c0e..a3d2162 100644
--- a/tools/bin/ext/figleaf/internals.py
+++ b/tools/bin/ext/figleaf/internals.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 """
 Coverage tracking internals.
 """

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/ext/figleaf/nose_sections.py
----------------------------------------------------------------------
diff --git a/tools/bin/ext/figleaf/nose_sections.py b/tools/bin/ext/figleaf/nose_sections.py
index 09654a5..e6fd42d 100644
--- a/tools/bin/ext/figleaf/nose_sections.py
+++ b/tools/bin/ext/figleaf/nose_sections.py
@@ -1,19 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-#   http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
 """
 figleafsections plugin for nose.
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/tools/bin/gppylib/operations/test/test_package.py
----------------------------------------------------------------------
diff --git a/tools/bin/gppylib/operations/test/test_package.py b/tools/bin/gppylib/operations/test/test_package.py
index 35d3060..e7a51dc 100755
--- a/tools/bin/gppylib/operations/test/test_package.py
+++ b/tools/bin/gppylib/operations/test/test_package.py
@@ -118,7 +118,7 @@ class RPMSpec:
 %define __os_install_post %{nil}
 
 Summary:        Temporary test package
-License:        GPLv2        
+License:        ASF 2.0
 Name:           ''' + self.name + '''          
 Version:        ''' + self.version + '''
 Release:        ''' + self.release + ''' 


[34/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_hs_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_hs_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_hs_generator.cc
deleted file mode 100644
index 4297397..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_hs_generator.cc
+++ /dev/null
@@ -1,1723 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-
-#include "t_oop_generator.h"
-
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Haskell code generator.
- *
- */
-class t_hs_generator : public t_oop_generator {
-public:
-  t_hs_generator(t_program* program,
-                 const map<string, string>& parsed_options,
-                 const string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-hs";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_hs_struct(t_struct* tstruct, bool is_exception);
-
-  void generate_hs_struct_definition(ofstream& out,
-                                     t_struct* tstruct,
-                                     bool is_xception = false,
-                                     bool helper = false);
-
-  void generate_hs_struct_reader(ofstream& out, t_struct* tstruct);
-
-  void generate_hs_struct_writer(ofstream& out, t_struct* tstruct);
-
-  void generate_hs_struct_arbitrary(ofstream& out, t_struct* tstruct);
-
-  void generate_hs_function_helpers(t_function* tfunction);
-
-  void generate_hs_typemap(ofstream& out, t_struct* tstruct);
-
-  void generate_hs_default(ofstream& out, t_struct* tstruct);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(ofstream& out, t_field* tfield, string prefix);
-
-  void generate_deserialize_struct(ofstream& out, t_struct* tstruct, string name = "");
-
-  void generate_deserialize_container(ofstream& out, t_type* ttype, string arg = "");
-
-  void generate_deserialize_set_element(ofstream& out, t_set* tset);
-
-  void generate_deserialize_list_element(ofstream& out, t_list* tlist, string prefix = "");
-
-  void generate_deserialize_type(ofstream& out, t_type* type, string arg = "");
-
-  void generate_serialize_type(ofstream& out, t_type* type, string name = "");
-
-  void generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix = "");
-
-  void generate_serialize_container(ofstream& out, t_type* ttype, string prefix = "");
-
-  void generate_serialize_map_element(ofstream& out, t_map* tmap, string kiter, string viter);
-
-  void generate_serialize_set_element(ofstream& out, t_set* tmap, string iter);
-
-  void generate_serialize_list_element(ofstream& out, t_list* tlist, string iter);
-
-  /**
-   * Helper rendering functions
-   */
-
-  string hs_autogen_comment();
-  string hs_language_pragma();
-  string hs_imports();
-
-  string type_name(t_type* ttype, string function_prefix = "");
-
-  string field_name(string tname, string fname);
-
-  string function_type(t_function* tfunc,
-                       bool options = false,
-                       bool io = false,
-                       bool method = false);
-
-  string type_to_enum(t_type* ttype);
-
-  string type_to_default(t_type* ttype);
-
-  string render_hs_type(t_type* type, bool needs_parens);
-
-  string type_to_constructor(t_type* ttype);
-
-  string render_hs_type_for_function_name(t_type* type);
-
-private:
-  ofstream f_types_;
-  ofstream f_consts_;
-  ofstream f_service_;
-  ofstream f_iface_;
-  ofstream f_client_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_hs_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // Make output file
-  string pname = capitalize(program_name_);
-  string f_types_name = get_out_dir() + pname + "_Types.hs";
-  f_types_.open(f_types_name.c_str());
-
-  string f_consts_name = get_out_dir() + pname + "_Consts.hs";
-  f_consts_.open(f_consts_name.c_str());
-
-  // Print header
-  f_types_ << hs_language_pragma() << endl;
-  f_types_ << hs_autogen_comment() << endl;
-  f_types_ << "module " << pname << "_Types where" << endl;
-  f_types_ << hs_imports() << endl;
-
-  f_consts_ << hs_language_pragma() << endl;
-  f_consts_ << hs_autogen_comment() << endl;
-  f_consts_ << "module " << pname << "_Consts where" << endl;
-  f_consts_ << hs_imports() << endl;
-  f_consts_ << "import " << pname << "_Types" << endl;
-}
-
-string t_hs_generator::hs_language_pragma() {
-  return string(
-      "{-# LANGUAGE DeriveDataTypeable #-}\n"
-      "{-# LANGUAGE DeriveGeneric #-}\n"
-      "{-# LANGUAGE OverloadedStrings #-}\n"
-      "{-# OPTIONS_GHC -fno-warn-missing-fields #-}\n"
-      "{-# OPTIONS_GHC -fno-warn-missing-signatures #-}\n"
-      "{-# OPTIONS_GHC -fno-warn-name-shadowing #-}\n"
-      "{-# OPTIONS_GHC -fno-warn-unused-imports #-}\n"
-      "{-# OPTIONS_GHC -fno-warn-unused-matches #-}\n");
-}
-
-/**
- * Autogen'd comment
- */
-string t_hs_generator::hs_autogen_comment() {
-  return string("-----------------------------------------------------------------\n")
-         + "-- Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")                      --\n"
-         + "--                                                             --\n"
-         + "-- DO NOT EDIT UNLESS YOU ARE SURE YOU KNOW WHAT YOU ARE DOING --\n"
-         + "-----------------------------------------------------------------\n";
-}
-
-/**
- * Prints standard thrift imports
- */
-string t_hs_generator::hs_imports() {
-  const vector<t_program*>& includes = program_->get_includes();
-  string result = string(
-      "import Prelude (($), (.), (>>=), (==), (++))\n"
-      "import qualified Prelude as P\n"
-      "import qualified Control.Exception as X\n"
-      "import qualified Control.Monad as M ( liftM, ap, when )\n"
-      "import Data.Functor ( (<$>) )\n"
-      "import qualified Data.ByteString.Lazy as LBS\n"
-      "import qualified Data.Hashable as H\n"
-      "import qualified Data.Int as I\n"
-      "import qualified Data.Maybe as M (catMaybes)\n"
-      "import qualified Data.Text.Lazy.Encoding as E ( decodeUtf8, encodeUtf8 )\n"
-      "import qualified Data.Text.Lazy as LT\n"
-      "import qualified GHC.Generics as G (Generic)\n"
-      "import qualified Data.Typeable as TY ( Typeable )\n"
-      "import qualified Data.HashMap.Strict as Map\n"
-      "import qualified Data.HashSet as Set\n"
-      "import qualified Data.Vector as Vector\n"
-      "import qualified Test.QuickCheck.Arbitrary as QC ( Arbitrary(..) )\n"
-      "import qualified Test.QuickCheck as QC ( elements )\n"
-      "\n"
-      "import qualified Thrift as T\n"
-      "import qualified Thrift.Types as T\n"
-      "import qualified Thrift.Arbitraries as T\n"
-      "\n");
-
-  for (size_t i = 0; i < includes.size(); ++i)
-    result += "import qualified " + capitalize(includes[i]->get_name()) + "_Types\n";
-
-  if (includes.size() > 0)
-    result += "\n";
-
-  return result;
-}
-
-/**
- * Closes the type files
- */
-void t_hs_generator::close_generator() {
-  // Close types file
-  f_types_.close();
-  f_consts_.close();
-}
-
-/**
- * Generates a typedef. Ez.
- *
- * @param ttypedef The type definition
- */
-void t_hs_generator::generate_typedef(t_typedef* ttypedef) {
-  string tname = capitalize(ttypedef->get_symbolic());
-  string tdef = render_hs_type(ttypedef->get_type(), false);
-  indent(f_types_) << "type " << tname << " = " << tdef << endl;
-  f_types_ << endl;
-}
-
-/**
- * Generates code for an enumerated type.
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_hs_generator::generate_enum(t_enum* tenum) {
-  indent(f_types_) << "data " << capitalize(tenum->get_name()) << " = ";
-  indent_up();
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-
-  bool first = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    string name = capitalize((*c_iter)->get_name());
-    f_types_ << (first ? "" : "|");
-    f_types_ << name;
-    first = false;
-  }
-  indent(f_types_) << "deriving (P.Show, P.Eq, G.Generic, TY.Typeable, P.Ord, P.Bounded)" << endl;
-  indent_down();
-
-  string ename = capitalize(tenum->get_name());
-
-  indent(f_types_) << "instance P.Enum " << ename << " where" << endl;
-  indent_up();
-  indent(f_types_) << "fromEnum t = case t of" << endl;
-  indent_up();
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << name << " -> " << value << endl;
-  }
-  indent_down();
-  indent(f_types_) << "toEnum t = case t of" << endl;
-  indent_up();
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << value << " -> " << name << endl;
-  }
-  indent(f_types_) << "_ -> X.throw T.ThriftException" << endl;
-  indent_down();
-  indent_down();
-
-  indent(f_types_) << "instance H.Hashable " << ename << " where" << endl;
-  indent_up();
-  indent(f_types_) << "hashWithSalt salt = H.hashWithSalt salt P.. P.fromEnum" << endl;
-  indent_down();
-
-  indent(f_types_) << "instance QC.Arbitrary " << ename << " where" << endl;
-  indent_up();
-  indent(f_types_) << "arbitrary = QC.elements (P.enumFromTo P.minBound P.maxBound)" << endl;
-  indent_down();
-}
-
-/**
- * Generate a constant value
- */
-void t_hs_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = decapitalize(tconst->get_name());
-
-  t_const_value* value = tconst->get_value();
-
-  indent(f_consts_) << name << " :: " << render_hs_type(type, false) << endl;
-  indent(f_consts_) << name << " = " << render_const_value(type, value) << endl;
-  f_consts_ << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_hs_generator::render_const_value(t_type* type, t_const_value* value) {
-  if (value == NULL)
-    return type_to_default(type);
-
-  type = get_true_type(type);
-  ostringstream out;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "P.True" : "P.False");
-      break;
-
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-
-  } else if (type->is_enum()) {
-    t_enum* tenum = (t_enum*)type;
-    vector<t_enum_value*> constants = tenum->get_constants();
-    for (vector<t_enum_value*>::iterator c_iter = constants.begin(); c_iter != constants.end();
-         ++c_iter) {
-      int val = (*c_iter)->get_value();
-      if (val == value->get_integer()) {
-        t_program* prog = type->get_program();
-        if (prog != NULL && prog != program_)
-          out << capitalize(prog->get_name()) << "_Types.";
-        out << capitalize((*c_iter)->get_name());
-        break;
-      }
-    }
-
-  } else if (type->is_struct() || type->is_xception()) {
-    string cname = type_name(type);
-    out << "default_" << cname << "{";
-
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-
-    bool first = true;
-    for (map<t_const_value*, t_const_value*>::const_iterator v_iter = val.begin();
-         v_iter != val.end();
-         ++v_iter) {
-      t_field* field = NULL;
-
-      for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end();
-           ++f_iter)
-        if ((*f_iter)->get_name() == v_iter->first->get_string())
-          field = (*f_iter);
-
-      if (field == NULL)
-        throw "type error: " + cname + " has no field " + v_iter->first->get_string();
-
-      string fname = v_iter->first->get_string();
-      string const_value = render_const_value(field->get_type(), v_iter->second);
-
-      out << (first ? "" : ", ");
-      out << field_name(cname, fname) << " = ";
-      if (field->get_req() == t_field::T_OPTIONAL || ((t_type*)field->get_type())->is_xception()) {
-        out << "P.Just ";
-      }
-      out << const_value;
-      first = false;
-    }
-
-    out << "}";
-
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-    out << "(Map.fromList [";
-
-    bool first = true;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(ktype, v_iter->first);
-      string val = render_const_value(vtype, v_iter->second);
-      out << (first ? "" : ",");
-      out << "(" << key << "," << val << ")";
-      first = false;
-    }
-    out << "])";
-
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype = type->is_list() ? ((t_list*)type)->get_elem_type()
-                                    : ((t_set*)type)->get_elem_type();
-
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-
-    if (type->is_set())
-      out << "(Set.fromList [";
-    else
-      out << "(Vector.fromList [";
-
-    bool first = true;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << (first ? "" : ",");
-      out << render_const_value(etype, *v_iter);
-      first = false;
-    }
-
-    out << "])";
-
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-
-  return out.str();
-}
-
-/**
- * Generates a "struct"
- */
-void t_hs_generator::generate_struct(t_struct* tstruct) {
-  generate_hs_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct, but also has an exception declaration.
- *
- * @param txception The struct definition
- */
-void t_hs_generator::generate_xception(t_struct* txception) {
-  generate_hs_struct(txception, true);
-}
-
-/**
- * Generates a Haskell struct
- */
-void t_hs_generator::generate_hs_struct(t_struct* tstruct, bool is_exception) {
-  generate_hs_struct_definition(f_types_, tstruct, is_exception, false);
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_hs_generator::generate_hs_struct_definition(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   bool is_exception,
-                                                   bool helper) {
-  (void)helper;
-  string tname = type_name(tstruct);
-  string name = tstruct->get_name();
-  const vector<t_field*>& members = tstruct->get_members();
-
-  indent(out) << "data " << tname << " = " << tname;
-  if (members.size() > 0) {
-    indent_up();
-    bool first = true;
-    for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();
-         ++m_iter) {
-      if (first) {
-        indent(out) << "{ ";
-        first = false;
-      } else {
-        indent(out) << ", ";
-      }
-      string mname = (*m_iter)->get_name();
-      out << field_name(tname, mname) << " :: ";
-      if ((*m_iter)->get_req() == t_field::T_OPTIONAL
-          || ((t_type*)(*m_iter)->get_type())->is_xception()) {
-        out << "P.Maybe ";
-      }
-      out << render_hs_type((*m_iter)->get_type(), true) << endl;
-    }
-    indent(out) << "}";
-    indent_down();
-  }
-
-  out << " deriving (P.Show,P.Eq,G.Generic,TY.Typeable)" << endl;
-
-  if (is_exception)
-    out << "instance X.Exception " << tname << endl;
-
-  indent(out) << "instance H.Hashable " << tname << " where" << endl;
-  indent_up();
-  indent(out) << "hashWithSalt salt record = salt";
-  for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();
-       ++m_iter) {
-    string mname = (*m_iter)->get_name();
-    indent(out) << " `H.hashWithSalt` " << field_name(tname, mname) << " record";
-  }
-  indent(out) << endl;
-  indent_down();
-
-  generate_hs_struct_arbitrary(out, tstruct);
-  generate_hs_struct_writer(out, tstruct);
-  generate_hs_struct_reader(out, tstruct);
-  generate_hs_typemap(out, tstruct);
-  generate_hs_default(out, tstruct);
-}
-
-void t_hs_generator::generate_hs_struct_arbitrary(ofstream& out, t_struct* tstruct) {
-  string tname = type_name(tstruct);
-  string name = tstruct->get_name();
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  indent(out) << "instance QC.Arbitrary " << tname << " where " << endl;
-  indent_up();
-  if (members.size() > 0) {
-    indent(out) << "arbitrary = M.liftM " << tname;
-    indent_up();
-    indent_up();
-    indent_up();
-    indent_up();
-    bool first = true;
-    for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();
-         ++m_iter) {
-      if (first) {
-        first = false;
-        out << " ";
-      } else {
-        indent(out) << "`M.ap`";
-      }
-      out << "(";
-      if ((*m_iter)->get_req() == t_field::T_OPTIONAL
-          || ((t_type*)(*m_iter)->get_type())->is_xception()) {
-        out << "M.liftM P.Just ";
-      }
-      out << "QC.arbitrary)" << endl;
-    }
-    indent_down();
-    indent_down();
-    indent_down();
-    indent_down();
-
-    // Shrink
-    indent(out) << "shrink obj | obj == default_" << tname << " = []" << endl;
-    indent(out) << "           | P.otherwise = M.catMaybes" << endl;
-    indent_up();
-    first = true;
-    for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();
-         ++m_iter) {
-      if (first) {
-        first = false;
-        indent(out) << "[ ";
-      } else {
-        indent(out) << ", ";
-      }
-      string fname = field_name(tname, (*m_iter)->get_name());
-      out << "if obj == default_" << tname;
-      out << "{" << fname << " = " << fname << " obj} ";
-      out << "then P.Nothing ";
-      out << "else P.Just $ default_" << tname;
-      out << "{" << fname << " = " << fname << " obj}" << endl;
-    }
-    indent(out) << "]" << endl;
-    indent_down();
-  } else { /* 0 == members.size() */
-    indent(out) << "arbitrary = QC.elements [" << tname << "]" << endl;
-  }
-  indent_down();
-}
-
-/**
- * Generates the read method for a struct
- */
-void t_hs_generator::generate_hs_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  string sname = type_name(tstruct);
-  string id = tmp("_id");
-  string val = tmp("_val");
-
-  indent(out) << "to_" << sname << " :: T.ThriftVal -> " << sname << endl;
-  indent(out) << "to_" << sname << " (T.TStruct fields) = " << sname << "{" << endl;
-  indent_up();
-
-  bool first = true;
-
-  // Generate deserialization code for known cases
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    int32_t key = (*f_iter)->get_key();
-    string etype = type_to_enum((*f_iter)->get_type());
-    string fname = (*f_iter)->get_name();
-
-    if (first) {
-      first = false;
-    } else {
-      out << "," << endl;
-    }
-
-    // Fill in Field
-    indent(out) << field_name(sname, fname) << " = ";
-
-    out << "P.maybe (";
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      out << "P.error \"Missing required field: " << fname << "\"";
-    } else {
-      if (((*f_iter)->get_req() == t_field::T_OPTIONAL
-           || ((t_type*)(*f_iter)->get_type())->is_xception()) && (*f_iter)->get_value() == NULL) {
-        out << "P.Nothing";
-      } else {
-        out << field_name(sname, fname) << " default_" << sname;
-      }
-    }
-    out << ") ";
-
-    out << "(\\(_," << val << ") -> ";
-    if ((*f_iter)->get_req() == t_field::T_OPTIONAL
-        || ((t_type*)(*f_iter)->get_type())->is_xception())
-      out << "P.Just ";
-    generate_deserialize_field(out, *f_iter, val);
-    out << ")";
-    out << " (Map.lookup (" << key << ") fields)";
-  }
-
-  out << endl;
-  indent(out) << "}" << endl;
-  indent_down();
-
-  // read
-  string tmap = type_name(tstruct, "typemap_");
-  indent(out) << "to_" << sname << " _ = P.error \"not a struct\"" << endl;
-
-  indent(out) << "read_" << sname << " :: (T.Transport t, T.Protocol p) => p t -> P.IO " << sname
-              << endl;
-  indent(out) << "read_" << sname << " iprot = to_" << sname;
-  out << " <$> T.readVal iprot (T.T_STRUCT " << tmap << ")" << endl;
-
-  indent(out) << "decode_" << sname
-              << " :: (T.Protocol p, T.Transport t) => p t -> LBS.ByteString -> " << sname << endl;
-  indent(out) << "decode_" << sname << " iprot bs = to_" << sname << " $ ";
-  out << "T.deserializeVal iprot (T.T_STRUCT " << tmap << ") bs" << endl;
-}
-
-void t_hs_generator::generate_hs_struct_writer(ofstream& out, t_struct* tstruct) {
-  string name = type_name(tstruct);
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-  string str = tmp("_str");
-  string f = tmp("_f");
-  string v = tmp("_v");
-
-  indent(out) << "from_" << name << " :: " << name << " -> T.ThriftVal" << endl;
-  indent(out) << "from_" << name << " record = T.TStruct $ Map.fromList ";
-  indent_up();
-
-  // Get Exceptions
-  bool hasExn = false;
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (((t_type*)(*f_iter)->get_type())->is_xception()) {
-      hasExn = true;
-      break;
-    }
-  }
-
-  bool isfirst = true;
-  if (hasExn) {
-    out << endl;
-    indent(out) << "(let exns = M.catMaybes ";
-    indent_up();
-    for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end();
-         ++f_iter) {
-      if (((t_type*)(*f_iter)->get_type())->is_xception()) {
-        if (isfirst) {
-          out << "[ ";
-          isfirst = false;
-        } else {
-          out << ", ";
-        }
-        string mname = (*f_iter)->get_name();
-        int32_t key = (*f_iter)->get_key();
-        out << "(\\" << v << " -> (" << key << ", (\"" << mname << "\",";
-        generate_serialize_type(out, (*f_iter)->get_type(), v);
-        out << "))) <$> " << field_name(name, mname) << " record";
-      }
-    }
-    if (!isfirst) {
-      out << "]" << endl;
-    }
-    indent_down();
-    indent(out) << "in if P.not (P.null exns) then exns else ";
-    indent_up();
-  } else {
-    out << "$ ";
-  }
-
-  out << "M.catMaybes" << endl;
-  // Get the Rest
-  isfirst = true;
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    // Write field header
-    if (isfirst) {
-      indent(out) << "[ ";
-      isfirst = false;
-    } else {
-      indent(out) << ", ";
-    }
-    string mname = (*f_iter)->get_name();
-    int32_t key = (*f_iter)->get_key();
-    out << "(\\";
-    out << v << " -> ";
-    if ((*f_iter)->get_req() != t_field::T_OPTIONAL
-        && !((t_type*)(*f_iter)->get_type())->is_xception()) {
-      out << "P.Just ";
-    }
-    out << "(" << key << ", (\"" << mname << "\",";
-    generate_serialize_type(out, (*f_iter)->get_type(), v);
-    out << "))) ";
-    if ((*f_iter)->get_req() != t_field::T_OPTIONAL
-        && !((t_type*)(*f_iter)->get_type())->is_xception()) {
-      out << "$";
-    } else {
-      out << "<$>";
-    }
-    out << " " << field_name(name, mname) << " record" << endl;
-  }
-
-  // Write the struct map
-  if (isfirst) {
-    indent(out) << "[]" << endl;
-  } else {
-    indent(out) << "]" << endl;
-  }
-  if (hasExn) {
-    indent(out) << ")" << endl;
-    indent_down();
-  }
-  indent_down();
-
-  // write
-  indent(out) << "write_" << name << " :: (T.Protocol p, T.Transport t) => p t -> " << name
-              << " -> P.IO ()" << endl;
-  indent(out) << "write_" << name << " oprot record = T.writeVal oprot $ from_";
-  out << name << " record" << endl;
-
-  // encode
-  indent(out) << "encode_" << name << " :: (T.Protocol p, T.Transport t) => p t -> " << name
-              << " -> LBS.ByteString" << endl;
-  indent(out) << "encode_" << name << " oprot record = T.serializeVal oprot $ ";
-  out << "from_" << name << " record" << endl;
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_hs_generator::generate_service(t_service* tservice) {
-  string f_service_name = get_out_dir() + capitalize(service_name_) + ".hs";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << hs_language_pragma() << endl;
-  f_service_ << hs_autogen_comment() << endl;
-  f_service_ << "module " << capitalize(service_name_) << " where" << endl;
-  f_service_ << hs_imports() << endl;
-
-  if (tservice->get_extends()) {
-    f_service_ << "import qualified " << capitalize(tservice->get_extends()->get_name()) << endl;
-  }
-
-  f_service_ << "import " << capitalize(program_name_) << "_Types" << endl;
-  f_service_ << "import qualified " << capitalize(service_name_) << "_Iface as Iface" << endl;
-
-  // Generate the three main parts of the service
-  generate_service_helpers(tservice);
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-
-  // Close service file
-  f_service_.close();
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_hs_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  indent(f_service_) << "-- HELPER FUNCTIONS AND STRUCTURES --" << endl;
-  indent(f_service_) << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_hs_struct_definition(f_service_, ts, false);
-    generate_hs_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_hs_generator::generate_hs_function_helpers(t_function* tfunction) {
-  t_struct result(program_, field_name(tfunction->get_name(), "result"));
-  t_field success(tfunction->get_returntype(), "success", 0);
-
-  if (!tfunction->get_returntype()->is_void())
-    result.append(&success);
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
-    result.append(*f_iter);
-
-  generate_hs_struct_definition(f_service_, &result, false);
-}
-
-/**
- * Generate the map from field names to (type, id)
- * @param tstruct the Struct
- */
-void t_hs_generator::generate_hs_typemap(ofstream& out, t_struct* tstruct) {
-  string name = type_name(tstruct);
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "typemap_" << name << " :: T.TypeMap" << endl;
-  indent(out) << "typemap_" << name << " = Map.fromList [";
-  bool first = true;
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    string mname = (*f_iter)->get_name();
-    if (!first) {
-      out << ",";
-    }
-
-    t_type* type = get_true_type((*f_iter)->get_type());
-    int32_t key = (*f_iter)->get_key();
-    out << "(" << key << ",(\"" << mname << "\"," << type_to_enum(type) << "))";
-    first = false;
-  }
-  out << "]" << endl;
-}
-
-/**
- * generate the struct with default values filled in
- * @param tstruct the Struct
- */
-void t_hs_generator::generate_hs_default(ofstream& out, t_struct* tstruct) {
-  string name = type_name(tstruct);
-  string fname = type_name(tstruct, "default_");
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-
-  indent(out) << fname << " :: " << name << endl;
-  indent(out) << fname << " = " << name << "{" << endl;
-  indent_up();
-  bool first = true;
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    string mname = (*f_iter)->get_name();
-    if (first) {
-      first = false;
-    } else {
-      out << "," << endl;
-    }
-
-    t_type* type = get_true_type((*f_iter)->get_type());
-    t_const_value* value = (*f_iter)->get_value();
-    indent(out) << field_name(name, mname) << " = ";
-    if ((*f_iter)->get_req() == t_field::T_OPTIONAL
-        || ((t_type*)(*f_iter)->get_type())->is_xception()) {
-      if (value == NULL) {
-        out << "P.Nothing";
-      } else {
-        out << "P.Just " << render_const_value(type, value);
-      }
-    } else {
-      out << render_const_value(type, value);
-    }
-  }
-  out << "}" << endl;
-  indent_down();
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_hs_generator::generate_service_interface(t_service* tservice) {
-  string f_iface_name = get_out_dir() + capitalize(service_name_) + "_Iface.hs";
-  f_iface_.open(f_iface_name.c_str());
-
-  f_iface_ << hs_language_pragma() << endl;
-  f_iface_ << hs_autogen_comment() << endl;
-
-  f_iface_ << "module " << capitalize(service_name_) << "_Iface where" << endl;
-
-  f_iface_ << hs_imports() << endl;
-  f_iface_ << "import " << capitalize(program_name_) << "_Types" << endl;
-  f_iface_ << endl;
-
-  string sname = capitalize(service_name_);
-  if (tservice->get_extends() != NULL) {
-    string extends = type_name(tservice->get_extends());
-
-    indent(f_iface_) << "import " << extends << "_Iface" << endl;
-    indent(f_iface_) << "class " << extends << "_Iface a => " << sname << "_Iface a where" << endl;
-
-  } else {
-    indent(f_iface_) << "class " << sname << "_Iface a where" << endl;
-  }
-
-  indent_up();
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string ft = function_type(*f_iter, true, true, true);
-    indent(f_iface_) << decapitalize((*f_iter)->get_name()) << " :: a -> " << ft << endl;
-  }
-
-  indent_down();
-  f_iface_.close();
-}
-
-/**
- * Generates a service client definition. Note that in Haskell, the client doesn't implement iface.
- *This is because
- * The client does not (and should not have to) deal with arguments being Nothing.
- *
- * @param tservice The service to generate a server for.
- */
-void t_hs_generator::generate_service_client(t_service* tservice) {
-  string f_client_name = get_out_dir() + capitalize(service_name_) + "_Client.hs";
-  f_client_.open(f_client_name.c_str());
-  f_client_ << hs_language_pragma() << endl;
-  f_client_ << hs_autogen_comment() << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-
-  string extends = "";
-  string exports = "";
-
-  bool first = true;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    exports += (first ? "" : ",");
-    string funname = (*f_iter)->get_name();
-    exports += decapitalize(funname);
-    first = false;
-  }
-
-  string sname = capitalize(service_name_);
-  indent(f_client_) << "module " << sname << "_Client(" << exports << ") where" << endl;
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    indent(f_client_) << "import " << extends << "_Client" << endl;
-  }
-
-  indent(f_client_) << "import qualified Data.IORef as R" << endl;
-  indent(f_client_) << hs_imports() << endl;
-  indent(f_client_) << "import " << capitalize(program_name_) << "_Types" << endl;
-  indent(f_client_) << "import " << capitalize(service_name_) << endl;
-
-  // DATS RITE A GLOBAL VAR
-  indent(f_client_) << "seqid = R.newIORef 0" << endl;
-
-  // Generate client method implementations
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    string fargs = "";
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter)
-      fargs += " arg_" + (*fld_iter)->get_name();
-
-    // Open function
-    indent(f_client_) << decapitalize(funname) << " (ip,op)" << fargs << " = do" << endl;
-    indent_up();
-    indent(f_client_) << "send_" << funname << " op" << fargs;
-
-    f_client_ << endl;
-
-    if (!(*f_iter)->is_oneway())
-      indent(f_client_) << "recv_" << funname << " ip" << endl;
-
-    indent_down();
-
-    indent(f_client_) << "send_" << funname << " op" << fargs << " = do" << endl;
-    indent_up();
-
-    indent(f_client_) << "seq <- seqid" << endl;
-    indent(f_client_) << "seqn <- R.readIORef seq" << endl;
-    string argsname = capitalize((*f_iter)->get_name() + "_args");
-
-    // Serialize the request header
-    string fname = (*f_iter)->get_name();
-    string msgType = (*f_iter)->is_oneway() ? "T.M_ONEWAY" : "T.M_CALL";
-    indent(f_client_) << "T.writeMessageBegin op (\"" << fname << "\", " << msgType << ", seqn)"
-                      << endl;
-    indent(f_client_) << "write_" << argsname << " op (" << argsname << "{";
-
-    bool first = true;
-    for (vector<t_field*>::const_iterator fld_iter = fields.begin(); fld_iter != fields.end();
-         ++fld_iter) {
-      string fieldname = (*fld_iter)->get_name();
-      f_client_ << (first ? "" : ",");
-      f_client_ << field_name(argsname, fieldname) << "=";
-      if ((*fld_iter)->get_req() == t_field::T_OPTIONAL
-          || ((t_type*)(*fld_iter)->get_type())->is_xception())
-        f_client_ << "P.Just ";
-      f_client_ << "arg_" << fieldname;
-      first = false;
-    }
-    f_client_ << "})" << endl;
-    indent(f_client_) << "T.writeMessageEnd op" << endl;
-
-    // Write to the stream
-    indent(f_client_) << "T.tFlush (T.getTransport op)" << endl;
-    indent_down();
-
-    if (!(*f_iter)->is_oneway()) {
-      string resultname = capitalize((*f_iter)->get_name() + "_result");
-      t_struct noargs(program_);
-
-      string funname = string("recv_") + (*f_iter)->get_name();
-      t_function recv_function((*f_iter)->get_returntype(), funname, &noargs);
-
-      // Open function
-      indent(f_client_) << funname << " ip = do" << endl;
-      indent_up();
-
-      indent(f_client_) << "(fname, mtype, rseqid) <- T.readMessageBegin ip" << endl;
-      indent(f_client_) << "M.when (mtype == T.M_EXCEPTION) $ do { exn <- T.readAppExn ip ; "
-                           "T.readMessageEnd ip ; X.throw exn }" << endl;
-
-      indent(f_client_) << "res <- read_" << resultname << " ip" << endl;
-      indent(f_client_) << "T.readMessageEnd ip" << endl;
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const vector<t_field*>& xceptions = xs->get_members();
-
-      for (vector<t_field*>::const_iterator x_iter = xceptions.begin(); x_iter != xceptions.end();
-           ++x_iter) {
-        indent(f_client_) << "P.maybe (P.return ()) X.throw ("
-                          << field_name(resultname, (*x_iter)->get_name()) << " res)" << endl;
-      }
-
-      if (!(*f_iter)->get_returntype()->is_void())
-        indent(f_client_) << "P.return $ " << field_name(resultname, "success") << " res" << endl;
-      else
-        indent(f_client_) << "P.return ()" << endl;
-
-      // Close function
-      indent_down();
-    }
-  }
-
-  f_client_.close();
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_hs_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter)
-    generate_process_function(tservice, *f_iter);
-
-  indent(f_service_) << "proc_ handler (iprot,oprot) (name,typ,seqid) = case name of" << endl;
-  indent_up();
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string fname = (*f_iter)->get_name();
-    indent(f_service_) << "\"" << fname << "\" -> process_" << decapitalize(fname)
-                       << " (seqid,iprot,oprot,handler)" << endl;
-  }
-
-  indent(f_service_) << "_ -> ";
-  if (tservice->get_extends() != NULL) {
-    f_service_ << type_name(tservice->get_extends())
-               << ".proc_ handler (iprot,oprot) (name,typ,seqid)" << endl;
-
-  } else {
-    f_service_ << "do" << endl;
-    indent_up();
-    indent(f_service_) << "_ <- T.readVal iprot (T.T_STRUCT Map.empty)" << endl;
-    indent(f_service_) << "T.writeMessageBegin oprot (name,T.M_EXCEPTION,seqid)" << endl;
-    indent(f_service_) << "T.writeAppExn oprot (T.AppExn T.AE_UNKNOWN_METHOD (\"Unknown function "
-                          "\" ++ LT.unpack name))" << endl;
-    indent(f_service_) << "T.writeMessageEnd oprot" << endl;
-    indent(f_service_) << "T.tFlush (T.getTransport oprot)" << endl;
-    indent_down();
-  }
-
-  indent_down();
-
-  // Generate the server implementation
-  indent(f_service_) << "process handler (iprot, oprot) = do" << endl;
-  indent_up();
-
-  indent(f_service_) << "(name, typ, seqid) <- T.readMessageBegin iprot" << endl;
-  indent(f_service_) << "proc_ handler (iprot,oprot) (name,typ,seqid)" << endl;
-  indent(f_service_) << "T.readMessageEnd iprot" << endl;
-  indent(f_service_) << "P.return P.True" << endl;
-  indent_down();
-}
-
-bool hasNoArguments(t_function* func) {
-  return (func->get_arglist()->get_members().empty());
-}
-
-string t_hs_generator::render_hs_type_for_function_name(t_type* type) {
-  string type_str = render_hs_type(type, false);
-  std::string::size_type found = -1;
-
-  while (true) {
-    found = type_str.find_first_of("[]. ", found + 1);
-    if (string::npos == size_t(found)) {
-      break;
-    }
-
-    if (type_str[found] == '.')
-      type_str[found] = '_';
-    else
-      type_str[found] = 'Z';
-  }
-  return type_str;
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_hs_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open function
-  string funname = decapitalize(tfunction->get_name());
-  indent(f_service_) << "process_" << funname << " (seqid, iprot, oprot, handler) = do" << endl;
-  indent_up();
-
-  string argsname = capitalize(tfunction->get_name()) + "_args";
-  string resultname = capitalize(tfunction->get_name()) + "_result";
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(f_service_) << "args <- read_" << argsname << " iprot" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  size_t n = xceptions.size() + 1;
-  // Try block for a function with exceptions
-  if (n > 0) {
-    for (size_t i = 0; i < n; i++) {
-      indent(f_service_) << "(X.catch" << endl;
-      indent_up();
-    }
-  }
-
-  if (n > 0) {
-    indent(f_service_) << "(do" << endl;
-    indent_up();
-  }
-  indent(f_service_);
-
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void())
-    f_service_ << "val <- ";
-
-  f_service_ << "Iface." << decapitalize(tfunction->get_name()) << " handler";
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter)
-    f_service_ << " (" << field_name(argsname, (*f_iter)->get_name()) << " args)";
-
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << endl;
-    indent(f_service_) << "let res = default_" << resultname << "{"
-                       << field_name(resultname, "success") << " = val}";
-
-  } else if (!tfunction->is_oneway()) {
-    f_service_ << endl;
-    indent(f_service_) << "let res = default_" << resultname;
-  }
-  f_service_ << endl;
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    indent(f_service_) << "P.return ()";
-  } else {
-    indent(f_service_) << "T.writeMessageBegin oprot (\"" << tfunction->get_name()
-                       << "\", T.M_REPLY, seqid)" << endl;
-    indent(f_service_) << "write_" << resultname << " oprot res" << endl;
-    indent(f_service_) << "T.writeMessageEnd oprot" << endl;
-    indent(f_service_) << "T.tFlush (T.getTransport oprot)";
-  }
-  if (n > 0) {
-    f_service_ << ")";
-    indent_down();
-  }
-  f_service_ << endl;
-
-  if (n > 0) {
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      indent(f_service_) << "(\\e  -> do" << endl;
-      indent_up();
-
-      if (!tfunction->is_oneway()) {
-        indent(f_service_) << "let res = default_" << resultname << "{"
-                           << field_name(resultname, (*x_iter)->get_name()) << " = P.Just e}"
-                           << endl;
-        indent(f_service_) << "T.writeMessageBegin oprot (\"" << tfunction->get_name()
-                           << "\", T.M_REPLY, seqid)" << endl;
-        indent(f_service_) << "write_" << resultname << " oprot res" << endl;
-        indent(f_service_) << "T.writeMessageEnd oprot" << endl;
-        indent(f_service_) << "T.tFlush (T.getTransport oprot)";
-      } else {
-        indent(f_service_) << "P.return ()";
-      }
-
-      f_service_ << "))" << endl;
-      indent_down();
-      indent_down();
-    }
-    indent(f_service_) << "((\\_ -> do" << endl;
-    indent_up();
-
-    if (!tfunction->is_oneway()) {
-      indent(f_service_) << "T.writeMessageBegin oprot (\"" << tfunction->get_name()
-                         << "\", T.M_EXCEPTION, seqid)" << endl;
-      indent(f_service_) << "T.writeAppExn oprot (T.AppExn T.AE_UNKNOWN \"\")" << endl;
-      indent(f_service_) << "T.writeMessageEnd oprot" << endl;
-      indent(f_service_) << "T.tFlush (T.getTransport oprot)";
-    } else {
-      indent(f_service_) << "P.return ()";
-    }
-
-    f_service_ << ") :: X.SomeException -> P.IO ()))" << endl;
-    indent_down();
-    indent_down();
-  }
-  // Close function
-  indent_down();
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_hs_generator::generate_deserialize_field(ofstream& out, t_field* tfield, string prefix) {
-  (void)prefix;
-  t_type* type = tfield->get_type();
-  generate_deserialize_type(out, type, prefix);
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_hs_generator::generate_deserialize_type(ofstream& out, t_type* type, string arg) {
-  type = get_true_type(type);
-  string val = tmp("_val");
-  out << "(case " << arg << " of {" << type_to_constructor(type) << " " << val << " -> ";
-
-  if (type->is_void())
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE";
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, val);
-
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, val);
-
-  } else if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    if (tbase == t_base_type::TYPE_STRING && !((t_base_type*)type)->is_binary()) {
-      out << "E.decodeUtf8 ";
-    }
-    out << val;
-  } else if (type->is_enum()) {
-    out << "P.toEnum $ P.fromIntegral " << val;
-
-  } else {
-    throw "DO NOT KNOW HOW TO DESERIALIZE TYPE " + type->get_name();
-  }
-  out << "; _ -> P.error \"wrong type\"})";
-}
-
-/**
- * Generates an unserializer for a struct, calling read()
- */
-void t_hs_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct, string name) {
-
-  out << "(" << type_name(tstruct, "to_") << " (T.TStruct " << name << "))";
-}
-
-/**
- * Serialize a container by writing out the header followed by
- * data and then a footer.
- */
-void t_hs_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string arg) {
-
-  string val = tmp("_v");
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    string key = tmp("_k");
-    out << "(Map.fromList $ P.map (\\(" << key << "," << val << ") -> (";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_key_type(), key);
-
-    out << ",";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_val_type(), val);
-
-    out << ")) " << arg << ")";
-
-  } else if (ttype->is_set()) {
-    out << "(Set.fromList $ P.map (\\" << val << " -> ";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_key_type(), val);
-    out << ") " << arg << ")";
-
-  } else if (ttype->is_list()) {
-    out << "(Vector.fromList $ P.map (\\" << val << " -> ";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_key_type(), val);
-    out << ") " << arg << ")";
-  }
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_hs_generator::generate_serialize_type(ofstream& out, t_type* type, string name) {
-
-  type = get_true_type(type);
-  // Do nothing for void types
-  if (type->is_void())
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE";
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, name);
-
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, name);
-
-  } else if (type->is_base_type() || type->is_enum()) {
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      out << type_to_constructor(type) << " ";
-      if (tbase == t_base_type::TYPE_STRING && !((t_base_type*)type)->is_binary()) {
-        out << "$ E.encodeUtf8 ";
-      }
-      out << name;
-
-    } else if (type->is_enum()) {
-      string ename = capitalize(type->get_name());
-      out << "T.TI32 $ P.fromIntegral $ P.fromEnum " << name;
-    }
-
-  } else {
-    throw "DO NOT KNOW HOW TO SERIALIZE FIELD OF TYPE " + type->get_name();
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_hs_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  out << type_name(tstruct, "from_") << " " << prefix;
-}
-
-void t_hs_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  string k = tmp("_k");
-  string v = tmp("_v");
-
-  if (ttype->is_map()) {
-    t_type* ktype = ((t_map*)ttype)->get_key_type();
-    t_type* vtype = ((t_map*)ttype)->get_val_type();
-    out << "T.TMap " << type_to_enum(ktype) << " " << type_to_enum(vtype);
-    out << " $ P.map (\\(" << k << "," << v << ") -> (";
-    generate_serialize_type(out, ktype, k);
-    out << ", ";
-    generate_serialize_type(out, vtype, v);
-    out << ")) $ Map.toList " << prefix;
-
-  } else if (ttype->is_set()) {
-    out << "T.TSet " << type_to_enum(((t_list*)ttype)->get_elem_type());
-    out << " $ P.map (\\" << v << " -> ";
-    generate_serialize_type(out, ((t_list*)ttype)->get_elem_type(), v);
-    out << ") $ Set.toList " << prefix;
-
-  } else if (ttype->is_list()) {
-    out << "T.TList " << type_to_enum(((t_list*)ttype)->get_elem_type());
-    out << " $ P.map (\\" << v << " -> ";
-    generate_serialize_type(out, ((t_list*)ttype)->get_elem_type(), v);
-    out << ") $ Vector.toList " << prefix;
-  }
-}
-
-string t_hs_generator::function_type(t_function* tfunc, bool options, bool io, bool method) {
-  string result = "";
-
-  const vector<t_field*>& fields = tfunc->get_arglist()->get_members();
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_OPTIONAL
-        || ((t_type*)(*f_iter)->get_type())->is_xception())
-      result += "P.Maybe ";
-    result += render_hs_type((*f_iter)->get_type(), options);
-    result += " -> ";
-  }
-
-  if (fields.empty() && !method)
-    result += "() -> ";
-
-  if (io)
-    result += "P.IO ";
-
-  result += render_hs_type(tfunc->get_returntype(), io);
-  return result;
-}
-
-string t_hs_generator::type_name(t_type* ttype, string function_prefix) {
-  string prefix = "";
-  t_program* program = ttype->get_program();
-
-  if (program != NULL && program != program_)
-    if (!ttype->is_service())
-      prefix = capitalize(program->get_name()) + "_Types.";
-
-  return prefix + function_prefix + capitalize(ttype->get_name());
-}
-
-string t_hs_generator::field_name(string tname, string fname) {
-  return decapitalize(tname) + "_" + fname;
-}
-
-/**
- * Converts the parse type to a Protocol.t_type enum
- */
-string t_hs_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "T.T_VOID";
-    case t_base_type::TYPE_STRING:
-      return "T.T_STRING";
-    case t_base_type::TYPE_BOOL:
-      return "T.T_BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "T.T_BYTE";
-    case t_base_type::TYPE_I16:
-      return "T.T_I16";
-    case t_base_type::TYPE_I32:
-      return "T.T_I32";
-    case t_base_type::TYPE_I64:
-      return "T.T_I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "T.T_DOUBLE";
-    }
-
-  } else if (type->is_enum()) {
-    return "T.T_I32";
-
-  } else if (type->is_struct() || type->is_xception()) {
-    return "(T.T_STRUCT " + type_name((t_struct*)type, "typemap_") + ")";
-
-  } else if (type->is_map()) {
-    string ktype = type_to_enum(((t_map*)type)->get_key_type());
-    string vtype = type_to_enum(((t_map*)type)->get_val_type());
-    return "(T.T_MAP " + ktype + " " + vtype + ")";
-
-  } else if (type->is_set()) {
-    return "(T.T_SET " + type_to_enum(((t_list*)type)->get_elem_type()) + ")";
-
-  } else if (type->is_list()) {
-    return "(T.T_LIST " + type_to_enum(((t_list*)type)->get_elem_type()) + ")";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Converts the parse type to a default value
- */
-string t_hs_generator::type_to_default(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "P.error \"No default value for type T_VOID\"";
-    case t_base_type::TYPE_STRING:
-      return "\"\"";
-    case t_base_type::TYPE_BOOL:
-      return "P.False";
-    case t_base_type::TYPE_BYTE:
-      return "0";
-    case t_base_type::TYPE_I16:
-      return "0";
-    case t_base_type::TYPE_I32:
-      return "0";
-    case t_base_type::TYPE_I64:
-      return "0";
-    case t_base_type::TYPE_DOUBLE:
-      return "0";
-    }
-
-  } else if (type->is_enum()) {
-    return "(P.toEnum 0)";
-
-  } else if (type->is_struct() || type->is_xception()) {
-    return type_name((t_struct*)type, "default_");
-
-  } else if (type->is_map()) {
-    return "Map.empty";
-
-  } else if (type->is_set()) {
-    return "Set.empty";
-
-  } else if (type->is_list()) {
-    return "Vector.empty";
-  }
-
-  throw "INVALID TYPE IN type_to_default: " + type->get_name();
-}
-
-/**
- * Converts the parse type to an haskell type
- */
-string t_hs_generator::render_hs_type(t_type* type, bool needs_parens) {
-  type = get_true_type(type);
-  string type_repr;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "()";
-    case t_base_type::TYPE_STRING:
-      return (((t_base_type*)type)->is_binary() ? "LBS.ByteString" : "LT.Text");
-    case t_base_type::TYPE_BOOL:
-      return "P.Bool";
-    case t_base_type::TYPE_BYTE:
-      return "I.Int8";
-    case t_base_type::TYPE_I16:
-      return "I.Int16";
-    case t_base_type::TYPE_I32:
-      return "I.Int32";
-    case t_base_type::TYPE_I64:
-      return "I.Int64";
-    case t_base_type::TYPE_DOUBLE:
-      return "P.Double";
-    }
-
-  } else if (type->is_enum()) {
-    return type_name((t_enum*)type);
-
-  } else if (type->is_struct() || type->is_xception()) {
-    return type_name((t_struct*)type);
-
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    type_repr = "Map.HashMap " + render_hs_type(ktype, true) + " " + render_hs_type(vtype, true);
-
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    type_repr = "Set.HashSet " + render_hs_type(etype, true);
-
-  } else if (type->is_list()) {
-    t_type* etype = ((t_list*)type)->get_elem_type();
-    type_repr = "Vector.Vector " + render_hs_type(etype, true);
-
-  } else {
-    throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-  }
-
-  return needs_parens ? "(" + type_repr + ")" : type_repr;
-}
-
-/**
- * Converts the parse type to a haskell constructor
- */
-string t_hs_generator::type_to_constructor(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "invalid type: T_VOID";
-    case t_base_type::TYPE_STRING:
-      return "T.TString";
-    case t_base_type::TYPE_BOOL:
-      return "T.TBool";
-    case t_base_type::TYPE_BYTE:
-      return "T.TByte";
-    case t_base_type::TYPE_I16:
-      return "T.TI16";
-    case t_base_type::TYPE_I32:
-      return "T.TI32";
-    case t_base_type::TYPE_I64:
-      return "T.TI64";
-    case t_base_type::TYPE_DOUBLE:
-      return "T.TDouble";
-    }
-
-  } else if (type->is_enum()) {
-    return "T.TI32";
-
-  } else if (type->is_struct() || type->is_xception()) {
-    return "T.TStruct";
-
-  } else if (type->is_map()) {
-    return "T.TMap _ _";
-
-  } else if (type->is_set()) {
-    return "T.TSet _";
-
-  } else if (type->is_list()) {
-    return "T.TList _";
-  }
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(hs, "Haskell", "")


[50/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/GNUmakefile.in
----------------------------------------------------------------------
diff --git a/GNUmakefile.in b/GNUmakefile.in
index fd97f4f..6a7ca9b 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -11,7 +11,6 @@ include $(top_builddir)/src/Makefile.global
 all:
 #	$(MAKE) -C doc $@
 	$(MAKE) -C depends/thirdparty/googletest $@
-	$(MAKE) -C depends/thirdparty/thrift/hawqbuild $@
 	$(MAKE) -C depends/libhdfs3 $@
 	$(MAKE) -C depends/libyarn $@
 	$(MAKE) -C src $@
@@ -23,7 +22,6 @@ all:
 install:
 #	$(MAKE) -C doc $@
 	$(MAKE) -C depends/thirdparty/googletest $@ 
-	$(MAKE) -C depends/thirdparty/thrift/hawqbuild $@
 	$(MAKE) -C depends/libhdfs3 $@
 	$(MAKE) -C depends/libyarn $@
 	$(MAKE) -C src $@
@@ -56,7 +54,6 @@ clean:
 #	$(MAKE) -C doc $@
 	$(MAKE) -C contrib $@
 	-$(MAKE) -C depends/thirdparty/googletest $@ 
-	-$(MAKE) -C depends/thirdparty/thrift/hawqbuild $@
 	-$(MAKE) -C depends/libhdfs3 $@
 	-$(MAKE) -C depends/libyarn $@
 	$(MAKE) -C src $@
@@ -73,7 +70,6 @@ distclean maintainer-clean:
 #	-$(MAKE) -C doc $@
 	-$(MAKE) -C contrib $@
 	-$(MAKE) -C depends/thirdparty/googletest $@ 
-	-$(MAKE) -C depends/thirdparty/thrift/hawqbuild $@
 	-$(MAKE) -C depends/libhdfs3 $@
 	-$(MAKE) -C depends/libyarn $@
 	-$(MAKE) -C config $@

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/configure
----------------------------------------------------------------------
diff --git a/configure b/configure
index abb93e7..c3abe93 100755
--- a/configure
+++ b/configure
@@ -720,7 +720,6 @@ with_zlib
 with_system_tzdata
 with_libhdfs3
 with_libyarn
-with_thrift
 with_openssl
 with_bonjour
 with_ldap
@@ -864,7 +863,6 @@ with_ldap
 with_bonjour
 with_openssl
 with_readline
-with_thrift
 with_libyarn
 with_libhdfs3
 with_libedit_preferred
@@ -1555,7 +1553,6 @@ Optional Packages:
   --with-bonjour          build with Bonjour support
   --with-openssl          build with OpenSSL support
   --without-readline      do not use GNU Readline nor BSD Libedit for editing
-  --with-thrift           build thrift
   --without-libyarn       do not build libyarn
   --without-libhdfs3      do not build libhdfs3
   --without-libedit-preferred  Don't prefer BSD Libedit over GNU Readline
@@ -6104,36 +6101,6 @@ $as_echo "$as_me: WARNING: *** Readline does not work on MinGW --- disabling" >&
 fi
 
 #
-# thrift
-#
-
-pgac_args="$pgac_args with_thrift"
-
-
-# Check whether --with-thrift was given.
-if test "${with_thrift+set}" = set; then :
-  withval=$with_thrift;
-  case $withval in
-    yes)
-      :
-      ;;
-    no)
-      :
-      ;;
-    *)
-      as_fn_error $? "no argument expected for --with-thrift option" "$LINENO" 5
-      ;;
-  esac
-
-else
-  with_thrift=no
-
-fi
-
-
-
-
-#
 # libyarn
 #
 
@@ -9965,9 +9932,6 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
 # Check for thrift
-#AC_CHECK_HEADERS(thrift/protocol/TBinaryProtocol.h, [], [AC_MSG_ERROR([thrift is required])])
-
-# Check for boost
 ac_ext=cpp
 ac_cpp='$CXXCPP $CPPFLAGS'
 ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -10360,6 +10324,22 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
 ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
 
 
+for ac_header in thrift/protocol/TBinaryProtocol.h
+do :
+  ac_fn_cxx_check_header_mongrel "$LINENO" "thrift/protocol/TBinaryProtocol.h" "ac_cv_header_thrift_protocol_TBinaryProtocol_h" "$ac_includes_default"
+if test "x$ac_cv_header_thrift_protocol_TBinaryProtocol_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_THRIFT_PROTOCOL_TBINARYPROTOCOL_H 1
+_ACEOF
+
+else
+  as_fn_error $? "thrift is required" "$LINENO" 5
+fi
+
+done
+
+
+# Check for boost
 for ac_header in boost/chrono.hpp
 do :
   ac_fn_cxx_check_header_mongrel "$LINENO" "boost/chrono.hpp" "ac_cv_header_boost_chrono_hpp" "$ac_includes_default"
@@ -16482,7 +16462,7 @@ $as_echo "done" >&6; }
 fi
 
 
-ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/thirdparty/thrift/hawqbuild/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global"
+ac_config_files="$ac_config_files GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global"
 
 
 ac_config_links="$ac_config_links src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c src/backend/port/pg_sema.c:${SEMA_IMPLEMENTATION} src/backend/port/pg_shmem.c:${SHMEM_IMPLEMENTATION} src/include/dynloader.h:src/backend/port/dynloader/${template}.h src/include/pg_config_os.h:src/include/port/${template}.h src/Makefile.port:src/makefiles/Makefile.${template}"
@@ -17203,7 +17183,6 @@ do
     "GNUmakefile") CONFIG_FILES="$CONFIG_FILES GNUmakefile" ;;
     "src/VERSIONS.mk") CONFIG_FILES="$CONFIG_FILES src/VERSIONS.mk" ;;
     "depends/thirdparty/googletest/Makefile.global") CONFIG_FILES="$CONFIG_FILES depends/thirdparty/googletest/Makefile.global" ;;
-    "depends/thirdparty/thrift/hawqbuild/Makefile.global") CONFIG_FILES="$CONFIG_FILES depends/thirdparty/thrift/hawqbuild/Makefile.global" ;;
     "depends/libhdfs3/Makefile.global") CONFIG_FILES="$CONFIG_FILES depends/libhdfs3/Makefile.global" ;;
     "depends/libyarn/Makefile.global") CONFIG_FILES="$CONFIG_FILES depends/libyarn/Makefile.global" ;;
     "src/Makefile.global") CONFIG_FILES="$CONFIG_FILES src/Makefile.global" ;;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/configure.in
----------------------------------------------------------------------
diff --git a/configure.in b/configure.in
index 89f9b7e..fd1481e 100644
--- a/configure.in
+++ b/configure.in
@@ -812,13 +812,6 @@ if test "$PORTNAME" = "win32"; then
 fi
 
 #
-# thrift
-#
-PGAC_ARG_BOOL(with, thrift, no,
-              [  --with-thrift           build thrift])
-AC_SUBST(with_thrift)
-
-#
 # libyarn
 #
 PGAC_ARG_BOOL(with, libyarn, yes,
@@ -1150,7 +1143,7 @@ AC_SEARCH_LIBS(snappy_max_compressed_length, snappy, [], [AC_MSG_ERROR([snappy i
 AC_LANG_PUSH([C++])
 
 # Check for thrift
-#AC_CHECK_HEADERS(thrift/protocol/TBinaryProtocol.h, [], [AC_MSG_ERROR([thrift is required])])
+AC_CHECK_HEADERS(thrift/protocol/TBinaryProtocol.h, [], [AC_MSG_ERROR([thrift is required])])
 
 # Check for boost
 AC_CHECK_HEADERS(boost/chrono.hpp, [], [AC_MSG_ERROR([boost is required])])
@@ -2078,7 +2071,7 @@ else
 fi
 AC_SUBST(vpath_build)
 
-AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/thirdparty/thrift/hawqbuild/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global])
+AC_CONFIG_FILES([GNUmakefile src/VERSIONS.mk depends/thirdparty/googletest/Makefile.global depends/libhdfs3/Makefile.global depends/libyarn/Makefile.global src/Makefile.global src/pl/pljava/src/java/Makefile.global])
 
 AC_CONFIG_LINKS([
   src/backend/port/dynloader.c:src/backend/port/dynloader/${template}.c

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/README
----------------------------------------------------------------------
diff --git a/depends/thirdparty/README b/depends/thirdparty/README
index bbbfc60..141a4ef 100644
--- a/depends/thirdparty/README
+++ b/depends/thirdparty/README
@@ -1,6 +1,3 @@
-thrift(with version 0.9.3):
-	https://github.com/apache/thrift/archive/0.9.3.tar.gz
-
 Please do not create following directories yourselves:
 	gporca, gp-xerces, gpos, postgres
 since they are auto-created and used when building some related features, i.e.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/.clang-format
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/.clang-format b/depends/thirdparty/thrift/.clang-format
deleted file mode 100644
index a62eef8..0000000
--- a/depends/thirdparty/thrift/.clang-format
+++ /dev/null
@@ -1,56 +0,0 @@
----
-Language:        Cpp
-# BasedOnStyle:  LLVM
-AccessModifierOffset: -2
-ConstructorInitializerIndentWidth: 2
-AlignEscapedNewlinesLeft: false
-AlignTrailingComments: true
-AllowAllParametersOfDeclarationOnNextLine: false
-AllowShortBlocksOnASingleLine: false
-AllowShortIfStatementsOnASingleLine: false
-AllowShortLoopsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: Inline
-AlwaysBreakTemplateDeclarations: true
-AlwaysBreakBeforeMultilineStrings: true
-BreakBeforeBinaryOperators: true
-BreakBeforeTernaryOperators: true
-BreakConstructorInitializersBeforeComma: false
-BinPackParameters: false
-ColumnLimit:     100
-ConstructorInitializerAllOnOneLineOrOnePerLine: true
-DerivePointerAlignment: false
-IndentCaseLabels: false
-IndentWrappedFunctionNames: false
-IndentFunctionDeclarationAfterType: false
-MaxEmptyLinesToKeep: 1
-KeepEmptyLinesAtTheStartOfBlocks: true
-NamespaceIndentation: None
-ObjCSpaceAfterProperty: false
-ObjCSpaceBeforeProtocolList: true
-PenaltyBreakBeforeFirstCallParameter: 190
-PenaltyBreakComment: 300
-PenaltyBreakString: 10000
-PenaltyBreakFirstLessLess: 120
-PenaltyExcessCharacter: 1000000
-PenaltyReturnTypeOnItsOwnLine: 1200
-PointerAlignment: Left
-SpacesBeforeTrailingComments: 1
-Cpp11BracedListStyle: true
-Standard:        Auto
-IndentWidth:     2
-TabWidth:        4
-UseTab:          Never
-BreakBeforeBraces: Attach
-SpacesInParentheses: false
-SpacesInAngles:  false
-SpaceInEmptyParentheses: false
-SpacesInCStyleCastParentheses: false
-SpacesInContainerLiterals: true
-SpaceBeforeAssignmentOperators: true
-ContinuationIndentWidth: 4
-CommentPragmas:  '^ IWYU pragma:'
-ForEachMacros:   [ foreach, Q_FOREACH, BOOST_FOREACH ]
-SpaceBeforeParens: ControlStatements
-DisableFormat:   false
-...
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/.editorconfig
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/.editorconfig b/depends/thirdparty/thrift/.editorconfig
deleted file mode 100755
index 3611762..0000000
--- a/depends/thirdparty/thrift/.editorconfig
+++ /dev/null
@@ -1,112 +0,0 @@
-#
-## Licensed to the Apache Software Foundation (ASF) under one
-## or more contributor license agreements. See the NOTICE file
-## distributed with this work for additional information
-## regarding copyright ownership. The ASF licenses this file
-## to you under the Apache License, Version 2.0 (the
-## "License"); you may not use this file except in compliance
-## with the License. You may obtain a copy of the License at
-##
-##   http://www.apache.org/licenses/LICENSE-2.0
-##
-## Unless required by applicable law or agreed to in writing,
-## software distributed under the License is distributed on an
-## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-## KIND, either express or implied. See the License for the
-## specific language governing permissions and limitations
-## under the License.
-##
-#
-
-# EditorConfig: http://editorconfig.org
-# see doc/coding_standards.md
-
-root = true
-
-[*]
-end_of_line = lf
-charset = utf-8
-trim_trailing_whitespace = true
-insert_final_newline = true
-
-# ActionScript
-# [*.as]
-
-# C
-# [*.c]
-
-# C++
-[*.cpp]
-indent_style = space
-indent_size = 2
-
-# C-Sharp
-# [*.cs]
-
-# D
-# [*.d]
-
-# Erlang
-# [*.erl]
-
-# Go-lang
-[*.go]
-indent_style = tab
-indent_size = 8
-
-# C header files
-# [*.h]
-
-# Haskell
-# [*.hs]
-
-# Haxe
-# [*.hx]
-
-# Java
-# [*.java]
-
-# Javascript
-[*.js]
-indent_style = space
-indent_size = 2
-
-# JSON
-[*.json]
-indent_style = space
-indent_size = 2
-
-# Lua
-# [*.lua]
-
-[*.markdown]
-indent_style = space
-trim_trailing_whitespace = false
-
-[*.md]
-indent_style = space
-trim_trailing_whitespace = false
-
-# OCaml
-# [*.ml]
-
-# Delphi Pascal
-# [*.pas]
-
-# PHP
-# [*.php]
-
-# Perl
-# [*.pm]
-
-# Python
-# [*.py]
-
-# Ruby
-# [*.rb]
-
-# Typescript
-# [*.ts]
-
-# XML
-# [*.xml]

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/.gitattributes
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/.gitattributes b/depends/thirdparty/thrift/.gitattributes
deleted file mode 100644
index 176a458..0000000
--- a/depends/thirdparty/thrift/.gitattributes
+++ /dev/null
@@ -1 +0,0 @@
-* text=auto

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/.gitignore
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/.gitignore b/depends/thirdparty/thrift/.gitignore
deleted file mode 100644
index 91ee32d..0000000
--- a/depends/thirdparty/thrift/.gitignore
+++ /dev/null
@@ -1,280 +0,0 @@
-# generic ignores
-*.la
-*.lo
-*.o
-*.deps
-*.dirstamp
-*.libs
-*.log
-*.trs
-*.suo
-*.pyc
-*.cache
-*.user
-*.ipch
-*.sdf
-*.jar
-*.exe
-*.dll
-*_ReSharper*
-*.opensdf
-*.swp
-*.hi
-*~
-
-.*project
-junit*.properties
-.idea
-gen-*
-Makefile
-Makefile.in
-aclocal.m4
-acinclude.m4
-autom4te.cache
-cmake-*
-node_modules
-compile
-test-driver
-
-.sonar
-.DS_Store
-.svn
-.vagrant
-
-/contrib/.vagrant/
-/aclocal/libtool.m4
-/aclocal/lt*.m4
-/autoscan.log
-/autoscan-*.log
-/compiler/cpp/Debug
-/compiler/cpp/Release
-/compiler/cpp/libparse.a
-/compiler/cpp/src/thriftl.cc
-/compiler/cpp/src/thrifty.cc
-/compiler/cpp/src/thrifty.hh
-/compiler/cpp/src/windows/version.h
-/compiler/cpp/thrift
-/compiler/cpp/thriftl.cc
-/compiler/cpp/thrifty.cc
-/compiler/cpp/lex.yythriftl.cc
-/compiler/cpp/thrifty.h
-/compiler/cpp/thrifty.hh
-/compiler/cpp/version.h
-/config.*
-/configure
-/configure.lineno
-/configure.scan
-/contrib/fb303/config.cache
-/contrib/fb303/config.log
-/contrib/fb303/config.status
-/contrib/fb303/configure
-/contrib/fb303/cpp/libfb303.a
-/contrib/fb303/java/build/
-/contrib/fb303/py/build/
-/contrib/fb303/py/fb303/FacebookService-remote
-/contrib/fb303/py/fb303/FacebookService.py
-/contrib/fb303/py/fb303/__init__.py
-/contrib/fb303/py/fb303/constants.py
-/contrib/fb303/py/fb303/ttypes.py
-/depcomp
-/install-sh
-/lib/cpp/Debug/
-/lib/cpp/Debug-mt/
-/lib/cpp/Release/
-/lib/cpp/Release-mt/
-/lib/cpp/src/thrift/qt/moc_TQTcpServer.cpp
-/lib/cpp/src/thrift/qt/moc__TQTcpServer.cpp
-/lib/cpp/src/thrift/config.h
-/lib/cpp/src/thrift/stamp-h2
-/lib/cpp/test/Benchmark
-/lib/cpp/test/AllProtocolsTest
-/lib/cpp/test/DebugProtoTest
-/lib/cpp/test/DenseProtoTest
-/lib/cpp/test/EnumTest
-/lib/cpp/test/JSONProtoTest
-/lib/cpp/test/OptionalRequiredTest
-/lib/cpp/test/SecurityTest
-/lib/cpp/test/SpecializationTest
-/lib/cpp/test/ReflectionTest
-/lib/cpp/test/RecursiveTest
-/lib/cpp/test/TFDTransportTest
-/lib/cpp/test/TFileTransportTest
-/lib/cpp/test/TInterruptTest
-/lib/cpp/test/TNonblockingServerTest
-/lib/cpp/test/TPipedTransportTest
-/lib/cpp/test/TServerIntegrationTest
-/lib/cpp/test/TSocketInterruptTest
-/lib/cpp/test/TransportTest
-/lib/cpp/test/UnitTests
-/lib/cpp/test/ZlibTest
-/lib/cpp/test/OpenSSLManualInitTest
-/lib/cpp/test/concurrency_test
-/lib/cpp/test/link_test
-/lib/cpp/test/processor_test
-/lib/cpp/test/tests.xml
-/lib/cpp/concurrency_test
-/lib/cpp/*.pc
-/lib/cpp/x64/Debug/
-/lib/cpp/x64/Debug-mt/
-/lib/cpp/x64/Release
-/lib/cpp/x64/Release-mt
-/lib/c_glib/*.gcda
-/lib/c_glib/*.gcno
-/lib/c_glib/*.loT
-/lib/c_glib/test/*.gcno
-/lib/c_glib/test/testwrapper.sh
-/lib/c_glib/test/testwrapper-test*
-/lib/c_glib/test/testapplicationexception
-/lib/c_glib/test/testbinaryprotocol
-/lib/c_glib/test/testbufferedtransport
-/lib/c_glib/test/testcontainertest
-/lib/c_glib/test/testdebugproto
-/lib/c_glib/test/testframedtransport
-/lib/c_glib/test/testmemorybuffer
-/lib/c_glib/test/testoptionalrequired
-/lib/c_glib/test/testsimpleserver
-/lib/c_glib/test/teststruct
-/lib/c_glib/test/testthrifttest
-/lib/c_glib/test/testthrifttestclient
-/lib/c_glib/test/testtransportsocket
-/lib/c_glib/thriftc.pc
-/lib/c_glib/thrift_c_glib.pc
-/lib/csharp/**/bin/
-/lib/csharp/**/obj/
-/lib/d/libthriftd.a
-/lib/d/test/serialization_benchmark
-/lib/d/test/transport_test
-/lib/d/unittest/
-/lib/delphi/src/*.dcu
-/lib/delphi/test/*.identcache
-/lib/delphi/test/*.local
-/lib/delphi/test/*.dcu
-/lib/delphi/test/*.2007
-/lib/delphi/test/*.dproj
-/lib/delphi/test/*.dproj
-/lib/delphi/test/codegen/*.bat
-/lib/delphi/test/skip/*.local
-/lib/delphi/test/skip/*.identcache
-/lib/delphi/test/skip/*.identcache
-/lib/delphi/test/skip/*.dproj
-/lib/delphi/test/skip/*.dproj
-/lib/delphi/test/skip/*.2007
-/lib/delphi/test/serializer/*.identcache
-/lib/delphi/test/serializer/*.dproj
-/lib/delphi/test/serializer/*.local
-/lib/delphi/test/serializer/*.2007
-/lib/delphi/test/serializer/*.dcu
-/lib/delphi/test/multiplexed/*.dproj
-/lib/delphi/test/multiplexed/*.2007
-/lib/delphi/test/multiplexed/*.local
-/lib/delphi/test/multiplexed/*.identcache
-/lib/delphi/test/multiplexed/*.dcu
-/lib/delphi/test/typeregistry/*.2007
-/lib/delphi/test/typeregistry/*.dproj
-/lib/delphi/test/typeregistry/*.identcache
-/lib/delphi/test/typeregistry/*.local
-/lib/delphi/test/typeregistry/*.dcu
-/lib/erl/.generated
-/lib/erl/.eunit
-/lib/erl/ebin
-/lib/erl/deps/
-/lib/haxe/test/bin
-/lib/hs/dist
-/lib/java/build
-/lib/js/test/build
-/lib/nodejs/coverage
-/lib/nodejs/node_modules/
-/lib/perl/MANIFEST
-/lib/perl/MYMETA.json
-/lib/perl/MYMETA.yml
-/lib/perl/Makefile-perl.mk
-/lib/perl/blib
-/lib/perl/pm_to_blib
-/lib/py/build
-/lib/py/thrift.egg-info/
-/lib/rb/Gemfile.lock
-/lib/rb/debug_proto_test
-/lib/rb/.config
-/lib/rb/ext/conftest.dSYM/
-/lib/rb/ext/mkmf.log
-/lib/rb/ext/thrift_native.bundle
-/lib/rb/ext/thrift_native.so
-/lib/rb/test/
-/lib/rb/thrift-*.gem
-/lib/php/src/ext/thrift_protocol/Makefile.*
-/lib/php/src/ext/thrift_protocol/build/
-/lib/php/src/ext/thrift_protocol/config.*
-/lib/php/src/ext/thrift_protocol/configure
-/lib/php/src/ext/thrift_protocol/configure.in
-/lib/php/src/ext/thrift_protocol/install-sh
-/lib/php/src/ext/thrift_protocol/libtool
-/lib/php/src/ext/thrift_protocol/ltmain.sh
-/lib/php/src/ext/thrift_protocol/missing
-/lib/php/src/ext/thrift_protocol/mkinstalldirs
-/lib/php/src/ext/thrift_protocol/modules/
-/lib/php/src/ext/thrift_protocol/php_thrift_protocol.lo
-/lib/php/src/ext/thrift_protocol/run-tests.php
-/lib/php/src/ext/thrift_protocol/thrift_protocol.la
-/lib/php/src/ext/thrift_protocol/tmp-php.ini
-/lib/php/src/packages/
-/lib/php/test/TEST-*.xml
-/lib/php/test/packages/
-/lib/py/dist/
-/lib/erl/logs/
-/lib/go/test/gopath/
-/lib/go/test/ThriftTest.thrift
-/libtool
-/ltmain.sh
-/missing
-/node_modules/
-/stamp-h1
-/test/results.json
-/test/c_glib/test_client
-/test/c_glib/test_server
-/test/cpp/StressTest
-/test/cpp/StressTestNonBlocking
-/test/cpp/TestClient
-/test/cpp/TestServer
-/test/log/
-/test/test.log
-/test/erl/.eunit/
-/test/erl/.generated
-/test/go/bin/
-/test/go/ThriftTest.thrift
-/test/go/gopath
-/test/go/pkg/
-/test/go/src/code.google.com/
-/test/go/src/github.com/golang/
-/test/go/src/gen/
-/test/go/src/thrift
-/test/haxe/bin
-/test/hs/TestClient
-/test/hs/TestServer
-/test/py.twisted/_trial_temp/
-/test/rb/Gemfile.lock
-/tutorial/cpp/TutorialClient
-/tutorial/cpp/TutorialServer
-/tutorial/c_glib/tutorial_client
-/tutorial/c_glib/tutorial_server
-/tutorial/delphi/*.dsk
-/tutorial/delphi/*.local
-/tutorial/delphi/*.tvsconfig
-/tutorial/delphi/DelphiClient/dcu
-/tutorial/delphi/DelphiServer/dcu
-/tutorial/delphi/DelphiClient/*.local
-/tutorial/delphi/DelphiClient/*.identcache
-/tutorial/delphi/DelphiServer/*.identcache
-/tutorial/delphi/DelphiServer/*.local
-/tutorial/go/go-tutorial
-/tutorial/go/calculator-remote
-/tutorial/go/src/shared
-/tutorial/go/src/tutorial
-/tutorial/go/src/git.apache.org
-/tutorial/haxe/bin
-/tutorial/hs/dist/
-/tutorial/java/build/
-/tutorial/js/build/
-/ylwrap
-/hawqbuild/Makefile.global
-
-/cmake_*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/.travis.yml
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/.travis.yml b/depends/thirdparty/thrift/.travis.yml
deleted file mode 100644
index 587d795..0000000
--- a/depends/thirdparty/thrift/.travis.yml
+++ /dev/null
@@ -1,188 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# build Apache Thrift on Travis CI - https://travis-ci.org/
-
-language: cpp
-
-sudo: required
-
-cache:
- - apt
- - npm
- - maven
-
-compiler:
-  - clang
-  - gcc
-
-before_install:
-  - sh build/travis/installCXXDependencies.sh
-  - if [ "$ALL_DEPS" != "no" ] ; then sh build/travis/installDependencies.sh 1> /dev/null ; fi
-  - if [ "$ALL_DEPS" != "no" ] ; then export PATH=/opt/ghc/$GHCVER/bin:/opt/cabal/1.20/bin:$PATH ; fi
-  - if [ "$ALL_DEPS" != "no" ] ; then cabal update ; fi
-  # Disabling any cabal concurrent jobs to workaround GHC crashes due to out of memory.
-  # We can safely remove this to speed up cabal install, once Travis infrastructure is upgraded.
-  - if [ "$ALL_DEPS" != "no" ] ; then sed -i 's/^\s*jobs\s*:\s*\$ncpus\s*$/jobs:1/g' $HOME/.cabal/config && cat $HOME/.cabal/config | grep jobs ; fi
-
-
-script:
-  - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then mkdir cmake_build && cd cmake_build && cmake -GNinja -DQT_MOC_EXECUTABLE="moq-qt5" $CMAKE_CONFIG $TRAVIS_BUILD_DIR ; fi
-  - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then ninja ; fi
-  - if [ "x$CMAKE_CONFIG" != "xnone" ] ; then cpack ; cd $TRAVIS_BUILD_DIR ; fi
-  - if [ "x$CONFIG" != "xnone" ] ; then sh bootstrap.sh ; fi
-  - if [ "x$CONFIG" != "xnone" ] ; then sh configure $CONFIG ; fi
-  - if [ "x$CONFIG" != "xnone" ] ; then make $MAKE_TARGET -j2 ; fi
-
-after_failure:
-  - if [ "x$ERROR_LOG" != "xnone" ] ; then cat $ERROR_LOG ; fi
-
-env:
-  global:
-    - TEST_NAME=""
-    - CMAKE_CONFIG="none"
-    - CONFIG="none"
-    - MAKE_TARGET="check"
-    - ALL_DEPS="no"
-    - GHCVER=7.8.3
-    - ERROR_LOG="none"
-
-  matrix:
-    # Put it here because it's most time consuming
-    - TEST_NAME="make cross (automake)"
-      THRIFT_CROSSTEST_CONCURRENCY=6
-      CONFIG="--enable-tutorial=no --without-erlang --without-lua --without-haxe --without-d"
-      ALL_DEPS="yes"
-      MAKE_TARGET="cross"
-      ERROR_LOG="test/log/unexpected_failures.log"
-
-    # CMake builds
-    - TEST_NAME="compiler (CMake + CPack)"
-      CMAKE_CONFIG="-DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
-    - TEST_NAME="all (CMake + CPack)"
-      CMAKE_CONFIG=""
-      ALL_DEPS="yes"
-    - TEST_NAME="C++/boost-threads (CMake + CPack)"
-      CMAKE_CONFIG="-DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_BOOSTTHREADS=ON"
-    - TEST_NAME="C++/std-threads (CMake + CPack)"
-      CMAKE_CONFIG="-DCMAKE_CXX_FLAGS=-std=c++0x -DWITH_C_GLIB=OFF -DWITH_JAVA=OFF -DWITH_STDTHREADS=ON"
-    - TEST_NAME="compiler (mingw32-gcc, CMake + CPack)"
-      CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
-
-    # Autotool builds
-    # TODO: Remove them as migration is made
-    - TEST_NAME="compiler (automake)"
-      CONFIG="--disable-libs"
-    - TEST_NAME="all (automake)"
-      CONFIG="--without-erlang --without-python --without-go --without-lua"
-      ALL_DEPS="yes"
-    - TEST_NAME="C & C++ & Haskell (automake)"
-      CONFIG="--without-csharp --without-java --without-erlang --without-nodejs --without-lua --without-python --without-perl --without-php --without-php-extension --without-ruby --without-go --without-d"
-      ALL_DEPS="yes"
-    - TEST_NAME="Small Set (automake)"
-      CONFIG="--without-erlang --without-haskell --without-python --without-go --without-lua --without-d --without-ruby --without-nodejs --without-java"
-      ALL_DEPS="yes"
-    - TEST_NAME="dist (automake)"
-      CONFIG=""
-      ALL_DEPS="yes"
-      MAKE_TARGET="dist"
-
-matrix:
-  allow_failures:
-    # gcc fails on travis seemingly due to out of memory
-    - compiler: gcc
-
-  exclude:
-    # This one takes very long
-    - compiler: gcc
-      env: TEST_NAME="make cross (automake)" CONFIG="--without-python" ALL_DEPS="yes" MAKE_TARGET="cross"
-
-    # Does not use native compiler, no need to do it twice
-    - compiler: gcc
-      env: TEST_NAME="compiler (mingw32-gcc, CMake + CPack)" CMAKE_CONFIG="-DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF"
-    - compiler: gcc
-      env: TEST_NAME="dist (automake)" CONFIG="" ALL_DEPS="yes" MAKE_TARGET="dist"
-
-  include:
-    - env:
-        - TEST_NAME="Debian Packages"
-      compiler: clang
-      before_install:
-       - sh build/travis/installCXXDependencies.sh;
-       - sh build/travis/installDependencies.sh 1> /dev/null;
-       - sudo apt-get install build-essential mono-gmcs mono-devel libmono-system-web2.0-cil erlang-base ruby1.8-dev python-all python-all-dev python-all-dbg php5 php5-dev
-      script:
-       - dpkg-buildpackage -tc -us -uc
-       - ls -al ..
-
-
-    # QA jobs for code analytics and metrics
-
-    # static code analysis with cppcheck (we can add --enable=all later)
-    - env:    TEST_NAME="cppcheck (compiler) error"
-      script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 compiler/cpp/src
-      before_install: sudo apt-get install cppcheck
-    - env:    TEST_NAME="cppcheck (cpp) error"
-      script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
-      before_install: sudo apt-get install cppcheck
-    - env:    TEST_NAME="cppcheck (c_glib) error"
-      script: cppcheck --force --quiet --inline-suppr --error-exitcode=1 -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
-      before_install: sudo apt-get install cppcheck
-    # add --error-exitcode=1 as soon as everything is fixed
-    - env:    TEST_NAME="cppcheck (compiler) all"
-      script: cppcheck --force --quiet --inline-suppr --enable=all -j2 compiler/cpp/src
-      before_install: sudo apt-get install cppcheck
-    - env:    TEST_NAME="cppcheck (cpp) all"
-      script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/cpp/src lib/cpp/test test/cpp tutorial/cpp
-      before_install: sudo apt-get install cppcheck
-    - env:    TEST_NAME="cppcheck (c_glib) all"
-      script: cppcheck --force --quiet --inline-suppr --enable=all -j2 lib/c_glib/src lib/c_glib/test test/c_glib/src tutorial/c_glib
-      before_install: sudo apt-get install cppcheck
-
-    # TODO use findbugs for Java
-    # TODO use fxcop for C#
-
-    # TODO do style checks
-
-    # search for TODO within source tree
-    - env:    TEST_NAME="TODO"
-      before_install:
-      script: grep -r TODO *
-    # search for FIXME within source tree
-    - env:    TEST_NAME="FIXME"
-      before_install:
-      script: grep -r FIXME *
-    # search for HACK within source tree
-    - env:    TEST_NAME="HACK"
-      before_install:
-      script: grep -r HACK *
-    # some statistics about the code base
-    - env:    TEST_NAME="sloccount"
-      before_install:
-      script: sloccount .
-      before_install: sudo apt-get install sloccount
-    # some info about the build machine
-    - env:    TEST_NAME="info"
-      before_install:
-      script:
-       - dpkg -l
-       - uname -a
-
-# TODO make it perfect ;-r
-#


[19/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.cpp b/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.cpp
deleted file mode 100644
index 7a61b21..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.cpp
+++ /dev/null
@@ -1,481 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <sys/time.h>
-
-#include "FacebookBase.h"
-#include "ServiceTracker.h"
-#include <thrift/concurrency/ThreadManager.h>
-
-using namespace std;
-using namespace facebook::fb303;
-using namespace apache::thrift::concurrency;
-
-
-uint64_t ServiceTracker::CHECKPOINT_MINIMUM_INTERVAL_SECONDS = 60;
-int ServiceTracker::LOG_LEVEL = 5;
-
-
-ServiceTracker::ServiceTracker(facebook::fb303::FacebookBase *handler,
-                               void (*logMethod)(int, const string &),
-                               bool featureCheckpoint,
-                               bool featureStatusCheck,
-                               bool featureThreadCheck,
-                               Stopwatch::Unit stopwatchUnit)
-  : handler_(handler), logMethod_(logMethod),
-    featureCheckpoint_(featureCheckpoint),
-    featureStatusCheck_(featureStatusCheck),
-    featureThreadCheck_(featureThreadCheck),
-    stopwatchUnit_(stopwatchUnit),
-    checkpointServices_(0)
-{
-  if (featureCheckpoint_) {
-    time_t now = time(NULL);
-    checkpointTime_ = now;
-  } else {
-    checkpointTime_ = 0;
-  }
-}
-
-/**
- * Registers the beginning of a "service method": basically, any of
- * the implementations of Thrift remote procedure calls that a
- * FacebookBase handler is handling.  Controls concurrent
- * services and reports statistics (via log and via fb303 counters).
- * Throws an exception if the server is not ready to handle service
- * methods yet.
- *
- * note: The relationship between startService() and finishService()
- * is currently defined so that a call to finishService() should only
- * be matched to this call to startService() if this method returns
- * without exception.  It wouldn't be a problem to implement things
- * the other way, so that *every* start needed a finish, but this
- * convention was chosen to match the way an object's constructor and
- * destructor work together, i.e. to work well with ServiceMethod
- * objects.
- *
- * @param const ServiceMethod &serviceMethod A reference to the ServiceMethod
- *                                           object instantiated at the start
- *                                           of the service method.
- */
-void
-ServiceTracker::startService(const ServiceMethod &serviceMethod)
-{
-  // note: serviceMethod.timer_ automatically starts at construction.
-
-  // log service start
-  logMethod_(5, serviceMethod.signature_);
-
-  // check handler ready
-  if (featureStatusCheck_ && !serviceMethod.featureLogOnly_) {
-    // note: Throwing exceptions before counting statistics.  See note
-    // in method header.
-    // note: A STOPPING server is not accepting new connections, but it
-    // is still handling any already-connected threads -- so from the
-    // service method's point of view, a status of STOPPING is a green
-    // light.
-    facebook::fb303::fb_status status = handler_->getStatus();
-    if (status != facebook::fb303::ALIVE
-        && status != facebook::fb303::STOPPING) {
-      if (status == facebook::fb303::STARTING) {
-        throw ServiceException("Server starting up; please try again later");
-      } else {
-        throw ServiceException("Server not alive; please try again later");
-      }
-    }
-  }
-
-  // check server threads
-  if (featureThreadCheck_ && !serviceMethod.featureLogOnly_) {
-    // note: Might want to put these messages in reportCheckpoint() if
-    // log is getting spammed.
-    if (threadManager_ != NULL) {
-      size_t idle_count = threadManager_->idleWorkerCount();
-      if (idle_count == 0) {
-        stringstream message;
-        message << "service " << serviceMethod.signature_
-                << ": all threads (" << threadManager_->workerCount()
-                << ") in use";
-        logMethod_(3, message.str());
-      }
-    }
-  }
-}
-
-/**
- * Logs a significant step in the middle of a "service method"; see
- * startService.
- *
- * @param const ServiceMethod &serviceMethod A reference to the ServiceMethod
- *                                           object instantiated at the start
- *                                           of the service method.
- * @return int64_t Elapsed units (see stopwatchUnit_) since ServiceMethod
- *                 instantiation.
- */
-int64_t
-ServiceTracker::stepService(const ServiceMethod &serviceMethod,
-                            const string &stepName)
-{
-  stringstream message;
-  string elapsed_label;
-  int64_t elapsed = serviceMethod.timer_.elapsedUnits(stopwatchUnit_,
-                                                      &elapsed_label);
-  message << serviceMethod.signature_
-          << ' ' << stepName
-          << " [" << elapsed_label << ']';
-  logMethod_(5, message.str());
-  return elapsed;
-}
-
-/**
- * Registers the end of a "service method"; see startService().
- *
- * @param const ServiceMethod &serviceMethod A reference to the ServiceMethod
- *                                           object instantiated at the start
- *                                           of the service method.
- */
-void
-ServiceTracker::finishService(const ServiceMethod &serviceMethod)
-{
-  // log end of service
-  stringstream message;
-  string duration_label;
-  int64_t duration = serviceMethod.timer_.elapsedUnits(stopwatchUnit_,
-                                                       &duration_label);
-  message << serviceMethod.signature_
-          << " finish [" << duration_label << ']';
-  logMethod_(5, message.str());
-
-  // count, record, and maybe report service statistics
-  if (!serviceMethod.featureLogOnly_) {
-
-    if (!featureCheckpoint_) {
-
-      // lifetime counters
-      // (note: No need to lock statisticsMutex_ if not doing checkpoint;
-      // FacebookService::incrementCounter() is already thread-safe.)
-      handler_->incrementCounter("lifetime_services");
-
-    } else {
-
-      statisticsMutex_.lock();
-      // note: No exceptions expected from this code block.  Wrap in a try
-      // just to be safe.
-      try {
-
-        // lifetime counters
-        // note: Good to synchronize this with the increment of
-        // checkpoint services, even though incrementCounter() is
-        // already thread-safe, for the sake of checkpoint reporting
-        // consistency (i.e.  since the last checkpoint,
-        // lifetime_services has incremented by checkpointServices_).
-        handler_->incrementCounter("lifetime_services");
-
-        // checkpoint counters
-        checkpointServices_++;
-        checkpointDuration_ += duration;
-
-        // per-service timing
-        // note kjv: According to my tests it is very slightly faster to
-        // call insert() once (and detect not-found) than calling find()
-        // and then maybe insert (if not-found).  However, the difference
-        // is tiny for small maps like this one, and the code for the
-        // faster solution is slightly less readable.  Also, I wonder if
-        // the instantiation of the (often unused) pair to insert makes
-        // the first algorithm slower after all.
-        map<string, pair<uint64_t, uint64_t> >::iterator iter;
-        iter = checkpointServiceDuration_.find(serviceMethod.name_);
-        if (iter != checkpointServiceDuration_.end()) {
-          iter->second.first++;
-          iter->second.second += duration;
-        } else {
-          checkpointServiceDuration_.insert(make_pair(serviceMethod.name_,
-                                                      make_pair(1, duration)));
-        }
-
-        // maybe report checkpoint
-        // note: ...if it's been long enough since the last report.
-        time_t now = time(NULL);
-        uint64_t check_interval = now - checkpointTime_;
-        if (check_interval >= CHECKPOINT_MINIMUM_INTERVAL_SECONDS) {
-          reportCheckpoint();
-        }
-
-      } catch (...) {
-        statisticsMutex_.unlock();
-        throw;
-      }
-      statisticsMutex_.unlock();
-
-    }
-  }
-}
-
-/**
- * Logs some statistics gathered since the last call to this method.
- *
- * note: Thread race conditions on this method could cause
- * misreporting and/or undefined behavior; the caller must protect
- * uses of the object variables (and calls to this method) with a
- * mutex.
- *
- */
-void
-ServiceTracker::reportCheckpoint()
-{
-  time_t now = time(NULL);
-
-  uint64_t check_count = checkpointServices_;
-  uint64_t check_interval = now - checkpointTime_;
-  uint64_t check_duration = checkpointDuration_;
-
-  // export counters for timing of service methods (by service name)
-  handler_->setCounter("checkpoint_time", check_interval);
-  map<string, pair<uint64_t, uint64_t> >::iterator iter;
-  uint64_t count;
-  for (iter = checkpointServiceDuration_.begin();
-       iter != checkpointServiceDuration_.end();
-       ++iter) {
-    count = iter->second.first;
-    handler_->setCounter(string("checkpoint_count_") + iter->first, count);
-    if (count == 0) {
-      handler_->setCounter(string("checkpoint_speed_") + iter->first,
-                           0);
-    } else {
-      handler_->setCounter(string("checkpoint_speed_") + iter->first,
-                           iter->second.second / count);
-    }
-  }
-
-  // reset checkpoint variables
-  // note: Clearing the map while other threads are using it might
-  // cause undefined behavior.
-  checkpointServiceDuration_.clear();
-  checkpointTime_ = now;
-  checkpointServices_ = 0;
-  checkpointDuration_ = 0;
-
-  // get lifetime variables
-  uint64_t life_count = handler_->getCounter("lifetime_services");
-  uint64_t life_interval = now - handler_->aliveSince();
-
-  // log checkpoint
-  stringstream message;
-  message << "checkpoint_time:" << check_interval
-          << " checkpoint_services:" << check_count
-          << " checkpoint_speed_sum:" << check_duration
-          << " lifetime_time:" << life_interval
-          << " lifetime_services:" << life_count;
-  if (featureThreadCheck_ && threadManager_ != NULL) {
-    size_t worker_count = threadManager_->workerCount();
-    size_t idle_count = threadManager_->idleWorkerCount();
-    message << " total_workers:" << worker_count
-            << " active_workers:" << (worker_count - idle_count);
-  }
-  logMethod_(4, message.str());
-}
-
-/**
- * Remembers the thread manager used in the server, for monitoring thread
- * activity.
- *
- * @param shared_ptr<ThreadManager> threadManager The server's thread manager.
- */
-void
-ServiceTracker::setThreadManager(boost::shared_ptr<ThreadManager>
-                                 threadManager)
-{
-  threadManager_ = threadManager;
-}
-
-/**
- * Logs messages to stdout; the passed message will be logged if the
- * passed level is less than or equal to LOG_LEVEL.
- *
- * This is the default logging method used by the ServiceTracker.  An
- * alternate logging method (that accepts the same parameters) may be
- * specified to the constructor.
- *
- * @param int level A level associated with the message: higher levels
- *                  are used to indicate higher levels of detail.
- * @param string message The message to log.
- */
-void
-ServiceTracker::defaultLogMethod(int level, const string &message)
-{
-  if (level <= LOG_LEVEL) {
-    string level_string;
-    time_t now = time(NULL);
-    char now_pretty[26];
-    ctime_r(&now, now_pretty);
-    now_pretty[24] = '\0';
-    switch (level) {
-    case 1:
-      level_string = "CRITICAL";
-      break;
-    case 2:
-      level_string = "ERROR";
-      break;
-    case 3:
-      level_string = "WARNING";
-      break;
-    case 5:
-      level_string = "DEBUG";
-      break;
-    case 4:
-    default:
-      level_string = "INFO";
-      break;
-    }
-    cout << '[' << level_string << "] [" << now_pretty << "] "
-         << message << endl;
-  }
-}
-
-
-/**
- * Creates a Stopwatch, which can report the time elapsed since its
- * creation.
- *
- */
-Stopwatch::Stopwatch()
-{
-  gettimeofday(&startTime_, NULL);
-}
-
-void
-Stopwatch::reset()
-{
-  gettimeofday(&startTime_, NULL);
-}
-
-uint64_t
-Stopwatch::elapsedUnits(Stopwatch::Unit unit, string *label) const
-{
-  timeval now_time;
-  gettimeofday(&now_time, NULL);
-  time_t duration_secs = now_time.tv_sec - startTime_.tv_sec;
-
-  uint64_t duration_units;
-  switch (unit) {
-  case UNIT_SECONDS:
-    duration_units = duration_secs
-      + (now_time.tv_usec - startTime_.tv_usec + 500000) / 1000000;
-    if (NULL != label) {
-      stringstream ss_label;
-      ss_label << duration_units << " secs";
-      label->assign(ss_label.str());
-    }
-    break;
-  case UNIT_MICROSECONDS:
-    duration_units = duration_secs * 1000000
-      + now_time.tv_usec - startTime_.tv_usec;
-    if (NULL != label) {
-      stringstream ss_label;
-      ss_label << duration_units << " us";
-      label->assign(ss_label.str());
-    }
-    break;
-  case UNIT_MILLISECONDS:
-  default:
-    duration_units = duration_secs * 1000
-      + (now_time.tv_usec - startTime_.tv_usec + 500) / 1000;
-    if (NULL != label) {
-      stringstream ss_label;
-      ss_label << duration_units << " ms";
-      label->assign(ss_label.str());
-    }
-    break;
-  }
-  return duration_units;
-}
-
-/**
- * Creates a ServiceMethod, used for tracking a single service method
- * invocation (via the ServiceTracker).  The passed name of the
- * ServiceMethod is used to group statistics (e.g. counts and durations)
- * for similar invocations; the passed signature is used to uniquely
- * identify the particular invocation in the log.
- *
- * note: A version of this constructor is provided that automatically
- * forms a signature the name and a passed numeric id.  Silly, sure,
- * but commonly used, since it often saves the caller a line or two of
- * code.
- *
- * @param ServiceTracker *tracker The service tracker that will track this
- *                                ServiceMethod.
- * @param const string &name The service method name (usually independent
- *                           of service method parameters).
- * @param const string &signature A signature uniquely identifying the method
- *                                invocation (usually name plus parameters).
- */
-ServiceMethod::ServiceMethod(ServiceTracker *tracker,
-                             const string &name,
-                             const string &signature,
-                             bool featureLogOnly)
-  : tracker_(tracker), name_(name), signature_(signature),
-    featureLogOnly_(featureLogOnly)
-{
-  // note: timer_ automatically starts at construction.
-
-  // invoke tracker to start service
-  // note: Might throw.  If it throws, then this object's destructor
-  // won't be called, which is according to plan: finishService() is
-  // only supposed to be matched to startService() if startService()
-  // returns without error.
-  tracker_->startService(*this);
-}
-
-ServiceMethod::ServiceMethod(ServiceTracker *tracker,
-                             const string &name,
-                             uint64_t id,
-                             bool featureLogOnly)
-  : tracker_(tracker), name_(name), featureLogOnly_(featureLogOnly)
-{
-  // note: timer_ automatically starts at construction.
-  stringstream ss_signature;
-  ss_signature << name << " (" << id << ')';
-  signature_ = ss_signature.str();
-
-  // invoke tracker to start service
-  // note: Might throw.  If it throws, then this object's destructor
-  // won't be called, which is according to plan: finishService() is
-  // only supposed to be matched to startService() if startService()
-  // returns without error.
-  tracker_->startService(*this);
-}
-
-ServiceMethod::~ServiceMethod()
-{
-  // invoke tracker to finish service
-  // note: Not expecting an exception from this code, but
-  // finishService() might conceivably throw an out-of-memory
-  // exception.
-  try {
-    tracker_->finishService(*this);
-  } catch (...) {
-    // don't throw
-  }
-}
-
-uint64_t
-ServiceMethod::step(const std::string &stepName)
-{
-  return tracker_->stepService(*this, stepName);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.h b/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.h
deleted file mode 100644
index 9a3edd8..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/cpp/ServiceTracker.h
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * ServiceTracker is a utility class for logging and timing service
- * calls to a fb303 Thrift server.  Currently, ServiceTracker offers
- * the following features:
- *
- *   . Logging of service method start, end (and duration), and
- *     optional steps in between.
- *
- *   . Automatic check of server status via fb303::getStatus()
- *     with a ServiceException thrown if server not alive
- *     (at method start).
- *
- *   . A periodic logged checkpoint reporting lifetime time, lifetime
- *     service count, and per-method statistics since the last checkpoint
- *     time (at method finish).
- *
- *   . Export of fb303 counters for lifetime and checkpoint statistics
- *     (at method finish).
- *
- *   . For TThreadPoolServers, a logged warning when all server threads
- *     are busy (at method start).  (Must call setThreadManager() after
- *     ServiceTracker instantiation for this feature to be enabled.)
- *
- * Individual features may be enabled or disabled by arguments to the
- * constructor.  The constructor also accepts a pointer to a logging
- * method -- if no pointer is passed, the tracker will log to stdout.
- *
- * ServiceTracker defines private methods for service start, finish,
- * and step, which are designed to be accessed by instantiating a
- * friend ServiceMethod object, as in the following example:
- *
- *    #include <ServiceTracker.h>
- *    class MyServiceHandler : virtual public MyServiceIf,
- *                             public facebook::fb303::FacebookBase
- *    {
- *    public:
- *      MyServiceHandler::MyServiceHandler() : mServiceTracker(this) {}
- *      void MyServiceHandler::myServiceMethod(int userId) {
- *        // note: Instantiating a ServiceMethod object starts a timer
- *        // and tells the ServiceTracker to log the start.  Might throw
- *        // a ServiceException.
- *        ServiceMethod serviceMethod(&mServiceTracker,
- *                                   "myServiceMethod",
- *                                   userId);
- *        ...
- *        // note: Calling the step method tells the ServiceTracker to
- *        // log the step, with a time elapsed since start.
- *        serviceMethod.step("post parsing, begin processing");
- *        ...
- *        // note: When the ServiceMethod object goes out of scope, the
- *        // ServiceTracker will log the total elapsed time of the method.
- *      }
- *      ...
- *    private:
- *      ServiceTracker mServiceTracker;
- *    }
- *
- * The step() method call is optional; the startService() and
- * finishService() methods are handled by the object's constructor and
- * destructor.
- *
- * The ServiceTracker is (intended to be) thread-safe.
- *
- * Future:
- *
- *   . Come up with something better for logging than passing a
- *     function pointer to the constructor.
- *
- *   . Add methods for tracking errors from service methods, e.g.
- *     ServiceTracker::reportService().
- */
-
-#ifndef SERVICETRACKER_H
-#define SERVICETRACKER_H
-
-
-#include <iostream>
-#include <string>
-#include <sstream>
-#include <exception>
-#include <map>
-#include <boost/shared_ptr.hpp>
-
-#include <thrift/concurrency/Mutex.h>
-
-
-namespace apache { namespace thrift { namespace concurrency {
-  class ThreadManager;
-}}}
-
-
-namespace facebook { namespace fb303 {
-
-
-class FacebookBase;
-class ServiceMethod;
-
-
-class Stopwatch
-{
-public:
-  enum Unit { UNIT_SECONDS, UNIT_MILLISECONDS, UNIT_MICROSECONDS };
-  Stopwatch();
-  uint64_t elapsedUnits(Unit unit, std::string *label = NULL) const;
-  void reset();
-private:
-  timeval startTime_;
-};
-
-
-class ServiceTracker
-{
-  friend class ServiceMethod;
-
-public:
-
-  static uint64_t CHECKPOINT_MINIMUM_INTERVAL_SECONDS;
-  static int LOG_LEVEL;
-
-  ServiceTracker(facebook::fb303::FacebookBase *handler,
-                 void (*logMethod)(int, const std::string &)
-                 = &ServiceTracker::defaultLogMethod,
-                 bool featureCheckpoint = true,
-                 bool featureStatusCheck = true,
-                 bool featureThreadCheck = true,
-                 Stopwatch::Unit stopwatchUnit
-                 = Stopwatch::UNIT_MILLISECONDS);
-
-  void setThreadManager(boost::shared_ptr<apache::thrift::concurrency::ThreadManager> threadManager);
-
-private:
-
-  facebook::fb303::FacebookBase *handler_;
-  void (*logMethod_)(int, const std::string &);
-  boost::shared_ptr<apache::thrift::concurrency::ThreadManager> threadManager_;
-
-  bool featureCheckpoint_;
-  bool featureStatusCheck_;
-  bool featureThreadCheck_;
-  Stopwatch::Unit stopwatchUnit_;
-
-  apache::thrift::concurrency::Mutex statisticsMutex_;
-  time_t checkpointTime_;
-  uint64_t checkpointServices_;
-  uint64_t checkpointDuration_;
-  std::map<std::string, std::pair<uint64_t, uint64_t> > checkpointServiceDuration_;
-
-  void startService(const ServiceMethod &serviceMethod);
-  int64_t stepService(const ServiceMethod &serviceMethod,
-                      const std::string &stepName);
-  void finishService(const ServiceMethod &serviceMethod);
-  void reportCheckpoint();
-  static void defaultLogMethod(int level, const std::string &message);
-};
-
-
-class ServiceMethod
-{
-  friend class ServiceTracker;
-public:
-  ServiceMethod(ServiceTracker *tracker,
-                const std::string &name,
-                const std::string &signature,
-                bool featureLogOnly = false);
-  ServiceMethod(ServiceTracker *tracker,
-                const std::string &name,
-                uint64_t id,
-                bool featureLogOnly = false);
-  ~ServiceMethod();
-  uint64_t step(const std::string &stepName);
-private:
-  ServiceTracker *tracker_;
-  std::string name_;
-  std::string signature_;
-  bool featureLogOnly_;
-  Stopwatch timer_;
-};
-
-
-class ServiceException : public std::exception
-{
-public:
-  explicit ServiceException(const std::string &message, int code = 0)
-    : message_(message), code_(code) {}
-  ~ServiceException() throw() {}
-  virtual const char *what() const throw() { return message_.c_str(); }
-  int code() const throw() { return code_; }
-private:
-  std::string message_;
-  int code_;
-};
-
-
-}} // facebook::fb303
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/global_footer.mk
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/global_footer.mk b/depends/thirdparty/thrift/contrib/fb303/global_footer.mk
deleted file mode 100644
index 96f82eb..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/global_footer.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-thriftstyle : $(XBUILT_SOURCES)
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/global_header.mk
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/global_header.mk b/depends/thirdparty/thrift/contrib/fb303/global_header.mk
deleted file mode 100644
index 77c9455..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/global_header.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#define thrift_template
-#  $(1) : $(2)
-#	$$(THRIFT) $(3) $(4) $(5) $(6) $(7) $(8) $$<
-#endef
-
-define thrift_template
-XTARGET := $(shell perl -e '@val = split("\/","$(2)"); $$last = pop(@val);split("\\.",$$last);print "$(1)/"."gen-cpp/"."@_[0]"."_types.cpp\n"' )
-
-ifneq ($$(XBUILT_SOURCES),) 
-    XBUILT_SOURCES := $$(XBUILT_SOURCES) $$(XTARGET)
-else
-    XBUILT_SOURCES := $$(XTARGET)
-endif
-$$(XTARGET) : $(2)
-	$$(THRIFT) -o $1 $3 $$<
-endef
-
-clean-common:
-	rm -rf gen-*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/if/fb303.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/if/fb303.thrift b/depends/thirdparty/thrift/contrib/fb303/if/fb303.thrift
deleted file mode 100644
index 66c8315..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/if/fb303.thrift
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * fb303.thrift
- */
-
-namespace java com.facebook.fb303
-namespace cpp facebook.fb303
-namespace perl Facebook.FB303
-
-/**
- * Common status reporting mechanism across all services
- */
-enum fb_status {
-  DEAD = 0,
-  STARTING = 1,
-  ALIVE = 2,
-  STOPPING = 3,
-  STOPPED = 4,
-  WARNING = 5,
-}
-
-/**
- * Standard base service
- */
-service FacebookService {
-
-  /**
-   * Returns a descriptive name of the service
-   */
-  string getName(),
-
-  /**
-   * Returns the version of the service
-   */
-  string getVersion(),
-
-  /**
-   * Gets the status of this service
-   */
-  fb_status getStatus(),
-
-  /**
-   * User friendly description of status, such as why the service is in
-   * the dead or warning state, or what is being started or stopped.
-   */
-  string getStatusDetails(),
-
-  /**
-   * Gets the counters for this service
-   */
-  map<string, i64> getCounters(),
-
-  /**
-   * Gets the value of a single counter
-   */
-  i64 getCounter(1: string key),
-
-  /**
-   * Sets an option
-   */
-  void setOption(1: string key, 2: string value),
-
-  /**
-   * Gets an option
-   */
-  string getOption(1: string key),
-
-  /**
-   * Gets all options
-   */
-  map<string, string> getOptions(),
-
-  /**
-   * Returns a CPU profile over the given time interval (client and server
-   * must agree on the profile format).
-   */
-  string getCpuProfile(1: i32 profileDurationInSec),
-
-  /**
-   * Returns the unix time that the server has been running since
-   */
-  i64 aliveSince(),
-
-  /**
-   * Tell the server to reload its configuration, reopen log files, etc
-   */
-  oneway void reinitialize(),
-
-  /**
-   * Suggest a shutdown to the server
-   */
-  oneway void shutdown(),
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/java/build.xml
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/java/build.xml b/depends/thirdparty/thrift/contrib/fb303/java/build.xml
deleted file mode 100755
index 8f2fa51..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/java/build.xml
+++ /dev/null
@@ -1,195 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- -->
-<project name="libfb303" default="dist" basedir="."
-  xmlns:artifact="antlib:org.apache.maven.artifact.ant">
-
-  <!-- project wide settings. All directories relative to basedir -->
-  <property name="thrift.root" location="${basedir}/../../../"/>
-  <property name="fb303.artifactid" value="libfb303"/>
-  <property name="interface.dir" value="${basedir}/../if"/>
-  <property name="thrift.java.dir" location="${thrift.root}/lib/java"/>
-  <property name="build.tools.dir" location="${thrift.java.dir}/build/tools/"/>
-  <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/> 
-
-  <!-- inherit from the java build file for version and other properties -->
-  <property file="${thrift.java.dir}/build.properties" />
-
-  <property environment="env"/>
-
-  <condition property="version" value="${thrift.version}">
-    <isset property="release"/>
-  </condition>
-  <property name="version" value="${thrift.version}-snapshot"/>
-
-  <property name="fb303.final.name" value="${fb303.artifactid}-${version}"/>
-  <property name="thrift.java.libthrift" value="${thrift.java.dir}/build/libthrift-${version}.jar"/>
-
-  <property name="src" value="${basedir}/src"/>
-  <property name="gen" value="${basedir}/gen-java"/>
-  <property name="build.dir" value="${basedir}/build"/>
-  <property name="build.lib.dir" value="${build.dir}/lib"/>
-  <property name="build.classes.dir" value="${build.dir}/classes"/>
-
-  <property name="fb303.jar.file" location="${build.dir}/${fb303.final.name}.jar"/>
-  <property name="fb303.pom.xml" location="${build.dir}/${fb303.final.name}.pom"/>
-
-  <target name="init" depends="setup.init,mvn.init" unless="init.finished">
-    <property name="init.finished" value="true"/>
-  </target>
-
-  <target name="setup.init">
-    <tstamp/>
-    <mkdir dir="${build.dir}"/>
-    <mkdir dir="${build.classes.dir}"/>
-    <mkdir dir="${build.lib.dir}"/>
-  </target>
-
-  <!-- generate fb303 thrift code -->
-  <target name="generate">
-    <echo message="generating thrift fb303 files"/>
-    <exec executable="${thrift_compiler}" failonerror="true">
-      <arg line="--gen java -o ${basedir} ${interface.dir}/fb303.thrift"/>
-    </exec>
-  </target>
-
-  <!-- compile the base and thrift generated code and jar them -->
-  <target name="dist" depends="init,generate">
-    <echo message="Building ${fb303.final.name}.jar"/>
-    <javac destdir="${build.classes.dir}" debug="on">
-      <classpath>
-        <pathelement location="${thrift.java.libthrift}"/>
-        <fileset dir="${thrift.root}/lib/java/build/lib">
-          <include name="*.jar"/>
-        </fileset>
-      </classpath>
-      <src path="${src}"/>
-      <src path="${gen}"/>
-      <include name="**/*.java"/>
-    </javac>
-    <jar jarfile="${build.dir}/${fb303.final.name}.jar" basedir="${build.classes.dir}">
-    </jar>
-  </target>
-
-  <!-- copy the build jar to the distribution library directory -->
-  <target name="install" depends="dist">
-    <copy todir="${install.path}">
-      <fileset dir="${build.lib.dir}" includes="*.jar"/>
-      <fileset dir="${build.lib.dir}" includes="${fb303.final.name}.jar"/>
-    </copy>
-  </target>
-
-  <target name="clean">
-    <delete dir="${build.dir}"/>
-    <delete dir="${gen}"/>
-  </target>
-
-  <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check" unless="mvn.ant.tasks.found">
-    <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
-  </target>
-
-  <target name="mvn.ant.tasks.check">
-    <condition property="mvn.ant.tasks.found">
-      <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
-    </condition>
-  </target>
-
-  <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
-    <echo message="${mvn.ant.task.jar}"/>
-    <!-- Download mvn ant tasks, download dependencies, and setup pom file -->
-    <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
-
-    <!-- remote repositories used to download dependencies from -->
-    <artifact:remoteRepository id="central" url="${mvn.repo}"/>
-    <artifact:remoteRepository id="apache" url="${apache.repo}"/>
-
-    <!-- Pom file information -->
-    <artifact:pom id="pom" 
-      groupId="${thrift.groupid}" 
-      artifactId="${fb303.artifactid}"
-      version="${version}" 
-      url="http://thrift.apache.org"
-      name="Apache Thrift"
-      description="Thrift is a software framework for scalable cross-language services development."
-      packaging="pom"
-    >
-      <remoteRepository refid="central"/>
-      <remoteRepository refid="apache"/>
-      <license name="The Apache Software License, Version 2.0" url="${license}"/>
-      <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" 
-      developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
-      url="https://git-wip-us.apache.org/repos/asf?p=thrift.git"
-    />
-      <!-- Thrift Developers -->
-      <developer id="mcslee" name="Mark Slee"/>
-      <developer id="dreiss" name="David Reiss"/>
-      <developer id="aditya" name="Aditya Agarwal"/>
-      <developer id="marck" name="Marc Kwiatkowski"/>
-      <developer id="jwang" name="James Wang"/>
-      <developer id="cpiro" name="Chris Piro"/>
-      <developer id="bmaurer" name="Ben Maurer"/>
-      <developer id="kclark" name="Kevin Clark"/>
-      <developer id="jake" name="Jake Luciani"/>
-      <developer id="bryanduxbury" name="Bryan Duxbury"/>
-      <developer id="esteve" name="Esteve Fernandez"/>
-      <developer id="todd" name="Todd Lipcon"/>
-      <developer id="geechorama" name="Andrew McGeachie"/>
-      <developer id="molinaro" name="Anthony Molinaro"/>
-      <developer id="roger" name="Roger Meier"/>
-      <developer id="jfarrell" name="Jake Farrell"/>
-      <developer id="jensg" name="Jens Geyer"/>
-      <developer id="carl" name="Carl Yeksigian"/>
-
-      <!-- Thrift dependencies list -->
-      <dependency groupId="org.apache.thrift" artifactId="libthrift" version="${version}"/>
-    </artifact:pom>
-
-    <!-- Generate the pom file -->
-    <artifact:writepom pomRefId="pom" file="${fb303.pom.xml}"/>
-
-    <property name="mvn.finished" value="true"/>
-  </target>
-
-  <macrodef name="signAndDeploy">
-    <!-- Sign and deploy jars to apache repo -->
-    <attribute name="file"/>
-    <attribute name="classifier" default=""/>
-    <attribute name="packaging" default="jar"/>
-    <attribute name="pom" default=""/>
-    <sequential>
-      <artifact:mvn fork="true">
-        <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/>
-        <arg value="-DrepositoryId=${maven-repository-id}"/>
-        <arg value="-Durl=${maven-repository-url}"/>
-        <arg value="-DpomFile=@{pom}"/>
-        <arg value="-Dfile=@{file}"/>
-        <arg value="-Dclassifier=@{classifier}"/>
-        <arg value="-Dpackaging=@{packaging}"/>
-        <arg value="-Pgpg"/>
-      </artifact:mvn>
-    </sequential>
-  </macrodef>
-
-  <target name="publish" depends="clean,dist">
-    <!-- Compile, packages and then send release to apache maven repo -->
-    <!-- run with: ant -Drelease=true publish-->
-    <signAndDeploy file="${fb303.pom.xml}" packaging="pom" classifier="" pom="${fb303.pom.xml}"/>
-    <signAndDeploy file="${fb303.jar.file}" packaging="jar" classifier="" pom="${fb303.pom.xml}"/>
-  </target>
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/java/src/FacebookBase.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/java/src/FacebookBase.java b/depends/thirdparty/thrift/contrib/fb303/java/src/FacebookBase.java
deleted file mode 100644
index f8f26a3..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/java/src/FacebookBase.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package com.facebook.fb303;
-
-import java.util.AbstractMap;
-import java.util.HashMap;
-import java.util.concurrent.ConcurrentHashMap;
-
-public abstract class FacebookBase implements FacebookService.Iface {
-
-  private String name_;
-
-  private long alive_;
-
-  private final ConcurrentHashMap<String,Long> counters_ =
-    new ConcurrentHashMap<String, Long>();
-
-  private final ConcurrentHashMap<String,String> options_ =
-    new ConcurrentHashMap<String, String>();
-
-  protected FacebookBase(String name) {
-    name_ = name;
-    alive_ = System.currentTimeMillis() / 1000;
-  }
-
-  public String getName() {
-    return name_;
-  }
-
-  public abstract fb_status getStatus();
-
-  public String getStatusDetails() {
-    return "";
-  }
-
-  public void deleteCounter(String key) {
-    counters_.remove(key);
-  }
-
-  public void resetCounter(String key) {
-    counters_.put(key, 0L);
-  }
-
-  public long incrementCounter(String key) {
-    long val = getCounter(key) + 1;
-    counters_.put(key, val);
-    return val;
-  }
-
-  public long incrementCounter(String key, long increment) {
-    long val = getCounter(key) + increment;
-    counters_.put(key, val);
-    return val;
-  }
-
-  public long setCounter(String key, long value) {
-    counters_.put(key, value);
-    return value;
-  }
-
-  public AbstractMap<String,Long> getCounters() {
-    return counters_;
-  }
-
-  public long getCounter(String key) {
-    Long val = counters_.get(key);
-    if (val == null) {
-      return 0;
-    }
-    return val.longValue();
-  }
-
-  public void setOption(String key, String value) {
-    options_.put(key, value);
-  }
-
-  public String getOption(String key) {
-    return options_.get(key);
-  }
-
-  public AbstractMap<String,String> getOptions() {
-    return options_;
-  }
-
-  public long aliveSince() {
-    return alive_;
-  }
-
-  public String getCpuProfile() {
-    return "";
-  }
-
-  public void reinitialize() {}
-
-  public void shutdown() {}
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/php/FacebookBase.php
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/php/FacebookBase.php b/depends/thirdparty/thrift/contrib/fb303/php/FacebookBase.php
deleted file mode 100644
index 2ac318f..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/php/FacebookBase.php
+++ /dev/null
@@ -1,89 +0,0 @@
-<?php
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Abstract Class providing null implementation for FacebookService
- * methods.
- */
-class FacebookBase implements FacebookServiceIf {
-  protected $name_ = '';
-
-  public function __construct($name) {
-    $this->name_ = $name;
-  }
-
-  public function getName() {
-    return $this->name_;
-  }
-
-  public function getVersion() { 
-    return ''; 
-  }
-
-  public function getStatus() { 
-    return null; 
-  } 
-  
-  public function getStatusDetails() { 
-    return '';
-  }
- 
-  public function getCounters() { 
-    return array();
-  } 
-
-  public function getCounter($key) { 
-    return null;
-  } 
-
-  public function setOption($key, $value) { 
-    return;
-  } 
-
-  public function getOption($key) { 
-    return ''; 
-  } 
-
-  public function getOptions() { 
-    return array();
-  } 
-
-  public function aliveSince() { 
-    return 0;
-  } 
-
-  public function getCpuProfile($duration) { 
-    return ''; 
-  }
-
-  public function getLimitedReflection() { 
-    return array();
-  } 
-
-  public function reinitialize() { 
-    return;
-  }
-
-  public function shutdown() { 
-    return;
-  }
-
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/py/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/py/Makefile.am b/depends/thirdparty/thrift/contrib/fb303/py/Makefile.am
deleted file mode 100644
index 060495e..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/py/Makefile.am
+++ /dev/null
@@ -1,44 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-DESTDIR ?= /
-EXTRA_DIST = setup.py src
-
-all:
-
-all-local:
-	$(thrift_home)/bin/thrift --gen py $(top_srcdir)/if/fb303.thrift
-	mv gen-py/fb303/* fb303
-	$(PYTHON) setup.py build
-
-# We're ignoring prefix here because site-packages seems to be
-# the equivalent of /usr/local/lib in Python land.
-# Old version (can't put inline because it's not portable).
-#$(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) $(PYTHON_SETUPUTIL_ARGS)
-install-exec-hook:
-	$(PYTHON) setup.py install --root=$(DESTDIR) --prefix=$(PY_PREFIX) $(PYTHON_SETUPUTIL_ARGS)
-
-
-
-clean:	clean-local
-
-clean-local:
-	$(RM) -r build
-
-check-local: all

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/py/fb303/FacebookBase.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/py/fb303/FacebookBase.py b/depends/thirdparty/thrift/contrib/fb303/py/fb303/FacebookBase.py
deleted file mode 100644
index 685ff20..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/py/fb303/FacebookBase.py
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import time
-import FacebookService
-import thrift.reflection.limited
-from ttypes import fb_status
-
-class FacebookBase(FacebookService.Iface):
-
-  def __init__(self, name):
-    self.name = name
-    self.alive = int(time.time())
-    self.counters = {}
-
-  def getName(self, ):
-    return self.name
-
-  def getVersion(self, ):
-    return ''
-
-  def getStatus(self, ):
-    return fb_status.ALIVE
-
-  def getCounters(self):
-    return self.counters
-
-  def resetCounter(self, key):
-    self.counters[key] = 0
-
-  def getCounter(self, key):
-    if self.counters.has_key(key):
-      return self.counters[key]
-    return 0
-
-  def incrementCounter(self, key):
-    self.counters[key] = self.getCounter(key) + 1
-
-  def setOption(self, key, value):
-    pass
-
-  def getOption(self, key):
-    return ""
-
-  def getOptions(self):
-    return {}
-
-  def getOptions(self):
-    return {}
-
-  def aliveSince(self):
-    return self.alive
-
-  def getCpuProfile(self, duration):
-    return ""
-
-  def getLimitedReflection(self):
-    return thrift.reflection.limited.Service()
-
-  def reinitialize(self):
-    pass
-
-  def shutdown(self):
-    pass

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/__init__.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/__init__.py b/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/__init__.py
deleted file mode 100644
index f8e3a94..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/__init__.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-__all__ = ['fb303_simple_mgmt']

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py b/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
deleted file mode 100644
index 4f8ce99..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/py/fb303_scripts/fb303_simple_mgmt.py
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import sys, os
-from optparse import OptionParser
-
-from thrift.Thrift import *
-
-from thrift.transport import TSocket
-from thrift.transport import TTransport
-from thrift.protocol import TBinaryProtocol
-
-from fb303 import *
-from fb303.ttypes import *
-
-def service_ctrl(
-                 command,
-                 port,
-                 trans_factory = None,
-                 prot_factory = None):
-    """
-    service_ctrl is a generic function to execute standard fb303 functions
-
-    @param command: one of stop, start, reload, status, counters, name, alive
-    @param port: service's port
-    @param trans_factory: TTransportFactory to use for obtaining a TTransport. Default is
-                          TBufferedTransportFactory
-    @param prot_factory: TProtocolFactory to use for obtaining a TProtocol. Default is
-                         TBinaryProtocolFactory
-    """
-
-    if command in ["status"]:
-        try:
-            status = fb303_wrapper('status', port, trans_factory, prot_factory)
-            status_details = fb303_wrapper('get_status_details', port, trans_factory, prot_factory)
-
-            msg = fb_status_string(status)
-            if (len(status_details)):
-                msg += " - %s" % status_details
-            print msg
-
-            if (status == fb_status.ALIVE):
-                return 2
-            else:
-                return 3
-        except:
-            print "Failed to get status"
-            return 3
-
-    # scalar commands
-    if command in ["version","alive","name"]:
-        try:
-            result = fb303_wrapper(command,  port, trans_factory, prot_factory)
-            print result
-            return 0
-        except:
-            print "failed to get ",command
-            return 3
-
-    # counters
-    if command in ["counters"]:
-        try:
-            counters = fb303_wrapper('counters',  port, trans_factory, prot_factory)
-            for counter in counters:
-                print "%s: %d" % (counter, counters[counter])
-            return 0
-        except:
-            print "failed to get counters"
-            return 3
-
-
-    # Only root should be able to run the following commands
-    if os.getuid() == 0:
-        # async commands
-        if command in ["stop","reload"] :
-            try:
-                fb303_wrapper(command, port, trans_factory, prot_factory)
-                return 0
-            except:
-                print "failed to tell the service to ", command
-                return 3
-    else:
-        if command in ["stop","reload"]:
-            print "root privileges are required to stop or reload the service."
-            return 4
-
-    print "The following commands are available:"
-    for command in ["counters","name","version","alive","status"]:
-        print "\t%s" % command
-    print "The following commands are available for users with root privileges:"
-    for command in ["stop","reload"]:
-        print "\t%s" % command
-
-
-
-    return 0;
-
-
-def fb303_wrapper(command, port, trans_factory = None, prot_factory = None):
-    sock = TSocket.TSocket('localhost', port)
-
-    # use input transport factory if provided
-    if (trans_factory is None):
-        trans = TTransport.TBufferedTransport(sock)
-    else:
-        trans = trans_factory.getTransport(sock)
-
-    # use input protocol factory if provided
-    if (prot_factory is None):
-        prot = TBinaryProtocol.TBinaryProtocol(trans)
-    else:
-        prot = prot_factory.getProtocol(trans)
-
-    # initialize client and open transport
-    fb303_client = FacebookService.Client(prot, prot)
-    trans.open()
-
-    if (command == 'reload'):
-        fb303_client.reinitialize()
-
-    elif (command == 'stop'):
-        fb303_client.shutdown()
-
-    elif (command == 'status'):
-        return fb303_client.getStatus()
-
-    elif (command == 'version'):
-        return fb303_client.getVersion()
-
-    elif (command == 'get_status_details'):
-        return fb303_client.getStatusDetails()
-
-    elif (command == 'counters'):
-        return fb303_client.getCounters()
-
-    elif (command == 'name'):
-        return fb303_client.getName()
-
-    elif (command == 'alive'):
-        return fb303_client.aliveSince()
-
-    trans.close()
-
-
-def fb_status_string(status_enum):
-    if (status_enum == fb_status.DEAD):
-        return "DEAD"
-    if (status_enum == fb_status.STARTING):
-        return "STARTING"
-    if (status_enum == fb_status.ALIVE):
-        return "ALIVE"
-    if (status_enum == fb_status.STOPPING):
-        return "STOPPING"
-    if (status_enum == fb_status.STOPPED):
-        return "STOPPED"
-    if (status_enum == fb_status.WARNING):
-        return "WARNING"
-
-
-def main():
-
-    # parse command line options
-    parser = OptionParser()
-    commands=["stop","counters","status","reload","version","name","alive"]
-
-    parser.add_option("-c", "--command", dest="command", help="execute this API",
-                      choices=commands, default="status")
-    parser.add_option("-p","--port",dest="port",help="the service's port",
-                      default=9082)
-
-    (options, args) = parser.parse_args()
-    status = service_ctrl(options.command, options.port)
-    sys.exit(status)
-
-
-if __name__ == '__main__':
-    main()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/py/setup.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/py/setup.py b/depends/thirdparty/thrift/contrib/fb303/py/setup.py
deleted file mode 100644
index 6d42bd1..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/py/setup.py
+++ /dev/null
@@ -1,49 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#	http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-import sys
-try:
-    from setuptools import setup, Extension
-except:
-    from distutils.core import setup, Extension, Command
-        
-setup(name = 'thrift_fb303',
-    version = '0.9.3',
-    description = 'Python bindings for the Apache Thrift FB303',
-    author = ['Thrift Developers'],
-    author_email = ['dev@thrift.apache.org'],
-    url = 'http://thrift.apache.org',
-    license = 'Apache License 2.0',
-    packages = [
-        'fb303',
-        'fb303_scripts',
-    ],
-    classifiers = [
-        'Development Status :: 5 - Production/Stable',
-        'Environment :: Console',
-        'Intended Audience :: Developers',
-        'Programming Language :: Python',
-        'Programming Language :: Python :: 2',
-        'Topic :: Software Development :: Libraries',
-        'Topic :: System :: Networking'
-    ],
-)
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/mingw-cross-compile.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/mingw-cross-compile.sh b/depends/thirdparty/thrift/contrib/mingw-cross-compile.sh
deleted file mode 100755
index 7ed5d47..0000000
--- a/depends/thirdparty/thrift/contrib/mingw-cross-compile.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/sh
-set -e
-
-./configure \
-  --disable-libs \
-  --build=i686-pc-linux-gnu \
-  --host=i586-mingw32msvc \
-  CC=i586-mingw32msvc-gcc CXX=i586-mingw32msvc-g++
-
-make
-
-# Check two locations to be compatible with libtool 1.5.26 or 2.2.6b.
-if test -f compiler/cpp/.libs/thrift.exe ; then
-  i586-mingw32msvc-strip compiler/cpp/.libs/thrift.exe -o ./thrift.exe
-else 
-  i586-mingw32msvc-strip compiler/cpp/thrift.exe -o ./thrift.exe
-fi
-echo "Finished compiling with resulting exe"
-ls -l ./thrift.exe

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/parse_profiling.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/parse_profiling.py b/depends/thirdparty/thrift/contrib/parse_profiling.py
deleted file mode 100755
index 3d46fb8..0000000
--- a/depends/thirdparty/thrift/contrib/parse_profiling.py
+++ /dev/null
@@ -1,310 +0,0 @@
-#!/usr/bin/env python
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-"""
-This script can be used to make the output from
-apache::thrift::profile_print_info() more human-readable.
-
-It translates each executable file name and address into the corresponding
-source file name, line number, and function name.  By default, it also
-demangles C++ symbol names.
-"""
-
-import optparse
-import os
-import re
-import subprocess
-import sys
-
-
-class AddressInfo(object):
-    """
-    A class to store information about a particular address in an object file.
-    """
-    def __init__(self, obj_file, address):
-        self.objectFile = obj_file
-        self.address = address
-        self.sourceFile = None
-        self.sourceLine = None
-        self.function = None
-
-
-g_addrs_by_filename = {}
-def get_address(filename, address):
-    """
-    Retrieve an AddressInfo object for the specified object file and address.
-
-    Keeps a global list of AddressInfo objects.  Two calls to get_address()
-    with the same filename and address will always return the same AddressInfo
-    object.
-    """
-    global g_addrs_by_filename
-    try:
-        by_address = g_addrs_by_filename[filename]
-    except KeyError:
-        by_address = {}
-        g_addrs_by_filename[filename] = by_address
-
-    try:
-        addr_info = by_address[address]
-    except KeyError:
-        addr_info = AddressInfo(filename, address)
-        by_address[address] = addr_info
-    return addr_info
-
-
-def translate_file_addresses(filename, addresses, options):
-    """
-    Use addr2line to look up information for the specified addresses.
-    All of the addresses must belong to the same object file.
-    """
-    # Do nothing if we can't find the file
-    if not os.path.isfile(filename):
-        return
-
-    args = ['addr2line']
-    if options.printFunctions:
-        args.append('-f')
-    args.extend(['-e', filename])
-
-    proc = subprocess.Popen(args, stdin=subprocess.PIPE,
-                            stdout=subprocess.PIPE)
-    for address in addresses:
-        assert address.objectFile == filename
-        proc.stdin.write(address.address + '\n')
-
-        if options.printFunctions:
-            function = proc.stdout.readline()
-            function = function.strip()
-            if not function:
-                raise Exception('unexpected EOF from addr2line')
-            address.function = function
-
-        file_and_line = proc.stdout.readline()
-        file_and_line = file_and_line.strip()
-        if not file_and_line:
-            raise Exception('unexpected EOF from addr2line')
-        idx = file_and_line.rfind(':')
-        if idx < 0:
-            msg = 'expected file and line number from addr2line; got %r' % \
-                    (file_and_line,)
-            msg += '\nfile=%r, address=%r' % (filename, address.address)
-            raise Exception(msg)
-
-        address.sourceFile = file_and_line[:idx]
-        address.sourceLine = file_and_line[idx+1:]
-
-    (remaining_out, cmd_err) = proc.communicate()
-    retcode = proc.wait()
-    if retcode != 0:
-        raise subprocess.CalledProcessError(retcode, args)
-
-
-def lookup_addresses(options):
-    """
-    Look up source file information for all of the addresses currently stored
-    in the global list of AddressInfo objects.
-    """
-    global g_addrs_by_filename
-    for (file, addresses) in g_addrs_by_filename.items():
-        translate_file_addresses(file, addresses.values(), options)
-
-
-class Entry(object):
-    """
-    An entry in the thrift profile output.
-    Contains a header line, and a backtrace.
-    """
-    def __init__(self, header):
-        self.header = header
-        self.bt = []
-
-    def addFrame(self, filename, address):
-        # If libc was able to determine the symbols names, the filename
-        # argument will be of the form <filename>(<function>+<offset>)
-        # So, strip off anything after the last '('
-        idx = filename.rfind('(')
-        if idx >= 0:
-            filename = filename[:idx]
-
-        addr = get_address(filename, address)
-        self.bt.append(addr)
-
-    def write(self, f, options):
-        f.write(self.header)
-        f.write('\n')
-        n = 0
-        for address in self.bt:
-            f.write('  #%-2d %s:%s\n' % (n, address.sourceFile,
-                                         address.sourceLine))
-            n += 1
-            if options.printFunctions:
-                if address.function:
-                    f.write('      %s\n' % (address.function,))
-                else:
-                    f.write('      ??\n')
-
-
-def process_file(in_file, out_file, options):
-    """
-    Read thrift profile output from the specified input file, and print
-    prettier information on the output file.
-    """
-    #
-    # A naive approach would be to read the input line by line,
-    # and each time we come to a filename and address, pass it to addr2line
-    # and print the resulting information.  Unfortunately, addr2line can be
-    # quite slow, especially with large executables.
-    #
-    # This approach is much faster.  We read in all of the input, storing
-    # the addresses in each file that need to be resolved.  We then call
-    # addr2line just once for each file.  This is much faster than calling
-    # addr2line once per address.
-    #
-
-    virt_call_regex = re.compile(r'^\s*T_VIRTUAL_CALL: (\d+) calls on (.*):$')
-    gen_prot_regex = re.compile(
-            r'^\s*T_GENERIC_PROTOCOL: (\d+) calls to (.*) with a (.*):$')
-    bt_regex = re.compile(r'^\s*#(\d+)\s*(.*) \[(0x[0-9A-Za-z]+)\]$')
-
-    # Parse all of the input, and store it as Entry objects
-    entries = []
-    current_entry = None
-    while True:
-        line = in_file.readline()
-        if not line:
-            break
-
-        if line == '\n' or line.startswith('Thrift virtual call info:'):
-            continue
-
-        virt_call_match = virt_call_regex.match(line)
-        if virt_call_match:
-            num_calls = int(virt_call_match.group(1))
-            type_name = virt_call_match.group(2)
-            if options.cxxfilt:
-                # Type names reported by typeid() are internal names.
-                # By default, c++filt doesn't demangle internal type names.
-                # (Some versions of c++filt have a "-t" option to enable this.
-                # Other versions don't have this argument, but demangle type
-                # names passed as an argument, but not on stdin.)
-                #
-                # If the output is being filtered through c++filt, prepend
-                # "_Z" to the type name to make it look like an external name.
-                type_name = '_Z' + type_name
-            header = 'T_VIRTUAL_CALL: %d calls on "%s"' % \
-                    (num_calls, type_name)
-            if current_entry is not None:
-                entries.append(current_entry)
-            current_entry = Entry(header)
-            continue
-
-        gen_prot_match = gen_prot_regex.match(line)
-        if gen_prot_match:
-            num_calls = int(gen_prot_match.group(1))
-            type_name1 = gen_prot_match.group(2)
-            type_name2 = gen_prot_match.group(3)
-            if options.cxxfilt:
-                type_name1 = '_Z' + type_name1
-                type_name2 = '_Z' + type_name2
-            header = 'T_GENERIC_PROTOCOL: %d calls to "%s" with a "%s"' % \
-                    (num_calls, type_name1, type_name2)
-            if current_entry is not None:
-                entries.append(current_entry)
-            current_entry = Entry(header)
-            continue
-
-        bt_match = bt_regex.match(line)
-        if bt_match:
-            if current_entry is None:
-                raise Exception('found backtrace frame before entry header')
-            frame_num = int(bt_match.group(1))
-            filename = bt_match.group(2)
-            address = bt_match.group(3)
-            current_entry.addFrame(filename, address)
-            continue
-
-        raise Exception('unexpected line in input: %r' % (line,))
-
-    # Add the last entry we were processing to the list
-    if current_entry is not None:
-        entries.append(current_entry)
-        current_entry = None
-
-    # Look up all of the addresses
-    lookup_addresses(options)
-
-    # Print out the entries, now that the information has been translated
-    for entry in entries:
-        entry.write(out_file, options)
-        out_file.write('\n')
-
-
-def start_cppfilt():
-    (read_pipe, write_pipe) = os.pipe()
-
-    # Fork.  Run c++filt in the parent process,
-    # and then continue normal processing in the child.
-    pid = os.fork()
-    if pid == 0:
-        # child
-        os.dup2(write_pipe, sys.stdout.fileno())
-        os.close(read_pipe)
-        os.close(write_pipe)
-        return
-    else:
-        # parent
-        os.dup2(read_pipe, sys.stdin.fileno())
-        os.close(read_pipe)
-        os.close(write_pipe)
-
-        cmd = ['c++filt']
-        os.execvp(cmd[0], cmd)
-
-
-def main(argv):
-    parser = optparse.OptionParser(usage='%prog [options] [<file>]')
-    parser.add_option('--no-functions', help='Don\'t print function names',
-                      dest='printFunctions', action='store_false',
-                      default=True)
-    parser.add_option('--no-demangle',
-                      help='Don\'t demangle C++ symbol names',
-                      dest='cxxfilt', action='store_false',
-                      default=True)
-
-    (options, args) = parser.parse_args(argv[1:])
-    num_args = len(args)
-    if num_args == 0:
-        in_file = sys.stdin
-    elif num_args == 1:
-        in_file = open(argv[1], 'r')
-    else:
-        parser.print_usage(sys.stderr)
-        print >> sys.stderr, 'trailing arguments: %s' % (' '.join(args[1:],))
-        return 1
-
-    if options.cxxfilt:
-        start_cppfilt()
-
-    process_file(in_file, sys.stdout, options)
-
-
-if __name__ == '__main__':
-    rc = main(sys.argv)
-    sys.exit(rc)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/pom.xml
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/pom.xml b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/pom.xml
deleted file mode 100644
index b12a821..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/pom.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
-   http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- -->
-<project 
-  xmlns="http://maven.apache.org/POM/4.0.0" 
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>org.apache.thrift</groupId>
-  <artifactId>thrift-maven-plugin</artifactId>
-  <packaging>maven-plugin</packaging>
-  <name>thrift-maven-plugin</name>
-  <version>0.9.3</version>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.7</source>
-          <target>1.7</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-surefire-plugin</artifactId>
-        <version>2.14.1</version>
-        <configuration>
-          <systemPropertyVariables>
-            <thriftExecutable>${thrift.compiler}</thriftExecutable>
-          </systemPropertyVariables>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-  <dependencies>
-      <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.11</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-plugin-api</artifactId>
-      <version>3.1.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-      <version>2.2.1</version>
-    </dependency>
-    <dependency>
-      <groupId>com.google.guava</groupId>
-      <artifactId>guava</artifactId>
-      <version>14.0.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-      <version>3.0.14</version>
-    </dependency>
-  </dependencies>
-  <properties>
-    <thrift.root>${basedir}/../..</thrift.root>
-    <thrift.compiler>${thrift.root}/compiler/cpp/thrift</thrift.compiler>
-    <thrift.test.home>${thrift.root}/test</thrift.test.home>
-  </properties>
-</project>


[26/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_php_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_php_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_php_generator.cc
deleted file mode 100644
index 0026d70..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_php_generator.cc
+++ /dev/null
@@ -1,2526 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_oop_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-#define NSGLOBAL (nsglobal_.size() ? nsglobal_ : "")
-#define NSGLOBAL_A ("\\" + NSGLOBAL)
-#define NSGLOBAL_B (NSGLOBAL + "\\")
-#define NSGLOBAL_AB ("\\" + NSGLOBAL + "\\")
-
-/**
- * PHP code generator.
- *
- */
-class t_php_generator : public t_oop_generator {
-public:
-  t_php_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("inlined");
-    binary_inline_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("rest");
-    rest_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("server");
-    phps_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("oop");
-    oop_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("validate");
-    validate_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("json");
-    json_serializable_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("nsglobal");
-    if (iter != parsed_options.end()) {
-      nsglobal_ = iter->second;
-    } else {
-      nsglobal_ = ""; // by default global namespace is empty
-    }
-
-    if (oop_ && binary_inline_) {
-      throw "oop and inlined are mutually exclusive.";
-    }
-
-    out_dir_base_ = (binary_inline_ ? "gen-phpi" : "gen-php");
-    escape_['$'] = "\\$";
-  }
-
-  static bool is_valid_namespace(const std::string& sub_namespace);
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_consts(vector<t_const*> consts);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Structs!
-   */
-
-  void generate_php_struct(t_struct* tstruct, bool is_exception);
-  void generate_php_struct_definition(std::ofstream& out,
-                                      t_struct* tstruct,
-                                      bool is_xception = false,
-                                      bool is_result = false);
-  void generate_php_struct_reader(std::ofstream& out, t_struct* tstruct, bool is_result);
-  void generate_php_struct_writer(std::ofstream& out, t_struct* tstruct, bool is_result);
-  void generate_php_function_helpers(t_function* tfunction);
-  void generate_php_struct_required_validator(ofstream& out,
-                                              t_struct* tstruct,
-                                              std::string method_name,
-                                              bool write_mode);
-  void generate_php_struct_read_validator(ofstream& out, t_struct* tstruct);
-  void generate_php_struct_write_validator(ofstream& out, t_struct* tstruct);
-  void generate_php_struct_json_serialize(ofstream& out, t_struct* tstruct, bool is_result);
-  bool needs_php_write_validator(t_struct* tstruct, bool is_result);
-  bool needs_php_read_validator(t_struct* tstruct, bool is_result);
-  int get_php_num_required_fields(const vector<t_field*>& fields, bool write_mode);
-
-  void generate_php_type_spec(std::ofstream& out, t_type* t);
-  void generate_php_struct_spec(std::ofstream& out, t_struct* tstruct);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_rest(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_processor(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool inclass = false);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_php_doc(std::ofstream& out, t_doc* tdoc);
-
-  void generate_php_doc(std::ofstream& out, t_field* tfield);
-
-  void generate_php_doc(std::ofstream& out, t_function* tfunction);
-
-  void generate_php_docstring_comment(std::ofstream& out, string contents);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string php_includes();
-  std::string declare_field(t_field* tfield, bool init = false, bool obj = false);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct, bool addTypeHints = true);
-  std::string type_to_cast(t_type* ttype);
-  std::string type_to_enum(t_type* ttype);
-  std::string type_to_phpdoc(t_type* ttype);
-
-  std::string php_namespace_base(const t_program* p) {
-    std::string ns = p->get_namespace("php");
-    const char* delimiter = "\\";
-    size_t position = ns.find('.');
-    while (position != string::npos) {
-      ns.replace(position, 1, delimiter);
-      position = ns.find('.', position + 1);
-    }
-    return ns;
-  }
-
-  // general use namespace prefixing: \my\namespace\ or my_namespace_
-  string php_namespace(const t_program* p) {
-    string ns = php_namespace_base(p);
-    return (nsglobal_.size() ? NSGLOBAL_AB : NSGLOBAL_B) + (ns.size() ? (ns + "\\") : "");
-  }
-
-  // setting the namespace of a file: my\namespace
-  string php_namespace_suffix(const t_program* p) {
-    string ns = php_namespace_base(p);
-
-    return (nsglobal_.size() ? NSGLOBAL_B : NSGLOBAL) + ns;
-  }
-
-  // add a directory to already existing namespace
-  string php_namespace_directory(string directory, bool end = true) {
-    (void)directory;
-    if (end) {
-      return ";";
-    } else {
-      return "";
-    }
-  }
-
-  // writing an autload identifier into globa;ls: my\namespace\ or my_namespace_
-  string php_namespace_autoload(const t_program* p) {
-    std::string ns = php_namespace_base(p);
-    return (nsglobal_.size() ? NSGLOBAL_B : NSGLOBAL) + (ns.size() ? (ns + "\\") : "");
-  }
-
-  // declaring a type: typename or my_namespace_typename
-  string php_namespace_declaration(t_type* t) { return t->get_name(); }
-
-  std::string php_path(t_program* p) {
-    std::string ns = p->get_namespace("php.path");
-    if (ns.empty()) {
-      return p->get_name();
-    }
-
-    // Transform the java-style namespace into a path.
-    for (std::string::iterator it = ns.begin(); it != ns.end(); ++it) {
-      if (*it == '.') {
-        *it = '/';
-      }
-    }
-
-    return ns + '/';
-  }
-
-  /**
-   * Transform class_method into ClassMethod
-   *
-   * @param str
-   * @return stirng
-   */
-  string classify(string str) {
-    string classe = "";
-
-    vector<string> x = split(str, '_');
-
-    for (size_t i = 0; i < x.size(); ++i) {
-      classe = classe + capitalize(x[i]);
-    }
-
-    return classe;
-  }
-
-  /**
-   * Split method
-   * @param s
-   * @param delim
-   * @param elems
-   * @return
-   */
-  vector<string>& split(const string& s, char delim, vector<string>& elems) {
-    stringstream ss(s);
-    string item;
-
-    while (getline(ss, item, delim)) {
-      elems.push_back(item);
-    }
-
-    return elems;
-  }
-
-  vector<string> split(const string& s, char delim) {
-    vector<string> elems;
-
-    return split(s, delim, elems);
-  }
-
-  /**
-   * Capitalize method
-   * @param str
-   * @return
-   */
-  string capitalize(string str) {
-    string::iterator it(str.begin());
-
-    if (it != str.end())
-      str[0] = toupper((unsigned char)str[0]);
-
-    //    while(++it != str.end())
-    //    {
-    //      *it = tolower((unsigned char)*it);
-    //    }
-    return str;
-  }
-
-private:
-  /**
-   * File streams
-   */
-  std::ofstream f_types_;
-  std::ofstream f_helpers_;
-  std::ofstream f_service_;
-
-  std::string package_dir_;
-  /**
-   * Generate protocol-independent template? Or Binary inline code?
-   */
-  bool binary_inline_;
-
-  /**
-   * Generate a REST handler class
-   */
-  bool rest_;
-
-  /**
-   * Generate stubs for a PHP server
-   */
-  bool phps_;
-
-  /**
-   * Whether to use OOP base class TBase
-   */
-  bool oop_;
-
-  /**
-   * Whether to generate validator code
-   */
-  bool validate_;
-
-  /**
-   * Whether to generate JsonSerializable classes
-   */
-  bool json_serializable_;
-
-  /**
-   * Global namespace for PHP 5.3
-   */
-  std::string nsglobal_;
-};
-
-bool t_php_generator::is_valid_namespace(const std::string& sub_namespace) {
-  return sub_namespace == "path";
-}
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_php_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // Create Real directory Namespaces
-  vector<string> NSx = split(php_namespace_suffix(get_program()), '\\');
-  package_dir_ = get_out_dir();
-
-  for (size_t i = 0; i < NSx.size(); ++i) {
-    package_dir_ = package_dir_ + "/" + NSx[i] + "/";
-    MKDIR(package_dir_.c_str());
-  }
-
-  // Make output file
-  string f_types_name = package_dir_ + "Types.php";
-  f_types_.open(f_types_name.c_str());
-
-  // Print header
-  f_types_ << "<?php" << endl;
-  if ( ! php_namespace_suffix(get_program()).empty() )  {
-    f_types_ << "namespace " << php_namespace_suffix(get_program()) << ";" << endl << endl;
-  }
-  f_types_ << autogen_comment() << php_includes();
-
-  f_types_ << endl;
-}
-
-/**
- * Prints standard php includes
- */
-string t_php_generator::php_includes() {
-  string includes = "use Thrift\\Base\\TBase;\n"
-                    "use Thrift\\Type\\TType;\n"
-                    "use Thrift\\Type\\TMessageType;\n"
-                    "use Thrift\\Exception\\TException;\n"
-                    "use Thrift\\Exception\\TProtocolException;\n"
-                    "use Thrift\\Protocol\\TProtocol;\n"
-                    "use Thrift\\Protocol\\TBinaryProtocolAccelerated;\n"
-                    "use Thrift\\Exception\\TApplicationException;\n";
-
-  if (json_serializable_) {
-    includes += "use JsonSerializable;\n"
-                "use stdClass;\n";
-  }
-
-  return includes + "\n";
-}
-
-/**
- * Close up (or down) some filez.
- */
-void t_php_generator::close_generator() {
-  // Close types file
-  f_types_ << endl;
-  f_types_.close();
-}
-
-/**
- * Generates a typedef. This is not done in PHP, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_php_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Since define is expensive to lookup
- * in PHP, we use a global array for this.
- *
- * @param tenum The enumeration
- */
-void t_php_generator::generate_enum(t_enum* tenum) {
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-
-  // We're also doing it this way to see how it performs. It's more legible
-  // code but you can't do things like an 'extract' on it, which is a bit of
-  // a downer.
-  generate_php_doc(f_types_, tenum);
-  f_types_ << "final class " << tenum->get_name() << " {" << endl;
-  indent_up();
-
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    generate_php_doc(f_types_, *c_iter);
-    indent(f_types_) << "const " << (*c_iter)->get_name() << " = " << value << ";" << endl;
-  }
-
-  indent(f_types_) << "static public $__names = array(" << endl;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_types_) << "  " << value << " => '" << (*c_iter)->get_name() << "'," << endl;
-  }
-  indent(f_types_) << ");" << endl;
-
-  indent_down();
-  f_types_ << "}" << endl << endl;
-}
-
-/**
- * Generate constant class
- *
- * Override the one from t_generator
- */
-void t_php_generator::generate_consts(vector<t_const*> consts) {
-  vector<t_const*>::iterator c_iter;
-
-  // Create class only if needed
-  if (consts.size() > 0) {
-    f_types_ << "final class Constant extends \\Thrift\\Type\\TConstant {" << endl;
-    indent_up();
-
-    // Create static property
-    for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-      string name = (*c_iter)->get_name();
-
-      indent(f_types_) << "static protected $" << name << ";" << endl;
-    }
-
-    // Create init function
-    for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-      string name = (*c_iter)->get_name();
-
-      f_types_ << endl;
-
-      indent(f_types_) << "static protected function init_" << name << "() {" << endl;
-      indent_up();
-
-      indent(f_types_) << "return ";
-      generate_const(*c_iter);
-      f_types_ << ";" << endl;
-
-      indent_down();
-      indent(f_types_) << "}" << endl;
-    }
-
-    indent_down();
-    f_types_ << "}" << endl << endl;
-  }
-}
-
-/**
- * Generate a constant value
- */
-void t_php_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  t_const_value* value = tconst->get_value();
-
-  generate_php_doc(f_types_, tconst);
-  f_types_ << render_const_value(type, value);
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_php_generator::render_const_value(t_type* type, t_const_value* value) {
-  std::ostringstream out;
-  type = get_true_type(type);
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "new " << php_namespace(type->get_program()) << type->get_name() << "(array(" << endl;
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      out << indent();
-      out << render_const_value(g_type_string, v_iter->first);
-      out << " => ";
-      out << render_const_value(field_type, v_iter->second);
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << "))";
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "array(" << endl;
-    indent_up();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent();
-      out << render_const_value(ktype, v_iter->first);
-      out << " => ";
-      out << render_const_value(vtype, v_iter->second);
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << ")";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    out << "array(" << endl;
-    indent_up();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent();
-      out << render_const_value(etype, *v_iter);
-      if (type->is_set()) {
-        out << " => true";
-      }
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << ")";
-  }
-  return out.str();
-}
-
-/**
- * Make a struct
- */
-void t_php_generator::generate_struct(t_struct* tstruct) {
-  generate_php_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_php_generator::generate_xception(t_struct* txception) {
-  generate_php_struct(txception, true);
-}
-
-/**
- * Structs can be normal or exceptions.
- */
-void t_php_generator::generate_php_struct(t_struct* tstruct, bool is_exception) {
-  generate_php_struct_definition(f_types_, tstruct, is_exception);
-}
-
-void t_php_generator::generate_php_type_spec(ofstream& out, t_type* t) {
-  t = get_true_type(t);
-  indent(out) << "'type' => " << type_to_enum(t) << "," << endl;
-
-  if (t->is_base_type() || t->is_enum()) {
-    // Noop, type is all we need
-  } else if (t->is_struct() || t->is_xception()) {
-    indent(out) << "'class' => '" << php_namespace(t->get_program()) << t->get_name() << "',"
-                << endl;
-  } else if (t->is_map()) {
-    t_type* ktype = get_true_type(((t_map*)t)->get_key_type());
-    t_type* vtype = get_true_type(((t_map*)t)->get_val_type());
-    indent(out) << "'ktype' => " << type_to_enum(ktype) << "," << endl;
-    indent(out) << "'vtype' => " << type_to_enum(vtype) << "," << endl;
-    indent(out) << "'key' => array(" << endl;
-    indent_up();
-    generate_php_type_spec(out, ktype);
-    indent_down();
-    indent(out) << ")," << endl;
-    indent(out) << "'val' => array(" << endl;
-    indent_up();
-    generate_php_type_spec(out, vtype);
-    indent(out) << ")," << endl;
-    indent_down();
-  } else if (t->is_list() || t->is_set()) {
-    t_type* etype;
-    if (t->is_list()) {
-      etype = get_true_type(((t_list*)t)->get_elem_type());
-    } else {
-      etype = get_true_type(((t_set*)t)->get_elem_type());
-    }
-    indent(out) << "'etype' => " << type_to_enum(etype) << "," << endl;
-    indent(out) << "'elem' => array(" << endl;
-    indent_up();
-    generate_php_type_spec(out, etype);
-    indent(out) << ")," << endl;
-    indent_down();
-  } else {
-    throw "compiler error: no type for php struct spec field";
-  }
-}
-
-/**
- * Generates the struct specification structure, which fully qualifies enough
- * type information to generalize serialization routines.
- */
-void t_php_generator::generate_php_struct_spec(ofstream& out, t_struct* tstruct) {
-  indent(out) << "if (!isset(self::$_TSPEC)) {" << endl;
-  indent_up();
-
-  indent(out) << "self::$_TSPEC = array(" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    indent(out) << (*m_iter)->get_key() << " => array(" << endl;
-    indent_up();
-    out << indent() << "'var' => '" << (*m_iter)->get_name() << "'," << endl;
-    generate_php_type_spec(out, t);
-    indent(out) << ")," << endl;
-    indent_down();
-  }
-
-  indent_down();
-  indent(out) << "  );" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is nothing in PHP
- * where the objects are all just associative arrays (unless of course we
- * decide to start using objects for them...)
- *
- * @param tstruct The struct definition
- */
-void t_php_generator::generate_php_struct_definition(ofstream& out,
-                                                     t_struct* tstruct,
-                                                     bool is_exception,
-                                                     bool is_result) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  generate_php_doc(out, tstruct);
-  out << "class " << php_namespace_declaration(tstruct);
-  if (is_exception) {
-    out << " extends "
-        << "TException";
-  } else if (oop_) {
-    out << " extends "
-        << "TBase";
-  }
-  if (json_serializable_) {
-    out << " implements JsonSerializable";
-  }
-  out << " {" << endl;
-  indent_up();
-
-  indent(out) << "static $_TSPEC;" << endl << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    string dval = "null";
-    t_type* t = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL && !(t->is_struct() || t->is_xception())) {
-      dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
-    }
-    generate_php_doc(out, *m_iter);
-    indent(out) << "public $" << (*m_iter)->get_name() << " = " << dval << ";" << endl;
-  }
-
-  out << endl;
-
-  // Generate constructor from array
-  string param = (members.size() > 0) ? "$vals=null" : "";
-  out << indent() << "public function __construct(" << param << ") {" << endl;
-  indent_up();
-
-  generate_php_struct_spec(out, tstruct);
-
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if ((*m_iter)->get_value() != NULL && (t->is_struct() || t->is_xception())) {
-        indent(out) << "$this->" << (*m_iter)->get_name() << " = "
-                    << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
-      }
-    }
-    out << indent() << "if (is_array($vals)) {" << endl;
-    indent_up();
-    if (oop_) {
-      out << indent() << "parent::__construct(self::$_TSPEC, $vals);" << endl;
-    } else {
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        out << indent() << "if (isset($vals['" << (*m_iter)->get_name() << "'])) {" << endl
-            << indent() << "  $this->" << (*m_iter)->get_name() << " = $vals['"
-            << (*m_iter)->get_name() << "'];" << endl << indent() << "}" << endl;
-      }
-    }
-    indent_down();
-    out << indent() << "}" << endl;
-  }
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "public function getName() {" << endl << indent() << "  return '"
-      << tstruct->get_name() << "';" << endl << indent() << "}" << endl << endl;
-
-  generate_php_struct_reader(out, tstruct, is_result);
-  generate_php_struct_writer(out, tstruct, is_result);
-  if (needs_php_read_validator(tstruct, is_result)) {
-    generate_php_struct_read_validator(out, tstruct);
-  }
-  if (needs_php_write_validator(tstruct, is_result)) {
-    generate_php_struct_write_validator(out, tstruct);
-  }
-  if (json_serializable_) {
-    generate_php_struct_json_serialize(out, tstruct, is_result);
-  }
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates the read() method for a struct
- */
-void t_php_generator::generate_php_struct_reader(ofstream& out, t_struct* tstruct, bool is_result) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "public function read($input)" << endl;
-  scope_up(out);
-
-  if (oop_) {
-    if (needs_php_read_validator(tstruct, is_result)) {
-      indent(out) << "$tmp = $this->_read('" << tstruct->get_name() << "', self::$_TSPEC, $input);"
-                  << endl;
-      indent(out) << "$this->_validateForRead();" << endl;
-      indent(out) << "return $tmp;" << endl;
-    } else {
-      indent(out) << "return $this->_read('" << tstruct->get_name() << "', self::$_TSPEC, $input);"
-                  << endl;
-    }
-    scope_down(out);
-    out << endl;
-    return;
-  }
-
-  out << indent() << "$xfer = 0;" << endl << indent() << "$fname = null;" << endl << indent()
-      << "$ftype = 0;" << endl << indent() << "$fid = 0;" << endl;
-
-  // Declare stack tmp variables
-  if (!binary_inline_) {
-    indent(out) << "$xfer += $input->readStructBegin($fname);" << endl;
-  }
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-
-  scope_up(out);
-
-  // Read beginning field marker
-  if (binary_inline_) {
-    t_field fftype(g_type_byte, "ftype");
-    t_field ffid(g_type_i16, "fid");
-    generate_deserialize_field(out, &fftype);
-    out << indent() << "if ($ftype == "
-        << "TType::STOP) {" << endl << indent() << "  break;" << endl << indent() << "}" << endl;
-    generate_deserialize_field(out, &ffid);
-  } else {
-    indent(out) << "$xfer += $input->readFieldBegin($fname, $ftype, $fid);" << endl;
-    // Check for field STOP marker and break
-    indent(out) << "if ($ftype == "
-                << "TType::STOP) {" << endl;
-    indent_up();
-    indent(out) << "break;" << endl;
-    indent_down();
-    indent(out) << "}" << endl;
-  }
-
-  // Switch statement on the field we are reading
-  indent(out) << "switch ($fid)" << endl;
-
-  scope_up(out);
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-    indent_up();
-    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-    generate_deserialize_field(out, *f_iter, "this->");
-    indent_down();
-    out << indent() << "} else {" << endl;
-    if (binary_inline_) {
-      indent(out) << "  $xfer += "
-                  << "TProtocol::skipBinary($input, $ftype);" << endl;
-    } else {
-      indent(out) << "  $xfer += $input->skip($ftype);" << endl;
-    }
-    out << indent() << "}" << endl << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  indent(out) << "default:" << endl;
-  if (binary_inline_) {
-    indent(out) << "  $xfer += "
-                << "TProtocol::skipBinary($input, $ftype);" << endl;
-  } else {
-    indent(out) << "  $xfer += $input->skip($ftype);" << endl;
-  }
-  indent(out) << "  break;" << endl;
-
-  scope_down(out);
-
-  if (!binary_inline_) {
-    // Read field end marker
-    indent(out) << "$xfer += $input->readFieldEnd();" << endl;
-  }
-
-  scope_down(out);
-
-  if (!binary_inline_) {
-    indent(out) << "$xfer += $input->readStructEnd();" << endl;
-  }
-
-  if (needs_php_read_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForRead();" << endl;
-  }
-
-  indent(out) << "return $xfer;" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates the write() method for a struct
- */
-void t_php_generator::generate_php_struct_writer(ofstream& out, t_struct* tstruct, bool is_result) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  if (binary_inline_) {
-    indent(out) << "public function write(&$output) {" << endl;
-  } else {
-    indent(out) << "public function write($output) {" << endl;
-  }
-  indent_up();
-
-  if (needs_php_write_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForWrite();" << endl;
-  }
-
-  if (oop_) {
-    indent(out) << "return $this->_write('" << tstruct->get_name() << "', self::$_TSPEC, $output);"
-                << endl;
-    scope_down(out);
-    out << endl;
-    return;
-  }
-
-  indent(out) << "$xfer = 0;" << endl;
-
-  if (!binary_inline_) {
-    indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << endl;
-  }
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if ($this->" << (*f_iter)->get_name() << " !== null) {" << endl;
-    indent_up();
-
-    t_type* type = get_true_type((*f_iter)->get_type());
-    string expect;
-    if (type->is_container()) {
-      expect = "array";
-    } else if (type->is_struct()) {
-      expect = "object";
-    }
-    if (!expect.empty()) {
-      out << indent() << "if (!is_" << expect << "($this->" << (*f_iter)->get_name() << ")) {"
-          << endl;
-      indent_up();
-      out << indent() << "throw new "
-          << "TProtocolException('Bad type in structure.', "
-          << "TProtocolException::INVALID_DATA);" << endl;
-      scope_down(out);
-    }
-
-    // Write field header
-    if (binary_inline_) {
-      out << indent() << "$output .= pack('c', " << type_to_enum((*f_iter)->get_type()) << ");"
-          << endl << indent() << "$output .= pack('n', " << (*f_iter)->get_key() << ");" << endl;
-    } else {
-      indent(out) << "$xfer += $output->writeFieldBegin("
-                  << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                  << ", " << (*f_iter)->get_key() << ");" << endl;
-    }
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this->");
-
-    // Write field closer
-    if (!binary_inline_) {
-      indent(out) << "$xfer += $output->writeFieldEnd();" << endl;
-    }
-
-    indent_down();
-    indent(out) << "}" << endl;
-  }
-
-  if (binary_inline_) {
-    out << indent() << "$output .= pack('c', "
-        << "TType::STOP);" << endl;
-  } else {
-    out << indent() << "$xfer += $output->writeFieldStop();" << endl << indent()
-        << "$xfer += $output->writeStructEnd();" << endl;
-  }
-
-  out << indent() << "return $xfer;" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-void t_php_generator::generate_php_struct_read_validator(ofstream& out, t_struct* tstruct) {
-  generate_php_struct_required_validator(out, tstruct, "_validateForRead", false);
-}
-
-void t_php_generator::generate_php_struct_write_validator(ofstream& out, t_struct* tstruct) {
-  generate_php_struct_required_validator(out, tstruct, "_validateForWrite", true);
-}
-
-void t_php_generator::generate_php_struct_required_validator(ofstream& out,
-                                                             t_struct* tstruct,
-                                                             std::string method_name,
-                                                             bool write_mode) {
-  indent(out) << "private function " << method_name << "() {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-
-  if (fields.size() > 0) {
-    vector<t_field*>::const_iterator f_iter;
-
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = (*f_iter);
-      if (field->get_req() == t_field::T_REQUIRED
-          || (field->get_req() == t_field::T_OPT_IN_REQ_OUT && write_mode)) {
-        indent(out) << "if ($this->" << field->get_name() << " === null) {" << endl;
-        indent_up();
-        indent(out) << "throw new TProtocolException('Required field " << tstruct->get_name() << "."
-                    << field->get_name() << " is unset!');" << endl;
-        indent_down();
-        indent(out) << "}" << endl;
-      }
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_php_generator::generate_php_struct_json_serialize(ofstream& out,
-                                                         t_struct* tstruct,
-                                                         bool is_result) {
-  indent(out) << "public function jsonSerialize() {" << endl;
-  indent_up();
-
-  if (needs_php_write_validator(tstruct, is_result)) {
-    indent(out) << "$this->_validateForWrite();" << endl;
-  }
-
-  indent(out) << "$json = new stdClass;" << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-
-  if (fields.size() > 0) {
-    vector<t_field*>::const_iterator f_iter;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = (*f_iter);
-      t_type* type = field->get_type();
-      const string& name = field->get_name();
-      if (type->is_map()) {
-        t_type* key_type = ((t_map*)type)->get_key_type();
-        if (!(key_type->is_base_type() || key_type->is_enum())) {
-          // JSON object keys must be strings. PHP's json_encode()
-          // function will convert any scalar key to strings, but
-          // we skip thrift maps with non-scalar keys.
-          continue;
-        }
-      }
-      indent(out) << "if ($this->" << name << " !== null) {" << endl;
-      indent_up();
-      indent(out) << "$json->" << name << " = ";
-      if (type->is_map()) {
-        out << "(object)";
-      }
-      out << "$this->" << name << ";" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-
-  indent(out) << "return $json;" << endl;
-  indent_down();
-
-  indent(out) << "}" << endl << endl;
-}
-
-int t_php_generator::get_php_num_required_fields(const vector<t_field*>& fields, bool write_mode) {
-  int num_req = 0;
-
-  if (fields.size() > 0) {
-    vector<t_field*>::const_iterator f_iter;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if ((*f_iter)->get_req() == t_field::T_REQUIRED
-          || ((*f_iter)->get_req() == t_field::T_OPT_IN_REQ_OUT && write_mode)) {
-        ++num_req;
-      }
-    }
-  }
-  return num_req;
-}
-
-bool t_php_generator::needs_php_write_validator(t_struct* tstruct, bool is_result) {
-  return (validate_ && !is_result && !tstruct->is_union()
-          && get_php_num_required_fields(tstruct->get_members(), true) > 0);
-}
-
-bool t_php_generator::needs_php_read_validator(t_struct* tstruct, bool is_result) {
-  return (validate_ && !is_result
-          && (get_php_num_required_fields(tstruct->get_members(), false) > 0));
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_php_generator::generate_service(t_service* tservice) {
-  string f_service_name = package_dir_ + service_name_ + ".php";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << "<?php" << endl;
-  if ( ! php_namespace_suffix(tservice->get_program()).empty() ) {
-    f_service_ << "namespace " << php_namespace_suffix(tservice->get_program()) << ";" << endl;
-  }
-  f_service_ << autogen_comment() << php_includes();
-
-  f_service_ << endl;
-
-  // Generate the three main parts of the service (well, two for now in PHP)
-  generate_service_interface(tservice);
-  if (rest_) {
-    generate_service_rest(tservice);
-  }
-  generate_service_client(tservice);
-  generate_service_helpers(tservice);
-  if (phps_) {
-    generate_service_processor(tservice);
-  }
-
-  // Close service file
-  f_service_ << endl;
-  f_service_.close();
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_php_generator::generate_service_processor(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = tservice->get_extends()->get_name();
-    extends_processor = " extends " + php_namespace(tservice->get_extends()->get_program())
-                        + extends + "Processor";
-  }
-
-  // Generate the header portion
-  f_service_ << "class " << service_name_ << "Processor" << extends_processor << " {" << endl;
-  indent_up();
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected $handler_ = null;" << endl;
-  }
-
-  f_service_ << indent() << "public function __construct($handler) {" << endl;
-  if (extends.empty()) {
-    f_service_ << indent() << "  $this->handler_ = $handler;" << endl;
-  } else {
-    f_service_ << indent() << "  parent::__construct($handler);" << endl;
-  }
-  f_service_ << indent() << "}" << endl << endl;
-
-  // Generate the server implementation
-  indent(f_service_) << "public function process($input, $output) {" << endl;
-  indent_up();
-
-  f_service_ << indent() << "$rseqid = 0;" << endl << indent() << "$fname = null;" << endl
-             << indent() << "$mtype = 0;" << endl << endl;
-
-  if (binary_inline_) {
-    t_field ffname(g_type_string, "fname");
-    t_field fmtype(g_type_byte, "mtype");
-    t_field fseqid(g_type_i32, "rseqid");
-    generate_deserialize_field(f_service_, &ffname, "", true);
-    generate_deserialize_field(f_service_, &fmtype, "", true);
-    generate_deserialize_field(f_service_, &fseqid, "", true);
-  } else {
-    f_service_ << indent() << "$input->readMessageBegin($fname, $mtype, $rseqid);" << endl;
-  }
-
-  // HOT: check for method implementation
-  f_service_ << indent() << "$methodname = 'process_'.$fname;" << endl << indent()
-             << "if (!method_exists($this, $methodname)) {" << endl;
-  if (binary_inline_) {
-    f_service_ << indent() << "  throw new \\Exception('Function '.$fname.' not implemented.');"
-               << endl;
-  } else {
-    f_service_ << indent() << "  $input->skip("
-               << "TType::STRUCT);" << endl << indent() << "  $input->readMessageEnd();" << endl
-               << indent() << "  $x = new "
-               << "TApplicationException('Function '.$fname.' not implemented.', "
-               << "TApplicationException::UNKNOWN_METHOD);" << endl << indent()
-               << "  $output->writeMessageBegin($fname, "
-               << "TMessageType::EXCEPTION, $rseqid);" << endl << indent()
-               << "  $x->write($output);" << endl << indent() << "  $output->writeMessageEnd();"
-               << endl << indent() << "  $output->getTransport()->flush();" << endl << indent()
-               << "  return;" << endl;
-  }
-  f_service_ << indent() << "}" << endl << indent()
-             << "$this->$methodname($rseqid, $input, $output);" << endl << indent()
-             << "return true;" << endl;
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  f_service_ << "}" << endl;
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_php_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  // Open function
-  indent(f_service_) << "protected function process_" << tfunction->get_name()
-                     << "($seqid, $input, $output) {" << endl;
-  indent_up();
-
-  string argsname = php_namespace(tservice->get_program()) + service_name_ + "_"
-                    + tfunction->get_name() + "_args";
-  string resultname = php_namespace(tservice->get_program()) + service_name_ + "_"
-                      + tfunction->get_name() + "_result";
-
-  f_service_ << indent() << "$args = new " << argsname << "();" << endl << indent()
-             << "$args->read($input);" << endl;
-  if (!binary_inline_) {
-    f_service_ << indent() << "$input->readMessageEnd();" << endl;
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "$result = new " << resultname << "();" << endl;
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
-    indent_up();
-  }
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_ << indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "$result->success = ";
-  }
-  f_service_ << "$this->handler_->" << tfunction->get_name() << "(";
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_service_ << ", ";
-    }
-    f_service_ << "$args->" << (*f_iter)->get_name();
-  }
-  f_service_ << ");" << endl;
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    indent_down();
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << indent() << "} catch ("
-                 << php_namespace(get_true_type((*x_iter)->get_type())->get_program())
-                 << (*x_iter)->get_type()->get_name() << " $" << (*x_iter)->get_name() << ") {"
-                 << endl;
-      if (!tfunction->is_oneway()) {
-        indent_up();
-        f_service_ << indent() << "$result->" << (*x_iter)->get_name() << " = $"
-                   << (*x_iter)->get_name() << ";" << endl;
-        indent_down();
-        f_service_ << indent();
-      }
-    }
-    f_service_ << "}" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-    return;
-  }
-
-  f_service_ << indent() << "$bin_accel = ($output instanceof "
-             << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');"
-             << endl;
-
-  f_service_ << indent() << "if ($bin_accel)" << endl;
-  scope_up(f_service_);
-
-  f_service_ << indent() << "thrift_protocol_write_binary($output, '" << tfunction->get_name()
-             << "', "
-             << "TMessageType::REPLY, $result, $seqid, $output->isStrictWrite());" << endl;
-
-  scope_down(f_service_);
-  f_service_ << indent() << "else" << endl;
-  scope_up(f_service_);
-
-  // Serialize the request header
-  if (binary_inline_) {
-    f_service_ << indent() << "$buff = pack('N', (0x80010000 | "
-               << "TMessageType::REPLY)); " << endl << indent() << "$buff .= pack('N', strlen('"
-               << tfunction->get_name() << "'));" << endl << indent() << "$buff .= '"
-               << tfunction->get_name() << "';" << endl << indent() << "$buff .= pack('N', $seqid);"
-               << endl << indent() << "$result->write($buff);" << endl << indent()
-               << "$output->write($buff);" << endl << indent() << "$output->flush();" << endl;
-  } else {
-    f_service_ << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', "
-               << "TMessageType::REPLY, $seqid);" << endl << indent() << "$result->write($output);"
-               << endl << indent() << "$output->writeMessageEnd();" << endl << indent()
-               << "$output->getTransport()->flush();" << endl;
-  }
-
-  scope_down(f_service_);
-
-  // Close function
-  indent_down();
-  f_service_ << indent() << "}" << endl;
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_php_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_ << "// HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    string name = ts->get_name();
-    ts->set_name(service_name_ + "_" + name);
-    generate_php_struct_definition(f_service_, ts);
-    generate_php_function_helpers(*f_iter);
-    ts->set_name(name);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_php_generator::generate_php_function_helpers(t_function* tfunction) {
-  if (!tfunction->is_oneway()) {
-    t_struct result(program_, service_name_ + "_" + tfunction->get_name() + "_result");
-    t_field success(tfunction->get_returntype(), "success", 0);
-    if (!tfunction->get_returntype()->is_void()) {
-      result.append(&success);
-    }
-
-    t_struct* xs = tfunction->get_xceptions();
-    const vector<t_field*>& fields = xs->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      result.append(*f_iter);
-    }
-
-    generate_php_struct_definition(f_service_, &result, false, true);
-  }
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_php_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_if = "";
-  if (tservice->get_extends() != NULL) {
-    extends = " extends " + php_namespace(tservice->get_extends()->get_program())
-              + tservice->get_extends()->get_name();
-    extends_if = " extends " + php_namespace(tservice->get_extends()->get_program())
-                 + tservice->get_extends()->get_name() + "If";
-  }
-  generate_php_doc(f_service_, tservice);
-  f_service_ << "interface " << php_namespace_declaration(tservice) << "If" << extends_if << " {"
-             << endl;
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_php_doc(f_service_, *f_iter);
-    indent(f_service_) << "public function " << function_signature(*f_iter) << ";" << endl;
-  }
-  indent_down();
-  f_service_ << "}" << endl << endl;
-}
-
-/**
- * Generates a REST interface
- */
-void t_php_generator::generate_service_rest(t_service* tservice) {
-  string extends = "";
-  string extends_if = "";
-  if (tservice->get_extends() != NULL) {
-    extends = " extends " + php_namespace(tservice->get_extends()->get_program())
-              + tservice->get_extends()->get_name();
-    extends_if = " extends " + php_namespace(tservice->get_extends()->get_program())
-                 + tservice->get_extends()->get_name() + "Rest";
-  }
-  f_service_ << "class " << service_name_ << "Rest" << extends_if << " {" << endl;
-  indent_up();
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected $impl_;" << endl << endl;
-  }
-
-  f_service_ << indent() << "public function __construct($impl) {" << endl << indent()
-             << "  $this->impl_ = $impl;" << endl << indent() << "}" << endl << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent(f_service_) << "public function " << (*f_iter)->get_name() << "($request) {" << endl;
-    indent_up();
-    const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
-      t_type* atype = get_true_type((*a_iter)->get_type());
-      string cast = type_to_cast(atype);
-      string req = "$request['" + (*a_iter)->get_name() + "']";
-      if (atype->is_bool()) {
-        f_service_ << indent() << "$" << (*a_iter)->get_name() << " = " << cast << "(!empty(" << req
-                   << ") && (" << req << " !== 'false'));" << endl;
-      } else {
-        f_service_ << indent() << "$" << (*a_iter)->get_name() << " = isset(" << req << ") ? "
-                   << cast << req << " : null;" << endl;
-      }
-      if (atype->is_string() && ((t_base_type*)atype)->is_string_list()) {
-        f_service_ << indent() << "$" << (*a_iter)->get_name() << " = explode(',', $"
-                   << (*a_iter)->get_name() << ");" << endl;
-      } else if (atype->is_map() || atype->is_list()) {
-        f_service_ << indent() << "$" << (*a_iter)->get_name() << " = json_decode($"
-                   << (*a_iter)->get_name() << ", true);" << endl;
-      } else if (atype->is_set()) {
-        f_service_ << indent() << "$" << (*a_iter)->get_name() << " = array_fill_keys(json_decode($"
-                   << (*a_iter)->get_name() << ", true), 1);" << endl;
-      } else if (atype->is_struct() || atype->is_xception()) {
-        f_service_ << indent() << "if ($" << (*a_iter)->get_name() << " !== null) {" << endl
-                   << indent() << "  $" << (*a_iter)->get_name() << " = new "
-                   << php_namespace(atype->get_program()) << atype->get_name() << "(json_decode($"
-                   << (*a_iter)->get_name() << ", true));" << endl << indent() << "}" << endl;
-      }
-    }
-    f_service_ << indent() << "return $this->impl_->" << (*f_iter)->get_name() << "("
-               << argument_list((*f_iter)->get_arglist(), false) << ");" << endl;
-    indent_down();
-    indent(f_service_) << "}" << endl << endl;
-  }
-  indent_down();
-  f_service_ << "}" << endl << endl;
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_php_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = tservice->get_extends()->get_name();
-    extends_client = " extends " + php_namespace(tservice->get_extends()->get_program()) + extends
-                     + "Client";
-  }
-
-  f_service_ << "class " << php_namespace_declaration(tservice) << "Client" << extends_client
-             << " implements " << php_namespace(tservice->get_program()) << service_name_ << "If {"
-             << endl;
-  indent_up();
-
-  // Private members
-  if (extends.empty()) {
-    f_service_ << indent() << "protected $input_ = null;" << endl << indent()
-               << "protected $output_ = null;" << endl << endl;
-    f_service_ << indent() << "protected $seqid_ = 0;" << endl << endl;
-  }
-
-  // Constructor function
-  f_service_ << indent() << "public function __construct($input, $output=null) {" << endl;
-  if (!extends.empty()) {
-    f_service_ << indent() << "  parent::__construct($input, $output);" << endl;
-  } else {
-    f_service_ << indent() << "  $this->input_ = $input;" << endl << indent()
-               << "  $this->output_ = $output ? $output : $input;" << endl;
-  }
-  f_service_ << indent() << "}" << endl << endl;
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    indent(f_service_) << "public function " << function_signature(*f_iter) << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "$this->send_" << funname << "(";
-
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "$" << (*fld_iter)->get_name();
-    }
-    f_service_ << ");" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "$this->recv_" << funname << "();" << endl;
-    }
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    indent(f_service_) << "public function send_" << function_signature(*f_iter) << endl;
-    scope_up(f_service_);
-
-    std::string argsname = php_namespace(tservice->get_program()) + service_name_ + "_"
-                           + (*f_iter)->get_name() + "_args";
-
-    f_service_ << indent() << "$args = new " << argsname << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "$args->" << (*fld_iter)->get_name() << " = $"
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    f_service_ << indent() << "$bin_accel = ($this->output_ instanceof "
-               << "TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');"
-               << endl;
-
-    f_service_ << indent() << "if ($bin_accel)" << endl;
-    scope_up(f_service_);
-
-    string messageType = (*f_iter)->is_oneway() ? "TMessageType::ONEWAY" : "TMessageType::CALL";
-
-    f_service_ << indent() << "thrift_protocol_write_binary($this->output_, '"
-               << (*f_iter)->get_name() << "', " << messageType
-               << ", $args, $this->seqid_, $this->output_->isStrictWrite());" << endl;
-
-    scope_down(f_service_);
-    f_service_ << indent() << "else" << endl;
-    scope_up(f_service_);
-
-    // Serialize the request header
-    if (binary_inline_) {
-      f_service_ << indent() << "$buff = pack('N', (0x80010000 | " << messageType << "));" << endl
-                 << indent() << "$buff .= pack('N', strlen('" << funname << "'));" << endl
-                 << indent() << "$buff .= '" << funname << "';" << endl << indent()
-                 << "$buff .= pack('N', $this->seqid_);" << endl;
-    } else {
-      f_service_ << indent() << "$this->output_->writeMessageBegin('" << (*f_iter)->get_name()
-                 << "', " << messageType << ", $this->seqid_);" << endl;
-    }
-
-    // Write to the stream
-    if (binary_inline_) {
-      f_service_ << indent() << "$args->write($buff);" << endl << indent()
-                 << "$this->output_->write($buff);" << endl << indent()
-                 << "$this->output_->flush();" << endl;
-    } else {
-      f_service_ << indent() << "$args->write($this->output_);" << endl << indent()
-                 << "$this->output_->writeMessageEnd();" << endl << indent()
-                 << "$this->output_->getTransport()->flush();" << endl;
-    }
-
-    scope_down(f_service_);
-
-    scope_down(f_service_);
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = php_namespace(tservice->get_program()) + service_name_ + "_"
-                               + (*f_iter)->get_name() + "_result";
-      t_struct noargs(program_);
-
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs);
-      // Open function
-      f_service_ << endl << indent() << "public function " << function_signature(&recv_function)
-                 << endl;
-      scope_up(f_service_);
-
-      f_service_ << indent() << "$bin_accel = ($this->input_ instanceof "
-                 << "TBinaryProtocolAccelerated)"
-                 << " && function_exists('thrift_protocol_read_binary');" << endl;
-
-      f_service_ << indent()
-                 << "if ($bin_accel) $result = thrift_protocol_read_binary($this->input_, '"
-                 << resultname << "', $this->input_->isStrictRead());" << endl;
-      f_service_ << indent() << "else" << endl;
-      scope_up(f_service_);
-
-      f_service_ << indent() << "$rseqid = 0;" << endl << indent() << "$fname = null;" << endl
-                 << indent() << "$mtype = 0;" << endl << endl;
-
-      if (binary_inline_) {
-        t_field ffname(g_type_string, "fname");
-        t_field fseqid(g_type_i32, "rseqid");
-        f_service_ << indent() << "$ver = unpack('N', $this->input_->readAll(4));" << endl
-                   << indent() << "$ver = $ver[1];" << endl << indent() << "$mtype = $ver & 0xff;"
-                   << endl << indent() << "$ver = $ver & 0xffff0000;" << endl << indent()
-                   << "if ($ver != 0x80010000) throw new "
-                   << "TProtocolException('Bad version identifier: '.$ver, "
-                   << "TProtocolException::BAD_VERSION);" << endl;
-        generate_deserialize_field(f_service_, &ffname, "", true);
-        generate_deserialize_field(f_service_, &fseqid, "", true);
-      } else {
-        f_service_ << indent() << "$this->input_->readMessageBegin($fname, $mtype, $rseqid);"
-                   << endl << indent() << "if ($mtype == "
-                   << "TMessageType::EXCEPTION) {" << endl << indent() << "  $x = new "
-                   << "TApplicationException();" << endl << indent() << "  $x->read($this->input_);"
-                   << endl << indent() << "  $this->input_->readMessageEnd();" << endl << indent()
-                   << "  throw $x;" << endl << indent() << "}" << endl;
-      }
-
-      f_service_ << indent() << "$result = new " << resultname << "();" << endl << indent()
-                 << "$result->read($this->input_);" << endl;
-
-      if (!binary_inline_) {
-        f_service_ << indent() << "$this->input_->readMessageEnd();" << endl;
-      }
-
-      scope_down(f_service_);
-
-      // Careful, only return result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if ($result->success !== null) {" << endl << indent()
-                   << "  return $result->success;" << endl << indent() << "}" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if ($result->" << (*x_iter)->get_name() << " !== null) {" << endl
-                   << indent() << "  throw $result->" << (*x_iter)->get_name() << ";" << endl
-                   << indent() << "}" << endl;
-      }
-
-      // Careful, only return _result if not a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
-      } else {
-        f_service_ << indent() << "throw new \\Exception(\"" << (*f_iter)->get_name()
-                   << " failed: unknown result\");" << endl;
-      }
-
-      // Close function
-      scope_down(f_service_);
-      f_service_ << endl;
-    }
-  }
-
-  indent_down();
-  f_service_ << "}" << endl << endl;
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_php_generator::generate_deserialize_field(ofstream& out,
-                                                 t_field* tfield,
-                                                 string prefix,
-                                                 bool inclass) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else {
-
-    if (type->is_container()) {
-      generate_deserialize_container(out, type, name);
-    } else if (type->is_base_type() || type->is_enum()) {
-
-      if (binary_inline_) {
-        std::string itrans = (inclass ? "$this->input_" : "$input");
-
-        if (type->is_base_type()) {
-          t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-          switch (tbase) {
-          case t_base_type::TYPE_VOID:
-            throw "compiler error: cannot serialize void field in a struct: " + name;
-            break;
-          case t_base_type::TYPE_STRING:
-            out << indent() << "$len = unpack('N', " << itrans << "->readAll(4));" << endl
-                << indent() << "$len = $len[1];" << endl << indent() << "if ($len > 0x7fffffff) {"
-                << endl << indent() << "  $len = 0 - (($len - 1) ^ 0xffffffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = " << itrans << "->readAll($len);"
-                << endl;
-            break;
-          case t_base_type::TYPE_BOOL:
-            out << indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));"
-                << endl << indent() << "$" << name << " = (bool)$" << name << "[1];" << endl;
-            break;
-          case t_base_type::TYPE_BYTE:
-            out << indent() << "$" << name << " = unpack('c', " << itrans << "->readAll(1));"
-                << endl << indent() << "$" << name << " = $" << name << "[1];" << endl;
-            break;
-          case t_base_type::TYPE_I16:
-            out << indent() << "$val = unpack('n', " << itrans << "->readAll(2));" << endl
-                << indent() << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fff) {"
-                << endl << indent() << "  $val = 0 - (($val - 1) ^ 0xffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = $val;" << endl;
-            break;
-          case t_base_type::TYPE_I32:
-            out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << endl
-                << indent() << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fffffff) {"
-                << endl << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << endl << indent()
-                << "}" << endl << indent() << "$" << name << " = $val;" << endl;
-            break;
-          case t_base_type::TYPE_I64:
-            out << indent() << "$arr = unpack('N2', " << itrans << "->readAll(8));" << endl
-                << indent() << "if ($arr[1] & 0x80000000) {" << endl << indent()
-                << "  $arr[1] = $arr[1] ^ 0xFFFFFFFF;" << endl << indent()
-                << "  $arr[2] = $arr[2] ^ 0xFFFFFFFF;" << endl << indent() << "  $" << name
-                << " = 0 - $arr[1]*4294967296 - $arr[2] - 1;" << endl << indent() << "} else {"
-                << endl << indent() << "  $" << name << " = $arr[1]*4294967296 + $arr[2];" << endl
-                << indent() << "}" << endl;
-            break;
-          case t_base_type::TYPE_DOUBLE:
-            out << indent() << "$arr = unpack('d', strrev(" << itrans << "->readAll(8)));" << endl
-                << indent() << "$" << name << " = $arr[1];" << endl;
-            break;
-          default:
-            throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase)
-                + tfield->get_name();
-          }
-        } else if (type->is_enum()) {
-          out << indent() << "$val = unpack('N', " << itrans << "->readAll(4));" << endl << indent()
-              << "$val = $val[1];" << endl << indent() << "if ($val > 0x7fffffff) {" << endl
-              << indent() << "  $val = 0 - (($val - 1) ^ 0xffffffff);" << endl << indent() << "}"
-              << endl << indent() << "$" << name << " = $val;" << endl;
-        }
-      } else {
-
-        indent(out) << "$xfer += $input->";
-
-        if (type->is_base_type()) {
-          t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-          switch (tbase) {
-          case t_base_type::TYPE_VOID:
-            throw "compiler error: cannot serialize void field in a struct: " + name;
-            break;
-          case t_base_type::TYPE_STRING:
-            out << "readString($" << name << ");";
-            break;
-          case t_base_type::TYPE_BOOL:
-            out << "readBool($" << name << ");";
-            break;
-          case t_base_type::TYPE_BYTE:
-            out << "readByte($" << name << ");";
-            break;
-          case t_base_type::TYPE_I16:
-            out << "readI16($" << name << ");";
-            break;
-          case t_base_type::TYPE_I32:
-            out << "readI32($" << name << ");";
-            break;
-          case t_base_type::TYPE_I64:
-            out << "readI64($" << name << ");";
-            break;
-          case t_base_type::TYPE_DOUBLE:
-            out << "readDouble($" << name << ");";
-            break;
-          default:
-            throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
-          }
-        } else if (type->is_enum()) {
-          out << "readI32($" << name << ");";
-        }
-        out << endl;
-      }
-    } else {
-      printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-             tfield->get_name().c_str(),
-             type->get_name().c_str());
-    }
-  }
-}
-
-/**
- * Generates an unserializer for a variable. This makes two key assumptions,
- * first that there is a const char* variable named data that points to the
- * buffer for deserialization, and that there is a variable protocol which
- * is a reference to a TProtocol serialization object.
- */
-void t_php_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  out << indent() << "$" << prefix << " = new " << php_namespace(tstruct->get_program())
-      << tstruct->get_name() << "();" << endl << indent() << "$xfer += $" << prefix
-      << "->read($input);" << endl;
-}
-
-void t_php_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  out << indent() << "$" << prefix << " = array();" << endl << indent() << "$" << size << " = 0;"
-      << endl;
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    out << indent() << "$" << ktype << " = 0;" << endl << indent() << "$" << vtype << " = 0;"
-        << endl;
-    if (binary_inline_) {
-      generate_deserialize_field(out, &fktype);
-      generate_deserialize_field(out, &fvtype);
-      generate_deserialize_field(out, &fsize);
-    } else {
-      out << indent() << "$xfer += $input->readMapBegin("
-          << "$" << ktype << ", $" << vtype << ", $" << size << ");" << endl;
-    }
-  } else if (ttype->is_set()) {
-    if (binary_inline_) {
-      generate_deserialize_field(out, &fetype);
-      generate_deserialize_field(out, &fsize);
-    } else {
-      out << indent() << "$" << etype << " = 0;" << endl << indent()
-          << "$xfer += $input->readSetBegin("
-          << "$" << etype << ", $" << size << ");" << endl;
-    }
-  } else if (ttype->is_list()) {
-    if (binary_inline_) {
-      generate_deserialize_field(out, &fetype);
-      generate_deserialize_field(out, &fsize);
-    } else {
-      out << indent() << "$" << etype << " = 0;" << endl << indent()
-          << "$xfer += $input->readListBegin("
-          << "$" << etype << ", $" << size << ");" << endl;
-    }
-  }
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for ($" << i << " = 0; $" << i << " < $" << size << "; ++$" << i << ")" << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  if (!binary_inline_) {
-    // Read container end
-    if (ttype->is_map()) {
-      indent(out) << "$xfer += $input->readMapEnd();" << endl;
-    } else if (ttype->is_set()) {
-      indent(out) << "$xfer += $input->readSetEnd();" << endl;
-    } else if (ttype->is_list()) {
-      indent(out) << "$xfer += $input->readListEnd();" << endl;
-    }
-  }
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_php_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("key");
-  string val = tmp("val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey, true, true) << endl;
-  indent(out) << declare_field(&fval, true, true) << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << "$" << prefix << "[$" << key << "] = $" << val << ";" << endl;
-}
-
-void t_php_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << "$" << elem << " = null;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << "if (is_scalar($" << elem << ")) {" << endl;
-  indent(out) << "  $" << prefix << "[$" << elem << "] = true;" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  $" << prefix << " []= $" << elem << ";" << endl;
-  indent(out) << "}" << endl;
-}
-
-void t_php_generator::generate_deserialize_list_element(ofstream& out,
-                                                        t_list* tlist,
-                                                        string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << "$" << elem << " = null;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << "$" << prefix << " []= $" << elem << ";" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_php_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + tfield->get_name());
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + tfield->get_name());
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = prefix + tfield->get_name();
-
-    if (binary_inline_) {
-      if (type->is_base_type()) {
-        t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-        switch (tbase) {
-        case t_base_type::TYPE_VOID:
-          throw "compiler error: cannot serialize void field in a struct: " + name;
-          break;
-        case t_base_type::TYPE_STRING:
-          out << indent() << "$output .= pack('N', strlen($" << name << "));" << endl << indent()
-              << "$output .= $" << name << ";" << endl;
-          break;
-        case t_base_type::TYPE_BOOL:
-          out << indent() << "$output .= pack('c', $" << name << " ? 1 : 0);" << endl;
-          break;
-        case t_base_type::TYPE_BYTE:
-          out << indent() << "$output .= pack('c', $" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_I16:
-          out << indent() << "$output .= pack('n', $" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_I32:
-          out << indent() << "$output .= pack('N', $" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_I64:
-          out << indent() << "$output .= pack('N2', $" << name << " >> 32, $" << name
-              << " & 0xFFFFFFFF);" << endl;
-          break;
-        case t_base_type::TYPE_DOUBLE:
-          out << indent() << "$output .= strrev(pack('d', $" << name << "));" << endl;
-          break;
-        default:
-          throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
-        }
-      } else if (type->is_enum()) {
-        out << indent() << "$output .= pack('N', $" << name << ");" << endl;
-      }
-    } else {
-
-      indent(out) << "$xfer += $output->";
-
-      if (type->is_base_type()) {
-        t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-        switch (tbase) {
-        case t_base_type::TYPE_VOID:
-          throw "compiler error: cannot serialize void field in a struct: " + name;
-          break;
-        case t_base_type::TYPE_STRING:
-          out << "writeString($" << name << ");";
-          break;
-        case t_base_type::TYPE_BOOL:
-          out << "writeBool($" << name << ");";
-          break;
-        case t_base_type::TYPE_BYTE:
-          out << "writeByte($" << name << ");";
-          break;
-        case t_base_type::TYPE_I16:
-          out << "writeI16($" << name << ");";
-          break;
-        case t_base_type::TYPE_I32:
-          out << "writeI32($" << name << ");";
-          break;
-        case t_base_type::TYPE_I64:
-          out << "writeI64($" << name << ");";
-          break;
-        case t_base_type::TYPE_DOUBLE:
-          out << "writeDouble($" << name << ");";
-          break;
-        default:
-          throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
-        }
-      } else if (type->is_enum()) {
-        out << "writeI32($" << name << ");";
-      }
-      out << endl;
-    }
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_php_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << "$xfer += $" << prefix << "->write($output);" << endl;
-}
-
-/**
- * Writes out a container
- */
-void t_php_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    if (binary_inline_) {
-      out << indent() << "$output .= pack('c', " << type_to_enum(((t_map*)ttype)->get_key_type())
-          << ");" << endl << indent() << "$output .= pack('c', "
-          << type_to_enum(((t_map*)ttype)->get_val_type()) << ");" << endl << indent()
-          << "$output .= strrev(pack('l', count($" << prefix << ")));" << endl;
-    } else {
-      indent(out) << "$output->writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type())
-                  << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                  << "count($" << prefix << "));" << endl;
-    }
-  } else if (ttype->is_set()) {
-    if (binary_inline_) {
-      out << indent() << "$output .= pack('c', " << type_to_enum(((t_set*)ttype)->get_elem_type())
-          << ");" << endl << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
-          << endl;
-
-    } else {
-      indent(out) << "$output->writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                  << ", "
-                  << "count($" << prefix << "));" << endl;
-    }
-  } else if (ttype->is_list()) {
-    if (binary_inline_) {
-      out << indent() << "$output .= pack('c', " << type_to_enum(((t_list*)ttype)->get_elem_type())
-          << ");" << endl << indent() << "$output .= strrev(pack('l', count($" << prefix << ")));"
-          << endl;
-
-    } else {
-      indent(out) << "$output->writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                  << ", "
-                  << "count($" << prefix << "));" << endl;
-    }
-  }
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    string kiter = tmp("kiter");
-    string viter = tmp("viter");
-    indent(out) << "foreach ($" << prefix << " as "
-                << "$" << kiter << " => $" << viter << ")" << endl;
-    scope_up(out);
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    scope_down(out);
-  } else if (ttype->is_set()) {
-    string iter = tmp("iter");
-    string iter_val = tmp("iter");
-    indent(out) << "foreach ($" << prefix << " as $" << iter << " => $" << iter_val << ")" << endl;
-    scope_up(out);
-    indent(out) << "if (is_scalar($" << iter_val << ")) {" << endl;
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    indent(out) << "} else {" << endl;
-    generate_serialize_set_element(out, (t_set*)ttype, iter_val);
-    indent(out) << "}" << endl;
-    scope_down(out);
-  } else if (ttype->is_list()) {
-    string iter = tmp("iter");
-    indent(out) << "foreach ($" << prefix << " as $" << iter << ")" << endl;
-    scope_up(out);
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    scope_down(out);
-  }
-
-  scope_down(out);
-
-  if (!binary_inline_) {
-    if (ttype->is_map()) {
-      indent(out) << "$output->writeMapEnd();" << endl;
-    } else if (ttype->is_set()) {
-      indent(out) << "$output->writeSetEnd();" << endl;
-    } else if (ttype->is_list()) {
-      indent(out) << "$output->writeListEnd();" << endl;
-    }
-  }
-
-  scope_down(out);
-}
-
-/**
- * Serializes the members of a map.
- *
- */
-void t_php_generator::generate_serialize_map_element(ofstream& out,
-                                                     t_map* tmap,
-                                                     string kiter,
-                                                     string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield, "");
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield, "");
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_php_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_php_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Emits a PHPDoc comment for the given contents
- */
-void t_php_generator::generate_php_docstring_comment(ofstream& out, string contents) {
-  generate_docstring_comment(out, "/**\n", " * ", contents, " */\n");
-}
-
-/**
- * Emits a PHPDoc comment if the provided object has a doc in Thrift
- */
-void t_php_generator::generate_php_doc(ofstream& out, t_doc* tdoc) {
-  if (tdoc->has_doc()) {
-    generate_php_docstring_comment(out, tdoc->get_doc());
-  }
-}
-
-/**
- * Emits a PHPDoc comment for a field
- */
-void t_php_generator::generate_php_doc(ofstream& out, t_field* field) {
-  stringstream ss;
-
-  // prepend free-style doc if available
-  if (field->has_doc()) {
-    ss << field->get_doc() << endl;
-  }
-
-  // append @var tag
-  t_type* type = get_true_type(field->get_type());
-  ss << "@var " << type_to_phpdoc(type) << endl;
-
-  generate_php_docstring_comment(out, ss.str());
-}
-
-/**
- * Emits a PHPDoc comment for a function
- */
-void t_php_generator::generate_php_doc(ofstream& out, t_function* function) {
-  stringstream ss;
-  if (function->has_doc()) {
-    ss << function->get_doc() << endl;
-  }
-
-  // generate parameter types doc
-  const vector<t_field*>& args = function->get_arglist()->get_members();
-  vector<t_field*>::const_iterator a_iter;
-  for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
-    t_field* arg = *a_iter;
-    ss << "@param " << type_to_phpdoc(arg->get_type()) << " $" << arg->get_name();
-    if (arg->has_doc()) {
-      ss << " " << arg->get_doc();
-    }
-    ss << endl;
-  }
-
-  // generate return type doc
-  t_type* ret_type = function->get_returntype();
-  if (!ret_type->is_void() || ret_type->has_doc()) {
-    ss << "@return " << type_to_phpdoc(ret_type);
-    if (ret_type->has_doc()) {
-      ss << " " << ret_type->get_doc();
-    }
-    ss << endl;
-  }
-
-  // generate exceptions doc
-  const vector<t_field*>& excs = function->get_xceptions()->get_members();
-  vector<t_field*>::const_iterator e_iter;
-  for (e_iter = excs.begin(); e_iter != excs.end(); ++e_iter) {
-    t_field* exc = *e_iter;
-    ss << "@throws " << type_to_phpdoc(exc->get_type());
-    if (exc->has_doc()) {
-      ss << " " << exc->get_doc();
-    }
-    ss << endl;
-  }
-
-  generate_docstring_comment(out, "/**\n", " * ", ss.str(), " */\n");
-}
-
-/**
- * Declares a field, which may include initialization as necessary.
- *
- * @param ttype The type
- */
-string t_php_generator::declare_field(t_field* tfield, bool init, bool obj) {
-  string result = "$" + tfield->get_name();
-  if (init) {
-    t_type* type = get_true_type(tfield->get_type());
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        break;
-      case t_base_type::TYPE_STRING:
-        result += " = ''";
-        break;
-      case t_base_type::TYPE_BOOL:
-        result += " = false";
-        break;
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-        result += " = 0";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        result += " = 0.0";
-        break;
-      default:
-        throw "compiler error: no PHP initializer for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      result += " = 0";
-    } else if (type->is_container()) {
-      result += " = array()";
-    } else if (type->is_struct() || type->is_xception()) {
-      if (obj) {
-        result += " = new " + php_namespace(type->get_program()) + type->get_name() + "()";
-      } else {
-        result += " = null";
-      }
-    }
-  }
-  return result + ";";
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_php_generator::function_signature(t_function* tfunction, string prefix) {
-  return prefix + tfunction->get_name() + "(" + argument_list(tfunction->get_arglist()) + ")";
-}
-
-/**
- * Renders a field list
- */
-string t_php_generator::argument_list(t_struct* tstruct, bool addTypeHints) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-
-    t_type* type = (*f_iter)->get_type();
-
-    // Set type name
-    if (addTypeHints) {
-      if (type->is_struct()) {
-        string className = php_namespace(type->get_program())
-                           + php_namespace_directory("Definition", false)
-                           + classify(type->get_name());
-
-        result += className + " ";
-      } else if (type->is_container()) {
-        result += "array ";
-      }
-    }
-
-    result += "$" + (*f_iter)->get_name();
-  }
-  return result;
-}
-
-/**
- * Gets a typecast string for a particular type.
- */
-string t_php_generator::type_to_cast(t_type* type) {
-  if (type->is_base_type()) {
-    t_base_type* btype = (t_base_type*)type;
-    switch (btype->get_base()) {
-    case t_base_type::TYPE_BOOL:
-      return "(bool)";
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      return "(int)";
-    case t_base_type::TYPE_DOUBLE:
-      return "(double)";
-    case t_base_type::TYPE_STRING:
-      return "(string)";
-    default:
-      return "";
-    }
-  } else if (type->is_enum()) {
-    return "(int)";
-  }
-  return "";
-}
-
-/**
- * Converts the parse type to a C++ enum string for the given type.
- */
-string t_php_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType::STRING";
-    case t_base_type::TYPE_BOOL:
-      return "TType::BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "TType::BYTE";
-    case t_base_type::TYPE_I16:
-      return "TType::I16";
-    case t_base_type::TYPE_I32:
-      return "TType::I32";
-    case t_base_type::TYPE_I64:
-      return "TType::I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType::DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "TType::I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType::STRUCT";
-  } else if (type->is_map()) {
-    return "TType::MAP";
-  } else if (type->is_set()) {
-    return "TType::SET";
-  } else if (type->is_list()) {
-    return "TType::LST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Converts the parse type to a PHPDoc string for the given type.
- */
-string t_php_generator::type_to_phpdoc(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "void";
-    case t_base_type::TYPE_STRING:
-      return "string";
-    case t_base_type::TYPE_BOOL:
-      return "bool";
-    case t_base_type::TYPE_BYTE:
-      return "int";
-    case t_base_type::TYPE_I16:
-      return "int";
-    case t_base_type::TYPE_I32:
-      return "int";
-    case t_base_type::TYPE_I64:
-      return "int";
-    case t_base_type::TYPE_DOUBLE:
-      return "double";
-    }
-  } else if (type->is_enum()) {
-    return "int";
-  } else if (type->is_struct() || type->is_xception()) {
-    return php_namespace

<TRUNCATED>


[46/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/ThriftMacros.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/ThriftMacros.cmake b/depends/thirdparty/thrift/build/cmake/ThriftMacros.cmake
deleted file mode 100644
index 2656598..0000000
--- a/depends/thirdparty/thrift/build/cmake/ThriftMacros.cmake
+++ /dev/null
@@ -1,94 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
-
-
-macro(ADD_LIBRARY_THRIFT name)
-
-if(WITH_SHARED_LIB)
-    add_library(${name} SHARED ${ARGN})
-    #target_link_libraries(${name} ${SYSLIBS})
-    set_target_properties(${name} PROPERTIES
-        OUTPUT_NAME ${name}
-        VERSION ${thrift_VERSION}
-        SOVERSION ${thrift_VERSION} )
-    #set_target_properties(${name} PROPERTIES PUBLIC_HEADER "${thriftcpp_HEADERS}")
-    install(TARGETS ${name}
-        RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
-        LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
-        ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
-        PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
-endif()
-
-if(WITH_STATIC_LIB)
-    add_library(${name}_static STATIC ${ARGN})
-    #target_link_libraries(${name}_static ${SYSLIBS})
-    set_target_properties(${name}_static PROPERTIES
-        OUTPUT_NAME ${name}${STATIC_POSTFIX}
-        VERSION ${thrift_VERSION}
-        SOVERSION ${thrift_VERSION} )
-    install(TARGETS ${name}_static
-        RUNTIME DESTINATION "${BIN_INSTALL_DIR}"
-        LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
-        ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
-        PUBLIC_HEADER DESTINATION "${INCLUDE_INSTALL_DIR}")
-endif()
-
-endmacro(ADD_LIBRARY_THRIFT)
-
-
-macro(TARGET_LINK_LIBRARIES_THRIFT name)
-
-if(WITH_SHARED_LIB)
-    target_link_libraries(${name} ${ARGN})
-endif()
-
-if(WITH_STATIC_LIB)
-    target_link_libraries(${name}_static ${ARGN})
-endif()
-
-endmacro(TARGET_LINK_LIBRARIES_THRIFT)
-
-
-macro(LINK_AGAINST_THRIFT_LIBRARY target libname)
-
-if (WITH_SHARED_LIB)
-    target_link_libraries(${target} ${libname})
-elseif (WITH_STATIC_LIB)
-    target_link_libraries(${target} ${libname}_static)
-else()
-    message(FATAL "Not linking with shared or static libraries?")
-endif()
-
-endmacro(LINK_AGAINST_THRIFT_LIBRARY)
-
-
-macro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY target libname)
-
-if(WITH_SHARED_LIB)
-    target_link_libraries(${target} ${libname})
-endif()
-
-if(WITH_STATIC_LIB)
-    target_link_libraries(${target}_static ${libname}_static)
-endif()
-
-endmacro(TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/config.h.in
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/config.h.in b/depends/thirdparty/thrift/build/cmake/config.h.in
deleted file mode 100644
index 181ea18..0000000
--- a/depends/thirdparty/thrift/build/cmake/config.h.in
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* config.h generated by CMake from config.h.in */
-
-#ifndef CONFIG_H
-#define CONFIG_H
-
-
-/* Name of package */
-#cmakedefine PACKAGE "${PACKAGE}"
-
-/* Define to the address where bug reports for this package should be sent. */
-#cmakedefine PACKAGE_BUGREPORT "${PACKAGE_BUGREPORT}"
-
-/* Define to the full name of this package. */
-#cmakedefine PACKAGE_NAME "${PACKAGE_NAME}"
-
-/* Define to the one symbol short name of this package. */
-#cmakedefine PACKAGE_TARNAME "${PACKAGE_TARNAME}"
-
-/* Define to the home page for this package. */
-#cmakedefine PACKAGE_URL "${PACKAGE_URL}"
-
-/* Define to the version of this package. */
-#define PACKAGE_VERSION "${PACKAGE_VERSION}"
-
-/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "${PACKAGE_STRING}"
-
-/* Version number of package */
-#define VERSION "${VERSION}"
-
-/************************** DEFINES *************************/
-
-/* Define if the AI_ADDRCONFIG symbol is unavailable */
-#cmakedefine AI_ADDRCONFIG 0
-
-/* Possible value for SIGNED_RIGHT_SHIFT_IS */
-/* TODO: This is just set to 1 for the moment
-   port the macro aclocal/ax_signed_right_shift.m4 to CMake to make this work */
-#define ARITHMETIC_RIGHT_SHIFT 1
-
-/* Indicates the effect of the right shift operator on negative signed
-   integers */
-/* TODO: This is just set to 1 for the moment */
-#define SIGNED_RIGHT_SHIFT_IS 1
-
-/* Use *.h extension for parser header file */
-/* TODO: This might now be necessary anymore as it is set only for automake < 1.11
-   see: aclocal/ac_prog_bison.m4 */
-#cmakedefine BISON_USE_PARSER_H_EXTENSION 1
-
-/* replaces POSIX pthread by boost::thread */
-#cmakedefine USE_BOOST_THREAD 1
-
-/* replaces POSIX pthread by std::thread */
-#cmakedefine USE_STD_THREAD 1
-
-/* Define to 1 if strerror_r returns char *. */
-#cmakedefine STRERROR_R_CHAR_P 1
-
-
-/************************** HEADER FILES *************************/
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#cmakedefine HAVE_ARPA_INET_H 1
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#cmakedefine HAVE_FCNTL_H 1
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#cmakedefine HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <netdb.h> header file. */
-#cmakedefine HAVE_NETDB_H 1
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#cmakedefine HAVE_NETINET_IN_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H 1
-
-/* Define to 1 if you have the <pthread.h> header file. */
-#cmakedefine HAVE_PTHREAD_H 1
-
-/* Define to 1 if you have the <sys/time.h> header file. */
-#cmakedefine HAVE_SYS_TIME_H 1
-
-/* Define to 1 if you have the <sys/param.h> header file. */
-#cmakedefine HAVE_SYS_PARAM_H 1
-
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#cmakedefine HAVE_SYS_RESOURCE_H 1
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#cmakedefine HAVE_SYS_SOCKET_H 1
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#cmakedefine HAVE_SYS_STAT_H 1
-
-/* Define to 1 if you have the <sys/un.h> header file. */
-#cmakedefine HAVE_SYS_UN_H 1
-
-/* Define to 1 if you have the <sys/poll.h> header file. */
-#cmakedefine HAVE_SYS_POLL_H 1
-
-/* Define to 1 if you have the <sys/select.h> header file. */
-#cmakedefine HAVE_SYS_SELECT_H 1
-
-/* Define to 1 if you have the <sched.h> header file. */
-#cmakedefine HAVE_SCHED_H 1
-
-/* Define to 1 if you have the <strings.h> header file. */
-#define HAVE_STRINGS_H 1
-
-/*************************** FUNCTIONS ***************************/
-
-/* Define to 1 if you have the `gethostbyname' function. */
-#cmakedefine HAVE_GETHOSTBYNAME 1
-
-/* Define to 1 if you have the `gethostbyname_r' function. */
-#cmakedefine HAVE_GETHOSTBYNAME_R 1
-
-/* Define to 1 if you have the `strerror_r' function. */
-#cmakedefine HAVE_STRERROR_R 1
-
-/* Define to 1 if you have the `sched_get_priority_max' function. */
-#cmakedefine HAVE_SCHED_GET_PRIORITY_MAX 1
-
-/* Define to 1 if you have the `sched_get_priority_min' function. */
-#cmakedefine HAVE_SCHED_GET_PRIORITY_MIN 1
-
-
-/* Define to 1 if strerror_r returns char *. */
-#cmakedefine STRERROR_R_CHAR_P 1
-
-#endif
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/mingw32-toolchain.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/mingw32-toolchain.cmake b/depends/thirdparty/thrift/build/cmake/mingw32-toolchain.cmake
deleted file mode 100644
index 864c0eb..0000000
--- a/depends/thirdparty/thrift/build/cmake/mingw32-toolchain.cmake
+++ /dev/null
@@ -1,24 +0,0 @@
-# CMake mingw32 cross compile toolchain file
-
-# the name of the target operating system
-SET(CMAKE_SYSTEM_NAME Windows)
-
-# which compilers to use for C and C++
-SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc)
-SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++)
-SET(CMAKE_RC_COMPILER i586-mingw32msvc-windres)
-
-# here is the target environment located
-SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc)
-
-# adjust the default behaviour of the FIND_XXX() commands:
-# search headers and libraries in the target environment, search
-# programs in the host environment
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-
-set(BUILD_SHARED_LIBS OFF)
-SET(CMAKE_EXE_LINKER_FLAGS "-static")
-set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} "-static-libgcc")
-set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-static-libstdc++")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/docker/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/docker/README.md b/depends/thirdparty/thrift/build/docker/README.md
deleted file mode 100644
index 3712653..0000000
--- a/depends/thirdparty/thrift/build/docker/README.md
+++ /dev/null
@@ -1,27 +0,0 @@
-# Apache Thrift Docker containers
-A set of docker containers used to build and test Apache Thrift
-
-### Available Containers
-
-* Ubuntu - based on ubuntu:trusty (14.04)
-* Centos - based on centos:6.6
-
-## Dependencies
-
-* A working Docker environment. A Vagrantfile is provided which will setup an Ubuntu host and working Docker environment as well as build the Apache Thrift Docker container for testing and development
-
-## Usage
-From the Apache Thrift code base root
-
-* Build
-
-	docker build -t thrift build/docker/ubuntu
-
-	or
-
-	docker build -t thrift build/docker/centos
-
-* Run
-
-	docker run -v $(pwd):/thrift -it thrift /bin/bash
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/docker/Vagrantfile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/docker/Vagrantfile b/depends/thirdparty/thrift/build/docker/Vagrantfile
deleted file mode 100644
index 5eac6e6..0000000
--- a/depends/thirdparty/thrift/build/docker/Vagrantfile
+++ /dev/null
@@ -1,59 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Base system bootstrap script
-$bootstrap_script = <<__BOOTSTRAP__
-echo "Provisioning defaults"
-
-sudo apt-get update -y
-sudo apt-get upgrade -y
-
-# Install default packages
-sudo apt-get install -y build-essential curl git
-
-# Install latest Docker version
-sudo curl -sSL https://get.docker.io/gpg | sudo apt-key add -
-sudo echo "deb http://get.docker.io/ubuntu docker main" > /etc/apt/sources.list.d/docker.list
-sudo apt-get update -y
-sudo apt-get install -y linux-image-extra-`uname -r` aufs-tools
-sudo apt-get install -y lxc-docker
-
-echo "Finished provisioning defaults"
-__BOOTSTRAP__
-
-Vagrant.configure("2") do |config|
-  config.vm.box = "trusty64"
-  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
-  config.ssh.forward_agent = true
-
-  config.vm.provider :virtualbox do |vbox|
-    vbox.customize ["modifyvm", :id, "--memory", "1024"]
-    vbox.customize ["modifyvm", :id, "--cpus", "2"]
-  end
-
-  # Setup the default bootstrap script for our ubuntu base box image
-  config.vm.provision "shell", inline: $bootstrap_script
-
-  # Setup the custom docker image from our Ubuntu Dockerfile
-  config.vm.provision "docker" do |d|
-    d.build_image "/vagrant/ubuntu", args: "-t thrift"
-  end
-
-  # Setup the custom docker image from our Centos Dockerfile
-  #config.vm.provision "docker" do |d|
-  #  d.build_image "/vagrant/centos", args: "-t thrift-centos"
-  #end
-
-end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/docker/centos/Dockerfile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/docker/centos/Dockerfile b/depends/thirdparty/thrift/build/docker/centos/Dockerfile
deleted file mode 100644
index c4c273c..0000000
--- a/depends/thirdparty/thrift/build/docker/centos/Dockerfile
+++ /dev/null
@@ -1,96 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Apache Thrift Docker build environment for Centos
-#
-# Known missing client libraries:
-#  - D
-#  - Haxe
-#  - Lua
-#
-
-FROM centos:7
-MAINTAINER Apache Thrift <de...@thrift.apache.org>
-
-ENV HOME /root
-
-# RUN yum -y update
-
-# General dependencies
-RUN yum -y install -y tar m4 perl gcc git libtool zlib-devel openssl-devel autoconf make bison bison-devel flex
-
-RUN mkdir -p /tmp/epel && \
-    curl -sSL "http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm" -o /tmp/epel/epel-release-7-5.noarch.rpm && \
-    cd /tmp/epel && \
-    rpm -ivh epel-release*.rpm && \
-    cd $HOME
-
-# Automake
-RUN mkdir -p /tmp/automake && \
-    curl -SL "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz" | tar -xzC /tmp/automake && \
-    cd /tmp/automake/automake-1.14 && \
-    ./configure --prefix=/usr && \
-    make && \
-    make install && \
-    cd $HOME
-
-# C++ dependencies
-RUN yum install -y libboost-dev libevent-devel
-
-# Java Dependencies
-RUN yum install -y ant junit ant-nodeps ant-junit java-1.7.0-openjdk-devel
-
-# Python Dependencies
-RUN yum install -y python-devel python-setuptools python-twisted
-
-# Ruby Dependencies
-RUN yum install -y ruby ruby-devel rubygems && \
-    gem install bundler rake
-
-# Perl Dependencies
-RUN yum install -y perl-Bit-Vector perl-Class-Accessor perl-ExtUtils-MakeMaker perl-Test-Simple
-
-# PHP Dependencies
-RUN yum install -y php php-devel php-pear re2c
-
-# GLibC Dependencies
-RUN yum install -y glib2-devel
-
-# Erlang Dependencies
-RUN curl -sSL http://packages.erlang-solutions.com/rpm/centos/erlang_solutions.repo -o /etc/yum.repos.d/erlang_solutions.repo && \
-    yum install -y erlang-kernel erlang-erts erlang-stdlib erlang-eunit erlang-rebar
-
-# Go Dependencies
-RUN curl -sSL https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C /usr/lib/ -xz && \
-    mkdir -p /usr/share/go
-
-ENV GOROOT /usr/lib/go
-ENV GOPATH /usr/share/go
-ENV PATH ${GOROOT}/bin:${GOPATH}/bin:$PATH
-
-# Haskell Dependencies
-RUN yum -y install cabal-dev && \
-    cabal update && \
-    cabal install cabal-install && \
-    cd $HOME
-
-# Node.js Dependencies
-RUN yum install -y nodejs nodejs-devel npm
-
-# C# Dependencies
-RUN yum install -y mono-core mono-devel mono-web-devel mono-extras mingw32-binutils mingw32-runtime mingw32-nsis
-
-# Clean up
-RUN rm -rf /tmp/* && \
-    yum clean all
-
-WORKDIR $HOME

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/docker/ubuntu/Dockerfile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/docker/ubuntu/Dockerfile b/depends/thirdparty/thrift/build/docker/ubuntu/Dockerfile
deleted file mode 100644
index 0148006..0000000
--- a/depends/thirdparty/thrift/build/docker/ubuntu/Dockerfile
+++ /dev/null
@@ -1,111 +0,0 @@
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#     http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# Apache Thrift Docker build environment for Centos
-#
-# Known missing client libraries:
-#  - None
-
-FROM ubuntu:trusty
-MAINTAINER Apache Thrift <de...@thrift.apache.org>
-
-ENV HOME /root
-ENV DEBIAN_FRONTEND noninteractive
-
-RUN apt-get update -y && apt-get dist-upgrade -y
-
-# General dependencies
-RUN apt-get install -y automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git \
-    debhelper cmake
-
-# C++ dependencies
-RUN apt-get install -y libboost-dev libboost-test-dev libboost-program-options-dev \
-    libboost-filesystem-dev libboost-system-dev libboost-thread-dev libevent-dev
-
-# Java dependencies
-RUN apt-get install -y ant openjdk-7-jdk maven && \
-    update-java-alternatives -s java-1.7.0-openjdk-amd64
-
-# Python dependencies
-RUN apt-get install -y python-all python-all-dev python-all-dbg python-setuptools python-support \
-    python-twisted python-zope.interface
-
-# Ruby dependencies
-RUN apt-get install -y ruby ruby-dev && \
-    gem install bundler rake
-
-# Perl dependencies
-RUN apt-get install -y libbit-vector-perl libclass-accessor-class-perl
-
-# Php dependencies
-RUN apt-get install -y php5 php5-dev php5-cli php-pear re2c phpunit
-
-# GlibC dependencies
-RUN apt-get install -y libglib2.0-dev
-
-# Erlang dependencies
-RUN echo 'deb http://packages.erlang-solutions.com/debian trusty contrib' > /etc/apt/sources.list.d/erlang_solutions.list && \
-    curl -sSL http://packages.erlang-solutions.com/debian/erlang_solutions.asc | sudo apt-key add - && \
-    apt-get update && \
-    apt-get install -y erlang-base erlang-eunit erlang-dev
-
-# GO dependencies
-RUN curl -sSL https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz | tar -C /usr/lib/ -xz && \
-    mkdir -p /usr/share/go
-
-ENV GOROOT /usr/lib/go
-ENV GOPATH /usr/share/go
-ENV PATH ${GOROOT}/bin:${GOPATH}/bin:$PATH
-
-# Haskell dependencies
-RUN apt-get install -y ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev \
-    libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev && \
-    cabal update
-
-# Haxe
-RUN apt-get install -y neko neko-dev libneko0 && \
-    mkdir -p /tmp/haxe /usr/lib/haxe && \
-    curl http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-linux64.tar.gz -o /tmp/haxe/haxe-3.2.0-linux64.tar.gz && \
-    tar -xvzf /tmp/haxe/haxe-3.2.0-linux64.tar.gz -C /usr/lib/haxe --strip-components=1 && \
-    ln -s /usr/lib/haxe/haxe /usr/bin/haxe && \
-    ln -s /usr/lib/haxe/haxelib /usr/bin/haxelib && \
-    mkdir -p /usr/lib/haxe/lib  && \
-    chmod -R 777 /usr/lib/haxe/lib && \
-    haxelib setup /usr/lib/haxe/lib && \
-    haxelib install hxcpp
-
-# Lua dependencies
-RUN apt-get install -y lua5.2 lua5.2-dev
-
-# Node.js dependencies
-RUN apt-get install -y nodejs nodejs-dev nodejs-legacy npm
-
-# CSharp
-RUN apt-get install -y mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil \
-    mingw32 mingw32-binutils mingw32-runtime nsis
-
-# D dependencies
-# THRIFT-2916: DMD pinned to 2.065.0-0 due to regression in 2.066
-# THRIFT-3253: DMD pinned to 2.065.0-0 due to deprecations 2.067.1
-RUN apt-get install -y gcc-multilib xdg-utils && \
-    curl -sSL http://downloads.dlang.org/releases/2.x/2.065.0/dmd_2.065.0-0_amd64.deb -o /tmp/dmd_2.065.0-0_amd64.deb && \
-    dpkg -i /tmp/dmd_2.065.0-0_amd64.deb && \
-    rm /tmp/dmd_2.065.0-0_amd64.deb
-
-# Clean up
-RUN apt-get clean && \
-    rm -rf /var/cache/apt/* && \
-    rm -rf /var/lib/apt/lists/* && \
-    rm -rf /tmp/* && \
-    rm -rf /var/tmp/*
-
-WORKDIR $HOME

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/travis/installCXXDependencies.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/travis/installCXXDependencies.sh b/depends/thirdparty/thrift/build/travis/installCXXDependencies.sh
deleted file mode 100755
index ac3edf3..0000000
--- a/depends/thirdparty/thrift/build/travis/installCXXDependencies.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-
-# Mainly aiming Travis CI's Ubuntu machines for now
-# see what we need: http://thrift.apache.org/docs/install/ubuntu
-
-# General dependencies
-sudo apt-add-repository "deb http://archive.ubuntu.com/ubuntu/ trusty main restricted" -y
-sudo apt-get update -qq
-
-sudo apt-get install -qq libpango-1.0-0 libqt4-dev qtbase5-dev qtbase5-dev-tools qt5-default libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev make cmake git debhelper bc nsis ninja-build
-dpkg -S /usr/include/boost/version.hpp

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/travis/installDependencies.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/travis/installDependencies.sh b/depends/thirdparty/thrift/build/travis/installDependencies.sh
deleted file mode 100755
index 5b74140..0000000
--- a/depends/thirdparty/thrift/build/travis/installDependencies.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/sh
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-SCRIPTPATH=$( cd $(dirname $0) ; pwd -P )
-
-# Mainly aiming Travis CI's Ubuntu machines for now
-# see what we need: http://thrift.apache.org/docs/install/ubuntu
-
-# General dependencies
-sh ${SCRIPTPATH}/installCXXDependencies.sh
-
-# Java dependencies
-sudo apt-get install -qq ant openjdk-7-jdk
-sudo update-java-alternatives -s java-1.7.0-openjdk-amd64
-
-# Python dependencies
-sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools python-support python-twisted
-
-# Ruby dependencies
-sudo apt-get install -qq ruby ruby-dev
-sudo gem install bundler rake
-
-# Perl dependencies
-sudo apt-get install -qq libbit-vector-perl libclass-accessor-class-perl libio-socket-ssl-perl libnet-ssleay-perl libcrypt-ssleay-perl
-
-# Php dependencies
-sudo apt-get install -qq php5 php5-dev php5-cli php-pear re2c
-
-# GlibC dependencies
-sudo apt-get install -qq libglib2.0-dev
-
-# Erlang dependencies
-sudo apt-get install -qq erlang-base erlang-eunit erlang-dev
-
-# GO dependencies
-echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections
-sudo apt-get -y install -qq golang golang-go
-
-# Haskell dependencies
-sudo add-apt-repository -y ppa:hvr/ghc
-sudo apt-get update
-sudo apt-get install cabal-install-1.20 ghc-$GHCVER
-
-# Lua dependencies
-sudo apt-get install -qq lua5.2 lua5.2-dev
-
-# Node.js dependencies
-sudo apt-get install -qq nodejs nodejs-dev npm
-sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
-
-# CSharp
-sudo apt-get install -qq mono-gmcs mono-devel libmono-system-web2.0-cil
-sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime nsis

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/cleanup.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/cleanup.sh b/depends/thirdparty/thrift/cleanup.sh
deleted file mode 100755
index f110721..0000000
--- a/depends/thirdparty/thrift/cleanup.sh
+++ /dev/null
@@ -1,89 +0,0 @@
-#!/bin/sh
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-topsrcdir="`dirname $0`"
-cd "$topsrcdir"
-
-make -k clean >/dev/null 2>&1
-make -k distclean >/dev/null 2>&1
-find . -name Makefile.in -exec rm -f {} \;
-rm -rf \
-AUTHORS \
-ChangeLog \
-INSTALL \
-Makefile \
-Makefile.in \
-Makefile.orig \
-aclocal/libtool.m4 \
-aclocal/ltoptions.m4 \
-aclocal/ltsugar.m4 \
-aclocal/ltversion.m4 \
-aclocal/lt~obsolete.m4 \
-aclocal.m4 \
-autom4te.cache \
-autoscan.log \
-config.guess \
-config.h \
-config.hin \
-config.hin~ \
-config.log \
-config.status \
-config.status.lineno \
-config.sub \
-configure \
-configure.lineno \
-configure.scan \
-depcomp \
-.deps \
-install-sh \
-.libs \
-libtool \
-ltmain.sh \
-missing \
-ylwrap \
-if/gen-* \
-test/gen-* \
-lib/php/src/ext/thrift_protocol/.deps \
-lib/php/src/ext/thrift_protocol/Makefile \
-lib/php/src/ext/thrift_protocol/Makefile.fragments \
-lib/php/src/ext/thrift_protocol/Makefile.global \
-lib/php/src/ext/thrift_protocol/Makefile.objects \
-lib/php/src/ext/thrift_protocol/acinclude.m4 \
-lib/php/src/ext/thrift_protocol/aclocal.m4 \
-lib/php/src/ext/thrift_protocol/autom4te.cache \
-lib/php/src/ext/thrift_protocol/build \
-lib/php/src/ext/thrift_protocol/config.guess \
-lib/php/src/ext/thrift_protocol/config.h \
-lib/php/src/ext/thrift_protocol/config.h.in \
-lib/php/src/ext/thrift_protocol/config.log \
-lib/php/src/ext/thrift_protocol/config.nice \
-lib/php/src/ext/thrift_protocol/config.status \
-lib/php/src/ext/thrift_protocol/config.sub \
-lib/php/src/ext/thrift_protocol/configure \
-lib/php/src/ext/thrift_protocol/configure.in \
-lib/php/src/ext/thrift_protocol/include \
-lib/php/src/ext/thrift_protocol/install-sh \
-lib/php/src/ext/thrift_protocol/libtool \
-lib/php/src/ext/thrift_protocol/ltmain.sh \
-lib/php/src/ext/thrift_protocol/missing \
-lib/php/src/ext/thrift_protocol/mkinstalldirs \
-lib/php/src/ext/thrift_protocol/modules \
-lib/php/src/ext/thrift_protocol/run-tests.php

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/CMakeLists.txt b/depends/thirdparty/thrift/compiler/cpp/CMakeLists.txt
deleted file mode 100644
index bc6591c..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Windows has a different header
-if(MSVC)
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/windows/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
-else()
-    configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h)
-endif()
-
-find_package(FLEX REQUIRED)
-find_package(BISON REQUIRED)
-
-# Create flex and bison files and build the lib parse static library
-BISON_TARGET(thrifty ${CMAKE_CURRENT_SOURCE_DIR}/src/thrifty.yy ${CMAKE_CURRENT_BINARY_DIR}/thrifty.cc)
-FLEX_TARGET(thriftl ${CMAKE_CURRENT_SOURCE_DIR}/src/thriftl.ll ${CMAKE_CURRENT_BINARY_DIR}/thriftl.cc)
-ADD_FLEX_BISON_DEPENDENCY(thriftl thrifty)
-
-# HACK: Work around the fact that bison crates a .hh file but we need a .h file
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
-                   COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/thrifty.hh ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
-                   DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/thrifty.hh
-                   )
-
-set(libparse_SOURCES
-    ${CMAKE_CURRENT_BINARY_DIR}/thrifty.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thriftl.cc
-    ${CMAKE_CURRENT_BINARY_DIR}/thrifty.h
-)
-
-add_library(libparse STATIC ${libparse_SOURCES})
-
-# Create the thrift compiler
-set( thrift_SOURCES 
-    src/main.cc
-    src/md5.c
-    src/generate/t_generator.cc
-    src/generate/t_generator_registry.h
-    src/globals.h
-    src/main.h
-    src/platform.h
-    src/md5.h
-    src/audit/t_audit.cpp
-    src/parse/t_doc.h
-    src/parse/t_type.h
-    src/parse/t_base_type.h
-    src/parse/t_enum.h
-    src/parse/t_enum_value.h
-    src/parse/t_typedef.h
-    src/parse/t_typedef.cc
-    src/parse/t_container.h
-    src/parse/t_list.h
-    src/parse/t_set.h
-    src/parse/t_map.h
-    src/parse/t_struct.h
-    src/parse/t_field.h
-    src/parse/t_service.h
-    src/parse/t_function.h
-    src/parse/t_program.h
-    src/parse/t_scope.h
-    src/parse/t_const.h
-    src/parse/t_const_value.h
-    src/parse/parse.cc
-    src/generate/t_generator.h
-    src/generate/t_oop_generator.h
-    src/generate/t_html_generator.h
-    src/windows/config.h
-    version.h
-)
-
-# This macro adds an option THRIFT_COMPILER_${NAME}
-# that allows enabling or disabling certain languages
-macro(THRIFT_ADD_COMPILER name description initial)
-    string(TOUPPER "THRIFT_COMPILER_${name}" enabler)
-    set(src "src/generate/t_${name}_generator.cc")
-    option(${enabler} ${description} ${initial})
-    if(${enabler})
-        list(APPEND thrift_SOURCES ${src})
-    endif()
-endmacro()
-
-# The following compiler can be enabled or disabled
-THRIFT_ADD_COMPILER(c_glib  "Enable compiler for C with Glib" ON)
-THRIFT_ADD_COMPILER(cpp     "Enable compiler for C++" ON)
-THRIFT_ADD_COMPILER(java    "Enable compiler for Java"   ON)
-THRIFT_ADD_COMPILER(as3     "Enable compiler for ActionScript 3" ON)
-THRIFT_ADD_COMPILER(haxe    "Enable compiler for Haxe" ON)
-THRIFT_ADD_COMPILER(csharp  "Enable compiler for C#" ON)
-THRIFT_ADD_COMPILER(py      "Enable compiler for Python 2.0" ON)
-THRIFT_ADD_COMPILER(rb      "Enable compiler for Ruby" ON)
-THRIFT_ADD_COMPILER(perl    "Enable compiler for Perl" ON)
-THRIFT_ADD_COMPILER(php     "Enable compiler for PHP" ON)
-THRIFT_ADD_COMPILER(erl     "Enable compiler for Erlang" ON)
-THRIFT_ADD_COMPILER(cocoa   "Enable compiler for Cocoa Objective-C" ON)
-THRIFT_ADD_COMPILER(st      "Enable compiler for Smalltalk" ON)
-THRIFT_ADD_COMPILER(ocaml   "Enable compiler for OCaml" ON)
-THRIFT_ADD_COMPILER(hs      "Enable compiler for Haskell" ON)
-THRIFT_ADD_COMPILER(xsd     "Enable compiler for XSD" ON)
-THRIFT_ADD_COMPILER(html    "Enable compiler for HTML Documentation" ON)
-THRIFT_ADD_COMPILER(js      "Enable compiler for JavaScript" ON)
-THRIFT_ADD_COMPILER(json    "Enable compiler for JSON" ON)
-THRIFT_ADD_COMPILER(javame  "Enable compiler for Java ME" ON)
-THRIFT_ADD_COMPILER(delphi  "Enable compiler for Delphi" ON)
-THRIFT_ADD_COMPILER(go      "Enable compiler for Go" ON)
-THRIFT_ADD_COMPILER(d       "Enable compiler for D" ON)
-THRIFT_ADD_COMPILER(lua     "Enable compiler for Lua" ON)
-
-# Thrift is looking for include files in the src directory
-# we also add the current binary directory for generated files
-include_directories(${CMAKE_CURRENT_BINARY_DIR} src)
-
-add_executable(thrift-compiler ${thrift_SOURCES})
-set_target_properties(thrift-compiler PROPERTIES OUTPUT_NAME thrift)
-
-target_link_libraries(thrift-compiler libparse)
-
-install(TARGETS thrift-compiler DESTINATION "${BIN_INSTALL_DIR}")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/Makefile.am b/depends/thirdparty/thrift/compiler/cpp/Makefile.am
deleted file mode 100644
index 38f9f9d..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/Makefile.am
+++ /dev/null
@@ -1,125 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-#
-# Contains some contributions under the Thrift Software License.
-# Please see doc/old-thrift-license.txt in the Thrift distribution for
-# details.
-
-AM_YFLAGS = -d
-LIBS =
-BUILT_SOURCES = src/thrifty.cc
-
-bin_PROGRAMS = thrift
-
-noinst_LIBRARIES = libparse.a
-
-thrift_OBJDIR = obj
-
-thrift_SOURCES = src/main.cc \
-                 src/md5.c \
-                 src/generate/t_generator.cc \
-                 src/generate/t_generator_registry.h \
-                 src/globals.h \
-                 src/main.h \
-                 src/platform.h \
-                 src/logging.h \
-                 src/md5.h \
-                 src/audit/t_audit.cpp \
-                 src/audit/t_audit.h \
-                 src/parse/t_doc.h \
-                 src/parse/t_type.h \
-                 src/parse/t_base_type.h \
-                 src/parse/t_enum.h \
-                 src/parse/t_enum_value.h \
-                 src/parse/t_typedef.h \
-                 src/parse/t_typedef.cc \
-                 src/parse/t_container.h \
-                 src/parse/t_list.h \
-                 src/parse/t_set.h \
-                 src/parse/t_map.h \
-                 src/parse/t_struct.h \
-                 src/parse/t_field.h \
-                 src/parse/t_service.h \
-                 src/parse/t_function.h \
-                 src/parse/t_program.h \
-                 src/parse/t_scope.h \
-                 src/parse/t_const.h \
-                 src/parse/t_const_value.h \
-                 src/parse/parse.cc \
-                 src/generate/t_generator.h \
-                 src/generate/t_oop_generator.h \
-                 src/generate/t_html_generator.h \
-                 src/windows/config.h \
-                 src/windows/version.h
-
-# Specific client generator source
-thrift_SOURCES += src/generate/t_c_glib_generator.cc \
-                  src/generate/t_cpp_generator.cc \
-                  src/generate/t_java_generator.cc \
-                  src/generate/t_json_generator.cc \
-                  src/generate/t_as3_generator.cc \
-                  src/generate/t_haxe_generator.cc \
-                  src/generate/t_csharp_generator.cc \
-                  src/generate/t_py_generator.cc \
-                  src/generate/t_rb_generator.cc \
-                  src/generate/t_perl_generator.cc \
-                  src/generate/t_php_generator.cc \
-                  src/generate/t_erl_generator.cc \
-                  src/generate/t_cocoa_generator.cc \
-                  src/generate/t_st_generator.cc \
-                  src/generate/t_ocaml_generator.cc \
-                  src/generate/t_hs_generator.cc \
-                  src/generate/t_xsd_generator.cc \
-                  src/generate/t_html_generator.cc \
-                  src/generate/t_js_generator.cc \
-                  src/generate/t_javame_generator.cc \
-                  src/generate/t_delphi_generator.cc \
-                  src/generate/t_go_generator.cc \
-                  src/generate/t_gv_generator.cc \
-                  src/generate/t_d_generator.cc \
-                  src/generate/t_lua_generator.cc
-
-thrift_CPPFLAGS = -I$(srcdir)/src
-thrift_CXXFLAGS = -Wall -Wextra -pedantic
-thrift_LDADD = @LEXLIB@ libparse.a
-
-libparse_a_CPPFLAGS = -I$(srcdir)/src
-libparse_a_CXXFLAGS = -Wall -Wno-sign-compare -Wno-unused
-
-libparse_a_SOURCES = src/thrifty.yy \
-                     src/thriftl.ll
-
-WINDOWS_DIST = \
-             compiler.sln \
-             compiler.vcxproj \
-             compiler.vcxproj.filters
-
-EXTRA_DIST = \
-             coding_standards.md \
-             README.md \
-             CMakeLists.txt \
-             $(WINDOWS_DIST)
-
-clean-local:
-	$(RM) thriftl.cc thrifty.cc thrifty.h thrifty.hh version.h windows/version.h
-
-src/main.cc: version.h
-
-style-local:
-	$(CPPSTYLE_CMD)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/README.md b/depends/thirdparty/thrift/compiler/cpp/README.md
deleted file mode 100644
index ea195c7..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/README.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# Build compiler using CMake
-
-Use the following steps to build using cmake:
-
-    mkdir cmake-build
-    cd cmake-build
-    cmake ..
-    make
-
-
-### Create an eclipse project
-
-    mkdir cmake-ec && cd cmake-ec
-    cmake -G "Eclipse CDT4 - Unix Makefiles" ..
-    make
-
-Now open the folder cmake-ec using eclipse.
-
-
-### Cross compile using mingw32 and generate a Windows Installer with CPack
-
-    mkdir cmake-mingw32 && cd cmake-mingw32
-    cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake -DBUILD_COMPILER=ON -DBUILD_LIBRARIES=OFF -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF ..
-    cpack
-
-## Build on windows
-
-### using Git Bash
-Git Bash provides flex and bison, so you just need to do this:
-
-    mkdir cmake-vs && cd cmake-vs
-    cmake -DWITH_SHARED_LIB=off ..
-
-### using Win flex-bison
-
-In order to build on windows with winflexbison a few additional steps are necessary:
-
-1. Download winflexbison from http://sourceforge.net/projects/winflexbison/
-2. Extract the winflex bison files to for e.g. C:\winflexbison
-3. Make the CMake variables point to the correct binaries.
-  * FLEX_EXECUTABLE = C:/winbuild/win_flex.exe
-  * BISON_EXECUTABLE = C:/winbuild/win_bison.exe
-4. Generate a Visual Studio project:
-```
-mkdir cmake-vs && cd cmake-vs
-cmake -G "Visual Studio 12" -DWITH_SHARED_LIB=off ..
-```
-5. Now open the folder build_vs using Visual Studio 2013.
-
-# Building the Thrift IDL compiler in Windows
-
-If you don't want to use CMake you can use the already available Visual Studio
-2010 solution.
-The Visual Studio project contains pre-build commands to generate the
-thriftl.cc, thrifty.cc and thrifty.hh files which are necessary to build
-the compiler. These depend on bison, flex and their dependencies to
-work properly. If this doesn't work on a system, try these manual
-pre-build steps.
-
-Open compiler.sln and remove the Pre-build commands under the project's
- Properties -> Build Events -> Pre-Build Events.
-
-Download flex & bison from http://jaisantonyk.wordpress.com/2008/03/16/lex-and-yaccbison-in-windows/
-Download bison.simple in addition to bison.exe . This build of bison is easier to use
-than the one on sourceforge which has a myriad of dependencies.
-Place these binaries somewhere in the path.
-
-From a command prompt:
-> cd thrift/compiler/cpp
-> flex -osrc\thriftl.cc src\thriftl.ll
-In the generated thriftl.cc, comment out #include <unistd.h>
-
-Place a copy of bison.simple in thrift/compiler/cpp
-> bison -y -o "src/thrifty.cc" --defines src/thrifty.yy
-> move src\thrifty.cc.hh  src\thrifty.hh
-
-Bison might generate the yacc header file "thrifty.cc.h" with just one h ".h" extension; in this case you'll have to rename to "thrifty.h".
-
-> move src\windows\version.h.in src\windows\version.h
-
-Download inttypes.h from the interwebs and place it in an include path
-location (e.g. thrift/compiler/cpp/src).
-
-Build the compiler in Visual Studio.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/coding_standards.md b/depends/thirdparty/thrift/compiler/cpp/coding_standards.md
deleted file mode 100644
index ea08946..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/coding_standards.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## Compiler Coding Standards
-
- * When making small change / bugfix - follow style as seen in nearby code.
- * When making major refactor and / or adding new feature - follow style for C++ library
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/compiler.sln
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/compiler.sln b/depends/thirdparty/thrift/compiler/cpp/compiler.sln
deleted file mode 100644
index 94961aa..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/compiler.sln
+++ /dev/null
@@ -1,20 +0,0 @@
-\ufeff
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "compiler", "compiler.vcxproj", "{89975A1A-F799-4556-98B8-64E30AB39A90}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.ActiveCfg = Debug|Win32
-		{89975A1A-F799-4556-98B8-64E30AB39A90}.Debug|Win32.Build.0 = Debug|Win32
-		{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.ActiveCfg = Release|Win32
-		{89975A1A-F799-4556-98B8-64E30AB39A90}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj b/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj
deleted file mode 100644
index c08edf2..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj
+++ /dev/null
@@ -1,247 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\audit\t_audit.h" />
-    <ClInclude Include="src\generate\t_generator.h" />
-    <ClInclude Include="src\generate\t_generator_registry.h" />
-    <ClInclude Include="src\generate\t_oop_generator.h" />
-    <ClInclude Include="src\generate\t_html_generator.h" />
-    <ClInclude Include="src\globals.h" />
-    <ClInclude Include="src\main.h" />
-    <ClInclude Include="src\md5.h" />
-    <ClInclude Include="src\parse\t_base_type.h" />
-    <ClInclude Include="src\parse\t_const.h" />
-    <ClInclude Include="src\parse\t_const_value.h" />
-    <ClInclude Include="src\parse\t_container.h" />
-    <ClInclude Include="src\parse\t_doc.h" />
-    <ClInclude Include="src\parse\t_enum.h" />
-    <ClInclude Include="src\parse\t_enum_value.h" />
-    <ClInclude Include="src\parse\t_field.h" />
-    <ClInclude Include="src\parse\t_function.h" />
-    <ClInclude Include="src\parse\t_list.h" />
-    <ClInclude Include="src\parse\t_map.h" />
-    <ClInclude Include="src\parse\t_program.h" />
-    <ClInclude Include="src\parse\t_scope.h" />
-    <ClInclude Include="src\parse\t_service.h" />
-    <ClInclude Include="src\parse\t_set.h" />
-    <ClInclude Include="src\parse\t_struct.h" />
-    <ClInclude Include="src\parse\t_type.h" />
-    <ClInclude Include="src\parse\t_typedef.h" />
-    <ClInclude Include="src\platform.h" />
-    <ClInclude Include="src\thrifty.hh" />
-    <ClInclude Include="src\windows\config.h" />
-    <ClInclude Include="src\windows\version.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\audit\t_audit.cpp"/>
-    <ClCompile Include="src\generate\t_as3_generator.cc" />
-    <ClCompile Include="src\generate\t_cocoa_generator.cc" />
-    <ClCompile Include="src\generate\t_cpp_generator.cc" />
-    <ClCompile Include="src\generate\t_csharp_generator.cc" />
-    <ClCompile Include="src\generate\t_c_glib_generator.cc" />
-    <ClCompile Include="src\generate\t_d_generator.cc" />
-    <ClCompile Include="src\generate\t_delphi_generator.cc" />
-    <ClCompile Include="src\generate\t_erl_generator.cc" />
-    <ClCompile Include="src\generate\t_generator.cc" />
-    <ClCompile Include="src\generate\t_go_generator.cc" />
-    <ClCompile Include="src\generate\t_gv_generator.cc" />
-    <ClCompile Include="src\generate\t_haxe_generator.cc" />
-    <ClCompile Include="src\generate\t_hs_generator.cc" />
-    <ClCompile Include="src\generate\t_html_generator.cc" />
-    <ClCompile Include="src\generate\t_javame_generator.cc" />
-    <ClCompile Include="src\generate\t_java_generator.cc" />
-    <ClCompile Include="src\generate\t_js_generator.cc" />
-    <ClCompile Include="src\generate\t_json_generator.cc" />
-    <ClCompile Include="src\generate\t_lua_generator.cc" />
-    <ClCompile Include="src\generate\t_ocaml_generator.cc" />
-    <ClCompile Include="src\generate\t_perl_generator.cc" />
-    <ClCompile Include="src\generate\t_php_generator.cc" />
-    <ClCompile Include="src\generate\t_py_generator.cc" />
-    <ClCompile Include="src\generate\t_rb_generator.cc" />
-    <ClCompile Include="src\generate\t_st_generator.cc" />
-    <ClCompile Include="src\generate\t_xsd_generator.cc" />
-    <ClCompile Include="src\main.cc" />
-    <ClCompile Include="src\md5.c" />
-    <ClCompile Include="src\parse\parse.cc" />
-    <ClCompile Include="src\parse\t_typedef.cc" />
-    <ClCompile Include="src\thriftl.cc" />
-    <ClCompile Include="src\thrifty.cc" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\thriftl.ll" />
-    <None Include="src\thrifty.yy" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{89975A1A-F799-4556-98B8-64E30AB39A90}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>compiler</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
-    <TargetName>thrift</TargetName>
-    <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <LinkIncremental>true</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
-    <TargetName>thrift</TargetName>
-    <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
-    <TargetName>thrift</TargetName>
-    <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <LinkIncremental>false</LinkIncremental>
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\windows\;$(IncludePath)</IncludePath>
-    <TargetName>thrift</TargetName>
-    <ExecutablePath>$(ExecutablePath);C:\Program Files (x86)\Git\bin</ExecutablePath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
-      <CompileAs>CompileAsCpp</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <PreBuildEvent>
-      <Command>flex -o "src\\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
-    </PreBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
-      <CompileAs>CompileAsCpp</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-    <PreBuildEvent>
-      <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
-    </PreBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
-      <CompileAs>CompileAsCpp</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-    <PreBuildEvent>
-      <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
-    </PreBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;MINGW;YY_NO_UNISTD_H;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ForcedIncludeFiles>config.h</ForcedIncludeFiles>
-      <CompileAs>CompileAsCpp</CompileAs>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-    <PreBuildEvent>
-      <Command>flex -o "src\thriftl.cc" src/thriftl.ll
-bison -y -o "src\thrifty.cc" --defines="src/thrifty.hh" src/thrifty.yy</Command>
-    </PreBuildEvent>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj.filters
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj.filters b/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj.filters
deleted file mode 100644
index 7ff69b7..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/compiler.vcxproj.filters
+++ /dev/null
@@ -1,189 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <ClInclude Include="src\audit\t_audit.h" />
-    <ClInclude Include="src\generate\t_generator.h">
-      <Filter>generate</Filter>
-    </ClInclude>
-    <ClInclude Include="src\generate\t_generator_registry.h">
-      <Filter>generate</Filter>
-    </ClInclude>
-    <ClInclude Include="src\generate\t_oop_generator.h">
-      <Filter>generate</Filter>
-    </ClInclude>
-    <ClInclude Include="src\generate\t_html_generator.h">
-      <Filter>generate</Filter>
-    </ClInclude>
-    <ClInclude Include="src\globals.h" />
-    <ClInclude Include="src\main.h" />
-    <ClInclude Include="src\md5.h" />
-    <ClInclude Include="src\parse\t_base_type.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_const.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_const_value.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_container.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_doc.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_enum.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_enum_value.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_field.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_function.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_list.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_map.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_program.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_scope.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_service.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_set.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_struct.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_type.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\parse\t_typedef.h">
-      <Filter>parse</Filter>
-    </ClInclude>
-    <ClInclude Include="src\platform.h" />
-    <ClInclude Include="src\thrifty.hh" />
-    <ClInclude Include="src\windows\config.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\windows\version.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <Filter Include="windows">
-      <UniqueIdentifier>{ae9d0a15-57ae-4f01-87a4-81f790249b83}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="parse">
-      <UniqueIdentifier>{5df016bb-591b-420a-a535-4330d9187fbf}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="generate">
-      <UniqueIdentifier>{b5c626af-afa5-433c-8e10-ee734533cb68}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\audit\t_audit.cpp"/>
-    <ClCompile Include="src\generate\t_as3_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_cocoa_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_cpp_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_csharp_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_c_glib_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_d_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_delphi_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_erl_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_go_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_gv_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_haxe_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_hs_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_html_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_javame_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_java_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_js_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_ocaml_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_perl_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_php_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_py_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_rb_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_st_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_xsd_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\main.cc" />
-    <ClCompile Include="src\md5.c" />
-    <ClCompile Include="src\parse\parse.cc">
-      <Filter>parse</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thriftl.cc" />
-    <ClCompile Include="src\thrifty.cc" />
-    <ClCompile Include="src\parse\t_typedef.cc">
-      <Filter>parse</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_json_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-    <ClCompile Include="src\generate\t_lua_generator.cc">
-      <Filter>generate</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\thriftl.ll" />
-    <None Include="src\thrifty.yy" />
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.cpp b/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.cpp
deleted file mode 100644
index afcbd5e..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.cpp
+++ /dev/null
@@ -1,466 +0,0 @@
-
-#include <cassert>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <time.h>
-#include <string>
-#include <algorithm>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <limits.h>
-
-// Careful: must include globals first for extern definitions
-#include "globals.h"
-
-#include "parse/t_program.h"
-#include "parse/t_scope.h"
-#include "parse/t_const.h"
-#include "parse/t_field.h"
-
-#include "version.h"
-
-#include "t_audit.h"
-
-extern int g_warn;
-extern std::string g_curpath;
-extern bool g_return_failure;
-
-void thrift_audit_warning(int level, const char* fmt, ...) {
-   if (g_warn < level) {
-      return;
-   }
-   va_list args;
-   printf("[Thrift Audit Warning:%s] ", g_curpath.c_str());
-   va_start(args, fmt);
-   vprintf(fmt, args);
-   va_end(args);
-   printf("\n");
-}
-
-void thrift_audit_failure(const char* fmt, ...) {
-  va_list args;
-  fprintf(stderr, "[Thrift Audit Failure:%s] ", g_curpath.c_str());
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  va_end(args);
-  fprintf(stderr, "\n");
-  g_return_failure = true;
-}
-
-void compare_namespace(t_program* newProgram, t_program* oldProgram)
-{
-   const std::map<std::string, std::string>& newNamespaceMap = newProgram->get_all_namespaces();
-   const std::map<std::string, std::string>& oldNamespaceMap = oldProgram->get_all_namespaces();
-
-   for(std::map<std::string, std::string>::const_iterator oldNamespaceMapIt = oldNamespaceMap.begin();
-         oldNamespaceMapIt != oldNamespaceMap.end();
-         oldNamespaceMapIt++)
-   {
-      std::map<std::string, std::string>::const_iterator newNamespaceMapIt = newNamespaceMap.find(oldNamespaceMapIt->first);
-      if(newNamespaceMapIt == newNamespaceMap.end())
-      {
-         thrift_audit_warning(1, "Language %s not found in new thrift file\n", (oldNamespaceMapIt->first).c_str());
-      }
-      else if((newNamespaceMapIt->second) != oldNamespaceMapIt->second)
-      {
-         thrift_audit_warning(1, "Namespace %s changed in new thrift file\n", (oldNamespaceMapIt->second).c_str());
-      }
-   }
-}
-
-void compare_enum_values(t_enum* newEnum,t_enum* oldEnum)
-{
-   const std::vector<t_enum_value*>& oldEnumValues = oldEnum->get_constants();
-   for(std::vector<t_enum_value*>::const_iterator oldEnumValuesIt = oldEnumValues.begin();
-         oldEnumValuesIt != oldEnumValues.end();
-         oldEnumValuesIt++)
-   {
-      int enumValue = (*oldEnumValuesIt)->get_value();
-      t_enum_value* newEnumValue = newEnum->get_constant_by_value(enumValue);
-      if(newEnumValue != NULL)
-      {
-         std::string enumName = (*oldEnumValuesIt)->get_name();
-         if(enumName != newEnumValue->get_name())
-         {
-            thrift_audit_warning(1, "Name of the value %d changed in enum %s\n", enumValue, oldEnum->get_name().c_str());
-         }      
-      }
-      else
-      {
-         thrift_audit_failure("Enum value %d missing in %s\n", enumValue, oldEnum->get_name().c_str());
-      }
-
-   }
-}
-
-void compare_enums(const std::vector<t_enum*>& newEnumList, const std::vector<t_enum*>& oldEnumList)
-{
-   std::map<std::string,t_enum*> newEnumMap;
-   std::vector<t_enum*>::const_iterator newEnumIt;
-   for(newEnumIt = newEnumList.begin(); newEnumIt != newEnumList.end(); newEnumIt++)
-   {
-      newEnumMap[(*newEnumIt)->get_name()] = *newEnumIt;
-   }
-   std::vector<t_enum*>::const_iterator oldEnumIt;
-   for(oldEnumIt = oldEnumList.begin(); oldEnumIt != oldEnumList.end(); oldEnumIt++)
-   {
-      std::map<std::string,t_enum*>::iterator newEnumMapIt;
-      newEnumMapIt = newEnumMap.find((*oldEnumIt)->get_name());
-
-      if(newEnumMapIt == newEnumMap.end())
-      {
-         thrift_audit_warning(1, "Enum %s not found in new thrift file\n",(*oldEnumIt)->get_name().c_str());
-      }
-      else
-      {
-         compare_enum_values(newEnumMapIt->second, *oldEnumIt);
-      }
-   }
-}
-
-//This function returns 'true' if the two arguements are of same types.
-//Returns false if they are of different type
-bool compare_type(t_type* newType, t_type* oldType)
-{
-   //Comparing names of two types will work when the newType and oldType are basic types or structs or enums.
-   //However, when they are containers, get_name() returns empty for which we have to compare the type of 
-   //their elements as well.
-   if((newType->get_name()).empty() && (oldType->get_name()).empty())
-   {
-
-      if(newType->is_list() && oldType->is_list())
-      {
-         t_type* newElementType = ((t_list*)newType)->get_elem_type();
-         t_type* oldElementType = ((t_list*)oldType)->get_elem_type();
-         return compare_type(newElementType, oldElementType);
-      }
-      else if(newType->is_map() && oldType->is_map())
-      {
-         t_type* newKeyType = ((t_map*)newType)->get_key_type();
-         t_type* oldKeyType = ((t_map*)oldType)->get_key_type();
-
-         t_type* newValType = ((t_map*)newType)->get_val_type();
-         t_type* oldValType = ((t_map*)oldType)->get_val_type();
-
-         return (compare_type(newKeyType, oldKeyType) && compare_type(newValType, oldValType));
-      }
-      else if(newType->is_set() && oldType->is_set())
-      {
-         t_type* newElementType = ((t_set*)newType)->get_elem_type();
-         t_type* oldElementType = ((t_set*)oldType)->get_elem_type();
-         return compare_type(newElementType, oldElementType); 
-      }
-      else
-      {
-         return false;
-      }
-   }
-   else if(newType->get_name() == oldType->get_name())
-   {
-      return true;
-   }
-   else
-   {
-      return false;
-   }
-}
-
-bool compare_pair(std::pair<t_const_value*, t_const_value*> newMapPair, std::pair<t_const_value*, t_const_value*> oldMapPair)
-{
-   return compare_defaults(newMapPair.first, oldMapPair.first) && compare_defaults(newMapPair.second, oldMapPair.second);
-}   
-
-// This function returns 'true' if the default values are same. Returns false if they are different.
-bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault)
-{
-   if(newStructDefault == NULL && oldStructDefault == NULL) return true;
-   else if(newStructDefault == NULL && oldStructDefault != NULL) return false;
-   else if (newStructDefault != NULL && oldStructDefault == NULL) return false;
-
-   if(newStructDefault->get_type() != oldStructDefault->get_type())
-   {
-      return false;
-   }
-
-   switch(newStructDefault->get_type())
-   {
-      case t_const_value::CV_INTEGER:
-         return (newStructDefault->get_integer() == oldStructDefault->get_integer());
-      case t_const_value::CV_DOUBLE:
-         return (newStructDefault->get_double() == oldStructDefault->get_double());
-      case t_const_value::CV_STRING:
-         return (newStructDefault->get_string() == oldStructDefault->get_string());
-      case t_const_value::CV_LIST:
-         {
-            const std::vector<t_const_value*>& oldDefaultList = oldStructDefault->get_list();
-            const std::vector<t_const_value*>& newDefaultList = newStructDefault->get_list();
-            bool defaultValuesCompare = (oldDefaultList.size() == newDefaultList.size());
-
-            return defaultValuesCompare && std::equal(newDefaultList.begin(), newDefaultList.end(), oldDefaultList.begin(), compare_defaults);
-         }
-      case t_const_value::CV_MAP:
-         {
-            const std::map<t_const_value*, t_const_value*> newMap = newStructDefault->get_map();
-            const std::map<t_const_value*, t_const_value*> oldMap = oldStructDefault->get_map();
-
-            bool defaultValuesCompare = (oldMap.size() == newMap.size());
-
-            return defaultValuesCompare && std::equal(newMap.begin(), newMap.end(), oldMap.begin(), compare_pair);
-         }
-      case t_const_value::CV_IDENTIFIER:
-         return (newStructDefault->get_identifier() == oldStructDefault->get_identifier());
-      default:
-         return false;
-   }
-
-}
-
-void compare_struct_field(t_field* newField, t_field* oldField, std::string oldStructName)
-{
-   t_type* newFieldType = newField->get_type();
-   t_type* oldFieldType = oldField->get_type();
-   if(!compare_type(newFieldType, oldFieldType))
-   {
-      thrift_audit_failure("Struct Field Type Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-   }
-
-   // A Struct member can be optional if it is mentioned explicitly, or if it is assigned with default values.
-   bool newStructFieldOptional = (newField->get_req() != t_field::T_REQUIRED);
-   bool oldStructFieldOptional = (oldField->get_req() != t_field::T_REQUIRED);
-
-   if(newStructFieldOptional != oldStructFieldOptional)
-   {
-      thrift_audit_failure("Struct Field Requiredness Changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-   }
-   if(newStructFieldOptional || oldStructFieldOptional)
-   {
-      if(!compare_defaults(newField->get_value(), oldField->get_value()))
-      {
-         thrift_audit_warning(1, "Default value changed for Id = %d in %s \n", newField->get_key(), oldStructName.c_str());
-      }
-   }
-
-   std::string fieldName = newField->get_name();
-   if(fieldName != oldField->get_name())
-   {
-      thrift_audit_warning(1, "Struct field name changed for Id = %d in %s\n", newField->get_key(), oldStructName.c_str());
-   }
-
-}
-
-void compare_single_struct(t_struct* newStruct, t_struct* oldStruct, const std::string& oldStructName = std::string())
-{
-   std::string structName = oldStructName.empty() ? oldStruct->get_name() : oldStructName;
-   const std::vector<t_field*>& oldStructMembersInIdOrder = oldStruct->get_sorted_members();
-   const std::vector<t_field*>& newStructMembersInIdOrder = newStruct->get_sorted_members();
-   std::vector<t_field*>::const_iterator oldStructMemberIt = oldStructMembersInIdOrder.begin();
-   std::vector<t_field*>::const_iterator newStructMemberIt = newStructMembersInIdOrder.begin();
-
-   // Since we have the struct members in their ID order, comparing their IDs can be done by traversing the two member
-   // lists together.  
-   while(!(oldStructMemberIt == oldStructMembersInIdOrder.end() && newStructMemberIt == newStructMembersInIdOrder.end()))
-   {
-      if(newStructMemberIt == newStructMembersInIdOrder.end() && oldStructMemberIt != oldStructMembersInIdOrder.end())
-      {
-         // A field ID has been removed from the end.
-         thrift_audit_failure("Struct Field removed for Id = %d in %s \n", (*oldStructMemberIt)->get_key(), structName.c_str());
-         oldStructMemberIt++;
-      }
-      else if(newStructMemberIt != newStructMembersInIdOrder.end() && oldStructMemberIt == oldStructMembersInIdOrder.end())
-      {
-         //New field ID has been added to the end.
-         if((*newStructMemberIt)->get_req() == t_field::T_REQUIRED)
-         {
-            thrift_audit_failure("Required Struct Field Added for Id = %d in %s \n", (*newStructMemberIt)->get_key(), structName.c_str());
-         }
-         newStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() == (*oldStructMemberIt)->get_key())
-      {
-         //Field ID found in both structs. Compare field types, default values.
-         compare_struct_field(*newStructMemberIt, *oldStructMemberIt, structName);
-
-         newStructMemberIt++;
-         oldStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() < (*oldStructMemberIt)->get_key())
-      {
-         //New Field Id is inserted in between
-         //Adding fields to struct is fine, but adding them in the middle is suspicious. Error!!
-         thrift_audit_failure("Struct field is added in the middle with Id = %d in %s\n",  (*newStructMemberIt)->get_key(),  structName.c_str());
-         newStructMemberIt++;
-      }
-      else if((*newStructMemberIt)->get_key() > (*oldStructMemberIt)->get_key())
-      {
-         //A field is deleted in newStruct.
-         thrift_audit_failure("Struct Field removed for Id = %d in %s \n",  (*oldStructMemberIt)->get_key(), structName.c_str());
-         oldStructMemberIt++;
-      }
-
-   }
-}
-
-void compare_structs(const std::vector<t_struct*>& newStructList, const std::vector<t_struct*>& oldStructList)
-{
-   std::map<std::string,t_struct*> newStructMap;
-   std::vector<t_struct*>::const_iterator newStructListIt;
-   for(newStructListIt = newStructList.begin(); newStructListIt != newStructList.end(); newStructListIt++)
-   {
-      newStructMap[(*newStructListIt)->get_name()] = *newStructListIt;
-   }
-
-   std::vector<t_struct*>::const_iterator oldStructListIt;
-   for(oldStructListIt = oldStructList.begin(); oldStructListIt != oldStructList.end(); oldStructListIt++)
-   {
-      std::map<std::string, t_struct*>::iterator newStructMapIt;
-      newStructMapIt = newStructMap.find((*oldStructListIt)->get_name());
-      if(newStructMapIt == newStructMap.end())
-      {
-         thrift_audit_failure("Struct %s not found in new thrift file\n", (*oldStructListIt)->get_name().c_str());
-      }
-      else
-      {
-         compare_single_struct(newStructMapIt->second, *oldStructListIt);
-      }
-   }
-
-}
-
-void compare_single_function(t_function* newFunction, t_function* oldFunction)
-{
-   t_type* newFunctionReturnType = newFunction->get_returntype();
-
-   if(newFunction->is_oneway() != oldFunction->is_oneway())
-   {
-      thrift_audit_failure("Oneway attribute changed for function %s\n",oldFunction->get_name().c_str());
-   }
-   if(!compare_type(newFunctionReturnType, oldFunction->get_returntype()))
-   {
-      thrift_audit_failure("Return type changed for function %s\n",oldFunction->get_name().c_str());
-   }
-
-   //Compare function arguments.
-   compare_single_struct(newFunction->get_arglist(), oldFunction->get_arglist());
-   std::string exceptionName = oldFunction->get_name();
-   exceptionName += "_exception";
-   compare_single_struct(newFunction->get_xceptions(), oldFunction->get_xceptions(), exceptionName);
-}
-
-void compare_functions(const std::vector<t_function*>& newFunctionList, const std::vector<t_function*>& oldFunctionList)
-{
-   std::map<std::string, t_function*> newFunctionMap;
-   std::map<std::string, t_function*>::iterator newFunctionMapIt;
-   for(std::vector<t_function*>::const_iterator newFunctionIt = newFunctionList.begin();
-         newFunctionIt != newFunctionList.end();
-         newFunctionIt++)
-   {
-      newFunctionMap[(*newFunctionIt)->get_name()] = *newFunctionIt;
-   }
-
-   for(std::vector<t_function*>::const_iterator oldFunctionIt = oldFunctionList.begin();
-         oldFunctionIt != oldFunctionList.end();
-         oldFunctionIt++)
-   {
-      newFunctionMapIt = newFunctionMap.find((*oldFunctionIt)->get_name());
-      if(newFunctionMapIt == newFunctionMap.end())
-      {
-         thrift_audit_failure("New Thrift File has missing function %s\n",(*oldFunctionIt)->get_name().c_str());
-         continue;
-      }
-      else
-      {
-         //Function is found in both thrift files. Compare return type and argument list
-         compare_single_function(newFunctionMapIt->second, *oldFunctionIt);
-      }
-   }
-
-}
-
-void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices)
-{
-   std::vector<t_service*>::const_iterator oldServiceIt;
-
-   std::map<std::string, t_service*> newServiceMap;
-   for(std::vector<t_service*>::const_iterator newServiceIt = newServices.begin();
-         newServiceIt != newServices.end();
-         newServiceIt++)
-   {
-      newServiceMap[(*newServiceIt)->get_name()] = *newServiceIt;
-   }
-
-
-   for(oldServiceIt = oldServices.begin(); oldServiceIt != oldServices.end(); oldServiceIt++)
-   {
-      const std::string oldServiceName = (*oldServiceIt)->get_name();
-      std::map<std::string, t_service*>::iterator newServiceMapIt = newServiceMap.find(oldServiceName);
-
-      if(newServiceMapIt == newServiceMap.end())
-      {
-         thrift_audit_failure("New Thrift file is missing a service %s\n", oldServiceName.c_str());
-      }
-      else
-      {
-         t_service* oldServiceExtends = (*oldServiceIt)->get_extends();
-         t_service* newServiceExtends = (newServiceMapIt->second)->get_extends();
-
-         if(oldServiceExtends == NULL)
-         {
-            // It is fine to add extends. So if service in older thrift did not have any extends, we are fine.
-            // DO Nothing
-         }
-         else if(oldServiceExtends != NULL && newServiceExtends == NULL)
-         {
-            thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
-         }
-         else
-         {
-            std::string oldExtendsName = oldServiceExtends->get_name();
-            std::string newExtendsName = newServiceExtends->get_name();
-
-            if( newExtendsName != oldExtendsName)
-            {
-               thrift_audit_failure("Change in Service inheritance for %s\n", oldServiceName.c_str());
-            }
-         }
-
-         compare_functions((newServiceMapIt->second)->get_functions(), (*oldServiceIt)->get_functions());
-      }
-
-   }
-
-}
-
-void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst)
-{
-   std::vector<t_const*>::const_iterator newConstIt;
-   std::vector<t_const*>::const_iterator oldConstIt;
-
-   std::map<std::string, t_const*> newConstMap;
-
-   for(newConstIt = newConst.begin(); newConstIt != newConst.end(); newConstIt++)
-   {
-      newConstMap[(*newConstIt)->get_name()] = *newConstIt;
-   }
-
-   std::map<std::string, t_const*>::const_iterator newConstMapIt;
-   for(oldConstIt = oldConst.begin(); oldConstIt != oldConst.end(); oldConstIt++)
-   {
-      newConstMapIt = newConstMap.find((*oldConstIt)->get_name());
-      if(newConstMapIt == newConstMap.end())
-      {
-         thrift_audit_warning(1, "Constants Missing %s \n", ((*oldConstIt)->get_name()).c_str());
-      }
-      else if(!compare_type((newConstMapIt->second)->get_type(), (*oldConstIt)->get_type()))
-      {
-         thrift_audit_warning(1, "Constant %s is of different type \n", ((*oldConstIt)->get_name()).c_str());
-      }
-      else if(!compare_defaults((newConstMapIt->second)->get_value(), (*oldConstIt)->get_value()))
-      {
-         thrift_audit_warning(1, "Constant %s has different value\n", ((*oldConstIt)->get_name()).c_str());
-      }
-   }
-}
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.h b/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.h
deleted file mode 100644
index fd0013a..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/audit/t_audit.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef T_AUDIT_H
-#define T_AUDIT_H
-
-void compare_namespace(t_program* newProgram, t_program* oldProgram);
-void compare_enums(const std::vector<t_enum*>& newEnumList, const std::vector<t_enum*>& oldEnumList);
-bool compare_defaults(t_const_value* newStructDefault, t_const_value* oldStructDefault);
-void compare_structs(const std::vector<t_struct*>& newStructList, const std::vector<t_struct*>& oldStructList);
-void compare_services(const std::vector<t_service*>& newServices, const std::vector<t_service*>& oldServices);
-void compare_consts(const std::vector<t_const*>& newConst, const std::vector<t_const*>& oldConst);
-
-#endif


[38/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_erl_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_erl_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_erl_generator.cc
deleted file mode 100644
index c066636..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_erl_generator.cc
+++ /dev/null
@@ -1,1044 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-#include "t_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const std::string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Erlang code generator.
- *
- */
-class t_erl_generator : public t_generator {
-public:
-  t_erl_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-erl";
-
-    legacy_names_ = (parsed_options.find("legacynames") != parsed_options.end());
-    maps_ = (parsed_options.find("maps") != parsed_options.end());
-    otp16_ = (parsed_options.find("otp16") != parsed_options.end());
-    if (maps_ && otp16_) {
-      throw "argument error: Cannot specify both maps and otp16; maps are not available for Erlang/OTP R16 or older";
-    }
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-  void generate_member_type(std::ostream& out, t_type* type);
-  void generate_member_value(std::ostream& out, t_type* type, t_const_value* value);
-
-  std::string render_member_type(t_field* field);
-  std::string render_member_value(t_field* field);
-  std::string render_member_requiredness(t_field* field);
-
-  //  std::string render_default_value(t_type* type);
-  std::string render_default_value(t_field* field);
-  std::string render_const_value(t_type* type, t_const_value* value);
-  std::string render_type_term(t_type* ttype, bool expand_structs, bool extended_info = false);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_erl_struct(t_struct* tstruct, bool is_exception);
-  void generate_erl_struct_definition(std::ostream& out, t_struct* tstruct);
-  void generate_erl_struct_member(std::ostream& out, t_field* tmember);
-  void generate_erl_struct_info(std::ostream& out, t_struct* tstruct);
-  void generate_erl_extended_struct_info(std::ostream& out, t_struct* tstruct);
-  void generate_erl_function_helpers(t_function* tfunction);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_function_info(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string erl_autogen_comment();
-  std::string erl_imports();
-  std::string render_includes();
-  std::string type_name(t_type* ttype);
-
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string type_module(t_type* ttype);
-
-  std::string make_safe_for_module_name(std::string in) {
-    if (legacy_names_) {
-      return decapitalize(in);
-    } else {
-      return underscore(in);
-    }
-  }
-
-  std::string atomify(std::string in) {
-    if (legacy_names_) {
-      return "'" + decapitalize(in) + "'";
-    } else {
-      return "'" + in + "'";
-    }
-  }
-
-  std::string constify(std::string in) {
-    if (legacy_names_) {
-      return capitalize(in);
-    } else {
-      return uppercase(in);
-    }
-  }
-
-  static std::string comment(string in);
-
-private:
-  bool has_default_value(t_field*);
-
-  /* if true retain pre 0.9.2 naming scheme for functions, atoms and consts */
-  bool legacy_names_;
-
-  /* if true use maps instead of dicts in generated code */
-  bool maps_;
-
-  /* if true use non-namespaced dict and set instead of dict:dict and sets:set */
-  bool otp16_;
-
-  /**
-   * add function to export list
-   */
-
-  void export_function(t_function* tfunction, std::string prefix = "");
-  void export_string(std::string name, int num);
-
-  void export_types_function(t_function* tfunction, std::string prefix = "");
-  void export_types_string(std::string name, int num);
-
-  /**
-   * write out headers and footers for hrl files
-   */
-
-  void hrl_header(std::ostream& out, std::string name);
-  void hrl_footer(std::ostream& out, std::string name);
-
-  /**
-   * stuff to spit out at the top of generated files
-   */
-
-  bool export_lines_first_;
-  std::ostringstream export_lines_;
-
-  bool export_types_lines_first_;
-  std::ostringstream export_types_lines_;
-
-  /**
-   * File streams
-   */
-
-  std::ostringstream f_info_;
-  std::ostringstream f_info_ext_;
-
-  std::ofstream f_types_file_;
-  std::ofstream f_types_hrl_file_;
-
-  std::ofstream f_consts_;
-  std::ostringstream f_service_;
-  std::ofstream f_service_file_;
-  std::ofstream f_service_hrl_;
-};
-
-/**
- * UI for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_erl_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // setup export lines
-  export_lines_first_ = true;
-  export_types_lines_first_ = true;
-
-  // types files
-  string f_types_name = get_out_dir() + make_safe_for_module_name(program_name_) + "_types.erl";
-  string f_types_hrl_name = get_out_dir() + make_safe_for_module_name(program_name_) + "_types.hrl";
-
-  f_types_file_.open(f_types_name.c_str());
-  f_types_hrl_file_.open(f_types_hrl_name.c_str());
-
-  hrl_header(f_types_hrl_file_, make_safe_for_module_name(program_name_) + "_types");
-
-  f_types_file_ << erl_autogen_comment() << endl << "-module("
-                << make_safe_for_module_name(program_name_) << "_types)." << endl << erl_imports()
-                << endl;
-
-  f_types_file_ << "-include(\"" << make_safe_for_module_name(program_name_) << "_types.hrl\")."
-                << endl << endl;
-
-  f_types_hrl_file_ << render_includes() << endl;
-
-  // consts file
-  string f_consts_name = get_out_dir() + make_safe_for_module_name(program_name_)
-                         + "_constants.hrl";
-  f_consts_.open(f_consts_name.c_str());
-
-  f_consts_ << erl_autogen_comment() << endl << erl_imports() << endl << "-include(\""
-            << make_safe_for_module_name(program_name_) << "_types.hrl\")." << endl << endl;
-}
-
-/**
- * Boilerplate at beginning and end of header files
- */
-void t_erl_generator::hrl_header(ostream& out, string name) {
-  out << "-ifndef(_" << name << "_included)." << endl << "-define(_" << name << "_included, yeah)."
-      << endl;
-}
-
-void t_erl_generator::hrl_footer(ostream& out, string name) {
-  (void)name;
-  out << "-endif." << endl;
-}
-
-/**
- * Renders all the imports necessary for including another Thrift program
- */
-string t_erl_generator::render_includes() {
-  const vector<t_program*>& includes = program_->get_includes();
-  string result = "";
-  for (size_t i = 0; i < includes.size(); ++i) {
-    result += "-include(\"" + make_safe_for_module_name(includes[i]->get_name())
-              + "_types.hrl\").\n";
-  }
-  if (includes.size() > 0) {
-    result += "\n";
-  }
-  return result;
-}
-
-/**
- * Autogen'd comment
- */
-string t_erl_generator::erl_autogen_comment() {
-  return std::string("%%\n") + "%% Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-         + "%%\n" + "%% DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
-         + "%%\n";
-}
-
-/**
- * Comment out text
- */
-
-string t_erl_generator::comment(string in) {
-  size_t pos = 0;
-  in.insert(pos, "%% ");
-  while ((pos = in.find_first_of('\n', pos)) != string::npos) {
-    in.insert(++pos, "%% ");
-  }
-  return in;
-}
-
-/**
- * Prints standard thrift imports
- */
-string t_erl_generator::erl_imports() {
-  return "";
-}
-
-/**
- * Closes the type files
- */
-void t_erl_generator::close_generator() {
-
-  export_types_string("struct_info", 1);
-  export_types_string("struct_info_ext", 1);
-  f_types_file_ << "-export([" << export_types_lines_.str() << "])." << endl << endl;
-
-  f_types_file_ << f_info_.str();
-  f_types_file_ << "struct_info(_) -> erlang:error(function_clause)." << endl << endl;
-
-  f_types_file_ << f_info_ext_.str();
-  f_types_file_ << "struct_info_ext(_) -> erlang:error(function_clause)." << endl << endl;
-
-  hrl_footer(f_types_hrl_file_, string("BOGUS"));
-
-  f_types_file_.close();
-  f_types_hrl_file_.close();
-  f_consts_.close();
-}
-
-/**
- * Generates a typedef. no op
- *
- * @param ttypedef The type definition
- */
-void t_erl_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Done using a class to scope
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_erl_generator::generate_enum(t_enum* tenum) {
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    string name = (*c_iter)->get_name();
-    indent(f_types_hrl_file_) << "-define(" << constify(make_safe_for_module_name(program_name_))
-                              << "_" << constify(tenum->get_name()) << "_" << constify(name) << ", "
-                              << value << ")." << endl;
-  }
-
-  f_types_hrl_file_ << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_erl_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  f_consts_ << "-define(" << constify(make_safe_for_module_name(program_name_)) << "_"
-            << constify(name) << ", " << render_const_value(type, value) << ")." << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_erl_generator::render_const_value(t_type* type, t_const_value* value) {
-  type = get_true_type(type);
-  std::ostringstream out;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << value->get_integer();
-
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "#" << atomify(type->get_name()) << "{";
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-    bool first = true;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-
-      if (first) {
-        first = false;
-      } else {
-        out << ",";
-      }
-      out << v_iter->first->get_string();
-      out << " = ";
-      out << render_const_value(field_type, v_iter->second);
-    }
-    indent_down();
-    indent(out) << "}";
-
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-
-    if (maps_) {
-      out << "maps:from_list([";
-    } else {
-      out << "dict:from_list([";
-    }
-    map<t_const_value*, t_const_value*>::const_iterator i, end = value->get_map().end();
-    for (i = value->get_map().begin(); i != end;) {
-      out << "{" << render_const_value(ktype, i->first) << ","
-          << render_const_value(vtype, i->second) << "}";
-      if (++i != end) {
-        out << ",";
-      }
-    }
-    out << "])";
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    out << "sets:from_list([";
-    vector<t_const_value*>::const_iterator i, end = value->get_list().end();
-    for (i = value->get_list().begin(); i != end;) {
-      out << render_const_value(etype, *i);
-      if (++i != end) {
-        out << ",";
-      }
-    }
-    out << "])";
-  } else if (type->is_list()) {
-    t_type* etype;
-    etype = ((t_list*)type)->get_elem_type();
-    out << "[";
-
-    bool first = true;
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      if (first) {
-        first = false;
-      } else {
-        out << ",";
-      }
-      out << render_const_value(etype, *v_iter);
-    }
-    out << "]";
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-  return out.str();
-}
-
-string t_erl_generator::render_default_value(t_field* field) {
-  t_type* type = field->get_type();
-  if (type->is_struct() || type->is_xception()) {
-    return "#" + atomify(type->get_name()) + "{}";
-  } else if (type->is_map()) {
-    if (maps_) {
-      return "#{}";
-    } else {
-      return "dict:new()";
-    }
-  } else if (type->is_set()) {
-    return "sets:new()";
-  } else if (type->is_list()) {
-    return "[]";
-  } else {
-    return "undefined";
-  }
-}
-
-string t_erl_generator::render_member_type(t_field* field) {
-  t_type* type = get_true_type(field->get_type());
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      return "string() | binary()";
-    case t_base_type::TYPE_BOOL:
-      return "boolean()";
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      return "integer()";
-    case t_base_type::TYPE_DOUBLE:
-      return "float()";
-    default:
-      throw "compiler error: unsupported base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    return "integer()";
-  } else if (type->is_struct() || type->is_xception()) {
-    return atomify(type->get_name()) + "()";
-  } else if (type->is_map()) {
-    if (maps_) {
-      return "#{}";
-    } else if (otp16_) {
-      return "dict()";
-    } else {
-      return "dict:dict()";
-    }
-  } else if (type->is_set()) {
-    if (otp16_) {
-      return "set()";
-    } else {
-      return "sets:set()";
-    }
-  } else if (type->is_list()) {
-    return "list()";
-  } else {
-    throw "compiler error: unsupported type " + type->get_name();
-  }
-}
-
-string t_erl_generator::render_member_requiredness(t_field* field) {
-  switch (field->get_req()) {
-  case t_field::T_REQUIRED:
-    return "required";
-  case t_field::T_OPTIONAL:
-    return "optional";
-  default:
-    return "undefined";
-  }
-}
-
-/**
- * Generates a struct
- */
-void t_erl_generator::generate_struct(t_struct* tstruct) {
-  generate_erl_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_erl_generator::generate_xception(t_struct* txception) {
-  generate_erl_struct(txception, true);
-}
-
-/**
- * Generates a struct
- */
-void t_erl_generator::generate_erl_struct(t_struct* tstruct, bool is_exception) {
-  (void)is_exception;
-  generate_erl_struct_definition(f_types_hrl_file_, tstruct);
-  generate_erl_struct_info(f_info_, tstruct);
-  generate_erl_extended_struct_info(f_info_ext_, tstruct);
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_erl_generator::generate_erl_struct_definition(ostream& out, t_struct* tstruct) {
-  indent(out) << "%% struct " << type_name(tstruct) << endl << endl;
-
-  std::stringstream buf;
-  buf << indent() << "-record(" << type_name(tstruct) << ", {";
-  string field_indent(buf.str().size(), ' ');
-
-  const vector<t_field*>& members = tstruct->get_members();
-  for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();) {
-    generate_erl_struct_member(buf, *m_iter);
-    if (++m_iter != members.end()) {
-      buf << "," << endl << field_indent;
-    }
-  }
-  buf << "}).";
-
-  out << buf.str() << endl;
-  out << "-type " + type_name(tstruct) << "() :: #" + type_name(tstruct) + "{}." << endl << endl;
-}
-
-/**
- * Generates the record field definition
- */
-
-void t_erl_generator::generate_erl_struct_member(ostream& out, t_field* tmember) {
-  out << atomify(tmember->get_name());
-  if (has_default_value(tmember))
-    out << " = " << render_member_value(tmember);
-  out << " :: " << render_member_type(tmember);
-}
-
-bool t_erl_generator::has_default_value(t_field* field) {
-  t_type* type = field->get_type();
-  if (!field->get_value()) {
-    if (field->get_req() == t_field::T_REQUIRED) {
-      if (type->is_struct() || type->is_xception() || type->is_map() || type->is_set()
-          || type->is_list()) {
-        return true;
-      } else {
-        return false;
-      }
-    } else {
-      return false;
-    }
-  } else {
-    return true;
-  }
-}
-
-string t_erl_generator::render_member_value(t_field* field) {
-  if (!field->get_value()) {
-    return render_default_value(field);
-  } else {
-    return render_const_value(field->get_type(), field->get_value());
-  }
-}
-
-/**
- * Generates the read method for a struct
- */
-void t_erl_generator::generate_erl_struct_info(ostream& out, t_struct* tstruct) {
-  indent(out) << "struct_info(" << type_name(tstruct) << ") ->" << endl;
-  indent_up();
-  out << indent() << render_type_term(tstruct, true) << ";" << endl;
-  indent_down();
-  out << endl;
-}
-
-void t_erl_generator::generate_erl_extended_struct_info(ostream& out, t_struct* tstruct) {
-  indent(out) << "struct_info_ext(" << type_name(tstruct) << ") ->" << endl;
-  indent_up();
-  out << indent() << render_type_term(tstruct, true, true) << ";" << endl;
-  indent_down();
-  out << endl;
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_erl_generator::generate_service(t_service* tservice) {
-  service_name_ = make_safe_for_module_name(service_name_);
-
-  string f_service_hrl_name = get_out_dir() + service_name_ + "_thrift.hrl";
-  string f_service_name = get_out_dir() + service_name_ + "_thrift.erl";
-  f_service_file_.open(f_service_name.c_str());
-  f_service_hrl_.open(f_service_hrl_name.c_str());
-
-  // Reset service text aggregating stream streams
-  f_service_.str("");
-  export_lines_.str("");
-  export_lines_first_ = true;
-
-  hrl_header(f_service_hrl_, service_name_);
-
-  if (tservice->get_extends() != NULL) {
-    f_service_hrl_ << "-include(\""
-                   << make_safe_for_module_name(tservice->get_extends()->get_name())
-                   << "_thrift.hrl\"). % inherit " << endl;
-  }
-
-  f_service_hrl_ << "-include(\"" << make_safe_for_module_name(program_name_) << "_types.hrl\")."
-                 << endl << endl;
-
-  // Generate the three main parts of the service (well, two for now in PHP)
-  generate_service_helpers(tservice); // cpiro: New Erlang Order
-
-  generate_service_interface(tservice);
-
-  // indent_down();
-
-  f_service_file_ << erl_autogen_comment() << endl << "-module(" << service_name_ << "_thrift)."
-                  << endl << "-behaviour(thrift_service)." << endl << endl << erl_imports() << endl;
-
-  f_service_file_ << "-include(\"" << make_safe_for_module_name(tservice->get_name())
-                  << "_thrift.hrl\")." << endl << endl;
-
-  f_service_file_ << "-export([" << export_lines_.str() << "])." << endl << endl;
-
-  f_service_file_ << f_service_.str();
-
-  hrl_footer(f_service_hrl_, f_service_name);
-
-  // Close service file
-  f_service_file_.close();
-  f_service_hrl_.close();
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_erl_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  //  indent(f_service_) <<
-  //  "% HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  export_string("struct_info", 1);
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_erl_function_helpers(*f_iter);
-  }
-  f_service_ << "struct_info(_) -> erlang:error(function_clause)." << endl;
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_erl_generator::generate_erl_function_helpers(t_function* tfunction) {
-  (void)tfunction;
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_erl_generator::generate_service_interface(t_service* tservice) {
-
-  export_string("function_info", 2);
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  f_service_ << "%%% interface" << endl;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "% " << function_signature(*f_iter) << endl;
-
-    generate_function_info(tservice, *f_iter);
-  }
-
-  // Inheritance - pass unknown functions to base class
-  if (tservice->get_extends() != NULL) {
-    indent(f_service_) << "function_info(Function, InfoType) ->" << endl;
-    indent_up();
-    indent(f_service_) << make_safe_for_module_name(tservice->get_extends()->get_name())
-                       << "_thrift:function_info(Function, InfoType)." << endl;
-    indent_down();
-  } else {
-    // return function_clause error for non-existent functions
-    indent(f_service_) << "function_info(_Func, _Info) -> erlang:error(function_clause)." << endl;
-  }
-
-  indent(f_service_) << endl;
-}
-
-/**
- * Generates a function_info(FunctionName, params_type) and
- * function_info(FunctionName, reply_type)
- */
-void t_erl_generator::generate_function_info(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  string name_atom = atomify(tfunction->get_name());
-
-  t_struct* xs = tfunction->get_xceptions();
-  t_struct* arg_struct = tfunction->get_arglist();
-
-  // function_info(Function, params_type):
-  indent(f_service_) << "function_info(" << name_atom << ", params_type) ->" << endl;
-  indent_up();
-
-  indent(f_service_) << render_type_term(arg_struct, true) << ";" << endl;
-
-  indent_down();
-
-  // function_info(Function, reply_type):
-  indent(f_service_) << "function_info(" << name_atom << ", reply_type) ->" << endl;
-  indent_up();
-
-  if (!tfunction->get_returntype()->is_void())
-    indent(f_service_) << render_type_term(tfunction->get_returntype(), false) << ";" << endl;
-  else if (tfunction->is_oneway())
-    indent(f_service_) << "oneway_void;" << endl;
-  else
-    indent(f_service_) << "{struct, []}"
-                       << ";" << endl;
-  indent_down();
-
-  // function_info(Function, exceptions):
-  indent(f_service_) << "function_info(" << name_atom << ", exceptions) ->" << endl;
-  indent_up();
-  indent(f_service_) << render_type_term(xs, true) << ";" << endl;
-  indent_down();
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_erl_generator::function_signature(t_function* tfunction, string prefix) {
-  return prefix + tfunction->get_name() + "(This"
-         + capitalize(argument_list(tfunction->get_arglist())) + ")";
-}
-
-/**
- * Add a function to the exports list
- */
-void t_erl_generator::export_string(string name, int num) {
-  if (export_lines_first_) {
-    export_lines_first_ = false;
-  } else {
-    export_lines_ << ", ";
-  }
-  export_lines_ << name << "/" << num;
-}
-
-void t_erl_generator::export_types_function(t_function* tfunction, string prefix) {
-
-  export_types_string(prefix + tfunction->get_name(),
-                      1 // This
-                      + ((tfunction->get_arglist())->get_members()).size());
-}
-
-void t_erl_generator::export_types_string(string name, int num) {
-  if (export_types_lines_first_) {
-    export_types_lines_first_ = false;
-  } else {
-    export_types_lines_ << ", ";
-  }
-  export_types_lines_ << name << "/" << num;
-}
-
-void t_erl_generator::export_function(t_function* tfunction, string prefix) {
-
-  export_string(prefix + tfunction->get_name(),
-                1 // This
-                + ((tfunction->get_arglist())->get_members()).size());
-}
-
-/**
- * Renders a field list
- */
-string t_erl_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      result += ", "; // initial comma to compensate for initial This
-    } else {
-      result += ", ";
-    }
-    result += capitalize((*f_iter)->get_name());
-  }
-  return result;
-}
-
-string t_erl_generator::type_name(t_type* ttype) {
-  string prefix = "";
-  string name = ttype->get_name();
-
-  if (ttype->is_struct() || ttype->is_xception() || ttype->is_service()) {
-    name = ttype->get_name();
-  }
-
-  return atomify(prefix + name);
-}
-
-/**
- * Converts the parse type to a Erlang "type" (macro for int constants)
- */
-string t_erl_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "?tType_STRING";
-    case t_base_type::TYPE_BOOL:
-      return "?tType_BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "?tType_BYTE";
-    case t_base_type::TYPE_I16:
-      return "?tType_I16";
-    case t_base_type::TYPE_I32:
-      return "?tType_I32";
-    case t_base_type::TYPE_I64:
-      return "?tType_I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "?tType_DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "?tType_I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "?tType_STRUCT";
-  } else if (type->is_map()) {
-    return "?tType_MAP";
-  } else if (type->is_set()) {
-    return "?tType_SET";
-  } else if (type->is_list()) {
-    return "?tType_LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Generate an Erlang term which represents a thrift type
- */
-std::string t_erl_generator::render_type_term(t_type* type,
-                                              bool expand_structs,
-                                              bool extended_info) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "string";
-    case t_base_type::TYPE_BOOL:
-      return "bool";
-    case t_base_type::TYPE_BYTE:
-      return "byte";
-    case t_base_type::TYPE_I16:
-      return "i16";
-    case t_base_type::TYPE_I32:
-      return "i32";
-    case t_base_type::TYPE_I64:
-      return "i64";
-    case t_base_type::TYPE_DOUBLE:
-      return "double";
-    }
-  } else if (type->is_enum()) {
-    return "i32";
-  } else if (type->is_struct() || type->is_xception()) {
-    if (expand_structs) {
-
-      std::stringstream buf;
-      buf << "{struct, [";
-      string field_indent(buf.str().size(), ' ');
-
-      t_struct::members_type const& fields = static_cast<t_struct*>(type)->get_members();
-      t_struct::members_type::const_iterator i, end = fields.end();
-      for (i = fields.begin(); i != end;) {
-        t_struct::members_type::value_type member = *i;
-        int32_t key = member->get_key();
-        string type = render_type_term(member->get_type(), false, false); // recursive call
-
-        if (!extended_info) {
-          // Convert to format: {struct, [{Fid, Type}|...]}
-          buf << "{" << key << ", " << type << "}";
-        } else {
-          // Convert to format: {struct, [{Fid, Req, Type, Name, Def}|...]}
-          string name = member->get_name();
-          string value = render_member_value(member);
-          string requiredness = render_member_requiredness(member);
-          buf << "{" << key << ", " << requiredness << ", " << type << ", " << atomify(name) << ", "
-              << value << "}";
-        }
-
-        if (++i != end) {
-          buf << "," << endl << field_indent;
-        }
-      }
-
-      buf << "]}" << endl;
-      return buf.str();
-    } else {
-      return "{struct, {" + atomify(type_module(type)) + ", " + type_name(type) + "}}";
-    }
-  } else if (type->is_map()) {
-    // {map, KeyType, ValType}
-    t_type* key_type = ((t_map*)type)->get_key_type();
-    t_type* val_type = ((t_map*)type)->get_val_type();
-
-    return "{map, " + render_type_term(key_type, false) + ", " + render_type_term(val_type, false)
-           + "}";
-
-  } else if (type->is_set()) {
-    t_type* elem_type = ((t_set*)type)->get_elem_type();
-
-    return "{set, " + render_type_term(elem_type, false) + "}";
-
-  } else if (type->is_list()) {
-    t_type* elem_type = ((t_list*)type)->get_elem_type();
-
-    return "{list, " + render_type_term(elem_type, false) + "}";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-std::string t_erl_generator::type_module(t_type* ttype) {
-  return make_safe_for_module_name(ttype->get_program()->get_name()) + "_types";
-}
-
-THRIFT_REGISTER_GENERATOR(
-    erl,
-    "Erlang",
-    "    legacynames: Output files retain naming conventions of Thrift 0.9.1 and earlier.\n"
-    "    maps:        Generate maps instead of dicts.\n"
-    "    otp16:       Generate non-namespaced dict and set instead of dict:dict and sets:set.\n")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.cc
deleted file mode 100644
index e7760d7..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.cc
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "t_generator.h"
-using namespace std;
-
-/**
- * Top level program generation function. Calls the generator subclass methods
- * for preparing file streams etc. then iterates over all the parts of the
- * program to perform the correct actions.
- *
- * @param program The thrift program to compile into C++ source
- */
-void t_generator::generate_program() {
-  // Initialize the generator
-  init_generator();
-
-  // Generate enums
-  vector<t_enum*> enums = program_->get_enums();
-  vector<t_enum*>::iterator en_iter;
-  for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-    generate_enum(*en_iter);
-  }
-
-  // Generate typedefs
-  vector<t_typedef*> typedefs = program_->get_typedefs();
-  vector<t_typedef*>::iterator td_iter;
-  for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-    generate_typedef(*td_iter);
-  }
-
-  // Generate structs, exceptions, and unions in declared order
-  vector<t_struct*> objects = program_->get_objects();
-
-  vector<t_struct*>::iterator o_iter;
-  for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-    generate_forward_declaration(*o_iter);
-  }
-  for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-    if ((*o_iter)->is_xception()) {
-      generate_xception(*o_iter);
-    } else {
-      generate_struct(*o_iter);
-    }
-  }
-
-  // Generate constants
-  vector<t_const*> consts = program_->get_consts();
-  generate_consts(consts);
-
-  // Generate services
-  vector<t_service*> services = program_->get_services();
-  vector<t_service*>::iterator sv_iter;
-  for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-    service_name_ = get_service_name(*sv_iter);
-    generate_service(*sv_iter);
-  }
-
-  // Close the generator
-  close_generator();
-}
-
-string t_generator::escape_string(const string& in) const {
-  string result = "";
-  for (string::const_iterator it = in.begin(); it < in.end(); it++) {
-    std::map<char, std::string>::const_iterator res = escape_.find(*it);
-    if (res != escape_.end()) {
-      result.append(res->second);
-    } else {
-      result.push_back(*it);
-    }
-  }
-  return result;
-}
-
-void t_generator::generate_consts(vector<t_const*> consts) {
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    generate_const(*c_iter);
-  }
-}
-
-void t_generator::generate_docstring_comment(ostream& out,
-                                             const string& comment_start,
-                                             const string& line_prefix,
-                                             const string& contents,
-                                             const string& comment_end) {
-  if (comment_start != "")
-    indent(out) << comment_start;
-  stringstream docs(contents, ios_base::in);
-  while (!(docs.eof() || docs.fail())) {
-    char line[1024];
-    docs.getline(line, 1024);
-
-    // Just prnt a newline when the line & prefix are empty.
-    if (strlen(line) == 0 && line_prefix == "" && !docs.eof()) {
-      out << std::endl;
-    } else if (strlen(line) > 0 || !docs.eof()) { // skip the empty last line
-      indent(out) << line_prefix << line << std::endl;
-    }
-  }
-  if (comment_end != "")
-    indent(out) << comment_end;
-}
-
-void t_generator_registry::register_generator(t_generator_factory* factory) {
-  gen_map_t& the_map = get_generator_map();
-  if (the_map.find(factory->get_short_name()) != the_map.end()) {
-    failure("Duplicate generators for language \"%s\"!\n", factory->get_short_name().c_str());
-  }
-  the_map[factory->get_short_name()] = factory;
-}
-
-t_generator* t_generator_registry::get_generator(t_program* program, const string& options) {
-  string::size_type colon = options.find(':');
-  string language = options.substr(0, colon);
-
-  map<string, string> parsed_options;
-  if (colon != string::npos) {
-    string::size_type pos = colon + 1;
-    while (pos != string::npos && pos < options.size()) {
-      string::size_type next_pos = options.find(',', pos);
-      string option = options.substr(pos, next_pos - pos);
-      pos = ((next_pos == string::npos) ? next_pos : next_pos + 1);
-
-      string::size_type separator = option.find('=');
-      string key, value;
-      if (separator == string::npos) {
-        key = option;
-        value = "";
-      } else {
-        key = option.substr(0, separator);
-        value = option.substr(separator + 1);
-      }
-
-      parsed_options[key] = value;
-    }
-  }
-
-  gen_map_t& the_map = get_generator_map();
-  gen_map_t::iterator iter = the_map.find(language);
-
-  if (iter == the_map.end()) {
-    return NULL;
-  }
-
-  return iter->second->get_generator(program, parsed_options, options);
-}
-
-t_generator_registry::gen_map_t& t_generator_registry::get_generator_map() {
-  // http://www.parashift.com/c++-faq-lite/ctors.html#faq-10.12
-  static gen_map_t* the_map = new gen_map_t();
-  return *the_map;
-}
-
-t_generator_factory::t_generator_factory(const std::string& short_name,
-                                         const std::string& long_name,
-                                         const std::string& documentation)
-  : short_name_(short_name), long_name_(long_name), documentation_(documentation) {
-  t_generator_registry::register_generator(this);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.h b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.h
deleted file mode 100644
index 99d878a..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator.h
+++ /dev/null
@@ -1,285 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_GENERATOR_H
-#define T_GENERATOR_H
-
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include "parse/t_program.h"
-#include "globals.h"
-#include "t_generator_registry.h"
-
-/**
- * Base class for a thrift code generator. This class defines the basic
- * routines for code generation and contains the top level method that
- * dispatches code generation across various components.
- *
- */
-class t_generator {
-public:
-  t_generator(t_program* program) {
-    tmp_ = 0;
-    indent_ = 0;
-    program_ = program;
-    program_name_ = get_program_name(program);
-    escape_['\n'] = "\\n";
-    escape_['\r'] = "\\r";
-    escape_['\t'] = "\\t";
-    escape_['"'] = "\\\"";
-    escape_['\\'] = "\\\\";
-  }
-
-  virtual ~t_generator() {}
-
-  /**
-   * Framework generator method that iterates over all the parts of a program
-   * and performs general actions. This is implemented by the base class and
-   * should not normally be overwritten in the subclasses.
-   */
-  virtual void generate_program();
-
-  const t_program* get_program() const { return program_; }
-
-  void generate_docstring_comment(std::ostream& out,
-                                  const std::string& comment_start,
-                                  const std::string& line_prefix,
-                                  const std::string& contents,
-                                  const std::string& comment_end);
-
-  /**
-   * check whether sub-namespace declaraction is used by generator.
-   * e.g. allow
-   * namespace py.twisted bar
-   * to specify namespace to use when -gen py:twisted is specified.
-   * Will be called with subnamespace, i.e. is_valid_namespace("twisted")
-   * will be called for the above example.
-   */
-  static bool is_valid_namespace(const std::string& sub_namespace) {
-    (void)sub_namespace;
-    return false;
-  }
-
-  /**
-   * Escape string to use one in generated sources.
-   */
-  virtual std::string escape_string(const std::string& in) const;
-
-  std::string get_escaped_string(t_const_value* constval) {
-    return escape_string(constval->get_string());
-  }
-
-protected:
-  /**
-   * Optional methods that may be imlemented by subclasses to take necessary
-   * steps at the beginning or end of code generation.
-   */
-
-  virtual void init_generator() {}
-  virtual void close_generator() {}
-
-  virtual void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Pure virtual methods implemented by the generator subclasses.
-   */
-
-  virtual void generate_typedef(t_typedef* ttypedef) = 0;
-  virtual void generate_enum(t_enum* tenum) = 0;
-  virtual void generate_const(t_const* tconst) { (void)tconst; }
-  virtual void generate_struct(t_struct* tstruct) = 0;
-  virtual void generate_service(t_service* tservice) = 0;
-  virtual void generate_forward_declaration(t_struct*) {}
-  virtual void generate_xception(t_struct* txception) {
-    // By default exceptions are the same as structs
-    generate_struct(txception);
-  }
-
-  /**
-   * Method to get the program name, may be overridden
-   */
-  virtual std::string get_program_name(t_program* tprogram) { return tprogram->get_name(); }
-
-  /**
-   * Method to get the service name, may be overridden
-   */
-  virtual std::string get_service_name(t_service* tservice) { return tservice->get_name(); }
-
-  /**
-   * Get the current output directory
-   */
-  virtual std::string get_out_dir() const {
-    if (program_->is_out_path_absolute()) {
-      return program_->get_out_path() + "/";
-    }
-
-    return program_->get_out_path() + out_dir_base_ + "/";
-  }
-
-  /**
-   * Creates a unique temporary variable name, which is just "name" with a
-   * number appended to it (i.e. name35)
-   */
-  std::string tmp(std::string name) {
-    std::ostringstream out;
-    out << name << tmp_++;
-    return out.str();
-  }
-
-  /**
-   * Indentation level modifiers
-   */
-
-  void indent_up() { ++indent_; }
-
-  void indent_down() { --indent_; }
-
-  /**
-   * Indentation print function
-   */
-  std::string indent() {
-    std::string ind = "";
-    int i;
-    for (i = 0; i < indent_; ++i) {
-      ind += "  ";
-    }
-    return ind;
-  }
-
-  /**
-   * Indentation utility wrapper
-   */
-  std::ostream& indent(std::ostream& os) { return os << indent(); }
-
-  /**
-   * Capitalization helpers
-   */
-  std::string capitalize(std::string in) {
-    in[0] = toupper(in[0]);
-    return in;
-  }
-  std::string decapitalize(std::string in) {
-    in[0] = tolower(in[0]);
-    return in;
-  }
-  static std::string lowercase(std::string in) {
-    for (size_t i = 0; i < in.size(); ++i) {
-      in[i] = tolower(in[i]);
-    }
-    return in;
-  }
-  static std::string uppercase(std::string in) {
-    for (size_t i = 0; i < in.size(); ++i) {
-      in[i] = toupper(in[i]);
-    }
-    return in;
-  }
-  /**
-   * Transforms a camel case string to an equivalent one separated by underscores
-   * e.g. aMultiWord -> a_multi_word
-   *      someName   -> some_name
-   *      CamelCase  -> camel_case
-   *      name       -> name
-   *      Name       -> name
-   */
-  std::string underscore(std::string in) {
-    in[0] = tolower(in[0]);
-    for (size_t i = 1; i < in.size(); ++i) {
-      if (isupper(in[i])) {
-        in[i] = tolower(in[i]);
-        in.insert(i, "_");
-      }
-    }
-    return in;
-  }
-  /**
-    * Transforms a string with words separated by underscores to a camel case equivalent
-    * e.g. a_multi_word -> aMultiWord
-    *      some_name    ->  someName
-    *      name         ->  name
-    */
-  std::string camelcase(std::string in) {
-    std::ostringstream out;
-    bool underscore = false;
-
-    for (size_t i = 0; i < in.size(); i++) {
-      if (in[i] == '_') {
-        underscore = true;
-        continue;
-      }
-      if (underscore) {
-        out << (char)toupper(in[i]);
-        underscore = false;
-        continue;
-      }
-      out << in[i];
-    }
-
-    return out.str();
-  }
-
-public:
-  /**
-   * Get the true type behind a series of typedefs.
-   */
-  static t_type* get_true_type(t_type* type) { return type->get_true_type(); }
-
-protected:
-  /**
-   * The program being generated
-   */
-  t_program* program_;
-
-  /**
-   * Quick accessor for formatted program name that is currently being
-   * generated.
-   */
-  std::string program_name_;
-
-  /**
-   * Quick accessor for formatted service name that is currently being
-   * generated.
-   */
-  std::string service_name_;
-
-  /**
-   * Output type-specifc directory name ("gen-*")
-   */
-  std::string out_dir_base_;
-
-  /**
-   * Map of characters to escape in string literals.
-   */
-  std::map<char, std::string> escape_;
-
-private:
-  /**
-   * Current code indentation level
-   */
-  int indent_;
-
-  /**
-   * Temporary variable counter, for making unique variable names
-   */
-  int tmp_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator_registry.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator_registry.h b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator_registry.h
deleted file mode 100644
index a852385..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_generator_registry.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_GENERATOR_REGISTRY_H
-#define T_GENERATOR_REGISTRY_H
-
-class t_generator;
-
-/**
- * A factory for producing generator classes of a particular language.
- *
- * This class is also responsible for:
- *  - Registering itself with the generator registry.
- *  - Providing documentation for the generators it produces.
- */
-class t_generator_factory {
-public:
-  t_generator_factory(const std::string& short_name,
-                      const std::string& long_name,
-                      const std::string& documentation);
-
-  virtual ~t_generator_factory() {}
-
-  virtual t_generator* get_generator(
-      // The program to generate.
-      t_program* program,
-      // Note: parsed_options will not exist beyond the call to get_generator.
-      const std::map<std::string, std::string>& parsed_options,
-      // Note: option_string might not exist beyond the call to get_generator.
-      const std::string& option_string) = 0;
-
-  virtual bool is_valid_namespace(const std::string& sub_namespace) = 0;
-
-  std::string get_short_name() { return short_name_; }
-  std::string get_long_name() { return long_name_; }
-  std::string get_documentation() { return documentation_; }
-
-private:
-  std::string short_name_;
-  std::string long_name_;
-  std::string documentation_;
-};
-
-template <typename generator>
-class t_generator_factory_impl : public t_generator_factory {
-public:
-  t_generator_factory_impl(const std::string& short_name,
-                           const std::string& long_name,
-                           const std::string& documentation)
-    : t_generator_factory(short_name, long_name, documentation) {}
-
-  virtual t_generator* get_generator(t_program* program,
-                                     const std::map<std::string, std::string>& parsed_options,
-                                     const std::string& option_string) {
-    return new generator(program, parsed_options, option_string);
-  }
-
-  virtual bool is_valid_namespace(const std::string& sub_namespace) {
-    return generator::is_valid_namespace(sub_namespace);
-  }
-};
-
-class t_generator_registry {
-public:
-  static void register_generator(t_generator_factory* factory);
-
-  static t_generator* get_generator(t_program* program, const std::string& options);
-
-  typedef std::map<std::string, t_generator_factory*> gen_map_t;
-  static gen_map_t& get_generator_map();
-
-private:
-  t_generator_registry();
-  t_generator_registry(const t_generator_registry&);
-};
-
-#define THRIFT_REGISTER_GENERATOR(language, long_name, doc)                                        \
-  class t_##language##_generator_factory_impl                                                      \
-      : public t_generator_factory_impl<t_##language##_generator> {                                \
-  public:                                                                                          \
-    t_##language##_generator_factory_impl()                                                        \
-      : t_generator_factory_impl<t_##language##_generator>(#language, long_name, doc) {}           \
-  };                                                                                               \
-  static t_##language##_generator_factory_impl _registerer;
-
-#endif


[23/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/globals.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/globals.h b/depends/thirdparty/thrift/compiler/cpp/src/globals.h
deleted file mode 100644
index af90616..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/globals.h
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_GLOBALS_H
-#define T_GLOBALS_H
-
-#include <set>
-#include <queue>
-#include <stack>
-#include <vector>
-#include <string>
-
-/**
- * This module contains all the global variables (slap on the wrist) that are
- * shared throughout the program. The reason for this is to facilitate simple
- * interaction between the parser and the rest of the program. Before calling
- * yyparse(), the main.cc program will make necessary adjustments to these
- * global variables such that the parser does the right thing and puts entries
- * into the right containers, etc.
- *
- */
-
-/**
- * Hooray for forward declaration of types!
- */
-
-class t_program;
-class t_scope;
-class t_type;
-
-/**
- * Parsing mode, two passes up in this gin rummy!
- */
-
-enum PARSE_MODE { INCLUDES = 1, PROGRAM = 2 };
-
-/**
- * Strictness level
- */
-extern int g_strict;
-
-/**
- * The master program parse tree. This is accessed from within the parser code
- * to build up the program elements.
- */
-extern t_program* g_program;
-
-/**
- * Global types for the parser to be able to reference
- */
-
-extern t_type* g_type_void;
-extern t_type* g_type_string;
-extern t_type* g_type_binary;
-extern t_type* g_type_slist;
-extern t_type* g_type_bool;
-extern t_type* g_type_byte;
-extern t_type* g_type_i16;
-extern t_type* g_type_i32;
-extern t_type* g_type_i64;
-extern t_type* g_type_double;
-
-/**
- * The scope that we are currently parsing into
- */
-extern t_scope* g_scope;
-
-/**
- * The parent scope to also load symbols into
- */
-extern t_scope* g_parent_scope;
-
-/**
- * The prefix for the parent scope entries
- */
-extern std::string g_parent_prefix;
-
-/**
- * The parsing pass that we are on. We do different things on each pass.
- */
-extern PARSE_MODE g_parse_mode;
-
-/**
- * Global time string, used in formatting error messages etc.
- */
-extern char* g_time_str;
-
-/**
- * The last parsed doctext comment.
- */
-extern char* g_doctext;
-
-/**
- * The location of the last parsed doctext comment.
- */
-extern int g_doctext_lineno;
-
-/**
- * Status of program level doctext candidate
- */
-enum PROGDOCTEXT_STATUS {
-  INVALID = 0,
-  STILL_CANDIDATE = 1,   // the text may or may not be the program doctext
-  ALREADY_PROCESSED = 2, // doctext has been used and is no longer available
-  ABSOLUTELY_SURE = 3,   // this is the program doctext
-  NO_PROGRAM_DOCTEXT = 4 // there is no program doctext
-};
-
-/**
- * The program level doctext. Stored separately to make parsing easier.
- */
-extern char* g_program_doctext_candidate;
-extern int g_program_doctext_lineno;
-extern PROGDOCTEXT_STATUS g_program_doctext_status;
-
-/**
- * Whether or not negative field keys are accepted.
- *
- * When a field does not have a user-specified key, thrift automatically
- * assigns a negative value.  However, this is fragile since changes to the
- * file may unintentionally change the key numbering, resulting in a new
- * protocol that is not backwards compatible.
- *
- * When g_allow_neg_field_keys is enabled, users can explicitly specify
- * negative keys.  This way they can write a .thrift file with explicitly
- * specified keys that is still backwards compatible with older .thrift files
- * that did not specify key values.
- */
-extern int g_allow_neg_field_keys;
-
-/**
- * Whether or not 64-bit constants will generate a warning.
- *
- * Some languages don't support 64-bit constants, but many do, so we can
- * suppress this warning for projects that don't use any non-64-bit-safe
- * languages.
- */
-extern int g_allow_64bit_consts;
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/logging.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/logging.h b/depends/thirdparty/thrift/compiler/cpp/src/logging.h
deleted file mode 100644
index 3f1fce8..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/logging.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_LOGGING_H
-#define T_LOGGING_H
-
-#include <string>
-
-/**
- * Parse debugging output, used to print helpful info
- */
-void pdebug(const char* fmt, ...);
-
-/**
- * Parser warning
- */
-void pwarning(int level, const char* fmt, ...);
-
-/**
- * Print verbose output message
- */
-void pverbose(const char* fmt, ...);
-
-/**
- * Failure!
- */
-void failure(const char* fmt, ...);
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/main.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/main.cc b/depends/thirdparty/thrift/compiler/cpp/src/main.cc
deleted file mode 100644
index e11d9b0..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/main.cc
+++ /dev/null
@@ -1,1290 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * thrift - a lightweight cross-language rpc/serialization tool
- *
- * This file contains the main compiler engine for Thrift, which invokes the
- * scanner/parser to build the thrift object tree. The interface generation
- * code for each language lives in a file by the language name under the
- * generate/ folder, and all parse structures live in parse/
- *
- */
-
-#include <cassert>
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <time.h>
-#include <string>
-#include <algorithm>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <errno.h>
-#include <limits.h>
-
-#ifdef _WIN32
-#include <windows.h> /* for GetFullPathName */
-#endif
-
-// Careful: must include globals first for extern definitions
-#include "globals.h"
-
-#include "platform.h"
-#include "main.h"
-#include "parse/t_program.h"
-#include "parse/t_scope.h"
-#include "generate/t_generator.h"
-#include "audit/t_audit.h"
-
-#include "version.h"
-
-using namespace std;
-
-/**
- * Global program tree
- */
-t_program* g_program;
-
-/**
- * Global types
- */
-
-t_type* g_type_void;
-t_type* g_type_string;
-t_type* g_type_binary;
-t_type* g_type_slist;
-t_type* g_type_bool;
-t_type* g_type_byte;
-t_type* g_type_i16;
-t_type* g_type_i32;
-t_type* g_type_i64;
-t_type* g_type_double;
-
-/**
- * Global scope
- */
-t_scope* g_scope;
-
-/**
- * Parent scope to also parse types
- */
-t_scope* g_parent_scope;
-
-/**
- * Prefix for putting types in parent scope
- */
-string g_parent_prefix;
-
-/**
- * Parsing pass
- */
-PARSE_MODE g_parse_mode;
-
-/**
- * Current directory of file being parsed
- */
-string g_curdir;
-
-/**
- * Current file being parsed
- */
-string g_curpath;
-
-/**
- * Search path for inclusions
- */
-vector<string> g_incl_searchpath;
-
-/**
- * Global debug state
- */
-int g_debug = 0;
-
-/**
- * Strictness level
- */
-int g_strict = 127;
-
-/**
- * Warning level
- */
-int g_warn = 1;
-
-/**
- * Verbose output
- */
-int g_verbose = 0;
-
-/**
- * Global time string
- */
-char* g_time_str;
-
-/**
- * The last parsed doctext comment.
- */
-char* g_doctext;
-
-/**
- * The location of the last parsed doctext comment.
- */
-int g_doctext_lineno;
-
-/**
- * The First doctext comment
- */
-char* g_program_doctext_candidate;
-int g_program_doctext_lineno = 0;
-PROGDOCTEXT_STATUS g_program_doctext_status = INVALID;
-
-/**
- * Whether or not negative field keys are accepted.
- */
-int g_allow_neg_field_keys;
-
-/**
- * Whether or not 64-bit constants will generate a warning.
- */
-int g_allow_64bit_consts = 0;
-
-/**
- * Flags to control code generation
- */
-bool gen_recurse = false;
-
-/**
- * Flags to control thrift audit
- */
-bool g_audit = false;
-
-/**
- * Flag to control return status
- */
-bool g_return_failure = false;
-bool g_audit_fatal = true;
-
-/**
- * Win32 doesn't have realpath, so use fallback implementation in that case,
- * otherwise this just calls through to realpath
- */
-char* saferealpath(const char* path, char* resolved_path) {
-#ifdef _WIN32
-  char buf[MAX_PATH];
-  char* basename;
-  DWORD len = GetFullPathName(path, MAX_PATH, buf, &basename);
-  if (len == 0 || len > MAX_PATH - 1) {
-    strcpy(resolved_path, path);
-  } else {
-    strcpy(resolved_path, buf);
-  }
-
-  // Replace backslashes with forward slashes so the
-  // rest of the code behaves correctly.
-  size_t resolved_len = strlen(resolved_path);
-  for (size_t i = 0; i < resolved_len; i++) {
-    if (resolved_path[i] == '\\') {
-      resolved_path[i] = '/';
-    }
-  }
-  return resolved_path;
-#else
-  return realpath(path, resolved_path);
-#endif
-}
-
-bool check_is_directory(const char* dir_name) {
-#ifdef _WIN32
-  DWORD attributes = ::GetFileAttributesA(dir_name);
-  if (attributes == INVALID_FILE_ATTRIBUTES) {
-    fprintf(stderr,
-            "Output directory %s is unusable: GetLastError() = %ld\n",
-            dir_name,
-            GetLastError());
-    return false;
-  }
-  if ((attributes & FILE_ATTRIBUTE_DIRECTORY) != FILE_ATTRIBUTE_DIRECTORY) {
-    fprintf(stderr, "Output directory %s exists but is not a directory\n", dir_name);
-    return false;
-  }
-  return true;
-#else
-  struct stat sb;
-  if (stat(dir_name, &sb) < 0) {
-    fprintf(stderr, "Output directory %s is unusable: %s\n", dir_name, strerror(errno));
-    return false;
-  }
-  if (!S_ISDIR(sb.st_mode)) {
-    fprintf(stderr, "Output directory %s exists but is not a directory\n", dir_name);
-    return false;
-  }
-  return true;
-#endif
-}
-
-/**
- * Report an error to the user. This is called yyerror for historical
- * reasons (lex and yacc expect the error reporting routine to be called
- * this). Call this function to report any errors to the user.
- * yyerror takes printf style arguments.
- *
- * @param fmt C format string followed by additional arguments
- */
-void yyerror(const char* fmt, ...) {
-  va_list args;
-  fprintf(stderr, "[ERROR:%s:%d] (last token was '%s')\n", g_curpath.c_str(), yylineno, yytext);
-
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  va_end(args);
-
-  fprintf(stderr, "\n");
-}
-
-/**
- * Prints a debug message from the parser.
- *
- * @param fmt C format string followed by additional arguments
- */
-void pdebug(const char* fmt, ...) {
-  if (g_debug == 0) {
-    return;
-  }
-  va_list args;
-  printf("[PARSE:%d] ", yylineno);
-  va_start(args, fmt);
-  vprintf(fmt, args);
-  va_end(args);
-  printf("\n");
-}
-
-/**
- * Prints a verbose output mode message
- *
- * @param fmt C format string followed by additional arguments
- */
-void pverbose(const char* fmt, ...) {
-  if (g_verbose == 0) {
-    return;
-  }
-  va_list args;
-  va_start(args, fmt);
-  vprintf(fmt, args);
-  va_end(args);
-}
-
-/**
- * Prints a warning message
- *
- * @param fmt C format string followed by additional arguments
- */
-void pwarning(int level, const char* fmt, ...) {
-  if (g_warn < level) {
-    return;
-  }
-  va_list args;
-  printf("[WARNING:%s:%d] ", g_curpath.c_str(), yylineno);
-  va_start(args, fmt);
-  vprintf(fmt, args);
-  va_end(args);
-  printf("\n");
-}
-
-/**
- * Prints a failure message and exits
- *
- * @param fmt C format string followed by additional arguments
- */
-void failure(const char* fmt, ...) {
-  va_list args;
-  fprintf(stderr, "[FAILURE:%s:%d] ", g_curpath.c_str(), yylineno);
-  va_start(args, fmt);
-  vfprintf(stderr, fmt, args);
-  va_end(args);
-  printf("\n");
-  exit(1);
-}
-
-/**
- * Converts a string filename into a thrift program name
- */
-string program_name(string filename) {
-  string::size_type slash = filename.rfind("/");
-  if (slash != string::npos) {
-    filename = filename.substr(slash + 1);
-  }
-  string::size_type dot = filename.rfind(".");
-  if (dot != string::npos) {
-    filename = filename.substr(0, dot);
-  }
-  return filename;
-}
-
-/**
- * Gets the directory path of a filename
- */
-string directory_name(string filename) {
-  string::size_type slash = filename.rfind("/");
-  // No slash, just use the current directory
-  if (slash == string::npos) {
-    return ".";
-  }
-  return filename.substr(0, slash);
-}
-
-/**
- * Finds the appropriate file path for the given filename
- */
-string include_file(string filename) {
-  // Absolute path? Just try that
-  if (filename[0] == '/') {
-    // Realpath!
-    char rp[THRIFT_PATH_MAX];
-    if (saferealpath(filename.c_str(), rp) == NULL) {
-      pwarning(0, "Cannot open include file %s\n", filename.c_str());
-      return std::string();
-    }
-
-    // Stat this file
-    struct stat finfo;
-    if (stat(rp, &finfo) == 0) {
-      return rp;
-    }
-  } else { // relative path, start searching
-    // new search path with current dir global
-    vector<string> sp = g_incl_searchpath;
-    sp.insert(sp.begin(), g_curdir);
-
-    // iterate through paths
-    vector<string>::iterator it;
-    for (it = sp.begin(); it != sp.end(); it++) {
-      string sfilename = *(it) + "/" + filename;
-
-      // Realpath!
-      char rp[THRIFT_PATH_MAX];
-      if (saferealpath(sfilename.c_str(), rp) == NULL) {
-        continue;
-      }
-
-      // Stat this files
-      struct stat finfo;
-      if (stat(rp, &finfo) == 0) {
-        return rp;
-      }
-    }
-  }
-
-  // Uh oh
-  pwarning(0, "Could not find include file %s\n", filename.c_str());
-  return std::string();
-}
-
-/**
- * Clears any previously stored doctext string.
- * Also prints a warning if we are discarding information.
- */
-void clear_doctext() {
-  if (g_doctext != NULL) {
-    pwarning(2, "Uncaptured doctext at on line %d.", g_doctext_lineno);
-  }
-  free(g_doctext);
-  g_doctext = NULL;
-}
-
-/**
- * Reset program doctext information after processing a file
- */
-void reset_program_doctext_info() {
-  if (g_program_doctext_candidate != NULL) {
-    free(g_program_doctext_candidate);
-    g_program_doctext_candidate = NULL;
-  }
-  g_program_doctext_lineno = 0;
-  g_program_doctext_status = INVALID;
-  pdebug("%s", "program doctext set to INVALID");
-}
-
-/**
- * We are sure the program doctext candidate is really the program doctext.
- */
-void declare_valid_program_doctext() {
-  if ((g_program_doctext_candidate != NULL) && (g_program_doctext_status == STILL_CANDIDATE)) {
-    g_program_doctext_status = ABSOLUTELY_SURE;
-    pdebug("%s", "program doctext set to ABSOLUTELY_SURE");
-  } else {
-    g_program_doctext_status = NO_PROGRAM_DOCTEXT;
-    pdebug("%s", "program doctext set to NO_PROGRAM_DOCTEXT");
-  }
-}
-
-/**
- * Cleans up text commonly found in doxygen-like comments
- *
- * Warning: if you mix tabs and spaces in a non-uniform way,
- * you will get what you deserve.
- */
-char* clean_up_doctext(char* doctext) {
-  // Convert to C++ string, and remove Windows's carriage returns.
-  string docstring = doctext;
-  docstring.erase(remove(docstring.begin(), docstring.end(), '\r'), docstring.end());
-
-  // Separate into lines.
-  vector<string> lines;
-  string::size_type pos = string::npos;
-  string::size_type last;
-  while (true) {
-    last = (pos == string::npos) ? 0 : pos + 1;
-    pos = docstring.find('\n', last);
-    if (pos == string::npos) {
-      // First bit of cleaning.  If the last line is only whitespace, drop it.
-      string::size_type nonwhite = docstring.find_first_not_of(" \t", last);
-      if (nonwhite != string::npos) {
-        lines.push_back(docstring.substr(last));
-      }
-      break;
-    }
-    lines.push_back(docstring.substr(last, pos - last));
-  }
-
-  // A very profound docstring.
-  if (lines.empty()) {
-    return NULL;
-  }
-
-  // Clear leading whitespace from the first line.
-  pos = lines.front().find_first_not_of(" \t");
-  lines.front().erase(0, pos);
-
-  // If every nonblank line after the first has the same number of spaces/tabs,
-  // then a star, remove them.
-  bool have_prefix = true;
-  bool found_prefix = false;
-  string::size_type prefix_len = 0;
-  vector<string>::iterator l_iter;
-  for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
-    if (l_iter->empty()) {
-      continue;
-    }
-
-    pos = l_iter->find_first_not_of(" \t");
-    if (!found_prefix) {
-      if (pos != string::npos) {
-        if (l_iter->at(pos) == '*') {
-          found_prefix = true;
-          prefix_len = pos;
-        } else {
-          have_prefix = false;
-          break;
-        }
-      } else {
-        // Whitespace-only line.  Truncate it.
-        l_iter->clear();
-      }
-    } else if (l_iter->size() > pos && l_iter->at(pos) == '*' && pos == prefix_len) {
-      // Business as usual.
-    } else if (pos == string::npos) {
-      // Whitespace-only line.  Let's truncate it for them.
-      l_iter->clear();
-    } else {
-      // The pattern has been broken.
-      have_prefix = false;
-      break;
-    }
-  }
-
-  // If our prefix survived, delete it from every line.
-  if (have_prefix) {
-    // Get the star too.
-    prefix_len++;
-    for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
-      l_iter->erase(0, prefix_len);
-    }
-  }
-
-  // Now delete the minimum amount of leading whitespace from each line.
-  prefix_len = string::npos;
-  for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
-    if (l_iter->empty()) {
-      continue;
-    }
-    pos = l_iter->find_first_not_of(" \t");
-    if (pos != string::npos && (prefix_len == string::npos || pos < prefix_len)) {
-      prefix_len = pos;
-    }
-  }
-
-  // If our prefix survived, delete it from every line.
-  if (prefix_len != string::npos) {
-    for (l_iter = lines.begin() + 1; l_iter != lines.end(); ++l_iter) {
-      l_iter->erase(0, prefix_len);
-    }
-  }
-
-  // Remove trailing whitespace from every line.
-  for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
-    pos = l_iter->find_last_not_of(" \t");
-    if (pos != string::npos && pos != l_iter->length() - 1) {
-      l_iter->erase(pos + 1);
-    }
-  }
-
-  // If the first line is empty, remove it.
-  // Don't do this earlier because a lot of steps skip the first line.
-  if (lines.front().empty()) {
-    lines.erase(lines.begin());
-  }
-
-  // Now rejoin the lines and copy them back into doctext.
-  docstring.clear();
-  for (l_iter = lines.begin(); l_iter != lines.end(); ++l_iter) {
-    docstring += *l_iter;
-    docstring += '\n';
-  }
-
-  // assert(docstring.length() <= strlen(doctext));  may happen, see THRIFT-1755
-  if (docstring.length() <= strlen(doctext)) {
-    strcpy(doctext, docstring.c_str());
-  } else {
-    free(doctext); // too short
-    doctext = strdup(docstring.c_str());
-  }
-  return doctext;
-}
-
-/** Set to true to debug docstring parsing */
-static bool dump_docs = false;
-
-/**
- * Dumps docstrings to stdout
- * Only works for top-level definitions and the whole program doc
- * (i.e., not enum constants, struct fields, or functions.
- */
-void dump_docstrings(t_program* program) {
-  string progdoc = program->get_doc();
-  if (!progdoc.empty()) {
-    printf("Whole program doc:\n%s\n", progdoc.c_str());
-  }
-  const vector<t_typedef*>& typedefs = program->get_typedefs();
-  vector<t_typedef*>::const_iterator t_iter;
-  for (t_iter = typedefs.begin(); t_iter != typedefs.end(); ++t_iter) {
-    t_typedef* td = *t_iter;
-    if (td->has_doc()) {
-      printf("typedef %s:\n%s\n", td->get_name().c_str(), td->get_doc().c_str());
-    }
-  }
-  const vector<t_enum*>& enums = program->get_enums();
-  vector<t_enum*>::const_iterator e_iter;
-  for (e_iter = enums.begin(); e_iter != enums.end(); ++e_iter) {
-    t_enum* en = *e_iter;
-    if (en->has_doc()) {
-      printf("enum %s:\n%s\n", en->get_name().c_str(), en->get_doc().c_str());
-    }
-  }
-  const vector<t_const*>& consts = program->get_consts();
-  vector<t_const*>::const_iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    t_const* co = *c_iter;
-    if (co->has_doc()) {
-      printf("const %s:\n%s\n", co->get_name().c_str(), co->get_doc().c_str());
-    }
-  }
-  const vector<t_struct*>& structs = program->get_structs();
-  vector<t_struct*>::const_iterator s_iter;
-  for (s_iter = structs.begin(); s_iter != structs.end(); ++s_iter) {
-    t_struct* st = *s_iter;
-    if (st->has_doc()) {
-      printf("struct %s:\n%s\n", st->get_name().c_str(), st->get_doc().c_str());
-    }
-  }
-  const vector<t_struct*>& xceptions = program->get_xceptions();
-  vector<t_struct*>::const_iterator x_iter;
-  for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-    t_struct* xn = *x_iter;
-    if (xn->has_doc()) {
-      printf("xception %s:\n%s\n", xn->get_name().c_str(), xn->get_doc().c_str());
-    }
-  }
-  const vector<t_service*>& services = program->get_services();
-  vector<t_service*>::const_iterator v_iter;
-  for (v_iter = services.begin(); v_iter != services.end(); ++v_iter) {
-    t_service* sv = *v_iter;
-    if (sv->has_doc()) {
-      printf("service %s:\n%s\n", sv->get_name().c_str(), sv->get_doc().c_str());
-    }
-  }
-}
-
-/**
- * Emits a warning on list<byte>, binary type is typically a much better choice.
- */
-void check_for_list_of_bytes(t_type* list_elem_type) {
-  if ((g_parse_mode == PROGRAM) && (list_elem_type != NULL) && list_elem_type->is_base_type()) {
-    t_base_type* tbase = (t_base_type*)list_elem_type;
-    if (tbase->get_base() == t_base_type::TYPE_BYTE) {
-      pwarning(1, "Consider using the more efficient \"binary\" type instead of \"list<byte>\".");
-    }
-  }
-}
-
-/**
- * Prints the version number
- */
-void version() {
-  printf("Thrift version %s\n", THRIFT_VERSION);
-}
-
-/**
- * Display the usage message and then exit with an error code.
- */
-void usage() {
-  fprintf(stderr, "Usage: thrift [options] file\n\n");
-  fprintf(stderr, "Use thrift -help for a list of options\n");
-  exit(1);
-}
-
-/**
- * Diplays the help message and then exits with an error code.
- */
-void help() {
-  fprintf(stderr, "Usage: thrift [options] file\n");
-  fprintf(stderr, "Options:\n");
-  fprintf(stderr, "  -version    Print the compiler version\n");
-  fprintf(stderr, "  -o dir      Set the output directory for gen-* packages\n");
-  fprintf(stderr, "               (default: current directory)\n");
-  fprintf(stderr, "  -out dir    Set the ouput location for generated files.\n");
-  fprintf(stderr, "               (no gen-* folder will be created)\n");
-  fprintf(stderr, "  -I dir      Add a directory to the list of directories\n");
-  fprintf(stderr, "                searched for include directives\n");
-  fprintf(stderr, "  -nowarn     Suppress all compiler warnings (BAD!)\n");
-  fprintf(stderr, "  -strict     Strict compiler warnings on\n");
-  fprintf(stderr, "  -v[erbose]  Verbose mode\n");
-  fprintf(stderr, "  -r[ecurse]  Also generate included files\n");
-  fprintf(stderr, "  -debug      Parse debug trace to stdout\n");
-  fprintf(stderr,
-          "  --allow-neg-keys  Allow negative field keys (Used to "
-          "preserve protocol\n");
-  fprintf(stderr, "                compatibility with older .thrift files)\n");
-  fprintf(stderr, "  --allow-64bit-consts  Do not print warnings about using 64-bit constants\n");
-  fprintf(stderr, "  --gen STR   Generate code with a dynamically-registered generator.\n");
-  fprintf(stderr, "                STR has the form language[:key1=val1[,key2[,key3=val3]]].\n");
-  fprintf(stderr, "                Keys and values are options passed to the generator.\n");
-  fprintf(stderr, "                Many options will not require values.\n");
-  fprintf(stderr, "\n");
-  fprintf(stderr, "Options related to audit operation\n");
-  fprintf(stderr, "   --audit OldFile   Old Thrift file to be audited with 'file'\n");
-  fprintf(stderr, "  -Iold dir    Add a directory to the list of directories\n");
-  fprintf(stderr, "                searched for include directives for old thrift file\n");
-  fprintf(stderr, "  -Inew dir    Add a directory to the list of directories\n");
-  fprintf(stderr, "                searched for include directives for new thrift file\n");
-  fprintf(stderr, "\n");
-  fprintf(stderr, "Available generators (and options):\n");
-
-  t_generator_registry::gen_map_t gen_map = t_generator_registry::get_generator_map();
-  t_generator_registry::gen_map_t::iterator iter;
-  for (iter = gen_map.begin(); iter != gen_map.end(); ++iter) {
-    fprintf(stderr,
-            "  %s (%s):\n",
-            iter->second->get_short_name().c_str(),
-            iter->second->get_long_name().c_str());
-    fprintf(stderr, "%s", iter->second->get_documentation().c_str());
-  }
-  exit(1);
-}
-
-/**
- * You know, when I started working on Thrift I really thought it wasn't going
- * to become a programming language because it was just a generator and it
- * wouldn't need runtime type information and all that jazz. But then we
- * decided to add constants, and all of a sudden that means runtime type
- * validation and inference, except the "runtime" is the code generator
- * runtime.
- */
-void validate_const_rec(std::string name, t_type* type, t_const_value* value) {
-  if (type->is_void()) {
-    throw "type error: cannot declare a void const: " + name;
-  }
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      if (value->get_type() != t_const_value::CV_STRING) {
-        throw "type error: const \"" + name + "\" was declared as string";
-      }
-      break;
-    case t_base_type::TYPE_BOOL:
-      if (value->get_type() != t_const_value::CV_INTEGER) {
-        throw "type error: const \"" + name + "\" was declared as bool";
-      }
-      break;
-    case t_base_type::TYPE_BYTE:
-      if (value->get_type() != t_const_value::CV_INTEGER) {
-        throw "type error: const \"" + name + "\" was declared as byte";
-      }
-      break;
-    case t_base_type::TYPE_I16:
-      if (value->get_type() != t_const_value::CV_INTEGER) {
-        throw "type error: const \"" + name + "\" was declared as i16";
-      }
-      break;
-    case t_base_type::TYPE_I32:
-      if (value->get_type() != t_const_value::CV_INTEGER) {
-        throw "type error: const \"" + name + "\" was declared as i32";
-      }
-      break;
-    case t_base_type::TYPE_I64:
-      if (value->get_type() != t_const_value::CV_INTEGER) {
-        throw "type error: const \"" + name + "\" was declared as i64";
-      }
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() != t_const_value::CV_INTEGER
-          && value->get_type() != t_const_value::CV_DOUBLE) {
-        throw "type error: const \"" + name + "\" was declared as double";
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase) + name;
-    }
-  } else if (type->is_enum()) {
-    if (value->get_type() != t_const_value::CV_IDENTIFIER) {
-      throw "type error: const \"" + name + "\" was declared as enum";
-    }
-
-    // see if there's a dot in the identifier
-    std::string name_portion = value->get_identifier_name();
-
-    const vector<t_enum_value*>& enum_values = ((t_enum*)type)->get_constants();
-    vector<t_enum_value*>::const_iterator c_iter;
-    bool found = false;
-
-    for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-      if ((*c_iter)->get_name() == name_portion) {
-        found = true;
-        break;
-      }
-    }
-    if (!found) {
-      throw "type error: const " + name + " was declared as type " + type->get_name()
-          + " which is an enum, but " + value->get_identifier()
-          + " is not a valid value for that enum";
-    }
-  } else if (type->is_struct() || type->is_xception()) {
-    if (value->get_type() != t_const_value::CV_MAP) {
-      throw "type error: const \"" + name + "\" was declared as struct/xception";
-    }
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      if (v_iter->first->get_type() != t_const_value::CV_STRING) {
-        throw "type error: " + name + " struct key must be string";
-      }
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-
-      validate_const_rec(name + "." + v_iter->first->get_string(), field_type, v_iter->second);
-    }
-  } else if (type->is_map()) {
-    t_type* k_type = ((t_map*)type)->get_key_type();
-    t_type* v_type = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      validate_const_rec(name + "<key>", k_type, v_iter->first);
-      validate_const_rec(name + "<val>", v_type, v_iter->second);
-    }
-  } else if (type->is_list() || type->is_set()) {
-    t_type* e_type;
-    if (type->is_list()) {
-      e_type = ((t_list*)type)->get_elem_type();
-    } else {
-      e_type = ((t_set*)type)->get_elem_type();
-    }
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      validate_const_rec(name + "<elem>", e_type, *v_iter);
-    }
-  }
-}
-
-/**
- * Check simple identifier names
- * It's easier to do it this way instead of rewriting the whole grammar etc.
- */
-void validate_simple_identifier(const char* identifier) {
-  string name(identifier);
-  if (name.find(".") != string::npos) {
-    yyerror("Identifier %s can't have a dot.", identifier);
-    exit(1);
-  }
-}
-
-/**
- * Check the type of the parsed const information against its declared type
- */
-void validate_const_type(t_const* c) {
-  validate_const_rec(c->get_name(), c->get_type(), c->get_value());
-}
-
-/**
- * Check the type of a default value assigned to a field.
- */
-void validate_field_value(t_field* field, t_const_value* cv) {
-  validate_const_rec(field->get_name(), field->get_type(), cv);
-}
-
-/**
- * Check that all the elements of a throws block are actually exceptions.
- */
-bool validate_throws(t_struct* throws) {
-  const vector<t_field*>& members = throws->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (!t_generator::get_true_type((*m_iter)->get_type())->is_xception()) {
-      return false;
-    }
-  }
-  return true;
-}
-
-/**
- * Skips UTF-8 BOM if there is one
- */
-bool skip_utf8_bom(FILE* f) {
-
-  // pretty straightforward, but works
-  if (fgetc(f) == 0xEF) {
-    if (fgetc(f) == 0xBB) {
-      if (fgetc(f) == 0xBF) {
-        return true;
-      }
-    }
-  }
-
-  rewind(f);
-  return false;
-}
-
-/**
- * Parses a program
- */
-void parse(t_program* program, t_program* parent_program) {
-  // Get scope file path
-  string path = program->get_path();
-
-  // Set current dir global, which is used in the include_file function
-  g_curdir = directory_name(path);
-  g_curpath = path;
-
-  // Open the file
-  // skip UTF-8 BOM if there is one
-  yyin = fopen(path.c_str(), "r");
-  if (yyin == 0) {
-    failure("Could not open input file: \"%s\"", path.c_str());
-  }
-  if (skip_utf8_bom(yyin))
-    pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
-
-  // Create new scope and scan for includes
-  pverbose("Scanning %s for includes\n", path.c_str());
-  g_parse_mode = INCLUDES;
-  g_program = program;
-  g_scope = program->scope();
-  try {
-    yylineno = 1;
-    if (yyparse() != 0) {
-      failure("Parser error during include pass.");
-    }
-  } catch (string x) {
-    failure(x.c_str());
-  }
-  fclose(yyin);
-
-  // Recursively parse all the include programs
-  vector<t_program*>& includes = program->get_includes();
-  vector<t_program*>::iterator iter;
-  for (iter = includes.begin(); iter != includes.end(); ++iter) {
-    parse(*iter, program);
-  }
-
-  // reset program doctext status before parsing a new file
-  reset_program_doctext_info();
-
-  // Parse the program file
-  g_parse_mode = PROGRAM;
-  g_program = program;
-  g_scope = program->scope();
-  g_parent_scope = (parent_program != NULL) ? parent_program->scope() : NULL;
-  g_parent_prefix = program->get_name() + ".";
-  g_curpath = path;
-
-  // Open the file
-  // skip UTF-8 BOM if there is one
-  yyin = fopen(path.c_str(), "r");
-  if (yyin == 0) {
-    failure("Could not open input file: \"%s\"", path.c_str());
-  }
-  if (skip_utf8_bom(yyin))
-    pverbose("Skipped UTF-8 BOM at %s\n", path.c_str());
-
-  pverbose("Parsing %s for types\n", path.c_str());
-  yylineno = 1;
-  try {
-    if (yyparse() != 0) {
-      failure("Parser error during types pass.");
-    }
-  } catch (string x) {
-    failure(x.c_str());
-  }
-  fclose(yyin);
-}
-
-/**
- * Generate code
- */
-void generate(t_program* program, const vector<string>& generator_strings) {
-  // Oooohh, recursive code generation, hot!!
-  if (gen_recurse) {
-    const vector<t_program*>& includes = program->get_includes();
-    for (size_t i = 0; i < includes.size(); ++i) {
-      // Propagate output path from parent to child programs
-      includes[i]->set_out_path(program->get_out_path(), program->is_out_path_absolute());
-
-      generate(includes[i], generator_strings);
-    }
-  }
-
-  // Generate code!
-  try {
-    pverbose("Program: %s\n", program->get_path().c_str());
-
-    // Compute fingerprints. - not anymore, we do it on the fly now
-    // generate_all_fingerprints(program);
-
-    if (dump_docs) {
-      dump_docstrings(program);
-    }
-
-    vector<string>::const_iterator iter;
-    for (iter = generator_strings.begin(); iter != generator_strings.end(); ++iter) {
-      t_generator* generator = t_generator_registry::get_generator(program, *iter);
-
-      if (generator == NULL) {
-        pwarning(1, "Unable to get a generator for \"%s\".\n", iter->c_str());
-      } else {
-        pverbose("Generating \"%s\"\n", iter->c_str());
-        generator->generate_program();
-        delete generator;
-      }
-    }
-  } catch (string s) {
-    printf("Error: %s\n", s.c_str());
-  } catch (const char* exc) {
-    printf("Error: %s\n", exc);
-  }
-}
-
-void audit(t_program* new_program, t_program* old_program, string new_thrift_include_path, string old_thrift_include_path)
-{
-  vector<string> temp_incl_searchpath = g_incl_searchpath;
-  if(!old_thrift_include_path.empty()) {
-    g_incl_searchpath.push_back(old_thrift_include_path);
-  }
-
-  parse(old_program, NULL);
-
-  g_incl_searchpath = temp_incl_searchpath;
-  if(!new_thrift_include_path.empty()) {
-    g_incl_searchpath.push_back(new_thrift_include_path);
-  }
-
-  parse(new_program, NULL);
-
-  compare_namespace(new_program, old_program);
-  compare_services(new_program->get_services(), old_program->get_services());
-  compare_enums(new_program->get_enums(), old_program->get_enums());
-  compare_structs(new_program->get_structs(), old_program->get_structs());
-  compare_structs(new_program->get_xceptions(), old_program->get_xceptions());
-  compare_consts(new_program->get_consts(), old_program->get_consts());
-}
-
-/**
- * Parse it up.. then spit it back out, in pretty much every language. Alright
- * not that many languages, but the cool ones that we care about.
- */
-int main(int argc, char** argv) {
-  int i;
-  std::string out_path;
-  bool out_path_is_absolute = false;
-
-  // Setup time string
-  time_t now = time(NULL);
-  g_time_str = ctime(&now);
-
-  // Check for necessary arguments, you gotta have at least a filename and
-  // an output language flag
-  if (argc < 2) {
-    usage();
-  }
-
-  vector<string> generator_strings;
-  string old_thrift_include_path;
-  string new_thrift_include_path;
-  string old_input_file;
-
-  // Set the current path to a dummy value to make warning messages clearer.
-  g_curpath = "arguments";
-
-  // Hacky parameter handling... I didn't feel like using a library sorry!
-  for (i = 1; i < argc - 1; i++) {
-    char* arg;
-
-    arg = strtok(argv[i], " ");
-    while (arg != NULL) {
-      // Treat double dashes as single dashes
-      if (arg[0] == '-' && arg[1] == '-') {
-        ++arg;
-      }
-
-      if (strcmp(arg, "-help") == 0) {
-        help();
-      } else if (strcmp(arg, "-version") == 0) {
-        version();
-        exit(0);
-      } else if (strcmp(arg, "-debug") == 0) {
-        g_debug = 1;
-      } else if (strcmp(arg, "-nowarn") == 0) {
-        g_warn = 0;
-      } else if (strcmp(arg, "-strict") == 0) {
-        g_strict = 255;
-        g_warn = 2;
-      } else if (strcmp(arg, "-v") == 0 || strcmp(arg, "-verbose") == 0) {
-        g_verbose = 1;
-      } else if (strcmp(arg, "-r") == 0 || strcmp(arg, "-recurse") == 0) {
-        gen_recurse = true;
-      } else if (strcmp(arg, "-allow-neg-keys") == 0) {
-        g_allow_neg_field_keys = true;
-      } else if (strcmp(arg, "-allow-64bit-consts") == 0) {
-        g_allow_64bit_consts = true;
-      } else if (strcmp(arg, "-gen") == 0) {
-        arg = argv[++i];
-        if (arg == NULL) {
-          fprintf(stderr, "Missing generator specification\n");
-          usage();
-        }
-        generator_strings.push_back(arg);
-      } else if (strcmp(arg, "-I") == 0) {
-        // An argument of "-I\ asdf" is invalid and has unknown results
-        arg = argv[++i];
-
-        if (arg == NULL) {
-          fprintf(stderr, "Missing Include directory\n");
-          usage();
-        }
-        g_incl_searchpath.push_back(arg);
-      } else if ((strcmp(arg, "-o") == 0) || (strcmp(arg, "-out") == 0)) {
-        out_path_is_absolute = (strcmp(arg, "-out") == 0) ? true : false;
-        arg = argv[++i];
-        if (arg == NULL) {
-          fprintf(stderr, "-o: missing output directory\n");
-          usage();
-        }
-        out_path = arg;
-
-#ifdef _WIN32
-        // strip out trailing \ on Windows
-        std::string::size_type last = out_path.length() - 1;
-        if (out_path[last] == '\\') {
-          out_path.erase(last);
-        }
-#endif
-        if (!check_is_directory(out_path.c_str()))
-          return -1;
-      } else if (strcmp(arg, "-audit") == 0) {
-        g_audit = true;
-        arg = argv[++i];
-        if (arg == NULL) {
-          fprintf(stderr, "Missing old thrift file name for audit operation\n");
-          usage();
-        }
-        char old_thrift_file_rp[THRIFT_PATH_MAX];
-
-        if (saferealpath(arg, old_thrift_file_rp) == NULL) {
-          failure("Could not open input file with realpath: %s", arg);
-        }
-        old_input_file = string(old_thrift_file_rp);
-      } else if(strcmp(arg, "-audit-nofatal") == 0){
-        g_audit_fatal = false;
-      } else if (strcmp(arg, "-Iold") == 0) {
-        arg = argv[++i];
-        if (arg == NULL) {
-          fprintf(stderr, "Missing Include directory for old thrift file\n");
-          usage();
-        }
-        old_thrift_include_path = string(arg);
-      } else if (strcmp(arg, "-Inew") == 0) {
-        arg = argv[++i];
-        if(arg == NULL) {
-        fprintf(stderr, "Missing Include directory for new thrift file\n");
-        usage();
-        }
-        new_thrift_include_path = string(arg);
-      } else {
-        fprintf(stderr, "Unrecognized option: %s\n", arg);
-        usage();
-      }
-
-      // Tokenize more
-      arg = strtok(NULL, " ");
-    }
-  }
-
-  // display help
-  if ((strcmp(argv[argc - 1], "-help") == 0) || (strcmp(argv[argc - 1], "--help") == 0)) {
-    help();
-  }
-
-  // if you're asking for version, you have a right not to pass a file
-  if ((strcmp(argv[argc - 1], "-version") == 0) || (strcmp(argv[argc - 1], "--version") == 0)) {
-    version();
-    exit(0);
-  }
-
-  // Initialize global types
-  g_type_void = new t_base_type("void", t_base_type::TYPE_VOID);
-  g_type_string = new t_base_type("string", t_base_type::TYPE_STRING);
-  g_type_binary = new t_base_type("string", t_base_type::TYPE_STRING);
-  ((t_base_type*)g_type_binary)->set_binary(true);
-  g_type_slist = new t_base_type("string", t_base_type::TYPE_STRING);
-  ((t_base_type*)g_type_slist)->set_string_list(true);
-  g_type_bool = new t_base_type("bool", t_base_type::TYPE_BOOL);
-  g_type_byte = new t_base_type("byte", t_base_type::TYPE_BYTE);
-  g_type_i16 = new t_base_type("i16", t_base_type::TYPE_I16);
-  g_type_i32 = new t_base_type("i32", t_base_type::TYPE_I32);
-  g_type_i64 = new t_base_type("i64", t_base_type::TYPE_I64);
-  g_type_double = new t_base_type("double", t_base_type::TYPE_DOUBLE);
-
-  if(g_audit)
-  {
-    // Audit operation
-
-    if (old_input_file.empty()) {
-      fprintf(stderr, "Missing file name of old thrift file for audit\n");
-      usage();
-    }
-
-    char new_thrift_file_rp[THRIFT_PATH_MAX];
-    if (argv[i] == NULL) {
-      fprintf(stderr, "Missing file name of new thrift file for audit\n");
-      usage();
-    }
-    if (saferealpath(argv[i], new_thrift_file_rp) == NULL) {
-      failure("Could not open input file with realpath: %s", argv[i]);
-    }
-    string new_input_file(new_thrift_file_rp);
-
-    t_program new_program(new_input_file);
-    t_program old_program(old_input_file);
-
-    audit(&new_program, &old_program, new_thrift_include_path, old_thrift_include_path);
-
-  } else {
-    // Generate options
-    
-    // You gotta generate something!
-    if (generator_strings.empty()) {
-      fprintf(stderr, "No output language(s) specified\n");
-      usage();
-    }
-
-    // Real-pathify it
-    char rp[THRIFT_PATH_MAX];
-    if (argv[i] == NULL) {
-      fprintf(stderr, "Missing file name\n");
-      usage();
-    }
-    if (saferealpath(argv[i], rp) == NULL) {
-      failure("Could not open input file with realpath: %s", argv[i]);
-    }
-    string input_file(rp);
-
-    // Instance of the global parse tree
-    t_program* program = new t_program(input_file);
-    if (out_path.size()) {
-      program->set_out_path(out_path, out_path_is_absolute);
-    }
-
-    // Compute the cpp include prefix.
-    // infer this from the filename passed in
-    string input_filename = argv[i];
-    string include_prefix;
-
-    string::size_type last_slash = string::npos;
-    if ((last_slash = input_filename.rfind("/")) != string::npos) {
-      include_prefix = input_filename.substr(0, last_slash);
-    }
-
-    program->set_include_prefix(include_prefix);
-
-    // Parse it!
-    parse(program, NULL);
-
-    // The current path is not really relevant when we are doing generation.
-    // Reset the variable to make warning messages clearer.
-    g_curpath = "generation";
-    // Reset yylineno for the heck of it.  Use 1 instead of 0 because
-    // That is what shows up during argument parsing.
-    yylineno = 1;
-
-    // Generate it!
-    generate(program, generator_strings);
-    delete program;
-  }
-
-  // Clean up. Who am I kidding... this program probably orphans heap memory
-  // all over the place, but who cares because it is about to exit and it is
-  // all referenced and used by this wacky parse tree up until now anyways.
-
-  delete g_type_void;
-  delete g_type_string;
-  delete g_type_bool;
-  delete g_type_byte;
-  delete g_type_i16;
-  delete g_type_i32;
-  delete g_type_i64;
-  delete g_type_double;
-
-  // Finished
-  if (g_return_failure && g_audit_fatal) {
-    exit(2);
-  }
-  // Finished
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/main.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/main.h b/depends/thirdparty/thrift/compiler/cpp/src/main.h
deleted file mode 100644
index cd4b032..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/main.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_MAIN_H
-#define T_MAIN_H
-
-#include <string>
-#include <cstdio>
-
-#include "logging.h"
-
-#include "parse/t_const.h"
-#include "parse/t_field.h"
-
-/**
- * Defined in the flex library
- */
-
-extern "C" { int yylex(void); }
-
-int yyparse(void);
-
-/**
- * Expected to be defined by Flex/Bison
- */
-void yyerror(const char* fmt, ...);
-
-/**
- * Check simple identifier names
- */
-void validate_simple_identifier(const char* identifier);
-
-/**
- * Check constant types
- */
-void validate_const_type(t_const* c);
-
-/**
- * Check constant types
- */
-void validate_field_value(t_field* field, t_const_value* cv);
-
-/**
- * Check members of a throws block
- */
-bool validate_throws(t_struct* throws);
-
-/**
- * Converts a string filename into a thrift program name
- */
-std::string program_name(std::string filename);
-
-/**
- * Gets the directory path of a filename
- */
-std::string directory_name(std::string filename);
-
-/**
- * Get the absolute path for an include file
- */
-std::string include_file(std::string filename);
-
-/**
- * Clears any previously stored doctext string.
- */
-void clear_doctext();
-
-/**
- * Cleans up text commonly found in doxygen-like comments
- */
-char* clean_up_doctext(char* doctext);
-
-/**
- * We are sure the program doctext candidate is really the program doctext.
- */
-void declare_valid_program_doctext();
-
-/**
- * Emits a warning on list<byte>, binary type is typically a much better choice.
- */
-void check_for_list_of_bytes(t_type* list_elem_type);
-
-/**
- * Flex utilities
- */
-
-extern int yylineno;
-extern char yytext[];
-extern std::FILE* yyin;
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/md5.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/md5.c b/depends/thirdparty/thrift/compiler/cpp/src/md5.c
deleted file mode 100644
index c35d96c..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/md5.c
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
-  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */
-/* $Id: md5.c,v 1.6 2002/04/13 19:20:28 lpd Exp $ */
-/*
-  Independent implementation of MD5 (RFC 1321).
-
-  This code implements the MD5 Algorithm defined in RFC 1321, whose
-  text is available at
-	http://www.ietf.org/rfc/rfc1321.txt
-  The code is derived from the text of the RFC, including the test suite
-  (section A.5) but excluding the rest of Appendix A.  It does not include
-  any code or documentation that is identified in the RFC as being
-  copyrighted.
-
-  The original and principal author of md5.c is L. Peter Deutsch
-  <gh...@aladdin.com>.  Other authors are noted in the change history
-  that follows (in reverse chronological order):
-
-  2002-04-13 lpd Clarified derivation from RFC 1321; now handles byte order
-	either statically or dynamically; added missing #include <string.h>
-	in library.
-  2002-03-11 lpd Corrected argument list for main(), and added int return
-	type, in test program and T value program.
-  2002-02-21 lpd Added missing #include <stdio.h> in test program.
-  2000-07-03 lpd Patched to eliminate warnings about "constant is
-	unsigned in ANSI C, signed in traditional"; made test program
-	self-checking.
-  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
-  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5).
-  1999-05-03 lpd Original version.
- */
-
-#include "md5.h"
-#include <string.h>
-
-#undef BYTE_ORDER	/* 1 = big-endian, -1 = little-endian, 0 = unknown */
-#ifdef ARCH_IS_BIG_ENDIAN
-#  define BYTE_ORDER (ARCH_IS_BIG_ENDIAN ? 1 : -1)
-#else
-#  define BYTE_ORDER 0
-#endif
-
-#define T_MASK ((md5_word_t)~0)
-#define T1 /* 0xd76aa478 */ (T_MASK ^ 0x28955b87)
-#define T2 /* 0xe8c7b756 */ (T_MASK ^ 0x173848a9)
-#define T3    0x242070db
-#define T4 /* 0xc1bdceee */ (T_MASK ^ 0x3e423111)
-#define T5 /* 0xf57c0faf */ (T_MASK ^ 0x0a83f050)
-#define T6    0x4787c62a
-#define T7 /* 0xa8304613 */ (T_MASK ^ 0x57cfb9ec)
-#define T8 /* 0xfd469501 */ (T_MASK ^ 0x02b96afe)
-#define T9    0x698098d8
-#define T10 /* 0x8b44f7af */ (T_MASK ^ 0x74bb0850)
-#define T11 /* 0xffff5bb1 */ (T_MASK ^ 0x0000a44e)
-#define T12 /* 0x895cd7be */ (T_MASK ^ 0x76a32841)
-#define T13    0x6b901122
-#define T14 /* 0xfd987193 */ (T_MASK ^ 0x02678e6c)
-#define T15 /* 0xa679438e */ (T_MASK ^ 0x5986bc71)
-#define T16    0x49b40821
-#define T17 /* 0xf61e2562 */ (T_MASK ^ 0x09e1da9d)
-#define T18 /* 0xc040b340 */ (T_MASK ^ 0x3fbf4cbf)
-#define T19    0x265e5a51
-#define T20 /* 0xe9b6c7aa */ (T_MASK ^ 0x16493855)
-#define T21 /* 0xd62f105d */ (T_MASK ^ 0x29d0efa2)
-#define T22    0x02441453
-#define T23 /* 0xd8a1e681 */ (T_MASK ^ 0x275e197e)
-#define T24 /* 0xe7d3fbc8 */ (T_MASK ^ 0x182c0437)
-#define T25    0x21e1cde6
-#define T26 /* 0xc33707d6 */ (T_MASK ^ 0x3cc8f829)
-#define T27 /* 0xf4d50d87 */ (T_MASK ^ 0x0b2af278)
-#define T28    0x455a14ed
-#define T29 /* 0xa9e3e905 */ (T_MASK ^ 0x561c16fa)
-#define T30 /* 0xfcefa3f8 */ (T_MASK ^ 0x03105c07)
-#define T31    0x676f02d9
-#define T32 /* 0x8d2a4c8a */ (T_MASK ^ 0x72d5b375)
-#define T33 /* 0xfffa3942 */ (T_MASK ^ 0x0005c6bd)
-#define T34 /* 0x8771f681 */ (T_MASK ^ 0x788e097e)
-#define T35    0x6d9d6122
-#define T36 /* 0xfde5380c */ (T_MASK ^ 0x021ac7f3)
-#define T37 /* 0xa4beea44 */ (T_MASK ^ 0x5b4115bb)
-#define T38    0x4bdecfa9
-#define T39 /* 0xf6bb4b60 */ (T_MASK ^ 0x0944b49f)
-#define T40 /* 0xbebfbc70 */ (T_MASK ^ 0x4140438f)
-#define T41    0x289b7ec6
-#define T42 /* 0xeaa127fa */ (T_MASK ^ 0x155ed805)
-#define T43 /* 0xd4ef3085 */ (T_MASK ^ 0x2b10cf7a)
-#define T44    0x04881d05
-#define T45 /* 0xd9d4d039 */ (T_MASK ^ 0x262b2fc6)
-#define T46 /* 0xe6db99e5 */ (T_MASK ^ 0x1924661a)
-#define T47    0x1fa27cf8
-#define T48 /* 0xc4ac5665 */ (T_MASK ^ 0x3b53a99a)
-#define T49 /* 0xf4292244 */ (T_MASK ^ 0x0bd6ddbb)
-#define T50    0x432aff97
-#define T51 /* 0xab9423a7 */ (T_MASK ^ 0x546bdc58)
-#define T52 /* 0xfc93a039 */ (T_MASK ^ 0x036c5fc6)
-#define T53    0x655b59c3
-#define T54 /* 0x8f0ccc92 */ (T_MASK ^ 0x70f3336d)
-#define T55 /* 0xffeff47d */ (T_MASK ^ 0x00100b82)
-#define T56 /* 0x85845dd1 */ (T_MASK ^ 0x7a7ba22e)
-#define T57    0x6fa87e4f
-#define T58 /* 0xfe2ce6e0 */ (T_MASK ^ 0x01d3191f)
-#define T59 /* 0xa3014314 */ (T_MASK ^ 0x5cfebceb)
-#define T60    0x4e0811a1
-#define T61 /* 0xf7537e82 */ (T_MASK ^ 0x08ac817d)
-#define T62 /* 0xbd3af235 */ (T_MASK ^ 0x42c50dca)
-#define T63    0x2ad7d2bb
-#define T64 /* 0xeb86d391 */ (T_MASK ^ 0x14792c6e)
-
-
-static void
-md5_process(md5_state_t *pms, const md5_byte_t *data /*[64]*/)
-{
-    md5_word_t
-	a = pms->abcd[0], b = pms->abcd[1],
-	c = pms->abcd[2], d = pms->abcd[3];
-    md5_word_t t;
-#if BYTE_ORDER > 0
-    /* Define storage only for big-endian CPUs. */
-    md5_word_t X[16];
-#else
-    /* Define storage for little-endian or both types of CPUs. */
-    md5_word_t xbuf[16];
-    const md5_word_t *X;
-#endif
-
-    {
-#if BYTE_ORDER == 0
-	/*
-	 * Determine dynamically whether this is a big-endian or
-	 * little-endian machine, since we can use a more efficient
-	 * algorithm on the latter.
-	 */
-	static const int w = 1;
-
-	if (*((const md5_byte_t *)&w)) /* dynamic little-endian */
-#endif
-#if BYTE_ORDER <= 0		/* little-endian */
-	{
-	    /*
-	     * On little-endian machines, we can process properly aligned
-	     * data without copying it.
-	     */
-	    if (!((data - (const md5_byte_t *)0) & 3)) {
-		/* data are properly aligned */
-		X = (const md5_word_t *)data;
-	    } else {
-		/* not aligned */
-		memcpy(xbuf, data, 64);
-		X = xbuf;
-	    }
-	}
-#endif
-#if BYTE_ORDER == 0
-	else			/* dynamic big-endian */
-#endif
-#if BYTE_ORDER >= 0		/* big-endian */
-	{
-	    /*
-	     * On big-endian machines, we must arrange the bytes in the
-	     * right order.
-	     */
-	    const md5_byte_t *xp = data;
-	    int i;
-
-#  if BYTE_ORDER == 0
-	    X = xbuf;		/* (dynamic only) */
-#  else
-#    define xbuf X		/* (static only) */
-#  endif
-	    for (i = 0; i < 16; ++i, xp += 4)
-		xbuf[i] = xp[0] + (xp[1] << 8) + (xp[2] << 16) + (xp[3] << 24);
-	}
-#endif
-    }
-
-#define ROTATE_LEFT(x, n) (((x) << (n)) | ((x) >> (32 - (n))))
-
-    /* Round 1. */
-    /* Let [abcd k s i] denote the operation
-       a = b + ((a + F(b,c,d) + X[k] + T[i]) <<< s). */
-#define F(x, y, z) (((x) & (y)) | (~(x) & (z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + F(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-    /* Do the following 16 operations. */
-    SET(a, b, c, d,  0,  7,  T1);
-    SET(d, a, b, c,  1, 12,  T2);
-    SET(c, d, a, b,  2, 17,  T3);
-    SET(b, c, d, a,  3, 22,  T4);
-    SET(a, b, c, d,  4,  7,  T5);
-    SET(d, a, b, c,  5, 12,  T6);
-    SET(c, d, a, b,  6, 17,  T7);
-    SET(b, c, d, a,  7, 22,  T8);
-    SET(a, b, c, d,  8,  7,  T9);
-    SET(d, a, b, c,  9, 12, T10);
-    SET(c, d, a, b, 10, 17, T11);
-    SET(b, c, d, a, 11, 22, T12);
-    SET(a, b, c, d, 12,  7, T13);
-    SET(d, a, b, c, 13, 12, T14);
-    SET(c, d, a, b, 14, 17, T15);
-    SET(b, c, d, a, 15, 22, T16);
-#undef SET
-
-     /* Round 2. */
-     /* Let [abcd k s i] denote the operation
-          a = b + ((a + G(b,c,d) + X[k] + T[i]) <<< s). */
-#define G(x, y, z) (((x) & (z)) | ((y) & ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + G(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  1,  5, T17);
-    SET(d, a, b, c,  6,  9, T18);
-    SET(c, d, a, b, 11, 14, T19);
-    SET(b, c, d, a,  0, 20, T20);
-    SET(a, b, c, d,  5,  5, T21);
-    SET(d, a, b, c, 10,  9, T22);
-    SET(c, d, a, b, 15, 14, T23);
-    SET(b, c, d, a,  4, 20, T24);
-    SET(a, b, c, d,  9,  5, T25);
-    SET(d, a, b, c, 14,  9, T26);
-    SET(c, d, a, b,  3, 14, T27);
-    SET(b, c, d, a,  8, 20, T28);
-    SET(a, b, c, d, 13,  5, T29);
-    SET(d, a, b, c,  2,  9, T30);
-    SET(c, d, a, b,  7, 14, T31);
-    SET(b, c, d, a, 12, 20, T32);
-#undef SET
-
-     /* Round 3. */
-     /* Let [abcd k s t] denote the operation
-          a = b + ((a + H(b,c,d) + X[k] + T[i]) <<< s). */
-#define H(x, y, z) ((x) ^ (y) ^ (z))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + H(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  5,  4, T33);
-    SET(d, a, b, c,  8, 11, T34);
-    SET(c, d, a, b, 11, 16, T35);
-    SET(b, c, d, a, 14, 23, T36);
-    SET(a, b, c, d,  1,  4, T37);
-    SET(d, a, b, c,  4, 11, T38);
-    SET(c, d, a, b,  7, 16, T39);
-    SET(b, c, d, a, 10, 23, T40);
-    SET(a, b, c, d, 13,  4, T41);
-    SET(d, a, b, c,  0, 11, T42);
-    SET(c, d, a, b,  3, 16, T43);
-    SET(b, c, d, a,  6, 23, T44);
-    SET(a, b, c, d,  9,  4, T45);
-    SET(d, a, b, c, 12, 11, T46);
-    SET(c, d, a, b, 15, 16, T47);
-    SET(b, c, d, a,  2, 23, T48);
-#undef SET
-
-     /* Round 4. */
-     /* Let [abcd k s t] denote the operation
-          a = b + ((a + I(b,c,d) + X[k] + T[i]) <<< s). */
-#define I(x, y, z) ((y) ^ ((x) | ~(z)))
-#define SET(a, b, c, d, k, s, Ti)\
-  t = a + I(b,c,d) + X[k] + Ti;\
-  a = ROTATE_LEFT(t, s) + b
-     /* Do the following 16 operations. */
-    SET(a, b, c, d,  0,  6, T49);
-    SET(d, a, b, c,  7, 10, T50);
-    SET(c, d, a, b, 14, 15, T51);
-    SET(b, c, d, a,  5, 21, T52);
-    SET(a, b, c, d, 12,  6, T53);
-    SET(d, a, b, c,  3, 10, T54);
-    SET(c, d, a, b, 10, 15, T55);
-    SET(b, c, d, a,  1, 21, T56);
-    SET(a, b, c, d,  8,  6, T57);
-    SET(d, a, b, c, 15, 10, T58);
-    SET(c, d, a, b,  6, 15, T59);
-    SET(b, c, d, a, 13, 21, T60);
-    SET(a, b, c, d,  4,  6, T61);
-    SET(d, a, b, c, 11, 10, T62);
-    SET(c, d, a, b,  2, 15, T63);
-    SET(b, c, d, a,  9, 21, T64);
-#undef SET
-
-     /* Then perform the following additions. (That is increment each
-        of the four registers by the value it had before this block
-        was started.) */
-    pms->abcd[0] += a;
-    pms->abcd[1] += b;
-    pms->abcd[2] += c;
-    pms->abcd[3] += d;
-}
-
-void
-md5_init(md5_state_t *pms)
-{
-    pms->count[0] = pms->count[1] = 0;
-    pms->abcd[0] = 0x67452301;
-    pms->abcd[1] = /*0xefcdab89*/ T_MASK ^ 0x10325476;
-    pms->abcd[2] = /*0x98badcfe*/ T_MASK ^ 0x67452301;
-    pms->abcd[3] = 0x10325476;
-}
-
-void
-md5_append(md5_state_t *pms, const md5_byte_t *data, int nbytes)
-{
-    const md5_byte_t *p = data;
-    int left = nbytes;
-    int offset = (pms->count[0] >> 3) & 63;
-    md5_word_t nbits = (md5_word_t)(nbytes << 3);
-
-    if (nbytes <= 0)
-	return;
-
-    /* Update the message length. */
-    pms->count[1] += nbytes >> 29;
-    pms->count[0] += nbits;
-    if (pms->count[0] < nbits)
-	pms->count[1]++;
-
-    /* Process an initial partial block. */
-    if (offset) {
-	int copy = (offset + nbytes > 64 ? 64 - offset : nbytes);
-
-	memcpy(pms->buf + offset, p, copy);
-	if (offset + copy < 64)
-	    return;
-	p += copy;
-	left -= copy;
-	md5_process(pms, pms->buf);
-    }
-
-    /* Process full blocks. */
-    for (; left >= 64; p += 64, left -= 64)
-	md5_process(pms, p);
-
-    /* Process a final partial block. */
-    if (left)
-	memcpy(pms->buf, p, left);
-}
-
-void
-md5_finish(md5_state_t *pms, md5_byte_t digest[16])
-{
-    static const md5_byte_t pad[64] = {
-	0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-	0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    };
-    md5_byte_t data[8];
-    int i;
-
-    /* Save the length before padding. */
-    for (i = 0; i < 8; ++i)
-	data[i] = (md5_byte_t)(pms->count[i >> 2] >> ((i & 3) << 3));
-    /* Pad to 56 bytes mod 64. */
-    md5_append(pms, pad, ((55 - (pms->count[0] >> 3)) & 63) + 1);
-    /* Append the length. */
-    md5_append(pms, data, 8);
-    for (i = 0; i < 16; ++i)
-	digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/md5.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/md5.h b/depends/thirdparty/thrift/compiler/cpp/src/md5.h
deleted file mode 100644
index 3fbe498..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/md5.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
-  Copyright (C) 1999, 2002 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */
-/* $Id: md5.h,v 1.4 2002/04/13 19:20:28 lpd Exp $ */
-/*
-  Independent implementation of MD5 (RFC 1321).
-
-  This code implements the MD5 Algorithm defined in RFC 1321, whose
-  text is available at
-    http://www.ietf.org/rfc/rfc1321.txt
-  The code is derived from the text of the RFC, including the test suite
-  (section A.5) but excluding the rest of Appendix A.  It does not include
-  any code or documentation that is identified in the RFC as being
-  copyrighted.
-
-  The original and principal author of md5.h is L. Peter Deutsch
-  <gh...@aladdin.com>.  Other authors are noted in the change history
-  that follows (in reverse chronological order):
-
-  2002-04-13 lpd Removed support for non-ANSI compilers; removed
-    references to Ghostscript; clarified derivation from RFC 1321;
-    now handles byte order either statically or dynamically.
-  1999-11-04 lpd Edited comments slightly for automatic TOC extraction.
-  1999-10-18 lpd Fixed typo in header comment (ansi2knr rather than md5);
-    added conditionalization for C++ compilation from Martin
-    Purschke <pu...@bnl.gov>.
-  1999-05-03 lpd Original version.
- */
-
-#ifndef md5_INCLUDED
-#define md5_INCLUDED
-
-/*
- * This package supports both compile-time and run-time determination of CPU
- * byte order.  If ARCH_IS_BIG_ENDIAN is defined as 0, the code will be
- * compiled to run only on little-endian CPUs; if ARCH_IS_BIG_ENDIAN is
- * defined as non-zero, the code will be compiled to run only on big-endian
- * CPUs; if ARCH_IS_BIG_ENDIAN is not defined, the code will be compiled to
- * run on either big- or little-endian CPUs, but will run slightly less
- * efficiently on either one than if ARCH_IS_BIG_ENDIAN is defined.
- */
-
-typedef unsigned char md5_byte_t; /* 8-bit byte */
-typedef unsigned int md5_word_t;  /* 32-bit word */
-
-/* Define the state of the MD5 Algorithm. */
-typedef struct md5_state_s {
-  md5_word_t count[2]; /* message length in bits, lsw first */
-  md5_word_t abcd[4];  /* digest buffer */
-  md5_byte_t buf[64];  /* accumulate block */
-} md5_state_t;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Initialize the algorithm. */
-void md5_init(md5_state_t* pms);
-
-/* Append a string to the message. */
-void md5_append(md5_state_t* pms, const md5_byte_t* data, int nbytes);
-
-/* Finish the message and return the digest. */
-void md5_finish(md5_state_t* pms, md5_byte_t digest[16]);
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-#endif /* md5_INCLUDED */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/parse.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/parse.cc b/depends/thirdparty/thrift/compiler/cpp/src/parse/parse.cc
deleted file mode 100644
index b22ee52..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/parse.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "t_type.h"
-#include "t_typedef.h"
-
-#include "main.h"
-
-t_type* t_type::get_true_type() {
-  t_type* type = this;
-  while (type->is_typedef()) {
-    type = ((t_typedef*)type)->get_type();
-  }
-  return type;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_base_type.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_base_type.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_base_type.h
deleted file mode 100644
index 9be1f80..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_base_type.h
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_BASE_TYPE_H
-#define T_BASE_TYPE_H
-
-#include <cstdlib>
-#include "t_type.h"
-
-/**
- * A thrift base type, which must be one of the defined enumerated types inside
- * this definition.
- *
- */
-class t_base_type : public t_type {
-public:
-  /**
-   * Enumeration of thrift base types
-   */
-  enum t_base {
-    TYPE_VOID,
-    TYPE_STRING,
-    TYPE_BOOL,
-    TYPE_BYTE,
-    TYPE_I16,
-    TYPE_I32,
-    TYPE_I64,
-    TYPE_DOUBLE
-  };
-
-  t_base_type(std::string name, t_base base)
-    : t_type(name), base_(base), string_list_(false), binary_(false), string_enum_(false) {}
-
-  t_base get_base() const { return base_; }
-
-  bool is_void() const { return base_ == TYPE_VOID; }
-
-  bool is_string() const { return base_ == TYPE_STRING; }
-
-  bool is_bool() const { return base_ == TYPE_BOOL; }
-
-  void set_string_list(bool val) { string_list_ = val; }
-
-  bool is_string_list() const { return (base_ == TYPE_STRING) && string_list_; }
-
-  void set_binary(bool val) { binary_ = val; }
-
-  bool is_binary() const { return (base_ == TYPE_STRING) && binary_; }
-
-  void set_string_enum(bool val) { string_enum_ = val; }
-
-  bool is_string_enum() const { return base_ == TYPE_STRING && string_enum_; }
-
-  void add_string_enum_val(std::string val) { string_enum_vals_.push_back(val); }
-
-  const std::vector<std::string>& get_string_enum_vals() const { return string_enum_vals_; }
-
-  bool is_base_type() const { return true; }
-
-  static std::string t_base_name(t_base tbase) {
-    switch (tbase) {
-    case TYPE_VOID:
-      return "void";
-      break;
-    case TYPE_STRING:
-      return "string";
-      break;
-    case TYPE_BOOL:
-      return "bool";
-      break;
-    case TYPE_BYTE:
-      return "byte";
-      break;
-    case TYPE_I16:
-      return "i16";
-      break;
-    case TYPE_I32:
-      return "i32";
-      break;
-    case TYPE_I64:
-      return "i64";
-      break;
-    case TYPE_DOUBLE:
-      return "double";
-      break;
-    default:
-      return "(unknown)";
-      break;
-    }
-  }
-
-private:
-  t_base base_;
-
-  bool string_list_;
-  bool binary_;
-  bool string_enum_;
-  std::vector<std::string> string_enum_vals_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const.h
deleted file mode 100644
index 0f64bb1..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_CONST_H
-#define T_CONST_H
-
-#include "t_type.h"
-#include "t_const_value.h"
-
-/**
- * A const is a constant value defined across languages that has a type and
- * a value. The trick here is that the declared type might not match the type
- * of the value object, since that is not determined until after parsing the
- * whole thing out.
- *
- */
-class t_const : public t_doc {
-public:
-  t_const(t_type* type, std::string name, t_const_value* value)
-    : type_(type), name_(name), value_(value) {}
-
-  t_type* get_type() const { return type_; }
-
-  std::string get_name() const { return name_; }
-
-  t_const_value* get_value() const { return value_; }
-
-private:
-  t_type* type_;
-  std::string name_;
-  t_const_value* value_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const_value.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const_value.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const_value.h
deleted file mode 100644
index 7e6e3f6..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_const_value.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_CONST_VALUE_H
-#define T_CONST_VALUE_H
-
-#include "t_enum.h"
-#include <stdint.h>
-#include <map>
-#include <vector>
-#include <string>
-
-/**
- * A const value is something parsed that could be a map, set, list, struct
- * or whatever.
- *
- */
-class t_const_value {
-public:
-  enum t_const_value_type { CV_INTEGER, CV_DOUBLE, CV_STRING, CV_MAP, CV_LIST, CV_IDENTIFIER };
-
-  t_const_value() {}
-
-  t_const_value(int64_t val) { set_integer(val); }
-
-  t_const_value(std::string val) { set_string(val); }
-
-  void set_string(std::string val) {
-    valType_ = CV_STRING;
-    stringVal_ = val;
-  }
-
-  std::string get_string() const { return stringVal_; }
-
-  void set_integer(int64_t val) {
-    valType_ = CV_INTEGER;
-    intVal_ = val;
-  }
-
-  int64_t get_integer() const {
-    if (valType_ == CV_IDENTIFIER) {
-      if (enum_ == NULL) {
-        throw "have identifier \"" + get_identifier() + "\", but unset enum on line!";
-      }
-      std::string identifier = get_identifier();
-      std::string::size_type dot = identifier.rfind('.');
-      if (dot != std::string::npos) {
-        identifier = identifier.substr(dot + 1);
-      }
-      t_enum_value* val = enum_->get_constant_by_name(identifier);
-      if (val == NULL) {
-        throw "Unable to find enum value \"" + identifier + "\" in enum \"" + enum_->get_name()
-            + "\"";
-      }
-      return val->get_value();
-    } else {
-      return intVal_;
-    }
-  }
-
-  void set_double(double val) {
-    valType_ = CV_DOUBLE;
-    doubleVal_ = val;
-  }
-
-  double get_double() const { return doubleVal_; }
-
-  void set_map() { valType_ = CV_MAP; }
-
-  void add_map(t_const_value* key, t_const_value* val) { mapVal_[key] = val; }
-
-  const std::map<t_const_value*, t_const_value*>& get_map() const { return mapVal_; }
-
-  void set_list() { valType_ = CV_LIST; }
-
-  void add_list(t_const_value* val) { listVal_.push_back(val); }
-
-  const std::vector<t_const_value*>& get_list() const { return listVal_; }
-
-  void set_identifier(std::string val) {
-    valType_ = CV_IDENTIFIER;
-    identifierVal_ = val;
-  }
-
-  std::string get_identifier() const { return identifierVal_; }
-
-  std::string get_identifier_name() const {
-    std::string ret = get_identifier();
-    size_t s = ret.find('.');
-    if (s == std::string::npos) {
-      throw "error: identifier " + ret + " is unqualified!";
-    }
-    ret = ret.substr(s + 1);
-    s = ret.find('.');
-    if (s != std::string::npos) {
-      ret = ret.substr(s + 1);
-    }
-    return ret;
-  }
-
-  std::string get_identifier_with_parent() const {
-    std::string ret = get_identifier();
-    size_t s = ret.find('.');
-    if (s == std::string::npos) {
-      throw "error: identifier " + ret + " is unqualified!";
-    }
-    size_t s2 = ret.find('.', s + 1);
-    if (s2 != std::string::npos) {
-      ret = ret.substr(s + 1);
-    }
-    return ret;
-  }
-
-  void set_enum(t_enum* tenum) { enum_ = tenum; }
-
-  t_const_value_type get_type() const { return valType_; }
-
-private:
-  std::map<t_const_value*, t_const_value*> mapVal_;
-  std::vector<t_const_value*> listVal_;
-  std::string stringVal_;
-  int64_t intVal_;
-  double doubleVal_;
-  std::string identifierVal_;
-  t_enum* enum_;
-
-  t_const_value_type valType_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_container.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_container.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_container.h
deleted file mode 100644
index 0d992b7..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_container.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_CONTAINER_H
-#define T_CONTAINER_H
-
-#include "t_type.h"
-
-class t_container : public t_type {
-public:
-  t_container() : cpp_name_(), has_cpp_name_(false) {}
-
-  virtual ~t_container() {}
-
-  void set_cpp_name(std::string cpp_name) {
-    cpp_name_ = cpp_name;
-    has_cpp_name_ = true;
-  }
-
-  bool has_cpp_name() { return has_cpp_name_; }
-
-  std::string get_cpp_name() { return cpp_name_; }
-
-  bool is_container() const { return true; }
-
-private:
-  std::string cpp_name_;
-  bool has_cpp_name_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_doc.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_doc.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_doc.h
deleted file mode 100644
index 9d310b7..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_doc.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_DOC_H
-#define T_DOC_H
-
-#include "globals.h"
-#include "logging.h"
-
-/**
- * Documentation stubs
- *
- */
-class t_doc {
-
-public:
-  t_doc() : has_doc_(false) {}
-
-  void set_doc(const std::string& doc) {
-    doc_ = doc;
-    has_doc_ = true;
-    if ((g_program_doctext_lineno == g_doctext_lineno)
-        && (g_program_doctext_status == STILL_CANDIDATE)) {
-      g_program_doctext_status = ALREADY_PROCESSED;
-      pdebug("%s", "program doctext set to ALREADY_PROCESSED");
-    }
-  }
-
-  const std::string& get_doc() const { return doc_; }
-
-  bool has_doc() { return has_doc_; }
-
-private:
-  std::string doc_;
-  bool has_doc_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum.h
deleted file mode 100644
index 7b6a020..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_ENUM_H
-#define T_ENUM_H
-
-#include "t_enum_value.h"
-#include <vector>
-
-/**
- * An enumerated type. A list of constant objects with a name for the type.
- *
- */
-class t_enum : public t_type {
-public:
-  t_enum(t_program* program) : t_type(program) {}
-
-  void set_name(const std::string& name) { name_ = name; }
-
-  void append(t_enum_value* constant) { constants_.push_back(constant); }
-
-  const std::vector<t_enum_value*>& get_constants() { return constants_; }
-
-  t_enum_value* get_constant_by_name(const std::string& name) {
-    const std::vector<t_enum_value*>& enum_values = get_constants();
-    std::vector<t_enum_value*>::const_iterator c_iter;
-    for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-      if ((*c_iter)->get_name() == name) {
-        return *c_iter;
-      }
-    }
-    return NULL;
-  }
-
-  t_enum_value* get_constant_by_value(int64_t value) {
-    const std::vector<t_enum_value*>& enum_values = get_constants();
-    std::vector<t_enum_value*>::const_iterator c_iter;
-    for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-      if ((*c_iter)->get_value() == value) {
-        return *c_iter;
-      }
-    }
-    return NULL;
-  }
-
-  t_enum_value* get_min_value() {
-    const std::vector<t_enum_value*>& enum_values = get_constants();
-    std::vector<t_enum_value*>::const_iterator c_iter;
-    t_enum_value* min_value;
-    if (enum_values.size() == 0) {
-      min_value = NULL;
-    } else {
-      int min_value_value;
-      min_value = enum_values.front();
-      min_value_value = min_value->get_value();
-      for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-        if ((*c_iter)->get_value() < min_value_value) {
-          min_value = (*c_iter);
-          min_value_value = min_value->get_value();
-        }
-      }
-    }
-    return min_value;
-  }
-
-  t_enum_value* get_max_value() {
-    const std::vector<t_enum_value*>& enum_values = get_constants();
-    std::vector<t_enum_value*>::const_iterator c_iter;
-    t_enum_value* max_value;
-    if (enum_values.size() == 0) {
-      max_value = NULL;
-    } else {
-      int max_value_value;
-      max_value = enum_values.back();
-      max_value_value = max_value->get_value();
-      for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-        if ((*c_iter)->get_value() > max_value_value) {
-          max_value = (*c_iter);
-          max_value_value = max_value->get_value();
-        }
-      }
-    }
-    return max_value;
-  }
-
-  bool is_enum() const { return true; }
-
-  virtual std::string get_fingerprint_material() const { return "enum"; }
-
-private:
-  std::vector<t_enum_value*> constants_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum_value.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum_value.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum_value.h
deleted file mode 100644
index 5979f06..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_enum_value.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_ENUM_VALUE_H
-#define T_ENUM_VALUE_H
-
-#include <string>
-#include "t_doc.h"
-
-/**
- * A constant. These are used inside of enum definitions. Constants are just
- * symbol identifiers that may or may not have an explicit value associated
- * with them.
- *
- */
-class t_enum_value : public t_doc {
-public:
-  t_enum_value(std::string name, int value) : name_(name), value_(value) {}
-
-  ~t_enum_value() {}
-
-  const std::string& get_name() const { return name_; }
-
-  int get_value() const { return value_; }
-
-  std::map<std::string, std::string> annotations_;
-
-private:
-  std::string name_;
-  int value_;
-};
-
-#endif



[40/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_d_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_d_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_d_generator.cc
deleted file mode 100644
index ca76485..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_d_generator.cc
+++ /dev/null
@@ -1,722 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <cassert>
-
-#include <fstream>
-#include <iostream>
-#include <set>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include <sys/stat.h>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::ostringstream;
-using std::set;
-using std::string;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * D code generator.
- *
- * generate_*() functions are called by the base class to emit code for the
- * given entity, print_*() functions write a piece of code to the passed
- * stream, and render_*() return a string containing the D representation of
- * the passed entity.
- */
-class t_d_generator : public t_oop_generator {
-public:
-  t_d_generator(t_program* program,
-                const std::map<string, string>& parsed_options,
-                const string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-d";
-  }
-
-protected:
-  virtual void init_generator() {
-    // Make output directory
-    MKDIR(get_out_dir().c_str());
-
-    string dir = program_->get_namespace("d");
-    string subdir = get_out_dir();
-    string::size_type loc;
-    while ((loc = dir.find(".")) != string::npos) {
-      subdir = subdir + "/" + dir.substr(0, loc);
-      MKDIR(subdir.c_str());
-      dir = dir.substr(loc + 1);
-    }
-    if (!dir.empty()) {
-      subdir = subdir + "/" + dir;
-      MKDIR(subdir.c_str());
-    }
-
-    package_dir_ = subdir + "/";
-
-    // Make output file
-    string f_types_name = package_dir_ + program_name_ + "_types.d";
-    f_types_.open(f_types_name.c_str());
-
-    // Print header
-    f_types_ << autogen_comment() << "module " << render_package(*program_) << program_name_
-             << "_types;" << endl << endl;
-
-    print_default_imports(f_types_);
-
-    // Include type modules from other imported programs.
-    const vector<t_program*>& includes = program_->get_includes();
-    for (size_t i = 0; i < includes.size(); ++i) {
-      f_types_ << "import " << render_package(*(includes[i])) << includes[i]->get_name()
-               << "_types;" << endl;
-    }
-    if (!includes.empty())
-      f_types_ << endl;
-  }
-
-  virtual void close_generator() {
-    // Close output file
-    f_types_.close();
-  }
-
-  virtual void generate_consts(std::vector<t_const*> consts) {
-    if (!consts.empty()) {
-      string f_consts_name = package_dir_ + program_name_ + "_constants.d";
-      ofstream f_consts;
-      f_consts.open(f_consts_name.c_str());
-
-      f_consts << autogen_comment() << "module " << render_package(*program_) << program_name_
-               << "_constants;" << endl << endl;
-
-      print_default_imports(f_consts);
-
-      f_consts << "import " << render_package(*get_program()) << program_name_ << "_types;" << endl
-               << endl;
-
-      vector<t_const*>::iterator c_iter;
-      for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-        string name = (*c_iter)->get_name();
-        t_type* type = (*c_iter)->get_type();
-        indent(f_consts) << "immutable(" << render_type_name(type) << ") " << name << ";" << endl;
-      }
-
-      f_consts << endl << "static this() {" << endl;
-      indent_up();
-
-      bool first = true;
-      for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-        if (first) {
-          first = false;
-        } else {
-          f_consts << endl;
-        }
-        t_type* type = (*c_iter)->get_type();
-        indent(f_consts) << (*c_iter)->get_name() << " = ";
-        if (!is_immutable_type(type)) {
-          f_consts << "cast(immutable(" << render_type_name(type) << ")) ";
-        }
-        f_consts << render_const_value(type, (*c_iter)->get_value()) << ";" << endl;
-      }
-      indent_down();
-      indent(f_consts) << "}" << endl;
-    }
-  }
-
-  virtual void generate_typedef(t_typedef* ttypedef) {
-    f_types_ << indent() << "alias " << render_type_name(ttypedef->get_type()) << " "
-             << ttypedef->get_symbolic() << ";" << endl << endl;
-  }
-
-  virtual void generate_enum(t_enum* tenum) {
-    vector<t_enum_value*> constants = tenum->get_constants();
-
-    string enum_name = tenum->get_name();
-    f_types_ << indent() << "enum " << enum_name << " {" << endl;
-
-    indent_up();
-
-    vector<t_enum_value*>::const_iterator c_iter;
-    bool first = true;
-    for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_types_ << "," << endl;
-      }
-      indent(f_types_) << (*c_iter)->get_name();
-      f_types_ << " = " << (*c_iter)->get_value();
-    }
-
-    f_types_ << endl;
-    indent_down();
-    indent(f_types_) << "}" << endl;
-
-    f_types_ << endl;
-  }
-
-  virtual void generate_struct(t_struct* tstruct) {
-    print_struct_definition(f_types_, tstruct, false);
-  }
-
-  virtual void generate_xception(t_struct* txception) {
-    print_struct_definition(f_types_, txception, true);
-  }
-
-  virtual void generate_service(t_service* tservice) {
-    string svc_name = tservice->get_name();
-
-    // Service implementation file includes
-    string f_servicename = package_dir_ + svc_name + ".d";
-    std::ofstream f_service;
-    f_service.open(f_servicename.c_str());
-    f_service << autogen_comment() << "module " << render_package(*program_) << svc_name << ";"
-              << endl << endl;
-
-    print_default_imports(f_service);
-
-    f_service << "import " << render_package(*get_program()) << program_name_ << "_types;" << endl;
-
-    t_service* extends_service = tservice->get_extends();
-    if (extends_service != NULL) {
-      f_service << "import " << render_package(*(extends_service->get_program()))
-                << extends_service->get_name() << ";" << endl;
-    }
-
-    f_service << endl;
-
-    string extends = "";
-    if (tservice->get_extends() != NULL) {
-      extends = " : " + render_type_name(tservice->get_extends());
-    }
-
-    f_service << indent() << "interface " << svc_name << extends << " {" << endl;
-    indent_up();
-
-    // Collect all the exception types service methods can throw so we can
-    // emit the necessary aliases later.
-    set<t_type*> exception_types;
-
-    // Print the method signatures.
-    vector<t_function*> functions = tservice->get_functions();
-    vector<t_function*>::iterator fn_iter;
-    for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
-      f_service << indent();
-      print_function_signature(f_service, *fn_iter);
-      f_service << ";" << endl;
-
-      const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
-      vector<t_field*>::const_iterator ex_iter;
-      for (ex_iter = exceptions.begin(); ex_iter != exceptions.end(); ++ex_iter) {
-        exception_types.insert((*ex_iter)->get_type());
-      }
-    }
-
-    // Alias the exception types into the current scope.
-    if (!exception_types.empty())
-      f_service << endl;
-    set<t_type*>::const_iterator et_iter;
-    for (et_iter = exception_types.begin(); et_iter != exception_types.end(); ++et_iter) {
-      indent(f_service) << "alias " << render_package(*(*et_iter)->get_program())
-                        << (*et_iter)->get_program()->get_name() << "_types"
-                        << "." << (*et_iter)->get_name() << " " << (*et_iter)->get_name() << ";"
-                        << endl;
-    }
-
-    // Write the method metadata.
-    ostringstream meta;
-    indent_up();
-    bool first = true;
-    for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
-      if ((*fn_iter)->get_arglist()->get_members().empty()
-          && (*fn_iter)->get_xceptions()->get_members().empty() && !(*fn_iter)->is_oneway()) {
-        continue;
-      }
-
-      if (first) {
-        first = false;
-      } else {
-        meta << ",";
-      }
-
-      meta << endl << indent() << "TMethodMeta(`" << (*fn_iter)->get_name() << "`, " << endl;
-      indent_up();
-      indent(meta) << "[";
-
-      bool first = true;
-      const vector<t_field*>& params = (*fn_iter)->get_arglist()->get_members();
-      vector<t_field*>::const_iterator p_iter;
-      for (p_iter = params.begin(); p_iter != params.end(); ++p_iter) {
-        if (first) {
-          first = false;
-        } else {
-          meta << ", ";
-        }
-
-        meta << "TParamMeta(`" << (*p_iter)->get_name() << "`, " << (*p_iter)->get_key();
-
-        t_const_value* cv = (*p_iter)->get_value();
-        if (cv != NULL) {
-          meta << ", q{" << render_const_value((*p_iter)->get_type(), cv) << "}";
-        }
-        meta << ")";
-      }
-
-      meta << "]";
-
-      if (!(*fn_iter)->get_xceptions()->get_members().empty() || (*fn_iter)->is_oneway()) {
-        meta << "," << endl << indent() << "[";
-
-        bool first = true;
-        const vector<t_field*>& exceptions = (*fn_iter)->get_xceptions()->get_members();
-        vector<t_field*>::const_iterator ex_iter;
-        for (ex_iter = exceptions.begin(); ex_iter != exceptions.end(); ++ex_iter) {
-          if (first) {
-            first = false;
-          } else {
-            meta << ", ";
-          }
-
-          meta << "TExceptionMeta(`" << (*ex_iter)->get_name() << "`, " << (*ex_iter)->get_key()
-               << ", `" << (*ex_iter)->get_type()->get_name() << "`)";
-        }
-
-        meta << "]";
-      }
-
-      if ((*fn_iter)->is_oneway()) {
-        meta << "," << endl << indent() << "TMethodType.ONEWAY";
-      }
-
-      indent_down();
-      meta << endl << indent() << ")";
-    }
-    indent_down();
-
-    string meta_str(meta.str());
-    if (!meta_str.empty()) {
-      f_service << endl << indent() << "enum methodMeta = [" << meta_str << endl << indent() << "];"
-                << endl;
-    }
-
-    indent_down();
-    indent(f_service) << "}" << endl;
-
-    // Server skeleton generation.
-    string f_skeletonname = package_dir_ + svc_name + "_server.skeleton.d";
-    std::ofstream f_skeleton;
-    f_skeleton.open(f_skeletonname.c_str());
-    print_server_skeleton(f_skeleton, tservice);
-    f_skeleton.close();
-  }
-
-private:
-  /**
-   * Writes a server skeleton for the passed service to out.
-   */
-  void print_server_skeleton(ostream& out, t_service* tservice) {
-    string svc_name = tservice->get_name();
-
-    out << "/*" << endl
-        << " * This auto-generated skeleton file illustrates how to build a server. If you" << endl
-        << " * intend to customize it, you should edit a copy with another file name to " << endl
-        << " * avoid overwriting it when running the generator again." << endl << " */" << endl
-        << "module " << render_package(*tservice->get_program()) << svc_name << "_server;" << endl
-        << endl << "import std.stdio;" << endl << "import thrift.codegen.processor;" << endl
-        << "import thrift.protocol.binary;" << endl << "import thrift.server.simple;" << endl
-        << "import thrift.server.transport.socket;" << endl << "import thrift.transport.buffered;"
-        << endl << "import thrift.util.hashset;" << endl << endl << "import "
-        << render_package(*tservice->get_program()) << svc_name << ";" << endl << "import "
-        << render_package(*get_program()) << program_name_ << "_types;" << endl << endl << endl
-        << "class " << svc_name << "Handler : " << svc_name << " {" << endl;
-
-    indent_up();
-    out << indent() << "this() {" << endl << indent() << "  // Your initialization goes here."
-        << endl << indent() << "}" << endl << endl;
-
-    vector<t_function*> functions = tservice->get_functions();
-    vector<t_function*>::iterator f_iter;
-    for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      out << indent();
-      print_function_signature(out, *f_iter);
-      out << " {" << endl;
-
-      indent_up();
-
-      out << indent() << "// Your implementation goes here." << endl << indent() << "writeln(\""
-          << (*f_iter)->get_name() << " called\");" << endl;
-
-      t_base_type* rt = (t_base_type*)(*f_iter)->get_returntype();
-      if (rt->get_base() != t_base_type::TYPE_VOID) {
-        indent(out) << "return typeof(return).init;" << endl;
-      }
-
-      indent_down();
-
-      out << indent() << "}" << endl << endl;
-    }
-
-    indent_down();
-    out << "}" << endl << endl;
-
-    out << indent() << "void main() {" << endl;
-    indent_up();
-    out << indent() << "auto protocolFactory = new TBinaryProtocolFactory!();" << endl << indent()
-        << "auto processor = new TServiceProcessor!" << svc_name << "(new " << svc_name
-        << "Handler);" << endl << indent() << "auto serverTransport = new TServerSocket(9090);"
-        << endl << indent() << "auto transportFactory = new TBufferedTransportFactory;" << endl
-        << indent() << "auto server = new TSimpleServer(" << endl << indent()
-        << "  processor, serverTransport, transportFactory, protocolFactory);" << endl << indent()
-        << "server.serve();" << endl;
-    indent_down();
-    out << "}" << endl;
-  }
-
-  /**
-   * Writes the definition of a struct or an exception type to out.
-   */
-  void print_struct_definition(ostream& out, t_struct* tstruct, bool is_exception) {
-    const vector<t_field*>& members = tstruct->get_members();
-
-    if (is_exception) {
-      indent(out) << "class " << tstruct->get_name() << " : TException {" << endl;
-    } else {
-      indent(out) << "struct " << tstruct->get_name() << " {" << endl;
-    }
-    indent_up();
-
-    // Declare all fields.
-    vector<t_field*>::const_iterator m_iter;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      indent(out) << render_type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name() << ";"
-                  << endl;
-    }
-
-    if (!members.empty())
-      indent(out) << endl;
-    indent(out) << "mixin TStructHelpers!(";
-
-    if (!members.empty()) {
-      // If there are any fields, construct the TFieldMeta array to pass to
-      // TStructHelpers. We can't just pass an empty array if not because []
-      // doesn't pass the TFieldMeta[] constraint.
-      out << "[";
-      indent_up();
-
-      bool first = true;
-      vector<t_field*>::const_iterator m_iter;
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        if (first) {
-          first = false;
-        } else {
-          out << ",";
-        }
-        out << endl;
-
-        indent(out) << "TFieldMeta(`" << (*m_iter)->get_name() << "`, " << (*m_iter)->get_key();
-
-        t_const_value* cv = (*m_iter)->get_value();
-        t_field::e_req req = (*m_iter)->get_req();
-        out << ", " << render_req(req);
-        if (cv != NULL) {
-          out << ", q{" << render_const_value((*m_iter)->get_type(), cv) << "}";
-        }
-        out << ")";
-      }
-
-      indent_down();
-      out << endl << indent() << "]";
-    }
-
-    out << ");" << endl;
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-
-  /**
-   * Prints the D function signature (including return type) for the given
-   * method.
-   */
-  void print_function_signature(ostream& out, t_function* fn) {
-    out << render_type_name(fn->get_returntype()) << " " << fn->get_name() << "(";
-
-    const vector<t_field*>& fields = fn->get_arglist()->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        out << ", ";
-      }
-      out << render_type_name((*f_iter)->get_type(), true) << " " << (*f_iter)->get_name();
-    }
-
-    out << ")";
-  }
-
-  /**
-   * Returns the D representation of value. The result is guaranteed to be a
-   * single expression; for complex types, immediately called delegate
-   * literals are used to achieve this.
-   */
-  string render_const_value(t_type* type, t_const_value* value) {
-    // Resolve any typedefs.
-    type = get_true_type(type);
-
-    ostringstream out;
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_STRING:
-        out << '"' << get_escaped_string(value) << '"';
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << ((value->get_integer() > 0) ? "true" : "false");
-        break;
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-        out << "cast(" << render_type_name(type) << ")" << value->get_integer();
-        break;
-      case t_base_type::TYPE_I32:
-        out << value->get_integer();
-        break;
-      case t_base_type::TYPE_I64:
-        out << value->get_integer() << "L";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        if (value->get_type() == t_const_value::CV_INTEGER) {
-          out << value->get_integer();
-        } else {
-          out << value->get_double();
-        }
-        break;
-      default:
-        throw "Compiler error: No const of base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "cast(" << render_type_name(type) << ")" << value->get_integer();
-    } else {
-      out << "{" << endl;
-      indent_up();
-
-      indent(out) << render_type_name(type) << " v;" << endl;
-      if (type->is_struct() || type->is_xception()) {
-        indent(out) << "v = " << (type->is_xception() ? "new " : "") << render_type_name(type)
-                    << "();" << endl;
-
-        const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-        vector<t_field*>::const_iterator f_iter;
-        const map<t_const_value*, t_const_value*>& val = value->get_map();
-        map<t_const_value*, t_const_value*>::const_iterator v_iter;
-        for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-          t_type* field_type = NULL;
-          for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-            if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-              field_type = (*f_iter)->get_type();
-            }
-          }
-          if (field_type == NULL) {
-            throw "Type error: " + type->get_name() + " has no field "
-                + v_iter->first->get_string();
-          }
-          string val = render_const_value(field_type, v_iter->second);
-          indent(out) << "v.set!`" << v_iter->first->get_string() << "`(" << val << ");" << endl;
-        }
-      } else if (type->is_map()) {
-        t_type* ktype = ((t_map*)type)->get_key_type();
-        t_type* vtype = ((t_map*)type)->get_val_type();
-        const map<t_const_value*, t_const_value*>& val = value->get_map();
-        map<t_const_value*, t_const_value*>::const_iterator v_iter;
-        for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-          string key = render_const_value(ktype, v_iter->first);
-          string val = render_const_value(vtype, v_iter->second);
-          indent(out) << "v[";
-          if (!is_immutable_type(ktype)) {
-            out << "cast(immutable(" << render_type_name(ktype) << "))";
-          }
-          out << key << "] = " << val << ";" << endl;
-        }
-      } else if (type->is_list()) {
-        t_type* etype = ((t_list*)type)->get_elem_type();
-        const vector<t_const_value*>& val = value->get_list();
-        vector<t_const_value*>::const_iterator v_iter;
-        for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-          string val = render_const_value(etype, *v_iter);
-          indent(out) << "v ~= " << val << ";" << endl;
-        }
-      } else if (type->is_set()) {
-        t_type* etype = ((t_set*)type)->get_elem_type();
-        const vector<t_const_value*>& val = value->get_list();
-        vector<t_const_value*>::const_iterator v_iter;
-        for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-          string val = render_const_value(etype, *v_iter);
-          indent(out) << "v ~= " << val << ";" << endl;
-        }
-      } else {
-        throw "Compiler error: Invalid type in render_const_value: " + type->get_name();
-      }
-      indent(out) << "return v;" << endl;
-
-      indent_down();
-      indent(out) << "}()";
-    }
-
-    return out.str();
-  }
-
-  /**
-   * Returns the D package to which modules for program are written (with a
-   * trailing dot, if not empty).
-   */
-  string render_package(const t_program& program) const {
-    string package = program.get_namespace("d");
-    if (package.size() == 0)
-      return "";
-    return package + ".";
-  }
-
-  /**
-   * Returns the name of the D repesentation of ttype.
-   *
-   * If isArg is true, a const reference to the type will be returned for
-   * structs.
-   */
-  string render_type_name(const t_type* ttype, bool isArg = false) const {
-    if (ttype->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        return "void";
-      case t_base_type::TYPE_STRING:
-        return "string";
-      case t_base_type::TYPE_BOOL:
-        return "bool";
-      case t_base_type::TYPE_BYTE:
-        return "byte";
-      case t_base_type::TYPE_I16:
-        return "short";
-      case t_base_type::TYPE_I32:
-        return "int";
-      case t_base_type::TYPE_I64:
-        return "long";
-      case t_base_type::TYPE_DOUBLE:
-        return "double";
-      default:
-        throw "Compiler error: No D type name for base type " + t_base_type::t_base_name(tbase);
-      }
-    }
-
-    if (ttype->is_container()) {
-      t_container* tcontainer = (t_container*)ttype;
-      if (tcontainer->has_cpp_name()) {
-        return tcontainer->get_cpp_name();
-      } else if (ttype->is_map()) {
-        t_map* tmap = (t_map*)ttype;
-        t_type* ktype = tmap->get_key_type();
-
-        string name = render_type_name(tmap->get_val_type()) + "[";
-        if (!is_immutable_type(ktype)) {
-          name += "immutable(";
-        }
-        name += render_type_name(ktype);
-        if (!is_immutable_type(ktype)) {
-          name += ")";
-        }
-        name += "]";
-        return name;
-      } else if (ttype->is_set()) {
-        t_set* tset = (t_set*)ttype;
-        return "HashSet!(" + render_type_name(tset->get_elem_type()) + ")";
-      } else if (ttype->is_list()) {
-        t_list* tlist = (t_list*)ttype;
-        return render_type_name(tlist->get_elem_type()) + "[]";
-      }
-    }
-
-    if (ttype->is_struct() && isArg) {
-      return "ref const(" + ttype->get_name() + ")";
-    } else {
-      return ttype->get_name();
-    }
-  }
-
-  /**
-   * Returns the D TReq enum member corresponding to req.
-   */
-  string render_req(t_field::e_req req) const {
-    switch (req) {
-    case t_field::T_OPT_IN_REQ_OUT:
-      return "TReq.OPT_IN_REQ_OUT";
-    case t_field::T_OPTIONAL:
-      return "TReq.OPTIONAL";
-    case t_field::T_REQUIRED:
-      return "TReq.REQUIRED";
-    default: {
-      std::stringstream ss;
-      ss << "Compiler error: Invalid requirement level " << req;
-      throw ss.str();
-    }
-    }
-  }
-
-  /**
-   * Writes the default list of imports (which are written to every generated
-   * module) to f.
-   */
-  void print_default_imports(ostream& out) {
-    indent(out) << "import thrift.base;" << endl << "import thrift.codegen.base;" << endl
-                << "import thrift.util.hashset;" << endl << endl;
-  }
-
-  /**
-   * Returns whether type is �intrinsically immutable�, in the sense that
-   * a value of that type is implicitly castable to immutable(type), and it is
-   * allowed for AA keys without an immutable() qualifier.
-   */
-  bool is_immutable_type(t_type* type) const {
-    t_type* ttype = get_true_type(type);
-    return ttype->is_base_type() || ttype->is_enum();
-  }
-
-  /*
-   * File streams, stored here to avoid passing them as parameters to every
-   * function.
-   */
-  ofstream f_types_;
-  ofstream f_header_;
-
-  string package_dir_;
-};
-
-THRIFT_REGISTER_GENERATOR(d, "D", "")


[15/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/specs/idl.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/specs/idl.md b/depends/thirdparty/thrift/doc/specs/idl.md
deleted file mode 100644
index 6da4696..0000000
--- a/depends/thirdparty/thrift/doc/specs/idl.md
+++ /dev/null
@@ -1,236 +0,0 @@
-## Thrift interface description language
-The Thrift interface definition language (IDL) allows for the definition of [Thrift Types](/docs/types). A Thrift IDL file is processed by the Thrift code generator to produce code for the various target languages to support the defined structs and services in the IDL file.
-
-## Description
-
-*Under construction*
-
-Here is a description of the Thrift IDL.
-
-## Document
-
-Every Thrift document contains 0 or more headers followed by 0 or more definitions.
-
-    [1]  Document        ::=  Header* Definition*
-
-## Header
-
-A header is either a Thrift include, a C++ include, or a namespace declaration.
-
-    [2]  Header          ::=  Include | CppInclude | Namespace
-
-### Thrift Include
-
-An include makes all the symbols from another file visible (with a prefix) and adds corresponding include statements into the code generated for this Thrift document.
-
-    [3]  Include         ::=  'include' Literal
-
-### C++ Include
-
-A C++ include adds a custom C++ include to the output of the C++ code generator for this Thrift document. 
-
-    [4]  CppInclude      ::=  'cpp_include' Literal
-
-### Namespace
-
-A namespace declares which namespaces/package/module/etc. the type definitions in this file will be declared in for the target languages. The namespace scope indicates which language the namespace applies to; a scope of '*' indicates that the namespace applies to all target languages.
-
-    [5]  Namespace       ::=  ( 'namespace' ( NamespaceScope Identifier ) |
-                                            ( 'smalltalk.category' STIdentifier ) |
-                                            ( 'smalltalk.prefix' Identifier ) ) |
-                              ( 'php_namespace' Literal ) |
-                              ( 'xsd_namespace' Literal )
-
-    [6]  NamespaceScope  ::=  '*' | 'cpp' | 'java' | 'py' | 'perl' | 'rb' | 'cocoa' | 'csharp'
-
-N.B.: Smalltalk has two distinct types of namespace commands:
-
-- smalltalk.prefix: Prepended to generated classnames.
-  - Smalltalk does not have namespaces for classes, so prefixes
-    are used to avoid class-name collisions.
-    Often, the prefix is the author's initials, like "KB" or "JWS",
-    or an abbreviation of the package name, like "MC" for "Monticello".
-- smalltalk.category: Determines the category for generated classes.
-  Any dots in the identifier will be replaced with hyphens when generating
-  the category name.
-  If not provided, defaults to "Generated-" + the program name.
-  Methods will not be categorized beyond "as yet uncategorized".
-  - Smalltalk allows filing both classes and methods within classes into named
-    groups. These named groups of methods are called categories.
-
-N.B.: The `php_namespace` directive will be deprecated at some point in the future in favor of the scoped syntax, but the scoped syntax is not yet supported for PHP.
-
-N.B.: The `xsd_namespace` directive has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
-
-## Definition
-
-    [7]  Definition      ::=  Const | Typedef | Enum | Senum | Struct | Union | Exception | Service
-
-### Const
-
-    [8]  Const           ::=  'const' FieldType Identifier '=' ConstValue ListSeparator?
-
-### Typedef
-
-A typedef creates an alternate name for a type.
-
-    [9]  Typedef         ::=  'typedef' DefinitionType Identifier
-
-### Enum
-
-An enum creates an enumerated type, with named values. If no constant value is supplied, the value is either 0 for the first element, or one greater than the preceding value for any subsequent element. Any constant value that is supplied must be non-negative.
-
-    [10] Enum            ::=  'enum' Identifier '{' (Identifier ('=' IntConstant)? ListSeparator?)* '}'
-
-### Senum
-
-Senum (and Slist) are now deprecated and should both be replaced with String.
-
-    [11] Senum           ::=  'senum' Identifier '{' (Literal ListSeparator?)* '}'
-
-### Struct
-
-Structs are the fundamental compositional type in Thrift. The name of each field must be unique within the struct.
-
-    [12] Struct          ::=  'struct' Identifier 'xsd_all'? '{' Field* '}'
-
-N.B.: The `xsd_all` keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
-
-### Union
-
-Unions are similar to structs, except that they provide a means to transport exactly one field of a possible set of fields, just like union {} in C++. Consequently, union members cannot be required fields.
-
-    [13] Union          ::=  'union' Identifier 'xsd_all'? '{' Field* '}'
-
-N.B.: The `xsd_all` keyword has some purpose internal to Facebook but serves no purpose in Thrift itself. Use of this feature is strongly discouraged
-
-### Exception
-
-Exceptions are similar to structs except that they are intended to integrate with the native exception handling mechanisms in the target languages. The name of each field must be unique within the exception.
-
-    [14] Exception       ::=  'exception' Identifier '{' Field* '}'
-
-### Service
-
-A service provides the interface for a set of functionality provided by a Thrift server. The interface is simply a list of functions. A service can extend another service, which simply means that it provides the functions of the extended service in addition to its own.
-
-    [15] Service         ::=  'service' Identifier ( 'extends' Identifier )? '{' Function* '}'
-
-## Field
-
-    [16] Field           ::=  FieldID? FieldReq? FieldType Identifier ('= ConstValue)? XsdFieldOptions ListSeparator?
-
-### Field ID
-
-    [17] FieldID         ::=  IntConstant ':'
-
-### Field Requiredness
-
-    [18] FieldReq        ::=  'required' | 'optional'
-
-### XSD Options
-
-N.B.: These have  some internal purpose at Facebook but serve no current purpose in Thrift. Use of these options is strongly discouraged.
-
-    [19] XsdFieldOptions ::=  'xsd_optional'? 'xsd_nillable'? XsdAttrs?
-
-    [20] XsdAttrs        ::=  'xsd_attrs' '{' Field* '}'
-
-## Functions
-
-    [21] Function        ::=  'oneway'? FunctionType Identifier '(' Field* ')' Throws? ListSeparator?
-
-    [22] FunctionType    ::=  FieldType | 'void'
-
-    [23] Throws          ::=  'throws' '(' Field* ')'
-
-## Types
-
-    [24] FieldType       ::=  Identifier | BaseType | ContainerType
-
-    [25] DefinitionType  ::=  BaseType | ContainerType
-
-    [26] BaseType        ::=  'bool' | 'byte' | 'i16' | 'i32' | 'i64' | 'double' | 'string' | 'binary' | 'slist'
-
-    [27] ContainerType   ::=  MapType | SetType | ListType
-
-    [28] MapType         ::=  'map' CppType? '<' FieldType ',' FieldType '>'
-
-    [29] SetType         ::=  'set' CppType? '<' FieldType '>'
-
-    [30] ListType        ::=  'list' '<' FieldType '>' CppType?
-
-    [31] CppType         ::=  'cpp_type' Literal
-
-## Constant Values
-
-    [32] ConstValue      ::=  IntConstant | DoubleConstant | Literal | Identifier | ConstList | ConstMap
-
-    [33] IntConstant     ::=  ('+' | '-')? Digit+
-
-    [34] DoubleConstant  ::=  ('+' | '-')? Digit* ('.' Digit+)? ( ('E' | 'e') IntConstant )?
-
-    [35] ConstList       ::=  '[' (ConstValue ListSeparator?)* ']'
-
-    [36] ConstMap        ::=  '{' (ConstValue ':' ConstValue ListSeparator?)* '}'
-
-## Basic Definitions
-
-### Literal
-
-    [37] Literal         ::=  ('"' [^"]* '"') | ("'" [^']* "'")
-
-### Identifier
-
-    [38] Identifier      ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' )*
-
-    [39] STIdentifier    ::=  ( Letter | '_' ) ( Letter | Digit | '.' | '_' | '-' )*
-
-### List Separator
-
-    [40] ListSeparator   ::=  ',' | ';'
-
-### Letters and Digits
-
-    [41] Letter          ::=  ['A'-'Z'] | ['a'-'z']
-
-    [42] Digit           ::=  ['0'-'9']
-
-## Examples
-
-Here are some examples of Thrift definitions, using the Thrift IDL:
-
- * [ThriftTest.thrift][] used by the Thrift TestFramework
- * Thrift [tutorial][]
- * Facebook's [fb303.thrift][]
- * [Apache Cassandra's][] Thrift IDL: [cassandra.thrift][]
- * [Evernote API][]
-
- [ThriftTest.thrift]:  https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob_plain;f=test/ThriftTest.thrift;hb=HEAD
- [tutorial]:           /tutorial/
- [fb303.thrift]:       https://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob_plain;f=contrib/fb303/if/fb303.thrift;hb=HEAD
- [Apache Cassandra's]: http://cassandra.apache.org/
- [cassandra.thrift]:   http://svn.apache.org/viewvc/cassandra/trunk/interface/cassandra.thrift?view=co
- [Evernote API]:       http://www.evernote.com/about/developer/api/
-
-## To Do/Questions
-
-Initialization of Base Types for all Languages?
-
- * Do all Languages initialize them to 0, bool=false and string=""? or null, undefined?
-
-Why does position of `CppType` vary between `SetType` and `ListType`?
-
- * std::set does sort the elements automatically, that's the design. see [Thrift Types](/docs/types) or the [C++ std:set reference][] for further details
- * The question is, how other languages are doing that? What about custom objects, do they have a Compare function the set the order correctly?
-
- [C++ std:set reference]: http://www.cplusplus.com/reference/stl/set/
-
-Why can't `DefinitionType` be the same as `FieldType` (i.e. include `Identifier`)?
-
-Examine the `smalltalk.prefix` and `smalltalk.category` status (esp `smalltalk.category`, which takes `STIdentifier` as its argument)...
-
-What to do about `ListSeparator`? Do we really want to be as lax as we currently are?
-
-Should `Field*` really be `Field+` in `Struct`, `Enum`, etc.?
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/specs/thrift-protocol-spec.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/specs/thrift-protocol-spec.md b/depends/thirdparty/thrift/doc/specs/thrift-protocol-spec.md
deleted file mode 100644
index 950e163..0000000
--- a/depends/thirdparty/thrift/doc/specs/thrift-protocol-spec.md
+++ /dev/null
@@ -1,99 +0,0 @@
-Thrift Protocol Structure
-====================================================================
-
-Last Modified: 2007-Jun-29
-
---------------------------------------------------------------------
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-
---------------------------------------------------------------------
-
-This document describes the structure of the Thrift protocol
-without specifying the encoding. Thus, the order of elements
-could in some cases be rearranged depending upon the TProtocol
-implementation, but this document specifies the minimum required
-structure. There are some "dumb" terminals like STRING and INT
-that take the place of an actual encoding specification.
-
-They key point to notice is that ALL messages are just one wrapped
-`<struct>`. Depending upon the message type, the `<struct>` can be
-interpreted as the argument list to a function, the return value
-of a function, or an exception.
-
---------------------------------------------------------------------
-
-```
-       <message> ::= <message-begin> <struct> <message-end>
-
- <message-begin> ::= <method-name> <message-type> <message-seqid>
-
-   <method-name> ::= STRING
-
-  <message-type> ::= T_CALL | T_REPLY | T_EXCEPTION | T_ONEWAY
-
- <message-seqid> ::= I32
-
-        <struct> ::= <struct-begin> <field>* <field-stop> <struct-end>
-
-  <struct-begin> ::= <struct-name>
-
-   <struct-name> ::= STRING
-
-    <field-stop> ::= T_STOP
-
-         <field> ::= <field-begin> <field-data> <field-end>
-
-   <field-begin> ::= <field-name> <field-type> <field-id>
-
-    <field-name> ::= STRING
-
-    <field-type> ::= T_BOOL | T_BYTE | T_I8 | T_I16 | T_I32 | T_I64 | T_DOUBLE
-                     | T_STRING | T_BINARY | T_STRUCT | T_MAP | T_SET | T_LIST
-
-      <field-id> ::= I16
-
-    <field-data> ::= I8 | I16 | I32 | I64 | DOUBLE | STRING | BINARY
-                     <struct> | <map> | <list> | <set>
-
-           <map> ::= <map-begin> <field-datum>* <map-end>
-
-     <map-begin> ::= <map-key-type> <map-value-type> <map-size>
-
-  <map-key-type> ::= <field-type>
-
-<map-value-type> ::= <field-type>
-
-      <map-size> ::= I32
-
-          <list> ::= <list-begin> <field-data>* <list-end>
-
-    <list-begin> ::= <list-elem-type> <list-size>
-
-<list-elem-type> ::= <field-type>
-
-     <list-size> ::= I32
-
-           <set> ::= <set-begin> <field-data>* <set-end>
-
-     <set-begin> ::= <set-elem-type> <set-size>
-
- <set-elem-type> ::= <field-type>
-
-      <set-size> ::= I32
-```

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/specs/thrift-sasl-spec.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/specs/thrift-sasl-spec.txt b/depends/thirdparty/thrift/doc/specs/thrift-sasl-spec.txt
deleted file mode 100644
index 02cf79e..0000000
--- a/depends/thirdparty/thrift/doc/specs/thrift-sasl-spec.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-A Thrift SASL message shall be a byte array of the following form:
-
-| 1-byte status code | 4-byte payload length | variable-length payload |
-
-The length fields shall be interpreted as integers, with the high byte sent
-first. This indicates the length of the field immediately following it, not
-including the status code or the length bytes.
-
-The possible status codes are:
-
-0x01 - START - Hello, let's go on a date.
-0x02 - OK - Everything's been going alright so far, let's see each other again.
-0x03 - BAD - I understand what you're saying. I really do. I just don't like it. We have to break up.
-0x04 - ERROR - We can't go on like this. It's like you're speaking another language.
-0x05 - COMPLETE - Will you marry me?
-
-The Thrift SASL communication will proceed as follows:
-
-1. The client is configured at instantiation of the transport with a single
-underlying SASL security mechanism that it supports.
-
-2. The server is configured with a mapping of underlying security mechanism
-name -> mechanism options.
-
-3. At connection time, the client will initiate communication by sending the
-server a START message. The payload of this message will be the name of the
-underlying security mechanism that the client would like to use.
-This mechanism name shall be 1-20 characters in length, and follow the
-specifications for SASL mechanism names specified in RFC 2222.
-
-4. The server receives this message and, if the mechanism name provided is
-among the set of mechanisms this server transport is configured to accept,
-appropriate initialization of the underlying security mechanism may take place.
-If the mechanism name is not one which the server is configured to support, the
-server shall return the BAD byte, followed by a 4-byte, potentially zero-value
-message length, followed by the potentially zero-length payload which may be a
-status code or message indicating failure. No further communication may take
-place via this transport. If the mechanism name is one which the server
-supports, then proceed to step 5.
-
-5. Following the START message, the client must send another message containing
-the "initial response" of the chosen SASL implementation. The client may send
-this message piggy-backed on the "START" message of step 3. The message type
-of this message must be either "OK" or "COMPLETE", depending on whether the
-SASL implementation indicates that this side of the authentication has been
-satisfied.
-
-6. The server then provides the byte array of the payload received to its
-underlying security mechanism. A challenge is generated by the underlying
-security mechanism on the server, and this is used as the payload for a message
-sent to the client. This message shall consist of an OK byte, followed by the
-non-zero message length word, followed by the payload.
-
-7. The client receives this message from the server and passes the payload to
-its underlying security mechanism to generate a response. The client then sends
-the server an OK byte, followed by the non-zero-value length of the response,
-followed by the bytes of the response as the payload.
-
-8. Steps 6 and 7 are repeated until both security mechanisms are satisfied with
-the challenge/response exchange. When either side has completed its security
-protocol, its next message shall be the COMPLETE byte, followed by a 4-byte
-potentially zero-value length word, followed by a potentially zero-length
-payload. This payload will be empty except for those underlying security
-mechanisms which provide additional data with success.
-
-If at any point in time either side is able to interpret the challenge or
-response sent by the other, but is dissatisfied with the contents thereof, this
-side should send the other a BAD byte, followed by a 4-byte potentially
-zero-value length word, followed by an optional, potentially zero-length
-message encoded in UTF-8 indicating failure. This message should be passed to
-the protocol above the thrift transport by whatever mechanism is appropriate
-and idiomatic for the particular language these thrift bindings are for.
-
-If at any point in time either side fails to interpret the challenge or
-response sent by the other, this side should send the other an ERROR byte,
-followed by a 4-byte potentially zero-value length word, followed by an
-optional, potentially zero-length message encoded in UTF-8. This message should
-be passed to the protocol above the thrift transport by whatever mechanism is
-appropriate and idiomatic for the particular language these thrift bindings are
-for.
-
-If step 8 completes successfully, then the communication is considered
-authenticated and subsequent communication may commence.
-
-If step 8 fails to complete successfully, then no further communication may
-take place via this transport.
-
-8. All writes to the underlying transport must be prefixed by the 4-byte length
-of the payload data, followed by the payload. All reads from this transport
-should read the 4-byte length word, then read the full quantity of bytes
-specified by this length word.
-
-If no SASL QOP (quality of protection) is negotiated during steps 6 and 7, then
-all subsequent writes to/reads from this transport are written/read unaltered,
-save for the length prefix, to the underlying transport.
-
-If a SASL QOP is negotiated, then this must be used by the Thrift transport for
-all subsequent communication. This is done by wrapping subsequent writes to the
-transport using the underlying security mechanism, and unwrapping subsequent
-reads from the underlying transport. Note that in this case, the length prefix
-of the write to the underlying transport is the length of the data after it has
-been wrapped by the underlying security mechanism. Note that the complete
-message must be read before giving this data to the underlying security
-mechanism for unwrapping.
-
-If at any point in time reading of a message fails either because of a
-malformed length word or failure to unwrap by the underlying security
-mechanism, then all further communication on this transport must cease.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/specs/thrift.tex
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/specs/thrift.tex b/depends/thirdparty/thrift/doc/specs/thrift.tex
deleted file mode 100644
index a706fcb..0000000
--- a/depends/thirdparty/thrift/doc/specs/thrift.tex
+++ /dev/null
@@ -1,1057 +0,0 @@
-%-----------------------------------------------------------------------------
-%
-%               Thrift whitepaper
-%
-% Name:         thrift.tex
-%
-% Authors:      Mark Slee (mcslee@facebook.com)
-%
-% Created:      05 March 2007
-%
-% You will need a copy of sigplanconf.cls to format this document.
-% It is available at <http://www.sigplan.org/authorInformation.htm>.
-%
-%-----------------------------------------------------------------------------
-
-
-\documentclass[nocopyrightspace,blockstyle]{sigplanconf}
-
-\usepackage{amssymb}
-\usepackage{amsfonts}
-\usepackage{amsmath}
-\usepackage{url}
-
-\begin{document}
-
-% \conferenceinfo{WXYZ '05}{date, City.}
-% \copyrightyear{2007}
-% \copyrightdata{[to be supplied]}
-
-% \titlebanner{banner above paper title}        % These are ignored unless
-% \preprintfooter{short description of paper}   % 'preprint' option specified.
-
-\title{Thrift: Scalable Cross-Language Services Implementation}
-\subtitle{}
-
-\authorinfo{Mark Slee, Aditya Agarwal and Marc Kwiatkowski}
-           {Facebook, 156 University Ave, Palo Alto, CA}
-           {\{mcslee,aditya,marc\}@facebook.com}
-
-\maketitle
-
-\begin{abstract}
-Thrift is a software library and set of code-generation tools developed at
-Facebook to expedite development and implementation of efficient and scalable
-backend services. Its primary goal is to enable efficient and reliable
-communication across programming languages by abstracting the portions of each
-language that tend to require the most customization into a common library
-that is implemented in each language. Specifically, Thrift allows developers to
-define datatypes and service interfaces in a single language-neutral file
-and generate all the necessary code to build RPC clients and servers.
-
-This paper details the motivations and design choices we made in Thrift, as
-well as some of the more interesting implementation details. It is not
-intended to be taken as research, but rather it is an exposition on what we did
-and why.
-\end{abstract}
-
-% \category{D.3.3}{Programming Languages}{Language constructs and features}
-
-%\terms
-%Languages, serialization, remote procedure call
-
-%\keywords
-%Data description language, interface definition language, remote procedure call
-
-\section{Introduction}
-As Facebook's traffic and network structure have scaled, the resource
-demands of many operations on the site (i.e. search,
-ad selection and delivery, event logging) have presented technical requirements
-drastically outside the scope of the LAMP framework. In our implementation of
-these services, various programming languages have been selected to
-optimize for the right combination of performance, ease and speed of
-development, availability of existing libraries, etc. By and large,
-Facebook's engineering culture has tended towards choosing the best
-tools and implementations available over standardizing on any one
-programming language and begrudgingly accepting its inherent limitations.
-
-Given this design choice, we were presented with the challenge of building
-a transparent, high-performance bridge across many programming languages.
-We found that most available solutions were either too limited, did not offer
-sufficient datatype freedom, or suffered from subpar performance.
-\footnote{See Appendix A for a discussion of alternative systems.}
-
-The solution that we have implemented combines a language-neutral software
-stack implemented across numerous programming languages and an associated code
-generation engine that transforms a simple interface and data definition
-language into client and server remote procedure call libraries.
-Choosing static code generation over a dynamic system allows us to create
-validated code that can be run without the need for
-any advanced introspective run-time type checking. It is also designed to
-be as simple as possible for the developer, who can typically define all
-the necessary data structures and interfaces for a complex service in a single
-short file.
-
-Surprised that a robust open solution to these relatively common problems
-did not yet exist, we committed early on to making the Thrift implementation
-open source.
-
-In evaluating the challenges of cross-language interaction in a networked
-environment, some key components were identified:
-
-\textit{Types.} A common type system must exist across programming languages
-without requiring that the application developer use custom Thrift datatypes
-or write their own serialization code. That is,
-a C++ programmer should be able to transparently exchange a strongly typed
-STL map for a dynamic Python dictionary. Neither
-programmer should be forced to write any code below the application layer
-to achieve this. Section 2 details the Thrift type system.
-
-\textit{Transport.} Each language must have a common interface to
-bidirectional raw data transport. The specifics of how a given
-transport is implemented should not matter to the service developer.
-The same application code should be able to run against TCP stream sockets,
-raw data in memory, or files on disk. Section 3 details the Thrift Transport
-layer.
-
-\textit{Protocol.} Datatypes must have some way of using the Transport
-layer to encode and decode themselves. Again, the application
-developer need not be concerned by this layer. Whether the service uses
-an XML or binary protocol is immaterial to the application code.
-All that matters is that the data can be read and written in a consistent,
-deterministic matter. Section 4 details the Thrift Protocol layer.
-
-\textit{Versioning.} For robust services, the involved datatypes must
-provide a mechanism for versioning themselves. Specifically,
-it should be possible to add or remove fields in an object or alter the
-argument list of a function without any interruption in service (or,
-worse yet, nasty segmentation faults). Section 5 details Thrift's versioning
-system.
-
-\textit{Processors.} Finally, we generate code capable of processing data
-streams to accomplish remote procedure calls. Section 6 details the generated
-code and TProcessor paradigm.
-
-Section 7 discusses implementation details, and Section 8 describes
-our conclusions.
-
-\section{Types}
-
-The goal of the Thrift type system is to enable programmers to develop using
-completely natively defined types, no matter what programming language they
-use. By design, the Thrift type system does not introduce any special dynamic
-types or wrapper objects. It also does not require that the developer write
-any code for object serialization or transport. The Thrift IDL (Interface
-Definition Language) file is
-logically a way for developers to annotate their data structures with the
-minimal amount of extra information necessary to tell a code generator
-how to safely transport the objects across languages.
-
-\subsection{Base Types}
-
-The type system rests upon a few base types. In considering which types to
-support, we aimed for clarity and simplicity over abundance, focusing
-on the key types available in all programming languages, omitting any
-niche types available only in specific languages.
-
-The base types supported by Thrift are:
-\begin{itemize}
-\item \texttt{bool} A boolean value, true or false
-\item \texttt{byte} A signed byte
-\item \texttt{i16} A 16-bit signed integer
-\item \texttt{i32} A 32-bit signed integer
-\item \texttt{i64} A 64-bit signed integer
-\item \texttt{double} A 64-bit floating point number
-\item \texttt{string} An encoding-agnostic text or binary string
-\item \texttt{binary} A byte array representation for blobs
-\end{itemize}
-
-Of particular note is the absence of unsigned integer types. Because these
-types have no direct translation to native primitive types in many languages,
-the advantages they afford are lost. Further, there is no way to prevent the
-application developer in a language like Python from assigning a negative value
-to an integer variable, leading to unpredictable behavior. From a design
-standpoint, we observed that unsigned integers were very rarely, if ever, used
-for arithmetic purposes, but in practice were much more often used as keys or
-identifiers. In this case, the sign is irrelevant. Signed integers serve this
-same purpose and can be safely cast to their unsigned counterparts (most
-commonly in C++) when absolutely necessary.
-
-\subsection{Structs}
-
-A Thrift struct defines a common object to be used across languages. A struct
-is essentially equivalent to a class in object oriented programming
-languages. A struct has a set of strongly typed fields, each with a unique
-name identifier. The basic syntax for defining a Thrift struct looks very
-similar to a C struct definition. Fields may be annotated with an integer field
-identifier (unique to the scope of that struct) and optional default values.
-Field identifiers will be automatically assigned if omitted, though they are
-strongly encouraged for versioning reasons discussed later.
-
-\subsection{Containers}
-
-Thrift containers are strongly typed containers that map to the most commonly
-used containers in common programming languages. They are annotated using
-the C++ template (or Java Generics) style. There are three types available:
-\begin{itemize}
-\item \texttt{list<type>} An ordered list of elements. Translates directly into
-an STL \texttt{vector}, Java \texttt{ArrayList}, or native array in scripting languages. May
-contain duplicates.
-\item \texttt{set<type>} An unordered set of unique elements. Translates into
-an STL \texttt{set}, Java \texttt{HashSet}, \texttt{set} in Python, or native
-dictionary in PHP/Ruby.
-\item \texttt{map<type1,type2>} A map of strictly unique keys to values
-Translates into an STL \texttt{map}, Java \texttt{HashMap}, PHP associative
-array, or Python/Ruby dictionary.
-\end{itemize}
-
-While defaults are provided, the type mappings are not explicitly fixed. Custom
-code generator directives have been added to substitute custom types in
-destination languages (i.e.
-\texttt{hash\_map} or Google's sparse hash map can be used in C++). The
-only requirement is that the custom types support all the necessary iteration
-primitives. Container elements may be of any valid Thrift type, including other
-containers or structs.
-
-\begin{verbatim}
-struct Example {
-  1:i32 number=10,
-  2:i64 bigNumber,
-  3:double decimals,
-  4:string name="thrifty"
-}\end{verbatim}
-
-In the target language, each definition generates a type with two methods,
-\texttt{read} and \texttt{write}, which perform serialization and transport
-of the objects using a Thrift TProtocol object.
-
-\subsection{Exceptions}
-
-Exceptions are syntactically and functionally equivalent to structs except
-that they are declared using the \texttt{exception} keyword instead of the
-\texttt{struct} keyword.
-
-The generated objects inherit from an exception base class as appropriate
-in each target programming language, in order to seamlessly
-integrate with native exception handling in any given
-language. Again, the design emphasis is on making the code familiar to the
-application developer.
-
-\subsection{Services}
-
-Services are defined using Thrift types. Definition of a service is
-semantically equivalent to defining an interface (or a pure virtual abstract
-class) in object oriented
-programming. The Thrift compiler generates fully functional client and
-server stubs that implement the interface. Services are defined as follows:
-
-\begin{verbatim}
-service <name> {
-  <returntype> <name>(<arguments>)
-    [throws (<exceptions>)]
-  ...
-}\end{verbatim}
-
-An example:
-
-\begin{verbatim}
-service StringCache {
-  void set(1:i32 key, 2:string value),
-  string get(1:i32 key) throws (1:KeyNotFound knf),
-  void delete(1:i32 key)
-}
-\end{verbatim}
-
-Note that \texttt{void} is a valid type for a function return, in addition to
-all other defined Thrift types. Additionally, an \texttt{async} modifier
-keyword may be added to a \texttt{void} function, which will generate code that does
-not wait for a response from the server. Note that a pure \texttt{void}
-function will return a response to the client which guarantees that the
-operation has completed on the server side. With \texttt{async} method calls
-the client will only be guaranteed that the request succeeded at the
-transport layer. (In many transport scenarios this is inherently unreliable
-due to the Byzantine Generals' Problem. Therefore, application developers
-should take care only to use the async optimization in cases where dropped
-method calls are acceptable or the transport is known to be reliable.)
-
-Also of note is the fact that argument lists and exception lists for functions
-are implemented as Thrift structs. All three constructs are identical in both
-notation and behavior.
-
-\section{Transport}
-
-The transport layer is used by the generated code to facilitate data transfer.
-
-\subsection{Interface}
-
-A key design choice in the implementation of Thrift was to decouple the
-transport layer from the code generation layer. Though Thrift is typically
-used on top of the TCP/IP stack with streaming sockets as the base layer of
-communication, there was no compelling reason to build that constraint into
-the system. The performance tradeoff incurred by an abstracted I/O layer
-(roughly one virtual method lookup / function call per operation) was
-immaterial compared to the cost of actual I/O operations (typically invoking
-system calls).
-
-Fundamentally, generated Thrift code only needs to know how to read and
-write data. The origin and destination of the data are irrelevant; it may be a
-socket, a segment of shared memory, or a file on the local disk. The Thrift
-transport interface supports the following methods:
-
-\begin{itemize}
-\item \texttt{open} Opens the transport
-\item \texttt{close} Closes the transport
-\item \texttt{isOpen} Indicates whether the transport is open
-\item \texttt{read} Reads from the transport
-\item \texttt{write} Writes to the transport
-\item \texttt{flush} Forces any pending writes
-\end{itemize}
-
-There are a few additional methods not documented here which are used to aid
-in batching reads and optionally signaling the completion of a read or
-write operation from the generated code.
-
-In addition to the above
-\texttt{TTransport} interface, there is a\\
-\texttt{TServerTransport} interface
-used to accept or create primitive transport objects. Its interface is as
-follows:
-
-\begin{itemize}
-\item \texttt{open} Opens the transport
-\item \texttt{listen} Begins listening for connections
-\item \texttt{accept} Returns a new client transport
-\item \texttt{close} Closes the transport
-\end{itemize}
-
-\subsection{Implementation}
-
-The transport interface is designed for simple implementation in any
-programming language. New transport mechanisms can be easily defined as needed
-by application developers.
-
-\subsubsection{TSocket}
-
-The \texttt{TSocket} class is implemented across all target languages. It
-provides a common, simple interface to a TCP/IP stream socket.
-
-\subsubsection{TFileTransport}
-
-The \texttt{TFileTransport} is an abstraction of an on-disk file to a data
-stream. It can be used to write out a set of incoming Thrift requests to a file
-on disk. The on-disk data can then be replayed from the log, either for
-post-processing or for reproduction and/or simulation of past events.
-
-\subsubsection{Utilities}
-
-The Transport interface is designed to support easy extension using common
-OOP techniques, such as composition. Some simple utilities include the
-\texttt{TBufferedTransport}, which buffers the writes and reads on an
-underlying transport, the \texttt{TFramedTransport}, which transmits data with frame
-size headers for chunking optimization or nonblocking operation, and the
-\texttt{TMemoryBuffer}, which allows reading and writing directly from the heap
-or stack memory owned by the process.
-
-\section{Protocol}
-
-A second major abstraction in Thrift is the separation of data structure from
-transport representation. Thrift enforces a certain messaging structure when
-transporting data, but it is agnostic to the protocol encoding in use. That is,
-it does not matter whether data is encoded as XML, human-readable ASCII, or a
-dense binary format as long as the data supports a fixed set of operations
-that allow it to be deterministically read and written by generated code.
-
-\subsection{Interface}
-
-The Thrift Protocol interface is very straightforward. It fundamentally
-supports two things: 1) bidirectional sequenced messaging, and
-2) encoding of base types, containers, and structs.
-
-\begin{verbatim}
-writeMessageBegin(name, type, seq)
-writeMessageEnd()
-writeStructBegin(name)
-writeStructEnd()
-writeFieldBegin(name, type, id)
-writeFieldEnd()
-writeFieldStop()
-writeMapBegin(ktype, vtype, size)
-writeMapEnd()
-writeListBegin(etype, size)
-writeListEnd()
-writeSetBegin(etype, size)
-writeSetEnd()
-writeBool(bool)
-writeByte(byte)
-writeI16(i16)
-writeI32(i32)
-writeI64(i64)
-writeDouble(double)
-writeString(string)
-
-name, type, seq = readMessageBegin()
-                  readMessageEnd()
-name =            readStructBegin()
-                  readStructEnd()
-name, type, id =  readFieldBegin()
-                  readFieldEnd()
-k, v, size =      readMapBegin()
-                  readMapEnd()
-etype, size =     readListBegin()
-                  readListEnd()
-etype, size =     readSetBegin()
-                  readSetEnd()
-bool =            readBool()
-byte =            readByte()
-i16 =             readI16()
-i32 =             readI32()
-i64 =             readI64()
-double =          readDouble()
-string =          readString()
-\end{verbatim}
-
-Note that every \texttt{write} function has exactly one \texttt{read} counterpart, with
-the exception of \texttt{writeFieldStop()}. This is a special method
-that signals the end of a struct. The procedure for reading a struct is to
-\texttt{readFieldBegin()} until the stop field is encountered, and then to
-\texttt{readStructEnd()}.  The
-generated code relies upon this call sequence to ensure that everything written by
-a protocol encoder can be read by a matching protocol decoder. Further note
-that this set of functions is by design more robust than necessary.
-For example, \texttt{writeStructEnd()} is not strictly necessary, as the end of
-a struct may be implied by the stop field. This method is a convenience for
-verbose protocols in which it is cleaner to separate these calls (e.g. a closing
-\texttt{</struct>} tag in XML).
-
-\subsection{Structure}
-
-Thrift structures are designed to support encoding into a streaming
-protocol. The implementation should never need to frame or compute the
-entire data length of a structure prior to encoding it. This is critical to
-performance in many scenarios. Consider a long list of relatively large
-strings. If the protocol interface required reading or writing a list to be an
-atomic operation, then the implementation would need to perform a linear pass over the
-entire list before encoding any data. However, if the list can be written
-as iteration is performed, the corresponding read may begin in parallel,
-theoretically offering an end-to-end speedup of $(kN - C)$, where $N$ is the size
-of the list, $k$ the cost factor associated with serializing a single
-element, and $C$ is fixed offset for the delay between data being written
-and becoming available to read.
-
-Similarly, structs do not encode their data lengths a priori. Instead, they are
-encoded as a sequence of fields, with each field having a type specifier and a
-unique field identifier. Note that the inclusion of type specifiers allows
-the protocol to be safely parsed and decoded without any generated code
-or access to the original IDL file. Structs are terminated by a field header
-with a special \texttt{STOP} type. Because all the basic types can be read
-deterministically, all structs (even those containing other structs) can be
-read deterministically. The Thrift protocol is self-delimiting without any
-framing and regardless of the encoding format.
-
-In situations where streaming is unnecessary or framing is advantageous, it
-can be very simply added into the transport layer, using the
-\texttt{TFramedTransport} abstraction.
-
-\subsection{Implementation}
-
-Facebook has implemented and deployed a space-efficient binary protocol which
-is used by most backend services. Essentially, it writes all data
-in a flat binary format. Integer types are converted to network byte order,
-strings are prepended with their byte length, and all message and field headers
-are written using the primitive integer serialization constructs. String names
-for fields are omitted - when using generated code, field identifiers are
-sufficient.
-
-We decided against some extreme storage optimizations (i.e. packing
-small integers into ASCII or using a 7-bit continuation format) for the sake
-of simplicity and clarity in the code. These alterations can easily be made
-if and when we encounter a performance-critical use case that demands them.
-
-\section{Versioning}
-
-Thrift is robust in the face of versioning and data definition changes. This
-is critical to enable staged rollouts of changes to deployed services. The
-system must be able to support reading of old data from log files, as well as
-requests from out-of-date clients to new servers, and vice versa.
-
-\subsection{Field Identifiers}
-
-Versioning in Thrift is implemented via field identifiers. The field header
-for every member of a struct in Thrift is encoded with a unique field
-identifier. The combination of this field identifier and its type specifier
-is used to uniquely identify the field. The Thrift definition language
-supports automatic assignment of field identifiers, but it is good
-programming practice to always explicitly specify field identifiers.
-Identifiers are specified as follows:
-
-\begin{verbatim}
-struct Example {
-  1:i32 number=10,
-  2:i64 bigNumber,
-  3:double decimals,
-  4:string name="thrifty"
-}\end{verbatim}
-
-To avoid conflicts between manually and automatically assigned identifiers,
-fields with identifiers omitted are assigned identifiers
-decrementing from -1, and the language only supports the manual assignment of
-positive identifiers.
-
-When data is being deserialized, the generated code can use these identifiers
-to properly identify the field and determine whether it aligns with a field in
-its definition file. If a field identifier is not recognized, the generated
-code can use the type specifier to skip the unknown field without any error.
-Again, this is possible due to the fact that all datatypes are self
-delimiting.
-
-Field identifiers can (and should) also be specified in function argument
-lists. In fact, argument lists are not only represented as structs on the
-backend, but actually share the same code in the compiler frontend. This
-allows for version-safe modification of method parameters
-
-\begin{verbatim}
-service StringCache {
-  void set(1:i32 key, 2:string value),
-  string get(1:i32 key) throws (1:KeyNotFound knf),
-  void delete(1:i32 key)
-}
-\end{verbatim}
-
-The syntax for specifying field identifiers was chosen to echo their structure.
-Structs can be thought of as a dictionary where the identifiers are keys, and
-the values are strongly-typed named fields.
-
-Field identifiers internally use the \texttt{i16} Thrift type. Note, however,
-that the \texttt{TProtocol} abstraction may encode identifiers in any format.
-
-\subsection{Isset}
-
-When an unexpected field is encountered, it can be safely ignored and
-discarded. When an expected field is not found, there must be some way to
-signal to the developer that it was not present. This is implemented via an
-inner \texttt{isset} structure inside the defined objects. (Isset functionality
-is implicit with a \texttt{null} value in PHP, \texttt{None} in Python
-and \texttt{nil} in Ruby.) Essentially,
-the inner \texttt{isset} object of each Thrift struct contains a boolean value
-for each field which denotes whether or not that field is present in the
-struct. When a reader receives a struct, it should check for a field being set
-before operating directly on it.
-
-\begin{verbatim}
-class Example {
- public:
-  Example() :
-    number(10),
-    bigNumber(0),
-    decimals(0),
-    name("thrifty") {}
-
-  int32_t number;
-  int64_t bigNumber;
-  double decimals;
-  std::string name;
-
-  struct __isset {
-    __isset() :
-      number(false),
-      bigNumber(false),
-      decimals(false),
-      name(false) {}
-    bool number;
-    bool bigNumber;
-    bool decimals;
-    bool name;
-  } __isset;
-...
-}
-\end{verbatim}
-
-\subsection{Case Analysis}
-
-There are four cases in which version mismatches may occur.
-
-\begin{enumerate}
-\item \textit{Added field, old client, new server.} In this case, the old
-client does not send the new field. The new server recognizes that the field
-is not set, and implements default behavior for out-of-date requests.
-\item \textit{Removed field, old client, new server.} In this case, the old
-client sends the removed field. The new server simply ignores it.
-\item \textit{Added field, new client, old server.} The new client sends a
-field that the old server does not recognize. The old server simply ignores
-it and processes as normal.
-\item \textit{Removed field, new client, old server.} This is the most
-dangerous case, as the old server is unlikely to have suitable default
-behavior implemented for the missing field. It is recommended that in this
-situation the new server be rolled out prior to the new clients.
-\end{enumerate}
-
-\subsection{Protocol/Transport Versioning}
-The \texttt{TProtocol} abstractions are also designed to give protocol
-implementations the freedom to version themselves in whatever manner they
-see fit. Specifically, any protocol implementation is free to send whatever
-it likes in the \texttt{writeMessageBegin()} call. It is entirely up to the
-implementor how to handle versioning at the protocol level. The key point is
-that protocol encoding changes are safely isolated from interface definition
-version changes.
-
-Note that the exact same is true of the \texttt{TTransport} interface. For
-example, if we wished to add some new checksumming or error detection to the
-\texttt{TFileTransport}, we could simply add a version header into the
-data it writes to the file in such a way that it would still accept old
-log files without the given header.
-
-\section{RPC Implementation}
-
-\subsection{TProcessor}
-
-The last core interface in the Thrift design is the \texttt{TProcessor},
-perhaps the most simple of the constructs. The interface is as follows:
-
-\begin{verbatim}
-interface TProcessor {
-  bool process(TProtocol in, TProtocol out)
-    throws TException
-}
-\end{verbatim}
-
-The key design idea here is that the complex systems we build can fundamentally
-be broken down into agents or services that operate on inputs and outputs. In
-most cases, there is actually just one input and output (an RPC client) that
-needs handling.
-
-\subsection{Generated Code}
-
-When a service is defined, we generate a
-\texttt{TProcessor} instance capable of handling RPC requests to that service,
-using a few helpers. The fundamental structure (illustrated in pseudo-C++) is
-as follows:
-
-\begin{verbatim}
-Service.thrift
- => Service.cpp
-     interface ServiceIf
-     class ServiceClient : virtual ServiceIf
-       TProtocol in
-       TProtocol out
-     class ServiceProcessor : TProcessor
-       ServiceIf handler
-
-ServiceHandler.cpp
- class ServiceHandler : virtual ServiceIf
-
-TServer.cpp
- TServer(TProcessor processor,
-         TServerTransport transport,
-         TTransportFactory tfactory,
-         TProtocolFactory pfactory)
- serve()
-\end{verbatim}
-
-From the Thrift definition file, we generate the virtual service interface.
-A client class is generated, which implements the interface and
-uses two \texttt{TProtocol} instances to perform the I/O operations. The
-generated processor implements the \texttt{TProcessor} interface. The generated
-code has all the logic to handle RPC invocations via the \texttt{process()}
-call, and takes as a parameter an instance of the service interface, as
-implemented by the application developer.
-
-The user provides an implementation of the application interface in separate,
-non-generated source code.
-
-\subsection{TServer}
-
-Finally, the Thrift core libraries provide a \texttt{TServer} abstraction.
-The \texttt{TServer} object generally works as follows.
-
-\begin{itemize}
-\item Use the \texttt{TServerTransport} to get a \texttt{TTransport}
-\item Use the \texttt{TTransportFactory} to optionally convert the primitive
-transport into a suitable application transport (typically the
-\texttt{TBufferedTransportFactory} is used here)
-\item Use the \texttt{TProtocolFactory} to create an input and output protocol
-for the \texttt{TTransport}
-\item Invoke the \texttt{process()} method of the \texttt{TProcessor} object
-\end{itemize}
-
-The layers are appropriately separated such that the server code needs to know
-nothing about any of the transports, encodings, or applications in play. The
-server encapsulates the logic around connection handling, threading, etc.
-while the processor deals with RPC. The only code written by the application
-developer lives in the definitional Thrift file and the interface
-implementation.
-
-Facebook has deployed multiple \texttt{TServer} implementations, including
-the single-threaded \texttt{TSimpleServer}, thread-per-connection
-\texttt{TThreadedServer}, and thread-pooling \texttt{TThreadPoolServer}.
-
-The \texttt{TProcessor} interface is very general by design. There is no
-requirement that a \texttt{TServer} take a generated \texttt{TProcessor}
-object. Thrift allows the application developer to easily write any type of
-server that operates on \texttt{TProtocol} objects (for instance, a server
-could simply stream a certain type of object without any actual RPC method
-invocation).
-
-\section{Implementation Details}
-\subsection{Target Languages}
-Thrift currently supports five target languages: C++, Java, Python, Ruby, and
-PHP. At Facebook, we have deployed servers predominantly in C++, Java, and
-Python. Thrift services implemented in PHP have also been embedded into the
-Apache web server, providing transparent backend access to many of our
-frontend constructs using a \texttt{THttpClient} implementation of the
-\texttt{TTransport} interface.
-
-Though Thrift was explicitly designed to be much more efficient and robust
-than typical web technologies, as we were designing our XML-based REST web
-services API we noticed that Thrift could be easily used to define our
-service interface. Though we do not currently employ SOAP envelopes (in the
-authors' opinions there is already far too much repetitive enterprise Java
-software to do that sort of thing), we were able to quickly extend Thrift to
-generate XML Schema Definition files for our service, as well as a framework
-for versioning different implementations of our web service. Though public
-web services are admittedly tangential to Thrift's core use case and design,
-Thrift facilitated rapid iteration and affords us the ability to quickly
-migrate our entire XML-based web service onto a higher performance system
-should the need arise.
-
-\subsection{Generated Structs}
-We made a conscious decision to make our generated structs as transparent as
-possible. All fields are publicly accessible; there are no \texttt{set()} and
-\texttt{get()} methods. Similarly, use of the \texttt{isset} object is not
-enforced. We do not include any \texttt{FieldNotSetException} construct.
-Developers have the option to use these fields to write more robust code, but
-the system is robust to the developer ignoring the \texttt{isset} construct
-entirely and will provide suitable default behavior in all cases.
-
-This choice was motivated by the desire to ease application development. Our stated
-goal is not to make developers learn a rich new library in their language of
-choice, but rather to generate code that allow them to work with the constructs
-that are most familiar in each language.
-
-We also made the \texttt{read()} and \texttt{write()} methods of the generated
-objects public so that the objects can be used outside of the context
-of RPC clients and servers. Thrift is a useful tool simply for generating
-objects that are easily serializable across programming languages.
-
-\subsection{RPC Method Identification}
-Method calls in RPC are implemented by sending the method name as a string. One
-issue with this approach is that longer method names require more bandwidth.
-We experimented with using fixed-size hashes to identify methods, but in the
-end concluded that the savings were not worth the headaches incurred. Reliably
-dealing with conflicts across versions of an interface definition file is
-impossible without a meta-storage system (i.e. to generate non-conflicting
-hashes for the current version of a file, we would have to know about all
-conflicts that ever existed in any previous version of the file).
-
-We wanted to avoid too many unnecessary string comparisons upon
-method invocation. To deal with this, we generate maps from strings to function
-pointers, so that invocation is effectively accomplished via a constant-time
-hash lookup in the common case. This requires the use of a couple interesting
-code constructs. Because Java does not have function pointers, process
-functions are all private member classes implementing a common interface.
-
-\begin{verbatim}
-private class ping implements ProcessFunction {
-  public void process(int seqid,
-                      TProtocol iprot,
-                      TProtocol oprot)
-    throws TException
-  { ...}
-}
-
-HashMap<String,ProcessFunction> processMap_ =
-  new HashMap<String,ProcessFunction>();
-\end{verbatim}
-
-In C++, we use a relatively esoteric language construct: member function
-pointers.
-
-\begin{verbatim}
-std::map<std::string,
-  void (ExampleServiceProcessor::*)(int32_t,
-  facebook::thrift::protocol::TProtocol*,
-  facebook::thrift::protocol::TProtocol*)>
- processMap_;
-\end{verbatim}
-
-Using these techniques, the cost of string processing is minimized, and we
-reap the benefit of being able to easily debug corrupt or misunderstood data by
-inspecting it for known string method names.
-
-\subsection{Servers and Multithreading}
-Thrift services require basic multithreading to handle simultaneous
-requests from multiple clients. For the Python and Java implementations of
-Thrift server logic, the standard threading libraries distributed with the
-languages provide adequate support. For the C++ implementation, no standard multithread runtime
-library exists. Specifically, robust, lightweight, and portable
-thread manager and timer class implementations do not exist. We investigated
-existing implementations, namely \texttt{boost::thread},
-\texttt{boost::threadpool}, \texttt{ACE\_Thread\_Manager} and
-\texttt{ACE\_Timer}.
-
-While \texttt{boost::threads}\cite{boost.threads}  provides clean,
-lightweight and robust implementations of multi-thread primitives (mutexes,
-conditions, threads) it does not provide a thread manager or timer
-implementation.
-
-\texttt{boost::threadpool}\cite{boost.threadpool} also looked promising but
-was not far enough along for our purposes. We wanted to limit the dependency on
-third-party libraries as much as possible. Because\\
-\texttt{boost::threadpool} is
-not a pure template library and requires runtime libraries and because it is
-not yet part of the official Boost distribution we felt it was not ready for
-use in Thrift. As \texttt{boost::threadpool} evolves and especially if it is
-added to the Boost distribution we may reconsider our decision to not use it.
-
-ACE has both a thread manager and timer class in addition to multi-thread
-primitives. The biggest problem with ACE is that it is ACE. Unlike Boost, ACE
-API quality is poor. Everything in ACE has large numbers of dependencies on
-everything else in ACE - thus forcing developers to throw out standard
-classes, such as STL collections, in favor of ACE's homebrewed implementations. In
-addition, unlike Boost, ACE implementations demonstrate little understanding
-of the power and pitfalls of C++ programming and take no advantage of modern
-templating techniques to ensure compile time safety and reasonable compiler
-error messages. For all these reasons, ACE was rejected. Instead, we chose
-to implement our own library, described in the following sections.
-
-\subsection{Thread Primitives}
-
-The Thrift thread libraries are implemented in the namespace\\
-\texttt{facebook::thrift::concurrency} and have three components:
-\begin{itemize}
-\item primitives
-\item thread pool manager
-\item timer manager
-\end{itemize}
-
-As mentioned above, we were hesitant to introduce any additional dependencies
-on Thrift. We decided to use \texttt{boost::shared\_ptr} because it is so
-useful for multithreaded application, it requires no link-time or
-runtime libraries (i.e. it is a pure template library) and it is due
-to become part of the C++0x standard.
-
-We implement standard \texttt{Mutex} and \texttt{Condition} classes, and a
- \texttt{Monitor} class. The latter is simply a combination of a mutex and
-condition variable and is analogous to the \texttt{Monitor} implementation provided for
-the Java \texttt{Object} class. This is also sometimes referred to as a barrier. We
-provide a \texttt{Synchronized} guard class to allow Java-like synchronized blocks.
-This is just a bit of syntactic sugar, but, like its Java counterpart, clearly
-delimits critical sections of code. Unlike its Java counterpart, we still
-have the ability to programmatically lock, unlock, block, and signal monitors.
-
-\begin{verbatim}
-void run() {
- {Synchronized s(manager->monitor);
-  if (manager->state == TimerManager::STARTING) {
-    manager->state = TimerManager::STARTED;
-    manager->monitor.notifyAll();
-  }
- }
-}
-\end{verbatim}
-
-We again borrowed from Java the distinction between a thread and a runnable
-class. A \texttt{Thread} is the actual schedulable object. The
-\texttt{Runnable} is the logic to execute within the thread.
-The \texttt{Thread} implementation deals with all the platform-specific thread
-creation and destruction issues, while the \texttt{Runnable} implementation deals
-with the application-specific per-thread logic. The benefit of this approach
-is that developers can easily subclass the Runnable class without pulling in
-platform-specific super-classes.
-
-\subsection{Thread, Runnable, and shared\_ptr}
-We use \texttt{boost::shared\_ptr} throughout the \texttt{ThreadManager} and
-\texttt{TimerManager} implementations to guarantee cleanup of dead objects that can
-be accessed by multiple threads. For \texttt{Thread} class implementations,
-\texttt{boost::shared\_ptr} usage requires particular attention to make sure
-\texttt{Thread} objects are neither leaked nor dereferenced prematurely while
-creating and shutting down threads.
-
-Thread creation requires calling into a C library. (In our case the POSIX
-thread library, \texttt{libpthread}, but the same would be true for WIN32 threads).
-Typically, the OS makes few, if any, guarantees about when \texttt{ThreadMain}, a C thread's entry-point function, will be called. Therefore, it is
-possible that our thread create call,
-\texttt{ThreadFactory::newThread()} could return to the caller
-well before that time. To ensure that the returned \texttt{Thread} object is not
-prematurely cleaned up if the caller gives up its reference prior to the
-\texttt{ThreadMain} call, the \texttt{Thread} object makes a weak reference to
-itself in its \texttt{start} method.
-
-With the weak reference in hand the \texttt{ThreadMain} function can attempt to get
-a strong reference before entering the \texttt{Runnable::run} method of the
-\texttt{Runnable} object bound to the \texttt{Thread}. If no strong references to the
-thread are obtained between exiting \texttt{Thread::start} and entering \texttt{ThreadMain}, the weak reference returns \texttt{null} and the function
-exits immediately.
-
-The need for the \texttt{Thread} to make a weak reference to itself has a
-significant impact on the API. Since references are managed through the
-\texttt{boost::shared\_ptr} templates, the \texttt{Thread} object must have a reference
-to itself wrapped by the same \texttt{boost::shared\_ptr} envelope that is returned
-to the caller. This necessitated the use of the factory pattern.
-\texttt{ThreadFactory} creates the raw \texttt{Thread} object and a
-\texttt{boost::shared\_ptr} wrapper, and calls a private helper method of the class
-implementing the \texttt{Thread} interface (in this case, \texttt{PosixThread::weakRef})
- to allow it to make add weak reference to itself through the
- \texttt{boost::shared\_ptr} envelope.
-
-\texttt{Thread} and \texttt{Runnable} objects reference each other. A \texttt{Runnable}
-object may need to know about the thread in which it is executing, and a Thread, obviously,
-needs to know what \texttt{Runnable} object it is hosting. This interdependency is
-further complicated because the lifecycle of each object is independent of the
-other. An application may create a set of \texttt{Runnable} object to be reused in different threads, or it may create and forget a \texttt{Runnable} object
-once a thread has been created and started for it.
-
-The \texttt{Thread} class takes a \texttt{boost::shared\_ptr} reference to the hosted
-\texttt{Runnable} object in its constructor, while the \texttt{Runnable} class has an
-explicit \texttt{thread} method to allow explicit binding of the hosted thread.
-\texttt{ThreadFactory::newThread} binds the objects to each other.
-
-\subsection{ThreadManager}
-
-\texttt{ThreadManager} creates a pool of worker threads and
-allows applications to schedule tasks for execution as free worker threads
-become available. The \texttt{ThreadManager} does not implement dynamic
-thread pool resizing, but provides primitives so that applications can add
-and remove threads based on load. This approach was chosen because
-implementing load metrics and thread pool size is very application
-specific. For example some applications may want to adjust pool size based
-on running-average of work arrival rates that are measured via polled
-samples. Others may simply wish to react immediately to work-queue
-depth high and low water marks. Rather than trying to create a complex
-API abstract enough to capture these different approaches, we
-simply leave it up to the particular application and provide the
-primitives to enact the desired policy and sample current status.
-
-\subsection{TimerManager}
-
-\texttt{TimerManager} allows applications to schedule
- \texttt{Runnable} objects for execution at some point in the future. Its specific task
-is to allows applications to sample \texttt{ThreadManager} load at regular
-intervals and make changes to the thread pool size based on application policy.
-Of course, it can be used to generate any number of timer or alarm events.
-
-The default implementation of \texttt{TimerManager} uses a single thread to
-execute expired \texttt{Runnable} objects. Thus, if a timer operation needs to
-do a large amount of work and especially if it needs to do blocking I/O,
-that should be done in a separate thread.
-
-\subsection{Nonblocking Operation}
-Though the Thrift transport interfaces map more directly to a blocking I/O
-model, we have implemented a high performance \texttt{TNonBlockingServer}
-in C++ based on \texttt{libevent} and the \texttt{TFramedTransport}. We
-implemented this by moving all I/O into one tight event loop using a
-state machine. Essentially, the event loop reads framed requests into
-\texttt{TMemoryBuffer} objects. Once entire requests are ready, they are
-dispatched to the \texttt{TProcessor} object which can read directly from
-the data in memory.
-
-\subsection{Compiler}
-The Thrift compiler is implemented in C++ using standard \texttt{lex}/\texttt{yacc}
-lexing and parsing. Though it could have been implemented with fewer
-lines of code in another language (i.e. Python Lex-Yacc (PLY) or \texttt{ocamlyacc}), using C++
-forces explicit definition of the language constructs. Strongly typing the
-parse tree elements (debatably) makes the code more approachable for new
-developers.
-
-Code generation is done using two passes. The first pass looks only for
-include files and type definitions. Type definitions are not checked during
-this phase, since they may depend upon include files. All included files
-are sequentially scanned in a first pass. Once the include tree has been
-resolved, a second pass over all files is taken that inserts type definitions
-into the parse tree and raises an error on any undefined types. The program is
-then generated against the parse tree.
-
-Due to inherent complexities and potential for circular dependencies,
-we explicitly disallow forward declaration. Two Thrift structs cannot
-each contain an instance of the other. (Since we do not allow \texttt{null}
-struct instances in the generated C++ code, this would actually be impossible.)
-
-\subsection{TFileTransport}
-The \texttt{TFileTransport} logs Thrift requests/structs by
-framing incoming data with its length and writing it out to disk.
-Using a framed on-disk format allows for better error checking and
-helps with the processing of a finite number of discrete events. The\\
-\texttt{TFileWriterTransport} uses a system of swapping in-memory buffers
-to ensure good performance while logging large amounts of data.
-A Thrift log file is split up into chunks of a specified size; logged messages
-are not allowed to cross chunk boundaries. A message that would cross a chunk
-boundary will cause padding to be added until the end of the chunk and the
-first byte of the message are aligned to the beginning of the next chunk.
-Partitioning the file into chunks makes it possible to read and interpret data
-from a particular point in the file.
-
-\section{Facebook Thrift Services}
-Thrift has been employed in a large number of applications at Facebook, including
-search, logging, mobile, ads and the developer platform. Two specific usages are discussed below.
-
-\subsection{Search}
-Thrift is used as the underlying protocol and transport layer for the Facebook Search service.
-The multi-language code generation is well suited for search because it allows for application
-development in an efficient server side language (C++) and allows the Facebook PHP-based web application
-to make calls to the search service using Thrift PHP libraries. There is also a large
-variety of search stats, deployment and testing functionality that is built on top
-of generated Python code. Additionally, the Thrift log file format is
-used as a redo log for providing real-time search index updates. Thrift has allowed the
-search team to leverage each language for its strengths and to develop code at a rapid pace.
-
-\subsection{Logging}
-The Thrift \texttt{TFileTransport} functionality is used for structured logging. Each
-service function definition along with its parameters can be considered to be
-a structured log entry identified by the function name. This log can then be used for
-a variety of purposes, including inline and offline processing, stats aggregation and as a redo log.
-
-\section{Conclusions}
-Thrift has enabled Facebook to build scalable backend
-services efficiently by enabling engineers to divide and conquer. Application
-developers can focus on application code without worrying about the
-sockets layer. We avoid duplicated work by writing buffering and I/O logic
-in one place, rather than interspersing it in each application.
-
-Thrift has been employed in a wide variety of applications at Facebook,
-including search, logging, mobile, ads, and the developer platform. We have
-found that the marginal performance cost incurred by an extra layer of
-software abstraction is far eclipsed by the gains in developer efficiency and
-systems reliability.
-
-\appendix
-
-\section{Similar Systems}
-The following are software systems similar to Thrift. Each is (very!) briefly
-described:
-
-\begin{itemize}
-\item \textit{SOAP.} XML-based. Designed for web services via HTTP, excessive
-XML parsing overhead.
-\item \textit{CORBA.} Relatively comprehensive, debatably overdesigned and
-heavyweight. Comparably cumbersome software installation.
-\item \textit{COM.} Embraced mainly in Windows client software. Not an entirely
-open solution.
-\item \textit{Pillar.} Lightweight and high-performance, but missing versioning
-and abstraction.
-\item \textit{Protocol Buffers.} Closed-source, owned by Google. Described in
-Sawzall paper.
-\end{itemize}
-
-\acks
-
-Many thanks for feedback on Thrift (and extreme trial by fire) are due to
-Martin Smith, Karl Voskuil and Yishan Wong.
-
-Thrift is a successor to Pillar, a similar system developed
-by Adam D'Angelo, first while at Caltech and continued later at Facebook.
-Thrift simply would not have happened without Adam's insights.
-
-\begin{thebibliography}{}
-
-\bibitem{boost.threads}
-Kempf, William,
-``Boost.Threads'',
-\url{http://www.boost.org/doc/html/threads.html}
-
-\bibitem{boost.threadpool}
-Henkel, Philipp,
-``threadpool'',
-\url{http://threadpool.sourceforge.net}
-
-\end{thebibliography}
-
-\end{document}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/hawqbuild/Makefile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/hawqbuild/Makefile b/depends/thirdparty/thrift/hawqbuild/Makefile
deleted file mode 100644
index 3e00b41..0000000
--- a/depends/thirdparty/thrift/hawqbuild/Makefile
+++ /dev/null
@@ -1,37 +0,0 @@
-subdir = depends/thirdparty/thrift
-top_builddir = ../../../..
-include Makefile.global
-
-.PHONY: all install distclean maintainer-clean clean pre-config
-
-ifeq ($(with_thrift), yes)
-
-all: build
-	cd $(top_srcdir)/$(subdir); mkdir -p install; \
-	$(MAKE) DESTDIR=$(abs_top_builddir)/$(subdir)/install install
-
-install:
-	cd $(top_srcdir)/$(subdir) && $(MAKE) install
-
-distclean:
-	cd $(top_srcdir)/$(subdir) && $(MAKE) distclean
-	cd $(top_srcdir)/$(subdir) && rm -rf install
-
-maintainer-clean: distclean
-
-clean:
-	cd $(top_srcdir)/$(subdir) && $(MAKE) clean
-
-build: pre-config
-	cd $(top_srcdir)/$(subdir) && $(MAKE)
-
-pre-config:
-	cd $(top_srcdir)/$(subdir); \
-	./bootstrap.sh; \
-	./configure --without-php --prefix=$(prefix)
-
-else
-
-all install distclean maintainer-clean clean pre-config:
-
-endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/hawqbuild/Makefile.global.in
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/hawqbuild/Makefile.global.in b/depends/thirdparty/thrift/hawqbuild/Makefile.global.in
deleted file mode 100644
index 22a11b0..0000000
--- a/depends/thirdparty/thrift/hawqbuild/Makefile.global.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Makefile.globbal.in for HAWQ build with --with-thrift
-prefix := @prefix@
-with_thrift = @with_thrift@
-
-# Support for VPATH builds
-vpath_build = @vpath_build@
-abs_top_srcdir = @abs_top_srcdir@
-abs_top_builddir = @abs_top_builddir@
-
-ifneq ($(vpath_build),yes)
-top_srcdir = $(top_builddir)
-srcdir = ./thrift
-else # vpath_build = yes
-top_srcdir = $(abs_top_srcdir)
-srcdir = $(top_srcdir)/$(subdir)
-VPATH = $(srcdir)
-endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/json-schema.json
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/json-schema.json b/depends/thirdparty/thrift/json-schema.json
deleted file mode 100644
index d61216a..0000000
--- a/depends/thirdparty/thrift/json-schema.json
+++ /dev/null
@@ -1,310 +0,0 @@
-{
-  "$schema": "http://json-schema.org/draft-04/schema#",
-
-  "id": "http://thrift.apache.org/program-schema#",
-  "description": "Schema for Apache Thrift protocol descriptors",
-
-  "definitions": {
-    "type-id": {
-      "enum": [
-        "void",
-        "string",
-        "bool",
-        "byte",
-        "i16",
-        "i32",
-        "i64",
-        "double",
-        "list",
-        "set",
-        "map",
-        "union",
-        "struct",
-        "exception",
-        "binary"
-      ]
-    },
-    "base-type": {
-      "title": "Base types",
-      "type": "object",
-      "properties": {
-        "typeId": {
-          "enum": [ "void", "string", "bool", "byte", "i16", "i32", "i64", "double", "binary" ]
-        }
-      },
-      "required": [ "typeId" ]
-    },
-    "list-type": {
-      "title": "List and set types",
-      "type": "object",
-      "properties": {
-        "typeId": { "enum": [ "list", "set" ] },
-        "elemTypeId": { "$ref": "#/definitions/type-id" },
-        "elemType": { "$ref": "#/definitions/type-spec" }
-      },
-      "required": [ "typeId", "elemTypeId", "elemType" ]
-    },
-    "map-type": {
-      "title": "Map type",
-      "type": "object",
-      "properties": {
-        "typeId":      { "enum": [ "map" ] },
-        "keyTypeId":   { "$ref": "#/definitions/type-id" },
-        "keyType":     { "$ref": "#/definitions/type-spec" },
-        "valueTypeId": { "$ref": "#/definitions/type-id" },
-        "valueType":   { "$ref": "#/definitions/type-spec" }
-      },
-      "required": [ "typeId", "keyTypeId", "valueTypeId" ]
-    },
-    "struct-spec": {
-      "title": "Struct and union types",
-      "type": "object",
-      "properties": {
-        "typeId": { "enum": [ "union", "struct" ] },
-        "class": { "type": "string" }
-      },
-      "required": [ "typeId", "class" ]
-    },
-    "type-spec": {
-      "allOf": [
-        { "type": "object" },
-        {
-          "oneOf":
-          [
-            { "$ref": "#/definitions/base-type" },
-            { "$ref": "#/definitions/list-type" },
-            { "$ref": "#/definitions/map-type" },
-            { "$ref": "#/definitions/struct-spec" }
-          ]
-        }
-      ]
-    },
-    "name-and-doc": {
-      "type": "object",
-      "properties": {
-        "name": { "type": "string" },
-        "doc": { "type": "string" }
-      },
-      "required": [ "name" ]
-    },
-    "enum": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        {
-          "required": [ "members" ],
-          "properties": {
-            "members": {
-              "type": "array",
-              "items": {
-                "type": "object",
-                "properties": {
-                  "name": { "type": "string" },
-                  "value": { "type": "integer" }
-                },
-                "required": [ "name", "value" ]
-              }
-            }
-          }
-        }
-      ]
-    },
-    "typedef": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        {
-          "properties": {
-            "typeId": { "$ref": "#/definitions/type-id" },
-            "type": { "$ref": "#/definitions/type-spec" }
-          },
-          "required": [ "typeId" ]
-        }
-      ]
-    },
-    "constant": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        { "$ref": "#/definitions/type-spec" },
-        {
-          "properties": {
-            "value": {
-              "oneOf": [
-                { "type": "string" },
-                { "type": "number" },
-                { "type": "array" },
-                { "type": "object" }
-              ]
-            }
-          },
-          "required": [ "value" ]
-        }
-      ]
-    },
-    "field": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        { "$ref": "#/definitions/type-spec" },
-        {
-          "properties": {
-            "key": {
-              "type": "integer",
-              "minimum": 1,
-              "maximum": 65535
-            },
-            "required": {
-              "enum": [ "required", "optional", "req_out" ]
-            },
-            "default": {
-              "oneOf": [
-                { "type": "string" },
-                { "type": "number" },
-                { "type": "array" },
-                { "type": "object" }
-              ]
-            }
-          },
-          "required": [ "key", "required" ]
-        }
-      ]
-    },
-    "struct": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        {
-          "properties": {
-            "isException": { "type": "boolean" },
-            "isUnion": { "type": "boolean" },
-            "fields": {
-              "type": "array",
-              "items": {
-                "$ref": "#/definitions/field"
-              }
-            }
-          },
-          "required": [ "isException", "isUnion", "fields" ]
-        }
-      ]
-    },
-    "union": {
-      "$ref": "#/definitions/struct"
-    },
-    "exception": {
-      "$ref": "#/definitions/struct"
-    },
-    "function": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        {
-          "oneOf": [
-            {
-              "properties": { "oneway": { "type": "boolean" } },
-              "required": [ "oneway" ]
-            },
-            {
-              "properties": { "returnType": { "$ref": "#/definitions/type-spec" } },
-              "required": [ "returnType" ]
-            }
-          ]
-        },
-        {
-          "properties": {
-            "arguments": {
-              "type": "array",
-              "items": {
-                "allOf": [
-                  { "$ref": "#/definitions/field" },
-                  {
-                    "properties": { }
-                  }
-                ]
-              }
-            },
-            "exceptions": {
-              "type": "array",
-              "items": {
-                "$ref": "#/definitions/exception"
-              }
-            }
-          },
-          "required": [ "oneway", "arguments", "exceptions" ]
-        }
-      ]
-    },
-    "service": {
-      "type": "object",
-      "allOf": [
-        { "$ref": "#/definitions/name-and-doc" },
-        {
-          "properties": {
-            "functions": {
-              "type": "array",
-              "items": {
-                "$ref": "#/definitions/function"
-              }
-            }
-          },
-          "required": [ "functions" ]
-        }
-      ]
-    }
-  },
-
-  "type": "object",
-  "required": [
-    "name",
-    "namespaces",
-    "includes",
-    "enums",
-    "typedefs",
-    "structs",
-    "constants",
-    "services"
-  ],
-  "properties": {
-    "name": {
-      "type": "string"
-    },
-    "includes": {
-      "type": "array",
-      "items": {
-        "type": "string"
-      },
-      "uniqueItems": true
-    },
-    "enums": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/enum"
-      }
-    },
-    "typedefs": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/typedef"
-      }
-    },
-    "structs": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/struct"
-      }
-    },
-    "constants": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/constant"
-      }
-    },
-    "services": {
-      "type": "array",
-      "items": {
-        "$ref": "#/definitions/service"
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/Makefile.am b/depends/thirdparty/thrift/lib/Makefile.am
deleted file mode 100644
index 5066a00..0000000
--- a/depends/thirdparty/thrift/lib/Makefile.am
+++ /dev/null
@@ -1,101 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-SUBDIRS =
-PRECROSS_TARGET =
-
-if WITH_CPP
-SUBDIRS += cpp
-endif
-
-if WITH_C_GLIB
-SUBDIRS += c_glib
-endif
-
-if WITH_MONO
-SUBDIRS += csharp
-PRECROSS_TARGET += precross-csharp
-endif
-
-if WITH_JAVA
-SUBDIRS += java
-PRECROSS_TARGET += precross-java
-# JavaScript unit test depends on java
-# so test only if java, ant & co is available
-SUBDIRS += js/test
-endif
-
-if WITH_PYTHON
-SUBDIRS += py
-endif
-
-if WITH_ERLANG
-SUBDIRS += erl
-endif
-
-if WITH_RUBY
-SUBDIRS += rb
-endif
-
-if WITH_HASKELL
-SUBDIRS += hs
-endif
-
-if WITH_PERL
-SUBDIRS += perl
-endif
-
-if WITH_PHP
-SUBDIRS += php
-endif
-
-if WITH_GO
-SUBDIRS += go
-endif
-
-if WITH_D
-SUBDIRS += d
-endif
-
-if WITH_NODEJS
-SUBDIRS += nodejs
-PRECROSS_TARGET += precross-nodejs
-endif
-
-if WITH_LUA
-SUBDIRS += lua
-endif
-
-# All of the libs that don't use Automake need to go in here
-# so they will end up in our release tarballs.
-EXTRA_DIST = \
-	as3 \
-	cocoa \
-	d \
-	delphi \
-	haxe \
-	javame \
-	js \
-	ocaml \
-	st \
-	ts
-
-precross-%:
-	$(MAKE) -C $* precross
-precross: $(PRECROSS_TARGET)


[07/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.m
deleted file mode 100644
index 45b0ef3..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.m
+++ /dev/null
@@ -1,687 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TCompactProtocol.h"
-#import "TObjective-C.h"
-#import "TProtocolException.h"
-
-static const uint8_t COMPACT_PROTOCOL_ID = 0x82;
-static const uint8_t COMPACT_VERSION = 1;
-static const uint8_t COMPACT_VERSION_MASK = 0x1F; // 0001 1111
-static const uint8_t COMPACT_TYPE_MASK = 0xE0; // 1110 0000
-static const uint8_t COMPACT_TYPE_BITS = 0x07; // 0000 0111
-static const int COMPACT_TYPE_SHIFT_AMOUNT = 5;
-
-enum {
-  TCType_STOP = 0x00,
-  TCType_BOOLEAN_TRUE = 0x01,
-  TCType_BOOLEAN_FALSE = 0x02,
-  TCType_BYTE = 0x03,
-  TCType_I16 = 0x04,
-  TCType_I32 = 0x05,
-  TCType_I64 = 0x06,
-  TCType_DOUBLE = 0x07,
-  TCType_BINARY = 0x08,
-  TCType_LIST = 0x09,
-  TCType_SET = 0x0A,
-  TCType_MAP = 0x0B,
-  TCType_STRUCT = 0x0C,
-};
-
-@implementation TCompactProtocolFactory
-
-+ (TCompactProtocolFactory *) sharedFactory
-{
-  static TCompactProtocolFactory * gSharedFactory = nil;
-  if (gSharedFactory == nil) {
-    gSharedFactory = [[TCompactProtocolFactory alloc] init];
-  }
-  
-  return gSharedFactory;
-}
-
-- (TCompactProtocol *) newProtocolOnTransport: (id <TTransport>) transport
-{
-  return [[TCompactProtocol alloc] initWithTransport: transport];
-}
-
-@end
-
-@implementation TCompactProtocol {
-  NSMutableArray * lastField;
-  short lastFieldId;
-  id <TTransport> mTransport;
-  
-  NSString * boolFieldName;
-  NSNumber * boolFieldType;
-  NSNumber * boolFieldId;
-  NSNumber * booleanValue;
-}
-
-- (id) init
-{
-  self = [super init];
-  
-  if (self != nil) {
-    lastField = [[NSMutableArray alloc] init];
-  }
-  
-  return self;
-}
-
-- (id) initWithTransport: (id <TTransport>) transport
-{
-  self = [self init];
-  
-  if (self != nil) {
-    mTransport = [transport retain_stub];
-  }
-  
-  return self;
-}
-
-- (void) dealloc
-{
-  [lastField release_stub];
-  [mTransport release_stub];
-  [boolFieldName release_stub];
-  [boolFieldType release_stub];
-  [boolFieldId release_stub];
-  [booleanValue release_stub];
-  
-  [super dealloc_stub];
-}
-
-- (id <TTransport>) transport
-{
-  return mTransport;
-}
-
-- (void) writeByteDirect: (int8_t) n
-{
-  [mTransport write: (uint8_t *)&n offset: 0 length: 1];
-}
-
-- (void)writeVarint32: (uint32_t) n
-{
-  uint8_t i32buf[5] = {0};
-  uint32_t idx = 0;
-  
-  while (true) {
-    if ((n & ~0x7F) == 0) {
-      i32buf[idx++] = (uint8_t)n;
-      break;
-    } else {
-      i32buf[idx++] = (uint8_t)((n & 0x7F) | 0x80);
-      n >>= 7;
-    }
-  }
-  
-  [mTransport write: i32buf offset: 0 length: idx];
-}
-
-- (void) writeMessageBeginWithName: (NSString *) name
-                              type: (int) messageType
-                        sequenceID: (int) sequenceID
-{
-  [self writeByteDirect: COMPACT_PROTOCOL_ID];
-  [self writeByteDirect: (uint8_t)((COMPACT_VERSION & COMPACT_VERSION_MASK) |
-                                   ((((uint32_t)messageType) << COMPACT_TYPE_SHIFT_AMOUNT) & COMPACT_TYPE_MASK))];
-  [self writeVarint32: (uint32_t)sequenceID];
-  [self writeString: name];
-}
-
-- (void) writeStructBeginWithName: (NSString *) name
-{
-  [lastField addObject: [NSNumber numberWithShort: lastFieldId]];
-  lastFieldId = 0;
-}
-
-- (void) writeStructEnd
-{
-  lastFieldId = [[lastField lastObject] shortValue];
-  [lastField removeLastObject];
-}
-
-- (void) writeFieldBeginWithName: (NSString *) name
-                            type: (int) fieldType
-                         fieldID: (int) fieldID
-{
-  if (fieldType == TType_BOOL) {
-    boolFieldName = [name copy];
-    boolFieldType = [[NSNumber numberWithInt: fieldType] retain_stub];
-    boolFieldId = [[NSNumber numberWithInt: fieldID] retain_stub];
-  } else {
-    [self writeFieldBeginInternalWithName: name
-                                     type: fieldType
-                                  fieldID: fieldID
-                             typeOverride: 0xFF];
-  }
-}
-
-- (void) writeFieldBeginInternalWithName: (NSString *) name
-                                    type: (int) fieldType
-                                 fieldID: (int) fieldID
-                            typeOverride: (uint8_t) typeOverride
-{
-  uint8_t typeToWrite = typeOverride == 0xFF ? [self compactTypeForTType: fieldType] : typeOverride;
-  
-  // check if we can use delta encoding for the field id
-  if (fieldID > lastFieldId && fieldID - lastFieldId <= 15) {
-    // Write them together
-    [self writeByteDirect: (fieldID - lastFieldId) << 4 | typeToWrite];
-  } else {
-    // Write them separate
-    [self writeByteDirect: typeToWrite];
-    [self writeI16: fieldID];
-  }
-  
-  lastFieldId = fieldID;
-}
-
-- (void) writeFieldStop
-{
-  [self writeByteDirect: TCType_STOP];
-}
-
-- (void) writeMapBeginWithKeyType: (int) keyType
-                        valueType: (int) valueType
-                             size: (int) size
-{
-  if (size == 0) {
-    [self writeByteDirect: 0];
-  } else {
-    [self writeVarint32: (uint32_t)size];
-    [self writeByteDirect: [self compactTypeForTType: keyType] << 4 | [self compactTypeForTType: valueType]];
-  }
-}
-
-- (void) writeListBeginWithElementType: (int) elementType
-                                  size: (int) size
-{
-  [self writeCollectionBeginWithElementType: elementType size: size];
-}
-
-- (void) writeSetBeginWithElementType: (int) elementType
-                                 size: (int) size
-{
-  [self writeCollectionBeginWithElementType: elementType size: size];
-}
-
-- (void) writeBool: (BOOL) b
-{
-  if (boolFieldId != nil && boolFieldName != nil && boolFieldType != nil) {
-    // we haven't written the field header yet
-    [self writeFieldBeginInternalWithName: boolFieldName
-                                     type: [boolFieldType intValue]
-                                  fieldID: [boolFieldId intValue]
-                             typeOverride: b ? TCType_BOOLEAN_TRUE : TCType_BOOLEAN_FALSE];
-    
-    [boolFieldId release_stub];
-    [boolFieldName release_stub];
-    [boolFieldType release_stub];
-    
-    boolFieldId = nil;
-    boolFieldName = nil;
-    boolFieldType = nil;
-  } else {
-    // we're not part of a field, so just Write the value.
-    [self writeByteDirect: b ? TCType_BOOLEAN_TRUE : TCType_BOOLEAN_FALSE];
-  }
-}
-
-- (void) writeByte: (uint8_t) value
-{
-  [self writeByteDirect: value];
-}
-
-- (void) writeI16: (int16_t) value
-{
-  [self writeVarint32: [self i32ToZigZag: value]];
-}
-
-- (void) writeI32: (int32_t) value
-{
-  [self writeVarint32: [self i32ToZigZag: value]];
-}
-
-- (void) writeI64: (int64_t) value
-{
-  [self writeVarint64: [self i64ToZigZag: value]];
-}
-
-- (void) writeDouble: (double) value
-{
-  //Safe bit-casting double->uint64
-  
-  uint64_t bits = 0;
-  memcpy(&bits, &value, 8);
-  
-  bits = OSSwapHostToLittleInt64(bits);
-  
-  [mTransport write: (uint8_t *)&bits offset: 0 length: 8];
-}
-
-- (void) writeString: (NSString *) value
-{
-  [self writeBinary: [value dataUsingEncoding: NSUTF8StringEncoding]];
-}
-
-- (void) writeBinary: (NSData *) data
-{
-  [self writeVarint32: (uint32_t)data.length];
-  [mTransport write: data.bytes offset: 0 length: data.length];
-}
-
-- (void) writeMessageEnd {}
-- (void) writeMapEnd {}
-- (void) writeListEnd {}
-- (void) writeSetEnd {}
-- (void) writeFieldEnd {}
-
-- (void) writeCollectionBeginWithElementType: (int) elementType
-                                        size: (int) size
-{
-  if (size <= 14) {
-    [self writeByteDirect: size << 4 | [self compactTypeForTType: elementType]];
-  } else {
-    [self writeByteDirect: 0xf0 | [self compactTypeForTType: elementType]];
-    [self writeVarint32: (uint32_t)size];
-  }
-}
-
-- (void) writeVarint64: (uint64_t) n
-{
-  uint8_t varint64out[10] = {0};
-  int idx = 0;
-  
-  while (true) {
-    if ((n & ~0x7FL) == 0) {
-      varint64out[idx++] = (uint8_t)n;
-      break;
-    } else {
-      varint64out[idx++] = (uint8_t)((n & 0x7F) | 0x80);
-      n >>= 7;
-    }
-  }
-  
-  [mTransport write: varint64out offset: 0 length: idx];
-}
-
-- (uint32_t) i32ToZigZag: (int32_t) n
-{
-  /*
-   ZigZag encoding maps signed integers to unsigned integers so that
-   numbers with a small absolute value (for instance, -1) have
-   a small varint encoded value too. It does this in a way that
-   "zig-zags" back and forth through the positive and negative integers,
-   so that -1 is encoded as 1, 1 is encoded as 2, -2 is encoded as 3, and so on
-   */
-  return (uint32_t)(n << 1) ^ (uint32_t)(n >> 31);
-}
-
-- (uint64_t) i64ToZigZag: (int64_t) n
-{
-  return (uint64_t)(n << 1) ^ (uint64_t)(n >> 63);
-}
-
-- (void) readMessageBeginReturningName: (NSString **) pname
-                                  type: (int *) ptype
-                            sequenceID: (int *) psequenceID
-{
-  uint8_t protocolId = [self readByte];
-  if (protocolId != COMPACT_PROTOCOL_ID) {
-    @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                          reason: [NSString stringWithFormat: @"Expected protocol id %X but got %X", COMPACT_PROTOCOL_ID, protocolId]];
-  }
-  
-  uint8_t versionAndType = [self readByte];
-  uint8_t version = versionAndType & COMPACT_VERSION_MASK;
-  if (version != COMPACT_VERSION) {
-    @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                          reason: [NSString stringWithFormat: @"Expected version %d but got %d", COMPACT_VERSION, version]];
-  }
-  
-  int type = (versionAndType >> COMPACT_TYPE_SHIFT_AMOUNT) & COMPACT_TYPE_BITS;
-  int sequenceID = (int)[self readVarint32];
-  NSString* name = [self readString];
-  
-  if (ptype != NULL) {
-    *ptype = type;
-  }
-  if (psequenceID != NULL) {
-    *psequenceID = sequenceID;
-  }
-  if (pname != NULL) {
-    *pname = name;
-  }
-}
-
-- (void) readStructBeginReturningName: (NSString **) pname
-{
-  [lastField addObject: [NSNumber numberWithShort: lastFieldId]];
-  lastFieldId = 0;
-  
-  if (pname != NULL) {
-    *pname = @"";
-  }
-}
-
-- (void) readStructEnd
-{
-  lastFieldId = [[lastField lastObject] shortValue];
-  [lastField removeLastObject];
-}
-
-- (void) readFieldBeginReturningName: (NSString **) pname
-                                type: (int *) pfieldType
-                             fieldID: (int *) pfieldID
-{
-  uint8_t byte = [self readByte];
-  uint8_t type = byte & 0x0f;
-  
-  // if it's a stop, then we can return immediately, as the struct is over.
-  if (type == TCType_STOP) {
-    if (pname != NULL) {
-      *pname = @"";
-    }
-    if (pfieldType != NULL) {
-      *pfieldType = TType_STOP;
-    }
-    if (pfieldID != NULL) {
-      *pfieldID = 0;
-    }
-    return;
-  }
-  
-  short fieldId = 0;
-  
-  // mask off the 4 MSB of the type header. it could contain a field id delta.
-  short modifier = (byte & 0xf0) >> 4;
-  if (modifier == 0) {
-    // not a delta. look ahead for the zigzag varint field id.
-    fieldId = [self readI16];
-  } else {
-    // has a delta. add the delta to the last Read field id.
-    fieldId = lastFieldId + modifier;
-  }
-  
-  int fieldType = [self ttypeForCompactType: type];
-  
-  if (pname != NULL) {
-    *pname = @"";
-  }
-  if (pfieldType != NULL) {
-    *pfieldType = fieldType;
-  }
-  if (pfieldID != NULL) {
-    *pfieldID = fieldId;
-  }
-  
-  // if this happens to be a boolean field, the value is encoded in the type
-  if (type == TCType_BOOLEAN_TRUE ||
-      type == TCType_BOOLEAN_FALSE) {
-    // save the boolean value in a special instance variable.
-    booleanValue = [[NSNumber numberWithBool: type == TCType_BOOLEAN_TRUE] retain_stub];
-  }
-  
-  // push the new field onto the field stack so we can keep the deltas going.
-  lastFieldId = fieldId;
-}
-
-- (void) readMapBeginReturningKeyType: (int *) pkeyType
-                            valueType: (int *) pvalueType
-                                 size: (int *) psize
-{
-  uint8_t keyAndValueType = 0;
-  int size = (int)[self readVarint32];
-  if (size != 0) {
-    keyAndValueType = [self readByte];
-  }
-  
-  int keyType = [self ttypeForCompactType: keyAndValueType >> 4];
-  int valueType = [self ttypeForCompactType: keyAndValueType & 0xf];
-  
-  if (pkeyType != NULL) {
-    *pkeyType = keyType;
-  }
-  if (pvalueType != NULL) {
-    *pvalueType = valueType;
-  }
-  if (psize != NULL) {
-    *psize = size;
-  }
-}
-
-- (void) readListBeginReturningElementType: (int *) pelementType
-                                      size: (int *) psize
-{
-  uint8_t size_and_type = [self readByte];
-  int size = (size_and_type >> 4) & 0x0f;
-  if (size == 15) {
-    size = (int)[self readVarint32];
-  }
-  
-  int elementType = [self ttypeForCompactType: size_and_type & 0x0f];
-  
-  if (pelementType != NULL) {
-    *pelementType = elementType;
-  }
-  if (psize != NULL) {
-    *psize = size;
-  }
-}
-
-- (void) readSetBeginReturningElementType: (int *) pelementType
-                                     size: (int *) psize
-{
-  [self readListBeginReturningElementType: pelementType size: psize];
-}
-
-- (BOOL) readBool
-{
-  if (booleanValue != nil) {
-    BOOL result = [booleanValue boolValue];
-    [booleanValue release_stub];
-    booleanValue = nil;
-    return result;
-  } else {
-    return [self readByte] == TCType_BOOLEAN_TRUE;
-  }
-}
-
-- (uint8_t) readByte
-{
-  uint8_t buf = 0;
-  [mTransport readAll: &buf offset: 0 length: 1];
-  return buf;
-}
-
-- (int16_t) readI16
-{
-  return (int16_t)[self zigZagToi32: [self readVarint32]];
-}
-
-- (int32_t) readI32
-{
-  return [self zigZagToi32: [self readVarint32]];
-}
-
-- (int64_t) readI64
-{
-  return [self zigZagToi64: [self readVarint64]];
-}
-
-- (double) readDouble
-{
-  uint64_t bits = 0;
-  [mTransport readAll: (uint8_t *)&bits offset: 0 length: 8];
-  bits = OSSwapLittleToHostInt64(bits);
-  
-  double result = 0;
-  memcpy(&result, &bits, 8);
-  
-  return result;
-}
-
-- (NSString *) readString
-{
-  int length = (int)[self readVarint32];
-  if (length == 0) {
-    return @"";
-  }
-  
-  return [[[NSString alloc] initWithData: [self readBinary: length]
-                                encoding: NSUTF8StringEncoding] autorelease_stub];
-}
-
-- (NSData *) readBinary
-{
-  return [self readBinary: (int)[self readVarint32]];
-}
-
-- (NSData *) readBinary: (int) length
-{
-  if (length == 0) {
-    return [NSData data];
-  }
-  
-  NSMutableData* buf = [NSMutableData dataWithLength: length];
-  [mTransport readAll: buf.mutableBytes offset: 0 length: length];
-  return buf;
-}
-
-- (void) readMessageEnd {}
-- (void) readFieldEnd {}
-- (void) readMapEnd {}
-- (void) readListEnd {}
-- (void) readSetEnd {}
-
-- (uint32_t) readVarint32
-{
-  uint32_t result = 0;
-  int shift = 0;
-  
-  while (true) {
-    uint8_t byte = [self readByte];
-    result |= (uint32_t)(byte & 0x7f) << shift;
-    if (!(byte & 0x80)) {
-      break;
-    }
-    
-    shift += 7;
-  }
-  return result;
-}
-
-- (uint64_t) readVarint64
-{
-  int shift = 0;
-  uint64_t result = 0;
-  
-  while (true) {
-    uint8_t byte = [self readByte];
-    result |= (uint64_t)(byte & 0x7f) << shift;
-    if (!(byte & 0x80)) {
-      break;
-    }
-    
-    shift += 7;
-  }
-  
-  return result;
-}
-
-- (int32_t) zigZagToi32: (uint32_t) n
-{
-  return (int32_t)(n >> 1) ^ (-(int32_t)(n & 1));
-}
-
-- (int64_t) zigZagToi64: (uint64_t) n
-{
-  return (int64_t)(n >> 1) ^ (-(int64_t)(n & 1));
-}
-
-- (uint8_t) ttypeForCompactType: (uint8_t) type
-{
-  switch (type & 0x0f) {
-    case TCType_STOP:
-      return TType_STOP;
-      
-    case TCType_BOOLEAN_FALSE:
-    case TCType_BOOLEAN_TRUE:
-      return TType_BOOL;
-      
-    case TCType_BYTE:
-      return TType_BYTE;
-      
-    case TCType_I16:
-      return TType_I16;
-      
-    case TCType_I32:
-      return TType_I32;
-      
-    case TCType_I64:
-      return TType_I64;
-      
-    case TCType_DOUBLE:
-      return TType_DOUBLE;
-      
-    case TCType_BINARY:
-      return TType_STRING;
-      
-    case TCType_LIST:
-      return TType_LIST;
-      
-    case TCType_SET:
-      return TType_SET;
-      
-    case TCType_MAP:
-      return TType_MAP;
-      
-    case TCType_STRUCT:
-      return TType_STRUCT;
-      
-    default:
-      @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                            reason: [NSString stringWithFormat: @"Don't know what type: %d", (uint8_t)(type & 0x0F)]];
-  }
-}
-
-- (uint8_t) compactTypeForTType: (uint8_t) ttype
-{
-  static uint8_t ttypeToCompactType[] = {
-    [TType_STOP] = TCType_STOP,
-    [TType_BOOL] = TCType_BOOLEAN_FALSE,
-    [TType_BYTE] = TCType_BYTE,
-    [TType_DOUBLE] = TCType_DOUBLE,
-    [TType_I16] = TCType_I16,
-    [TType_I32] = TCType_I32,
-    [TType_I64] = TCType_I64,
-    [TType_STRING] = TCType_BINARY,
-    [TType_STRUCT] = TCType_STRUCT,
-    [TType_MAP] = TCType_MAP,
-    [TType_SET] = TCType_SET,
-    [TType_LIST] = TCType_LIST
-  };
-  
-  return ttypeToCompactType[ttype];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.h
deleted file mode 100644
index f298459..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "TProtocolDecorator.h"
-
-FOUNDATION_EXPORT NSString *const MULTIPLEXED_SERVICE_SEPERATOR;
-
-@interface TMultiplexedProtocol : TProtocolDecorator {
-    NSString * mServiceName;
-}
-
-- (id) initWithProtocol: (id <TProtocol>) protocol
-            serviceName: (NSString *) name;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.m
deleted file mode 100644
index 49095e3..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TMultiplexedProtocol.m
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TMultiplexedProtocol.h"
-
-#import "TProtocol.h"
-#import "TObjective-C.h"
-
-NSString *const MULTIPLEXED_SERVICE_SEPERATOR = @":";
-
-@implementation TMultiplexedProtocol
-
-- (id) initWithProtocol: (id <TProtocol>) protocol
-            serviceName: (NSString *) name
-{
-    self = [super initWithProtocol:protocol];
-
-    if (self) {
-        mServiceName = [name retain_stub];
-    }
-    return self;
-}
-
-- (void) writeMessageBeginWithName: (NSString *) name
-                              type: (int) messageType
-                        sequenceID: (int) sequenceID
-{
-    switch (messageType) {
-        case TMessageType_CALL:
-        case TMessageType_ONEWAY:
-            {
-                NSMutableString * serviceFunction = [[NSMutableString alloc] initWithString:mServiceName];
-                [serviceFunction appendString:MULTIPLEXED_SERVICE_SEPERATOR];
-                [serviceFunction appendString:name];
-                [super writeMessageBeginWithName:serviceFunction type:messageType sequenceID:sequenceID];
-                [serviceFunction release_stub];
-            }
-            break;
-        default:
-            [super writeMessageBeginWithName:name type:messageType sequenceID:sequenceID];
-            break;
-    }
-}
-
-- (void) dealloc
-{
-    [mServiceName release_stub];
-    [super dealloc_stub];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocol.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocol.h
deleted file mode 100644
index 281239d..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocol.h
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "TTransport.h"
-
-
-enum {
-  TMessageType_CALL = 1,
-  TMessageType_REPLY = 2,
-  TMessageType_EXCEPTION = 3,
-  TMessageType_ONEWAY = 4
-};
-
-enum {
-  TType_STOP   = 0,
-  TType_VOID   = 1,
-  TType_BOOL   = 2,
-  TType_BYTE   = 3,
-  TType_DOUBLE = 4,
-  TType_I16    = 6,
-  TType_I32    = 8,
-  TType_I64    = 10,
-  TType_STRING = 11,
-  TType_STRUCT = 12,
-  TType_MAP    = 13,
-  TType_SET    = 14,
-  TType_LIST   = 15
-};
-
-
-@protocol TProtocol <NSObject>
-
-- (id <TTransport>) transport;
-
-- (void) readMessageBeginReturningName: (NSString **) name
-                                  type: (int *) type
-                            sequenceID: (int *) sequenceID;
-- (void) readMessageEnd;
-
-- (void) readStructBeginReturningName: (NSString **) name;
-- (void) readStructEnd;
-
-- (void) readFieldBeginReturningName: (NSString **) name
-                                type: (int *) fieldType
-                             fieldID: (int *) fieldID;
-- (void) readFieldEnd;
-
-- (NSString *) readString;
-
-- (BOOL) readBool;
-
-- (unsigned char) readByte;
-
-- (short) readI16;
-
-- (int32_t) readI32;
-
-- (int64_t) readI64;
-
-- (double) readDouble;
-
-- (NSData *) readBinary;
-
-- (void) readMapBeginReturningKeyType: (int *) keyType
-                            valueType: (int *) valueType
-                                 size: (int *) size;
-- (void) readMapEnd;
-
-
-- (void) readSetBeginReturningElementType: (int *) elementType
-                                     size: (int *) size;
-- (void) readSetEnd;
-
-
-- (void) readListBeginReturningElementType: (int *) elementType
-                                      size: (int *) size;
-- (void) readListEnd;
-
-
-- (void) writeMessageBeginWithName: (NSString *) name
-                              type: (int) messageType
-                        sequenceID: (int) sequenceID;
-- (void) writeMessageEnd;
-
-- (void) writeStructBeginWithName: (NSString *) name;
-- (void) writeStructEnd;
-
-- (void) writeFieldBeginWithName: (NSString *) name
-                            type: (int) fieldType
-                         fieldID: (int) fieldID;
-
-- (void) writeI32: (int32_t) value;
-
-- (void) writeI64: (int64_t) value;
-
-- (void) writeI16: (short) value;
-
-- (void) writeByte: (uint8_t) value;
-
-- (void) writeString: (NSString *) value;
-
-- (void) writeDouble: (double) value;
-
-- (void) writeBool: (BOOL) value;
-
-- (void) writeBinary: (NSData *) data;
-
-- (void) writeFieldStop;
-
-- (void) writeFieldEnd;
-
-- (void) writeMapBeginWithKeyType: (int) keyType
-                        valueType: (int) valueType
-                             size: (int) size;
-- (void) writeMapEnd;
-
-
-- (void) writeSetBeginWithElementType: (int) elementType
-                                 size: (int) size;
-- (void) writeSetEnd;
-
-
-- (void) writeListBeginWithElementType: (int) elementType
-                                  size: (int) size;
-
-- (void) writeListEnd;
-
-
-@end
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.h
deleted file mode 100644
index 829bed6..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "TProtocol.h"
-
-@interface TProtocolDecorator : NSObject <TProtocol> {
-    id<TProtocol> mConcreteProtocol;
-}
-
-- (id) initWithProtocol: (id <TProtocol>) protocol;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.m
deleted file mode 100644
index e5acb6c..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolDecorator.m
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocolDecorator.h"
-#import "TObjective-C.h"
-
-@implementation TProtocolDecorator
-
-- (id) initWithProtocol: (id <TProtocol>) protocol
-{
-    self = [super init];
-    if (self) {
-        mConcreteProtocol = [protocol retain_stub];
-    }
-    return self;
-}
-
-- (id <TTransport>) transport
-{
-    return [mConcreteProtocol transport];
-}
-
-- (void) readMessageBeginReturningName: (NSString **) name
-                                  type: (int *) type
-                            sequenceID: (int *) sequenceID
-{
-    [mConcreteProtocol readMessageBeginReturningName:name
-                                                type:type
-                                          sequenceID:sequenceID];
-}
-
-- (void) readMessageEnd
-{
-    [mConcreteProtocol readMessageEnd];
-}
-
-- (void) readStructBeginReturningName: (NSString **) name
-{
-    [mConcreteProtocol readStructBeginReturningName:name];
-}
-
-- (void) readStructEnd
-{
-    [mConcreteProtocol readStructEnd];
-}
-
-- (void) readFieldBeginReturningName: (NSString **) name
-                                type: (int *) fieldType
-                             fieldID: (int *) fieldID
-{
-    [mConcreteProtocol readFieldBeginReturningName:name
-                                              type:fieldType
-                                           fieldID:fieldID];
-}
-- (void) readFieldEnd
-{
-    [mConcreteProtocol readFieldEnd];
-}
-
-- (NSString *) readString
-{
-    return [mConcreteProtocol readString];
-}
-
-- (BOOL) readBool
-{
-    return [mConcreteProtocol readBool];
-}
-
-- (unsigned char) readByte
-{
-    return [mConcreteProtocol readByte];
-}
-
-- (short) readI16
-{
-    return [mConcreteProtocol readI16];
-}
-
-- (int32_t) readI32
-{
-    return [mConcreteProtocol readI32];
-}
-
-- (int64_t) readI64
-{
-    return [mConcreteProtocol readI64];
-}
-
-- (double) readDouble
-{
-    return [mConcreteProtocol readDouble];
-}
-
-- (NSData *) readBinary
-{
-    return [mConcreteProtocol readBinary];
-}
-
-- (void) readMapBeginReturningKeyType: (int *) keyType
-                            valueType: (int *) valueType
-                                 size: (int *) size
-{
-    [mConcreteProtocol readMapBeginReturningKeyType:keyType
-                                          valueType:valueType
-                                               size:size];
-}
-- (void) readMapEnd
-{
-    [mConcreteProtocol readMapEnd];
-}
-
-
-- (void) readSetBeginReturningElementType: (int *) elementType
-                                     size: (int *) size
-{
-    [mConcreteProtocol readSetBeginReturningElementType:elementType
-                                                   size:size];
-}
-- (void) readSetEnd
-{
-    [mConcreteProtocol readSetEnd];
-}
-
-- (void) readListBeginReturningElementType: (int *) elementType
-                                      size: (int *) size
-{
-    [mConcreteProtocol readListBeginReturningElementType:elementType
-                                                    size:size];
-}
-- (void) readListEnd
-{
-    [mConcreteProtocol readListEnd];
-}
-
-- (void) writeMessageBeginWithName: (NSString *) name
-                              type: (int) messageType
-                        sequenceID: (int) sequenceID
-{
-    [mConcreteProtocol writeMessageBeginWithName:name
-                                            type:messageType
-                                      sequenceID:sequenceID];
-}
-- (void) writeMessageEnd
-{
-    [mConcreteProtocol writeMessageEnd];
-}
-
-- (void) writeStructBeginWithName: (NSString *) name
-{
-    [mConcreteProtocol writeStructBeginWithName:name];
-}
-- (void) writeStructEnd
-{
-    [mConcreteProtocol writeStructEnd];
-}
-
-- (void) writeFieldBeginWithName: (NSString *) name
-                            type: (int) fieldType
-                         fieldID: (int) fieldID
-{
-    [mConcreteProtocol writeFieldBeginWithName:name
-                                          type:fieldType
-                                       fieldID:fieldID];
-}
-
-- (void) writeI32: (int32_t) value
-{
-    [mConcreteProtocol writeI32:value];
-}
-
-- (void) writeI64: (int64_t) value
-{
-    [mConcreteProtocol writeI64:value];
-}
-
-- (void) writeI16: (short) value
-{
-    [mConcreteProtocol writeI16:value];
-}
-
-- (void) writeByte: (uint8_t) value
-{
-    [mConcreteProtocol writeByte:value];
-}
-
-- (void) writeString: (NSString *) value
-{
-    [mConcreteProtocol writeString:value];
-}
-
-- (void) writeDouble: (double) value
-{
-    [mConcreteProtocol writeDouble:value];
-}
-
-- (void) writeBool: (BOOL) value
-{
-    [mConcreteProtocol writeBool:value];
-}
-
-- (void) writeBinary: (NSData *) data
-{
-    [mConcreteProtocol writeBinary:data];
-}
-
-- (void) writeFieldStop
-{
-    [mConcreteProtocol writeFieldStop];
-}
-
-- (void) writeFieldEnd
-{
-    [mConcreteProtocol writeFieldEnd];
-}
-
-- (void) writeMapBeginWithKeyType: (int) keyType
-                        valueType: (int) valueType
-                             size: (int) size
-{
-    [mConcreteProtocol writeMapBeginWithKeyType:keyType
-                                      valueType:valueType
-                                           size:size];
-}
-- (void) writeMapEnd
-{
-    [mConcreteProtocol writeMapEnd];
-}
-
-- (void) writeSetBeginWithElementType: (int) elementType
-                                 size: (int) size
-{
-    [mConcreteProtocol writeSetBeginWithElementType:elementType size:size];
-}
-
-- (void) writeSetEnd
-{
-    [mConcreteProtocol writeSetEnd];
-}
-
-- (void) writeListBeginWithElementType: (int) elementType
-                                  size: (int) size
-{
-    [mConcreteProtocol writeListBeginWithElementType:elementType size:size];
-}
-
-- (void) writeListEnd
-{
-    [mConcreteProtocol writeListEnd];
-}
-
-- (void) dealloc
-{
-    [mConcreteProtocol release_stub];
-    [super dealloc_stub];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.h
deleted file mode 100644
index ad354fc..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.h
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TException.h"
-
-@interface TProtocolException : TException {
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.m
deleted file mode 100644
index 681487a..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolException.m
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocolException.h"
-
-@implementation TProtocolException
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolFactory.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolFactory.h
deleted file mode 100644
index f200a6d..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolFactory.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TProtocol.h"
-#import "TTransport.h"
-
-
-@protocol TProtocolFactory <NSObject>
-
-- (id <TProtocol>) newProtocolOnTransport: (id <TTransport>) transport;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.h
deleted file mode 100644
index 757748a..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocol.h"
-#import "TTransport.h"
-
-@interface TProtocolUtil : NSObject {
-
-}
-
-+ (void) skipType: (int) type onProtocol: (id <TProtocol>) protocol;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.m
deleted file mode 100644
index 13d7095..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TProtocolUtil.m
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocolUtil.h"
-
-@implementation TProtocolUtil
-
-+ (void) skipType: (int) type onProtocol: (id <TProtocol>) protocol
-{
-  switch (type) {
-  case TType_BOOL:
-    [protocol readBool];
-    break;
-  case TType_BYTE:
-    [protocol readByte];
-    break;
-  case TType_I16:
-    [protocol readI16];
-    break;
-  case TType_I32:
-    [protocol readI32];
-    break;
-  case TType_I64:
-    [protocol readI64];
-    break;
-  case TType_DOUBLE:
-    [protocol readDouble];
-    break;
-  case TType_STRING:
-    [protocol readString];
-    break;
-  case TType_STRUCT:
-    [protocol readStructBeginReturningName: NULL];
-    while (true) {
-      int fieldType;
-      [protocol readFieldBeginReturningName: nil type: &fieldType fieldID: nil];
-      if (fieldType == TType_STOP) {
-        break;
-      }
-      [TProtocolUtil skipType: fieldType onProtocol: protocol];
-      [protocol readFieldEnd];
-    }
-    [protocol readStructEnd];
-    break;
-  case TType_MAP:
-  {
-    int keyType;
-    int valueType;
-    int size;
-    [protocol readMapBeginReturningKeyType: &keyType valueType: &valueType size: &size];
-    int i;
-    for (i = 0; i < size; i++) {
-      [TProtocolUtil skipType: keyType onProtocol: protocol];
-      [TProtocolUtil skipType: valueType onProtocol: protocol];
-    }
-    [protocol readMapEnd];
-  }
-    break;
-    case TType_SET:
-    {
-      int elemType;
-      int size;
-      [protocol readSetBeginReturningElementType: &elemType size: &size];
-      int i;
-      for (i = 0; i < size; i++) {
-        [TProtocolUtil skipType: elemType onProtocol: protocol];
-      }
-      [protocol readSetEnd];
-    }
-      break;
-    case TType_LIST:
-    {
-      int elemType;
-      int size;
-      [protocol readListBeginReturningElementType: &elemType size: &size];
-      int i;
-      for (i = 0; i < size; i++) {
-        [TProtocolUtil skipType: elemType onProtocol: protocol];
-      }
-      [protocol readListEnd];
-    }
-      break;
-    default:
-      return;
-  }
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.h b/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.h
deleted file mode 100644
index c8ff9f0..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TProtocolFactory.h"
-#import "TProcessorFactory.h"
-
-#if !TARGET_OS_IPHONE
-#import <CoreServices/CoreServices.h>
-#else
-#import <CFNetwork/CFNetwork.h>
-#endif
-
-extern NSString * const kTSocketServer_ClientConnectionFinishedForProcessorNotification;
-extern NSString * const kTSocketServer_ProcessorKey;
-extern NSString * const kTSockerServer_TransportKey;
-
-
-@interface TSocketServer : NSObject {
-  NSFileHandle * mSocketFileHandle;
-  id <TProtocolFactory> mInputProtocolFactory;
-  id <TProtocolFactory> mOutputProtocolFactory;
-  id <TProcessorFactory> mProcessorFactory;
-}
-
-- (id) initWithPort: (int) port
-    protocolFactory: (id <TProtocolFactory>) protocolFactory
-   processorFactory: (id <TProcessorFactory>) processorFactory;
-
-@end
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.m b/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.m
deleted file mode 100644
index 07bc829..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/server/TSocketServer.m
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TSocketServer.h"
-#import "TNSFileHandleTransport.h"
-#import "TProtocol.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-#import <sys/socket.h>
-#include <netinet/in.h>
-
-
-
-NSString * const kTSocketServer_ClientConnectionFinishedForProcessorNotification = @"TSocketServer_ClientConnectionFinishedForProcessorNotification";
-NSString * const kTSocketServer_ProcessorKey = @"TSocketServer_Processor";
-NSString * const kTSockerServer_TransportKey = @"TSockerServer_Transport";
-
-
-@implementation TSocketServer
-
-- (id) initWithPort: (int) port
-    protocolFactory: (id <TProtocolFactory>) protocolFactory
-   processorFactory: (id <TProcessorFactory>) processorFactory
-{
-  self = [super init];
-
-  mInputProtocolFactory = [protocolFactory retain_stub];
-  mOutputProtocolFactory = [protocolFactory retain_stub];
-  mProcessorFactory = [processorFactory retain_stub];
-
-  // create a socket.
-  int fd = -1;
-  CFSocketRef socket = CFSocketCreate(kCFAllocatorDefault, PF_INET, SOCK_STREAM, IPPROTO_TCP, 0, NULL, NULL);
-  if (socket) {
-    CFOptionFlags flagsToClear = kCFSocketCloseOnInvalidate;
-    CFSocketSetSocketFlags(socket,  CFSocketGetSocketFlags(socket) & ~flagsToClear);
-
-    fd = CFSocketGetNative(socket);
-    int yes = 1;
-    setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes));
-
-    struct sockaddr_in addr;
-    memset(&addr, 0, sizeof(addr));
-    addr.sin_len = sizeof(addr);
-    addr.sin_family = AF_INET;
-    addr.sin_port = htons(port);
-    addr.sin_addr.s_addr = htonl(INADDR_ANY);
-    NSData *address = [NSData dataWithBytes:&addr length:sizeof(addr)];
-    if (CFSocketSetAddress(socket, (bridge_stub CFDataRef)address) != kCFSocketSuccess) {
-      CFSocketInvalidate(socket);
-      CFRelease(socket);
-      NSLog(@"*** Could not bind to address");
-      return nil;
-    }
-  } else {
-    NSLog(@"*** No server socket");
-    return nil;
-  }
-  
-  // wrap it in a file handle so we can get messages from it
-  mSocketFileHandle = [[NSFileHandle alloc] initWithFileDescriptor: fd
-                                                    closeOnDealloc: YES];
-  
-  // throw away our socket
-  CFSocketInvalidate(socket);
-  CFRelease(socket);
-  
-    // register for notifications of accepted incoming connections
-  [[NSNotificationCenter defaultCenter] addObserver: self
-                                           selector: @selector(connectionAccepted:)
-                                               name: NSFileHandleConnectionAcceptedNotification
-                                             object: mSocketFileHandle];
-  
-  // tell socket to listen
-  [mSocketFileHandle acceptConnectionInBackgroundAndNotify];
-  
-  NSLog(@"Listening on TCP port %d", port);
-  
-  return self;
-}
-
-
-- (void) dealloc {
-  [[NSNotificationCenter defaultCenter] removeObserver:self];
-  [mInputProtocolFactory release_stub];
-  [mOutputProtocolFactory release_stub];
-  [mProcessorFactory release_stub];
-  [mSocketFileHandle release_stub];
-  [super dealloc_stub];
-}
-
-
-- (void) connectionAccepted: (NSNotification *) aNotification
-{
-  NSFileHandle * socket = [[aNotification userInfo] objectForKey: NSFileHandleNotificationFileHandleItem];
-
-  // now that we have a client connected, spin off a thread to handle activity
-  [NSThread detachNewThreadSelector: @selector(handleClientConnection:)
-                           toTarget: self
-                         withObject: socket];
-
-  [[aNotification object] acceptConnectionInBackgroundAndNotify];
-}
-
-
-- (void) handleClientConnection: (NSFileHandle *) clientSocket
-{
-#if __has_feature(objc_arc)
-    @autoreleasepool {
-        TNSFileHandleTransport * transport = [[TNSFileHandleTransport alloc] initWithFileHandle: clientSocket];
-        id<TProcessor> processor = [mProcessorFactory processorForTransport: transport];
-        
-        id <TProtocol> inProtocol = [mInputProtocolFactory newProtocolOnTransport: transport];
-        id <TProtocol> outProtocol = [mOutputProtocolFactory newProtocolOnTransport: transport];
-        
-        @try {
-            BOOL result = NO;
-            do {
-                @autoreleasepool {
-                    result = [processor processOnInputProtocol: inProtocol outputProtocol: outProtocol];
-                }
-            } while (result);
-        }
-        @catch (TTransportException * te) {
-            (void)te;
-            //NSLog(@"Caught transport exception, abandoning client connection: %@", te);
-        }
-        
-        NSNotification * n = [NSNotification notificationWithName: kTSocketServer_ClientConnectionFinishedForProcessorNotification
-                                                           object: self
-                                                         userInfo: [NSDictionary dictionaryWithObjectsAndKeys: 
-                                                                    processor,
-                                                                    kTSocketServer_ProcessorKey,
-                                                                    transport,
-                                                                    kTSockerServer_TransportKey,
-                                                                    nil]];
-        [[NSNotificationCenter defaultCenter] performSelectorOnMainThread: @selector(postNotification:) withObject: n waitUntilDone: YES];
-        
-    }
-#else
-  NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-  
-  TNSFileHandleTransport * transport = [[TNSFileHandleTransport alloc] initWithFileHandle: clientSocket];
-  id<TProcessor> processor = [mProcessorFactory processorForTransport: transport];
-  
-  id <TProtocol> inProtocol = [[mInputProtocolFactory newProtocolOnTransport: transport] autorelease];
-  id <TProtocol> outProtocol = [[mOutputProtocolFactory newProtocolOnTransport: transport] autorelease];
-
-  @try {
-    BOOL result = NO;
-    do {
-      NSAutoreleasePool * myPool = [[NSAutoreleasePool alloc] init];
-      result = [processor processOnInputProtocol: inProtocol outputProtocol: outProtocol];
-      [myPool release];
-    } while (result);
-  }
-  @catch (TTransportException * te) {
-    //NSLog(@"Caught transport exception, abandoning client connection: %@", te);
-  }
-
-  NSNotification * n = [NSNotification notificationWithName: kTSocketServer_ClientConnectionFinishedForProcessorNotification
-                                                     object: self
-                                                   userInfo: [NSDictionary dictionaryWithObjectsAndKeys: 
-                                                              processor,
-                                                              kTSocketServer_ProcessorKey,
-                                                              transport,
-                                                              kTSockerServer_TransportKey,
-                                                              nil]];
-  [[NSNotificationCenter defaultCenter] performSelectorOnMainThread: @selector(postNotification:) withObject: n waitUntilDone: YES];
-  
-  [pool release];
-#endif
-}
-
-
-
-@end
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TAsyncTransport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TAsyncTransport.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TAsyncTransport.h
deleted file mode 100644
index f75b701..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TAsyncTransport.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TTransport.h"
-#import "TException.h"
-
-typedef void(^TAsyncFailureBlock)(TException *);
-
-@protocol TAsyncTransport <TTransport>
-
-- (void) flush:(dispatch_block_t)flushed failure:(TAsyncFailureBlock)failure;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.h
deleted file mode 100644
index fc38877..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TTransport.h"
-
-@interface TFramedTransport : NSObject <TTransport> {
-    id <TTransport> mTransport;
-}
-
-- (id) initWithTransport: (id <TTransport>) transport;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.m
deleted file mode 100644
index 2148806..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TFramedTransport.m
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TFramedTransport.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-#define HEADER_SIZE 4
-#define INIT_FRAME_SIZE 1024
-
-@implementation TFramedTransport {
-    NSMutableData* writeBuffer;
-    NSMutableData* readBuffer;
-    NSUInteger readOffset;
-    uint8_t dummy_header[HEADER_SIZE];
-}
-
-- (id) initWithTransport:(id <TTransport>)transport
-{
-    mTransport = [transport retain_stub];
-    readBuffer = nil;
-    readOffset = 0;
-    writeBuffer = [[NSMutableData alloc] initWithCapacity:INIT_FRAME_SIZE];
-    [writeBuffer appendBytes:dummy_header length:HEADER_SIZE];
-    return self;
-}
-
-- (void) dealloc
-{
-    [mTransport release_stub];
-    [writeBuffer release_stub];
-    if (readBuffer != nil)
-        [readBuffer release_stub];
-    [super dealloc_stub];
-}
-
-- (void)flush
-{
-    size_t headerAndDataLength = [writeBuffer length];
-    if (headerAndDataLength < HEADER_SIZE) {
-        @throw [TTransportException exceptionWithReason:@"Framed transport buffer has no header"];
-    }
-
-    size_t dataLength = headerAndDataLength - HEADER_SIZE;
-    uint8_t i32rd[HEADER_SIZE];
-    i32rd[0] = (uint8_t)(0xff & (dataLength >> 24));
-    i32rd[1] = (uint8_t)(0xff & (dataLength >> 16));
-    i32rd[2] = (uint8_t)(0xff & (dataLength >> 8));
-    i32rd[3] = (uint8_t)(0xff & (dataLength));
-
-    // should we make a copy of the writeBuffer instead? Better for threaded operations!
-    [writeBuffer replaceBytesInRange:NSMakeRange(0, HEADER_SIZE) withBytes:i32rd length:HEADER_SIZE];
-    [mTransport write:[writeBuffer mutableBytes] offset:0 length:headerAndDataLength];
-    [mTransport flush];
-
-    // reuse old memory buffer
-    [writeBuffer setLength:0];
-    [writeBuffer appendBytes:dummy_header length:HEADER_SIZE];
-}
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length
-{
-    [writeBuffer appendBytes:data+offset length:length];
-}
-
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length
-{
-    if (readBuffer == nil) {
-        [self readFrame];
-    }
-    
-    if (readBuffer != nil) {
-        size_t bufferLength = [readBuffer length];
-        if (bufferLength - readOffset >= length) {
-            [readBuffer getBytes:buf range:NSMakeRange(readOffset,length)]; // copy data
-            readOffset += length;
-        } else {
-            // void the previous readBuffer data and request a new frame
-            [self readFrame];
-            [readBuffer getBytes:buf range:NSMakeRange(0,length)]; // copy data
-            readOffset = length;
-        }
-    }
-    return length;
-}
-
-- (void)readFrame
-{
-    uint8_t i32rd[HEADER_SIZE];
-    [mTransport readAll: i32rd offset: 0 length: HEADER_SIZE];
-    int32_t headerValue =
-        ((i32rd[0] & 0xff) << 24) |
-        ((i32rd[1] & 0xff) << 16) |
-        ((i32rd[2] & 0xff) <<  8) |
-        ((i32rd[3] & 0xff));
-    if (headerValue < 0) {
-        NSString *reason = [NSString stringWithFormat:
-                            @"Frame header reports negative frame size: %"PRId32,
-                            headerValue];
-        @throw [TTransportException exceptionWithReason:reason];
-    }
-
-    /* Cast should be safe:
-     * Have verified headerValue non-negative and of lesser or equal bitwidth to size_t. */
-    size_t frameSize = (size_t)headerValue;
-    [self ensureReadBufferHasLength:frameSize];
-
-    [mTransport readAll:[readBuffer mutableBytes] offset:0 length:frameSize];
-}
-
-- (void)ensureReadBufferHasLength:(size_t)length
-{
-    if (readBuffer == nil) {
-        readBuffer = [[NSMutableData alloc] initWithLength:length];
-    } else {
-        size_t currentLength = [readBuffer length];
-        BOOL isTooLong = (currentLength >= length);
-        if (isTooLong) {
-            [readBuffer setLength:length];
-        } else {
-            size_t lengthToAdd = length - currentLength;
-            [readBuffer increaseLengthBy:lengthToAdd];
-        }
-    }
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.h
deleted file mode 100644
index 78935fb..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TTransport.h"
-
-@interface THTTPClient : NSObject <TTransport> {
-  NSURL * mURL;
-  NSMutableURLRequest * mRequest;
-  NSMutableData * mRequestData;
-  NSData * mResponseData;
-  size_t mResponseDataOffset;
-  NSString * mUserAgent;
-  int mTimeout;
-}
-
-- (id) initWithURL: (NSURL *) aURL;
-
-- (id) initWithURL: (NSURL *) aURL
-         userAgent: (NSString *) userAgent
-           timeout: (int) timeout;
-
-- (void) setURL: (NSURL *) aURL;
-
-@end
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.m
deleted file mode 100644
index 169927c..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/THTTPClient.m
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "THTTPClient.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-@implementation THTTPClient
-
-
-- (void) setupRequest
-{
-  if (mRequest != nil) {
-    [mRequest release_stub];
-  }
-
-  // set up our request object that we'll use for each request
-  mRequest = [[NSMutableURLRequest alloc] initWithURL: mURL];
-  [mRequest setHTTPMethod: @"POST"];
-  [mRequest setValue: @"application/x-thrift" forHTTPHeaderField: @"Content-Type"];
-  [mRequest setValue: @"application/x-thrift" forHTTPHeaderField: @"Accept"];
-
-  NSString * userAgent = mUserAgent;
-  if (!userAgent) {
-    userAgent = @"Cocoa/THTTPClient";
-  }
-  [mRequest setValue: userAgent forHTTPHeaderField: @"User-Agent"];
-
-  [mRequest setCachePolicy: NSURLRequestReloadIgnoringCacheData];
-  if (mTimeout) {
-    [mRequest setTimeoutInterval: mTimeout];
-  }
-}
-
-
-- (id) initWithURL: (NSURL *) aURL
-{
-  return [self initWithURL: aURL
-                 userAgent: nil
-                   timeout: 0];
-}
-
-
-- (id) initWithURL: (NSURL *) aURL
-         userAgent: (NSString *) userAgent
-           timeout: (int) timeout
-{
-  self = [super init];
-  if (!self) {
-    return nil;
-  }
-
-  mTimeout = timeout;
-  if (userAgent) {
-    mUserAgent = [userAgent retain_stub];
-  }
-  mURL = [aURL retain_stub];
-
-  [self setupRequest];
-
-  // create our request data buffer
-  mRequestData = [[NSMutableData alloc] initWithCapacity: 1024];
-
-  return self;
-}
-
-
-- (void) setURL: (NSURL *) aURL
-{
-  [aURL retain_stub];
-  [mURL release_stub];
-  mURL = aURL;
-
-  [self setupRequest];
-}
-
-
-- (void) dealloc
-{
-  [mURL release_stub];
-  [mUserAgent release_stub];
-  [mRequest release_stub];
-  [mRequestData release_stub];
-  [mResponseData release_stub];
-  [super dealloc_stub];
-}
-
-
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length
-{
-  NSRange r;
-  r.location = mResponseDataOffset;
-  r.length = length;
-
-  [mResponseData getBytes: buf+offset range: r];
-  mResponseDataOffset += length;
-
-  return length;
-}
-
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length
-{
-  [mRequestData appendBytes: data+offset length: length];
-}
-
-
-- (void) flush
-{
-  [mRequest setHTTPBody: mRequestData]; // not sure if it copies the data
-
-  // make the HTTP request
-  NSURLResponse * response;
-  NSError * error;
-  NSData * responseData =
-    [NSURLConnection sendSynchronousRequest: mRequest returningResponse: &response error: &error];
-
-  [mRequestData setLength: 0];
-
-  if (responseData == nil) {
-    @throw [TTransportException exceptionWithName: @"TTransportException"
-                                reason: @"Could not make HTTP request"
-                                error: error];
-  }
-  if (![response isKindOfClass: [NSHTTPURLResponse class]]) {
-    @throw [TTransportException exceptionWithName: @"TTransportException"
-                                           reason: [NSString stringWithFormat: @"Unexpected NSURLResponse type: %@",
-                                                    NSStringFromClass([response class])]];
-  }
-
-  NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response;
-  if ([httpResponse statusCode] != 200) {
-    @throw [TTransportException exceptionWithName: @"TTransportException"
-                                           reason: [NSString stringWithFormat: @"Bad response from HTTP server: %ld",
-                                                    (long)[httpResponse statusCode]]];
-  }
-
-  // phew!
-  [mResponseData release_stub];
-  mResponseData = [responseData retain_stub];
-  mResponseDataOffset = 0;
-}
-
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.h
deleted file mode 100644
index fa4d371..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TTransport.h"
-
-@interface TMemoryBuffer : NSObject <TTransport> {
-	NSMutableData *mBuffer;
-	NSUInteger mOffset;
-}
-- (id)initWithData:(NSData *)data;
-- (NSData *)getBuffer;
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.m
deleted file mode 100644
index 4513ab8..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TMemoryBuffer.m
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TMemoryBuffer.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-#define GARBAGE_BUFFER_SIZE 4096 // 4KiB
-
-@implementation TMemoryBuffer
-- (id)init {
-	if ((self = [super init])) {
-		mBuffer = [[NSMutableData alloc] init];
-		mOffset = 0;
-	}
-	return self;
-}
-
-- (id)initWithData:(NSData *)data {
-	if ((self = [super init])) {
-		mBuffer = [data mutableCopy];
-		mOffset = 0;
-	}
-	return self;
-}
-
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length
-{
-	if ([mBuffer length] - mOffset < length) {
-		@throw [TTransportException exceptionWithReason:@"Not enough bytes remain in buffer"];
-	}
-	[mBuffer getBytes:buf range:NSMakeRange(mOffset, length)];
-	mOffset += length;
-	if (mOffset >= GARBAGE_BUFFER_SIZE) {
-		[mBuffer replaceBytesInRange:NSMakeRange(0, mOffset) withBytes:NULL length:0];
-		mOffset = 0;
-	}
-	return length;
-}
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length
-{
-	[mBuffer appendBytes:data+offset length:length];
-}
-
-- (void)flush {
-	// noop
-}
-
-- (NSData *)getBuffer {
-	return [[mBuffer copy] autorelease_stub];
-}
-
-- (void)dealloc {
-	[mBuffer release_stub];
-	[super dealloc_stub];
-}
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.h
deleted file mode 100644
index ba2a209..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#import <Foundation/Foundation.h>
-#import "TTransport.h"
-
-@interface TNSFileHandleTransport : NSObject <TTransport> {
-  NSFileHandle * mInputFileHandle;
-  NSFileHandle * mOutputFileHandle;
-}
-
-- (id) initWithFileHandle: (NSFileHandle *) fileHandle;
-
-- (id) initWithInputFileHandle: (NSFileHandle *) inputFileHandle
-              outputFileHandle: (NSFileHandle *) outputFileHandle;
-
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.m
deleted file mode 100644
index c2b18ca..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSFileHandleTransport.m
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#import "TNSFileHandleTransport.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-
-@implementation TNSFileHandleTransport
-
-- (id) initWithFileHandle: (NSFileHandle *) fileHandle
-{
-  return [self initWithInputFileHandle: fileHandle
-                      outputFileHandle: fileHandle];
-}
-
-
-- (id) initWithInputFileHandle: (NSFileHandle *) inputFileHandle
-              outputFileHandle: (NSFileHandle *) outputFileHandle
-{
-  self = [super init];
-
-  mInputFileHandle = [inputFileHandle retain_stub];
-  mOutputFileHandle = [outputFileHandle retain_stub];
-
-  return self;
-}
-
-
-- (void) dealloc {
-  [mInputFileHandle release_stub];
-  [mOutputFileHandle release_stub];
-  [super dealloc_stub];
-}
-
-
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length
-{
-  size_t totalBytesRead = 0;
-  while (totalBytesRead < length) {
-    NSData * data = [mInputFileHandle readDataOfLength: length-totalBytesRead];
-    if ([data length] == 0) {
-      @throw [TTransportException exceptionWithName: @"TTransportException"
-                                  reason: @"Cannot read. No more data."];
-    }
-    [data getBytes: buf+totalBytesRead];
-    totalBytesRead += [data length];
-  }
-  return totalBytesRead;
-}
-
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length
-{
-  const void *pos = data + offset;
-  NSData * dataObject = [[NSData alloc] initWithBytesNoCopy: (void *)pos
-                                                     length: length
-                                               freeWhenDone: NO];
-
-  @try {
-    [mOutputFileHandle writeData: dataObject];
-  } @catch (NSException * e) {
-    @throw [TTransportException exceptionWithName: @"TTransportException"
-                                           reason: [NSString stringWithFormat: @"%s: Unable to write data: %@", __PRETTY_FUNCTION__, e]];
-  }
-
-  [dataObject release_stub];
-}
-
-
-- (void) flush
-{
-
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.h
deleted file mode 100644
index 8011fb9..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TTransport.h"
-
-@interface TNSStreamTransport : NSObject <TTransport> {
-
-}
-
-@property (nonatomic, strong) NSInputStream * mInput;
-@property (nonatomic, strong) NSOutputStream * mOutput;
-
-- (id) initWithInputStream: (NSInputStream *) input
-              outputStream: (NSOutputStream *) output;
-
-- (id) initWithInputStream: (NSInputStream *) input;
-
-- (id) initWithOutputStream: (NSOutputStream *) output;
-
-@end
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.m
deleted file mode 100644
index 7ac1cdc..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TNSStreamTransport.m
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TNSStreamTransport.h"
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-
-@implementation TNSStreamTransport
-
-- (id) initWithInputStream: (NSInputStream *) input
-              outputStream: (NSOutputStream *) output
-{
-  self = [super init];
-  self.mInput = [input retain_stub];
-  self.mOutput = [output retain_stub];
-  return self;
-}
-
-- (id) initWithInputStream: (NSInputStream *) input
-{
-  return [self initWithInputStream: input outputStream: nil];
-}
-
-- (id) initWithOutputStream: (NSOutputStream *) output
-{
-  return [self initWithInputStream: nil outputStream: output];
-}
-
-- (void) dealloc
-{
-  [self.mInput release_stub];
-  [self.mOutput release_stub];
-  [super dealloc_stub];
-}
-
-
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length
-{
-  size_t totalBytesRead = 0;
-  ssize_t bytesRead = 0;
-  while (totalBytesRead < length) {
-    bytesRead = [self.mInput read: buf+offset+totalBytesRead maxLength: length-totalBytesRead];
-
-    BOOL encounteredErrorOrEOF = (bytesRead <= 0);
-    if (encounteredErrorOrEOF) {
-      @throw [TTransportException exceptionWithReason: @"Cannot read. Remote side has closed."];
-    } else {
-        /* bytesRead is guaranteed to be positive and within the range representable by size_t. */
-        totalBytesRead += (size_t)bytesRead;
-    }
-  }
-  return totalBytesRead;
-}
-
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length
-{
-  size_t totalBytesWritten = 0;
-  ssize_t bytesWritten = 0;
-  while (totalBytesWritten < length) {
-    bytesWritten = [self.mOutput write: data+offset+totalBytesWritten maxLength: length-totalBytesWritten];
-    if (bytesWritten < 0) {
-      @throw [TTransportException exceptionWithReason: @"Error writing to transport output stream."
-                                                error: [self.mOutput streamError]];
-    } else if (bytesWritten == 0) {
-      @throw [TTransportException exceptionWithReason: @"End of output stream."];
-    } else {
-        /* bytesWritten is guaranteed to be positive and within the range representable by size_t. */
-        totalBytesWritten += (size_t)bytesWritten;
-    }
-  }
-}
-
-- (void) flush
-{
-  // no flush for you!
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.h
deleted file mode 100644
index 44de124..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TNSStreamTransport.h"
-
-@interface TSSLSocketClient : TNSStreamTransport
-#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
-<NSStreamDelegate>
-#endif
-{
-    NSInputStream *inputStream;
-    NSOutputStream *outputStream;
-@private
-    NSString *sslHostname;
-    int sd;
-}
-
-- (id) initWithHostname: (NSString *) hostname
-                   port: (int) port;
-
-- (BOOL) isOpen;
-
-@end


[16/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-server.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-server.cpp b/depends/thirdparty/thrift/contrib/zeromq/test-server.cpp
deleted file mode 100644
index c624b0d..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-server.cpp
+++ /dev/null
@@ -1,43 +0,0 @@
-#include "zmq.hpp"
-#include "TZmqServer.h"
-#include "Storage.h"
-
-using boost::shared_ptr;
-using apache::thrift::TProcessor;
-using apache::thrift::server::TZmqServer;
-using apache::thrift::server::TZmqMultiServer;
-
-class StorageHandler : virtual public StorageIf {
- public:
-  StorageHandler()
-    : value_(0)
-  {}
-
-  void incr(const int32_t amount) {
-    value_ += amount;
-  }
-
-  int32_t get() {
-    return value_;
-  }
-
- private:
-  int32_t value_;
-
-};
-
-
-int main(int argc, char *argv[]) {
-  shared_ptr<StorageHandler> handler(new StorageHandler());
-  shared_ptr<TProcessor> processor(new StorageProcessor(handler));
-
-  zmq::context_t ctx(1);
-  TZmqServer reqrep_server(processor, ctx, "tcp://0.0.0.0:9090", ZMQ_REP);
-  TZmqServer oneway_server(processor, ctx, "tcp://0.0.0.0:9091", ZMQ_UPSTREAM);
-  TZmqMultiServer multiserver;
-  multiserver.servers().push_back(&reqrep_server);
-  multiserver.servers().push_back(&oneway_server);
-  multiserver.serveForever();
-
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-server.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-server.py b/depends/thirdparty/thrift/contrib/zeromq/test-server.py
deleted file mode 100755
index 5767b71..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-server.py
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/usr/bin/env python
-import zmq
-import TZmqServer
-import storage.ttypes
-import storage.Storage
-
-
-class StorageHandler(storage.Storage.Iface):
-  def __init__(self):
-    self.value = 0
-
-  def incr(self, amount):
-    self.value += amount
-
-  def get(self):
-    return self.value
-
-
-def main():
-  handler = StorageHandler()
-  processor = storage.Storage.Processor(handler)
-
-  ctx = zmq.Context()
-  reqrep_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9090", zmq.REP)
-  oneway_server = TZmqServer.TZmqServer(processor, ctx, "tcp://0.0.0.0:9091", zmq.UPSTREAM)
-  multiserver = TZmqServer.TZmqMultiServer()
-  multiserver.servers.append(reqrep_server)
-  multiserver.servers.append(oneway_server)
-  multiserver.serveForever()
-
-
-if __name__ == "__main__":
-  main()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/README.md b/depends/thirdparty/thrift/debian/README.md
deleted file mode 100755
index 98d4da0..0000000
--- a/depends/thirdparty/thrift/debian/README.md
+++ /dev/null
@@ -1,19 +0,0 @@
-some tips on Debian Packaging
-- Debian New Maintainers' Guide [http://www.debian.org/doc/debian-policy/]
-- Debian Policy Manual [http://www.debian.org/doc/manuals/maint-guide/]
-- Machine-readable debian/copyright file [http://dep.debian.net/deps/dep5/]
-
-build
-$ dpkg-buildpackage -d -tc
-  -d             do not check build dependencies and conflicts.
-  -tc            clean source tree when finished.
-
-update changelog
-$ date -R
-
-check packages
-$ dpkg -c *.deb
-$ lintian *.deb
-
-todo
-make it perfect!

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/changelog
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/changelog b/depends/thirdparty/thrift/debian/changelog
deleted file mode 100755
index 4638a1f..0000000
--- a/depends/thirdparty/thrift/debian/changelog
+++ /dev/null
@@ -1,73 +0,0 @@
-thrift (0.9.3) stable; urgency=low
-  * update to 0.9.3
-
- -- Jake Farrell <jf...@apache.org>  Fri, 25 Sep 2015 12:00:00 -0500
-
-thrift (0.9.2) stable; urgency=low
-
-  * update to 0.9.2
-
- -- Jake Farrell <jf...@apache.org>  Thu, 30 Oct 2014 12:00:00 -0500
-
-thrift (0.9.1) stable; urgency=low
-  * update to 0.9.1
-
-thrift (0.9.0) stable; urgency=low
-
-  * update to 0.9.0
-
- -- Jake Farrell <jf...@apache.org>  Wed, 10 Oct 2012 12:00:00 -0500
-
-thrift (0.7.0) stable; urgency=low
-
-  * update to 0.7.0
-
- -- Jake Farrell <jf...@apache.org>  Tue, 10 Aug 2011 17:01:53 -0500
-
-thrift (0.7.0-dev1) stable; urgency=low
-  * added glib
-  * fix location of libthrift.jar
-
- -- Roger Meier <ro...@apache.org>  Tue, 12 Apr 2011 21:41:18 +0200
-
-thrift (0.6.0-dev1) stable; urgency=low
-
-  * update version field
-  * added debian folder to thrift/contrib
-  * changed a few details in control file
-  * update copyright file
-
- -- Roger Meier <ro...@apache.org>  Tue, 14 Dec 2010 12:12:33 -0800
-
-thrift (0.5.0+nmu2) stable; urgency=low
-
-  * Non-maintainer upload.
-  * Merged THRIFT-71_v9.patch to skip ./bootstrap.sh if not exists.
-    https://issues.apache.org/jira/secure/attachment/12465360/THRIFT-71_v9.patch
-
- -- Yamashita Yuu <ya...@geishatokyo.com>  Tue, 07 Dec 2010 15:00:55 +0900
-
-thrift (0.5.0+nmu1) stable; urgency=low
-
-  * Non-maintainer upload.
-  * Imported package information for php5-thrift from https://github.com/simplegeo/thrift.
-
- -- Yamashita Yuu <ya...@geishatokyo.com>  Tue, 07 Dec 2010 01:00:17 +0900
-
-thrift (0.5.0) stable; urgency=low
-
-  * update to 0.5.0
-
- -- Roger Meier <ro...@apache.org>  Fri, 08 Oct 2010 11:23:53 +0200
-
-thrift (0.4.0) stable; urgency=low
-
-  * update to 0.4.0
-
- -- Roger Meier <ro...@bufferoverflow.ch>  Sun, 22 Aug 2010 21:26:00 +0100
-
-thrift (0.2008.12.30~8.04) hardy; urgency=low
-
-  * Initial release.
-
- -- Esteve Fernandez <es...@fluidinfo.com>  Thu, 15 Jan 2009 11:34:24 +0100

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/compat
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/compat b/depends/thirdparty/thrift/debian/compat
deleted file mode 100644
index 7ed6ff8..0000000
--- a/depends/thirdparty/thrift/debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-5

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/control
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/control b/depends/thirdparty/thrift/debian/control
deleted file mode 100644
index 39d57f9..0000000
--- a/depends/thirdparty/thrift/debian/control
+++ /dev/null
@@ -1,153 +0,0 @@
-Source: thrift
-Section: devel
-Priority: extra
-Build-Depends: debhelper (>= 5), build-essential, mono-gmcs, python-dev, ant,
-    mono-devel,  libmono-system-web2.0-cil, erlang-base, ruby1.8-dev, autoconf, automake,
-    pkg-config, libtool, bison, flex, libboost-dev | libboost1.40-dev, python-all,
-    python-all-dev, python-all-dbg, openjdk-6-jdk | java-sdk,
-    libboost-test-dev | libboost-test1.40-dev, libevent-dev, perl (>= 5.8.0-7),
-    php5, php5-dev, libglib2.0-dev, libqt4-dev
-Maintainer: Thrift Developer's <de...@thrift.apache.org>
-Homepage: http://thrift.apache.org/
-Vcs-Git: https://git-wip-us.apache.org/repos/asf/thrift.git
-Vcs-Browser: https://git-wip-us.apache.org/repos/asf?p=thrift.git
-Standards-Version: 3.7.2
-X-Python-Version: >= 2.6
-
-Package: thrift-compiler
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Compiler for Thrift definition files
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Thrift compiler that is used for translating
- from .thrift files (containing the definitions) to the language binding
- for the supported languages.
-
-Package: python-thrift
-Architecture: any
-Section: python
-Depends: ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Recommends: python-twisted-core
-Provides: ${python:Provides}
-Description: Python bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Python bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Python
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: python-thrift-dbg
-Architecture: any
-Section: python
-Depends: ${shlibs:Depends}, ${misc:Depends}, python-thrift (= ${binary:Version}), python-all-dbg
-Provides: ${python:Provides}
-Description: Python bindings for Thrift (debug version)
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Python bindings for Thrift with debugging symbols.
- You will need the thrift tool (in the thrift-compiler package) to compile your
- definition to Python classes, and then the modules in this package will allow
- you to use those classes in your programs.
-
-Package: ruby-thrift
-Architecture: all
-Section: libs
-Depends: ruby | ruby-interpreter, ${shlibs:Depends}, ${misc:Depends}
-Provides: libthrift-ruby
-Replaces: libthrift-ruby
-Breaks: libthrift-ruby
-Description: Ruby bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Ruby bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Ruby
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-java
-Architecture: all
-Section: libs
-Depends: java-gcj-compat | java1-runtime | java2-runtime, ${misc:Depends}
-Description: Java bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Java bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Java
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-cil
-Architecture: all
-Section: libs
-Depends: cli-common, libmono-corlib1.0-cil (>= 1.0), libmono-system1.0-cil (>= 1.0), 
-    libmono-system-web2.0-cil, ${misc:Depends}
-Description: CLI bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the CLI bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to C#
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift-perl
-Architecture: all
-Section: perl
-Depends: perl (>= 5.8.0-7), ${misc:Depends}
-Description: Perl bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the Perl bindings for Thrift. You will need the thrift
- tool (in the thrift-compiler package) to compile your definition to Perl
- classes, and then the modules in this package will allow you to use those
- classes in your programs.
-
-Package: libthrift0
-Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}
-Description: Thrift C++ library
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the runtime libraries needed for C++ applications
- using Thrift.
-
-Package: libthrift-dev
-Architecture: any
-Section: libdevel
-Depends: ${shlibs:Depends}, ${misc:Depends}, libthrift0, libglib2.0-dev
-Description: Thrift C++ library (development headers)
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the development libraries required for writing C++
- applications using Thrift.
-
-Package: php5-thrift
-Architecture: any
-Section: php
-Depends: ${php:Depends}, ${shlibs:Depends}, ${misc:Depends}
-Provides: ${php:Provides}
-Description: PHP bindings for Thrift
- Thrift is a software framework for scalable cross-language services
- development. It combines a software stack with a code generation engine to
- build services that work efficiently and seamlessly.
- .
- This package contains the PHP bindings for Thrift.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/copyright
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/copyright b/depends/thirdparty/thrift/debian/copyright
deleted file mode 100644
index 25546b4..0000000
--- a/depends/thirdparty/thrift/debian/copyright
+++ /dev/null
@@ -1,129 +0,0 @@
-This package was debianized by Thrift Developer's <de...@thrift.apache.org>.
-
-
-This package and the Debian packaging is licensed under the Apache License,
-see `/usr/share/common-licenses/Apache-2.0'.
-
-The following informations was copied from Apache Thrift LICENSE file.
-
---------------------------------------------------
-SOFTWARE DISTRIBUTED WITH THRIFT:
-
-The Apache Thrift software includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
---------------------------------------------------
-Portions of the following files are licensed under the MIT License:
-
-  lib/erl/src/Makefile.am
-
-Please see doc/otp-base-license.txt for the full terms of this license.
-
-
---------------------------------------------------
-The following files contain some portions of code contributed under
-the Thrift Software License (see doc/old-thrift-license.txt), and relicensed
-under the Apache 2.0 License:
-
-  compiler/cpp/Makefile.am
-  compiler/cpp/src/generate/t_cocoa_generator.cc
-  compiler/cpp/src/generate/t_cpp_generator.cc
-  compiler/cpp/src/generate/t_csharp_generator.cc
-  compiler/cpp/src/generate/t_erl_generator.cc
-  compiler/cpp/src/generate/t_hs_generator.cc
-  compiler/cpp/src/generate/t_java_generator.cc
-  compiler/cpp/src/generate/t_ocaml_generator.cc
-  compiler/cpp/src/generate/t_perl_generator.cc
-  compiler/cpp/src/generate/t_php_generator.cc
-  compiler/cpp/src/generate/t_py_generator.cc
-  compiler/cpp/src/generate/t_rb_generator.cc
-  compiler/cpp/src/generate/t_st_generator.cc
-  compiler/cpp/src/generate/t_xsd_generator.cc
-  compiler/cpp/src/main.cc
-  compiler/cpp/src/parse/t_field.h
-  compiler/cpp/src/parse/t_program.h
-  compiler/cpp/src/platform.h
-  compiler/cpp/src/thriftl.ll
-  compiler/cpp/src/thrifty.yy
-  lib/csharp/src/Protocol/TBinaryProtocol.cs
-  lib/csharp/src/Protocol/TField.cs
-  lib/csharp/src/Protocol/TList.cs
-  lib/csharp/src/Protocol/TMap.cs
-  lib/csharp/src/Protocol/TMessage.cs
-  lib/csharp/src/Protocol/TMessageType.cs
-  lib/csharp/src/Protocol/TProtocol.cs
-  lib/csharp/src/Protocol/TProtocolException.cs
-  lib/csharp/src/Protocol/TProtocolFactory.cs
-  lib/csharp/src/Protocol/TProtocolUtil.cs
-  lib/csharp/src/Protocol/TSet.cs
-  lib/csharp/src/Protocol/TStruct.cs
-  lib/csharp/src/Protocol/TType.cs
-  lib/csharp/src/Server/TServer.cs
-  lib/csharp/src/Server/TSimpleServer.cs
-  lib/csharp/src/Server/TThreadPoolServer.cs
-  lib/csharp/src/TApplicationException.cs
-  lib/csharp/src/Thrift.csproj
-  lib/csharp/src/Thrift.sln
-  lib/csharp/src/TProcessor.cs
-  lib/csharp/src/Transport/TServerSocket.cs
-  lib/csharp/src/Transport/TServerTransport.cs
-  lib/csharp/src/Transport/TSocket.cs
-  lib/csharp/src/Transport/TStreamTransport.cs
-  lib/csharp/src/Transport/TTransport.cs
-  lib/csharp/src/Transport/TTransportException.cs
-  lib/csharp/src/Transport/TTransportFactory.cs
-  lib/csharp/ThriftMSBuildTask/Properties/AssemblyInfo.cs
-  lib/csharp/ThriftMSBuildTask/ThriftBuild.cs
-  lib/csharp/ThriftMSBuildTask/ThriftMSBuildTask.csproj
-  lib/rb/lib/thrift.rb
-  lib/st/README
-  lib/st/thrift.st
-  test/OptionalRequiredTest.cpp
-  test/OptionalRequiredTest.thrift
-  test/ThriftTest.thrift
-
---------------------------------------------------
-For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
-
-#   Copyright (c) 2007 Thomas Porschberg <th...@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
---------------------------------------------------
-For the compiler/cpp/src/md5.[ch] components:
-
-/*
-  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */
-
----------------------------------------------------
-For the lib/rb/setup.rb: Copyright (c) 2000-2005 Minero Aoki,
-lib/ocaml/OCamlMakefile and lib/ocaml/README-OCamlMakefile components:
-     Copyright (C) 1999 - 2007  Markus Mottl
-
-Licensed under the terms of the GNU Lesser General Public License 2.1
-(see doc/lgpl-2.1.txt for the full terms of this license)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/dirs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/dirs b/depends/thirdparty/thrift/debian/dirs
deleted file mode 100644
index ca882bb..0000000
--- a/depends/thirdparty/thrift/debian/dirs
+++ /dev/null
@@ -1,2 +0,0 @@
-usr/bin
-usr/sbin

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/docs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/docs b/depends/thirdparty/thrift/debian/docs
deleted file mode 100644
index b43bf86..0000000
--- a/depends/thirdparty/thrift/debian/docs
+++ /dev/null
@@ -1 +0,0 @@
-README.md

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/libthrift-dev.install
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/libthrift-dev.install b/depends/thirdparty/thrift/debian/libthrift-dev.install
deleted file mode 100644
index 58b5223..0000000
--- a/depends/thirdparty/thrift/debian/libthrift-dev.install
+++ /dev/null
@@ -1,4 +0,0 @@
-usr/lib/*.a
-usr/lib/*.la
-usr/lib/pkgconfig
-usr/include

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/libthrift0.install
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/libthrift0.install b/depends/thirdparty/thrift/debian/libthrift0.install
deleted file mode 100755
index ec74efc..0000000
--- a/depends/thirdparty/thrift/debian/libthrift0.install
+++ /dev/null
@@ -1,5 +0,0 @@
-usr/lib/libthrift.so*
-usr/lib/libthrift-*.so*
-usr/lib/libthriftnb*.so*
-usr/lib/libthriftqt*.so*
-usr/lib/libthriftz*.so*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/php5-thrift.dirs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/php5-thrift.dirs b/depends/thirdparty/thrift/debian/php5-thrift.dirs
deleted file mode 100644
index 8ca3a0f..0000000
--- a/depends/thirdparty/thrift/debian/php5-thrift.dirs
+++ /dev/null
@@ -1 +0,0 @@
-etc/php5/conf.d

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/rules
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/rules b/depends/thirdparty/thrift/debian/rules
deleted file mode 100755
index d8462d1..0000000
--- a/depends/thirdparty/thrift/debian/rules
+++ /dev/null
@@ -1,206 +0,0 @@
-#!/usr/bin/make -f
-# -*- makefile -*-
-# Sample debian/rules that uses debhelper.
-#
-# This file was originally written by Joey Hess and Craig Small.
-# As a special exception, when this file is copied by dh-make into a
-# dh-make output file, you may use that output file without restriction.
-# This special exception was added by Craig Small in version 0.37 of dh-make.
-#
-# Modified to make a template file for a multi-binary package with separated
-# build-arch and build-indep targets  by Bill Allombert 2001
-
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
-
-# This has to be exported to make some magic below work.
-export DH_OPTIONS
-
-PYVERS := $(shell pyversions -r)
-
-configure: configure-stamp
-configure-stamp:
-	dh_testdir
-	# Add here commands to configure the package.
-	if [ -f bootstrap.sh ]; then $(CURDIR)/bootstrap.sh; fi
-	$(CURDIR)/configure --prefix=/usr --with-c_glib --without-erlang
-
-	touch configure-stamp
-
-
-#Architecture
-build: build-arch build-indep
-	# Tests disabled
-	# $(MAKE) -C test check
-
-build-arch: build-arch-stamp
-build-arch-stamp: configure-stamp
-
-	# Compile compiler
-	$(MAKE) -C $(CURDIR)/compiler/cpp
-
-	# Compile C++ library
-	$(MAKE) -C $(CURDIR)/lib/cpp
-
-	# Compile C (glib) library
-	$(MAKE) -C $(CURDIR)/lib/c_glib
-
-	# Python library
-	cd $(CURDIR)/lib/py && \
-    for py in $(PYVERS); do  \
-        $$py setup.py build; \
-        $$py-dbg setup.py build; \
-    done
-
-	# PHP
-	cd $(CURDIR)/lib/php/src/ext/thrift_protocol && \
-		phpize && \
-		./configure && make
-
-	touch $@
-
-build-indep: build-indep-stamp
-build-indep-stamp: configure-stamp
-
-	# Add here commands to compile the indep part of the package.
-	#$(MAKE) doc
-
-	# Java
-	cd $(CURDIR)/lib/java && \
-		ant
-
-	# C#
-	$(MAKE) -C $(CURDIR)/lib/csharp
-
-	# Ruby
-	$(MAKE) -C $(CURDIR)/lib/rb
-
-	# Perl
-	$(MAKE) -C $(CURDIR)/lib/perl INSTALLDIRS=vendor
-
-	touch $@
-
-clean:
-	dh_testdir
-	dh_testroot
-	rm -f build-arch-stamp build-indep-stamp configure-stamp
-
-	# Add here commands to clean up after the build process.
-	-$(MAKE) clean
-
-	dh_clean
-
-install: install-indep install-arch
-install-indep:
-	dh_testdir
-	dh_testroot
-	dh_clean -k -i
-	dh_installdirs -i
-
-	# Add here commands to install the indep part of the package into
-	# debian/<package>-doc.
-	#INSTALLDOC#
-
-        # Java
-	mkdir -p $(CURDIR)/debian/libthrift-java/usr/share/java/ && \
-	cp $(CURDIR)/lib/java/build/libthrift*.jar \
-		$(CURDIR)/debian/libthrift-java/usr/share/java/
-
-        # Ruby
-	mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8 && \
-	cp $(CURDIR)/lib/rb/lib/thrift.rb \
-		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8
-	cp -r $(CURDIR)/lib/rb/lib/thrift \
-		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.8
-	mkdir -p $(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1 && \
-	cp $(CURDIR)/lib/rb/lib/thrift.rb \
-		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
-	cp -r $(CURDIR)/lib/rb/lib/thrift \
-		$(CURDIR)/debian/ruby-thrift/usr/lib/ruby/1.9.1
-
-	# C#
-	mkdir -p $(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/ && \
-	cp $(CURDIR)/lib/csharp/Thrift.dll \
-		$(CURDIR)/debian/libthrift-cil/usr/lib/cli/thrift/Thrift.dll
-
-	# Perl
-	$(MAKE) -C $(CURDIR)/lib/perl install DESTDIR=$(CURDIR)/debian/libthrift-perl/usr
-
-	dh_install -i
-
-install-arch:
-	dh_testdir
-	dh_testroot
-	dh_clean -k -s
-	dh_installdirs -s
-
-	# Add here commands to install the arch part of the package into
-	# debian/tmp.
-	#$(MAKE) DESTDIR=$(CURDIR)/debian/thrift install
-
-	# Compiler
-	mkdir -p $(CURDIR)/debian/thrift-compiler/usr/bin && \
-	cp $(CURDIR)/compiler/cpp/thrift \
-		$(CURDIR)/debian/thrift-compiler/usr/bin/thrift && \
-	rmdir $(CURDIR)/debian/thrift-compiler/usr/sbin
-
-	# Python
-	cd $(CURDIR)/lib/py && \
-	for py in $(PYVERS); do \
-		$$py setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift; \
-		$$py-dbg setup.py install --no-compile --root=$(CURDIR)/debian/python-thrift-dbg; \
-	done
-
-	find $(CURDIR)/debian/python-thrift-dbg -name "*.pyc" -print0 | xargs -0 rm -f
-	find $(CURDIR)/debian/python-thrift-dbg -name "*.py" -print0 | xargs -0 rm -f
-	find $(CURDIR)/debian/python-thrift-dbg -name "*.egg-info" -print0 | xargs -0 rm -rf
-	find $(CURDIR)/debian/python-thrift-dbg -depth -type d -empty -exec rmdir {} \;
-
-	# PHP
-	mkdir -p $(CURDIR)/debian/php5-thrift
-	cd $(CURDIR)/lib/php && \
-		$(MAKE) DESTDIR=$(CURDIR)/debian/php5-thrift install
-
-	# C++ and C (glib)
-	mkdir -p $(CURDIR)/debian/tmp; \
-	cd $(CURDIR)/lib/cpp && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
-	cd $(CURDIR)/lib/c_glib && \
-		make DESTDIR=$(CURDIR)/debian/tmp install
-
-	dh_install --sourcedir=debian/tmp -s
-
-
-# Must not depend on anything. This is to be called by
-# binary-arch/binary-indep
-# in another 'make' thread.
-binary-common:
-	dh_testdir
-	dh_testroot
-	dh_installchangelogs
-	dh_installdocs
-	dh_installexamples
-	dh_installman
-	dh_link
-	dh_strip -Npython-thrift-dbg -Nthrift-compiler -Nlibthrift0 --dbg=python-thrift-dbg
-	dh_strip -Npython-thrift-dbg
-	dh_compress
-	dh_fixperms
-	dh_makeshlibs
-	dh_installdeb
-	dh_perl
-	dh_shlibdeps
-	dh_gencontrol
-	dh_md5sums
-	dh_builddeb
-# Build architecture independent packages using the common target.
-binary-indep: build-indep install-indep
-	$(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
-
-# Build architecture dependent packages using the common target.
-binary-arch: build-arch install-arch
-	echo "php:Depends=phpapi-$(php-config5 --phpapi)" > debian/substvars
-	$(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
-
-binary: binary-arch binary-indep
-.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/substvars
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/substvars b/depends/thirdparty/thrift/debian/substvars
deleted file mode 100644
index badf572..0000000
--- a/depends/thirdparty/thrift/debian/substvars
+++ /dev/null
@@ -1 +0,0 @@
-php:Depends=phpapi-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/thrift-doc.docs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/thrift-doc.docs b/depends/thirdparty/thrift/debian/thrift-doc.docs
deleted file mode 100644
index 299950c..0000000
--- a/depends/thirdparty/thrift/debian/thrift-doc.docs
+++ /dev/null
@@ -1,2 +0,0 @@
-#DOCS#
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/debian/thrift-doc.install
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/debian/thrift-doc.install b/depends/thirdparty/thrift/debian/thrift-doc.install
deleted file mode 100644
index 299950c..0000000
--- a/depends/thirdparty/thrift/debian/thrift-doc.install
+++ /dev/null
@@ -1,2 +0,0 @@
-#DOCS#
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doap.rdf
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doap.rdf b/depends/thirdparty/thrift/doap.rdf
deleted file mode 100755
index 5ff9945..0000000
--- a/depends/thirdparty/thrift/doap.rdf
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/xsl"?>
-<rdf:RDF xml:lang="en"
-         xmlns="http://usefulinc.com/ns/doap#" 
-         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
-         xmlns:asfext="http://projects.apache.org/ns/asfext#"
-         xmlns:foaf="http://xmlns.com/foaf/0.1/">
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-   
-         http://www.apache.org/licenses/LICENSE-2.0
-   
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-  <Project rdf:about="http://thrift.apache.org">
-    <created>2012-04-14</created>
-    <license rdf:resource="http://usefulinc.com/doap/licenses/asl20" />
-    <name>Apache Thrift</name>
-    <homepage rdf:resource="http://thrift.apache.org" />
-    <asfext:pmc rdf:resource="http://thrift.apache.org" />
-    <shortdesc>Apache Thrift software provides a framework for scalable cross-language services development, combines a software stack with a code generation engine to build services that work efficiently and seamlessly between C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, JavaScript, Node.js, Smalltalk, OCaml and Delphi and other languages. </shortdesc>
-    <description>Apache Thrift allows you to define data types and service interfaces in a simple definition file. Taking that file as input, the compiler generates code to be used to easily build RPC clients and servers that communicate seamlessly across programming languages. Instead of writing a load of boilerplate code to serialize and transport your objects and invoke remote methods, you can get right down to business. </description>
-    <bug-database rdf:resource="https://issues.apache.org/jira/browse/THRIFT" />
-    <mailing-list rdf:resource="http://thrift.apache.org/mailing/" />
-    <download-page rdf:resource="http://thrift.apache.org/download/" />
-    <programming-language>ActionScript</programming-language>
-    <programming-language>C</programming-language>
-    <programming-language>C#</programming-language>
-    <programming-language>C++</programming-language>
-    <programming-language>Cocoa</programming-language>
-    <programming-language>D</programming-language>
-    <programming-language>Delphi</programming-language>
-    <programming-language>Erlang</programming-language>
-    <programming-language>Go</programming-language>
-    <programming-language>Haskell</programming-language>
-    <programming-language>Java</programming-language>
-    <programming-language>JavaScript</programming-language>
-    <programming-language>node.js</programming-language>
-    <programming-language>OCaml</programming-language>
-    <programming-language>Perl</programming-language>
-    <programming-language>PHP</programming-language>
-    <programming-language>Python</programming-language>
-    <programming-language>SmallTalk</programming-language>
-    <category rdf:resource="http://projects.apache.org/category/http" />
-    <category rdf:resource="http://projects.apache.org/category/library" />
-    <category rdf:resource="http://projects.apache.org/category/network-client" />
-    <category rdf:resource="http://projects.apache.org/category/network-server" />
-    <release rdf:parseType="Collection">
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2015-09-25</created>
-        <revision>0.9.3</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2013-08-22</created>
-        <revision>0.9.1</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2012-10-15</created>
-        <revision>0.9.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2011-11-29</created>
-        <revision>0.8.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2011-08-13</created>
-        <revision>0.7.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2011-04-25</created>
-        <revision>0.6.1</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift</name>
-        <created>2011-02-08</created>
-        <revision>0.6.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift (incubating)</name>
-        <created>2010-10-07</created>
-        <revision>0.5.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift (incubating)</name>
-        <created>2010-08-23</created>
-        <revision>0.4.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift (incubating)</name>
-        <created>2010-08-04</created>
-        <revision>0.3.0</revision>
-      </Version>
-      <Version>
-        <name>Apache Thrift (incubating)</name>
-        <created>2009-12-11</created>
-        <revision>0.2.0</revision>
-      </Version>
-    </release>
-    <repository>
-      <GitRepository>
-        <location rdf:resource="https://git-wip-us.apache.org/repos/asf/thrift.git"/>
-        <browse rdf:resource="https://git-wip-us.apache.org/repos/asf?p=thrift.git"/>
-      </GitRepository>
-    </repository>
-    <maintainer>
-      <foaf:Person>
-        <foaf:name>Apache Thrift PMC</foaf:name>
-          <foaf:mbox rdf:resource="mailto:dev@thrift.apache.org"/>
-      </foaf:Person>
-    </maintainer>
-  </Project>
-</rdf:RDF>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/coding_standards.md b/depends/thirdparty/thrift/doc/coding_standards.md
deleted file mode 100644
index 308100a..0000000
--- a/depends/thirdparty/thrift/doc/coding_standards.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# Thrift Coding Standards
-
-   Any fool can write code that a computer can understand.
-   Good programmers write code that humans can understand.
-                                  -- Martin Fowler, 1999
-
-The purpose of this document is to make everyone's life easier.
-
-It's easier when you read good, well formatted, with clearly defined purpose, code.
-But the only way to read clean code is to write such.
-
-This document can help achieve that, but keep in mind that
-those are not silver-bullet, fix-all-at-once rules. Just think about readability while writing code.
-Write code like you would have to read it in ten years from now.
-
-## General Coding Standards
-
-Thrift has some history. Not all existing code follows those rules.
-But we want to improve over time.
-When making small change / bugfix - like single line fix - do *not* refactor whole function.
-That disturbs code repository history.
-Whenever adding something new and / or making bigger refactoring
- - follow those rules as strictly as you can.
-
-When in doubt - contact other developers (using dev@ mailing list or IRC).
-Code review is the best way to improve readability.
-
-### Basics
- * Use spaces not tabs
- * Use only ASCII characters in file and directory names
- * Commit to repository using Unix-style line endings (LF)
-     On Windows:
-       git config core.autocrlf true
- * Maximum line width - 100 characters
- * If not specified otherwise in language specific standard - use 2 spaces as indent/tab
-
-### Comments
- * Each file has to start with comment containing [Apache License](http://www.apache.org/licenses/LICENSE-2.0)
- * Public API of library should be documented, preferably using format native for language specific documentation generation tools (Javadoc, Doxygen etc.)
- * Other comments are discouraged - comments are lies. When one has to make comment it means one failed to write readable code. Instead of "I should write a comment here" think "I should clean it up"
- * Do not leave "TODO/FIXME" comments - file [Jira](http://issues.apache.org/jira/browse/THRIFT) issue instead
-
-### Naming
- Finding proper names is the most important and most difficult task in software development.
-
-## Language Specific Coding Standards
-
-For detailed information see `lib/LANG/coding_standards.md`

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/committers.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/committers.md b/depends/thirdparty/thrift/doc/committers.md
deleted file mode 100644
index b02edbe..0000000
--- a/depends/thirdparty/thrift/doc/committers.md
+++ /dev/null
@@ -1,54 +0,0 @@
-## Process used by committers to review and submit patches
-
-1. Make sure that there is an issue for the patch(s) you are about to commit in our [Jira issue tracker](http://issues.apache.org/jira/browse/THRIFT)
-
-1. Check out the latest version of the source code
-
-  * git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift
-
-1. Apply the patch
-
-  * curl https://issues.apache.org/jira/... |git apply --ignore-space-change
-
-  or
-
-  * curl https://github.com/<GitHub User>/thrift/commit/<Commit ID>.patch |git apply --ignore-space-change
-
-
-1. Inspect the applied patch to ensure that all [Legal aspects on Submission of Contributions (Patches)](http://www.apache.org/licenses/LICENSE-2.0.html#contributions) are met
-
-1. Run the necessary unit tests and cross language test cases to verify the patch
-
-1. Commit the patch
-
-        git --config user.name "Your Name"
-        git --config user.email "YourApacheID@apache.org"
-        git add -A
-        git commit
-
-1. The commit message should be in the format:
-
-       THRIFT-###:<Jira description>
-       Client: <component>
-       Patch: <Name of person contributing the patch>
-
-       Description of what was fixed or addressed.
-
-       <%
-           if this is a github pull request then add below comment
-            to automaticaly close GitHub request.
-       %>
-       This closes #XX
-
-
-1. Double check the patch committed and that nothing was missed then push the patch
-
-       git status
-       git show HEAD
-       git push origin master
-
-
-1. Resolve the jira issue and set the following for the changelog
-
-  * Component the patch is for
-  * fixVersion to the current version on master

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/install/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/install/README.md b/depends/thirdparty/thrift/doc/install/README.md
deleted file mode 100644
index e37f4ff..0000000
--- a/depends/thirdparty/thrift/doc/install/README.md
+++ /dev/null
@@ -1,43 +0,0 @@
-
-## Basic requirements
-* A relatively POSIX-compliant *NIX system
-    * Cygwin or MinGW can be used on Windows (but there are better options, see below)
-* g++ 4.2
-* boost 1.53.0
-* Runtime libraries for lex and yacc might be needed for the compiler.
-
-## Requirements for building from source
-* GNU build tools: 
-    * autoconf 2.65
-    * automake 1.13
-    * libtool 1.5.24
-* pkg-config autoconf macros (pkg.m4)
-* lex and yacc (developed primarily with flex and bison)
-* libssl-dev
-
-## Requirements for building the compiler from source on Windows
-* Visual Studio C++
-* Flex and Bison (e.g. the WinFlexBison package)
-
-## Language requirements
-These are only required if you choose to build the libraries for the given language
-
-* C++
-    * Boost 1.53.0
-    * libevent (optional, to build the nonblocking server)
-    * zlib (optional)
-* Java
-    * Java 1.7
-    * Apache Ant
-* C#: Mono 1.2.4 (and pkg-config to detect it) or Visual Studio 2005+
-* Python 2.6 (including header files for extension modules)
-* PHP 5.0 (optionally including header files for extension modules)
-* Ruby 1.8
-    * bundler gem
-* Erlang R12 (R11 works but not recommended)
-* Perl 5
-    * Bit::Vector
-    * Class::Accessor
-* Haxe 3.1.3
-* Go 1.4
-* Delphi 2010

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/install/centos.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/install/centos.md b/depends/thirdparty/thrift/doc/install/centos.md
deleted file mode 100644
index 609e118..0000000
--- a/depends/thirdparty/thrift/doc/install/centos.md
+++ /dev/null
@@ -1,75 +0,0 @@
-# Building Apache Thrift on CentOS 6.5
-
-Starting with a minimal installation, the following steps are required to build Apache Thrift on Centos 6.5. This example builds from source, using the current development master branch. These instructions should also work with Apache Thrift releases beginning with 0.9.2.
-
-## Update the System
-
-	sudo yum -y update
-
-## Install the Platform Development Tools
-
-	sudo yum -y groupinstall "Development Tools"
-
-## Upgrade autoconf/automake/bison
-
-	sudo yum install -y wget
-
-### Upgrade autoconf
-
-	wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
-	tar xvf autoconf-2.69.tar.gz
-	cd autoconf-2.69
-	./configure --prefix=/usr
-	make
-	sudo make install
-	cd ..
-
-### Upgrade automake
-
-	wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
-	tar xvf automake-1.14.tar.gz
-	cd automake-1.14
-	./configure --prefix=/usr
-	make
-	sudo make install
-	cd ..
-
-### Upgrade bison
-
-	wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
-	tar xvf bison-2.5.1.tar.gz
-	cd bison-2.5.1
-	./configure --prefix=/usr
-	make
-	sudo make install
-	cd ..
-
-## Add Optional C++ Language Library Dependencies
-
-All languages require the Apache Thrift IDL Compiler and at this point everything needed to make the IDL Compiler is installed (if you only need the compiler you can skip to the Build step). 
-
-If you will be developing Apache Thrift clients/servers in C++ you will also need additional packages to support the C++ shared library build.
-
-### Install C++ Lib Dependencies
-
-	sudo yum -y install libevent-devel zlib-devel openssl-devel
-
-### Upgrade Boost >= 1.53
-
-	wget http://sourceforge.net/projects/boost/files/boost/1.53.0/boost_1_53_0.tar.gz
-	tar xvf boost_1_53_0.tar.gz
-	cd boost_1_53_0
-	./bootstrap.sh
-	sudo ./b2 install
-
-## Build and Install the Apache Thrift IDL Compiler
-
-	git clone https://git-wip-us.apache.org/repos/asf/thrift.git
-	cd thrift
-	./bootstrap.sh
-	./configure --with-lua=no
-	make
-	sudo make install
-
-This will build the compiler (thrift/compiler/cpp/thrift --version) and any language libraries supported. The make install step installs the compiler on the path: /usr/local/bin/thrift
-You can use the ./configure --enable-libs=no switch to build the Apache Thrift IDL Compiler only without lib builds. To run tests use "make check".

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/install/debian.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/install/debian.md b/depends/thirdparty/thrift/doc/install/debian.md
deleted file mode 100644
index a4344c7..0000000
--- a/depends/thirdparty/thrift/doc/install/debian.md
+++ /dev/null
@@ -1,41 +0,0 @@
-## Debian or Ubuntu setup
-The following command install all the required tools and libraries to build and install the Apache Thrift compiler on a Debian/Ubuntu Linux based system.
-
-	sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev ant
-
-Then install the Java JDK of your choice. Type **javac** to see a list of available packages, pick the one you prefer and **apt-get install** it.
-
-Debian stable users need to manually install a more recent automake version:
-
-    wget http://ftp.debian.org/debian/pool/main/a/automake-1.14/automake_1.14.1-3_all.deb
-    sudo dpkg -i automake_1.14.1-3_all.deb
-
-## Optional packages
-
-Some other packages depend on what languages you want Thrift to support.
-
- * Ruby 
-	* ruby-full ruby-dev ruby-rspec rake rubygems libdaemons-ruby libgemplugin-ruby mongrel
- * Python
-	* python-all python-all-dev python-all-dbg
- * Perl
-	* libbit-vector-perl libclass-accessor-class-perl
- * Php, install
-	* php5-dev php5-cli phpunit
- * C_glib
-	* libglib2.0-dev
- * Erlang
-	* erlang-base erlang-eunit erlang-dev
- * Csharp
-	* mono-gmcs mono-devel libmono-system-web2.0-cil nunit nunit-console
- * Haskell
-	* ghc6 cabal-install libghc6-binary-dev libghc6-network-dev libghc6-http-dev
- * Thrift Compiler for Windows
-	* mingw32 mingw32-binutils mingw32-runtime nsis
-
-
-## Additional reading
-
-For more information on the requirements see: [Apache Thrift Requirements](/docs/install)
-
-For more information on building and installing Thrift see: [Building from source](/docs/BuildingFromSource)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/install/os_x.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/install/os_x.md b/depends/thirdparty/thrift/doc/install/os_x.md
deleted file mode 100644
index 2d99ef4..0000000
--- a/depends/thirdparty/thrift/doc/install/os_x.md
+++ /dev/null
@@ -1,27 +0,0 @@
-## OS X Setup
-The following command install all the required tools and libraries to build and install the Apache Thrift compiler on a OS X based system. 
-
-### Install Boost
-Download the boost library from [boost.org](http://www.boost.org) untar compile with
-
-	./bootstrap.sh
-	sudo ./b2 threading=multi address-model=64 variant=release stage install
-
-### Install libevent
-Download [libevent](http://monkey.org/~provos/libevent), untar and compile with
-
-	./configure --prefix=/usr/local 
-	make
-	sudo make install
-
-### Building Apache Thrift
-Download the latest version of [Apache Thrift](/download), untar and compile with
-
-	./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local
-
-## Additional reading
-
-For more information on the requirements see: [Apache Thrift Requirements](/docs/install)
-
-For more information on building and installing Thrift see: [Building from source](/docs/BuildingFromSource)
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/install/windows.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/install/windows.md b/depends/thirdparty/thrift/doc/install/windows.md
deleted file mode 100644
index 7b09840..0000000
--- a/depends/thirdparty/thrift/doc/install/windows.md
+++ /dev/null
@@ -1,186 +0,0 @@
-## Windows Setup
-
-The Thrift environment consists of two main parts: The Thrift compiler EXE and the language-dependent libraries. Most of these libraries will require some kind of build and/or installation. But regarding the Thrift compiler utility there are a number of different alternatives. 
-
-The first one of these alternatives is to download the **pre-built Thrift Compiler EXE** and only build the libraries needed from source, following one of the "Setup from source" methods outlined below.
-
-The other two options are to build the Thrift compiler from source. The most recommended way to achieve this is by means of the **Visual Studio C++ build project**. Alternatively, the Thrift compiler can also be built via **Cygwin** or **MinGW** build environments, however this method is not only less comfortable, but more time-consuming and requires much more manual effort. 
-
-
-## Prebuilt Thrift compiler
-
-The windows Thrift compiler is available as a prebuilt exe available [here](/download). Note that there is no installation tool, rather this EXE file *is* already the Thrift compiler utility. Download the file and put it into some suitable location of your choice.
-
-Now pick one of the "Build and install target libraries" below to continue.
-
- 
-## Setup from source via Visual Studio C++ (recommended)
-
-### Requirements
-
-Thrift's compiler is written in C++ and designed to be portable, but there are some system requirements. Thrift's runtime libraries are written in various languages, which are also required for the particular language interface.
-
- * Visual Studio C++, any recent version should do
- * Flex and Bison, e.g. the WinFlexBison package
- * [Apache Thrift Requirements](/docs/install)
-
-### Build and install the compiler
- 
-After all requirements are in place, use the `compiler/cpp/compiler.vcxproj` build project to build the Thrift compiler. Copy the resulting EXE file to a location of your choice. 
-
-### Build and install target libraries
-
-A few of the target language libraries also do provide Visual Studio project files, such as C++ and C#. These are located in the `lib/<language>/` folders. 
-
-Most of the language packages must be built and installed manually using build tools better suited to those languages. Typical examples are Java, Ruby, Delphi, or PHP. Look for the `README.md` file in the `lib/<language>/` folder for more details on how to build and install each language's library package.
- 
-
-## Setup from source via Cygwin
-
-### Requirements
-
-Thrift's compiler is written in C++ and designed to be portable, but there are some system requirements. Thrift's runtime libraries are written in various languages, which are also required for the particular language interface.
-
- * Cygwin or MinGW 
- * [Apache Thrift Requirements](/docs/install)
-
-### Installing from source
-
-If you are building from the first time out of the source repository, you will need to generate the configure scripts.  (This is not necessary if you downloaded a tarball.)  From the top directory, do:
-
-	./bootstrap.sh
-
-Once the configure scripts are generated, thrift can be configured. From the top directory, do:
-
-	export CXXFLAGS="-D PTHREAD_MUTEX_RECURSIVE_NP=PTHREAD_MUTEX_RECURSIVE"
-	./configure
-
-Setting the CXXFLAGS environmental variable works around compile errors with PTHREAD_MUTEX_RECURSIVE_NP being undeclared, by replacing it with the newer, portable PTHREAD_MUTEX_RECURSIVE. (Tested on cygwin 20100320, Thrift r760184, latest pthread.)
-
-**Optional:** You **may not** be able to make from the root  Thrift directory due to errors (see below to resolve). To make the compiler only, change to the compiler directory before running make:
-
-	cd compiler/cpp
-
-Now make the thrift compiler (& runtime libraries if make is run from the thrift root directory):
-
-	make
-	make install
-
-### Build and install target libraries
-
-Some language packages must be installed manually using build tools better suited to those languages. Typical examples are Java, Ruby, or PHP. Look for the README file in the `lib/<language>/` folder for more details on the installation of each language library package.
-
-### Possible issues with Cygwin install
-
-See also Possible issues with MinGW install.
-
-#### Syntax error in ./configure
-
-The following error occurs for some users when running ./configure:
-
-	./configure: line 21183: syntax error near unexpected token `MONO,'
-	./configure: line 21183: `  PKG_CHECK_MODULES(MONO, mono >= 1.2.6, have_mono=yes, have_mono=no)'
-
-To resolve this, you'll need to find your pkg.m4 (installed by the pkg-config package) file and copy it to the thrift/aclocal directory.  From the top-level thrift directory, you can copy the file by running
-
-	cp /usr/share/aclocal/pkg.m4 aclocal
-
-Finally, re-run ./bootstrap.sh and ./configure.  (Note that pkg.m4 is created by the pkg-config tool.  If your /usr/share/aclocal directory doesn't contain the pkg.m4 file, you may not have pkg-config installed.)
-
-#### Installing perl runtime libraries
-
-Sometimes, there will be an error during the install of the perl libraries with chmod.
-
-A workaround is to avoid installing the perl libraries if they are not needed.
-
-If you don't need perl, run configure with --without-perl.
-
-If you need perl, and are happy to manually install it, replace the contents of thrift/lib/perl/Makefile with the following, after building thrift:
-	
-	TODO
-
-#### Linking to installed C++ runtime libraries
-
-Sometimes, the installed libthrift.a will not link using g++, with linker errors about missing vtables and exceptions for Thrift classes.
-
-A workaround is to link the compiled object files directly from your Thrift build, corresponding to the missing classes.
-
-This can be implemented in a Makefile using the following lines:
-
-	THRIFT_O=<path to>/thrift/lib/cpp
-	LTHRIFT=$(THRIFT_O)/Thrift.o $(THRIFT_O)/TSocket.o $(THRIFT_O)/TBinaryProtocol.o $(THRIFT_O)/TBufferTransports.o
-
-Then linking using $(LTHRIFT) instead of -lthrift.
-
-	TODO - diagnose issue further
-
-#### C++ runtime segfault with cygwin 1.7.5-1, g++-4.3.4, fork() and throw
-
-If your thrift C++ programs segfault on throw after fork()ing, compile them with g++-3.
-
-The issue and patch are described on the Cygwin mailing list at http://cygwin.com/ml/cygwin/2010-05/msg00203.html
-
-This issue should be fixed in Cygwin versions after 1.7.5-1, or g++ 4.5.0.
-
-## Setup from source via MinGW
-
-### Requirements
-
-To compile the Thrift generator & runtime libraries (untested) without the cygwin.dll dependency you need to install MinGW (www.mingw.org). 
-
- * MinGW 
- * [Apache Thrift Requirements](/docs/install)
-
-In addition you need to add the following entry to your windows PATH variable.
-
-	C:\MINGW\BIN
-	
-Next, open compiler/cpp/Makefile.am and add the following line to thrift_CXXFLAGS
-
-	-DMINGW -mno-cygwin -lfl
-	
-Run bootstrap.sh:
-
-	./bootstrap.sh
-
-Make sure you have java in your $PATH variable, if not do(adjust path if necessary):
-
-	export PATH=$PATH:"/cygdrive/c/program files/java/jre1.6.0_05/bin"
-
-Run configure - using CXXFLAGS to work around an issue with an old pthreads define (untested on MinGW - works on Cygwin):
-
-	export CXXFLAGS="-D PTHREAD_MUTEX_RECURSIVE_NP=PTHREAD_MUTEX_RECURSIVE"
-	./configure
-
-''Optional:'' To make the compiler only, change to the compiler  directory before running make:
-
-	cd compiler/cpp
-	
-Run make:
-
-	mingw32-make.exe
-
-### Possible issues with MinGW install
-
-See also Possible issues with Cygwin install, including the discussion about PTHREAD_MUTEX_RECURSIVE_NP.
-
-#### yywrap is not found
-
-Make sure you add -lfl in your cxxflags in Makefile, also try adding -Lc:/cygwin/libs
-
-#### boost is not found
-
-Try and change the include dir to use the windows path from c like this: Edit compiler/cpp/Makefile, look for the declaration of BOOST_CPPFLAGS, change that line for
-
-	BOOST_CPPFLAGS = -Ic:/cygwin/usr/include/boost-1_53_0
-	
-#### realpath is not found
-
-add -DMINGW -mno-cygwin to the CXXDEFS variable in Makefile
-
-## Additional reading
-
-For more information on the requirements see: [Apache Thrift Requirements](/docs/install)
-
-For more information on building and installing Thrift see: [Building from source](/docs/BuildingFromSource)
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/licenses/lgpl-2.1.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/licenses/lgpl-2.1.txt b/depends/thirdparty/thrift/doc/licenses/lgpl-2.1.txt
deleted file mode 100644
index 5ab7695..0000000
--- a/depends/thirdparty/thrift/doc/licenses/lgpl-2.1.txt
+++ /dev/null
@@ -1,504 +0,0 @@
-		  GNU LESSER GENERAL PUBLIC LICENSE
-		       Version 2.1, February 1999
-
- Copyright (C) 1991, 1999 Free Software Foundation, Inc.
- 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-[This is the first released version of the Lesser GPL.  It also counts
- as the successor of the GNU Library Public License, version 2, hence
- the version number 2.1.]
-
-			    Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-Licenses are intended to guarantee your freedom to share and change
-free software--to make sure the software is free for all its users.
-
-  This license, the Lesser General Public License, applies to some
-specially designated software packages--typically libraries--of the
-Free Software Foundation and other authors who decide to use it.  You
-can use it too, but we suggest you first think carefully about whether
-this license or the ordinary General Public License is the better
-strategy to use in any particular case, based on the explanations below.
-
-  When we speak of free software, we are referring to freedom of use,
-not price.  Our General Public Licenses are designed to make sure that
-you have the freedom to distribute copies of free software (and charge
-for this service if you wish); that you receive source code or can get
-it if you want it; that you can change the software and use pieces of
-it in new free programs; and that you are informed that you can do
-these things.
-
-  To protect your rights, we need to make restrictions that forbid
-distributors to deny you these rights or to ask you to surrender these
-rights.  These restrictions translate to certain responsibilities for
-you if you distribute copies of the library or if you modify it.
-
-  For example, if you distribute copies of the library, whether gratis
-or for a fee, you must give the recipients all the rights that we gave
-you.  You must make sure that they, too, receive or can get the source
-code.  If you link other code with the library, you must provide
-complete object files to the recipients, so that they can relink them
-with the library after making changes to the library and recompiling
-it.  And you must show them these terms so they know their rights.
-
-  We protect your rights with a two-step method: (1) we copyright the
-library, and (2) we offer you this license, which gives you legal
-permission to copy, distribute and/or modify the library.
-
-  To protect each distributor, we want to make it very clear that
-there is no warranty for the free library.  Also, if the library is
-modified by someone else and passed on, the recipients should know
-that what they have is not the original version, so that the original
-author's reputation will not be affected by problems that might be
-introduced by others.
-
-  Finally, software patents pose a constant threat to the existence of
-any free program.  We wish to make sure that a company cannot
-effectively restrict the users of a free program by obtaining a
-restrictive license from a patent holder.  Therefore, we insist that
-any patent license obtained for a version of the library must be
-consistent with the full freedom of use specified in this license.
-
-  Most GNU software, including some libraries, is covered by the
-ordinary GNU General Public License.  This license, the GNU Lesser
-General Public License, applies to certain designated libraries, and
-is quite different from the ordinary General Public License.  We use
-this license for certain libraries in order to permit linking those
-libraries into non-free programs.
-
-  When a program is linked with a library, whether statically or using
-a shared library, the combination of the two is legally speaking a
-combined work, a derivative of the original library.  The ordinary
-General Public License therefore permits such linking only if the
-entire combination fits its criteria of freedom.  The Lesser General
-Public License permits more lax criteria for linking other code with
-the library.
-
-  We call this license the "Lesser" General Public License because it
-does Less to protect the user's freedom than the ordinary General
-Public License.  It also provides other free software developers Less
-of an advantage over competing non-free programs.  These disadvantages
-are the reason we use the ordinary General Public License for many
-libraries.  However, the Lesser license provides advantages in certain
-special circumstances.
-
-  For example, on rare occasions, there may be a special need to
-encourage the widest possible use of a certain library, so that it becomes
-a de-facto standard.  To achieve this, non-free programs must be
-allowed to use the library.  A more frequent case is that a free
-library does the same job as widely used non-free libraries.  In this
-case, there is little to gain by limiting the free library to free
-software only, so we use the Lesser General Public License.
-
-  In other cases, permission to use a particular library in non-free
-programs enables a greater number of people to use a large body of
-free software.  For example, permission to use the GNU C Library in
-non-free programs enables many more people to use the whole GNU
-operating system, as well as its variant, the GNU/Linux operating
-system.
-
-  Although the Lesser General Public License is Less protective of the
-users' freedom, it does ensure that the user of a program that is
-linked with the Library has the freedom and the wherewithal to run
-that program using a modified version of the Library.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.  Pay close attention to the difference between a
-"work based on the library" and a "work that uses the library".  The
-former contains code derived from the library, whereas the latter must
-be combined with the library in order to run.
-
-		  GNU LESSER GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License Agreement applies to any software library or other
-program which contains a notice placed by the copyright holder or
-other authorized party saying it may be distributed under the terms of
-this Lesser General Public License (also called "this License").
-Each licensee is addressed as "you".
-
-  A "library" means a collection of software functions and/or data
-prepared so as to be conveniently linked with application programs
-(which use some of those functions and data) to form executables.
-
-  The "Library", below, refers to any such software library or work
-which has been distributed under these terms.  A "work based on the
-Library" means either the Library or any derivative work under
-copyright law: that is to say, a work containing the Library or a
-portion of it, either verbatim or with modifications and/or translated
-straightforwardly into another language.  (Hereinafter, translation is
-included without limitation in the term "modification".)
-
-  "Source code" for a work means the preferred form of the work for
-making modifications to it.  For a library, complete source code means
-all the source code for all modules it contains, plus any associated
-interface definition files, plus the scripts used to control compilation
-and installation of the library.
-
-  Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running a program using the Library is not restricted, and output from
-such a program is covered only if its contents constitute a work based
-on the Library (independent of the use of the Library in a tool for
-writing it).  Whether that is true depends on what the Library does
-and what the program that uses the Library does.
-  
-  1. You may copy and distribute verbatim copies of the Library's
-complete source code as you receive it, in any medium, provided that
-you conspicuously and appropriately publish on each copy an
-appropriate copyright notice and disclaimer of warranty; keep intact
-all the notices that refer to this License and to the absence of any
-warranty; and distribute a copy of this License along with the
-Library.
-
-  You may charge a fee for the physical act of transferring a copy,
-and you may at your option offer warranty protection in exchange for a
-fee.
-
-  2. You may modify your copy or copies of the Library or any portion
-of it, thus forming a work based on the Library, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) The modified work must itself be a software library.
-
-    b) You must cause the files modified to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    c) You must cause the whole of the work to be licensed at no
-    charge to all third parties under the terms of this License.
-
-    d) If a facility in the modified Library refers to a function or a
-    table of data to be supplied by an application program that uses
-    the facility, other than as an argument passed when the facility
-    is invoked, then you must make a good faith effort to ensure that,
-    in the event an application does not supply such function or
-    table, the facility still operates, and performs whatever part of
-    its purpose remains meaningful.
-
-    (For example, a function in a library to compute square roots has
-    a purpose that is entirely well-defined independent of the
-    application.  Therefore, Subsection 2d requires that any
-    application-supplied function or table used by this function must
-    be optional: if the application does not supply it, the square
-    root function must still compute square roots.)
-
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Library,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Library, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote
-it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Library.
-
-In addition, mere aggregation of another work not based on the Library
-with the Library (or with a work based on the Library) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may opt to apply the terms of the ordinary GNU General Public
-License instead of this License to a given copy of the Library.  To do
-this, you must alter all the notices that refer to this License, so
-that they refer to the ordinary GNU General Public License, version 2,
-instead of to this License.  (If a newer version than version 2 of the
-ordinary GNU General Public License has appeared, then you can specify
-that version instead if you wish.)  Do not make any other change in
-these notices.
-
-  Once this change is made in a given copy, it is irreversible for
-that copy, so the ordinary GNU General Public License applies to all
-subsequent copies and derivative works made from that copy.
-
-  This option is useful when you wish to copy part of the code of
-the Library into a program that is not a library.
-
-  4. You may copy and distribute the Library (or a portion or
-derivative of it, under Section 2) in object code or executable form
-under the terms of Sections 1 and 2 above provided that you accompany
-it with the complete corresponding machine-readable source code, which
-must be distributed under the terms of Sections 1 and 2 above on a
-medium customarily used for software interchange.
-
-  If distribution of object code is made by offering access to copy
-from a designated place, then offering equivalent access to copy the
-source code from the same place satisfies the requirement to
-distribute the source code, even though third parties are not
-compelled to copy the source along with the object code.
-
-  5. A program that contains no derivative of any portion of the
-Library, but is designed to work with the Library by being compiled or
-linked with it, is called a "work that uses the Library".  Such a
-work, in isolation, is not a derivative work of the Library, and
-therefore falls outside the scope of this License.
-
-  However, linking a "work that uses the Library" with the Library
-creates an executable that is a derivative of the Library (because it
-contains portions of the Library), rather than a "work that uses the
-library".  The executable is therefore covered by this License.
-Section 6 states terms for distribution of such executables.
-
-  When a "work that uses the Library" uses material from a header file
-that is part of the Library, the object code for the work may be a
-derivative work of the Library even though the source code is not.
-Whether this is true is especially significant if the work can be
-linked without the Library, or if the work is itself a library.  The
-threshold for this to be true is not precisely defined by law.
-
-  If such an object file uses only numerical parameters, data
-structure layouts and accessors, and small macros and small inline
-functions (ten lines or less in length), then the use of the object
-file is unrestricted, regardless of whether it is legally a derivative
-work.  (Executables containing this object code plus portions of the
-Library will still fall under Section 6.)
-
-  Otherwise, if the work is a derivative of the Library, you may
-distribute the object code for the work under the terms of Section 6.
-Any executables containing that work also fall under Section 6,
-whether or not they are linked directly with the Library itself.
-
-  6. As an exception to the Sections above, you may also combine or
-link a "work that uses the Library" with the Library to produce a
-work containing portions of the Library, and distribute that work
-under terms of your choice, provided that the terms permit
-modification of the work for the customer's own use and reverse
-engineering for debugging such modifications.
-
-  You must give prominent notice with each copy of the work that the
-Library is used in it and that the Library and its use are covered by
-this License.  You must supply a copy of this License.  If the work
-during execution displays copyright notices, you must include the
-copyright notice for the Library among them, as well as a reference
-directing the user to the copy of this License.  Also, you must do one
-of these things:
-
-    a) Accompany the work with the complete corresponding
-    machine-readable source code for the Library including whatever
-    changes were used in the work (which must be distributed under
-    Sections 1 and 2 above); and, if the work is an executable linked
-    with the Library, with the complete machine-readable "work that
-    uses the Library", as object code and/or source code, so that the
-    user can modify the Library and then relink to produce a modified
-    executable containing the modified Library.  (It is understood
-    that the user who changes the contents of definitions files in the
-    Library will not necessarily be able to recompile the application
-    to use the modified definitions.)
-
-    b) Use a suitable shared library mechanism for linking with the
-    Library.  A suitable mechanism is one that (1) uses at run time a
-    copy of the library already present on the user's computer system,
-    rather than copying library functions into the executable, and (2)
-    will operate properly with a modified version of the library, if
-    the user installs one, as long as the modified version is
-    interface-compatible with the version that the work was made with.
-
-    c) Accompany the work with a written offer, valid for at
-    least three years, to give the same user the materials
-    specified in Subsection 6a, above, for a charge no more
-    than the cost of performing this distribution.
-
-    d) If distribution of the work is made by offering access to copy
-    from a designated place, offer equivalent access to copy the above
-    specified materials from the same place.
-
-    e) Verify that the user has already received a copy of these
-    materials or that you have already sent this user a copy.
-
-  For an executable, the required form of the "work that uses the
-Library" must include any data and utility programs needed for
-reproducing the executable from it.  However, as a special exception,
-the materials to be distributed need not include anything that is
-normally distributed (in either source or binary form) with the major
-components (compiler, kernel, and so on) of the operating system on
-which the executable runs, unless that component itself accompanies
-the executable.
-
-  It may happen that this requirement contradicts the license
-restrictions of other proprietary libraries that do not normally
-accompany the operating system.  Such a contradiction means you cannot
-use both them and the Library together in an executable that you
-distribute.
-
-  7. You may place library facilities that are a work based on the
-Library side-by-side in a single library together with other library
-facilities not covered by this License, and distribute such a combined
-library, provided that the separate distribution of the work based on
-the Library and of the other library facilities is otherwise
-permitted, and provided that you do these two things:
-
-    a) Accompany the combined library with a copy of the same work
-    based on the Library, uncombined with any other library
-    facilities.  This must be distributed under the terms of the
-    Sections above.
-
-    b) Give prominent notice with the combined library of the fact
-    that part of it is a work based on the Library, and explaining
-    where to find the accompanying uncombined form of the same work.
-
-  8. You may not copy, modify, sublicense, link with, or distribute
-the Library except as expressly provided under this License.  Any
-attempt otherwise to copy, modify, sublicense, link with, or
-distribute the Library is void, and will automatically terminate your
-rights under this License.  However, parties who have received copies,
-or rights, from you under this License will not have their licenses
-terminated so long as such parties remain in full compliance.
-
-  9. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Library or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Library (or any work based on the
-Library), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Library or works based on it.
-
-  10. Each time you redistribute the Library (or any work based on the
-Library), the recipient automatically receives a license from the
-original licensor to copy, distribute, link with or modify the Library
-subject to these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties with
-this License.
-
-  11. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Library at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Library by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Library.
-
-If any portion of this section is held invalid or unenforceable under any
-particular circumstance, the balance of the section is intended to apply,
-and the section as a whole is intended to apply in other circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-
-  12. If the distribution and/or use of the Library is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Library under this License may add
-an explicit geographical distribution limitation excluding those countries,
-so that distribution is permitted only in or among countries not thus
-excluded.  In such case, this License incorporates the limitation as if
-written in the body of this License.
-
-  13. The Free Software Foundation may publish revised and/or new
-versions of the Lesser General Public License from time to time.
-Such new versions will be similar in spirit to the present version,
-but may differ in detail to address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Library
-specifies a version number of this License which applies to it and
-"any later version", you have the option of following the terms and
-conditions either of that version or of any later version published by
-the Free Software Foundation.  If the Library does not specify a
-license version number, you may choose any version ever published by
-the Free Software Foundation.
-
-  14. If you wish to incorporate parts of the Library into other free
-programs whose distribution conditions are incompatible with these,
-write to the author to ask for permission.  For software which is
-copyrighted by the Free Software Foundation, write to the Free
-Software Foundation; we sometimes make exceptions for this.  Our
-decision will be guided by the two goals of preserving the free status
-of all derivatives of our free software and of promoting the sharing
-and reuse of software generally.
-
-			    NO WARRANTY
-
-  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
-WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
-EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
-OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
-KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
-LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
-THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
-WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
-AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
-FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
-CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
-LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
-RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
-FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
-SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
-DAMAGES.
-
-		     END OF TERMS AND CONDITIONS
-
-           How to Apply These Terms to Your New Libraries
-
-  If you develop a new library, and you want it to be of the greatest
-possible use to the public, we recommend making it free software that
-everyone can redistribute and change.  You can do so by permitting
-redistribution under these terms (or, alternatively, under the terms of the
-ordinary General Public License).
-
-  To apply these terms, attach the following notices to the library.  It is
-safest to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least the
-"copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the library's name and a brief idea of what it does.>
-    Copyright (C) <year>  <name of author>
-
-    This library is free software; you can redistribute it and/or
-    modify it under the terms of the GNU Lesser General Public
-    License as published by the Free Software Foundation; either
-    version 2.1 of the License, or (at your option) any later version.
-
-    This library is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-    Lesser General Public License for more details.
-
-    You should have received a copy of the GNU Lesser General Public
-    License along with this library; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-
-Also add information on how to contact you by electronic and paper mail.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the library, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the
-  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
-
-  <signature of Ty Coon>, 1 April 1990
-  Ty Coon, President of Vice
-
-That's all there is to it!
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/doc/licenses/otp-base-license.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/doc/licenses/otp-base-license.txt b/depends/thirdparty/thrift/doc/licenses/otp-base-license.txt
deleted file mode 100644
index 8ee2992..0000000
--- a/depends/thirdparty/thrift/doc/licenses/otp-base-license.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-Tue Oct 24 12:28:44 CDT 2006
-
-Copyright (c) <2006> <Martin J. Logan, Erlware> 
-
-Permission is hereby granted, free of charge, to any person obtaining a copy 
-of this software (OTP Base, fslib, G.A.S)  and associated documentation files (the "Software"), to deal 
-in the Software without restriction, including without limitation the rights to 
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 
-of the Software, and to permit persons to whom the Software is furnished to do 
-so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all 
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 
-INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 
-PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
-OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


[09/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testcontainertest.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testcontainertest.c b/depends/thirdparty/thrift/lib/c_glib/test/testcontainertest.c
deleted file mode 100644
index 852254b..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testcontainertest.c
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "gen-c_glib/t_test_container_test_types.h"
-#include "gen-c_glib/t_test_container_service.h"
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol_factory.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-#include <thrift/c_glib/protocol/thrift_protocol_factory.h>
-#include <thrift/c_glib/server/thrift_server.h>
-#include <thrift/c_glib/server/thrift_simple_server.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport_factory.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-
-#include <glib-object.h>
-#include <glib.h>
-
-#include <unistd.h>
-#include <signal.h>
-#include <string.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-
-#define TEST_SERVER_HOSTNAME "localhost"
-#define TEST_SERVER_PORT     9090
-
-/* --------------------------------------------------------------------------
-   The ContainerService handler we'll use for testing */
-
-G_BEGIN_DECLS
-
-GType test_container_service_handler_get_type (void);
-
-#define TYPE_TEST_CONTAINER_SERVICE_HANDLER \
-  (test_container_service_handler_get_type ())
-
-#define TEST_CONTAINER_SERVICE_HANDLER(obj)                             \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                                   \
-                               TYPE_TEST_CONTAINER_SERVICE_HANDLER,     \
-                               TestContainerServiceHandler))
-#define TEST_CONTAINER_SERVICE_HANDLER_CLASS(c)                         \
-  (G_TYPE_CHECK_CLASS_CAST ((c),                                        \
-                            TYPE_TEST_CONTAINER_SERVICE_HANDLER,        \
-                            TestContainerServiceHandlerClass))
-#define IS_TEST_CONTAINER_SERVICE_HANDLER(obj)                          \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                                   \
-                               TYPE_TEST_CONTAINER_SERVICE_HANDLER))
-#define IS_TEST_CONTAINER_SERVICE_HANDLER_CLASS(c)                      \
-  (G_TYPE_CHECK_CLASS_TYPE ((c),                                        \
-                            TYPE_TEST_CONTAINER_SERVICE_HANDLER))
-#define TEST_CONTAINER_SERVICE_HANDLER_GET_CLASS(obj)                   \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj),                                    \
-                              TYPE_TEST_CONTAINER_SERVICE_HANDLER,      \
-                              TestContainerServiceHandlerClass))
-
-struct _TestContainerServiceHandler {
-  TTestContainerServiceHandler parent_instance;
-
-  /* private */
-  GPtrArray *string_list;
-};
-typedef struct _TestContainerServiceHandler TestContainerServiceHandler;
-
-struct _TestContainerServiceHandlerClass {
-  TTestContainerServiceHandlerClass parent_class;
-};
-typedef struct _TestContainerServiceHandlerClass
-  TestContainerServiceHandlerClass;
-
-G_END_DECLS
-
-/* -------------------------------------------------------------------------- */
-
-G_DEFINE_TYPE (TestContainerServiceHandler,
-               test_container_service_handler,
-               T_TEST_TYPE_CONTAINER_SERVICE_HANDLER)
-
-/* A helper function used to append copies of strings to a string list */
-static void append_string_to_ptr_array (gpointer element, gpointer ptr_array)
-{
-  g_ptr_array_add ((GPtrArray *)ptr_array, g_strdup ((gchar *)element));
-}
-
-/* Accept a string list from the client and append its contents to our internal
-   list */
-static gboolean
-test_container_service_handler_receive_string_list (TTestContainerServiceIf *iface,
-                                                    const GPtrArray *stringList,
-                                                    GError **error)
-{
-  TestContainerServiceHandler *self = TEST_CONTAINER_SERVICE_HANDLER (iface);
-
-  /* Append the client's strings to our own internal string list */
-  g_ptr_array_foreach ((GPtrArray *)stringList,
-                       append_string_to_ptr_array,
-                       self->string_list);
-
-  g_clear_error (error);
-  return TRUE;
-}
-
-/* Return the contents of our internal string list to the client */
-static gboolean
-test_container_service_handler_return_string_list (TTestContainerServiceIf *iface,
-                                                   GPtrArray **_return,
-                                                   GError **error)
-{
-  TestContainerServiceHandler *self = TEST_CONTAINER_SERVICE_HANDLER (iface);
-
-  /* Return (copies of) the strings contained in our list */
-  g_ptr_array_foreach (self->string_list,
-                       append_string_to_ptr_array,
-                       *_return);
-
-  g_clear_error (error);
-  return TRUE;
-}
-
-static gboolean
-test_container_service_handler_return_list_string_list (TTestContainerServiceIf *iface,
-                                                        GPtrArray **_return,
-                                                        GError **error)
-{
-  TestContainerServiceHandler *self = TEST_CONTAINER_SERVICE_HANDLER (iface);
-  GPtrArray *nested_list;
-
-  /* Return a list containing our list of strings */
-  nested_list
-    = g_ptr_array_new_with_free_func ((GDestroyNotify)g_ptr_array_unref);
-  g_ptr_array_add (nested_list, self->string_list);
-  g_ptr_array_ref (self->string_list);
-
-  g_ptr_array_add (*_return, nested_list);
-
-  g_clear_error (error);
-  return TRUE;
-}
-
-static gboolean
-test_container_service_handler_return_typedefd_list_string_list (TTestContainerServiceIf *iface,
-                                                                 TTestListStringList **_return,
-                                                                 GError **error)
-{
-  TestContainerServiceHandler *self = TEST_CONTAINER_SERVICE_HANDLER (iface);
-  TTestStringList *nested_list;
-
-  /* Return a list containing our list of strings */
-  nested_list
-    = g_ptr_array_new_with_free_func ((GDestroyNotify)g_ptr_array_unref);
-  g_ptr_array_add (nested_list, self->string_list);
-  g_ptr_array_ref (self->string_list);
-
-  g_ptr_array_add (*_return, nested_list);
-
-  g_clear_error (error);
-  return TRUE;
-}
-
-static void
-test_container_service_handler_finalize (GObject *object) {
-  TestContainerServiceHandler *self = TEST_CONTAINER_SERVICE_HANDLER (object);
-
-  /* Destroy our internal containers */
-  g_ptr_array_unref (self->string_list);
-  self->string_list = NULL;
-
-  G_OBJECT_CLASS (test_container_service_handler_parent_class)->
-    finalize (object);
-}
-
-static void
-test_container_service_handler_init (TestContainerServiceHandler *self)
-{
-  /* Create our internal containers */
-  self->string_list = g_ptr_array_new_with_free_func (g_free);
-}
-
-static void
-test_container_service_handler_class_init (TestContainerServiceHandlerClass *klass)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
-  TTestContainerServiceHandlerClass *parent_class =
-    T_TEST_CONTAINER_SERVICE_HANDLER_CLASS (klass);
-
-  gobject_class->finalize = test_container_service_handler_finalize;
-
-  parent_class->receive_string_list =
-    test_container_service_handler_receive_string_list;
-  parent_class->return_string_list =
-    test_container_service_handler_return_string_list;
-  parent_class->return_list_string_list =
-    test_container_service_handler_return_list_string_list;
-  parent_class->return_typedefd_list_string_list =
-    test_container_service_handler_return_typedefd_list_string_list;
-}
-
-/* -------------------------------------------------------------------------- */
-
-/* Our test server, declared globally so we can access it within a signal
-   handler */
-ThriftServer *server = NULL;
-
-/* A signal handler used to detect when the child process (the test suite) has
-   exited so we know to shut down the server and terminate ourselves */
-static void
-sigchld_handler (int signal_number)
-{
-  THRIFT_UNUSED_VAR (signal_number);
-
-  /* The child process (the tests) has exited or been terminated; shut down the
-     server gracefully */
-  if (server != NULL)
-    thrift_server_stop (server);
-}
-
-/* A helper function that executes a test case against a newly constructed
-   service client */
-static void
-execute_with_service_client (void (*test_case)(TTestContainerServiceIf *,
-                                               GError **))
-{
-  ThriftSocket *socket;
-  ThriftTransport *transport;
-  ThriftProtocol *protocol;
-
-  TTestContainerServiceIf *client;
-
-  GError *error = NULL;
-
-  /* Create a client with which to access the server */
-  socket    = g_object_new (THRIFT_TYPE_SOCKET,
-                            "hostname", TEST_SERVER_HOSTNAME,
-                            "port",     TEST_SERVER_PORT,
-                            NULL);
-  transport = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                            "transport", socket,
-                            NULL);
-  protocol  = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL,
-                            "transport", transport,
-                            NULL);
-
-  thrift_transport_open (transport, &error);
-  g_assert_no_error (error);
-
-  client = g_object_new (T_TEST_TYPE_CONTAINER_SERVICE_CLIENT,
-                         "input_protocol",  protocol,
-                         "output_protocol", protocol,
-                         NULL);
-
-  /* Execute the test against this client */
-  (*test_case)(client, &error);
-  g_assert_no_error (error);
-
-  /* Clean up and exit */
-  thrift_transport_close (transport, NULL);
-
-  g_object_unref (client);
-  g_object_unref (protocol);
-  g_object_unref (transport);
-  g_object_unref (socket);
-}
-
-static void
-test_containers_with_default_values (void)
-{
-  TTestContainersWithDefaultValues *default_values;
-  GPtrArray *string_list;
-
-  /* Fetch a new ContainersWithDefaultValues struct and its StringList member */
-  default_values = g_object_new (T_TEST_TYPE_CONTAINERS_WITH_DEFAULT_VALUES,
-                                 NULL);
-  g_object_get (default_values,
-                "StringList", &string_list,
-                NULL);
-
-  /* Make sure the list has been populated with its default values */
-  g_assert_cmpint (string_list->len, ==, 2);
-  g_assert_cmpstr (((gchar **)string_list->pdata)[0], ==, "Apache");
-  g_assert_cmpstr (((gchar **)string_list->pdata)[1], ==, "Thrift");
-
-  g_ptr_array_unref (string_list);
-  g_object_unref (default_values);
-}
-
-static void
-test_container_service_string_list_inner (TTestContainerServiceIf *client,
-                                          GError **error)
-{
-  gchar *test_data[] = { "one", "two", "three" };
-
-  GPtrArray *outgoing_string_list;
-  GPtrArray *incoming_string_list;
-  guint index;
-
-  g_clear_error (error);
-
-  /* Prepare our test data (our string list to send) */
-  outgoing_string_list = g_ptr_array_new ();
-  for (index = 0; index < 3; index += 1)
-    g_ptr_array_add (outgoing_string_list, &test_data[index]);
-
-  /* Send our data to the server and make sure we get the same data back on
-     retrieve */
-  g_assert
-    (t_test_container_service_client_receive_string_list (client,
-                                                          outgoing_string_list,
-                                                          error) &&
-     *error == NULL);
-
-  incoming_string_list = g_ptr_array_new ();
-  g_assert
-    (t_test_container_service_client_return_string_list (client,
-                                                         &incoming_string_list,
-                                                         error) &&
-     *error == NULL);
-
-  /* Make sure the two lists are equivalent */
-  g_assert_cmpint (incoming_string_list->len, ==, outgoing_string_list->len);
-  for (index = 0; index < incoming_string_list->len; index += 1)
-    g_assert_cmpstr (((gchar **)incoming_string_list->pdata)[index],
-                     ==,
-                     ((gchar **)outgoing_string_list->pdata)[index]);
-
-  /* Clean up and exit */
-  g_ptr_array_unref (incoming_string_list);
-  g_ptr_array_unref (outgoing_string_list);
-}
-
-static void
-test_container_service_string_list (void)
-{
-    execute_with_service_client (test_container_service_string_list_inner);
-}
-
-static void
-test_container_service_list_string_list_inner (TTestContainerServiceIf *client,
-                                               GError **error)
-{
-  GPtrArray *incoming_list;
-  GPtrArray *nested_list;
-
-  g_clear_error (error);
-
-  /* Receive a list of string lists from the server */
-  incoming_list =
-    g_ptr_array_new_with_free_func ((GDestroyNotify)g_ptr_array_unref);
-  g_assert
-    (t_test_container_service_client_return_list_string_list (client,
-                                                              &incoming_list,
-                                                              error) &&
-     *error == NULL);
-
-  /* Make sure the list and its contents are valid */
-  g_assert_cmpint (incoming_list->len, >, 0);
-
-  nested_list = (GPtrArray *)g_ptr_array_index (incoming_list, 0);
-  g_assert (nested_list != NULL);
-  g_assert_cmpint (nested_list->len, >=, 0);
-
-  /* Clean up and exit */
-  g_ptr_array_unref (incoming_list);
-}
-
-static void
-test_container_service_list_string_list (void)
-{
-  execute_with_service_client (test_container_service_list_string_list_inner);
-}
-
-static void
-test_container_service_typedefd_list_string_list_inner (TTestContainerServiceIf *client,
-                                                        GError **error)
-{
-  TTestListStringList *incoming_list;
-  TTestStringList *nested_list;
-
-  g_clear_error (error);
-
-  /* Receive a list of string lists from the server */
-  incoming_list =
-    g_ptr_array_new_with_free_func ((GDestroyNotify)g_ptr_array_unref);
-  g_assert
-    (t_test_container_service_client_return_list_string_list (client,
-                                                              &incoming_list,
-                                                              error) &&
-     *error == NULL);
-
-  /* Make sure the list and its contents are valid */
-  g_assert_cmpint (incoming_list->len, >, 0);
-
-  nested_list = (TTestStringList *)g_ptr_array_index (incoming_list, 0);
-  g_assert (nested_list != NULL);
-  g_assert_cmpint (nested_list->len, >=, 0);
-
-  /* Clean up and exit */
-  g_ptr_array_unref (incoming_list);
-}
-
-static void
-test_container_service_typedefd_list_string_list (void)
-{
-  execute_with_service_client
-    (test_container_service_typedefd_list_string_list_inner);
-}
-
-int
-main(int argc, char *argv[])
-{
-  pid_t pid;
-  int status;
-
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init ();
-#endif
-
-  /* Fork to run our test suite in a child process */
-  pid = fork ();
-  g_assert_cmpint (pid, >=, 0);
-
-  if (pid == 0) {    /* The child process */
-    /* Wait a moment for the server to finish starting */
-    sleep (1);
-
-    g_test_init (&argc, &argv, NULL);
-
-    g_test_add_func
-      ("/testcontainertest/ContainerTest/Structs/ContainersWithDefaultValues",
-       test_containers_with_default_values);
-    g_test_add_func
-      ("/testcontainertest/ContainerTest/Services/ContainerService/StringList",
-       test_container_service_string_list);
-    g_test_add_func
-      ("/testcontainertest/ContainerTest/Services/ContainerService/ListStringList",
-       test_container_service_list_string_list);
-    g_test_add_func
-      ("/testcontainertest/ContainerTest/Services/ContainerService/TypedefdListStringList",
-       test_container_service_typedefd_list_string_list);
-
-    /* Run the tests and make the result available to our parent process */
-    _exit (g_test_run ());
-  }
-  else {
-    TTestContainerServiceHandler *handler;
-    TTestContainerServiceProcessor *processor;
-
-    ThriftServerTransport *server_transport;
-    ThriftTransportFactory *transport_factory;
-    ThriftProtocolFactory *protocol_factory;
-
-    struct sigaction sigchld_action;
-
-    GError *error = NULL;
-    int exit_status = 1;
-
-    /* Trap the event of the child process terminating so we know to stop the
-       server and exit */
-    memset (&sigchld_action, 0, sizeof (sigchld_action));
-    sigchld_action.sa_handler = sigchld_handler;
-    sigchld_action.sa_flags = SA_RESETHAND;
-    sigaction (SIGCHLD, &sigchld_action, NULL);
-
-    /* Create our test server */
-    handler = g_object_new (TYPE_TEST_CONTAINER_SERVICE_HANDLER,
-                            NULL);
-    processor = g_object_new (T_TEST_TYPE_CONTAINER_SERVICE_PROCESSOR,
-                              "handler", handler,
-                              NULL);
-    server_transport = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                     "port", TEST_SERVER_PORT,
-                                     NULL);
-    transport_factory = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY,
-                                      NULL);
-    protocol_factory = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL_FACTORY,
-                                     NULL);
-
-    server = g_object_new (THRIFT_TYPE_SIMPLE_SERVER,
-                           "processor",                processor,
-                           "server_transport",         server_transport,
-                           "input_transport_factory",  transport_factory,
-                           "output_transport_factory", transport_factory,
-                           "input_protocol_factory",   protocol_factory,
-                           "output_protocol_factory",  protocol_factory,
-                           NULL);
-
-    /* Start the server */
-    thrift_server_serve (server, &error);
-
-    /* Make sure the server stopped only because it was interrupted (by the
-       child process terminating) */
-    g_assert (g_error_matches (error,
-                               THRIFT_SERVER_SOCKET_ERROR,
-                               THRIFT_SERVER_SOCKET_ERROR_ACCEPT));
-
-    /* Free our resources */
-    g_object_unref (server);
-    g_object_unref (transport_factory);
-    g_object_unref (protocol_factory);
-    g_object_unref (server_transport);
-
-    g_object_unref (processor);
-    g_object_unref (handler);
-
-    /* Wait for the child process to complete and return its exit status */
-    g_assert (wait (&status) == pid);
-    if (WIFEXITED (status))
-      exit_status = WEXITSTATUS (status);
-
-    return exit_status;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testdebugproto.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testdebugproto.c b/depends/thirdparty/thrift/lib/c_glib/test/testdebugproto.c
deleted file mode 100644
index 703dff0..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testdebugproto.c
+++ /dev/null
@@ -1,938 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <math.h>
-#include <string.h>
-#include <glib-object.h>
-
-#ifndef M_PI
-#define M_PI 3.1415926535897932385
-#endif
-
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-
-#include "gen-c_glib/t_test_debug_proto_test_types.h"
-#include "gen-c_glib/t_test_srv.h"
-#include "gen-c_glib/t_test_inherited.h"
-
-static void
-test_structs_doubles_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A Doubles structure can be created... */
-  object = g_object_new (T_TEST_TYPE_DOUBLES, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_DOUBLES (object));
-
-  /* ...and destroyed */
-  g_object_unref (object);
-}
-
-static void
-test_structs_doubles_initialize (void)
-{
-  TTestDoubles *doubles = NULL;
-  gdouble nan;
-  gdouble inf;
-  gdouble neginf;
-  gdouble repeating;
-  gdouble big;
-  gdouble tiny;
-  gdouble zero;
-  gdouble negzero;
-
-  /* Note there seems to be no way to get not-a-number ("NAN") values past
-     GObject's range-checking, so that portion of the test has been commented
-     out below. */
-
-  /* A Doubles structure's members are available as GObject properties
-     that can be initialized at construction... */
-  doubles = g_object_new (T_TEST_TYPE_DOUBLES,
-                          /* "nan",      0 * INFINITY, */
-                          "inf",          INFINITY,
-                          "neginf",      -INFINITY,
-                          "repeating",     1.0 / 3,
-                          "big",       G_MAXDOUBLE,
-                          "tiny",          10E-101,
-                          "zero",          1.0 * 0,
-                          "negzero",      -1.0 * 0,
-                          NULL);
-
-  g_assert (doubles != NULL);
-
-  /* ...and later retrieved */
-  g_object_get (doubles,
-                "nan",       &nan,
-                "inf",       &inf,
-                "neginf",    &neginf,
-                "repeating", &repeating,
-                "big",       &big,
-                "tiny",      &tiny,
-                "zero",      &zero,
-                "negzero",   &negzero,
-                NULL);
-
-  /* g_assert_cmpint (isnan (nan),    !=,  0); */
-  g_assert_cmpint (isinf (inf),    ==,  1);
-  g_assert_cmpint (isinf (neginf), ==, -1);
-
-  g_assert_cmpfloat (repeating, ==,     1.0 / 3);
-  g_assert_cmpfloat (big,       ==, G_MAXDOUBLE);
-  g_assert_cmpfloat (tiny,      ==,     10E-101);
-  g_assert_cmpfloat (zero,      ==,     1.0 * 0);
-  g_assert_cmpfloat (negzero,   ==,    -1.0 * 0);
-
-  g_object_unref (doubles);
-}
-
-static void
-test_structs_one_of_each_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A OneOfEach structure can be created... */
-  object = g_object_new (T_TEST_TYPE_ONE_OF_EACH, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_ONE_OF_EACH (object));
-
-  /* ...and destroyed */
-  g_object_unref (object);
-}
-
-static void
-test_structs_one_of_each_initialize_default_values (void)
-{
-  TTestOneOfEach *one_of_each = NULL;
-  gint   a_bite;
-  gint   integer16;
-  gint64 integer64;
-  GArray *byte_list;
-  GArray *i16_list;
-  GArray *i64_list;
-
-  /* A OneOfEach structure created with no explicit property values
-     will hold the default values specified in the .thrift file */
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH, NULL);
-
-  g_object_get (one_of_each,
-                "a_bite",    &a_bite,
-                "integer16", &integer16,
-                "integer64", &integer64,
-                "byte_list", &byte_list,
-                "i16_list",  &i16_list,
-                "i64_list",  &i64_list,
-                NULL);
-
-  g_assert_cmpint (a_bite,    ==, 0x7f);
-  g_assert_cmpint (integer16, ==, 0x7fff);
-  g_assert_cmpint (integer64, ==, 10000000000);
-
-  g_assert (byte_list != NULL);
-  g_assert_cmpint (byte_list->len, ==, 3);
-  g_assert_cmpint (g_array_index (byte_list, gint8, 0), ==, 1);
-  g_assert_cmpint (g_array_index (byte_list, gint8, 1), ==, 2);
-  g_assert_cmpint (g_array_index (byte_list, gint8, 2), ==, 3);
-
-  g_assert (i16_list != NULL);
-  g_assert_cmpint (i16_list->len, ==, 3);
-  g_assert_cmpint (g_array_index (i16_list, gint16, 0), ==, 1);
-  g_assert_cmpint (g_array_index (i16_list, gint16, 1), ==, 2);
-  g_assert_cmpint (g_array_index (i16_list, gint16, 2), ==, 3);
-
-  g_assert (i64_list != NULL);
-  g_assert_cmpint (i64_list->len, ==, 3);
-  g_assert_cmpint (g_array_index (i64_list, gint64, 0), ==, 1);
-  g_assert_cmpint (g_array_index (i64_list, gint64, 1), ==, 2);
-  g_assert_cmpint (g_array_index (i64_list, gint64, 2), ==, 3);
-
-  g_array_unref (i64_list);
-  g_array_unref (i16_list);
-  g_array_unref (byte_list);
-  g_object_unref (one_of_each);
-}
-
-static void
-test_structs_one_of_each_initialize_specified_values (void)
-{
-  static const gint8 initial_byte_list[5] = { 13, 21, 34, 55, 89 };
-  static const gint16 initial_i16_list[5] = { 4181, 6765, 10946, 17711, 28657 };
-  static const gint64 initial_i64_list[5] =
-    {
-      1100087778366101931, 1779979416004714189, 2880067194370816120,
-      4660046610375530309, 7540113804746346429
-    };
-  static const guint8 initial_base64[8] =
-    {
-      0x56, 0x47, 0x68, 0x79, 0x61, 0x57, 0x5a, 0x30
-    };
-
-  TTestOneOfEach *one_of_each;
-  gboolean im_true;
-  gboolean im_false;
-  gint a_bite;
-  gint integer16;
-  gint integer32;
-  gint64 integer64;
-  double double_precision;
-  gchar *some_characters;
-  gchar *zomg_unicode;
-  gboolean what_who;
-  GByteArray *base64;
-  GArray *byte_list;
-  GArray *i16_list;
-  GArray *i64_list;
-
-  base64 = g_byte_array_new ();
-  g_byte_array_append (base64, initial_base64, 8);
-
-  byte_list = g_array_new (FALSE, FALSE, sizeof (gint8));
-  g_array_append_vals (byte_list, initial_byte_list, 5);
-
-  i16_list = g_array_new (FALSE, FALSE, sizeof (gint16));
-  g_array_append_vals (i16_list, initial_i16_list, 5);
-
-  i64_list = g_array_new (FALSE, FALSE, sizeof (gint64));
-  g_array_append_vals (i64_list, initial_i64_list, 5);
-
-  /* All of OneOfEach's properties can be set at construction... */
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH,
-                              "im_true",          TRUE,
-                              "im_false",         FALSE,
-                              "a_bite",           0x50,
-                              "integer16",        0x7e57,
-                              "integer32",        0xdeadbeef,
-                              "integer64",        0xfa15efacade15bad,
-                              "double_precision", M_PI,
-                              "some_characters",  "Debug THIS!",
-                              "zomg_unicode",     "\xd7\n\a\t",
-                              "what_who",         TRUE,
-                              "base64",           base64,
-                              "byte_list",        byte_list,
-                              "i16_list",         i16_list,
-                              "i64_list",         i64_list,
-                              NULL);
-  g_assert (one_of_each != NULL);
-
-  g_array_unref (i64_list);
-  i64_list = NULL;
-  g_array_unref (i16_list);
-  i16_list = NULL;
-  g_array_unref (byte_list);
-  byte_list = NULL;
-  g_byte_array_unref (base64);
-  base64 = NULL;
-
-  /* ...and later retrieved */
-  g_object_get (one_of_each,
-                "im_true",          &im_true,
-                "im_false",         &im_false,
-                "a_bite",           &a_bite,
-                "integer16",        &integer16,
-                "integer32",        &integer32,
-                "integer64",        &integer64,
-                "double_precision", &double_precision,
-                "some_characters",  &some_characters,
-                "zomg_unicode",     &zomg_unicode,
-                "what_who",         &what_who,
-                "base64",           &base64,
-                "byte_list",        &byte_list,
-                "i16_list",         &i16_list,
-                "i64_list",         &i64_list,
-                NULL);
-
-  g_assert (im_true  == TRUE);
-  g_assert (im_false == FALSE);
-
-  g_assert_cmphex (a_bite,    ==, 0x50);
-  g_assert_cmphex (integer16, ==, 0x7e57);
-  g_assert_cmphex (integer32, ==, (gint32)0xdeadbeef);
-  g_assert_cmphex (integer64, ==, 0xfa15efacade15bad);
-
-  g_assert_cmpfloat (double_precision, ==, M_PI);
-
-  g_assert_cmpstr (some_characters, ==, "Debug THIS!");
-  g_assert_cmpstr (zomg_unicode,    ==, "\xd7\n\a\t");
-
-  g_assert (what_who == TRUE);
-
-  g_assert_cmpint (base64->len, ==, 8);
-  g_assert_cmpint (memcmp (base64->data,
-                           initial_base64,
-                           8 * sizeof (guint8)), ==, 0);
-
-  g_assert_cmpint (byte_list->len, ==, 5);
-  g_assert_cmpint (memcmp (byte_list->data,
-                           initial_byte_list,
-                           5 * sizeof (gint8)),  ==, 0);
-
-  g_assert_cmpint (i16_list->len, ==, 5);
-  g_assert_cmpint (memcmp (i16_list->data,
-                           initial_i16_list,
-                           5 * sizeof (gint16)), ==, 0);
-
-  g_assert_cmpint (i64_list->len, ==, 5);
-  g_assert_cmpint (memcmp (i64_list->data,
-                           initial_i64_list,
-                           5 * sizeof (gint64)), ==, 0);
-
-  g_array_unref (i64_list);
-  g_array_unref (i16_list);
-  g_array_unref (byte_list);
-  g_byte_array_unref (base64);
-
-  g_object_unref (one_of_each);
-}
-
-static void
-test_structs_one_of_each_properties_byte_list (void)
-{
-  TTestOneOfEach *one_of_each;
-  GArray *byte_list = NULL;
-
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH, NULL);
-
-  /* OneOfEach's "byte_list" member is a list that holds eight-bit-wide integer
-     values */
-  g_object_get (one_of_each, "byte_list", &byte_list, NULL);
-
-  g_assert (byte_list != NULL);
-  g_assert_cmpint (g_array_get_element_size (byte_list), ==, sizeof (gint8));
-
-  g_array_unref (byte_list);
-  g_object_unref (one_of_each);
-}
-
-static void
-test_structs_one_of_each_properties_i16_list (void)
-{
-  TTestOneOfEach *one_of_each;
-  GArray *i16_list = NULL;
-
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH, NULL);
-
-  /* OneOfEach's "i16_list" member is a list that holds sixteen-bit-wide integer
-     values */
-  g_object_get (one_of_each, "i16_list", &i16_list, NULL);
-
-  g_assert (i16_list != NULL);
-  g_assert_cmpint (g_array_get_element_size (i16_list), ==, sizeof (gint16));
-
-  g_array_unref (i16_list);
-  g_object_unref (one_of_each);
-}
-
-static void
-test_structs_one_of_each_properties_i64_list (void)
-{
-  TTestOneOfEach *one_of_each;
-  GArray *i64_list = NULL;
-
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH, NULL);
-
-  /* OneOfEach's "i64_list" member is a list that holds sixty-four-bit-wide
-     integer values */
-  g_object_get (one_of_each, "i64_list", &i64_list, NULL);
-
-  g_assert (i64_list != NULL);
-  g_assert_cmpint (g_array_get_element_size (i64_list), ==, sizeof (gint64));
-
-  g_array_unref (i64_list);
-  g_object_unref (one_of_each);
-}
-
-static void
-test_structs_nesting_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A Nesting structure can be created... */
-  object = g_object_new (T_TEST_TYPE_NESTING, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_NESTING (object));
-
-  /* ...and destroyed */
-  g_object_unref (object);
-}
-
-static void
-test_structs_nesting_properties_my_bonk (void)
-{
-  TTestNesting *nesting;
-  TTestBonk *bonk = NULL;
-  gint type;
-  gchar *message;
-
-  nesting = g_object_new (T_TEST_TYPE_NESTING, NULL);
-
-  /* Nesting's "my_bonk" member is initialized with a new, default Bonk object
-     during construction */
-  g_object_get (nesting, "my_bonk", &bonk, NULL);
-
-  g_assert (bonk != NULL);
-  g_assert (T_TEST_IS_BONK (bonk));
-
-  g_object_get (bonk,
-                "type",    &type,
-                "message", &message,
-                NULL);
-
-  g_assert_cmpint (type, ==, 0);
-  g_assert (message == NULL);
-
-  g_object_unref (bonk);
-  bonk = NULL;
-
-  /* It can be replaced... */
-  bonk = g_object_new (T_TEST_TYPE_BONK,
-                       "type",    100,
-                       "message", "Replacement Bonk",
-                       NULL);
-  g_object_set (nesting, "my_bonk", bonk, NULL);
-  g_object_unref (bonk);
-  bonk = NULL;
-
-  g_object_get (nesting, "my_bonk", &bonk, NULL);
-
-  g_assert (bonk != NULL);
-  g_assert (T_TEST_IS_BONK (bonk));
-
-  g_object_get (bonk,
-                "type",    &type,
-                "message", &message,
-                NULL);
-
-  g_assert_cmpint (type, ==, 100);
-  g_assert_cmpstr (message, ==, "Replacement Bonk");
-
-  g_free (message);
-  g_object_unref (bonk);
-  bonk = NULL;
-
-  /* ...or set to null */
-  g_object_set (nesting, "my_bonk", NULL, NULL);
-  g_object_get (nesting, "my_bonk", &bonk, NULL);
-
-  g_assert (bonk == NULL);
-
-  g_object_unref (nesting);
-}
-
-static void
-test_structs_nesting_properties_my_ooe (void)
-{
-  TTestNesting *nesting;
-  TTestOneOfEach *one_of_each = NULL;
-  gint a_bite;
-  gint integer16;
-
-  nesting = g_object_new (T_TEST_TYPE_NESTING, NULL);
-
-  /* Nesting's "my_ooe" member is initialized with a new, default OneOfEach
-     object during construction */
-  g_object_get (nesting, "my_ooe", &one_of_each, NULL);
-
-  g_assert (one_of_each != NULL);
-  g_assert (T_TEST_IS_ONE_OF_EACH (one_of_each));
-
-  g_object_get (one_of_each,
-                "a_bite",    &a_bite,
-                "integer16", &integer16,
-                NULL);
-
-  g_assert_cmphex (a_bite,    ==, 0x7f);
-  g_assert_cmphex (integer16, ==, 0x7fff);
-
-  g_object_unref (one_of_each);
-  one_of_each = NULL;
-
-  /* It can be replaced... */
-  one_of_each = g_object_new (T_TEST_TYPE_ONE_OF_EACH,
-                              "a_bite",    0x50,
-                              "integer16", 0x5050,
-                              NULL);
-  g_object_set (nesting, "my_ooe", one_of_each, NULL);
-  g_object_unref (one_of_each);
-  one_of_each = NULL;
-
-  g_object_get (nesting, "my_ooe", &one_of_each, NULL);
-
-  g_assert (one_of_each != NULL);
-  g_assert (T_TEST_IS_ONE_OF_EACH (one_of_each));
-
-  g_object_get (one_of_each,
-                "a_bite",    &a_bite,
-                "integer16", &integer16,
-                NULL);
-
-  g_assert_cmphex (a_bite,    ==, 0x50);
-  g_assert_cmphex (integer16, ==, 0x5050);
-
-  g_object_unref (one_of_each);
-  one_of_each = NULL;
-
-  /* ...or set to null */
-  g_object_set (nesting, "my_ooe", NULL, NULL);
-  g_object_get (nesting, "my_ooe", &one_of_each, NULL);
-
-  g_assert (one_of_each == NULL);
-
-  g_object_unref (nesting);
-}
-
-static void
-test_structs_holy_moley_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A HolyMoley structure can be created... */
-  object = g_object_new (T_TEST_TYPE_HOLY_MOLEY, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_HOLY_MOLEY (object));
-
-  /* ...and destroyed */
-  g_object_unref (object);
-}
-
-static void
-test_structs_holy_moley_properties_big (void)
-{
-  TTestHolyMoley *holy_moley;
-  GPtrArray *big = NULL;
-  gint a_bite = 0;
-  gint integer16 = 0;
-
-  holy_moley = g_object_new (T_TEST_TYPE_HOLY_MOLEY, NULL);
-
-  /* A HolyMoley's "big" member is is initialized on construction */
-  g_object_get (holy_moley, "big", &big, NULL);
-
-  g_assert (big != NULL);
-  g_assert_cmpint (big->len, ==, 0);
-
-  /* It can be modified... */
-  g_ptr_array_add (big,
-                   g_object_new (T_TEST_TYPE_ONE_OF_EACH,
-                                 "a_bite",    0x50,
-                                 "integer16", 0x5050,
-                                 NULL));
-
-  g_ptr_array_unref (big);
-  big = NULL;
-
-  g_object_get (holy_moley, "big", &big, NULL);
-
-  g_assert_cmpint (big->len, ==, 1);
-  g_object_get (g_ptr_array_index (big, 0),
-                "a_bite",    &a_bite,
-                "integer16", &integer16,
-                NULL);
-
-  g_assert_cmphex (a_bite,    ==, 0x50);
-  g_assert_cmphex (integer16, ==, 0x5050);
-
-  g_ptr_array_unref (big);
-  big = NULL;
-
-  /* ...replaced... */
-  big = g_ptr_array_new_with_free_func (g_object_unref);
-  g_ptr_array_add (big,
-                   g_object_new (T_TEST_TYPE_ONE_OF_EACH,
-                                 "a_bite",    0x64,
-                                 "integer16", 0x1541,
-                                 NULL));
-
-  g_object_set (holy_moley, "big", big, NULL);
-
-  g_ptr_array_unref (big);
-  big = NULL;
-
-  g_object_get (holy_moley, "big", &big, NULL);
-
-  g_assert_cmpint (big->len, ==, 1);
-  g_object_get (g_ptr_array_index (big, 0),
-                "a_bite",    &a_bite,
-                "integer16", &integer16,
-                NULL);
-
-  g_assert_cmphex (a_bite,    ==, 0x64);
-  g_assert_cmphex (integer16, ==, 0x1541);
-
-  g_ptr_array_unref (big);
-  big = NULL;
-
-  /* ...or set to NULL */
-  g_object_set (holy_moley, "big", NULL, NULL);
-  g_object_get (holy_moley, "big", &big, NULL);
-
-  g_assert (big == NULL);
-
-  g_object_unref (holy_moley);
-}
-
-static void
-test_structs_holy_moley_properties_contain (void)
-{
-  static gchar *strings[2] = { "Apache", "Thrift" };
-
-  TTestHolyMoley *holy_moley;
-  GHashTable *contain = NULL;
-  GPtrArray *string_list;
-  GList *key_list;
-
-  holy_moley = g_object_new (T_TEST_TYPE_HOLY_MOLEY, NULL);
-
-  /* A HolyMoley's "contain" member is initialized on construction */
-  g_object_get (holy_moley, "contain", &contain, NULL);
-
-  g_assert (contain != NULL);
-  g_assert_cmpint (g_hash_table_size (contain), ==, 0);
-
-  /* It can be modified... */
-  string_list = g_ptr_array_new ();
-  g_ptr_array_add (string_list, strings[0]);
-  g_ptr_array_add (string_list, strings[1]);
-
-  g_hash_table_insert (contain, string_list, NULL);
-  string_list = NULL;
-
-  g_hash_table_unref (contain);
-  contain = NULL;
-
-  g_object_get (holy_moley, "contain", &contain, NULL);
-
-  g_assert_cmpint (g_hash_table_size (contain), ==, 1);
-
-  key_list = g_hash_table_get_keys (contain);
-  string_list = g_list_nth_data (key_list, 0);
-
-  g_assert_cmpint (string_list->len, ==, 2);
-  g_assert_cmpstr (g_ptr_array_index (string_list, 0), ==, "Apache");
-  g_assert_cmpstr (g_ptr_array_index (string_list, 1), ==, "Thrift");
-
-  g_list_free (key_list);
-  g_hash_table_unref (contain);
-  contain = NULL;
-
-  /* ...replaced... */
-  contain = g_hash_table_new_full (g_direct_hash,
-                                   g_direct_equal,
-                                   (GDestroyNotify) g_ptr_array_unref,
-                                   NULL);
-  g_object_set (holy_moley, "contain", contain, NULL);
-  g_hash_table_unref (contain);
-  contain = NULL;
-
-  g_object_get (holy_moley, "contain", &contain, NULL);
-
-  g_assert_cmpint (g_hash_table_size (contain), ==, 0);
-
-  g_hash_table_unref (contain);
-  contain = NULL;
-
-  /* ...or set to NULL */
-  g_object_set (holy_moley, "contain", NULL, NULL);
-  g_object_get (holy_moley, "contain", &contain, NULL);
-
-  g_assert (contain == NULL);
-
-  g_object_unref (holy_moley);
-}
-
-static void
-test_structs_holy_moley_properties_bonks (void)
-{
-  TTestHolyMoley *holy_moley;
-  GHashTable *bonks = NULL;
-  GPtrArray *bonk_list = NULL;
-  TTestBonk *bonk = NULL;
-  gint type;
-  gchar *message;
-  GList *key_list;
-
-  holy_moley = g_object_new (T_TEST_TYPE_HOLY_MOLEY, NULL);
-
-  /* A HolyMoley's "bonks" member is initialized on construction */
-  g_object_get (holy_moley, "bonks", &bonks, NULL);
-
-  g_assert (bonks != NULL);
-  g_assert_cmpint (g_hash_table_size (bonks), ==, 0);
-
-  /* It can be modified... */
-  bonk = g_object_new (T_TEST_TYPE_BONK,
-                       "type",    100,
-                       "message", "Sample Bonk",
-                       NULL);
-  bonk_list = g_ptr_array_new_with_free_func (g_object_unref);
-  g_ptr_array_add (bonk_list, bonk);
-  bonk = NULL;
-
-  g_hash_table_insert (bonks, g_strdup ("Sample Bonks"), bonk_list);
-  bonk_list = NULL;
-
-  g_hash_table_unref (bonks);
-  bonks = NULL;
-
-  g_object_get (holy_moley, "bonks", &bonks, NULL);
-
-  g_assert_cmpint (g_hash_table_size (bonks), ==, 1);
-
-  key_list = g_hash_table_get_keys (bonks);
-  bonk_list = g_hash_table_lookup (bonks, g_list_nth_data (key_list, 0));
-
-  g_assert_cmpint (bonk_list->len, ==, 1);
-
-  bonk = (g_ptr_array_index (bonk_list, 0));
-  g_object_get (bonk,
-                "type",    &type,
-                "message", &message,
-                NULL);
-
-  g_assert_cmpint (type, ==, 100);
-  g_assert_cmpstr (message, ==, "Sample Bonk");
-
-  bonk = NULL;
-  g_free (message);
-  g_list_free (key_list);
-  g_hash_table_unref (bonks);
-  bonks = NULL;
-
-  /* ...replaced... */
-  bonks = g_hash_table_new_full (g_str_hash,
-                                 g_str_equal,
-                                 g_free,
-                                 (GDestroyNotify) g_ptr_array_unref);
-  g_object_set (holy_moley, "bonks", bonks, NULL);
-  g_hash_table_unref (bonks);
-  bonks = NULL;
-
-  g_object_get (holy_moley, "bonks", &bonks, NULL);
-
-  g_assert_cmpint (g_hash_table_size (bonks), ==, 0);
-
-  g_hash_table_unref (bonks);
-  bonks = NULL;
-
-  /* ...or set to NULL */
-  g_object_set (holy_moley, "bonks", NULL, NULL);
-  g_object_get (holy_moley, "bonks", &bonks, NULL);
-
-  g_assert (bonks == NULL);
-
-  g_object_unref (holy_moley);
-}
-
-static void
-test_structs_empty (void)
-{
-  GObject *object = NULL;
-  GParamSpec **properties;
-  guint property_count;
-
-  /* An Empty structure can be created */
-  object = g_object_new (T_TEST_TYPE_EMPTY, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_EMPTY (object));
-
-  /* An Empty structure has no members and thus no properties */
-  properties = g_object_class_list_properties (G_OBJECT_GET_CLASS (object),
-                                               &property_count);
-  g_assert_cmpint (property_count, ==, 0);
-  g_free (properties);
-
-  /* An Empty structure can be destroyed  */
-  g_object_unref (object);
-}
-
-static void
-test_structs_wrapper_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A Wrapper structure can be created... */
-  object = g_object_new (T_TEST_TYPE_EMPTY, NULL);
-
-  g_assert (object != NULL);
-  g_assert (T_TEST_IS_EMPTY (object));
-
-  /* ...and destroyed  */
-  g_object_unref (object);
-}
-
-static void
-test_structs_wrapper_properties_foo (void) {
-  TTestWrapper *wrapper;
-  TTestEmpty *foo;
-
-  wrapper = g_object_new (T_TEST_TYPE_WRAPPER, NULL);
-
-  /* A Wrapper structure has one member, "foo", which is an Empty
-     structure initialized during construction */
-  g_object_get (wrapper, "foo", &foo, NULL);
-
-  g_assert (foo != NULL);
-  g_assert (T_TEST_IS_EMPTY (foo));
-
-  g_object_unref (foo);
-  foo = NULL;
-
-  /* A Wrapper's foo property can be replaced... */
-  foo = g_object_new (T_TEST_TYPE_EMPTY, NULL);
-  g_object_set (wrapper, "foo", foo, NULL);
-
-  g_object_unref (foo);
-  foo = NULL;
-
-  g_object_get (wrapper, "foo", &foo, NULL);
-  g_assert (foo != NULL);
-  g_assert (T_TEST_IS_EMPTY (foo));
-
-  g_object_unref (foo);
-  foo = NULL;
-
-  /* ...or set to NULL */
-  g_object_set (wrapper, "foo", NULL, NULL);
-  g_object_get (wrapper, "foo", &foo, NULL);
-
-  g_assert (foo == NULL);
-
-  g_object_unref (wrapper);
-}
-
-static void
-test_services_inherited (void)
-{
-  ThriftProtocol *protocol;
-  TTestInheritedClient *inherited_client;
-  GObject *input_protocol, *output_protocol;
-
-  protocol = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, NULL);
-  inherited_client = g_object_new (T_TEST_TYPE_INHERITED_CLIENT,
-                                   NULL);
-
-  /* TTestInheritedClient inherits from TTestSrvClient */
-  assert (g_type_is_a (T_TEST_TYPE_INHERITED_CLIENT,
-                       T_TEST_TYPE_SRV_CLIENT));
-
-  /* TTestInheritedClient implements TTestSrvClient's interface */
-  assert (g_type_is_a (T_TEST_TYPE_INHERITED_CLIENT,
-                       T_TEST_TYPE_SRV_IF));
-
-  /* TTestInheritedClient's inherited properties can be set and retrieved */
-  g_object_set (inherited_client,
-                "input_protocol", protocol,
-                "output_protocol", protocol,
-                NULL);
-
-  g_object_get (inherited_client,
-                "input_protocol", &input_protocol,
-                "output_protocol", &output_protocol,
-                NULL);
-
-  assert (input_protocol == G_OBJECT(protocol));
-  assert (output_protocol == G_OBJECT(protocol));
-
-  g_object_unref (output_protocol);
-  g_object_unref (input_protocol);
-  g_object_unref (inherited_client);
-  g_object_unref (protocol);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init ();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Doubles/CreateAndDestroy",
-     test_structs_doubles_create_and_destroy);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Doubles/Initialize",
-     test_structs_doubles_initialize);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/CreateAndDestroy",
-     test_structs_one_of_each_create_and_destroy);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/Initialize/DefaultValues",
-     test_structs_one_of_each_initialize_default_values);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/Initialize/SpecifiedValues",
-     test_structs_one_of_each_initialize_specified_values);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/Properties/byte_list",
-     test_structs_one_of_each_properties_byte_list);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/Properties/i16_list",
-     test_structs_one_of_each_properties_i16_list);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/OneOfEach/Properties/i64_list",
-     test_structs_one_of_each_properties_i64_list);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Nesting/CreateAndDestroy",
-     test_structs_nesting_create_and_destroy);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Nesting/Properties/my_bonk",
-     test_structs_nesting_properties_my_bonk);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Nesting/Properties/my_ooe",
-     test_structs_nesting_properties_my_ooe);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/HolyMoley/CreateAndDestroy",
-     test_structs_holy_moley_create_and_destroy);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/HolyMoley/Properties/big",
-     test_structs_holy_moley_properties_big);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/HolyMoley/Properties/contain",
-     test_structs_holy_moley_properties_contain);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/HolyMoley/Properties/bonks",
-     test_structs_holy_moley_properties_bonks);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Empty",
-     test_structs_empty);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Wrapper/CreateAndDestroy",
-     test_structs_wrapper_create_and_destroy);
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Structs/Wrapper/Properties/foo",
-     test_structs_wrapper_properties_foo);
-
-  g_test_add_func
-    ("/testdebugproto/DebugProto/Services/Inherited",
-     test_services_inherited);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testframedtransport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testframedtransport.c b/depends/thirdparty/thrift/lib/c_glib/test/testframedtransport.c
deleted file mode 100755
index d50ff23..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testframedtransport.c
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <sys/wait.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
-
-#include "../src/thrift/c_glib/transport/thrift_framed_transport.c"
-
-static void thrift_server (const int port);
-
-/* test object creation and destruction */
-static void
-test_create_and_destroy(void)
-{
-  ThriftTransport *transport = NULL;
-  guint r_buf_size = 0;
-  guint w_buf_size = 0;
-
-  GObject *object = NULL;
-  object = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT, NULL);
-  assert (object != NULL);
-  g_object_get (G_OBJECT (object), "transport", &transport,
-                "r_buf_size", &r_buf_size,
-                "w_buf_size", &w_buf_size, NULL);
-  g_object_unref (object);
-}
-
-static void
-test_open_and_close(void)
-{
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  GError *err = NULL;
-
-  /* create a ThriftSocket */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                          "port", 51188, NULL); 
-
-  /* create a BufferedTransport wrapper of the Socket */
-  transport = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT,
-                            "transport", THRIFT_TRANSPORT (tsocket), NULL);
-
-  /* this shouldn't work */
-  assert (thrift_framed_transport_open (transport, NULL) == FALSE);
-  assert (thrift_framed_transport_is_open (transport) == TRUE);
-  assert (thrift_framed_transport_close (transport, NULL) == TRUE);
-  g_object_unref (transport);
-  g_object_unref (tsocket);
-
-  /* try and underlying socket failure */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost.broken",
-                          NULL);
-
-  /* create a BufferedTransport wrapper of the Socket */
-  transport = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT,
-                            "transport", THRIFT_TRANSPORT (tsocket), NULL);
-
-  assert (thrift_framed_transport_open (transport, &err) == FALSE);
-  g_object_unref (transport);
-  g_object_unref (tsocket);
-  g_error_free (err);
-  err = NULL;
-}
-
-static void
-test_read_and_write(void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  int port = 51199;
-  guchar buf[10] = TEST_DATA; /* a buffer */
-
-  pid = fork ();
-  assert ( pid >= 0 );
-
-  if ( pid == 0 )
-  {
-    /* child listens */
-    thrift_server (port);
-    exit (0);
-  } else {
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT,
-                              "transport", THRIFT_TRANSPORT (tsocket),
-                              "w_buf_size", 4, NULL);
-
-    assert (thrift_framed_transport_open (transport, NULL) == TRUE);
-    assert (thrift_framed_transport_is_open (transport));
-
-    /* write 10 bytes */
-    thrift_framed_transport_write (transport, buf, 10, NULL);
-    thrift_framed_transport_flush (transport, NULL);
-
-    thrift_framed_transport_write (transport, buf, 1, NULL);
-    thrift_framed_transport_flush (transport, NULL);
-
-    thrift_framed_transport_write (transport, buf, 10, NULL);
-    thrift_framed_transport_flush (transport, NULL);
-
-    thrift_framed_transport_write (transport, buf, 10, NULL);
-    thrift_framed_transport_flush (transport, NULL);
-
-    thrift_framed_transport_write_end (transport, NULL);
-    thrift_framed_transport_flush (transport, NULL);
-    thrift_framed_transport_close (transport, NULL);
-
-    g_object_unref (transport);
-    g_object_unref (tsocket);
-
-    assert ( wait (&status) == pid );
-    assert ( status == 0 );
-  }
-}
-
-/* test reading from the transport after the peer has unexpectedly
-   closed the connection */
-static void
-test_read_after_peer_close(void)
-{
-  int status;
-  pid_t pid;
-  int port = 51199;
-  GError *err = NULL;
-
-  pid = fork ();
-  g_assert (pid >= 0);
-
-  if (pid == 0)
-  {
-    ThriftServerTransport *server_transport = NULL;
-    ThriftTransport *client_transport = NULL;
-
-    /* child listens */
-    server_transport = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                     "port", port,
-                                     NULL);
-    g_assert (server_transport != NULL);
-
-    thrift_server_transport_listen (server_transport, &err);
-    g_assert (err == NULL);
-
-    /* wrap the client transport in a ThriftFramedTransport */
-    client_transport = g_object_new
-      (THRIFT_TYPE_FRAMED_TRANSPORT,
-       "transport",  thrift_server_transport_accept (server_transport, &err),
-       "r_buf_size", 0,
-       NULL);
-    g_assert (err == NULL);
-    g_assert (client_transport != NULL);
-
-    /* close the connection immediately after the client connects */
-    thrift_transport_close (client_transport, NULL);
-
-    g_object_unref (client_transport);
-    g_object_unref (server_transport);
-
-    exit (0);
-  } else {
-    ThriftSocket *tsocket = NULL;
-    ThriftTransport *transport = NULL;
-    guchar buf[10]; /* a buffer */
-
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET,
-                            "hostname", "localhost",
-                            "port",     port,
-                            NULL);
-    transport = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT,
-                              "transport",  THRIFT_TRANSPORT (tsocket),
-                              "w_buf_size", 0,
-                              NULL);
-
-    g_assert (thrift_transport_open (transport, NULL) == TRUE);
-    g_assert (thrift_transport_is_open (transport));
-
-    /* attempting to read from the transport after the peer has closed
-       the connection fails gracefully without generating a critical
-       warning or segmentation fault */
-    thrift_transport_read (transport, buf, 10, &err);
-    g_assert (err != NULL);
-
-    g_error_free (err);
-    err = NULL;
-
-    thrift_transport_read_end (transport, &err);
-    g_assert (err == NULL);
-
-    thrift_transport_close (transport, &err);
-    g_assert (err == NULL);
-
-    g_object_unref (transport);
-    g_object_unref (tsocket);
-
-    g_assert (wait (&status) == pid);
-    g_assert (status == 0);
-  }
-}
-
-static void
-thrift_server (const int port)
-{
-  int bytes = 0;
-  ThriftServerTransport *transport = NULL;
-  ThriftTransport *client = NULL;
-  guchar buf[12]; /* a buffer */
-  guchar match[10] = TEST_DATA;
-
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", port, NULL);
-
-  transport = THRIFT_SERVER_TRANSPORT (tsocket);
-  thrift_server_transport_listen (transport, NULL);
-
-  /* wrap the client in a BufferedTransport */
-  client = g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT, "transport",
-                         thrift_server_transport_accept (transport, NULL),
-                         "r_buf_size", 5, NULL);
-  assert (client != NULL);
-
-  /* read 10 bytes */
-  bytes = thrift_framed_transport_read (client, buf, 10, NULL);
-  assert (bytes == 10); /* make sure we've read 10 bytes */
-  assert ( memcmp (buf, match, 10) == 0 ); /* make sure what we got matches */
-
-  bytes = thrift_framed_transport_read (client, buf, 6, NULL);
-  bytes = thrift_framed_transport_read (client, buf, 5, NULL);
-  bytes = thrift_framed_transport_read (client, buf, 1, NULL);
-
-  bytes = thrift_framed_transport_read (client, buf, 12, NULL);
-
-  thrift_framed_transport_read_end (client, NULL);
-  thrift_framed_transport_close (client, NULL);
-  g_object_unref (client);
-  g_object_unref (tsocket);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testframedtransport/CreateAndDestroy", test_create_and_destroy);
-  g_test_add_func ("/testframedtransport/OpenAndClose", test_open_and_close);
-  g_test_add_func ("/testframedtransport/ReadAndWrite", test_read_and_write);
-  g_test_add_func ("/testframedtransport/ReadAfterPeerClose", test_read_after_peer_close);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testmemorybuffer.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testmemorybuffer.c b/depends/thirdparty/thrift/lib/c_glib/test/testmemorybuffer.c
deleted file mode 100755
index 5c75273..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testmemorybuffer.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
-
-#include "../src/thrift/c_glib/transport/thrift_memory_buffer.c"
-
-/* test object creation and destruction */
-static void
-test_create_and_destroy(void)
-{
-  GObject *object = NULL;
-  object = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, NULL);
-  assert (object != NULL);
-  g_object_unref (object);
-}
-
-static void
-test_open_and_close(void)
-{
-  ThriftMemoryBuffer *tbuffer = NULL;
-
-  /* create a ThriftMemoryBuffer */
-  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, NULL);
-
-  /* this shouldn't work */
-  assert (thrift_memory_buffer_open (THRIFT_TRANSPORT (tbuffer), NULL) == TRUE);
-  assert (thrift_memory_buffer_is_open (THRIFT_TRANSPORT (tbuffer)) == TRUE);
-  assert (thrift_memory_buffer_close (THRIFT_TRANSPORT (tbuffer), NULL) == TRUE);
-  g_object_unref (tbuffer);
-}
-
-static void
-test_read_and_write(void)
-{
-  ThriftMemoryBuffer *tbuffer = NULL;
-  guchar buf[10] = TEST_DATA;
-  guchar read[10];
-  GError *error = NULL;
-
-  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, "buf_size", 5, NULL);
-  assert (thrift_memory_buffer_write (THRIFT_TRANSPORT (tbuffer),
-                                      (gpointer) buf,
-                                      10, &error) == FALSE);
-  assert (error != NULL);
-  g_error_free (error);
-  error = NULL;
-  g_object_unref (tbuffer);
-
-  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, "buf_size", 15, NULL);
-  assert (thrift_memory_buffer_write (THRIFT_TRANSPORT (tbuffer),
-                                      (gpointer) buf, 10, &error) == TRUE);
-  assert (error == NULL);
-
-  assert (thrift_memory_buffer_read (THRIFT_TRANSPORT (tbuffer),
-                                     &read, 10, &error) > 0);
-  assert (error == NULL);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testmemorybuffer/CreateAndDestroy", test_create_and_destroy);
-  g_test_add_func ("/testmemorybuffer/OpenAndClose", test_open_and_close);
-  g_test_add_func ("/testmemorybuffer/ReadAndWrite", test_read_and_write);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testoptionalrequired.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testoptionalrequired.c b/depends/thirdparty/thrift/lib/c_glib/test/testoptionalrequired.c
deleted file mode 100755
index ae0c3d2..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testoptionalrequired.c
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <glib.h>
-
-#include <thrift/c_glib/thrift_struct.h>
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-#include <thrift/c_glib/transport/thrift_memory_buffer.h>
-#include "gen-c_glib/t_test_optional_required_test_types.h"
-
-#include "gen-c_glib/t_test_optional_required_test_types.c"
-
-static void
-write_to_read (ThriftStruct *w, ThriftStruct *r, GError **write_error,
-               GError **read_error)
-{
-  ThriftMemoryBuffer *tbuffer = NULL;
-  ThriftProtocol *protocol = NULL;
-
-  tbuffer = g_object_new (THRIFT_TYPE_MEMORY_BUFFER, NULL);
-  protocol = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                           tbuffer, NULL);
-
-  thrift_struct_write (w, protocol, write_error);
-  thrift_struct_read (r, protocol, read_error);
-
-  g_object_unref (protocol);
-  g_object_unref (tbuffer);
-}
-
-static void
-test_old_school1 (void)
-{
-  TTestOldSchool *o = NULL;
-
-  o = g_object_new (T_TEST_TYPE_OLD_SCHOOL, NULL);
-  o->im_int = 10;
-  o->im_str = g_strdup ("test");
-  o->im_big = g_ptr_array_new ();
-  g_ptr_array_free (o->im_big, TRUE);
-  o->im_big = NULL;
-  g_free (o->im_str);
-  o->im_str = NULL;
-  g_object_unref (o);
-}
-
-/**
- * Write to read with optional fields
- */
-static void
-test_simple (void)
-{
-  TTestSimple *s1 = NULL, *s2 = NULL, *s3 = NULL;
-
-  s1 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
-  s2 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
-  s3 = g_object_new (T_TEST_TYPE_SIMPLE, NULL);
-
-  /* write-to-read with optional fields */
-  s1->im_optional = 10;
-  assert (s1->__isset_im_default == FALSE);
-  assert (s1->__isset_im_optional == FALSE);  
-  write_to_read (THRIFT_STRUCT (s1), THRIFT_STRUCT (s2), NULL, NULL);
-  assert (s2->__isset_im_default = TRUE);
-  assert (s2->__isset_im_optional == FALSE);
-  assert (s2->im_optional == 0);
-
-  s1->__isset_im_optional = TRUE;
-  write_to_read (THRIFT_STRUCT (s1), THRIFT_STRUCT (s3), NULL, NULL);
-  assert (s3->__isset_im_default == TRUE);
-  assert (s3->__isset_im_optional == TRUE);
-  assert (s3->im_optional == 10);
-
-  g_object_unref (s1);
-  g_object_unref (s2);
-}
-
-/**
- * Writing between optional and default
- */
-static void
-test_tricky1 (void)
-{
-  TTestTricky1 *t1 = NULL;
-  TTestTricky2 *t2 = NULL;
-
-  t1 = g_object_new (T_TEST_TYPE_TRICKY1, NULL);
-  t2 = g_object_new (T_TEST_TYPE_TRICKY2, NULL);
-
-  t2->im_optional = 10;
-  write_to_read (THRIFT_STRUCT (t2), THRIFT_STRUCT (t1), NULL, NULL);
-  write_to_read (THRIFT_STRUCT (t1), THRIFT_STRUCT (t2), NULL, NULL);
-
-  assert (t1->__isset_im_default == FALSE);
-  assert (t2->__isset_im_optional == TRUE);
-  assert (t1->im_default == t2->im_optional);
-  assert (t1->im_default == 0);
-
-  g_object_unref (t1);
-  g_object_unref (t2);
-}
-
-/**
- * Writing between default and required.
- */
-static void
-test_tricky2 (void)
-{
-  TTestTricky1 *t1 = NULL;
-  TTestTricky3 *t3 = NULL;
-
-  t1 = g_object_new (T_TEST_TYPE_TRICKY1, NULL);
-  t3 = g_object_new (T_TEST_TYPE_TRICKY3, NULL);
-
-  write_to_read (THRIFT_STRUCT (t1), THRIFT_STRUCT (t3), NULL, NULL);
-  write_to_read (THRIFT_STRUCT (t3), THRIFT_STRUCT (t1), NULL, NULL);
-
-  assert (t1->__isset_im_default == TRUE);
-
-  g_object_unref (t1);
-  g_object_unref (t3);
-}
-
-/**
- * Writing between optional and required.
- */
-static void
-test_tricky3 (void)
-{
-  TTestTricky2 *t2 = NULL;
-  TTestTricky3 *t3 = NULL;
-
-  t2 = g_object_new (T_TEST_TYPE_TRICKY2, NULL);
-  t3 = g_object_new (T_TEST_TYPE_TRICKY3, NULL);
-
-  t2->__isset_im_optional = TRUE;
-
-  write_to_read (THRIFT_STRUCT (t2), THRIFT_STRUCT (t3), NULL, NULL);
-  write_to_read (THRIFT_STRUCT (t3), THRIFT_STRUCT (t2), NULL, NULL);
-
-  g_object_unref (t2);
-  g_object_unref (t3);
-}
-
-/**
- * Catch an optional not set exception.  To quote the
- * C++ test, "Mu-hu-ha-ha-ha!"
- */
-static void
-test_tricky4 (void)
-{
-  TTestTricky2 *t2 = NULL;
-  TTestTricky3 *t3 = NULL;
-  GError *read_error = NULL;
-
-  t2 = g_object_new (T_TEST_TYPE_TRICKY2, NULL);
-  t3 = g_object_new (T_TEST_TYPE_TRICKY3, NULL);
-
-  /* throws protocol exception */
-  write_to_read (THRIFT_STRUCT (t2), THRIFT_STRUCT (t3), NULL, &read_error);
-  assert (read_error != NULL);
-  g_error_free (read_error);
-
-  write_to_read (THRIFT_STRUCT (t3), THRIFT_STRUCT (t2), NULL, NULL);
-
-  assert (t2->__isset_im_optional);
-
-  g_object_unref (t2);
-  g_object_unref (t3);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testoptionalrequired/OldSchool", test_old_school1);
-  g_test_add_func ("/testoptionalrequired/Simple", test_simple);
-  g_test_add_func ("/testoptionalrequired/Tricky1", test_tricky1);
-  g_test_add_func ("/testoptionalrequired/Tricky2", test_tricky2);
-  g_test_add_func ("/testoptionalrequired/Tricky3", test_tricky3);
-  g_test_add_func ("/testoptionalrequired/Tricky4", test_tricky4);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testsimpleserver.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testsimpleserver.c b/depends/thirdparty/thrift/lib/c_glib/test/testsimpleserver.c
deleted file mode 100755
index 3af2eeb..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testsimpleserver.c
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <glib.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/processor/thrift_processor.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_PORT 51199
-
-#include <thrift/c_glib/server/thrift_simple_server.c>
-
-/* create a rudimentary processor */
-#define TEST_PROCESSOR_TYPE (test_processor_get_type ())
-
-struct _TestProcessor
-{
-  ThriftProcessor parent;
-};
-typedef struct _TestProcessor TestProcessor;
-
-struct _TestProcessorClass
-{
-  ThriftProcessorClass parent;
-};
-typedef struct _TestProcessorClass TestProcessorClass;
-
-G_DEFINE_TYPE(TestProcessor, test_processor, THRIFT_TYPE_PROCESSOR)
-
-gboolean
-test_processor_process (ThriftProcessor *processor, ThriftProtocol *in,
-                        ThriftProtocol *out, GError **error)
-{
-  THRIFT_UNUSED_VAR (processor);
-  THRIFT_UNUSED_VAR (in);
-  THRIFT_UNUSED_VAR (out);
-  THRIFT_UNUSED_VAR (error);
-
-  return FALSE;
-}
-
-static void
-test_processor_init (TestProcessor *p)
-{
-  THRIFT_UNUSED_VAR (p);
-}
-
-static void
-test_processor_class_init (TestProcessorClass *proc)
-{
-  (THRIFT_PROCESSOR_CLASS(proc))->process = test_processor_process;
-}
-
-static void
-test_server (void)
-{
-  int status;
-  pid_t pid;
-  TestProcessor *p = NULL;
-  ThriftServerSocket *tss = NULL;
-  ThriftSimpleServer *ss = NULL;
-
-  p = g_object_new (TEST_PROCESSOR_TYPE, NULL);
-  tss = g_object_new (THRIFT_TYPE_SERVER_SOCKET, "port", TEST_PORT, NULL);
-  ss = g_object_new (THRIFT_TYPE_SIMPLE_SERVER, "processor", p,
-                     "server_transport", THRIFT_SERVER_TRANSPORT (tss), NULL);
-
-  /* run the server in a child process */
-  pid = fork ();
-  assert (pid >= 0);
-
-  if (pid == 0)
-  {
-    THRIFT_SERVER_GET_CLASS (THRIFT_SERVER (ss))->serve (THRIFT_SERVER (ss),
-                                                         NULL);
-    exit (0);
-  } else {
-    sleep (5);
-    kill (pid, SIGINT);
-
-    g_object_unref (ss);
-    g_object_unref (tss);
-    g_object_unref (p);
-    assert (wait (&status) == pid);
-    assert (status == SIGINT);
-  }
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testsimpleserver/SimpleServer", test_server);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/teststruct.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/teststruct.c b/depends/thirdparty/thrift/lib/c_glib/test/teststruct.c
deleted file mode 100755
index 5d4baf3..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/teststruct.c
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <glib-object.h>
-
-#include "../src/thrift/c_glib/thrift_struct.c"
-
-/* tests to ensure we can extend a ThriftStruct */
-
-struct _ThriftTestStruct
-{
-  ThriftStruct parent;
-};
-typedef struct _ThriftTestStruct ThriftTestStruct;
-
-struct _ThriftTestStructClass
-{
-  ThriftStructClass parent;
-};
-typedef struct _ThriftTestStructClass ThriftTestStructClass;
-
-GType thrift_test_struct_get_type (void);
-
-#define THRIFT_TYPE_TEST_STRUCT (thrift_test_struct_get_type ())
-#define THRIFT_TEST_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_TEST_STRUCT, ThriftTestStruct))
-#define THRIFT_TEST_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_TEST_STRUCT, ThriftTestStructClass))
-#define THRIFT_IS_TEST_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_TEST_STRUCT))
-#define THRIFT_IS_TEST_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_TEST_STRUCT))
-#define THRIFT_TEST_STRUCT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_TEST_STRUCT, ThriftTestStructClass))
-
-G_DEFINE_TYPE(ThriftTestStruct, thrift_test_struct, THRIFT_TYPE_STRUCT)
-
-gint32
-thrift_test_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
-                         GError **error)
-{
-  THRIFT_UNUSED_VAR (object);
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-
-  return 0;
-}
-
-gint32
-thrift_test_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
-                          GError **error)
-{
-  THRIFT_UNUSED_VAR (object);
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-
-  return 0;
-}
-
-static void
-thrift_test_struct_class_init (ThriftTestStructClass *cls)
-{
-  ThriftStructClass *ts_cls = THRIFT_STRUCT_CLASS (cls);
-  ts_cls->read = thrift_test_struct_read;
-  ts_cls->write = thrift_test_struct_write;
-}
-
-static void
-thrift_test_struct_init (ThriftTestStruct *s)
-{
-  THRIFT_UNUSED_VAR (s);
-}
-
-static void
-test_initialize_object (void)
-{
-  ThriftTestStruct *t = NULL;
-
-  t = g_object_new (THRIFT_TYPE_TEST_STRUCT, NULL);
-  assert ( THRIFT_IS_STRUCT (t));
-  thrift_struct_read (THRIFT_STRUCT (t), NULL, NULL);
-  thrift_struct_write (THRIFT_STRUCT (t), NULL, NULL);
-  thrift_test_struct_read (THRIFT_STRUCT (t), NULL, NULL);
-  thrift_test_struct_write (THRIFT_STRUCT (t), NULL, NULL);
-  g_object_unref (t);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/teststruct/InitializeObject", test_initialize_object);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testthrifttest.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testthrifttest.c b/depends/thirdparty/thrift/lib/c_glib/test/testthrifttest.c
deleted file mode 100755
index 5f0f6e3..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testthrifttest.c
+++ /dev/null
@@ -1,31 +0,0 @@
-#include <assert.h>
-#include <netdb.h>
-
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-static const char TEST_ADDRESS[] = "localhost";
-static const int TEST_PORT = 64444;
-
-static void
-test_thrift_server (void)
-{
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", TEST_PORT, NULL);
-
-  g_object_unref (tsocket);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testthrift/Server", test_thrift_server);
-
-  return g_test_run ();
-}


[47/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_lua.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_lua.m4 b/depends/thirdparty/thrift/aclocal/ax_lua.m4
deleted file mode 100644
index 1553491..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_lua.m4
+++ /dev/null
@@ -1,663 +0,0 @@
-# ===========================================================================
-#          http://www.gnu.org/software/autoconf-archive/ax_lua.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_PROG_LUA[([MINIMUM-VERSION], [TOO-BIG-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
-#   AX_LUA_HEADERS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
-#   AX_LUA_LIBS[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
-#   AX_LUA_READLINE[([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])]
-#
-# DESCRIPTION
-#
-#   Detect a Lua interpreter, optionally specifying a minimum and maximum
-#   version number. Set up important Lua paths, such as the directories in
-#   which to install scripts and modules (shared libraries).
-#
-#   Also detect Lua headers and libraries. The Lua version contained in the
-#   header is checked to match the Lua interpreter version exactly. When
-#   searching for Lua libraries, the version number is used as a suffix.
-#   This is done with the goal of supporting multiple Lua installs (5.1 and
-#   5.2 side-by-side).
-#
-#   A note on compatibility with previous versions: This file has been
-#   mostly rewritten for serial 18. Most developers should be able to use
-#   these macros without needing to modify configure.ac. Care has been taken
-#   to preserve each macro's behavior, but there are some differences:
-#
-#   1) AX_WITH_LUA is deprecated; it now expands to the exact same thing as
-#   AX_PROG_LUA with no arguments.
-#
-#   2) AX_LUA_HEADERS now checks that the version number defined in lua.h
-#   matches the interpreter version. AX_LUA_HEADERS_VERSION is therefore
-#   unnecessary, so it is deprecated and does not expand to anything.
-#
-#   3) The configure flag --with-lua-suffix no longer exists; the user
-#   should instead specify the LUA precious variable on the command line.
-#   See the AX_PROG_LUA description for details.
-#
-#   Please read the macro descriptions below for more information.
-#
-#   This file was inspired by Andrew Dalke's and James Henstridge's
-#   python.m4 and Tom Payne's, Matthieu Moy's, and Reuben Thomas's ax_lua.m4
-#   (serial 17). Basically, this file is a mash-up of those two files. I
-#   like to think it combines the best of the two!
-#
-#   AX_PROG_LUA: Search for the Lua interpreter, and set up important Lua
-#   paths. Adds precious variable LUA, which may contain the path of the Lua
-#   interpreter. If LUA is blank, the user's path is searched for an
-#   suitable interpreter.
-#
-#   If MINIMUM-VERSION is supplied, then only Lua interpreters with a
-#   version number greater or equal to MINIMUM-VERSION will be accepted. If
-#   TOO-BIG- VERSION is also supplied, then only Lua interpreters with a
-#   version number greater or equal to MINIMUM-VERSION and less than
-#   TOO-BIG-VERSION will be accepted.
-#
-#   The Lua version number, LUA_VERSION, is found from the interpreter, and
-#   substituted. LUA_PLATFORM is also found, but not currently supported (no
-#   standard representation).
-#
-#   Finally, the macro finds four paths:
-#
-#     luadir             Directory to install Lua scripts.
-#     pkgluadir          $luadir/$PACKAGE
-#     luaexecdir         Directory to install Lua modules.
-#     pkgluaexecdir      $luaexecdir/$PACKAGE
-#
-#   These paths a found based on $prefix, $exec_prefix, Lua's package.path,
-#   and package.cpath. The first path of package.path beginning with $prefix
-#   is selected as luadir. The first path of package.cpath beginning with
-#   $exec_prefix is used as luaexecdir. This should work on all reasonable
-#   Lua installations. If a path cannot be determined, a default path is
-#   used. Of course, the user can override these later when invoking make.
-#
-#     luadir             Default: $prefix/share/lua/$LUA_VERSION
-#     luaexecdir         Default: $exec_prefix/lib/lua/$LUA_VERSION
-#
-#   These directories can be used by Automake as install destinations. The
-#   variable name minus 'dir' needs to be used as a prefix to the
-#   appropriate Automake primary, e.g. lua_SCRIPS or luaexec_LIBRARIES.
-#
-#   If an acceptable Lua interpreter is found, then ACTION-IF-FOUND is
-#   performed, otherwise ACTION-IF-NOT-FOUND is preformed. If ACTION-IF-NOT-
-#   FOUND is blank, then it will default to printing an error. To prevent
-#   the default behavior, give ':' as an action.
-#
-#   AX_LUA_HEADERS: Search for Lua headers. Requires that AX_PROG_LUA be
-#   expanded before this macro. Adds precious variable LUA_INCLUDE, which
-#   may contain Lua specific include flags, e.g. -I/usr/include/lua5.1. If
-#   LUA_INCLUDE is blank, then this macro will attempt to find suitable
-#   flags.
-#
-#   LUA_INCLUDE can be used by Automake to compile Lua modules or
-#   executables with embedded interpreters. The *_CPPFLAGS variables should
-#   be used for this purpose, e.g. myprog_CPPFLAGS = $(LUA_INCLUDE).
-#
-#   This macro searches for the header lua.h (and others). The search is
-#   performed with a combination of CPPFLAGS, CPATH, etc, and LUA_INCLUDE.
-#   If the search is unsuccessful, then some common directories are tried.
-#   If the headers are then found, then LUA_INCLUDE is set accordingly.
-#
-#   The paths automatically searched are:
-#
-#     * /usr/include/luaX.Y
-#     * /usr/include/lua/X.Y
-#     * /usr/include/luaXY
-#     * /usr/local/include/luaX.Y
-#     * /usr/local/include/lua-X.Y
-#     * /usr/local/include/lua/X.Y
-#     * /usr/local/include/luaXY
-#
-#   (Where X.Y is the Lua version number, e.g. 5.1.)
-#
-#   The Lua version number found in the headers is always checked to match
-#   the Lua interpreter's version number. Lua headers with mismatched
-#   version numbers are not accepted.
-#
-#   If headers are found, then ACTION-IF-FOUND is performed, otherwise
-#   ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
-#   it will default to printing an error. To prevent the default behavior,
-#   set the action to ':'.
-#
-#   AX_LUA_LIBS: Search for Lua libraries. Requires that AX_PROG_LUA be
-#   expanded before this macro. Adds precious variable LUA_LIB, which may
-#   contain Lua specific linker flags, e.g. -llua5.1. If LUA_LIB is blank,
-#   then this macro will attempt to find suitable flags.
-#
-#   LUA_LIB can be used by Automake to link Lua modules or executables with
-#   embedded interpreters. The *_LIBADD and *_LDADD variables should be used
-#   for this purpose, e.g. mymod_LIBADD = $(LUA_LIB).
-#
-#   This macro searches for the Lua library. More technically, it searches
-#   for a library containing the function lua_load. The search is performed
-#   with a combination of LIBS, LIBRARY_PATH, and LUA_LIB.
-#
-#   If the search determines that some linker flags are missing, then those
-#   flags will be added to LUA_LIB.
-#
-#   If libraries are found, then ACTION-IF-FOUND is performed, otherwise
-#   ACTION-IF-NOT-FOUND is performed. If ACTION-IF-NOT-FOUND is blank, then
-#   it will default to printing an error. To prevent the default behavior,
-#   set the action to ':'.
-#
-#   AX_LUA_READLINE: Search for readline headers and libraries. Requires the
-#   AX_LIB_READLINE macro, which is provided by ax_lib_readline.m4 from the
-#   Autoconf Archive.
-#
-#   If a readline compatible library is found, then ACTION-IF-FOUND is
-#   performed, otherwise ACTION-IF-NOT-FOUND is performed.
-#
-# LICENSE
-#
-#   Copyright (c) 2014 Reuben Thomas <rr...@sc3d.org>
-#   Copyright (c) 2014 Tim Perkins <tp...@gmail.com>
-#
-#   This program is free software: you can redistribute it and/or modify it
-#   under the terms of the GNU General Public License as published by the
-#   Free Software Foundation, either version 3 of the License, or (at your
-#   option) any later version.
-#
-#   This program is distributed in the hope that it will be useful, but
-#   WITHOUT ANY WARRANTY; without even the implied warranty of
-#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
-#   Public License for more details.
-#
-#   You should have received a copy of the GNU General Public License along
-#   with this program. If not, see <http://www.gnu.org/licenses/>.
-#
-#   As a special exception, the respective Autoconf Macro's copyright owner
-#   gives unlimited permission to copy, distribute and modify the configure
-#   scripts that are the output of Autoconf when processing the Macro. You
-#   need not follow the terms of the GNU General Public License when using
-#   or distributing such scripts, even though portions of the text of the
-#   Macro appear in them. The GNU General Public License (GPL) does govern
-#   all other use of the material that constitutes the Autoconf Macro.
-#
-#   This special exception to the GPL applies to versions of the Autoconf
-#   Macro released by the Autoconf Archive. When you make and distribute a
-#   modified version of the Autoconf Macro, you may extend this special
-#   exception to the GPL to apply to your modified version as well.
-
-#serial 36
-
-dnl =========================================================================
-dnl AX_PROG_LUA([MINIMUM-VERSION], [TOO-BIG-VERSION],
-dnl             [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl =========================================================================
-AC_DEFUN([AX_PROG_LUA],
-[
-  dnl Check for required tools.
-  AC_REQUIRE([AC_PROG_GREP])
-  AC_REQUIRE([AC_PROG_SED])
-
-  dnl Make LUA a precious variable.
-  AC_ARG_VAR([LUA], [The Lua interpreter, e.g. /usr/bin/lua5.1])
-
-  dnl Find a Lua interpreter.
-  m4_define_default([_AX_LUA_INTERPRETER_LIST],
-    [lua lua5.2 lua52 lua5.1 lua51 lua50])
-
-  m4_if([$1], [],
-  [ dnl No version check is needed. Find any Lua interpreter.
-    AS_IF([test "x$LUA" = 'x'],
-      [AC_PATH_PROGS([LUA], [_AX_LUA_INTERPRETER_LIST], [:])])
-    ax_display_LUA='lua'
-
-    AS_IF([test "x$LUA" != 'x:'],
-      [ dnl At least check if this is a Lua interpreter.
-        AC_MSG_CHECKING([if $LUA is a Lua interpreter])
-        _AX_LUA_CHK_IS_INTRP([$LUA],
-          [AC_MSG_RESULT([yes])],
-          [ AC_MSG_RESULT([no])
-            AC_MSG_ERROR([not a Lua interpreter])
-          ])
-      ])
-  ],
-  [ dnl A version check is needed.
-    AS_IF([test "x$LUA" != 'x'],
-    [ dnl Check if this is a Lua interpreter.
-      AC_MSG_CHECKING([if $LUA is a Lua interpreter])
-      _AX_LUA_CHK_IS_INTRP([$LUA],
-        [AC_MSG_RESULT([yes])],
-        [ AC_MSG_RESULT([no])
-          AC_MSG_ERROR([not a Lua interpreter])
-        ])
-      dnl Check the version.
-      m4_if([$2], [],
-        [_ax_check_text="whether $LUA version >= $1"],
-        [_ax_check_text="whether $LUA version >= $1, < $2"])
-      AC_MSG_CHECKING([$_ax_check_text])
-      _AX_LUA_CHK_VER([$LUA], [$1], [$2],
-        [AC_MSG_RESULT([yes])],
-        [ AC_MSG_RESULT([no])
-          AC_MSG_ERROR([version is out of range for specified LUA])])
-      ax_display_LUA=$LUA
-    ],
-    [ dnl Try each interpreter until we find one that satisfies VERSION.
-      m4_if([$2], [],
-        [_ax_check_text="for a Lua interpreter with version >= $1"],
-        [_ax_check_text="for a Lua interpreter with version >= $1, < $2"])
-      AC_CACHE_CHECK([$_ax_check_text],
-        [ax_cv_pathless_LUA],
-        [ for ax_cv_pathless_LUA in _AX_LUA_INTERPRETER_LIST none; do
-            test "x$ax_cv_pathless_LUA" = 'xnone' && break
-            _AX_LUA_CHK_IS_INTRP([$ax_cv_pathless_LUA], [], [continue])
-            _AX_LUA_CHK_VER([$ax_cv_pathless_LUA], [$1], [$2], [break])
-          done
-        ])
-      dnl Set $LUA to the absolute path of $ax_cv_pathless_LUA.
-      AS_IF([test "x$ax_cv_pathless_LUA" = 'xnone'],
-        [LUA=':'],
-        [AC_PATH_PROG([LUA], [$ax_cv_pathless_LUA])])
-      ax_display_LUA=$ax_cv_pathless_LUA
-    ])
-  ])
-
-  AS_IF([test "x$LUA" = 'x:'],
-  [ dnl Run any user-specified action, or abort.
-    m4_default([$4], [AC_MSG_ERROR([cannot find suitable Lua interpreter])])
-  ],
-  [ dnl Query Lua for its version number.
-    AC_CACHE_CHECK([for $ax_display_LUA version],
-      [ax_cv_lua_version],
-      [ dnl Get the interpreter version in X.Y format. This should work for
-        dnl interpreters version 5.0 and beyond.
-        ax_cv_lua_version=[`$LUA -e '
-          -- return a version number in X.Y format
-          local _, _, ver = string.find(_VERSION, "^Lua (%d+%.%d+)")
-          print(ver)'`]
-      ])
-    AS_IF([test "x$ax_cv_lua_version" = 'x'],
-      [AC_MSG_ERROR([invalid Lua version number])])
-    AC_SUBST([LUA_VERSION], [$ax_cv_lua_version])
-    AC_SUBST([LUA_SHORT_VERSION], [`echo "$LUA_VERSION" | $SED 's|\.||'`])
-
-    dnl The following check is not supported:
-    dnl At times (like when building shared libraries) you may want to know
-    dnl which OS platform Lua thinks this is.
-    AC_CACHE_CHECK([for $ax_display_LUA platform],
-      [ax_cv_lua_platform],
-      [ax_cv_lua_platform=[`$LUA -e 'print("unknown")'`]])
-    AC_SUBST([LUA_PLATFORM], [$ax_cv_lua_platform])
-
-    dnl Use the values of $prefix and $exec_prefix for the corresponding
-    dnl values of LUA_PREFIX and LUA_EXEC_PREFIX. These are made distinct
-    dnl variables so they can be overridden if need be. However, the general
-    dnl consensus is that you shouldn't need this ability.
-    AC_SUBST([LUA_PREFIX], ['${prefix}'])
-    AC_SUBST([LUA_EXEC_PREFIX], ['${exec_prefix}'])
-
-    dnl Lua provides no way to query the script directory, and instead
-    dnl provides LUA_PATH. However, we should be able to make a safe educated
-    dnl guess. If the built-in search path contains a directory which is
-    dnl prefixed by $prefix, then we can store scripts there. The first
-    dnl matching path will be used.
-    AC_CACHE_CHECK([for $ax_display_LUA script directory],
-      [ax_cv_lua_luadir],
-      [ AS_IF([test "x$prefix" = 'xNONE'],
-          [ax_lua_prefix=$ac_default_prefix],
-          [ax_lua_prefix=$prefix])
-
-        dnl Initialize to the default path.
-        ax_cv_lua_luadir="$LUA_PREFIX/share/lua/$LUA_VERSION"
-
-        dnl Try to find a path with the prefix.
-        _AX_LUA_FND_PRFX_PTH([$LUA], [$ax_lua_prefix], [package.path])
-        AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
-        [ dnl Fix the prefix.
-          _ax_strip_prefix=`echo "$ax_lua_prefix" | $SED 's|.|.|g'`
-          ax_cv_lua_luadir=`echo "$ax_lua_prefixed_path" | \
-            $SED "s|^$_ax_strip_prefix|$LUA_PREFIX|"`
-        ])
-      ])
-    AC_SUBST([luadir], [$ax_cv_lua_luadir])
-    AC_SUBST([pkgluadir], [\${luadir}/$PACKAGE])
-
-    dnl Lua provides no way to query the module directory, and instead
-    dnl provides LUA_PATH. However, we should be able to make a safe educated
-    dnl guess. If the built-in search path contains a directory which is
-    dnl prefixed by $exec_prefix, then we can store modules there. The first
-    dnl matching path will be used.
-    AC_CACHE_CHECK([for $ax_display_LUA module directory],
-      [ax_cv_lua_luaexecdir],
-      [ AS_IF([test "x$exec_prefix" = 'xNONE'],
-          [ax_lua_exec_prefix=$ax_lua_prefix],
-          [ax_lua_exec_prefix=$exec_prefix])
-
-        dnl Initialize to the default path.
-        ax_cv_lua_luaexecdir="$LUA_EXEC_PREFIX/lib/lua/$LUA_VERSION"
-
-        dnl Try to find a path with the prefix.
-        _AX_LUA_FND_PRFX_PTH([$LUA],
-          [$ax_lua_exec_prefix], [package.cpath])
-        AS_IF([test "x$ax_lua_prefixed_path" != 'x'],
-        [ dnl Fix the prefix.
-          _ax_strip_prefix=`echo "$ax_lua_exec_prefix" | $SED 's|.|.|g'`
-          ax_cv_lua_luaexecdir=`echo "$ax_lua_prefixed_path" | \
-            $SED "s|^$_ax_strip_prefix|$LUA_EXEC_PREFIX|"`
-        ])
-      ])
-    AC_SUBST([luaexecdir], [$ax_cv_lua_luaexecdir])
-    AC_SUBST([pkgluaexecdir], [\${luaexecdir}/$PACKAGE])
-
-    dnl Run any user specified action.
-    $3
-  ])
-])
-
-dnl AX_WITH_LUA is now the same thing as AX_PROG_LUA.
-AC_DEFUN([AX_WITH_LUA],
-[
-  AC_MSG_WARN([[$0 is deprecated, please use AX_PROG_LUA instead]])
-  AX_PROG_LUA
-])
-
-
-dnl =========================================================================
-dnl _AX_LUA_CHK_IS_INTRP(PROG, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-dnl =========================================================================
-AC_DEFUN([_AX_LUA_CHK_IS_INTRP],
-[
-  dnl A minimal Lua factorial to prove this is an interpreter. This should work
-  dnl for Lua interpreters version 5.0 and beyond.
-  _ax_lua_factorial=[`$1 2>/dev/null -e '
-    -- a simple factorial
-    function fact (n)
-      if n == 0 then
-        return 1
-      else
-        return n * fact(n-1)
-      end
-    end
-    print("fact(5) is " .. fact(5))'`]
-  AS_IF([test "$_ax_lua_factorial" = 'fact(5) is 120'],
-    [$2], [$3])
-])
-
-
-dnl =========================================================================
-dnl _AX_LUA_CHK_VER(PROG, MINIMUM-VERSION, [TOO-BIG-VERSION],
-dnl                 [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-dnl =========================================================================
-AC_DEFUN([_AX_LUA_CHK_VER],
-[
-  dnl Check that the Lua version is within the bounds. Only the major and minor
-  dnl version numbers are considered. This should work for Lua interpreters
-  dnl version 5.0 and beyond.
-  _ax_lua_good_version=[`$1 -e '
-    -- a script to compare versions
-    function verstr2num(verstr)
-      local _, _, majorver, minorver = string.find(verstr, "^(%d+)%.(%d+)")
-      if majorver and minorver then
-        return tonumber(majorver) * 100 + tonumber(minorver)
-      end
-    end
-    local minver = verstr2num("$2")
-    local _, _, trimver = string.find(_VERSION, "^Lua (.*)")
-    local ver = verstr2num(trimver)
-    local maxver = verstr2num("$3") or 1e9
-    if minver <= ver and ver < maxver then
-      print("yes")
-    else
-      print("no")
-    end'`]
-    AS_IF([test "x$_ax_lua_good_version" = "xyes"],
-      [$4], [$5])
-])
-
-
-dnl =========================================================================
-dnl _AX_LUA_FND_PRFX_PTH(PROG, PREFIX, SCRIPT-OR-MODULE-DIR)
-dnl =========================================================================
-AC_DEFUN([_AX_LUA_FND_PRFX_PTH],
-[
-  dnl Get the script or module directory by querying the Lua interpreter,
-  dnl filtering on the given prefix, and selecting the shallowest path. If no
-  dnl path  is found matching the prefix, the result will be an empty string.
-  dnl The third argument determines the type of search, it can be 'script' or
-  dnl 'module'. Supplying 'script' will perform the search with package.path
-  dnl and LUA_PATH, and supplying 'module' will search with package.cpath and
-  dnl LUA_CPATH. This is done for compatibility with Lua 5.0.
-
-  ax_lua_prefixed_path=[`$1 -e '
-    -- get the path based on search type
-    local searchtype = "$3"
-    local paths = ""
-    if searchtype == "script" then
-      paths = (package and package.path) or LUA_PATH
-    elseif searchtype == "module" then
-      paths = (package and package.cpath) or LUA_CPATH
-    end
-    -- search for the prefix
-    local prefix = "$2"
-    local minpath = ""
-    local mindepth = 1e9
-    string.gsub(paths, "(@<:@^;@:>@+)",
-      function (path)
-        path = string.gsub(path, "%?.*$", "")
-        path = string.gsub(path, "/@<:@^/@:>@*$", "")
-        if string.find(path, prefix) then
-          local depth = string.len(string.gsub(path, "@<:@^/@:>@", ""))
-          if depth < mindepth then
-            minpath = path
-            mindepth = depth
-          end
-        end
-      end)
-    print(minpath)'`]
-])
-
-
-dnl =========================================================================
-dnl AX_LUA_HEADERS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl =========================================================================
-AC_DEFUN([AX_LUA_HEADERS],
-[
-  dnl Check for LUA_VERSION.
-  AC_MSG_CHECKING([if LUA_VERSION is defined])
-  AS_IF([test "x$LUA_VERSION" != 'x'],
-    [AC_MSG_RESULT([yes])],
-    [ AC_MSG_RESULT([no])
-      AC_MSG_ERROR([cannot check Lua headers without knowing LUA_VERSION])
-    ])
-
-  dnl Make LUA_INCLUDE a precious variable.
-  AC_ARG_VAR([LUA_INCLUDE], [The Lua includes, e.g. -I/usr/include/lua5.1])
-
-  dnl Some default directories to search.
-  LUA_SHORT_VERSION=`echo "$LUA_VERSION" | $SED 's|\.||'`
-  m4_define_default([_AX_LUA_INCLUDE_LIST],
-    [ /usr/include/lua$LUA_VERSION \
-      /usr/include/lua-$LUA_VERSION \
-      /usr/include/lua/$LUA_VERSION \
-      /usr/include/lua$LUA_SHORT_VERSION \
-      /usr/local/include/lua$LUA_VERSION \
-      /usr/local/include/lua-$LUA_VERSION \
-      /usr/local/include/lua/$LUA_VERSION \
-      /usr/local/include/lua$LUA_SHORT_VERSION \
-    ])
-
-  dnl Try to find the headers.
-  _ax_lua_saved_cppflags=$CPPFLAGS
-  CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
-  AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
-  CPPFLAGS=$_ax_lua_saved_cppflags
-
-  dnl Try some other directories if LUA_INCLUDE was not set.
-  AS_IF([test "x$LUA_INCLUDE" = 'x' &&
-         test "x$ac_cv_header_lua_h" != 'xyes'],
-    [ dnl Try some common include paths.
-      for _ax_include_path in _AX_LUA_INCLUDE_LIST; do
-        test ! -d "$_ax_include_path" && continue
-
-        AC_MSG_CHECKING([for Lua headers in])
-        AC_MSG_RESULT([$_ax_include_path])
-
-        AS_UNSET([ac_cv_header_lua_h])
-        AS_UNSET([ac_cv_header_lualib_h])
-        AS_UNSET([ac_cv_header_lauxlib_h])
-        AS_UNSET([ac_cv_header_luaconf_h])
-
-        _ax_lua_saved_cppflags=$CPPFLAGS
-        CPPFLAGS="$CPPFLAGS -I$_ax_include_path"
-        AC_CHECK_HEADERS([lua.h lualib.h lauxlib.h luaconf.h])
-        CPPFLAGS=$_ax_lua_saved_cppflags
-
-        AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
-          [ LUA_INCLUDE="-I$_ax_include_path"
-            break
-          ])
-      done
-    ])
-
-  AS_IF([test "x$ac_cv_header_lua_h" = 'xyes'],
-    [ dnl Make a program to print LUA_VERSION defined in the header.
-      dnl TODO It would be really nice if we could do this without compiling a
-      dnl program, then it would work when cross compiling. But I'm not sure how
-      dnl to do this reliably. For now, assume versions match when cross compiling.
-
-      AS_IF([test "x$cross_compiling" != 'xyes'],
-        [ AC_CACHE_CHECK([for Lua header version],
-            [ax_cv_lua_header_version],
-            [ _ax_lua_saved_cppflags=$CPPFLAGS
-              CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
-              AC_RUN_IFELSE(
-                [ AC_LANG_SOURCE([[
-#include <lua.h>
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char ** argv)
-{
-  if(argc > 1) printf("%s", LUA_VERSION);
-  exit(EXIT_SUCCESS);
-}
-]])
-                ],
-                [ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
-                    $SED -n "s|^Lua \(@<:@0-9@:>@\{1,\}\.@<:@0-9@:>@\{1,\}\).\{0,\}|\1|p"`
-                ],
-                [ax_cv_lua_header_version='unknown'])
-              CPPFLAGS=$_ax_lua_saved_cppflags
-            ])
-
-          dnl Compare this to the previously found LUA_VERSION.
-          AC_MSG_CHECKING([if Lua header version matches $LUA_VERSION])
-          AS_IF([test "x$ax_cv_lua_header_version" = "x$LUA_VERSION"],
-            [ AC_MSG_RESULT([yes])
-              ax_header_version_match='yes'
-            ],
-            [ AC_MSG_RESULT([no])
-              ax_header_version_match='no'
-            ])
-        ],
-        [ AC_MSG_WARN([cross compiling so assuming header version number matches])
-          ax_header_version_match='yes'
-        ])
-    ])
-
-  dnl Was LUA_INCLUDE specified?
-  AS_IF([test "x$ax_header_version_match" != 'xyes' &&
-         test "x$LUA_INCLUDE" != 'x'],
-    [AC_MSG_ERROR([cannot find headers for specified LUA_INCLUDE])])
-
-  dnl Test the final result and run user code.
-  AS_IF([test "x$ax_header_version_match" = 'xyes'], [$1],
-    [m4_default([$2], [AC_MSG_ERROR([cannot find Lua includes])])])
-])
-
-dnl AX_LUA_HEADERS_VERSION no longer exists, use AX_LUA_HEADERS.
-AC_DEFUN([AX_LUA_HEADERS_VERSION],
-[
-  AC_MSG_WARN([[$0 is deprecated, please use AX_LUA_HEADERS instead]])
-])
-
-
-dnl =========================================================================
-dnl AX_LUA_LIBS([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl =========================================================================
-AC_DEFUN([AX_LUA_LIBS],
-[
-  dnl TODO Should this macro also check various -L flags?
-
-  dnl Check for LUA_VERSION.
-  AC_MSG_CHECKING([if LUA_VERSION is defined])
-  AS_IF([test "x$LUA_VERSION" != 'x'],
-    [AC_MSG_RESULT([yes])],
-    [ AC_MSG_RESULT([no])
-      AC_MSG_ERROR([cannot check Lua libs without knowing LUA_VERSION])
-    ])
-
-  dnl Make LUA_LIB a precious variable.
-  AC_ARG_VAR([LUA_LIB], [The Lua library, e.g. -llua5.1])
-
-  AS_IF([test "x$LUA_LIB" != 'x'],
-  [ dnl Check that LUA_LIBS works.
-    _ax_lua_saved_libs=$LIBS
-    LIBS="$LIBS $LUA_LIB"
-    AC_SEARCH_LIBS([lua_load], [],
-      [_ax_found_lua_libs='yes'],
-      [_ax_found_lua_libs='no'])
-    LIBS=$_ax_lua_saved_libs
-
-    dnl Check the result.
-    AS_IF([test "x$_ax_found_lua_libs" != 'xyes'],
-      [AC_MSG_ERROR([cannot find libs for specified LUA_LIB])])
-  ],
-  [ dnl First search for extra libs.
-    _ax_lua_extra_libs=''
-
-    _ax_lua_saved_libs=$LIBS
-    LIBS="$LIBS $LUA_LIB"
-    AC_SEARCH_LIBS([exp], [m])
-    AC_SEARCH_LIBS([dlopen], [dl])
-    LIBS=$_ax_lua_saved_libs
-
-    AS_IF([test "x$ac_cv_search_exp" != 'xno' &&
-           test "x$ac_cv_search_exp" != 'xnone required'],
-      [_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_exp"])
-
-    AS_IF([test "x$ac_cv_search_dlopen" != 'xno' &&
-           test "x$ac_cv_search_dlopen" != 'xnone required'],
-      [_ax_lua_extra_libs="$_ax_lua_extra_libs $ac_cv_search_dlopen"])
-
-    dnl Try to find the Lua libs.
-    _ax_lua_saved_libs=$LIBS
-    LIBS="$LIBS $LUA_LIB"
-    AC_SEARCH_LIBS([lua_load],
-      [ lua$LUA_VERSION \
-        lua$LUA_SHORT_VERSION \
-        lua-$LUA_VERSION \
-        lua-$LUA_SHORT_VERSION \
-        lua \
-      ],
-      [_ax_found_lua_libs='yes'],
-      [_ax_found_lua_libs='no'],
-      [$_ax_lua_extra_libs])
-    LIBS=$_ax_lua_saved_libs
-
-    AS_IF([test "x$ac_cv_search_lua_load" != 'xno' &&
-           test "x$ac_cv_search_lua_load" != 'xnone required'],
-      [LUA_LIB="$ac_cv_search_lua_load $_ax_lua_extra_libs"])
-  ])
-
-  dnl Test the result and run user code.
-  AS_IF([test "x$_ax_found_lua_libs" = 'xyes'], [$1],
-    [m4_default([$2], [AC_MSG_ERROR([cannot find Lua libs])])])
-])
-
-
-dnl =========================================================================
-dnl AX_LUA_READLINE([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-dnl =========================================================================
-AC_DEFUN([AX_LUA_READLINE],
-[
-  AX_LIB_READLINE
-  AS_IF([test "x$ac_cv_header_readline_readline_h" != 'x' &&
-         test "x$ac_cv_header_readline_history_h" != 'x'],
-    [ LUA_LIBS_CFLAGS="-DLUA_USE_READLINE $LUA_LIBS_CFLAGS"
-      $1
-    ],
-    [$2])
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_prog_haxe_version.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_prog_haxe_version.m4 b/depends/thirdparty/thrift/aclocal/ax_prog_haxe_version.m4
deleted file mode 100644
index 3dee430..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_prog_haxe_version.m4
+++ /dev/null
@@ -1,60 +0,0 @@
-# ===========================================================================
-#   http://www.gnu.org/software/autoconf-archive/ax_prog_haxe_version.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_PROG_HAXE_VERSION([VERSION],[ACTION-IF-TRUE],[ACTION-IF-FALSE])
-#
-# DESCRIPTION
-#
-#   Makes sure that haxe supports the version indicated. If true the shell
-#   commands in ACTION-IF-TRUE are executed. If not the shell commands in
-#   ACTION-IF-FALSE are run. The $HAXE_VERSION variable will be filled with
-#   the detected version.
-#
-#   This macro uses the $HAXE variable to perform the check. If $HAXE is not
-#   set prior to calling this macro, the macro will fail.
-#
-#   Example:
-#
-#     AC_PATH_PROG([HAXE],[haxe])
-#     AC_PROG_HAXE_VERSION([3.1.3],[ ... ],[ ... ])
-#
-#   Searches for Haxe, then checks if at least version 3.1.3 is present.
-#
-# LICENSE
-#
-#   Copyright (c) 2015 Jens Geyer <je...@apache.org>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 1
-
-AC_DEFUN([AX_PROG_HAXE_VERSION],[
-    AC_REQUIRE([AC_PROG_SED])
-
-    AS_IF([test -n "$HAXE"],[
-        ax_haxe_version="$1"
-
-        AC_MSG_CHECKING([for haxe version])
-        haxe_version=`$HAXE -version 2>&1 | $SED -e 's/^.* \( @<:@0-9@:>@*\.@<:@0-9@:>@*\.@<:@0-9@:>@*\) .*/\1/'`
-        AC_MSG_RESULT($haxe_version)
-
-	    AC_SUBST([HAXE_VERSION],[$haxe_version])
-
-        AX_COMPARE_VERSION([$ax_haxe_version],[le],[$haxe_version],[
-	    :
-            $2
-        ],[
-	    :
-            $3
-        ])
-    ],[
-        AC_MSG_WARN([could not find Haxe])
-        $3
-    ])
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_prog_perl_modules.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_prog_perl_modules.m4 b/depends/thirdparty/thrift/aclocal/ax_prog_perl_modules.m4
deleted file mode 100644
index 11a326c..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_prog_perl_modules.m4
+++ /dev/null
@@ -1,77 +0,0 @@
-# ===========================================================================
-#   http://www.gnu.org/software/autoconf-archive/ax_prog_perl_modules.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_PROG_PERL_MODULES([MODULES], [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-#
-# DESCRIPTION
-#
-#   Checks to see if the given perl modules are available. If true the shell
-#   commands in ACTION-IF-TRUE are executed. If not the shell commands in
-#   ACTION-IF-FALSE are run. Note if $PERL is not set (for example by
-#   calling AC_CHECK_PROG, or AC_PATH_PROG), AC_CHECK_PROG(PERL, perl, perl)
-#   will be run.
-#
-#   MODULES is a space separated list of module names. To check for a
-#   minimum version of a module, append the version number to the module
-#   name, separated by an equals sign.
-#
-#   Example:
-#
-#     AX_PROG_PERL_MODULES( Text::Wrap Net::LDAP=1.0.3, ,
-#                           AC_MSG_WARN(Need some Perl modules)
-#
-# LICENSE
-#
-#   Copyright (c) 2009 Dean Povey <po...@wedgetail.com>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 7
-
-AU_ALIAS([AC_PROG_PERL_MODULES], [AX_PROG_PERL_MODULES])
-AC_DEFUN([AX_PROG_PERL_MODULES],[dnl
-
-m4_define([ax_perl_modules])
-m4_foreach([ax_perl_module], m4_split(m4_normalize([$1])),
-	  [
-	   m4_append([ax_perl_modules],
-		     [']m4_bpatsubst(ax_perl_module,=,[ ])[' ])
-          ])
-
-# Make sure we have perl
-if test -z "$PERL"; then
-AC_CHECK_PROG(PERL,perl,perl)
-fi
-
-if test "x$PERL" != x; then
-  ax_perl_modules_failed=0
-  for ax_perl_module in ax_perl_modules; do
-    AC_MSG_CHECKING(for perl module $ax_perl_module)
-
-    # Would be nice to log result here, but can't rely on autoconf internals
-    $PERL -e "use $ax_perl_module; exit" > /dev/null 2>&1
-    if test $? -ne 0; then
-      AC_MSG_RESULT(no);
-      ax_perl_modules_failed=1
-   else
-      AC_MSG_RESULT(ok);
-    fi
-  done
-
-  # Run optional shell commands
-  if test "$ax_perl_modules_failed" = 0; then
-    :
-    $2
-  else
-    :
-    $3
-  fi
-else
-  AC_MSG_WARN(could not find perl)
-fi])dnl

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_signed_right_shift.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_signed_right_shift.m4 b/depends/thirdparty/thrift/aclocal/ax_signed_right_shift.m4
deleted file mode 100644
index 9c3ceb7..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_signed_right_shift.m4
+++ /dev/null
@@ -1,127 +0,0 @@
-dnl @synopsis AX_SIGNED_RIGHT_SHIFT
-dnl
-dnl Tests the behavior of a right shift on a negative signed int.
-dnl
-dnl This macro calls:
-dnl   AC_DEFINE(SIGNED_RIGHT_SHIFT_IS)
-dnl   AC_DEFINE(ARITHMETIC_RIGHT_SHIFT)
-dnl   AC_DEFINE(LOGICAL_RIGHT_SHIFT)
-dnl   AC_DEFINE(UNKNOWN_RIGHT_SHIFT)
-dnl
-dnl SIGNED_RIGHT_SHIFT_IS will be equal to one of the other macros.
-dnl It also leaves the shell variables "ax_signed_right_shift"
-dnl set to "arithmetic", "logical", or "unknown".
-dnl
-dnl NOTE: This macro does not work for cross-compiling.
-dnl
-dnl @category C
-dnl @version 2009-03-25
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-AC_DEFUN([AX_SIGNED_RIGHT_SHIFT],
-         [
-
-          AC_MSG_CHECKING(the behavior of a signed right shift)
-
-          success_arithmetic=no
-          AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[
-          return
-            /* 0xffffffff */
-            -1 >>  1 != -1 ||
-            -1 >>  2 != -1 ||
-            -1 >>  3 != -1 ||
-            -1 >>  4 != -1 ||
-            -1 >>  8 != -1 ||
-            -1 >> 16 != -1 ||
-            -1 >> 24 != -1 ||
-            -1 >> 31 != -1 ||
-            /* 0x80000000 */
-            (-2147483647 - 1) >>  1 != -1073741824 ||
-            (-2147483647 - 1) >>  2 != -536870912  ||
-            (-2147483647 - 1) >>  3 != -268435456  ||
-            (-2147483647 - 1) >>  4 != -134217728  ||
-            (-2147483647 - 1) >>  8 != -8388608    ||
-            (-2147483647 - 1) >> 16 != -32768      ||
-            (-2147483647 - 1) >> 24 != -128        ||
-            (-2147483647 - 1) >> 31 != -1          ||
-            /* 0x90800000 */
-            -1870659584 >>  1 != -935329792 ||
-            -1870659584 >>  2 != -467664896 ||
-            -1870659584 >>  3 != -233832448 ||
-            -1870659584 >>  4 != -116916224 ||
-            -1870659584 >>  8 != -7307264   ||
-            -1870659584 >> 16 != -28544     ||
-            -1870659584 >> 24 != -112       ||
-            -1870659584 >> 31 != -1         ||
-            0;
-          ]])], [
-          success_arithmetic=yes
-          ])
-
-
-          success_logical=no
-          AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[
-          return
-            /* 0xffffffff */
-            -1 >>  1 != (signed)((unsigned)-1 >>  1) ||
-            -1 >>  2 != (signed)((unsigned)-1 >>  2) ||
-            -1 >>  3 != (signed)((unsigned)-1 >>  3) ||
-            -1 >>  4 != (signed)((unsigned)-1 >>  4) ||
-            -1 >>  8 != (signed)((unsigned)-1 >>  8) ||
-            -1 >> 16 != (signed)((unsigned)-1 >> 16) ||
-            -1 >> 24 != (signed)((unsigned)-1 >> 24) ||
-            -1 >> 31 != (signed)((unsigned)-1 >> 31) ||
-            /* 0x80000000 */
-            (-2147483647 - 1) >>  1 != (signed)((unsigned)(-2147483647 - 1) >>  1) ||
-            (-2147483647 - 1) >>  2 != (signed)((unsigned)(-2147483647 - 1) >>  2) ||
-            (-2147483647 - 1) >>  3 != (signed)((unsigned)(-2147483647 - 1) >>  3) ||
-            (-2147483647 - 1) >>  4 != (signed)((unsigned)(-2147483647 - 1) >>  4) ||
-            (-2147483647 - 1) >>  8 != (signed)((unsigned)(-2147483647 - 1) >>  8) ||
-            (-2147483647 - 1) >> 16 != (signed)((unsigned)(-2147483647 - 1) >> 16) ||
-            (-2147483647 - 1) >> 24 != (signed)((unsigned)(-2147483647 - 1) >> 24) ||
-            (-2147483647 - 1) >> 31 != (signed)((unsigned)(-2147483647 - 1) >> 31) ||
-            /* 0x90800000 */
-            -1870659584 >>  1 != (signed)((unsigned)-1870659584 >>  1) ||
-            -1870659584 >>  2 != (signed)((unsigned)-1870659584 >>  2) ||
-            -1870659584 >>  3 != (signed)((unsigned)-1870659584 >>  3) ||
-            -1870659584 >>  4 != (signed)((unsigned)-1870659584 >>  4) ||
-            -1870659584 >>  8 != (signed)((unsigned)-1870659584 >>  8) ||
-            -1870659584 >> 16 != (signed)((unsigned)-1870659584 >> 16) ||
-            -1870659584 >> 24 != (signed)((unsigned)-1870659584 >> 24) ||
-            -1870659584 >> 31 != (signed)((unsigned)-1870659584 >> 31) ||
-            0;
-          ]])], [
-          success_logical=yes
-          ])
-
-
-          AC_DEFINE([ARITHMETIC_RIGHT_SHIFT], 1, [Possible value for SIGNED_RIGHT_SHIFT_IS])
-          AC_DEFINE([LOGICAL_RIGHT_SHIFT], 2, [Possible value for SIGNED_RIGHT_SHIFT_IS])
-          AC_DEFINE([UNKNOWN_RIGHT_SHIFT], 3, [Possible value for SIGNED_RIGHT_SHIFT_IS])
-
-          if test "$success_arithmetic" = "yes" && test "$success_logical" = "yes" ; then
-            AC_MSG_ERROR("Right shift appears to be both arithmetic and logical!")
-          elif test "$success_arithmetic" = "yes" ; then
-            ax_signed_right_shift=arithmetic
-            AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 1,
-                      [Indicates the effect of the right shift operator
-                       on negative signed integers])
-          elif test "$success_logical" = "yes" ; then
-            ax_signed_right_shift=logical
-            AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 2,
-                      [Indicates the effect of the right shift operator
-                       on negative signed integers])
-          else
-            ax_signed_right_shift=unknown
-            AC_DEFINE([SIGNED_RIGHT_SHIFT_IS], 3,
-                      [Indicates the effect of the right shift operator
-                       on negative signed integers])
-          fi
-
-          AC_MSG_RESULT($ax_signed_right_shift)
-         ])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_thrift_internal.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_thrift_internal.m4 b/depends/thirdparty/thrift/aclocal/ax_thrift_internal.m4
deleted file mode 100644
index 8c0e3cb..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_thrift_internal.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl @synopsis AX_THRIFT_GEN(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
-dnl @synopsis AX_THRIFT_LIB(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
-dnl
-dnl Allow a particular language generator to be disabled.
-dnl Allow a particular language library to be disabled.
-dnl
-dnl These macros have poor error handling and are poorly documented.
-dnl They are intended only for internal use by the Thrift compiler.
-dnl
-dnl @version 2008-02-20
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-AC_DEFUN([AX_THRIFT_LIB],
-         [
-          AC_ARG_WITH($1,
-                      AC_HELP_STRING([--with-$1], [build the $2 library @<:@default=$3@:>@]),
-                      [with_$1="$withval"],
-                      [with_$1=$3]
-                      )
-          have_$1=no
-          dnl What we do here is going to vary from library to library,
-          dnl so we can't really generalize (yet!).
-         ])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/m4_ax_compare_version.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/m4_ax_compare_version.m4 b/depends/thirdparty/thrift/aclocal/m4_ax_compare_version.m4
deleted file mode 100644
index 74dc0fd..0000000
--- a/depends/thirdparty/thrift/aclocal/m4_ax_compare_version.m4
+++ /dev/null
@@ -1,177 +0,0 @@
-# ===========================================================================
-#    http://www.gnu.org/software/autoconf-archive/ax_compare_version.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
-#
-# DESCRIPTION
-#
-#   This macro compares two version strings. Due to the various number of
-#   minor-version numbers that can exist, and the fact that string
-#   comparisons are not compatible with numeric comparisons, this is not
-#   necessarily trivial to do in a autoconf script. This macro makes doing
-#   these comparisons easy.
-#
-#   The six basic comparisons are available, as well as checking equality
-#   limited to a certain number of minor-version levels.
-#
-#   The operator OP determines what type of comparison to do, and can be one
-#   of:
-#
-#    eq  - equal (test A == B)
-#    ne  - not equal (test A != B)
-#    le  - less than or equal (test A <= B)
-#    ge  - greater than or equal (test A >= B)
-#    lt  - less than (test A < B)
-#    gt  - greater than (test A > B)
-#
-#   Additionally, the eq and ne operator can have a number after it to limit
-#   the test to that number of minor versions.
-#
-#    eq0 - equal up to the length of the shorter version
-#    ne0 - not equal up to the length of the shorter version
-#    eqN - equal up to N sub-version levels
-#    neN - not equal up to N sub-version levels
-#
-#   When the condition is true, shell commands ACTION-IF-TRUE are run,
-#   otherwise shell commands ACTION-IF-FALSE are run. The environment
-#   variable 'ax_compare_version' is always set to either 'true' or 'false'
-#   as well.
-#
-#   Examples:
-#
-#     AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
-#     AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
-#
-#   would both be true.
-#
-#     AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
-#     AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
-#
-#   would both be false.
-#
-#     AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
-#
-#   would be true because it is only comparing two minor versions.
-#
-#     AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
-#
-#   would be true because it is only comparing the lesser number of minor
-#   versions of the two values.
-#
-#   Note: The characters that separate the version numbers do not matter. An
-#   empty string is the same as version 0. OP is evaluated by autoconf, not
-#   configure, so must be a string, not a variable.
-#
-#   The author would like to acknowledge Guido Draheim whose advice about
-#   the m4_case and m4_ifvaln functions make this macro only include the
-#   portions necessary to perform the specific comparison specified by the
-#   OP argument in the final configure script.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Tim Toolan <to...@ele.uri.edu>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 11
-
-dnl #########################################################################
-AC_DEFUN([AX_COMPARE_VERSION], [
-  AC_REQUIRE([AC_PROG_AWK])
-
-  # Used to indicate true or false condition
-  ax_compare_version=false
-
-  # Convert the two version strings to be compared into a format that
-  # allows a simple string comparison.  The end result is that a version
-  # string of the form 1.12.5-r617 will be converted to the form
-  # 0001001200050617.  In other words, each number is zero padded to four
-  # digits, and non digits are removed.
-  AS_VAR_PUSHDEF([A],[ax_compare_version_A])
-  A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/[[^0-9]]//g'`
-
-  AS_VAR_PUSHDEF([B],[ax_compare_version_B])
-  B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
-                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
-                     -e 's/[[^0-9]]//g'`
-
-  dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
-  dnl # then the first line is used to determine if the condition is true.
-  dnl # The sed right after the echo is to remove any indented white space.
-  m4_case(m4_tolower($2),
-  [lt],[
-    ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
-  ],
-  [gt],[
-    ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
-  ],
-  [le],[
-    ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
-  ],
-  [ge],[
-    ax_compare_version=`echo "x$A
-x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
-  ],[
-    dnl Split the operator from the subversion count if present.
-    m4_bmatch(m4_substr($2,2),
-    [0],[
-      # A count of zero means use the length of the shorter version.
-      # Determine the number of characters in A and B.
-      ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
-      ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
-
-      # Set A to no more than B's length and B to no more than A's length.
-      A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
-      B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
-    ],
-    [[0-9]+],[
-      # A count greater than zero means use only that many subversions
-      A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
-      B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
-    ],
-    [.+],[
-      AC_WARNING(
-        [illegal OP numeric parameter: $2])
-    ],[])
-
-    # Pad zeros at end of numbers to make same length.
-    ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
-    B="$B`echo $A | sed 's/./0/g'`"
-    A="$ax_compare_version_tmp_A"
-
-    # Check for equality or inequality as necessary.
-    m4_case(m4_tolower(m4_substr($2,0,2)),
-    [eq],[
-      test "x$A" = "x$B" && ax_compare_version=true
-    ],
-    [ne],[
-      test "x$A" != "x$B" && ax_compare_version=true
-    ],[
-      AC_WARNING([illegal OP parameter: $2])
-    ])
-  ])
-
-  AS_VAR_POPDEF([A])dnl
-  AS_VAR_POPDEF([B])dnl
-
-  dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
-  if test "$ax_compare_version" = "true" ; then
-    m4_ifvaln([$4],[$4],[:])dnl
-    m4_ifvaln([$5],[else $5])dnl
-  fi
-]) dnl AX_COMPARE_VERSION

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/appveyor.yml
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/appveyor.yml b/depends/thirdparty/thrift/appveyor.yml
deleted file mode 100755
index 0c5bfdf..0000000
--- a/depends/thirdparty/thrift/appveyor.yml
+++ /dev/null
@@ -1,53 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# build Apache Thrift on AppVeyor - https://ci.appveyor.com
-
-version: '{build}'
-os:
-- Windows Server 2012 R2
-- Visual Studio 2014 CTP4
-- Visual Studio 2015 CTP
-- Visual Studio 2015 CTP 6
-- Visual Studio 2015 Preview
-
-environment:
-  BOOST_ROOT: c:\Libraries\boost
-  BOOST_LIBRARYDIR: c:\Libraries\boost\stage\lib
-
-install:
-- cinst cmake
-- cinst nsis
-- cinst ant
-- cinst winflexbison
-
-build_script:
-- set PATH=C:\ProgramData\chocolatey\bin;C:\tools\apache-ant-1.9.4\bin;%PATH%
-- mv C:\ProgramData\chocolatey\bin\win_bison.exe C:\ProgramData\chocolatey\bin\bison.exe
-- mv C:\ProgramData\chocolatey\bin\win_flex.exe C:\ProgramData\chocolatey\bin\flex.exe
-- set JAVA_HOME=C:\Program Files\Java\jdk1.7.0
-- set PATH=%JAVA_HOME%\bin;%PATH%
-- mkdir cmake-build
-- cd cmake-build
-- cmake -DBUILD_TESTING=OFF ..
-- cmake --build .
-- cmake --build . --config Release
-- cpack
-
-#TODO enable testing
-#TODO make it perfect ;-r

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/bootstrap.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/bootstrap.sh b/depends/thirdparty/thrift/bootstrap.sh
deleted file mode 100755
index 52ecda4..0000000
--- a/depends/thirdparty/thrift/bootstrap.sh
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-./cleanup.sh
-if test -d lib/php/src/ext/thrift_protocol ; then
-    if phpize -v >/dev/null 2>/dev/null ; then
-        (cd lib/php/src/ext/thrift_protocol && phpize)
-    fi
-fi
-
-set -e
-
-# libtoolize is called "glibtoolize" on OSX.
-if libtoolize --version 1 >/dev/null 2>/dev/null; then
-  LIBTOOLIZE=libtoolize
-elif glibtoolize --version 1 >/dev/null 2>/dev/null; then
-  LIBTOOLIZE=glibtoolize
-else
-  echo >&2 "Couldn't find libtoolize!"
-  exit 1
-fi
-
-# we require automake 1.13 or later
-# check must happen externally due to use of newer macro
-AUTOMAKE_VERSION=`automake --version | grep automake | egrep -o '([0-9]{1,}\.)+[0-9]{1,}'`
-if [ "$AUTOMAKE_VERSION" \< "1.13" ]; then
-  echo >&2 "automake version $AUTOMAKE_VERSION is too old (need 1.13 or later)"
-  exit 1
-fi
-
-autoscan
-$LIBTOOLIZE --copy --automake
-aclocal -I ./aclocal
-autoheader
-autoconf
-automake --copy --add-missing --foreign

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/bower.json
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/bower.json b/depends/thirdparty/thrift/bower.json
deleted file mode 100644
index e0612e3..0000000
--- a/depends/thirdparty/thrift/bower.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
-  "name": "thrift",
-  "version": "0.9.3",
-  "homepage": "https://git-wip-us.apache.org/repos/asf/thrift.git",
-  "authors": [
-    "Apache Thrift <de...@thrift.apache.org>"
-  ],
-  "description": "Apache Thrift",
-  "main": "lib/js/src/thrift.js",
-  "keywords": [
-    "thrift"
-  ],
-  "license": "Apache v2",
-  "ignore": [
-  ]
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/CPackConfig.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/CPackConfig.cmake b/depends/thirdparty/thrift/build/cmake/CPackConfig.cmake
deleted file mode 100644
index 0240005..0000000
--- a/depends/thirdparty/thrift/build/cmake/CPackConfig.cmake
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-#TODO: Should we bundle system libraries for DLLs?
-#include(InstallRequiredSystemLibraries)
-
-# For help take a look at:
-# http://www.cmake.org/Wiki/CMake:CPackConfiguration
-
-### general settings
-set(CPACK_PACKAGE_NAME "thrift")
-set(CPACK_PACKAGE_VERSION "${PACKAGE_VERSION}")
-set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Apache Thrift")
-set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md")
-set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
-set(CPACK_PACKAGE_VENDOR "Apache Software Foundation")
-set(CPACK_PACKAGE_CONTACT "dev@thrift.apache.org")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CPACK_PACKAGE_NAME}")
-set(CPACK_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
-
-### versions
-set(CPACK_PACKAGE_VERSION_MAJOR ${thrift_VERSION_MAJOR})
-set(CPACK_PACKAGE_VERSION_MINOR ${thrift_VERSION_MINOR})
-set(CPACK_PACKAGE_VERSION_PATCH ${thrift_VERSION_PATCH})
-
-### source generator
-set(CPACK_SOURCE_GENERATOR "TGZ")
-set(CPACK_SOURCE_IGNORE_FILES "~$;[.]swp$;/[.]svn/;/[.]git/;.gitignore;/build/;tags;cscope.*")
-set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
-
-### zip generator
-set(CPACK_GENERATOR "ZIP")
-set(CPACK_PACKAGE_INSTALL_DIRECTORY "thrift")
-
-
-if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
-    set(CPACK_GENERATOR "NSIS")
-    set(CPACK_NSIS_HELP_LINK "http://thrift.apache.org")
-    set(CPACK_NSIS_MENU_LINKS
-        "http://thrift.apache.org" "Apache Thrift - Web Site"
-        "https://issues.apache.org/jira/browse/THRIFT" "Apache Thrift - Issues")
-    set(CPACK_NSIS_CONTACT ${CPACK_PACKAGE_CONTACT})
-    set(CPACK_NSIS_MODIFY_PATH "ON")
-    set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
-else()
-    set(CPACK_GENERATOR "DEB" )
-    set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
-endif()
-
-
-include(CPack)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/ConfigureChecks.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/ConfigureChecks.cmake b/depends/thirdparty/thrift/build/cmake/ConfigureChecks.cmake
deleted file mode 100644
index f650544..0000000
--- a/depends/thirdparty/thrift/build/cmake/ConfigureChecks.cmake
+++ /dev/null
@@ -1,76 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-include(CheckSymbolExists)
-include(CheckIncludeFile)
-include(CheckIncludeFiles)
-include(CheckFunctionExists)
-
-# If AI_ADDRCONFIG is not defined we define it as 0
-check_symbol_exists(AI_ADDRCONFIG "sys/types.h;sys/socket.h;netdb.h" HAVE_AI_ADDRCONFIG)
-if(NOT HAVE_AI_ADDRCONFIG)
-set(AI_ADDRCONFIG 1)
-endif(NOT HAVE_AI_ADDRCONFIG)
-
-check_include_file(arpa/inet.h HAVE_ARPA_INET_H)
-check_include_file(fcntl.h HAVE_FCNTL_H)
-check_include_file(getopt.h HAVE_GETOPT_H)
-check_include_file(inttypes.h HAVE_INTTYPES_H)
-check_include_file(netdb.h HAVE_NETDB_H)
-check_include_file(netinet/in.h HAVE_NETINET_IN_H)
-check_include_file(stdint.h HAVE_STDINT_H)
-check_include_file(unistd.h HAVE_UNISTD_H)
-check_include_file(pthread.h HAVE_PTHREAD_H)
-check_include_file(sys/time.h HAVE_SYS_TIME_H)
-check_include_file(sys/param.h HAVE_SYS_PARAM_H)
-check_include_file(sys/resource.h HAVE_SYS_RESOURCE_H)
-check_include_file(sys/socket.h HAVE_SYS_SOCKET_H)
-check_include_file(sys/stat.h HAVE_SYS_STAT_H)
-check_include_file(sys/un.h HAVE_SYS_UN_H)
-check_include_file(sys/poll.h HAVE_SYS_POLL_H)
-check_include_file(sys/select.h HAVE_SYS_SELECT_H)
-check_include_file(sched.h HAVE_SCHED_H)
-check_include_file(strings.h HAVE_STRINGS_H)
-
-check_function_exists(gethostbyname HAVE_GETHOSTBYNAME)
-check_function_exists(gethostbyname_r HAVE_GETHOSTBYNAME_R)
-check_function_exists(strerror_r HAVE_STRERROR_R)
-check_function_exists(sched_get_priority_max HAVE_SCHED_GET_PRIORITY_MAX)
-check_function_exists(sched_get_priority_min HAVE_SCHED_GET_PRIORITY_MIN)
-
-include(CheckCSourceCompiles)
-include(CheckCXXSourceCompiles)
-
-check_cxx_source_compiles(
-  "
-  #include <string.h>
-  int main(){char b;char *a = strerror_r(0, &b, 0); return(0);}
-  "
-  STRERROR_R_CHAR_P)
-
-
-set(PACKAGE ${PACKAGE_NAME})
-set(PACKAGE_STRING "${PACKAGE_NAME} ${PACKAGE_VERSION}")
-set(VERSION ${thrift_VERSION})
-
-# generate a config.h file
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/thrift/config.h")
-# HACK: Some files include thrift/config.h and some config.h so we include both. This should be cleaned up.
-include_directories("${CMAKE_CURRENT_BINARY_DIR}/thrift" "${CMAKE_CURRENT_BINARY_DIR}")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/DefineCMakeDefaults.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/DefineCMakeDefaults.cmake b/depends/thirdparty/thrift/build/cmake/DefineCMakeDefaults.cmake
deleted file mode 100644
index 34ff738..0000000
--- a/depends/thirdparty/thrift/build/cmake/DefineCMakeDefaults.cmake
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-# Always include srcdir and builddir in include path
-# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in
-# about every subdir
-# since cmake 2.4.0
-set(CMAKE_INCLUDE_CURRENT_DIR ON)
-
-# Put the include dirs which are in the source or build tree
-# before all other include dirs, so the headers in the sources
-# are preferred over the already installed ones
-# since cmake 2.4.1
-set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
-
-# Use colored output
-# since cmake 2.4.0
-set(CMAKE_COLOR_MAKEFILE ON)
-
-# Define the generic version of the libraries here
-set(GENERIC_LIB_VERSION "0.9.3")
-set(GENERIC_LIB_SOVERSION "0")
-
-# Set the default build type to release with debug info
-if (NOT CMAKE_BUILD_TYPE)
-  set(CMAKE_BUILD_TYPE RelWithDebInfo
-    CACHE STRING
-      "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
-  )
-endif (NOT CMAKE_BUILD_TYPE)
-
-# Create the compile command database for clang by default
-set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
-
-# Put the libraries and binaries that get built into directories at the
-# top of the build tree rather than in hard-to-find leaf
-# directories. This simplifies manual testing and the use of the build
-# tree rather than installed thrift libraries.
-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-#
-# "rpath" support.
-# See http://www.itk.org/Wiki/index.php?title=CMake_RPATH_handling
-#
-# On MacOSX, for shared libraries, enable rpath support.
-set(CMAKE_MACOSX_RPATH TRUE)
-#
-# On any OS, for executables, allow linking with shared libraries in non-system
-# locations and running the executables without LD_PRELOAD or similar.
-# This requires the library to be built with rpath support.
-set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/DefineInstallationPaths.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/DefineInstallationPaths.cmake b/depends/thirdparty/thrift/build/cmake/DefineInstallationPaths.cmake
deleted file mode 100644
index 122f0f6..0000000
--- a/depends/thirdparty/thrift/build/cmake/DefineInstallationPaths.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-# Define the default install paths
-set(BIN_INSTALL_DIR "bin" CACHE PATH "The binary install dir (default: bin)")
-set(LIB_INSTALL_DIR "lib${LIB_SUFFIX}" CACHE PATH "The library install dir (default: lib${LIB_SUFFIX})")
-set(INCLUDE_INSTALL_DIR "include" CACHE PATH "The library install dir (default: include)")
-set(CMAKE_INSTALL_DIR "cmake" CACHE PATH "The subdirectory to install cmake config files (default: cmake)")
-set(DOC_INSTALL_DIR "share/doc" CACHE PATH "The subdirectory to install documentation files (default: share/doc)")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/DefineOptions.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/DefineOptions.cmake b/depends/thirdparty/thrift/build/cmake/DefineOptions.cmake
deleted file mode 100644
index 62e240f..0000000
--- a/depends/thirdparty/thrift/build/cmake/DefineOptions.cmake
+++ /dev/null
@@ -1,143 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-include(CMakeDependentOption)
-
-# Additional components
-option(BUILD_COMPILER "Build Thrift compiler" ON)
-option(BUILD_TESTING "Build with unit tests" ON)
-option(BUILD_EXAMPLES "Build examples" ON)
-option(BUILD_TUTORIALS "Build Thrift tutorials" ON)
-option(BUILD_LIBRARIES "Build Thrift libraries" ON)
-
-# Libraries to build
-
-# Each language library can be enabled or disabled using the WITH_<LANG> flag.
-# By default CMake checks if the required dependencies for a language are present
-# and enables the library if all are found. This means the default is to build as
-# much as possible but leaving out libraries if their dependencies are not met.
-
-# C++
-option(WITH_CPP "Build C++ Thrift library" ON)
-find_package(Boost 1.53 QUIET)
-CMAKE_DEPENDENT_OPTION(BUILD_CPP "Build C++ library" ON
-                       "BUILD_LIBRARIES;WITH_CPP;Boost_FOUND" OFF)
-# NOTE: Currently the following options are C++ specific,
-# but in future other libraries might reuse them.
-# So they are not dependent on WITH_CPP but setting them without WITH_CPP currently
-# has no effect.
-find_package(ZLIB QUIET)
-CMAKE_DEPENDENT_OPTION(WITH_ZLIB "Build with ZLIB support" ON
-                       "ZLIB_FOUND" OFF)
-find_package(Libevent QUIET)
-CMAKE_DEPENDENT_OPTION(WITH_LIBEVENT "Build with libevent support" ON
-                       "Libevent_FOUND" OFF)
-find_package(Qt4 QUIET COMPONENTS QtCore QtNetwork)
-CMAKE_DEPENDENT_OPTION(WITH_QT4 "Build with Qt4 support" ON
-                       "QT4_FOUND" OFF)
-find_package(Qt5 QUIET COMPONENTS Core Network)
-CMAKE_DEPENDENT_OPTION(WITH_QT5 "Build with Qt5 support" ON
-                       "Qt5_FOUND" OFF)
-if(${WITH_QT4} AND ${WITH_QT5} AND ${CMAKE_MAJOR_VERSION} LESS 3)
-  # cmake < 3.0.0 causes conflict when building both Qt4 and Qt5
-  set(WITH_QT4 OFF)
-endif()
-find_package(OpenSSL QUIET)
-CMAKE_DEPENDENT_OPTION(WITH_OPENSSL "Build with OpenSSL support" ON
-                       "OPENSSL_FOUND" OFF)
-option(WITH_STDTHREADS "Build with C++ std::thread support" OFF)
-CMAKE_DEPENDENT_OPTION(WITH_BOOSTTHREADS "Build with Boost threads support" OFF
-    "NOT WITH_STDTHREADS;Boost_FOUND" OFF)
-
-
-# C GLib
-option(WITH_C_GLIB "Build C (GLib) Thrift library" ON)
-find_package(GLIB QUIET COMPONENTS gobject)
-CMAKE_DEPENDENT_OPTION(BUILD_C_GLIB "Build C (GLib) library" ON
-                       "BUILD_LIBRARIES;WITH_C_GLIB;GLIB_FOUND" OFF)
-# Java
-option(WITH_JAVA "Build Java Thrift library" ON)
-find_package(Java QUIET)
-find_package(Ant QUIET)
-CMAKE_DEPENDENT_OPTION(BUILD_JAVA "Build Java library" ON
-                       "BUILD_LIBRARIES;WITH_JAVA;JAVA_FOUND;ANT_FOUND" OFF)
-
-# Python
-option(WITH_PYTHON "Build Python Thrift library" ON)
-find_package(PythonInterp QUIET) # for Python executable
-find_package(PythonLibs QUIET) # for Python.h
-CMAKE_DEPENDENT_OPTION(BUILD_PYTHON "Build Python library" ON
-                       "BUILD_LIBRARIES;WITH_PYTHON;PYTHONLIBS_FOUND" OFF)
-
-# Common library options
-option(WITH_SHARED_LIB "Build shared libraries" ON)
-option(WITH_STATIC_LIB "Build static libraries" ON)
-if (NOT WITH_SHARED_LIB AND NOT WITH_STATIC_LIB)
-    message(FATAL_ERROR "Cannot build with both shared and static outputs disabled!")
-endif()
-
-#NOTE: C++ compiler options are defined in the lib/cpp/CMakeLists.txt
-
-# Visual Studio only options
-if(MSVC)
-option(WITH_MT "Build using MT instead of MD (MSVC only)" OFF)
-endif(MSVC)
-
-macro(MESSAGE_DEP flag summary)
-if(NOT ${flag})
-  message(STATUS "   - ${summary}")
-endif()
-endmacro(MESSAGE_DEP flag summary)
-
-macro(PRINT_CONFIG_SUMMARY)
-message(STATUS "----------------------------------------------------------")
-message(STATUS "Thrift version:                       ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
-message(STATUS "Thrift package version:               ${PACKAGE_VERSION}")
-message(STATUS "Build configuration Summary")
-message(STATUS "  Build Thrift compiler:              ${BUILD_COMPILER}")
-message(STATUS "  Build with unit tests:              ${BUILD_TESTING}")
-message(STATUS "  Build examples:                     ${BUILD_EXAMPLES}")
-message(STATUS "  Build Thrift libraries:             ${BUILD_LIBRARIES}")
-message(STATUS " Language libraries:")
-message(STATUS "  Build C++ library:                  ${BUILD_CPP}")
-MESSAGE_DEP(WITH_CPP "Disabled by via WITH_CCP=OFF")
-MESSAGE_DEP(Boost_FOUND "Boost headers missing")
-message(STATUS "  Build C (GLib) library:             ${BUILD_C_GLIB}")
-MESSAGE_DEP(WITH_C_GLIB "Disabled by via WITH_C_GLIB=OFF")
-MESSAGE_DEP(GLIB_FOUND "GLib missing")
-message(STATUS "  Build Java library:                 ${BUILD_JAVA}")
-MESSAGE_DEP(WITH_JAVA "Disabled by via WITH_JAVA=OFF")
-MESSAGE_DEP(JAVA_FOUND "Java Runtime missing")
-MESSAGE_DEP(ANT_FOUND "Ant missing")
-message(STATUS "  Build Python library:               ${BUILD_PYTHON}")
-MESSAGE_DEP(WITH_PYTHON "Disabled by via WITH_PYTHON=OFF")
-MESSAGE_DEP(PYTHONLIBS_FOUND "Python libraries missing")
-message(STATUS " Library features:")
-message(STATUS "  Build shared libraries:             ${WITH_SHARED_LIB}")
-message(STATUS "  Build static libraries:             ${WITH_STATIC_LIB}")
-message(STATUS "  Build with ZLIB support:            ${WITH_ZLIB}")
-message(STATUS "  Build with libevent support:        ${WITH_LIBEVENT}")
-message(STATUS "  Build with Qt4 support:             ${WITH_QT4}")
-message(STATUS "  Build with Qt5 support:             ${WITH_QT5}")
-message(STATUS "  Build with OpenSSL support:         ${WITH_OPENSSL}")
-message(STATUS "  Build with Boost thread support:    ${WITH_BOOSTTHREADS}")
-message(STATUS "  Build with C++ std::thread support: ${WITH_STDTHREADS}")
-message(STATUS "----------------------------------------------------------")
-endmacro(PRINT_CONFIG_SUMMARY)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/DefinePlatformSpecifc.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/DefinePlatformSpecifc.cmake b/depends/thirdparty/thrift/build/cmake/DefinePlatformSpecifc.cmake
deleted file mode 100755
index 40ec627..0000000
--- a/depends/thirdparty/thrift/build/cmake/DefinePlatformSpecifc.cmake
+++ /dev/null
@@ -1,94 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-# Visual Studio specific options
-if(MSVC)
-    #For visual studio the library naming is as following:
-    # Dynamic libraries:
-    #  - thrift.dll  for release library
-    #  - thriftd.dll for debug library
-    #
-    # Static libraries:
-    #  - thriftmd.lib for /MD release build
-    #  - thriftmt.lib for /MT release build
-    #
-    #  - thriftmdd.lib for /MD debug build
-    #  - thriftmtd.lib for /MT debug build
-    #
-    # the same holds for other libraries like libthriftz etc.
-
-    # For Debug build types, append a "d" to the library names.
-    set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Set debug library postfix" FORCE)
-    set(CMAKE_RELEASE_POSTFIX "" CACHE STRING "Set release library postfix" FORCE)
-
-    # Build using /MT option instead of /MD if the WITH_MT options is set
-    if(WITH_MT)
-        set(CompilerFlags
-                CMAKE_CXX_FLAGS
-                CMAKE_CXX_FLAGS_DEBUG
-                CMAKE_CXX_FLAGS_RELEASE
-                CMAKE_C_FLAGS
-                CMAKE_C_FLAGS_DEBUG
-                CMAKE_C_FLAGS_RELEASE
-                )
-        foreach(CompilerFlag ${CompilerFlags})
-          string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
-        endforeach()
-        set(STATIC_POSTFIX "mt" CACHE STRING "Set static library postfix" FORCE)
-    else(WITH_MT)
-        set(STATIC_POSTFIX "md" CACHE STRING "Set static library postfix" FORCE)
-    endif(WITH_MT)
-
-    # Disable Windows.h definition of macros for min and max
-    add_definitions("-DNOMINMAX")
-
-    # Disable boost auto linking pragmas - cmake includes the right files
-    add_definitions("-DBOOST_ALL_NO_LIB")
-
-    # Windows build does not know how to make a shared library yet
-    # as there are no __declspec(dllexport) or exports files in the project.
-    if (WITH_SHARED_LIB)
-      message (FATAL_ERROR "Windows build does not support shared library output yet, please set -DWITH_SHARED_LIB=off")
-    endif()
-
-elseif(UNIX)
-  find_program( MEMORYCHECK_COMMAND valgrind )
-  set( MEMORYCHECK_COMMAND_OPTIONS "--gen-suppressions=all --leak-check=full" )
-  set( MEMORYCHECK_SUPPRESSIONS_FILE "${PROJECT_SOURCE_DIR}/test/valgrind.suppress" )
-endif()
-
-# WITH_*THREADS selects which threading library to use
-if(WITH_BOOSTTHREADS)
-  add_definitions("-DUSE_BOOST_THREAD=1")
-elseif(WITH_STDTHREADS)
-  add_definitions("-DUSE_STD_THREAD=1")
-endif()
-
-# GCC and Clang.
-if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
-  # FIXME -pedantic can not be used at the moment because of: https://issues.apache.org/jira/browse/THRIFT-2784
-  #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra -pedantic")
-  # FIXME enabling c++11 breaks some Linux builds on Travis by triggering a g++ bug, see
-  # https://travis-ci.org/apache/thrift/jobs/58017022
-  # on the other hand, both MacOSX and FreeBSD need c++11
-  if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR ${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
-    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -Wall -Wextra")
-  endif()
-endif()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/FindAnt.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/FindAnt.cmake b/depends/thirdparty/thrift/build/cmake/FindAnt.cmake
deleted file mode 100644
index 16b9afd..0000000
--- a/depends/thirdparty/thrift/build/cmake/FindAnt.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-#  Ant_FOUND - system has Ant
-#  Ant_EXECUTBALE - the Ant executable
-#
-# It will search the environment variable ANT_HOME if it is set
-
-include(FindPackageHandleStandardArgs)
-
-find_program(Ant_EXECUTABLE NAMES ant PATHS $ENV{ANT_HOME}/bin)
-find_package_handle_standard_args(Ant DEFAULT_MSG Ant_EXECUTABLE)
-mark_as_advanced(Ant_EXECUTABLE)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/FindGLIB.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/FindGLIB.cmake b/depends/thirdparty/thrift/build/cmake/FindGLIB.cmake
deleted file mode 100644
index acbe433..0000000
--- a/depends/thirdparty/thrift/build/cmake/FindGLIB.cmake
+++ /dev/null
@@ -1,122 +0,0 @@
-# - Try to find Glib and its components (gio, gobject etc)
-# Once done, this will define
-#
-#  GLIB_FOUND - system has Glib
-#  GLIB_INCLUDE_DIRS - the Glib include directories
-#  GLIB_LIBRARIES - link these to use Glib
-#
-# Optionally, the COMPONENTS keyword can be passed to find_package()
-# and Glib components can be looked for.  Currently, the following
-# components can be used, and they define the following variables if
-# found:
-#
-#  gio:             GLIB_GIO_LIBRARIES
-#  gobject:         GLIB_GOBJECT_LIBRARIES
-#  gmodule:         GLIB_GMODULE_LIBRARIES
-#  gthread:         GLIB_GTHREAD_LIBRARIES
-#
-# Note that the respective _INCLUDE_DIR variables are not set, since
-# all headers are in the same directory as GLIB_INCLUDE_DIRS.
-#
-# Copyright (C) 2012 Raphael Kubo da Costa <ra...@webkit.org>
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-# 1.  Redistributions of source code must retain the above copyright
-#     notice, this list of conditions and the following disclaimer.
-# 2.  Redistributions in binary form must reproduce the above copyright
-#     notice, this list of conditions and the following disclaimer in the
-#     documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
-# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
-# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-find_package(PkgConfig)
-pkg_check_modules(PC_GLIB QUIET glib-2.0)
-
-find_library(GLIB_LIBRARIES
-    NAMES glib-2.0
-    HINTS ${PC_GLIB_LIBDIR}
-          ${PC_GLIB_LIBRARY_DIRS}
-)
-
-# Files in glib's main include path may include glibconfig.h, which,
-# for some odd reason, is normally in $LIBDIR/glib-2.0/include.
-get_filename_component(_GLIB_LIBRARY_DIR ${GLIB_LIBRARIES} PATH)
-find_path(GLIBCONFIG_INCLUDE_DIR
-    NAMES glibconfig.h
-    HINTS ${PC_LIBDIR} ${PC_LIBRARY_DIRS} ${_GLIB_LIBRARY_DIR}
-          ${PC_GLIB_INCLUDEDIR} ${PC_GLIB_INCLUDE_DIRS}
-    PATH_SUFFIXES glib-2.0/include
-)
-
-find_path(GLIB_INCLUDE_DIR
-    NAMES glib.h
-    HINTS ${PC_GLIB_INCLUDEDIR}
-          ${PC_GLIB_INCLUDE_DIRS}
-    PATH_SUFFIXES glib-2.0
-)
-
-set(GLIB_INCLUDE_DIRS ${GLIB_INCLUDE_DIR} ${GLIBCONFIG_INCLUDE_DIR})
-
-if(GLIBCONFIG_INCLUDE_DIR)
-    # Version detection
-    file(READ "${GLIBCONFIG_INCLUDE_DIR}/glibconfig.h" GLIBCONFIG_H_CONTENTS)
-    string(REGEX MATCH "#define GLIB_MAJOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-    set(GLIB_VERSION_MAJOR "${CMAKE_MATCH_1}")
-    string(REGEX MATCH "#define GLIB_MINOR_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-    set(GLIB_VERSION_MINOR "${CMAKE_MATCH_1}")
-    string(REGEX MATCH "#define GLIB_MICRO_VERSION ([0-9]+)" _dummy "${GLIBCONFIG_H_CONTENTS}")
-    set(GLIB_VERSION_MICRO "${CMAKE_MATCH_1}")
-    set(GLIB_VERSION "${GLIB_VERSION_MAJOR}.${GLIB_VERSION_MINOR}.${GLIB_VERSION_MICRO}")
-endif()
-
-# Additional Glib components.  We only look for libraries, as not all of them
-# have corresponding headers and all headers are installed alongside the main
-# glib ones.
-foreach (_component ${GLIB_FIND_COMPONENTS})
-    if (${_component} STREQUAL "gio")
-        find_library(GLIB_GIO_LIBRARIES NAMES gio-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GIO_LIBRARIES)
-    elseif (${_component} STREQUAL "gobject")
-        find_library(GLIB_GOBJECT_LIBRARIES NAMES gobject-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GOBJECT_LIBRARIES)
-    elseif (${_component} STREQUAL "gmodule")
-        find_library(GLIB_GMODULE_LIBRARIES NAMES gmodule-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GMODULE_LIBRARIES)
-    elseif (${_component} STREQUAL "gthread")
-        find_library(GLIB_GTHREAD_LIBRARIES NAMES gthread-2.0 HINTS ${_GLIB_LIBRARY_DIR})
-        set(ADDITIONAL_REQUIRED_VARS ${ADDITIONAL_REQUIRED_VARS} GLIB_GTHREAD_LIBRARIES)
-    elseif (${_component} STREQUAL "gio-unix")
-        # gio-unix is compiled as part of the gio library, but the include paths
-        # are separate from the shared glib ones. Since this is currently only used
-        # by WebKitGTK+ we don't go to extraordinary measures beyond pkg-config.
-        pkg_check_modules(GIO_UNIX QUIET gio-unix-2.0)
-    endif ()
-endforeach ()
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLIB REQUIRED_VARS GLIB_INCLUDE_DIRS GLIB_LIBRARIES ${ADDITIONAL_REQUIRED_VARS}
-                                       VERSION_VAR   GLIB_VERSION)
-
-mark_as_advanced(
-    GLIBCONFIG_INCLUDE_DIR
-    GLIB_GIO_LIBRARIES
-    GLIB_GIO_UNIX_LIBRARIES
-    GLIB_GMODULE_LIBRARIES
-    GLIB_GOBJECT_LIBRARIES
-    GLIB_GTHREAD_LIBRARIES
-    GLIB_INCLUDE_DIR
-    GLIB_INCLUDE_DIRS
-    GLIB_LIBRARIES
-)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/FindLibevent.cmake
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/FindLibevent.cmake b/depends/thirdparty/thrift/build/cmake/FindLibevent.cmake
deleted file mode 100644
index 1eac315..0000000
--- a/depends/thirdparty/thrift/build/cmake/FindLibevent.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-# find LibEvent
-# an event notification library (http://libevent.org/)
-#
-# Usage: 
-# LIBEVENT_INCLUDE_DIRS, where to find LibEvent headers
-# LIBEVENT_LIBRARIES, LibEvent libraries
-# Libevent_FOUND, If false, do not try to use libevent
-
-set(LibEvent_EXTRA_PREFIXES /usr/local /opt/local "$ENV{HOME}")
-foreach(prefix ${LibEvent_EXTRA_PREFIXES})
-  list(APPEND LibEvent_INCLUDE_PATHS "${prefix}/include")
-  list(APPEND LibEvent_LIBRARIES_PATHS "${prefix}/lib")
-endforeach()
-
-find_path(LIBEVENT_INCLUDE_DIRS event.h PATHS ${LibEvent_INCLUDE_PATHS})
-find_library(LIBEVENT_LIBRARIES NAMES event PATHS ${LibEvent_LIBRARIES_PATHS})
-
-if (LIBEVENT_LIBRARIES AND LIBEVENT_INCLUDE_DIRS)
-  set(Libevent_FOUND TRUE)
-  set(LIBEVENT_LIBRARIES ${LIBEVENT_LIBRARIES})
-else ()
-  set(Libevent_FOUND FALSE)
-endif ()
-
-if (Libevent_FOUND)
-  if (NOT Libevent_FIND_QUIETLY)
-    message(STATUS "Found libevent: ${LIBEVENT_LIBRARIES}")
-  endif ()
-else ()
-  if (LibEvent_FIND_REQUIRED)
-    message(FATAL_ERROR "Could NOT find libevent.")
-  endif ()
-  message(STATUS "libevent NOT found.")
-endif ()
-
-mark_as_advanced(
-    LIBEVENT_LIBRARIES
-    LIBEVENT_INCLUDE_DIRS
-  )

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/build/cmake/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/build/cmake/README.md b/depends/thirdparty/thrift/build/cmake/README.md
deleted file mode 100644
index ebc4f7d..0000000
--- a/depends/thirdparty/thrift/build/cmake/README.md
+++ /dev/null
@@ -1,60 +0,0 @@
-# Apache Thrift - CMake build
-
-## Goal
-Extend Apache Thrift's *make cross* approach to the build system.
-
-Due to growing the field of operating system support, a proper executable
-and library detection mechanism running on as much platforms as possible
-becomes required. The other aspect to simplify the release process and
-package generation process.
-
-As nice side benefit of CMake is the generation of development environment
-specific soultion files. => No solution files within source tree.
-
-
-## Usage
-just do this:
-
-    mkdir cmake-build && cd cmake-build
-    cmake ..
-
-if you use a specific toolchain pass it to cmake, the same for options:
-
-    cmake -DCMAKE_TOOLCHAIN_FILE=../build/cmake/mingw32-toolchain.cmake ..
-    cmake -DCMAKE_C_COMPILER=clang-3.5 -DCMAKE_CXX_COMPILER=clang++-3.5 ..
-    cmake -DTHRIFT_COMPILER_HS=OFF ..
-    cmake -DWITH_ZLIB=ON ..
-
-or on Windows
-
-    cmake -G "Visual Studio 12 2013 Win64" \
-    -DBOOST_ROOT=C:/3rdparty/boost_1_58_0 \
-    -DZLIB_ROOT=C:/3rdparty/zlib128-dll \
-    -DWITH_SHARED_LIB=off -DWITH_BOOSTTHREADS=ON ..
-
-and open the development environment you like with the solution or do this:
-
-    make
-    make check
-    make cross
-    make dist
-
-to generate an installer and distribution package do this:
-
-    cpack
-
-## TODO
-* git hash or tag based versioning depending on source state
-* build tutorial
-* build test
-* with/without language lib/<lang>/
-* enable/disable
-* make cross
-* make dist (create an alias to make package_source)
-* make doc
-* cpack (C++ and make dist only ?)
-  * thrift-compiler
-  * libthrift
-  * tutorial
-  * test
-* merge into /README.md


[43/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cocoa_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cocoa_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cocoa_generator.cc
deleted file mode 100644
index a90c937..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cocoa_generator.cc
+++ /dev/null
@@ -1,2856 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_oop_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Objective-C code generator.
- *
- * mostly copy/pasting/tweaking from mcslee's work.
- */
-class t_cocoa_generator : public t_oop_generator {
-public:
-  t_cocoa_generator(t_program* program,
-                    const std::map<std::string, std::string>& parsed_options,
-                    const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("log_unexpected");
-    log_unexpected_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("validate_required");
-    validate_required_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("async_clients");
-    async_clients_ = (iter != parsed_options.end());
-
-    out_dir_base_ = "gen-cocoa";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool defval = false,
-                         bool is_property = false);
-  std::string render_const_value(ofstream& out,
-                                 t_type* type,
-                                 t_const_value* value,
-                                 bool containerize_it = false);
-
-  void generate_cocoa_struct(t_struct* tstruct, bool is_exception);
-  void generate_cocoa_struct_interface(std::ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_xception = false);
-  void generate_cocoa_struct_implementation(std::ofstream& out,
-                                            t_struct* tstruct,
-                                            bool is_xception = false,
-                                            bool is_result = false);
-  void generate_cocoa_struct_initializer_signature(std::ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_init_with_coder_method(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    bool is_exception);
-  void generate_cocoa_struct_encode_with_coder_method(ofstream& out,
-                                                      t_struct* tstruct,
-                                                      bool is_exception);
-  void generate_cocoa_struct_hash_method(ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_is_equal_method(ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_field_accessor_declarations(std::ofstream& out,
-                                                         t_struct* tstruct,
-                                                         bool is_exception);
-  void generate_cocoa_struct_field_accessor_implementations(std::ofstream& out,
-                                                            t_struct* tstruct,
-                                                            bool is_exception);
-  void generate_cocoa_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_cocoa_struct_description(std::ofstream& out, t_struct* tstruct);
-
-  std::string function_result_helper_struct_type(t_function* tfunction);
-  std::string function_args_helper_struct_type(t_function* tfunction);
-  void generate_function_helpers(t_function* tfunction);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_cocoa_service_protocol(std::ofstream& out, t_service* tservice);
-  void generate_cocoa_service_async_protocol(std::ofstream& out, t_service* tservice);
-
-  void generate_cocoa_service_client_interface(std::ofstream& out, t_service* tservice);
-  void generate_cocoa_service_client_async_interface(std::ofstream& out, t_service* tservice);
-
-  void generate_cocoa_service_client_send_function_implementation(ofstream& out,
-                                                                  t_function* tfunction);
-  void generate_cocoa_service_client_send_function_invocation(ofstream& out, t_function* tfunction);
-  void generate_cocoa_service_client_recv_function_implementation(ofstream& out,
-                                                                  t_function* tfunction);
-  void generate_cocoa_service_client_implementation(std::ofstream& out, t_service* tservice);
-  void generate_cocoa_service_client_async_implementation(std::ofstream& out, t_service* tservice);
-
-  void generate_cocoa_service_server_interface(std::ofstream& out, t_service* tservice);
-  void generate_cocoa_service_server_implementation(std::ofstream& out, t_service* tservice);
-  void generate_cocoa_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out, t_field* tfield, std::string fieldName);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string fieldName = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out,
-                                       t_list* tlist,
-                                       std::string index,
-                                       std::string listName);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string cocoa_prefix();
-  std::string cocoa_imports();
-  std::string cocoa_thrift_imports();
-  std::string type_name(t_type* ttype, bool class_ref = false);
-  std::string base_type_name(t_base_type* tbase);
-  std::string declare_field(t_field* tfield);
-  std::string declare_property(t_field* tfield);
-  std::string function_signature(t_function* tfunction);
-  std::string async_function_signature(t_function* tfunction);
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string format_string_for_type(t_type* type);
-  std::string call_field_setter(t_field* tfield, std::string fieldName);
-  std::string containerize(t_type* ttype, std::string fieldName);
-  std::string decontainerize(t_field* tfield, std::string fieldName);
-
-  bool type_can_be_null(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception()
-           || ttype->is_string();
-  }
-
-private:
-  std::string cocoa_prefix_;
-  std::string constants_declarations_;
-
-  /**
-   * File streams
-   */
-
-  std::ofstream f_header_;
-  std::ofstream f_impl_;
-
-  bool log_unexpected_;
-  bool validate_required_;
-  bool async_clients_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- */
-void t_cocoa_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  cocoa_prefix_ = program_->get_namespace("cocoa");
-
-  // we have a .h header file...
-  string f_header_name = program_name_ + ".h";
-  string f_header_fullname = get_out_dir() + f_header_name;
-  f_header_.open(f_header_fullname.c_str());
-
-  f_header_ << autogen_comment() << endl;
-
-  f_header_ << cocoa_imports() << cocoa_thrift_imports();
-
-  // ...and a .m implementation file
-  string f_impl_name = get_out_dir() + program_name_ + ".m";
-  f_impl_.open(f_impl_name.c_str());
-
-  f_impl_ << autogen_comment() << endl;
-
-  f_impl_ << cocoa_imports() << cocoa_thrift_imports() << "#import \"" << f_header_name << "\""
-          << endl << endl;
-}
-
-/**
- * Prints standard Cocoa imports
- *
- * @return List of imports for Cocoa libraries
- */
-string t_cocoa_generator::cocoa_imports() {
-  return string() + "#import <Foundation/Foundation.h>\n" + "\n";
-}
-
-/**
- * Prints thrift runtime imports
- *
- * @return List of imports necessary for thrift runtime
- */
-string t_cocoa_generator::cocoa_thrift_imports() {
-  string result = string() + "#import \"TProtocol.h\"\n" + "#import \"TApplicationException.h\"\n"
-                  + "#import \"TProtocolException.h\"\n" 
-                  + "#import \"TProtocolUtil.h\"\n"
-                  + "#import \"TProcessor.h\"\n" 
-                  + "#import \"TObjective-C.h\"\n"
-                  + "#import \"TBase.h\"\n"
-                  + "#import \"TAsyncTransport.h\"\n"
-                  + "#import \"TProtocolFactory.h\"\n"
-                  + "#import \"TBaseClient.h\"\n" 
-                  + "\n";
-
-  // Include other Thrift includes
-  const vector<t_program*>& includes = program_->get_includes();
-  for (size_t i = 0; i < includes.size(); ++i) {
-    result += "#import \"" + includes[i]->get_name() + ".h\"" + "\n";
-  }
-  result += "\n";
-
-  return result;
-}
-
-/**
- * Finish up generation.
- */
-void t_cocoa_generator::close_generator() {
-  // stick our constants declarations at the end of the header file
-  // since they refer to things we are defining.
-  f_header_ << constants_declarations_ << endl;
-}
-
-/**
- * Generates a typedef. This is just a simple 1-liner in objective-c
- *
- * @param ttypedef The type definition
- */
-void t_cocoa_generator::generate_typedef(t_typedef* ttypedef) {
-  f_header_ << indent() << "typedef " << type_name(ttypedef->get_type()) << " " << cocoa_prefix_
-            << ttypedef->get_symbolic() << ";" << endl << endl;
-}
-
-/**
- * Generates code for an enumerated type. In Objective-C, this is
- * essentially the same as the thrift definition itself, using the
- * enum keyword in Objective-C.  For namespace purposes, the name of
- * the enum plus an underscore is prefixed onto each element.
- *
- * @param tenum The enumeration
- */
-void t_cocoa_generator::generate_enum(t_enum* tenum) {
-  f_header_ << indent() << "enum " << cocoa_prefix_ << tenum->get_name() << " {" << endl;
-  indent_up();
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  bool first = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_header_ << "," << endl;
-    }
-    f_header_ << indent() << tenum->get_name() << "_" << (*c_iter)->get_name();
-    f_header_ << " = " << (*c_iter)->get_value();
-  }
-
-  indent_down();
-  f_header_ << endl << "};" << endl << endl;
-}
-
-/**
- * Generates a class that holds all the constants.  Primitive values
- * could have been placed outside this class, but I just put
- * everything in for consistency.
- */
-void t_cocoa_generator::generate_consts(std::vector<t_const*> consts) {
-  std::ostringstream const_interface;
-  string constants_class_name = cocoa_prefix_ + program_name_ + "Constants";
-
-  const_interface << "@interface " << constants_class_name << " : NSObject ";
-  scope_up(const_interface);
-  scope_down(const_interface);
-
-  // getter method for each constant defined.
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    t_type* type = (*c_iter)->get_type();
-    const_interface << "+ (" << type_name(type) << ") " << name << ";" << endl;
-  }
-
-  const_interface << "@end";
-
-  // this gets spit into the header file in ::close_generator
-  constants_declarations_ = const_interface.str();
-
-  // static variables in the .m hold all constant values
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    t_type* type = (*c_iter)->get_type();
-    f_impl_ << "static " << type_name(type) << " " << cocoa_prefix_ << name;
-    if (!type->is_container() && !type->is_struct()) {
-      f_impl_ << " = " << render_const_value(f_impl_, type, (*c_iter)->get_value());
-    }
-    f_impl_ << ";" << endl;
-  }
-  f_impl_ << endl;
-
-  f_impl_ << "@implementation " << constants_class_name << endl;
-
-  // initialize complex constants when the class is loaded
-  f_impl_ << "+ (void) initialize ";
-  scope_up(f_impl_);
-
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    if ((*c_iter)->get_type()->is_container() || (*c_iter)->get_type()->is_struct()) {
-      print_const_value(f_impl_,
-                        cocoa_prefix_ + (*c_iter)->get_name(),
-                        (*c_iter)->get_type(),
-                        (*c_iter)->get_value(),
-                        false,
-                        false);
-      f_impl_ << ";" << endl;
-    }
-  }
-  scope_down(f_impl_);
-
-  // getter method for each constant
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    t_type* type = (*c_iter)->get_type();
-    f_impl_ << "+ (" << type_name(type) << ") " << name;
-    scope_up(f_impl_);
-    indent(f_impl_) << "return " << cocoa_prefix_ << name << ";" << endl;
-    scope_down(f_impl_);
-  }
-
-  f_impl_ << "@end" << endl << endl;
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is a class
- * with protected data members, read(), write(), and getters and setters.
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_struct(t_struct* tstruct) {
-  generate_cocoa_struct_interface(f_header_, tstruct, false);
-  generate_cocoa_struct_implementation(f_impl_, tstruct, false);
-}
-
-/**
- * Exceptions are structs, but they inherit from NSException
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_xception(t_struct* txception) {
-  generate_cocoa_struct_interface(f_header_, txception, true);
-  generate_cocoa_struct_implementation(f_impl_, txception, true);
-}
-
-/**
- * Generate the interface for a struct
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_interface(ofstream& out,
-                                                        t_struct* tstruct,
-                                                        bool is_exception) {
-  out << "@interface " << cocoa_prefix_ << tstruct->get_name() << " : ";
-
-  if (is_exception) {
-    out << "NSException ";
-  } else {
-    out << "NSObject ";
-  }
-  out << "<TBase, NSCoding> ";
-
-  scope_up(out);
-
-  // members are protected.  this is redundant, but explicit.
-  //  f_header_ << endl << "@protected:" << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-
-  // member varialbes
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << indent() << declare_field(*m_iter) << endl;
-  }
-
-  if (members.size() > 0) {
-    out << endl;
-    // isset fields
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      indent(out) << "BOOL __" << (*m_iter)->get_name() << "_isset;" << endl;
-    }
-  }
-
-  scope_down(out);
-  out << endl;
-
-  // properties
-  if (members.size() > 0) {
-    out << "#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)"
-        << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      out << indent() << declare_property(*m_iter) << endl;
-    }
-    out << "#endif" << endl << endl;
-  }
-
-  // default initializer
-  out << indent() << "- (id) init;" << endl;
-
-  // initializer for all fields
-  if (!members.empty()) {
-    generate_cocoa_struct_initializer_signature(out, tstruct);
-    out << ";" << endl;
-  }
-  out << endl;
-
-  // read and write
-  out << "- (void) read: (id <TProtocol>) inProtocol;" << endl;
-  out << "- (void) write: (id <TProtocol>) outProtocol;" << endl;
-  out << endl;
-
-  // validator
-  out << "- (void) validate;" << endl << endl;
-
-  // getters and setters
-  generate_cocoa_struct_field_accessor_declarations(out, tstruct, is_exception);
-
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generate signature for initializer of struct with a parameter for
- * each field.
- */
-void t_cocoa_generator::generate_cocoa_struct_initializer_signature(ofstream& out,
-                                                                    t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  indent(out) << "- (id) initWith";
-  for (m_iter = members.begin(); m_iter != members.end();) {
-    if (m_iter == members.begin()) {
-      out << capitalize((*m_iter)->get_name());
-    } else {
-      out << (*m_iter)->get_name();
-    }
-    out << ": (" << type_name((*m_iter)->get_type()) << ") " << (*m_iter)->get_name();
-    ++m_iter;
-    if (m_iter != members.end()) {
-      out << " ";
-    }
-  }
-}
-
-/**
- * Generate getter and setter declarations for all fields, plus an
- * IsSet getter.
- */
-void t_cocoa_generator::generate_cocoa_struct_field_accessor_declarations(ofstream& out,
-                                                                          t_struct* tstruct,
-                                                                          bool is_exception) {
-  (void)is_exception;
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << indent() << "#if !__has_feature(objc_arc)" << endl;
-    out << indent() << "- (" << type_name((*m_iter)->get_type()) << ") "
-        << decapitalize((*m_iter)->get_name()) << ";" << endl;
-    out << indent() << "- (void) set" << capitalize((*m_iter)->get_name()) << ": ("
-        << type_name((*m_iter)->get_type()) << ") " << (*m_iter)->get_name() << ";" << endl;
-    out << indent() << "#endif" << endl;
-    out << indent() << "- (BOOL) " << (*m_iter)->get_name() << "IsSet;" << endl << endl;
-  }
-}
-
-/**
- * Generate the initWithCoder method for this struct so it's compatible with
- * the NSCoding protocol
- */
-void t_cocoa_generator::generate_cocoa_struct_init_with_coder_method(ofstream& out,
-                                                                     t_struct* tstruct,
-                                                                     bool is_exception) {
-  indent(out) << "- (id) initWithCoder: (NSCoder *) decoder" << endl;
-  scope_up(out);
-  if (is_exception) {
-    // NSExceptions conform to NSCoding, so we can call super
-    out << indent() << "self = [super initWithCoder: decoder];" << endl;
-  } else {
-    out << indent() << "self = [super init];" << endl;
-  }
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    out << indent() << "if ([decoder containsValueForKey: @\"" << (*m_iter)->get_name() << "\"])"
-        << endl;
-    scope_up(out);
-    out << indent() << "__" << (*m_iter)->get_name() << " = ";
-    if (type_can_be_null(t)) {
-      out << "[[decoder decodeObjectForKey: @\"" << (*m_iter)->get_name() << "\"] retain_stub];"
-          << endl;
-    } else if (t->is_enum()) {
-      out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-    } else {
-      t_base_type::t_base tbase = ((t_base_type*)t)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_BOOL:
-        out << "[decoder decodeBoolForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I16:
-        out << "[decoder decodeIntForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I32:
-        out << "[decoder decodeInt32ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I64:
-        out << "[decoder decodeInt64ForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "[decoder decodeDoubleForKey: @\"" << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      default:
-        throw "compiler error: don't know how to decode thrift type: "
-            + t_base_type::t_base_name(tbase);
-      }
-    }
-    out << indent() << "__" << (*m_iter)->get_name() << "_isset = YES;" << endl;
-    scope_down(out);
-  }
-
-  out << indent() << "return self;" << endl;
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generate the encodeWithCoder method for this struct so it's compatible with
- * the NSCoding protocol
- */
-void t_cocoa_generator::generate_cocoa_struct_encode_with_coder_method(ofstream& out,
-                                                                       t_struct* tstruct,
-                                                                       bool is_exception) {
-  indent(out) << "- (void) encodeWithCoder: (NSCoder *) encoder" << endl;
-  scope_up(out);
-  if (is_exception) {
-    // NSExceptions conform to NSCoding, so we can call super
-    out << indent() << "[super encodeWithCoder: encoder];" << endl;
-  }
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    out << indent() << "if (__" << (*m_iter)->get_name() << "_isset)" << endl;
-    scope_up(out);
-    // out << indent() << "__" << (*m_iter)->get_name() << " = ";
-    if (type_can_be_null(t)) {
-      out << indent() << "[encoder encodeObject: __" << (*m_iter)->get_name() << " forKey: @\""
-          << (*m_iter)->get_name() << "\"];" << endl;
-    } else if (t->is_enum()) {
-      out << indent() << "[encoder encodeInt: __" << (*m_iter)->get_name() << " forKey: @\""
-          << (*m_iter)->get_name() << "\"];" << endl;
-    } else {
-      t_base_type::t_base tbase = ((t_base_type*)t)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_BOOL:
-        out << indent() << "[encoder encodeBool: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << indent() << "[encoder encodeInt: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I16:
-        out << indent() << "[encoder encodeInt: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I32:
-        out << indent() << "[encoder encodeInt32: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_I64:
-        out << indent() << "[encoder encodeInt64: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << indent() << "[encoder encodeDouble: __" << (*m_iter)->get_name() << " forKey: @\""
-            << (*m_iter)->get_name() << "\"];" << endl;
-        break;
-      default:
-        throw "compiler error: don't know how to encode thrift type: "
-            + t_base_type::t_base_name(tbase);
-      }
-    }
-    scope_down(out);
-  }
-
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generate the hash method for this struct
- */
-void t_cocoa_generator::generate_cocoa_struct_hash_method(ofstream& out, t_struct* tstruct) {
-  indent(out) << "- (NSUInteger) hash" << endl;
-  scope_up(out);
-  out << indent() << "NSUInteger hash = 17;" << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    out << indent() << "hash = (hash * 31) ^ __" << (*m_iter)->get_name()
-        << "_isset ? 2654435761 : 0;" << endl;
-    out << indent() << "if (__" << (*m_iter)->get_name() << "_isset)" << endl;
-    scope_up(out);
-    if (type_can_be_null(t)) {
-      out << indent() << "hash = (hash * 31) ^ [__" << (*m_iter)->get_name() << " hash];" << endl;
-    } else {
-      out << indent() << "hash = (hash * 31) ^ [@(__" << (*m_iter)->get_name() << ") hash];"
-          << endl;
-    }
-    scope_down(out);
-  }
-
-  out << indent() << "return hash;" << endl;
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generate the isEqual method for this struct
- */
-void t_cocoa_generator::generate_cocoa_struct_is_equal_method(ofstream& out, t_struct* tstruct) {
-  indent(out) << "- (BOOL) isEqual: (id) anObject" << endl;
-  scope_up(out);
-
-  indent(out) << "if (self == anObject) {" << endl;
-  indent_up();
-  indent(out) << "return YES;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  string class_name = cocoa_prefix_ + tstruct->get_name();
-
-  indent(out) << "if (![anObject isKindOfClass:[" << class_name << " class]]) {" << endl;
-  indent_up();
-  indent(out) << "return NO;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent(out) << class_name << " *other = (" << class_name << " *)anObject;" << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    string name = (*m_iter)->get_name();
-    if (type_can_be_null(t)) {
-      out << indent() << "if ((__" << name << "_isset != other->__" << name << "_isset) ||" << endl
-          << indent() << "    "
-          << "(__" << name << "_isset && "
-          << "((__" << name << " || other->__" << name << ") && "
-          << "![__" << name << " isEqual:other->__" << name << "]))) {" << endl;
-    } else {
-      out << indent() << "if ((__" << name << "_isset != other->__" << name << "_isset) ||" << endl
-          << indent() << "    "
-          << "(__" << name << "_isset && "
-          << "(__" << name << " != other->__" << name << "))) {" << endl;
-    }
-    indent_up();
-    indent(out) << "return NO;" << endl;
-    indent_down();
-    indent(out) << "}" << endl;
-  }
-
-  out << indent() << "return YES;" << endl;
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generate struct implementation.
- *
- * @param tstruct      The struct definition
- * @param is_exception Is this an exception?
- * @param is_result    If this is a result it needs a different writer
- */
-void t_cocoa_generator::generate_cocoa_struct_implementation(ofstream& out,
-                                                             t_struct* tstruct,
-                                                             bool is_exception,
-                                                             bool is_result) {
-  indent(out) << "@implementation " << cocoa_prefix_ << tstruct->get_name() << endl << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  // exceptions need to call the designated initializer on NSException
-  if (is_exception) {
-    out << indent() << "- (id) init" << endl;
-    scope_up(out);
-    out << indent() << "return [super initWithName: @\"" << cocoa_prefix_ << tstruct->get_name()
-        << "\" reason: @\"unknown\" userInfo: nil];" << endl;
-    scope_down(out);
-    out << endl;
-  } else {
-    // struct
-
-    // default initializer
-    // setup instance variables with default values
-    indent(out) << "- (id) init" << endl;
-    scope_up(out);
-    indent(out) << "self = [super init];" << endl;
-    if (members.size() > 0) {
-      out << "#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5)"
-          << endl;
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        t_type* t = get_true_type((*m_iter)->get_type());
-        if ((*m_iter)->get_value() != NULL) {
-          print_const_value(out,
-                            "self." + (*m_iter)->get_name(),
-                            t,
-                            (*m_iter)->get_value(),
-                            false,
-                            true);
-        }
-      }
-      out << "#endif" << endl;
-    }
-    indent(out) << "return self;" << endl;
-    scope_down(out);
-    out << endl;
-  }
-
-  // initializer with all fields as params
-  if (!members.empty()) {
-    generate_cocoa_struct_initializer_signature(out, tstruct);
-    out << endl;
-    scope_up(out);
-    if (is_exception) {
-      out << indent() << "self = [self init];" << endl;
-    } else {
-      out << indent() << "self = [super init];" << endl;
-    }
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      out << indent() << "__" << (*m_iter)->get_name() << " = ";
-      if (type_can_be_null(t)) {
-        out << "[" << (*m_iter)->get_name() << " retain_stub];" << endl;
-      } else {
-        out << (*m_iter)->get_name() << ";" << endl;
-      }
-      out << indent() << "__" << (*m_iter)->get_name() << "_isset = YES;" << endl;
-    }
-
-    out << indent() << "return self;" << endl;
-    scope_down(out);
-    out << endl;
-  }
-
-  // initWithCoder for NSCoding
-  generate_cocoa_struct_init_with_coder_method(out, tstruct, is_exception);
-  // encodeWithCoder for NSCoding
-  generate_cocoa_struct_encode_with_coder_method(out, tstruct, is_exception);
-  // hash and isEqual for NSObject
-  generate_cocoa_struct_hash_method(out, tstruct);
-  generate_cocoa_struct_is_equal_method(out, tstruct);
-
-  // dealloc
-  if (!members.empty()) {
-    out << "- (void) dealloc" << endl;
-    scope_up(out);
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if (type_can_be_null(t)) {
-        indent(out) << "[__" << (*m_iter)->get_name() << " release_stub];" << endl;
-      }
-    }
-
-    out << indent() << "[super dealloc_stub];" << endl;
-    scope_down(out);
-    out << endl;
-  }
-
-  // the rest of the methods
-  generate_cocoa_struct_field_accessor_implementations(out, tstruct, is_exception);
-  generate_cocoa_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_cocoa_struct_result_writer(out, tstruct);
-  } else {
-    generate_cocoa_struct_writer(out, tstruct);
-  }
-  generate_cocoa_struct_validator(out, tstruct);
-  generate_cocoa_struct_description(out, tstruct);
-
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a function to read all the fields of the struct.
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_reader(ofstream& out, t_struct* tstruct) {
-  out << "- (void) read: (id <TProtocol>) inProtocol" << endl;
-  scope_up(out);
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Declare stack tmp variables
-  indent(out) << "NSString * fieldName;" << endl;
-  indent(out) << "int fieldType;" << endl;
-  indent(out) << "int fieldID;" << endl;
-  out << endl;
-
-  indent(out) << "[inProtocol readStructBeginReturningName: NULL];" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  // Read beginning field marker
-  indent(out)
-      << "[inProtocol readFieldBeginReturningName: &fieldName type: &fieldType fieldID: &fieldID];"
-      << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if (fieldType == TType_STOP) { " << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Switch statement on the field we are reading
-  indent(out) << "switch (fieldID)" << endl;
-
-  scope_up(out);
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-    indent_up();
-    indent(out) << "if (fieldType == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    generate_deserialize_field(out, *f_iter, "fieldValue");
-    indent(out) << call_field_setter(*f_iter, "fieldValue") << endl;
-    // if this is an allocated field, release it since the struct
-    // is now retaining it
-    if (type_can_be_null((*f_iter)->get_type())) {
-      // deserialized strings are autorelease, so don't release them
-      if (!(get_true_type((*f_iter)->get_type())->is_string())) {
-        indent(out) << "[fieldValue release_stub];" << endl;
-      }
-    }
-
-    indent_down();
-    out << indent() << "} else { " << endl;
-    if (log_unexpected_) {
-      out << indent() << "  NSLog(@\"%s: field ID %i has unexpected type %i.  Skipping.\", "
-                         "__PRETTY_FUNCTION__, fieldID, fieldType);" << endl;
-    }
-    out << indent() << "  [TProtocolUtil skipType: fieldType onProtocol: inProtocol];" << endl
-        << indent() << "}" << endl << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  out << indent() << "default:" << endl;
-  if (log_unexpected_) {
-    out << indent() << "  NSLog(@\"%s: unexpected field ID %i with type %i.  Skipping.\", "
-                       "__PRETTY_FUNCTION__, fieldID, fieldType);" << endl;
-  }
-  out << indent() << "  [TProtocolUtil skipType: fieldType onProtocol: inProtocol];" << endl
-      << indent() << "  break;" << endl;
-
-  scope_down(out);
-
-  // Read field end marker
-  indent(out) << "[inProtocol readFieldEnd];" << endl;
-
-  scope_down(out);
-
-  out << indent() << "[inProtocol readStructEnd];" << endl;
-
-  // performs various checks (e.g. check that all required fields are set)
-  if (validate_required_) {
-    out << indent() << "[self validate];" << endl;
-  }
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "- (void) write: (id <TProtocol>) outProtocol {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "[outProtocol writeStructBeginWithName: @\"" << name << "\"];" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if (__" << (*f_iter)->get_name() << "_isset) {" << endl;
-    indent_up();
-    bool null_allowed = type_can_be_null((*f_iter)->get_type());
-    if (null_allowed) {
-      out << indent() << "if (__" << (*f_iter)->get_name() << " != nil) {" << endl;
-      indent_up();
-    }
-
-    indent(out) << "[outProtocol writeFieldBeginWithName: @\"" << (*f_iter)->get_name()
-                << "\" type: " << type_to_enum((*f_iter)->get_type())
-                << " fieldID: " << (*f_iter)->get_key() << "];" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "__" + (*f_iter)->get_name());
-
-    // Write field closer
-    indent(out) << "[outProtocol writeFieldEnd];" << endl;
-
-    if (null_allowed) {
-      scope_down(out);
-    }
-    scope_down(out);
-  }
-  // Write the struct map
-  out << indent() << "[outProtocol writeFieldStop];" << endl << indent()
-      << "[outProtocol writeStructEnd];" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct, which
- * is a function result. These fields are only written if they are
- * set, and only one of them can be set at a time.
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "- (void) write: (id <TProtocol>) outProtocol {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "[outProtocol writeStructBeginWithName: @\"" << name << "\"];" << endl;
-
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << endl << indent() << "if ";
-    } else {
-      out << " else if ";
-    }
-
-    out << "(__" << (*f_iter)->get_name() << "_isset) {" << endl;
-    indent_up();
-
-    bool null_allowed = type_can_be_null((*f_iter)->get_type());
-    if (null_allowed) {
-      out << indent() << "if (__" << (*f_iter)->get_name() << " != nil) {" << endl;
-      indent_up();
-    }
-
-    indent(out) << "[outProtocol writeFieldBeginWithName: @\"" << (*f_iter)->get_name()
-                << "\" type: " << type_to_enum((*f_iter)->get_type())
-                << " fieldID: " << (*f_iter)->get_key() << "];" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "__" + (*f_iter)->get_name());
-
-    // Write field closer
-    indent(out) << "[outProtocol writeFieldEnd];" << endl;
-
-    if (null_allowed) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-
-    indent_down();
-    indent(out) << "}";
-  }
-  // Write the struct map
-  out << endl << indent() << "[outProtocol writeFieldStop];" << endl << indent()
-      << "[outProtocol writeStructEnd];" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to perform various checks
- * (e.g. check that all required fields are set)
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_validator(ofstream& out, t_struct* tstruct) {
-  out << indent() << "- (void) validate {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "// check for required fields" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = (*f_iter);
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      out << indent() << "if (!__" << field->get_name() << "_isset) {" << endl << indent()
-          << "  @throw [TProtocolException exceptionWithName: @\"TProtocolException\"" << endl
-          << indent() << "                             reason: @\"Required field '"
-          << (*f_iter)->get_name() << "' is not set.\"];" << endl << indent() << "}" << endl;
-    }
-  }
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generate property accessor methods for all fields in the struct.
- * getter, setter, isset getter.
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_field_accessor_implementations(ofstream& out,
-                                                                             t_struct* tstruct,
-                                                                             bool is_exception) {
-  (void)is_exception;
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = field_name;
-    cap_name[0] = toupper(cap_name[0]);
-
-    // Simple getter
-    indent(out) << "- (" << type_name(type) << ") ";
-    out << field_name << " {" << endl;
-    indent_up();
-    if (!type_can_be_null(type)) {
-      indent(out) << "return __" << field_name << ";" << endl;
-    } else {
-      indent(out) << "return [[__" << field_name << " retain_stub] autorelease_stub];" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Simple setter
-    indent(out) << "- (void) set" << cap_name << ": (" << type_name(type) << ") " << field_name
-                << " {" << endl;
-    indent_up();
-    if (!type_can_be_null(type)) {
-      indent(out) << "__" << field_name << " = " << field_name << ";" << endl;
-    } else {
-      indent(out) << "[" << field_name << " retain_stub];" << endl;
-      indent(out) << "[__" << field_name << " release_stub];" << endl;
-      indent(out) << "__" << field_name << " = " << field_name << ";" << endl;
-    }
-    indent(out) << "__" << field_name << "_isset = YES;" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // IsSet
-    indent(out) << "- (BOOL) " << field_name << "IsSet {" << endl;
-    indent_up();
-    indent(out) << "return __" << field_name << "_isset;" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Unsetter - do we need this?
-    indent(out) << "- (void) unset" << cap_name << " {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "[__" << field_name << " release_stub];" << endl;
-      indent(out) << "__" << field_name << " = nil;" << endl;
-    }
-    indent(out) << "__" << field_name << "_isset = NO;" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a description method for the given struct
- *
- * @param tstruct The struct definition
- */
-void t_cocoa_generator::generate_cocoa_struct_description(ofstream& out, t_struct* tstruct) {
-  out << indent() << "- (NSString *) description {" << endl;
-  indent_up();
-
-  out << indent() << "NSMutableString * ms = [NSMutableString stringWithString: @\""
-      << cocoa_prefix_ << tstruct->get_name() << "(\"];" << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      indent(out) << "[ms appendString: @\"" << (*f_iter)->get_name() << ":\"];" << endl;
-    } else {
-      indent(out) << "[ms appendString: @\"," << (*f_iter)->get_name() << ":\"];" << endl;
-    }
-    t_type* ttype = (*f_iter)->get_type();
-    indent(out) << "[ms appendFormat: @\"" << format_string_for_type(ttype) << "\", __"
-                << (*f_iter)->get_name() << "];" << endl;
-  }
-  out << indent() << "[ms appendString: @\")\"];" << endl << indent()
-      << "return [NSString stringWithString: ms];" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a thrift service.  In Objective-C this consists of a
- * protocol definition, a client interface and a client implementation.
- *
- * @param tservice The service definition
- */
-void t_cocoa_generator::generate_service(t_service* tservice) {
-  generate_cocoa_service_protocol(f_header_, tservice);
-  generate_cocoa_service_client_interface(f_header_, tservice);
-  generate_cocoa_service_server_interface(f_header_, tservice);
-  generate_cocoa_service_helpers(tservice);
-  generate_cocoa_service_client_implementation(f_impl_, tservice);
-  generate_cocoa_service_server_implementation(f_impl_, tservice);
-  if (async_clients_) {
-    generate_cocoa_service_async_protocol(f_header_, tservice);
-    generate_cocoa_service_client_async_interface(f_header_, tservice);
-    generate_cocoa_service_client_async_implementation(f_impl_, tservice);
-  }
-}
-
-/**
- * Generates structs for all the service return types
- *
- * @param tservice The service
- */
-void t_cocoa_generator::generate_cocoa_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_cocoa_struct_interface(f_impl_, ts, false);
-    generate_cocoa_struct_implementation(f_impl_, ts, false, false);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-string t_cocoa_generator::function_result_helper_struct_type(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return capitalize(tfunction->get_name());
-  } else {
-    return capitalize(tfunction->get_name()) + "_result";
-  }
-}
-
-string t_cocoa_generator::function_args_helper_struct_type(t_function* tfunction) {
-  return tfunction->get_name() + "_args";
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_cocoa_generator::generate_function_helpers(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return;
-  }
-
-  // create a result struct with a success field of the return type,
-  // and a field for each type of exception thrown
-  t_struct result(program_, function_result_helper_struct_type(tfunction));
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  // generate the result struct
-  generate_cocoa_struct_interface(f_impl_, &result, false);
-  generate_cocoa_struct_implementation(f_impl_, &result, false, true);
-}
-
-/**
- * Generates a service protocol definition.
- *
- * @param tservice The service to generate a protocol definition for
- */
-void t_cocoa_generator::generate_cocoa_service_protocol(ofstream& out, t_service* tservice) {
-  out << "@protocol " << cocoa_prefix_ << tservice->get_name() << " <NSObject>" << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    out << "- " << function_signature(*f_iter) << ";"
-        << "  // throws ";
-    t_struct* xs = (*f_iter)->get_xceptions();
-    const std::vector<t_field*>& xceptions = xs->get_members();
-    vector<t_field*>::const_iterator x_iter;
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      out << type_name((*x_iter)->get_type()) + ", ";
-    }
-    out << "TException" << endl;
-  }
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates an asynchronous service protocol definition.
- *
- * @param tservice The service to generate a protocol definition for
- */
-void t_cocoa_generator::generate_cocoa_service_async_protocol(ofstream& out, t_service* tservice) {
-  out << "@protocol " << cocoa_prefix_ << tservice->get_name() << "Async"
-      << " <NSObject>" << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    out << "- " << async_function_signature(*f_iter) << ";" << endl;
-  }
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a service client interface definition.
- *
- * @param tservice The service to generate a client interface definition for
- */
-void t_cocoa_generator::generate_cocoa_service_client_interface(ofstream& out,
-                                                                t_service* tservice) {
-  out << "@interface " << cocoa_prefix_ << tservice->get_name() << "Client : TBaseClient <"
-      << cocoa_prefix_ << tservice->get_name() << "> ";
-
-  out << "- (id) initWithProtocol: (id <TProtocol>) protocol;" << endl;
-  out << "- (id) initWithInProtocol: (id <TProtocol>) inProtocol outProtocol: (id <TProtocol>) "
-         "outProtocol;" << endl;
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a service client interface definition.
- *
- * @param tservice The service to generate a client interface definition for
- */
-void t_cocoa_generator::generate_cocoa_service_client_async_interface(ofstream& out,
-                                                                      t_service* tservice) {
-  out << "@interface " << cocoa_prefix_ << tservice->get_name() << "ClientAsync : TBaseClient <"
-      << cocoa_prefix_ << tservice->get_name() << "Async> ";
-
-  scope_up(out);
-  out << indent() << "id <TAsyncTransport> asyncTransport;" << endl;
-  scope_down(out);
-
-  out << "- (id) initWithProtocolFactory: (id <TProtocolFactory>) factory "
-         "transport: (id <TAsyncTransport>) transport;" << endl;
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a service server interface definition. In other words, the TProcess implementation for
- *the
- * service definition.
- *
- * @param tservice The service to generate a client interface definition for
- */
-void t_cocoa_generator::generate_cocoa_service_server_interface(ofstream& out,
-                                                                t_service* tservice) {
-  out << "@interface " << cocoa_prefix_ << tservice->get_name()
-      << "Processor : NSObject <TProcessor> ";
-
-  scope_up(out);
-  out << indent() << "id <" << cocoa_prefix_ << tservice->get_name() << "> mService;" << endl;
-  out << indent() << "NSDictionary * mMethodMap;" << endl;
-  scope_down(out);
-
-  out << "- (id) initWith" << tservice->get_name() << ": (id <" << cocoa_prefix_
-      << tservice->get_name() << ">) service;" << endl;
-  out << "- (id<" << cocoa_prefix_ << tservice->get_name() << ">) service;" << endl;
-
-  out << "@end" << endl << endl;
-}
-
-void t_cocoa_generator::generate_cocoa_service_client_send_function_implementation(
-    ofstream& out,
-    t_function* tfunction) {
-  string funname = tfunction->get_name();
-
-  t_function send_function(g_type_void,
-                           string("send_") + tfunction->get_name(),
-                           tfunction->get_arglist());
-
-  string argsname = tfunction->get_name() + "_args";
-
-  // Open function
-  indent(out) << "- " << function_signature(&send_function) << endl;
-  scope_up(out);
-
-  // Serialize the request
-  out << indent() << "[outProtocol writeMessageBeginWithName: @\"" << funname << "\""
-      << (tfunction->is_oneway() ? " type: TMessageType_ONEWAY" : " type: TMessageType_CALL")
-      << " sequenceID: 0];" << endl;
-
-  out << indent() << "[outProtocol writeStructBeginWithName: @\"" << argsname << "\"];" << endl;
-
-  // write out function parameters
-  t_struct* arg_struct = tfunction->get_arglist();
-  const vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator fld_iter;
-  for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    string fieldName = (*fld_iter)->get_name();
-    if (type_can_be_null((*fld_iter)->get_type())) {
-      out << indent() << "if (" << fieldName << " != nil)";
-      scope_up(out);
-    }
-    out << indent() << "[outProtocol writeFieldBeginWithName: @\"" << fieldName
-        << "\""
-           " type: " << type_to_enum((*fld_iter)->get_type())
-        << " fieldID: " << (*fld_iter)->get_key() << "];" << endl;
-
-    generate_serialize_field(out, *fld_iter, fieldName);
-
-    out << indent() << "[outProtocol writeFieldEnd];" << endl;
-
-    if (type_can_be_null((*fld_iter)->get_type())) {
-      indent_down();
-      out << indent() << "}" << endl;
-    }
-  }
-
-  out << indent() << "[outProtocol writeFieldStop];" << endl;
-  out << indent() << "[outProtocol writeStructEnd];" << endl;
-  out << indent() << "[outProtocol writeMessageEnd];" << endl;
-  scope_down(out);
-  out << endl;
-}
-
-void t_cocoa_generator::generate_cocoa_service_client_recv_function_implementation(
-    ofstream& out,
-    t_function* tfunction) {
-  t_struct noargs(program_);
-  t_function recv_function(tfunction->get_returntype(),
-                           string("recv_") + tfunction->get_name(),
-                           &noargs,
-                           tfunction->get_xceptions());
-  // Open function
-  indent(out) << "- " << function_signature(&recv_function) << endl;
-  scope_up(out);
-
-  // TODO(mcslee): Message validation here, was the seqid etc ok?
-
-  // check for an exception
-  out << indent() << "TApplicationException * x = [self checkIncomingMessageException];" << endl
-      << indent() << "if (x != nil)";
-  scope_up(out);
-  out << indent() << "@throw x;" << endl;
-  scope_down(out);
-
-  // FIXME - could optimize here to reduce creation of temporary objects.
-  string resultname = function_result_helper_struct_type(tfunction);
-  out << indent() << cocoa_prefix_ << resultname << " * result = [[[" << cocoa_prefix_ << resultname
-      << " alloc] init] autorelease_stub];" << endl;
-  indent(out) << "[result read: inProtocol];" << endl;
-  indent(out) << "[inProtocol readMessageEnd];" << endl;
-
-  // Careful, only return _result if not a void function
-  if (!tfunction->get_returntype()->is_void()) {
-    out << indent() << "if ([result successIsSet]) {" << endl << indent()
-        << "  return [result success];" << endl << indent() << "}" << endl;
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-  for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-    out << indent() << "if ([result " << (*x_iter)->get_name() << "IsSet]) {" << endl << indent()
-        << "  @throw [result " << (*x_iter)->get_name() << "];" << endl << indent() << "}" << endl;
-  }
-
-  // If you get here it's an exception, unless a void function
-  if (tfunction->get_returntype()->is_void()) {
-    indent(out) << "return;" << endl;
-  } else {
-    out << indent() << "@throw [TApplicationException exceptionWithType: "
-                       "TApplicationException_MISSING_RESULT" << endl << indent()
-        << "                                         reason: @\"" << tfunction->get_name()
-        << " failed: unknown result\"];" << endl;
-  }
-
-  // Close function
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generates an invocation of a given 'send_' function.
- *
- * @param tfunction The service to generate an implementation for
- */
-void t_cocoa_generator::generate_cocoa_service_client_send_function_invocation(
-    ofstream& out,
-    t_function* tfunction) {
-  t_struct* arg_struct = tfunction->get_arglist();
-  const vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator fld_iter;
-  indent(out) << "[self send_" << tfunction->get_name();
-  bool first = true;
-  for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    string fieldName = (*fld_iter)->get_name();
-    out << " ";
-    if (first) {
-      first = false;
-      out << ": " << fieldName;
-    } else {
-      out << fieldName << ": " << fieldName;
-    }
-  }
-  out << "];" << endl;
-}
-
-/**
- * Generates a service client implementation.
- *
- * @param tservice The service to generate an implementation for
- */
-void t_cocoa_generator::generate_cocoa_service_client_implementation(ofstream& out,
-                                                                     t_service* tservice) {
-  out << "@implementation " << cocoa_prefix_ << tservice->get_name() << "Client" << endl;
-
-  // initializers
-  out << "- (id) initWithProtocol: (id <TProtocol>) protocol" << endl;
-  scope_up(out);
-  out << indent() << "return [self initWithInProtocol: protocol outProtocol: protocol];" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << "- (id) initWithInProtocol: (id <TProtocol>) anInProtocol outProtocol: (id <TProtocol>) "
-         "anOutProtocol" << endl;
-  scope_up(out);
-  out << indent() << "self = [super init];" << endl;
-  out << indent() << "inProtocol = [anInProtocol retain_stub];" << endl;
-  out << indent() << "outProtocol = [anOutProtocol retain_stub];" << endl;
-  out << indent() << "return self;" << endl;
-  scope_down(out);
-  out << endl;
-
-  // generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-
-    generate_cocoa_service_client_send_function_implementation(out, *f_iter);
-
-    if (!(*f_iter)->is_oneway()) {
-      generate_cocoa_service_client_recv_function_implementation(out, *f_iter);
-    }
-
-    // Open function
-    indent(out) << "- " << function_signature(*f_iter) << endl;
-    scope_up(out);
-    generate_cocoa_service_client_send_function_invocation(out, *f_iter);
-
-    out << indent() << "[[outProtocol transport] flush];" << endl;
-    if (!(*f_iter)->is_oneway()) {
-      out << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        out << "return ";
-      }
-      out << "[self recv_" << (*f_iter)->get_name() << "];" << endl;
-    }
-    scope_down(out);
-    out << endl;
-  }
-  indent_down();
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a service client implementation for its asynchronous interface.
- *
- * @param tservice The service to generate an implementation for
- */
-void t_cocoa_generator::generate_cocoa_service_client_async_implementation(ofstream& out,
-                                                                           t_service* tservice) {
-  out << "@implementation " << cocoa_prefix_ << tservice->get_name() << "ClientAsync" << endl
-      << endl << "- (id) initWithProtocolFactory: (id <TProtocolFactory>) factory "
-                 "transport: (id <TAsyncTransport>) transport;" << endl;
-
-  scope_up(out);
-  out << indent() << "self = [super init];" << endl;
-  out << indent() << "inProtocol = [[factory newProtocolOnTransport:transport] retain_stub];"
-      << endl;
-  out << indent() << "outProtocol = inProtocol;" << endl;
-  out << indent() << "asyncTransport = transport;" << endl;
-  out << indent() << "return self;" << endl;
-  scope_down(out);
-  out << endl;
-
-  // generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-
-    generate_cocoa_service_client_send_function_implementation(out, *f_iter);
-
-    if (!(*f_iter)->is_oneway()) {
-      generate_cocoa_service_client_recv_function_implementation(out, *f_iter);
-    }
-
-    // Open function
-    indent(out) << "- " << async_function_signature(*f_iter) << endl;
-    scope_up(out);
-    indent(out) << "@try {" << endl;
-    indent_up();
-    generate_cocoa_service_client_send_function_invocation(out, *f_iter);
-    indent_down();
-    out << indent() << "} @catch(TException * texception) {" << endl;
-    indent_up();
-    out << indent() << "failureBlock(texception);" << endl << indent() << "return;" << endl;
-    indent_down();
-    indent(out) << "}" << endl;
-
-    out << indent() << "[asyncTransport flush:^{" << endl;
-    indent_up();
-
-    out << indent() << "@try {" << endl;
-    indent_up();
-
-    string recv_invocation = "[self recv_" + (*f_iter)->get_name() + "]";
-    if (!(*f_iter)->is_oneway() && (*f_iter)->get_returntype()->is_void()) {
-      out << indent() << recv_invocation << ";" << endl;
-    }
-    out << indent() << "responseBlock(";
-    if (!(*f_iter)->is_oneway() && !(*f_iter)->get_returntype()->is_void()) {
-      out << recv_invocation;
-    }
-    out << ");" << endl;
-
-    indent_down();
-
-    out << indent() << "} @catch(TException * texception) {" << endl;
-    indent_up();
-
-    out << indent() << "failureBlock(texception);" << endl;
-
-    indent_down();
-    out << indent() << "}" << endl;
-
-    indent_down();
-    out << indent() << "} failure:failureBlock];" << endl;
-
-    scope_down(out);
-
-    out << endl;
-  }
-
-  out << "@end" << endl << endl;
-}
-
-/**
- * Generates a service server implementation.  In other words the actual TProcessor implementation
- * for the service.
- *
- * @param tservice The service to generate an implementation for
- */
-void t_cocoa_generator::generate_cocoa_service_server_implementation(ofstream& out,
-                                                                     t_service* tservice) {
-  out << "@implementation " << cocoa_prefix_ << tservice->get_name() << "Processor" << endl;
-
-  // initializer
-  out << endl;
-  out << "- (id) initWith" << tservice->get_name() << ": (id <" << cocoa_prefix_
-      << tservice->get_name() << ">) service" << endl;
-  scope_up(out);
-  out << indent() << "self = [super init];" << endl;
-  out << indent() << "if (!self) {" << endl;
-  out << indent() << "  return nil;" << endl;
-  out << indent() << "}" << endl;
-  out << indent() << "mService = [service retain_stub];" << endl;
-  out << indent() << "mMethodMap = [[NSMutableDictionary dictionary] retain_stub];" << endl;
-
-  // generate method map for routing incoming calls
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-    scope_up(out);
-    out << indent() << "SEL s = @selector(process_" << funname
-        << "_withSequenceID:inProtocol:outProtocol:);" << endl;
-    out << indent() << "NSMethodSignature * sig = [self methodSignatureForSelector: s];" << endl;
-    out << indent()
-        << "NSInvocation * invocation = [NSInvocation invocationWithMethodSignature: sig];" << endl;
-    out << indent() << "[invocation setSelector: s];" << endl;
-    out << indent() << "[invocation retainArguments];" << endl;
-    out << indent() << "[mMethodMap setValue: invocation forKey: @\"" << funname << "\"];" << endl;
-    scope_down(out);
-  }
-  out << indent() << "return self;" << endl;
-  scope_down(out);
-
-  // implementation of the 'service' method which returns the service associated with this
-  // processor
-  out << endl;
-  out << indent() << "- (id<" << cocoa_prefix_ << tservice->get_name() << ">) service" << endl;
-  out << indent() << "{" << endl;
-  out << indent() << "  return [[mService retain_stub] autorelease_stub];" << endl;
-  out << indent() << "}" << endl;
-
-  // implementation of the TProcess method, which dispatches the incoming call using the method map
-  out << endl;
-  out << indent() << "- (BOOL) processOnInputProtocol: (id <TProtocol>) inProtocol" << endl;
-  out << indent() << "                 outputProtocol: (id <TProtocol>) outProtocol" << endl;
-  out << indent() << "{" << endl;
-  out << indent() << "  NSString * messageName;" << endl;
-  out << indent() << "  int messageType;" << endl;
-  out << indent() << "  int seqID;" << endl;
-  out << indent() << "  [inProtocol readMessageBeginReturningName: &messageName" << endl;
-  out << indent() << "                                       type: &messageType" << endl;
-  out << indent() << "                                 sequenceID: &seqID];" << endl;
-  out << indent() << "  NSInvocation * invocation = [mMethodMap valueForKey: messageName];" << endl;
-  out << indent() << "  if (invocation == nil) {" << endl;
-  out << indent() << "    [TProtocolUtil skipType: TType_STRUCT onProtocol: inProtocol];" << endl;
-  out << indent() << "    [inProtocol readMessageEnd];" << endl;
-  out << indent() << "    TApplicationException * x = [TApplicationException exceptionWithType: "
-                     "TApplicationException_UNKNOWN_METHOD reason: [NSString stringWithFormat: "
-                     "@\"Invalid method name: '%@'\", messageName]];" << endl;
-  out << indent() << "    [outProtocol writeMessageBeginWithName: messageName" << endl;
-  out << indent() << "                                      type: TMessageType_EXCEPTION" << endl;
-  out << indent() << "                                sequenceID: seqID];" << endl;
-  out << indent() << "    [x write: outProtocol];" << endl;
-  out << indent() << "    [outProtocol writeMessageEnd];" << endl;
-  out << indent() << "    [[outProtocol transport] flush];" << endl;
-  out << indent() << "    return YES;" << endl;
-  out << indent() << "  }" << endl;
-  out << indent() << "  // NSInvocation does not conform to NSCopying protocol" << endl;
-  out << indent() << "  NSInvocation * i = [NSInvocation invocationWithMethodSignature: "
-                     "[invocation methodSignature]];" << endl;
-  out << indent() << "  [i setSelector: [invocation selector]];" << endl;
-  out << indent() << "  [i setArgument: &seqID atIndex: 2];" << endl;
-  out << indent() << "  [i setArgument: &inProtocol atIndex: 3];" << endl;
-  out << indent() << "  [i setArgument: &outProtocol atIndex: 4];" << endl;
-  out << indent() << "  [i setTarget: self];" << endl;
-  out << indent() << "  [i invoke];" << endl;
-  out << indent() << "  return YES;" << endl;
-  out << indent() << "}" << endl;
-
-  // generate a process_XXXX method for each service function, which reads args, calls the service,
-  // and writes results
-  functions = tservice->get_functions();
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    out << endl;
-    string funname = (*f_iter)->get_name();
-    out << indent() << "- (void) process_" << funname
-        << "_withSequenceID: (int32_t) seqID inProtocol: (id<TProtocol>) inProtocol outProtocol: "
-           "(id<TProtocol>) outProtocol" << endl;
-    scope_up(out);
-    string argstype = cocoa_prefix_ + function_args_helper_struct_type(*f_iter);
-    out << indent() << argstype << " * args = [[" << argstype << " alloc] init];" << endl;
-    out << indent() << "[args read: inProtocol];" << endl;
-    out << indent() << "[inProtocol readMessageEnd];" << endl;
-
-    // prepare the result if not oneway
-    if (!(*f_iter)->is_oneway()) {
-      string resulttype = cocoa_prefix_ + function_result_helper_struct_type(*f_iter);
-      out << indent() << resulttype << " * result = [[" << resulttype << " alloc] init];" << endl;
-    }
-
-    // make the call to the actual service object
-    out << indent();
-    if (!(*f_iter)->get_returntype()->is_void()) {
-      out << "[result setSuccess: ";
-    }
-    out << "[mService " << funname;
-    // supplying arguments
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      string fieldName = (*fld_iter)->get_name();
-      if (first) {
-        first = false;
-        out << ": [args " << fieldName << "]";
-      } else {
-        out << " " << fieldName << ": [args " << fieldName << "]";
-      }
-    }
-    out << "]";
-    if (!(*f_iter)->get_returntype()->is_void()) {
-      out << "]";
-    }
-    out << ";" << endl;
-
-    // write out the result if not oneway
-    if (!(*f_iter)->is_oneway()) {
-      out << indent() << "[outProtocol writeMessageBeginWithName: @\"" << funname << "\"" << endl;
-      out << indent() << "                                  type: TMessageType_REPLY" << endl;
-      out << indent() << "                            sequenceID: seqID];" << endl;
-      out << indent() << "[result write: outProtocol];" << endl;
-      out << indent() << "[outProtocol writeMessageEnd];" << endl;
-      out << indent() << "[[outProtocol transport] flush];" << endl;
-      out << indent() << "[result release_stub];" << endl;
-    }
-    out << indent() << "[args release_stub];" << endl;
-
-    scope_down(out);
-  }
-
-  // dealloc
-  out << endl;
-  out << "- (void) dealloc" << endl;
-  scope_up(out);
-  out << indent() << "[mService release_stub];" << endl;
-  out << indent() << "[mMethodMap release_stub];" << endl;
-  out << indent() << "[super dealloc_stub];" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << "@end" << endl << endl;
-}
-
-/**
- * Deserializes a field of any type.
- *
- * @param tfield The field
- * @param fieldName The variable name for this field
- */
-void t_cocoa_generator::generate_deserialize_field(ofstream& out,
-                                                   t_field* tfield,
-                                                   string fieldName) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, fieldName);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, fieldName);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << type_name(type) << " " << fieldName << " = [inProtocol ";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + tfield->get_name();
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "readBinary];";
-        } else {
-          out << "readString];";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool];";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte];";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16];";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32];";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64];";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble];";
-        break;
-      default:
-        throw "compiler error: no Objective-C name for base type "
-            + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32];";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a struct, allocates the struct and invokes read:
- */
-void t_cocoa_generator::generate_deserialize_struct(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    string fieldName) {
-  indent(out) << type_name(tstruct) << fieldName << " = [[" << type_name(tstruct, true)
-              << " alloc] init];" << endl;
-  indent(out) << "[" << fieldName << " read: inProtocol];" << endl;
-}
-
-/**
- * Deserializes a container by reading its size and then iterating
- */
-void t_cocoa_generator::generate_deserialize_container(ofstream& out,
-                                                       t_type* ttype,
-                                                       string fieldName) {
-  string size = tmp("_size");
-  indent(out) << "int " << size << ";" << endl;
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    indent(out) << "[inProtocol readMapBeginReturningKeyType: NULL valueType: NULL size: &" << size
-                << "];" << endl;
-    indent(out) << "NSMutableDictionary * " << fieldName
-                << " = [[NSMutableDictionary alloc] initWithCapacity: " << size << "];" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "[inProtocol readSetBeginReturningElementType: NULL size: &" << size << "];"
-                << endl;
-    indent(out) << "NSMutableSet * " << fieldName
-                << " = [[NSMutableSet alloc] initWithCapacity: " << size << "];" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "[inProtocol readListBeginReturningElementType: NULL size: &" << size << "];"
-                << endl;
-    indent(out) << "NSMutableArray * " << fieldName
-                << " = [[NSMutableArray alloc] initWithCapacity: " << size << "];" << endl;
-  }
-  // FIXME - the code above does not verify that the element types of
-  // the containers being read match the element types of the
-  // containers we are reading into.  Does that matter?
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "int " << i << ";" << endl << indent() << "for (" << i << " = 0; " << i << " < "
-              << size << "; "
-              << "++" << i << ")" << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, fieldName);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, fieldName);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, fieldName);
-  }
-
-  scope_down(out);
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "[inProtocol readMapEnd];" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "[inProtocol readSetEnd];" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "[inProtocol readListEnd];" << endl;
-  }
-}
-
-/**
- * Take a variable of a given type and wrap it in code to make it
- * suitable for putting into a container, if necessary.  Basically,
- * wrap scaler primitives in NSNumber objects.
- */
-string t_cocoa_generator::containerize(t_type* ttype, string fieldName) {
-  // FIXME - optimize here to avoid autorelease pool?
-  ttype = get_true_type(ttype);
-  if (ttype->is_enum()) {
-    return "[NSNumber numberWithInt: " + fieldName + "]";
-  } else if (ttype->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "can't containerize void";
-    case t_base_type::TYPE_BOOL:
-      return "[NSNumber numberWithBool: " + fieldName + "]";
-    case t_base_type::TYPE_BYTE:
-      return "[NSNumber numberWithUnsignedChar: " + fieldName + "]";
-    case t_base_type::TYPE_I16:
-      return "[NSNumber numberWithShort: " + fieldName + "]";
-    case t_base_type::TYPE_I32:
-      return "[NSNumber numberWithLong: " + fieldName + "]";
-    case t_base_type::TYPE_I64:
-      return "[NSNumber numberWithLongLong: " + fieldName + "]";
-    case t_base_type::TYPE_DOUBLE:
-      return "[NSNumber numberWithDouble: " + fieldName + "]";
-    default:
-      break;
-    }
-  }
-
-  // do nothing
-  return fieldName;
-}
-
-/**
- * Generates code to deserialize a map element
- */
-void t_cocoa_generator::generate_deserialize_map_element(ofstream& out,
-                                                         t_map* tmap,
-                                                         string fieldName) {
-  string key = tmp("_key");
-  string val = tmp("_val");
-  t_type* keyType = tmap->get_key_type();
-  t_type* valType = tmap->get_val_type();
-  t_field fkey(keyType, key);
-  t_field fval(valType, val);
-
-  generate_deserialize_field(out, &fkey, key);
-  generate_deserialize_field(out, &fval, val);
-
-  indent(out) << "[" << fieldName << " setObject: " << containerize(valType, val)
-              << " forKey: " << containerize(keyType, key) << "];" << endl;
-
-  if (type_can_be_null(keyType)) {
-    if (!(get_true_type(keyType)->is_string())) {
-      indent(out) << "[" << containerize(keyType, key) << " release_stub];" << endl;
-    }
-  }
-
-  if (type_can_be_null(valType)) {
-    if (!(get_true_type(valType)->is_string())) {
-      indent(out) << "[" << containerize(valType, val) << " release_stub];" << endl;
-    }
-  }
-}
-
-/**
- * Deserializes a set element
- */
-void t_cocoa_generator::generate_deserialize_set_element(ofstream& out,
-                                                         t_set* tset,
-                                                         string fieldName) {
-  string elem = tmp("_elem");
-  t_type* type = tset->get_elem_type();
-  t_field felem(type, elem);
-
-  generate_deserialize_field(out, &felem, elem);
-
-  indent(out) << "[" << fieldName << " addObject: " << containerize(type, elem) << "];" << endl;
-
-  if (type_can_be_null(type)) {
-    // deserialized strings are autorelease, so don't release them
-    if (!(get_true_type(type)->is_string())) {
-      indent(out) << "[" << containerize(type, elem) << " release_stub];" << endl;
-    }
-  }
-}
-
-/**
- * Deserializes a list element
- */
-void t_cocoa_generator::generate_deserialize_list_element(ofstream& out,
-                                                          t_list* tlist,
-                                                          string fieldName) {
-  string elem = tmp("_elem");
-  t_type* type = tlist->get_elem_type();
-  t_field felem(type, elem);
-
-  generate_deserialize_field(out, &felem, elem);
-
-  indent(out) << "[" << fieldName << " addObject: " << containerize(type, elem) << "];" << endl;
-
-  if (type_can_be_null(type)) {
-    if (!(get_true_type(type)->is_string())) {
-      indent(out) << "[" << containerize(type, elem) << " release_stub];" << endl;
-    }
-  }
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param fieldName Name to of the variable holding the field
- */
-void t_cocoa_generator::generate_serialize_field(ofstream& out, t_field* tfield, string fieldName) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, fieldName);
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, fieldName);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << "[outProtocol ";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + fieldName;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "writeBinary: " << fieldName << "];";
-        } else {
-          out << "writeString: " << fieldName << "];";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool: " << fieldName << "];";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte: " << fieldName << "];";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16: " << fieldName << "];";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32: " << fieldName << "];";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64: " << fieldName << "];";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble: " << fieldName << "];";
-        break;
-      default:
-        throw "compiler error: no Objective-C name for base type "
-            + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32: " << fieldName << "];";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Serialize a struct.
- *
- * @param tstruct The struct to serialize
- * @param fieldName Name of variable holding struct
- */
-void t_cocoa_generator::generate_serialize_struct(ofstream& out,
-                                                  t_struct* tstruct,
-                                                  string fieldName) {
-  (void)tstruct;
-  out << indent() << "[" << fieldName << " write: outProtocol];" << endl;
-}
-
-/**
- * Serializes a container by writing its size then the elements.
- *
- * @param ttype  The type of container
- * @param fieldName Name of variable holding container
- */
-void t_cocoa_generator::generate_serialize_container(ofstream& out,
-                                                     t_type* ttype,
-                                                     string fieldName) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "[outProtocol writeMapBeginWithKeyType: "
-                << type_to_enum(((t_map*)ttype)->get_key_type())
-                << " valueType: " << type_to_enum(((t_map*)ttype)->get_val_type()) << " size: ["
-                << fieldName << " count]];" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "[outProtocol writeSetBeginWithElementType: "
-                << type_to_enum(((t_set*)ttype)->get_elem_type()) << " size: [" << fieldName
-                << " count]];" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "[outProtocol writeListBeginWithElementType: "
-                << type_to_enum(((t_list*)ttype)->get_elem_type()) << " size: [" << fieldName
-                << " count]];" << endl;
-  }
-
-  string iter = tmp("_iter");
-  string key;
-  if (ttype->is_map()) {
-    key = tmp("key");
-    indent(out) << "NSEnumerator * " << iter << " = [" << fieldName << " keyEnumerator];" << endl;
-    indent(out) << "id " << key << ";" << endl;
-    indent(out) << "while ((" << key << " = [" << iter << " nextObject]))" << endl;
-  } else if (ttype->is_set()) {
-    key = tmp("obj");
-    indent(out) << "NSEnumerator * " << iter << " = [" << fieldName << " objectEnumerator];"
-                << endl;
-    indent(out) << "id " << key << ";" << endl;
-    indent(out) << "while ((" << key << " = [" << iter << " nextObject]))" << endl;
-  } else if (ttype->is_list()) {
-    key = tmp("idx");
-    indent(out) << "int " << key << ";" << endl;
-    indent(out) << "for (" << key << " = 0; " << key << " < [" << fieldName << " count]; " << key
-                << "++)" << endl;
-  }
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_serialize_map_element(out, (t_map*)ttype, key, fieldName);
-  } else if (ttype->is_set()) {
-    generate_serialize_set_element(out, (t_set*)ttype, key);
-  } else if (ttype->is_list()) {
-    generate_serialize_list_element(out, (t_list*)ttype, key, fieldName);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "[outProtocol writeMapEnd];" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "[outProtocol writeSetEnd];" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "[outProtocol writeListEnd];" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Given a field variable name, wrap it in code that converts it to a
- * primitive type, if necessary.
- */
-string t_cocoa_generator::decontainerize(t_field* tfield, string fieldName) {
-  t_type* ttype = get_true_type(tfield->get_type());
-  if (ttype->is_enum()) {
-    return "[" + fieldName + " intValue]";
-  } else if (ttype->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "can't decontainerize void";
-    case t_base_type::TYPE_BOOL:
-      return "[" + fieldName + " boolValue]";
-    case t_base_type::TYPE_BYTE:
-      return "[" + fieldName + " unsignedCharValue]";
-    case t_base_type::TYPE_I16:
-      return "[" + fieldName + " shortValue]";
-    case t_base_type::TYPE_I32:
-      return "[" + fieldName + " longValue]";
-    case t_base_type::TYPE_I64:
-      return "[" + fieldName + " longLongValue]";
-    case t_base_type::TYPE_DOUBLE:
-      return "[" + fieldName + " doubleValue]";
-    default:
-      break;
-    }
-  }
-
-  // do nothing
-  return fieldName;
-}
-
-/**
- * Serializes the members of a map.
- */
-void t_cocoa_generator::generate_serialize_map_element(ofstream& out,
-                                                       t_map* tmap,
-                                                       string key,
-                                                       string mapName) {
-  t_field kfield(tmap->get_key_type(), key);
-  generate_serialize_field(out, &kfield, decontainerize(&kfield, key));
-  t_field vfield(tmap->get_val_type(), "[" + mapName + " objectForKey: " + key + "]");
-  generate_serialize_field(out, &vfield, decontainerize(&vfield, vfield.get_name()));
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_cocoa_generator::generate_serialize_set_element(ofstream& out,
-                                                       t_set* tset,
-                                                       string elementName) {
-  t_field efield(tset->get_elem_type(), elementName);
-  generate_serialize_field(out, &efield, decontainerize(&efield, elementName));
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_cocoa_generator::generate_serialize_list_element(ofstream& out,
-                                                        t_list* tlist,
-                                                        string index,
-                                                        string listName) {
-  t_field efield(tlist->get_elem_type(), "[" + listName + " objectAtIndex: " + index + "]");
-  generate_serialize_field(out, &efield, decontainerize(&efield, efield.get_name()));
-}
-
-/**
- * Returns an Objective-C name
- *
- * @param ttype The type
- * @param class_ref Do we want a Class reference istead of a type reference?
- * @return Java type name, i.e. HashMap<Key,Value>
- */
-string t_cocoa_generator::type_name(t_type* ttype, bool class_ref) {
-  if (ttype->is_typedef()) {
-    t_program* program = ttype->get_program();
-    return program ? (program->get_namespace("cocoa") + ttype->get_name()) : ttype->get_name();
-  }
-
-  string result;
-  if (ttype->is_base_type()) {
-    return base_type_name((t_base_type*)ttype);
-  } else if (ttype->is_enum()) {
-    return "int";
-  } else if (ttype->is_map()) {
-    result = "NSMutableDictionary";
-  } else if (ttype->is_set()) {
-    result = "NSMutableSet";
-  } else if (ttype->is_list()) {
-    result = "

<TRUNCATED>


[54/54] incubator-hawq git commit: HAWQ-958, HAWQ-976, HAWQ-957. LICENSE & NOTICE updates

Posted by es...@apache.org.
HAWQ-958, HAWQ-976, HAWQ-957. LICENSE & NOTICE updates

* Update Stream license
* Update PyGreSQL license
* Update CMake license
* Remove ASF license header from CMake files
* Update pom.xml to exclude all libyarn and libhdfs3 CMake files
* Using new license format seen in spark.
* HAWQ-976. dynloader license (and corresponding source change)
* HAWQ-976. glob license (and corresponding source change)
* Add unittest2, pychecker, pg_controldata, pg8000, lockfile LICENSE files
* Add figleaf LICENSE file
* Remove incorrect ASF headers for figleaf
* update bzip2 license
* update googletest license
* update pexpect license
* update pitlockfile license
* update pljava license
* update oraface license
* Add licenses for:
    LICENSE-json.txt
    LICENSE-plperl.txt
    LICENSE-postgresql.txt
    LICENSE-test-ctype.txt
* Fix incorrect GPL reference - tools/bin/gppylib/operations/test/test_package.py
* HAWQ-957. Update NOTICE
* Remove ASF license header for plperl
* Add PSI,regents-of-the-university-of-california, university-of-california-at-berkeley LICENSE file
* Add port, wstrcmp BSD license
* Add isc, libpq-sha2, port-rand, port-gettimeofday, regex license
* Add pg_dump license


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/8eff6033
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/8eff6033
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/8eff6033

Branch: refs/heads/2.0.0.0-incubating
Commit: 8eff60336df48c1b6830f21b443313b8a1887047
Parents: 6c54864
Author: Ed Espino <ee...@pivotal.io>
Authored: Mon Sep 5 17:00:48 2016 +0800
Committer: EC2 Default User <ec...@ip-172-31-38-49.us-west-2.compute.internal>
Committed: Thu Sep 8 05:18:09 2016 +0000

----------------------------------------------------------------------
 COPYRIGHT                                       |  25 -
 LICENSE                                         | 602 ++++++++-----------
 NOTICE                                          |  60 +-
 .../CMake/CMakeTestCompileNestedException.cpp   |  20 -
 .../CMake/CMakeTestCompileSteadyClock.cpp       |  19 -
 .../libhdfs3/CMake/CMakeTestCompileStrerror.cpp |  19 -
 depends/libhdfs3/CMake/FindGoogleTest.cmake     |  17 -
 depends/libyarn/CMake/CodeCoverage.cmake        |  18 -
 depends/libyarn/CMake/FindGoogleTest.cmake      |  17 -
 depends/libyarn/CMake/Functions.cmake           |  18 -
 depends/libyarn/CMake/Options.cmake             |  18 -
 depends/libyarn/CMake/Platform.cmake            |  18 -
 licenses/LICENSE-PSI.txt                        |  26 +
 licenses/LICENSE-bzip2.txt                      |  41 ++
 licenses/LICENSE-cmake.txt                      |  32 +
 licenses/LICENSE-dynloader.txt                  |  25 +
 licenses/LICENSE-figleaf.txt                    |  24 +
 licenses/LICENSE-glob.txt                       |  31 +
 licenses/LICENSE-googletest.txt                 |  28 +
 licenses/LICENSE-isc.txt                        |  14 +
 licenses/LICENSE-json.txt                       | 131 ++++
 licenses/LICENSE-libpq-sha2.txt                 |  26 +
 licenses/LICENSE-lockfile.txt                   |  21 +
 licenses/LICENSE-oraface.txt                    |  18 +
 licenses/LICENSE-pexpect.txt                    |  20 +
 licenses/LICENSE-pg8000.txt                     |  26 +
 licenses/LICENSE-pg_controldata.txt             |  24 +
 licenses/LICENSE-pitlockfile.txt                | 192 ++++++
 licenses/LICENSE-pljava.txt                     |  33 +
 licenses/LICENSE-plperl.txt                     | 135 +++++
 licenses/LICENSE-port-gettimeofday.txt          |  20 +
 licenses/LICENSE-port-rand.txt                  |  10 +
 licenses/LICENSE-port.txt                       |  26 +
 licenses/LICENSE-postgresql.txt                 |  23 +
 licenses/LICENSE-pychecker.txt                  |  31 +
 licenses/LICENSE-pygresql.txt                   |  28 +
 licenses/LICENSE-regex.txt                      |  84 +++
 licenses/LICENSE-stream.txt                     |  32 +
 licenses/LICENSE-test-ctype.txt                 |  11 +
 licenses/LICENSE-unittest2.txt                  |  32 +
 licenses/LICENSE-wstrcmp.txt                    |  26 +
 pom.xml                                         |  20 +-
 src/backend/port/dynloader/freebsd.c            |   6 +-
 src/backend/port/dynloader/netbsd.c             |   6 +-
 src/backend/port/dynloader/openbsd.c            |   6 +-
 src/bin/gpfdist/src/gpfdist/glob.c              |   6 +-
 src/bin/gpfdist/src/gpfdist/include/glob.h      |   6 +-
 src/include/port/win32_msvc/glob.h              |   6 +-
 src/pl/plperl/plperl.c                          |  19 -
 src/pl/plperl/plperl.h                          |  19 -
 src/pl/plperl/plperl_helpers.h                  |  20 -
 src/port/glob.c                                 |   6 +-
 tools/bin/ext/figleaf/__init__.py               |  16 -
 tools/bin/ext/figleaf/_lib.py                   |  16 -
 tools/bin/ext/figleaf/annotate.py               |  16 -
 tools/bin/ext/figleaf/annotate_cover.py         |  16 -
 tools/bin/ext/figleaf/annotate_html.py          |  16 -
 tools/bin/ext/figleaf/annotate_sections.py      |  16 -
 tools/bin/ext/figleaf/internals.py              |  16 -
 tools/bin/ext/figleaf/nose_sections.py          |  16 -
 .../bin/gppylib/operations/test/test_package.py |   2 +-
 61 files changed, 1482 insertions(+), 789 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/COPYRIGHT
----------------------------------------------------------------------
diff --git a/COPYRIGHT b/COPYRIGHT
deleted file mode 100644
index aad9ed4..0000000
--- a/COPYRIGHT
+++ /dev/null
@@ -1,25 +0,0 @@
-Greenplum Database version of PostgreSQL Database Management System
-(formerly known as Postgres, then as Postgres95)
-
-Portions Copyright (c) 2011 EMC
-
-Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
-
-Portions Copyright (c) 1994, The Regents of the University of California
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose, without fee, and without a written agreement
-is hereby granted, provided that the above copyright notice and this
-paragraph and the following two paragraphs appear in all copies.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
-DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
-LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
-DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
-PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 2f5b242..62a4872 100644
--- a/LICENSE
+++ b/LICENSE
@@ -201,353 +201,269 @@
    limitations under the License.
 
 =======================================================================
-Apache HAWQ (incubating) Subcomponents:
 
-The Apache HAWQ (incubating) project contains subcomponents with separate 
-copyright notices and license terms. Your use of the source code for these
-subcomponents is subject to the terms and conditions of the following
-licenses.
-
-***********************************************************************
-Source code under tools/bin/src/stream/ is taken from stream benchmark
-and is available under the following license:
-
-*=======================================================================
-*-----------------------------------------------------------------------
-* Copyright 1991-2003: John D. McCalpin
-*-----------------------------------------------------------------------
-* License:
-*  1. You are free to use this program and/or to redistribute
-*     this program.
-*  2. You are free to modify this program for your own use,
-*     including commercial use, subject to the publication
-*     restrictions in item 3.
-*  3. You are free to publish results obtained from running this
-*     program, or from works that you derive from this program,
-*     with the following limitations:
-*     3a. In order to be referred to as "STREAM benchmark results",
-*         published results must be in conformance to the STREAM
-*         Run Rules, (briefly reviewed below) published at
-*         http://www.cs.virginia.edu/stream/ref.html
-*         and incorporated herein by reference.
-*         As the copyright holder, John McCalpin retains the
-*         right to determine conformity with the Run Rules.
-*     3b. Results based on modified source code or on runs not in
-*         accordance with the STREAM Run Rules must be clearly
-*         labelled whenever they are published.  Examples of
-*         proper labelling include:
-*         "tuned STREAM benchmark results" 
-*         "based on a variant of the STREAM benchmark code"
-*         Other comparable, clear and reasonable labelling is
-*         acceptable.
-*     3c. Submission of results to the STREAM benchmark web site
-*         is encouraged, but not required.
-*  4. Use of this program or creation of derived works based on this
-*     program constitutes acceptance of these licensing restrictions.
-*  5. Absolutely no warranty is expressed or implied.
-*-----------------------------------------------------------------------
-
-***********************************************************************
-Source code under tools/bin/pythonSrc/PyGreSQL-4.0 is taken from PyGreSQL
-and is available under the following license:
-
-Written by D\u2019Arcy J.M. Cain (darcy@druid.net)
-
-Based heavily on code written by Pascal Andre (andre@chimay.via.ecp.fr)
-
-Copyright (c) 1995, Pascal Andre
-
-Further modifications copyright (c) 1997-2008 by D\u2019Arcy J.M. Cain (darcy@PyGreSQL.org)
-
-Further modifications copyright (c) 2009-2016 by the PyGreSQL team.
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose, without fee, and without a written agreement is
-hereby granted, provided that the above copyright notice and this paragraph and
-the following two paragraphs appear in all copies. In this license the term
-\u201cAUTHORS\u201d refers to anyone who has contributed code to PyGreSQL.
-
-IN NO EVENT SHALL THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING
-OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF AUTHORS HAVE BEEN
-ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-THE AUTHORS SPECIFICALLY DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-THE SOFTWARE PROVIDED HEREUNDER IS ON AN \u201cAS IS\u201d BASIS, AND THE AUTHORS HAVE NO
-OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR
-MODIFICATIONS.
-
-***********************************************************************
-Source code under
-  depends/libyarn/CMake/FindBoost.cmake
-  depends/libyarn/CMake/FindGSasl.cmake
-  depends/libyarn/CMake/FindKERBEROS.cmake
-  depends/libhdfs3/CMake/FindBoost.cmake
-  depends/libhdfs3/CMake/CodeCoverage.cmake
-  depends/libhdfs3/CMake/FindGSasl.cmake
-  depends/libhdfs3/CMake/FindKERBEROS.cmake
-  depends/libhdfs3/CMake/FindLibUUID.cmake
-  depends/libhdfs3/CMake/Functions.cmake
-  depends/libhdfs3/CMake/Options.cmake
-  depends/libhdfs3/CMake/Platform.cmake
-is taken from CMake and is available under the following license:
-
-CMake - Cross Platform Makefile Generator
-Copyright 2000-2014 Kitware, Inc.
-Copyright 2000-2011 Insight Software Consortium
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-* Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright
-notice, this list of conditions and the following disclaimer in the
-documentation and/or other materials provided with the distribution.
-
-* Neither the names of Kitware, Inc., the Insight Software Consortium,
-nor the names of their contributors may be used to endorse or promote
-products derived from this software without specific prior written
-permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-***********************************************************************
-Source code under
-  src/bin/gpfdist/src/gpfdist/glob.c
-  src/bin/gpfdist/src/gpfdist/include/glob.h
-  src/include/port/win32_msvc/glob.h
-is taken from OpenBSD/NetBSD and is available under the following license:
-
- * Copyright (c) 1989, 1993
- *      The Regents of the University of California.  All rights reserved.
- *
- * This code is derived from software contributed to Berkeley by
- * Guido van Rossum.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *      This product includes software developed by the University of
- *      California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
-
-***********************************************************************
-Source code under src/include/port/win32_msvc/bzlib.h is taken from bzip2
-and is available under the following license:
-
-This program, "bzip2", the associated library "libbzip2", and all
-documentation, are copyright (C) 1996-2010 Julian R Seward.  All
-rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-1. Redistributions of source code must retain the above copyright
-   notice, this list of conditions and the following disclaimer.
-
-2. The origin of this software must not be misrepresented; you must
-   not claim that you wrote the original software.  If you use this
-   software in a product, an acknowledgment in the product
-   documentation would be appreciated but is not required.
-
-3. Altered source versions must be plainly marked as such, and must
-   not be misrepresented as being the original software.
-
-4. The name of the author may not be used to endorse or promote
-   products derived from this software without specific prior written
-   permission.
-
-THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
-OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
-DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
-GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-Julian Seward, jseward@bzip.org
-bzip2/libbzip2 version 1.0.6 of 6 September 2010
-
-***********************************************************************
-Source code under depends/thirdparty/googletest is taken from googletest
-and is available under the following license:
-
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
-    * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-***********************************************************************
-Source code under contrib/orafce is taken from Oraface Project
-and is available under the following license:
-
-Orafce, Oracle API support
-
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose, without fee, and without a written agreement
-is hereby granted, provided that the above copyright notice and this
-paragraph and the following two paragraphs appear in all copies.
-
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
-DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
-LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
-DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
-
-THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
-PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-***********************************************************************
-Source code under tools/bin/lib/pexpect.py is taken from Pexpect Python module
-and is available under the following license:
-
-http://opensource.org/licenses/isc-license.txt
-
-Copyright (c) 2013-2014, Pexpect development team
-Copyright (c) 2012, Noah Spurrier <no...@noah.org>
-
-PERMISSION TO USE, COPY, MODIFY, AND/OR DISTRIBUTE THIS SOFTWARE FOR ANY
-PURPOSE WITH OR WITHOUT FEE IS HEREBY GRANTED, PROVIDED THAT THE ABOVE
-COPYRIGHT NOTICE AND THIS PERMISSION NOTICE APPEAR IN ALL COPIES.
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-***********************************************************************
-Source code under src/pl/pljava/ is taken from PL/Java
-and is available under the following license:
-
-PL/Java, a backend Java integration for PostgreSQL
-
-Java\ufffd is a registered trademark of Sun Microsystems, Inc. in the United
-States and other countries.
-
-PL/Java Copyright (c) 2003 - 2013 Tada AB - Taby Sweden
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions
-are met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-    * Redistributions in binary form must reproduce the above copyright
-      notice, this list of conditions and the following disclaimer in
-      the documentation and/or other materials provided with the
-      distribution.
-    * Neither the name Tada AB nor the names of its contributors may be
-      used to endorse or promote products derived from this software
-      without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
-TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
-CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
-EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
-PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
-LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-***********************************************************************
-The rest of the source code without explicit ASF license headers was
-taken from PostgreSQL and is available under the following license:
+Apache HAWQ (incubating) Subcomponents:
 
-PostgreSQL Database Management System
-(formerly known as Postgres, then as Postgres95)
+  The Apache HAWQ (incubating) project contains subcomponents with
+  separate copyright notices and license terms. Your use of the source
+  code for these subcomponents is subject to the terms and conditions
+  of the following licenses.
 
-Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group
+=======================================================================
+Stream License
+======================================================================
+
+  The following files are used:
+  
+      tools/bin/src/stream
+  
+  This file is made available under the following Stream License:
+  
+      licenses/LICENSE-stream.txt
+
+======================================================================
+PyGreSQL 4.0 License
+======================================================================
+
+  The following files are used:
+  
+      tools/bin/pythonSrc/PyGreSQL-4.0
+  
+  This file is made available under the following PyGreSQL License:
+  
+      licenses/LICENSE-pygresql.txt
+
+======================================================================
+BSD-style licenses
+======================================================================
+
+  The following components are provided under a BSD-style license. See
+  project link for details.  The text of each license is also included
+  at licenses/LICENSE-[project].txt.
+
+     (BSD 3 Clause) CMake (https://cmake.org)
+       depends/libyarn/CMake
+       depends/libhdfs3/CMake
+
+     (BSD 4 Clause revised) dynloader
+       src/backend/port/dynloader/freebsd.c
+       src/backend/port/dynloader/netbsd.c
+       src/backend/port/dynloader/openbsd.c
+       src/backend/port/dynloader/ultrix4.h
+
+       Revised based on: ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+       
+     (BSD 4 Clause revised) glob
+       src/bin/gpfdist/src/gpfdist/glob.c
+       src/bin/gpfdist/src/gpfdist/include/glob.h
+       src/include/port/win32_msvc/glob.h
+       src/port/glob.c
+
+       Revised based on: ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+      
+     (BSD License) pg_controldata 
+       src/bin/pg_controldata/pg_controldata.c 
+     
+     (BSD License) unittest2 (v2-0.5.1 - https://pypi.python.org/pypi/unittest2)
+       tools/bin/pythonSrc/unittest2-0.5.1
+     
+     (BSD License) pychecker (v0.8.18 - http://pychecker.sourceforge.net/)
+       tools/bin/pythonSrc/pychecker-0.8.18 
+     
+     (BSD License) pg8000
+       tools/bin/ext/pg8000
+      
+     (BSD License) figleaf (http://darcs.idyll.org/~t/projects/figleaf/)
+       tools/bin/ext/figleaf
+    
+     (BSD License) port
+       src/port/inet_aton.c
+       src/port/snprintf.c
+       src/port/crypt.c
+       src/port/memcmp.c
+       src/port/strlcpy.c
+
+     (BSD License) wstrcmp
+       src/backend/utils/mb/wstrcmp.c
+
+     (BSD License) libpq-sha2
+       src/backend/libpq/sha2
+
+======================================================================
+MIT License
+======================================================================
+
+  The following components are provided under a MIT license. See
+  project link for details.  The text of each license is also included
+  at licenses/LICENSE-[project].txt.
+
+     lockfile (0.9.1)
+       tools/bin/pythonSrc/lockfile-0.9.1
+
+     PSI (0.3b2_gp)
+       tools/bin/pythonSrc/PSI-0.3b2_gp
+
+======================================================================
+Python Software Foundation (PSF) License
+======================================================================
+
+  The following components are provided under a PSF license. See
+  project link for details.  The text of each license is also included
+  at licenses/LICENSE-[project].txt.
+
+     pidlockfile
+       tools/bin/pythonSrc/lockfile-0.9.1/lockfile/pidlockfile.py
+
+======================================================================
+BZIP2 License
+======================================================================
+
+  The following files are used:
+  
+      src/include/port/win32_msvc/bzlib.h
+  
+  This file is made available under the following bzip2 and libbzip2
+  License v1.0.5 license:
+  
+      licenses/LICENSE-bzip2.txt
+
+======================================================================
+Google Test License
+======================================================================
+
+  The following files are used:
+  
+      depends/thirdparty/googletest
+  
+  This file is made available under the following Google test license:
+  
+      licenses/LICENSE-googletest.txt
+
+======================================================================
+Oraface License
+======================================================================
+
+  The following files are used:
+  
+      contrib/orafce
+  
+  This file is made available under the following Oraface license:
+  
+      licenses/LICENSE-oraface.txt
+
+======================================================================
+Pexpect License
+======================================================================
+
+  The following files are used:
+  
+      tools/bin/lib/pexpect.py
+  
+  This file is made available under the following Pexpect license:
+  
+      licenses/LICENSE-pexect.txt
+
+======================================================================
+PL/Java License
+======================================================================
+
+  The following files are used:
+  
+      src/pl/pljava
+  
+  This file is made available under the following PL/Java license:
+  
+      licenses/LICENSE-pljava.txt
+
+======================================================================
+Perl LICENSE
+======================================================================
+
+  The following components are provided under a Perl Artistic
+  license. See project link for details.  The text of each license is
+  also included at licenses/LICENSE-[project].txt.
+
+     JSON 
+       src/include/catalog/JSON
+  
+     plperl
+       src/pl/plperl
+      
+======================================================================
+test-ctype LICENSE
+======================================================================
+
+  The following files are used:
+  
+      src/test/locale/test-ctype.c
+  
+  This file is made available under the following test ctype license:
+  
+      licenses/LICENSE-test-ctype.txt
+ 
+======================================================================
+port-rand LICENSE
+======================================================================
+
+  The following files are used:
+  
+      src/port/rand.c 
+  
+  This file is made available under the following port-rand license:
+  
+      licenses/LICENSE-port-rand.txt
+
+======================================================================
+Internet Systems Consortium/Internet Software Consortium (ISC) LICENSE
+======================================================================
+
+  The following files are used:
+  
+      src/backend/utils/adt/inet_net_ntop.c
+      src/backend/utils/adt/inet_net_pton.c 
+  
+  This file is made available under the following ISC license:
+  
+      licenses/LICENSE-isc.txt
+
+======================================================================
+regex LICENSE
+======================================================================
+
+  The following files are used:
+  
+      src/backend/regex 
+  
+  This file is made available under the following regex license:
+  
+      licenses/LICENSE-regex.txt
+
+======================================================================
+port-gettimeofday LICENSE
+======================================================================
+
+  The following files are used:
+  
+      src/port/gettimeofday.c 
+  
+  This file is made available under the following port-gettimeofday license:
+  
+      licenses/LICENSE-port-gettimeofday.txt
+
+======================================================================
+PostgreSQL LICENSE
+======================================================================
 
-Portions Copyright (c) 1994, The Regents of the University of California
+The rest of the source code without explicit ASF license headers was
+derived from PostgreSQL and is available under the following license:
 
-Permission to use, copy, modify, and distribute this software and its
-documentation for any purpose, without fee, and without a written agreement
-is hereby granted, provided that the above copyright notice and this
-paragraph and the following two paragraphs appear in all copies.
+      licenses/LICENSE-postgresql.txt
 
-IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
-DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
-LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
-DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGE.
+  This includes the following explicitely listed source directories:
 
-THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
-INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
-AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
-ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
-PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+     src/backend/utils/mb/Unicode
+     src/interfaces/libpq/po
+     src/bin/pg_dump
+     src/backend/port/qnx4/shm.c
+     src/backend/port/beos/shm.c
+     
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/NOTICE
----------------------------------------------------------------------
diff --git a/NOTICE b/NOTICE
index 253e559..6589c8f 100644
--- a/NOTICE
+++ b/NOTICE
@@ -4,34 +4,32 @@ Copyright 2016 The Apache Software Foundation.
 This product includes software developed at
 The Apache Software Foundation (http://www.apache.org/).
 
-Portions Copyright (c) 2014-2015, Pivotal Inc.
-
-Portions Copyright (c) 2010-2013, EMC Inc.
-
-Portions Copyright (c) 2005-2010, Greenplum Inc.
-
-Portions Copyright (c) 1996-2011, PostgreSQL Global Development Group
-
-Portions Copyright (c) 1989, 1993, 1994, The Regents of the University of California
-
-Portions Copyright (c) 1991-2003, John D. McCalpin
-
-Portions Copyright (c) 1995, Pascal Andre
-
-Portions Copyright (c) 1997-2008, D\u2019Arcy J.M. Cain (darcy@PyGreSQL.org)
-
-Portions Copyright (c) 2009-2016, the PyGreSQL team.
-
-Portions Copyright (c) 2000-2014, Kitware, Inc.
-
-Portions Copyright (c) 2000-2011, Insight Software Consortium
-
-Portions Copyright (c) 1996-2010, Julian R Seward
-
-Portions Copyright (c) 2008, Google Inc.
-
-Portions Copyright (c) 2013-2014, Pexpect development team
-
-Portions Copyright (c) 2012, Noah Spurrier <no...@noah.org>
-
-Portions Copyright (c) 2003 - 2013 Tada AB - Taby Sweden
+This project includes software copyrighted by PostgreSQL Global
+Development Group (PostgreSQL 8.2.15) with the following copyright
+notice.  The contents were originally available in the COPYRIGHT file.
+This file has been removed and included here to conform to recommended
+Apache source packaging contents.
+
+  PostgreSQL Database Management System
+  (formerly known as Postgres, then as Postgres95)
+  
+  Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
+  
+  Portions Copyright (c) 1994, The Regents of the University of California
+  
+  Permission to use, copy, modify, and distribute this software and its
+  documentation for any purpose, without fee, and without a written agreement
+  is hereby granted, provided that the above copyright notice and this
+  paragraph and the following two paragraphs appear in all copies.
+  
+  IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+  DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+  LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+  DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+  
+  THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+  AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+  ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+  PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libhdfs3/CMake/CMakeTestCompileNestedException.cpp
----------------------------------------------------------------------
diff --git a/depends/libhdfs3/CMake/CMakeTestCompileNestedException.cpp b/depends/libhdfs3/CMake/CMakeTestCompileNestedException.cpp
index 72e3bbd..66918ca 100644
--- a/depends/libhdfs3/CMake/CMakeTestCompileNestedException.cpp
+++ b/depends/libhdfs3/CMake/CMakeTestCompileNestedException.cpp
@@ -1,23 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
 #include <exception>
 #include <stdexcept>
 

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libhdfs3/CMake/CMakeTestCompileSteadyClock.cpp
----------------------------------------------------------------------
diff --git a/depends/libhdfs3/CMake/CMakeTestCompileSteadyClock.cpp b/depends/libhdfs3/CMake/CMakeTestCompileSteadyClock.cpp
index 91c1172..afcbe1b 100644
--- a/depends/libhdfs3/CMake/CMakeTestCompileSteadyClock.cpp
+++ b/depends/libhdfs3/CMake/CMakeTestCompileSteadyClock.cpp
@@ -1,22 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 #include <chrono>
 
 using std::chrono::steady_clock;

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libhdfs3/CMake/CMakeTestCompileStrerror.cpp
----------------------------------------------------------------------
diff --git a/depends/libhdfs3/CMake/CMakeTestCompileStrerror.cpp b/depends/libhdfs3/CMake/CMakeTestCompileStrerror.cpp
index 57c67d5..0ef4eda 100644
--- a/depends/libhdfs3/CMake/CMakeTestCompileStrerror.cpp
+++ b/depends/libhdfs3/CMake/CMakeTestCompileStrerror.cpp
@@ -1,22 +1,3 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
 #include <string.h>
 
 int main()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libhdfs3/CMake/FindGoogleTest.cmake
----------------------------------------------------------------------
diff --git a/depends/libhdfs3/CMake/FindGoogleTest.cmake b/depends/libhdfs3/CMake/FindGoogleTest.cmake
index 03209cd..fd57c1e 100644
--- a/depends/libhdfs3/CMake/FindGoogleTest.cmake
+++ b/depends/libhdfs3/CMake/FindGoogleTest.cmake
@@ -1,20 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
 include(CheckCXXSourceRuns)
 
 find_path(GTest_INCLUDE_DIR gtest/gtest.h

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libyarn/CMake/CodeCoverage.cmake
----------------------------------------------------------------------
diff --git a/depends/libyarn/CMake/CodeCoverage.cmake b/depends/libyarn/CMake/CodeCoverage.cmake
index 226ae83..ecf2d28 100644
--- a/depends/libyarn/CMake/CodeCoverage.cmake
+++ b/depends/libyarn/CMake/CodeCoverage.cmake
@@ -1,21 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
 # Check prereqs
 FIND_PROGRAM(GCOV_PATH gcov)
 FIND_PROGRAM(LCOV_PATH lcov)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libyarn/CMake/FindGoogleTest.cmake
----------------------------------------------------------------------
diff --git a/depends/libyarn/CMake/FindGoogleTest.cmake b/depends/libyarn/CMake/FindGoogleTest.cmake
index 03209cd..fd57c1e 100644
--- a/depends/libyarn/CMake/FindGoogleTest.cmake
+++ b/depends/libyarn/CMake/FindGoogleTest.cmake
@@ -1,20 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
 include(CheckCXXSourceRuns)
 
 find_path(GTest_INCLUDE_DIR gtest/gtest.h

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libyarn/CMake/Functions.cmake
----------------------------------------------------------------------
diff --git a/depends/libyarn/CMake/Functions.cmake b/depends/libyarn/CMake/Functions.cmake
index 652c96a..a771b60 100644
--- a/depends/libyarn/CMake/Functions.cmake
+++ b/depends/libyarn/CMake/Functions.cmake
@@ -1,21 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
 FUNCTION(AUTO_SOURCES RETURN_VALUE PATTERN SOURCE_SUBDIRS)
 
 	IF ("${SOURCE_SUBDIRS}" STREQUAL "RECURSE")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libyarn/CMake/Options.cmake
----------------------------------------------------------------------
diff --git a/depends/libyarn/CMake/Options.cmake b/depends/libyarn/CMake/Options.cmake
index bcd3d94..6fe1ca8 100644
--- a/depends/libyarn/CMake/Options.cmake
+++ b/depends/libyarn/CMake/Options.cmake
@@ -1,21 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
 OPTION(ENABLE_COVERAGE "enable code coverage" OFF)
 OPTION(ENABLE_DEBUG "enable debug build" OFF)
 OPTION(ENABLE_SSE "enable SSE4.2 buildin function" ON)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/depends/libyarn/CMake/Platform.cmake
----------------------------------------------------------------------
diff --git a/depends/libyarn/CMake/Platform.cmake b/depends/libyarn/CMake/Platform.cmake
index 2655948..d18733d 100644
--- a/depends/libyarn/CMake/Platform.cmake
+++ b/depends/libyarn/CMake/Platform.cmake
@@ -1,21 +1,3 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
 IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
     SET(OS_LINUX true CACHE INTERNAL "Linux operating system")
 ELSEIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-PSI.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-PSI.txt b/licenses/LICENSE-PSI.txt
new file mode 100644
index 0000000..6ffa900
--- /dev/null
+++ b/licenses/LICENSE-PSI.txt
@@ -0,0 +1,26 @@
+The MIT License
+
+Copyright (C) 2007 Chris Miles
+
+Copyright (C) 2008-2009 Floris Bruynooghe
+
+Copyright (C) 2008-2009 Abilisoft Ltd.
+
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-bzip2.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-bzip2.txt b/licenses/LICENSE-bzip2.txt
new file mode 100644
index 0000000..70ee59b
--- /dev/null
+++ b/licenses/LICENSE-bzip2.txt
@@ -0,0 +1,41 @@
+Version 1.0.5 of 10 December 2007
+Copyright � 1996-2007 Julian Seward
+
+This program, bzip2, the associated library libbzip2, and all
+documentation, are copyright � 1996-2007 Julian Seward. All rights
+reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+\u2022 Redistributions of source code must retain the above copyright
+  notice, this list of conditions and the following disclaimer.
+
+\u2022 The origin of this software must not be misrepresented; you must not
+  claim that you wrote the original software. If you use this software
+  in a product, an acknowledgment in the product documentation would
+  be appreciated but is not required.
+
+\u2022 Altered source versions must be plainly marked as such, and must not
+  be misrepresented as being the original software.
+
+\u2022 The name of the author may not be used to endorse or promote
+  products derived from this software without specific prior written
+  permission.
+
+THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.  PATENTS: To the best of my knowledge,
+bzip2 and libbzip2 do not use any patented algorithms. However, I do
+not have the resources to carry out a patent search. Therefore I
+cannot give any guarantee of the above statement.
+

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-cmake.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-cmake.txt b/licenses/LICENSE-cmake.txt
new file mode 100644
index 0000000..c942bde
--- /dev/null
+++ b/licenses/LICENSE-cmake.txt
@@ -0,0 +1,32 @@
+CMake - Cross Platform Makefile Generator
+Copyright 2000-2014 Kitware, Inc.
+Copyright 2000-2011 Insight Software Consortium
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+
+* Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright
+notice, this list of conditions and the following disclaimer in the
+documentation and/or other materials provided with the distribution.
+
+* Neither the names of Kitware, Inc., the Insight Software Consortium,
+nor the names of their contributors may be used to endorse or promote
+products derived from this software without specific prior written
+permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-dynloader.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-dynloader.txt b/licenses/LICENSE-dynloader.txt
new file mode 100644
index 0000000..6503643
--- /dev/null
+++ b/licenses/LICENSE-dynloader.txt
@@ -0,0 +1,25 @@
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *	  notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *	  notice, this list of conditions and the following disclaimer in the
+ *	  documentation and/or other materials provided with the distribution.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+ * 4. Neither the name of the University nor the names of its contributors
+ *	  may be used to endorse or promote products derived from this software
+ *	  without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.	IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-figleaf.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-figleaf.txt b/licenses/LICENSE-figleaf.txt
new file mode 100644
index 0000000..2e5b0f3
--- /dev/null
+++ b/licenses/LICENSE-figleaf.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2006, C. Titus Brown, titus@idyll.org 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the <organization> nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-glob.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-glob.txt b/licenses/LICENSE-glob.txt
new file mode 100644
index 0000000..f0fa561
--- /dev/null
+++ b/licenses/LICENSE-glob.txt
@@ -0,0 +1,31 @@
+ * Copyright (c) 1989, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Guido van Rossum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. BSD Advertising Clause omitted per the July 22, 1999 licensing change
+ *    ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
+ * 4. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-googletest.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-googletest.txt b/licenses/LICENSE-googletest.txt
new file mode 100644
index 0000000..1941a11
--- /dev/null
+++ b/licenses/LICENSE-googletest.txt
@@ -0,0 +1,28 @@
+Copyright 2008, Google Inc.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+copyright notice, this list of conditions and the following disclaimer
+in the documentation and/or other materials provided with the
+distribution.
+    * Neither the name of Google Inc. nor the names of its
+contributors may be used to endorse or promote products derived from
+this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-isc.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-isc.txt b/licenses/LICENSE-isc.txt
new file mode 100644
index 0000000..6a9665a
--- /dev/null
+++ b/licenses/LICENSE-isc.txt
@@ -0,0 +1,14 @@
+ Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
+ Copyright (c) 1996,1999 by Internet Software Consortium.
+ 
+ Permission to use, copy, modify, and distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+ 
+ THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
+ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-json.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-json.txt b/licenses/LICENSE-json.txt
new file mode 100644
index 0000000..71dd596
--- /dev/null
+++ b/licenses/LICENSE-json.txt
@@ -0,0 +1,131 @@
+Copyright 2007-2010 by Makamaka Hannyaharamitu
+
+The "Artistic License"
+
+Preamble
+
+The intent of this document is to state the conditions under which a
+Package may be copied, such that the Copyright Holder maintains some
+semblance of artistic control over the development of the package,
+while giving the users of the package the right to use and distribute
+the Package in a more-or-less customary fashion, plus the right to make
+reasonable modifications.
+
+Definitions:
+
+"Package" refers to the collection of files distributed by the
+Copyright Holder, and derivatives of that collection of files
+created through textual modification.
+
+"Standard Version" refers to such a Package if it has not been
+modified, or has been modified in accordance with the wishes
+of the Copyright Holder as specified below.
+
+"Copyright Holder" is whoever is named in the copyright or
+copyrights for the package.
+
+"You" is you, if you're thinking about copying or distributing
+this Package.
+
+"Reasonable copying fee" is whatever you can justify on the
+basis of media cost, duplication charges, time of people involved,
+and so on.  (You will not be required to justify it to the
+                 Copyright Holder, but only to the computing community at large
+                 as a market that must bear the fee.)
+
+"Freely Available" means that no fee is charged for the item
+itself, though there may be fees involved in handling the item.
+It also means that recipients of the item may redistribute it
+under the same conditions they received it.
+
+1. You may make and give away verbatim copies of the source form of the
+Standard Version of this Package without restriction, provided that you
+duplicate all of the original copyright notices and associated disclaimers.
+
+2. You may apply bug fixes, portability fixes and other modifications
+derived from the Public Domain or from the Copyright Holder.  A Package
+modified in such a way shall still be considered the Standard Version.
+
+3. You may otherwise modify your copy of this Package in any way, provided
+that you insert a prominent notice in each changed file stating how and
+when you changed that file, and provided that you do at least ONE of the
+following:
+
+a) place your modifications in the Public Domain or otherwise make them
+Freely Available, such as by posting said modifications to Usenet or
+an equivalent medium, or placing the modifications on a major archive
+site such as uunet.uu.net, or by allowing the Copyright Holder to include
+your modifications in the Standard Version of the Package.
+
+b) use the modified Package only within your corporation or organization.
+
+c) rename any non-standard executables so the names do not conflict
+with standard executables, which must also be provided, and provide
+a separate manual page for each non-standard executable that clearly
+documents how it differs from the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+4. You may distribute the programs of this Package in object code or
+executable form, provided that you do at least ONE of the following:
+
+a) distribute a Standard Version of the executables and library files,
+together with instructions (in the manual page or equivalent) on where
+to get the Standard Version.
+
+b) accompany the distribution with the machine-readable source of
+the Package with your modifications.
+
+c) give non-standard executables non-standard names, and clearly
+document the differences in manual pages (or equivalent), together
+with instructions on where to get the Standard Version.
+
+d) make other distribution arrangements with the Copyright Holder.
+
+5. You may charge a reasonable copying fee for any distribution of this
+Package.  You may charge any fee you choose for support of this
+Package.  You may not charge a fee for this Package itself.  However,
+you may distribute this Package in aggregate with other (possibly
+commercial) programs as part of a larger (possibly commercial) software
+distribution provided that you do not advertise this Package as a
+product of your own.  You may embed this Package's interpreter within
+an executable of yours (by linking); this shall be construed as a mere
+form of aggregation, provided that the complete Standard Version of the
+interpreter is so embedded.
+
+6. The scripts and library files supplied as input to or produced as
+output from the programs of this Package do not automatically fall
+under the copyright of this Package, but belong to whoever generated
+them, and may be sold commercially, and may be aggregated with this
+Package.  If such scripts or library files are aggregated with this
+Package via the so-called "undump" or "unexec" methods of producing a
+binary executable image, then distribution of such an image shall
+neither be construed as a distribution of this Package nor shall it
+fall under the restrictions of Paragraphs 3 and 4, provided that you do
+not represent such an executable image as a Standard Version of this
+Package.
+
+7. C subroutines (or comparably compiled subroutines in other
+languages) supplied by you and linked into this Package in order to
+emulate subroutines and variables of the language defined by this
+Package shall not be considered part of this Package, but are the
+equivalent of input as in Paragraph 6, provided these subroutines do
+not change the language in any way that would cause it to fail the
+regression tests for the language.
+
+8. Aggregation of this Package with a commercial distribution is always
+permitted provided that the use of this Package is embedded; that is,
+when no overt attempt is made to make this Package's interfaces visible
+to the end user of the commercial distribution.  Such use shall not be
+construed as a distribution of this Package.
+
+9. The name of the Copyright Holder may not be used to endorse or promote
+products derived from this software without specific prior written permission.
+
+10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+
+The End
+Contact GitHub API Training Shop Blog About
+� 2016 GitHub, Inc. Terms Privacy Security Status Help

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-libpq-sha2.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-libpq-sha2.txt b/licenses/LICENSE-libpq-sha2.txt
new file mode 100644
index 0000000..66b9ad2
--- /dev/null
+++ b/licenses/LICENSE-libpq-sha2.txt
@@ -0,0 +1,26 @@
+ Copyright (c) 2000-2001, Aaron D. Gifford
+ All rights reserved.
+ 
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+ 1. Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+ 3. Neither the name of the copyright holder nor the names of contributors
+    may be used to endorse or promote products derived from this software
+    without specific prior written permission.
+ 
+ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-lockfile.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-lockfile.txt b/licenses/LICENSE-lockfile.txt
new file mode 100644
index 0000000..610c079
--- /dev/null
+++ b/licenses/LICENSE-lockfile.txt
@@ -0,0 +1,21 @@
+This is the MIT license: http://www.opensource.org/licenses/mit-license.php
+
+Copyright (c) 2007 Skip Montanaro.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-oraface.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-oraface.txt b/licenses/LICENSE-oraface.txt
new file mode 100644
index 0000000..460649d
--- /dev/null
+++ b/licenses/LICENSE-oraface.txt
@@ -0,0 +1,18 @@
+Orafce, Oracle API support
+
+Permission to use, copy, modify, and distribute this software and its
+documentation for any purpose, without fee, and without a written agreement
+is hereby granted, provided that the above copyright notice and this
+paragraph and the following two paragraphs appear in all copies.
+
+IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR
+DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING
+LOST PROFITS, ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS
+DOCUMENTATION, EVEN IF THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
+
+THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
+INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATIONS TO
+PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pexpect.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pexpect.txt b/licenses/LICENSE-pexpect.txt
new file mode 100644
index 0000000..b810638
--- /dev/null
+++ b/licenses/LICENSE-pexpect.txt
@@ -0,0 +1,20 @@
+Free, open source, and all that good stuff.
+Pexpect Copyright (c) 2006 Noah Spurrier
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pg8000.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pg8000.txt b/licenses/LICENSE-pg8000.txt
new file mode 100644
index 0000000..6968101
--- /dev/null
+++ b/licenses/LICENSE-pg8000.txt
@@ -0,0 +1,26 @@
+Copyright (c) 2007-2009, Mathieu Fenniak
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions of source code must retain the above copyright notice,
+this list of conditions and the following disclaimer.
+* Redistributions in binary form must reproduce the above copyright notice,
+this list of conditions and the following disclaimer in the documentation
+and/or other materials provided with the distribution.
+* The name of the author may not be used to endorse or promote products
+derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/8eff6033/licenses/LICENSE-pg_controldata.txt
----------------------------------------------------------------------
diff --git a/licenses/LICENSE-pg_controldata.txt b/licenses/LICENSE-pg_controldata.txt
new file mode 100644
index 0000000..8f6f68f
--- /dev/null
+++ b/licenses/LICENSE-pg_controldata.txt
@@ -0,0 +1,24 @@
+Copyright (c) 2001, Oliver Elphick <ol...@lfix.co.uk> 
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright
+      notice, this list of conditions and the following disclaimer in the
+      documentation and/or other materials provided with the distribution.
+    * Neither the name of the <organization> nor the
+      names of its contributors may be used to endorse or promote products
+      derived from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


[28/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_ocaml_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_ocaml_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_ocaml_generator.cc
deleted file mode 100644
index 75bc12d..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_ocaml_generator.cc
+++ /dev/null
@@ -1,1756 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-#include "t_oop_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::ios;
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * OCaml code generator.
- *
- */
-class t_ocaml_generator : public t_oop_generator {
-public:
-  t_ocaml_generator(t_program* program,
-                    const std::map<std::string, std::string>& parsed_options,
-                    const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-ocaml";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-  void generate_program();
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-  bool struct_member_persistent(t_field* tmember);
-  bool struct_member_omitable(t_field* tmember);
-  bool struct_member_default_cheaply_comparable(t_field* tmember);
-  std::string struct_member_copy_of(t_type* type, string what);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_ocaml_struct(t_struct* tstruct, bool is_exception);
-  void generate_ocaml_struct_definition(std::ofstream& out,
-                                        t_struct* tstruct,
-                                        bool is_xception = false);
-  void generate_ocaml_struct_member(std::ofstream& out, string tname, t_field* tmember);
-  void generate_ocaml_struct_sig(std::ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_ocaml_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_ocaml_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_ocaml_function_helpers(t_function* tfunction);
-  void generate_ocaml_method_copy(std::ofstream& out, const vector<t_field*>& members);
-  void generate_ocaml_member_copy(std::ofstream& out, t_field* member);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out, t_field* tfield, std::string prefix);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct);
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype);
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset);
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-  void generate_deserialize_type(std::ofstream& out, t_type* type);
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string name = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string ocaml_autogen_comment();
-  std::string ocaml_imports();
-  std::string type_name(t_type* ttype);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string function_type(t_function* tfunc, bool method = false, bool options = false);
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string render_ocaml_type(t_type* type);
-
-private:
-  /**
-   * File streams
-   */
-
-  std::ofstream f_types_;
-  std::ofstream f_consts_;
-  std::ofstream f_service_;
-
-  std::ofstream f_types_i_;
-  std::ofstream f_service_i_;
-};
-
-/*
- * This is necessary because we want typedefs to appear later,
- * after all the types have been declared.
- */
-void t_ocaml_generator::generate_program() {
-  // Initialize the generator
-  init_generator();
-
-  // Generate enums
-  vector<t_enum*> enums = program_->get_enums();
-  vector<t_enum*>::iterator en_iter;
-  for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-    generate_enum(*en_iter);
-  }
-
-  // Generate structs
-  vector<t_struct*> structs = program_->get_structs();
-  vector<t_struct*>::iterator st_iter;
-  for (st_iter = structs.begin(); st_iter != structs.end(); ++st_iter) {
-    generate_struct(*st_iter);
-  }
-
-  // Generate xceptions
-  vector<t_struct*> xceptions = program_->get_xceptions();
-  vector<t_struct*>::iterator x_iter;
-  for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-    generate_xception(*x_iter);
-  }
-
-  // Generate typedefs
-  vector<t_typedef*> typedefs = program_->get_typedefs();
-  vector<t_typedef*>::iterator td_iter;
-  for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-    generate_typedef(*td_iter);
-  }
-
-  // Generate services
-  vector<t_service*> services = program_->get_services();
-  vector<t_service*>::iterator sv_iter;
-  for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-    service_name_ = get_service_name(*sv_iter);
-    generate_service(*sv_iter);
-  }
-
-  // Generate constants
-  vector<t_const*> consts = program_->get_consts();
-  generate_consts(consts);
-
-  // Close the generator
-  close_generator();
-}
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_ocaml_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // Make output file
-  string f_types_name = get_out_dir() + program_name_ + "_types.ml";
-  f_types_.open(f_types_name.c_str());
-  string f_types_i_name = get_out_dir() + program_name_ + "_types.mli";
-  f_types_i_.open(f_types_i_name.c_str());
-
-  string f_consts_name = get_out_dir() + program_name_ + "_consts.ml";
-  f_consts_.open(f_consts_name.c_str());
-
-  // Print header
-  f_types_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_types_i_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_consts_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl << "open "
-            << capitalize(program_name_) << "_types" << endl;
-}
-
-/**
- * Autogen'd comment
- */
-string t_ocaml_generator::ocaml_autogen_comment() {
-  return std::string("(*\n") + " Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n" + "\n"
-         + " DO NOT EDIT UNLESS YOU ARE SURE YOU KNOW WHAT YOU ARE DOING\n" + "*)\n";
-}
-
-/**
- * Prints standard thrift imports
- */
-string t_ocaml_generator::ocaml_imports() {
-  return "open Thrift";
-}
-
-/**
- * Closes the type files
- */
-void t_ocaml_generator::close_generator() {
-  // Close types file
-  f_types_.close();
-}
-
-/**
- * Generates a typedef. Ez.
- *
- * @param ttypedef The type definition
- */
-void t_ocaml_generator::generate_typedef(t_typedef* ttypedef) {
-  f_types_ << indent() << "type " << decapitalize(ttypedef->get_symbolic()) << " = "
-           << render_ocaml_type(ttypedef->get_type()) << endl << endl;
-  f_types_i_ << indent() << "type " << decapitalize(ttypedef->get_symbolic()) << " = "
-             << render_ocaml_type(ttypedef->get_type()) << endl << endl;
-}
-
-/**
- * Generates code for an enumerated type.
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_ocaml_generator::generate_enum(t_enum* tenum) {
-  indent(f_types_) << "module " << capitalize(tenum->get_name()) << " = " << endl << "struct"
-                   << endl;
-  indent(f_types_i_) << "module " << capitalize(tenum->get_name()) << " : " << endl << "sig"
-                     << endl;
-  indent_up();
-  indent(f_types_) << "type t = " << endl;
-  indent(f_types_i_) << "type t = " << endl;
-  indent_up();
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << name << endl;
-    indent(f_types_i_) << "| " << name << endl;
-  }
-  indent_down();
-
-  indent(f_types_) << "let to_i = function" << endl;
-  indent(f_types_i_) << "val to_i : t -> Int32.t" << endl;
-  indent_up();
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << name << " -> " << value << "l" << endl;
-  }
-  indent_down();
-
-  indent(f_types_) << "let of_i = function" << endl;
-  indent(f_types_i_) << "val of_i : Int32.t -> t" << endl;
-  indent_up();
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    string name = capitalize((*c_iter)->get_name());
-    indent(f_types_) << "| " << value << "l -> " << name << endl;
-  }
-  indent(f_types_) << "| _ -> raise Thrift_error" << endl;
-  indent_down();
-  indent_down();
-  indent(f_types_) << "end" << endl;
-  indent(f_types_i_) << "end" << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_ocaml_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = decapitalize(tconst->get_name());
-  t_const_value* value = tconst->get_value();
-
-  indent(f_consts_) << "let " << name << " = " << render_const_value(type, value) << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_ocaml_generator::render_const_value(t_type* type, t_const_value* value) {
-  type = get_true_type(type);
-  std::ostringstream out;
-  // OCaml requires all floating point numbers contain a decimal point
-  out.setf(ios::showpoint);
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      out << value->get_integer() << "l";
-      break;
-    case t_base_type::TYPE_I64:
-      out << value->get_integer() << "L";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer() << ".0";
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    t_enum* tenum = (t_enum*)type;
-    vector<t_enum_value*> constants = tenum->get_constants();
-    vector<t_enum_value*>::iterator c_iter;
-    for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-      int val = (*c_iter)->get_value();
-      if (val == value->get_integer()) {
-        indent(out) << capitalize(tenum->get_name()) << "." << capitalize((*c_iter)->get_name());
-        break;
-      }
-    }
-  } else if (type->is_struct() || type->is_xception()) {
-    string cname = type_name(type);
-    string ct = tmp("_c");
-    out << endl;
-    indent_up();
-    indent(out) << "(let " << ct << " = new " << cname << " in" << endl;
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string fname = v_iter->first->get_string();
-      out << indent();
-      out << ct << "#set_" << fname << " ";
-      out << render_const_value(field_type, v_iter->second);
-      out << ";" << endl;
-    }
-    indent(out) << ct << ")";
-    indent_down();
-    indent_down();
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    string hm = tmp("_hm");
-    out << endl;
-    indent_up();
-    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << endl;
-    indent_up();
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(ktype, v_iter->first);
-      string val = render_const_value(vtype, v_iter->second);
-      indent(out) << "Hashtbl.add " << hm << " " << key << " " << val << ";" << endl;
-    }
-    indent(out) << hm << ")";
-    indent_down();
-    indent_down();
-  } else if (type->is_list()) {
-    t_type* etype;
-    etype = ((t_list*)type)->get_elem_type();
-    out << "[" << endl;
-    indent_up();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent();
-      out << render_const_value(etype, *v_iter);
-      out << ";" << endl;
-    }
-    indent_down();
-    indent(out) << "]";
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    string hm = tmp("_hm");
-    indent(out) << "(let " << hm << " = Hashtbl.create " << val.size() << " in" << endl;
-    indent_up();
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(etype, *v_iter);
-      indent(out) << "Hashtbl.add " << hm << " " << val << " true;" << endl;
-    }
-    indent(out) << hm << ")" << endl;
-    indent_down();
-    out << endl;
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-  return out.str();
-}
-
-/**
- * Generates a "struct"
- */
-void t_ocaml_generator::generate_struct(t_struct* tstruct) {
-  generate_ocaml_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct, but also has an exception declaration.
- *
- * @param txception The struct definition
- */
-void t_ocaml_generator::generate_xception(t_struct* txception) {
-  generate_ocaml_struct(txception, true);
-}
-
-/**
- * Generates an OCaml struct
- */
-void t_ocaml_generator::generate_ocaml_struct(t_struct* tstruct, bool is_exception) {
-  generate_ocaml_struct_definition(f_types_, tstruct, is_exception);
-  generate_ocaml_struct_sig(f_types_i_, tstruct, is_exception);
-}
-
-void t_ocaml_generator::generate_ocaml_method_copy(ofstream& out, const vector<t_field*>& members) {
-  vector<t_field*>::const_iterator m_iter;
-
-  /* Create a copy of the current object */
-  indent(out) << "method copy =" << endl;
-  indent_up();
-  indent_up();
-  indent(out) << "let _new = Oo.copy self in" << endl;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter)
-    generate_ocaml_member_copy(out, *m_iter);
-
-  indent_down();
-  indent(out) << "_new" << endl;
-  indent_down();
-}
-
-string t_ocaml_generator::struct_member_copy_of(t_type* type, string what) {
-  if (type->is_struct() || type->is_xception()) {
-    return what + string("#copy");
-  }
-  if (type->is_map()) {
-    string copy_of_k = struct_member_copy_of(((t_map*)type)->get_key_type(), "k");
-    string copy_of_v = struct_member_copy_of(((t_map*)type)->get_val_type(), "v");
-
-    if (copy_of_k == "k" && copy_of_v == "v") {
-      return string("(Hashtbl.copy ") + what + string(")");
-    } else {
-      return string(
-                 "((fun oh -> let nh = Hashtbl.create (Hashtbl.length oh) in Hashtbl.iter (fun k v "
-                 "-> Hashtbl.add nh ") + copy_of_k + string(" ") + copy_of_v + string(") oh; nh) ")
-             + what + ")";
-    }
-  }
-  if (type->is_set()) {
-    string copy_of = struct_member_copy_of(((t_set*)type)->get_elem_type(), "k");
-
-    if (copy_of == "k") {
-      return string("(Hashtbl.copy ") + what + string(")");
-    } else {
-      return string(
-                 "((fun oh -> let nh = Hashtbl.create (Hashtbl.length oh) in Hashtbl.iter (fun k v "
-                 "-> Hashtbl.add nh ") + copy_of + string(" true") + string(") oh; nh) ") + what
-             + ")";
-    }
-  }
-  if (type->is_list()) {
-    string copy_of = struct_member_copy_of(((t_list*)type)->get_elem_type(), "x");
-    if (copy_of != "x") {
-      return string("(List.map (fun x -> ") + copy_of + string(") ") + what + string(")");
-    } else {
-      return what;
-    }
-  }
-  return what;
-}
-
-void t_ocaml_generator::generate_ocaml_member_copy(ofstream& out, t_field* tmember) {
-  string mname = decapitalize(tmember->get_name());
-  t_type* type = get_true_type(tmember->get_type());
-
-  string grab_field = string("self#grab_") + mname;
-  string copy_of = struct_member_copy_of(type, grab_field);
-  if (copy_of != grab_field) {
-    indent(out);
-    if (!struct_member_persistent(tmember)) {
-      out << "if _" << mname << " <> None then" << endl;
-      indent(out) << "  ";
-    }
-    out << "_new#set_" << mname << " " << copy_of << ";" << endl;
-  }
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_ocaml_generator::generate_ocaml_struct_definition(ofstream& out,
-                                                         t_struct* tstruct,
-                                                         bool is_exception) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  string tname = type_name(tstruct);
-  indent(out) << "class " << tname << " =" << endl;
-  indent(out) << "object (self)" << endl;
-
-  indent_up();
-
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      generate_ocaml_struct_member(out, tname, (*m_iter));
-      out << endl;
-    }
-  }
-  generate_ocaml_method_copy(out, members);
-  generate_ocaml_struct_writer(out, tstruct);
-  indent_down();
-  indent(out) << "end" << endl;
-
-  if (is_exception) {
-    indent(out) << "exception " << capitalize(tname) << " of " << tname << endl;
-  }
-
-  generate_ocaml_struct_reader(out, tstruct);
-}
-
-/**
- * Generates a structure member for a thrift data type.
- *
- * @param tname Name of the parent structure for the member
- * @param tmember Member definition
- */
-void t_ocaml_generator::generate_ocaml_struct_member(ofstream& out,
-                                                     string tname,
-                                                     t_field* tmember) {
-  string x = tmp("_x");
-  string mname = decapitalize(tmember->get_name());
-
-  indent(out) << "val mutable _" << mname << " : " << render_ocaml_type(tmember->get_type());
-  t_const_value* val = tmember->get_value();
-  if (val) {
-    if (struct_member_persistent(tmember))
-      out << " = " << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
-    else
-      out << " option = Some " << render_const_value(tmember->get_type(), tmember->get_value())
-          << endl;
-  } else {
-    // assert(!struct_member_persistent(tmember))
-    out << " option = None" << endl;
-  }
-
-  if (struct_member_persistent(tmember)) {
-    indent(out) << "method get_" << mname << " = Some _" << mname << endl;
-    indent(out) << "method grab_" << mname << " = _" << mname << endl;
-    indent(out) << "method set_" << mname << " " << x << " = _" << mname << " <- " << x << endl;
-  } else {
-    indent(out) << "method get_" << mname << " = _" << mname << endl;
-    indent(out) << "method grab_" << mname << " = match _" << mname
-                << " with None->raise (Field_empty \"" << tname << "." << mname << "\") | Some "
-                << x << " -> " << x << endl;
-    indent(out) << "method set_" << mname << " " << x << " = _" << mname << " <- Some " << x
-                << endl;
-    indent(out) << "method unset_" << mname << " = _" << mname << " <- None" << endl;
-  }
-
-  indent(out) << "method reset_" << mname << " = _" << mname << " <- ";
-  if (val) {
-    if (struct_member_persistent(tmember))
-      out << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
-    else
-      out << "Some " << render_const_value(tmember->get_type(), tmember->get_value()) << endl;
-  } else {
-    out << "None" << endl;
-  }
-}
-
-/**
- * Check whether a member of the structure can not have undefined value
- *
- * @param tmember Member definition
- */
-bool t_ocaml_generator::struct_member_persistent(t_field* tmember) {
-  t_const_value* val = tmember->get_value();
-  return (val ? true : false);
-}
-
-/**
- * Check whether a member of the structure can be skipped during encoding
- *
- * @param tmember Member definition
- */
-bool t_ocaml_generator::struct_member_omitable(t_field* tmember) {
-  return (tmember->get_req() != t_field::T_REQUIRED);
-}
-
-/**
- * Figure out whether a member of the structure has
- * a cheaply comparable default value.
- *
- * @param tmember Member definition
- */
-bool t_ocaml_generator::struct_member_default_cheaply_comparable(t_field* tmember) {
-  t_type* type = get_true_type(tmember->get_type());
-  t_const_value* val = tmember->get_value();
-  if (!val) {
-    return false;
-  } else if (type->is_base_type()) {
-    // Base types are generally cheaply compared for structural equivalence.
-    switch (((t_base_type*)type)->get_base()) {
-    case t_base_type::TYPE_DOUBLE:
-      if (val->get_double() == 0.0)
-        return true;
-      else
-        return false;
-    default:
-      return true;
-    }
-  } else if (type->is_list()) {
-    // Empty lists are cheaply compared for structural equivalence.
-    // Is empty list?
-    if (val->get_list().size() == 0)
-      return true;
-    else
-      return false;
-  } else {
-    return false;
-  }
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_ocaml_generator::generate_ocaml_struct_sig(ofstream& out,
-                                                  t_struct* tstruct,
-                                                  bool is_exception) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  string tname = type_name(tstruct);
-  indent(out) << "class " << tname << " :" << endl;
-  indent(out) << "object ('a)" << endl;
-
-  indent_up();
-
-  string x = tmp("_x");
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      string mname = decapitalize((*m_iter)->get_name());
-      string type = render_ocaml_type((*m_iter)->get_type());
-      indent(out) << "method get_" << mname << " : " << type << " option" << endl;
-      indent(out) << "method grab_" << mname << " : " << type << endl;
-      indent(out) << "method set_" << mname << " : " << type << " -> unit" << endl;
-      if (!struct_member_persistent(*m_iter))
-        indent(out) << "method unset_" << mname << " : unit" << endl;
-      indent(out) << "method reset_" << mname << " : unit" << endl;
-    }
-  }
-  indent(out) << "method copy : 'a" << endl;
-  indent(out) << "method write : Protocol.t -> unit" << endl;
-  indent_down();
-  indent(out) << "end" << endl;
-
-  if (is_exception) {
-    indent(out) << "exception " << capitalize(tname) << " of " << tname << endl;
-  }
-
-  indent(out) << "val read_" << tname << " : Protocol.t -> " << tname << endl;
-}
-
-/**
- * Generates the read method for a struct
- */
-void t_ocaml_generator::generate_ocaml_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  string sname = type_name(tstruct);
-  string str = tmp("_str");
-  string t = tmp("_t");
-  string id = tmp("_id");
-  indent(out) << "let rec read_" << sname << " (iprot : Protocol.t) =" << endl;
-  indent_up();
-  indent(out) << "let " << str << " = new " << sname << " in" << endl;
-  indent_up();
-  indent(out) << "ignore(iprot#readStructBegin);" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "(try while true do" << endl;
-  indent_up();
-  indent_up();
-
-  // Read beginning field marker
-  indent(out) << "let (_," << t << "," << id << ") = iprot#readFieldBegin in" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if " << t << " = Protocol.T_STOP then" << endl;
-  indent_up();
-  indent(out) << "raise Break" << endl;
-  indent_down();
-  indent(out) << "else ();" << endl;
-
-  indent(out) << "(match " << id << " with " << endl;
-  indent_up();
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "| " << (*f_iter)->get_key() << " -> (";
-    out << "if " << t << " = " << type_to_enum((*f_iter)->get_type()) << " then" << endl;
-    indent_up();
-    indent_up();
-    generate_deserialize_field(out, *f_iter, str);
-    indent_down();
-    out << indent() << "else" << endl << indent() << "  iprot#skip " << t << ")" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  out << indent() << "| _ -> "
-      << "iprot#skip " << t << ");" << endl;
-  indent_down();
-  // Read field end marker
-  indent(out) << "iprot#readFieldEnd;" << endl;
-  indent_down();
-  indent(out) << "done; ()" << endl;
-  indent_down();
-  indent(out) << "with Break -> ());" << endl;
-
-  indent(out) << "iprot#readStructEnd;" << endl;
-
-  indent(out) << str << endl << endl;
-  indent_down();
-  indent_down();
-}
-
-void t_ocaml_generator::generate_ocaml_struct_writer(ofstream& out, t_struct* tstruct) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-  string str = tmp("_str");
-  string f = tmp("_f");
-
-  indent(out) << "method write (oprot : Protocol.t) =" << endl;
-  indent_up();
-  indent(out) << "oprot#writeStructBegin \"" << name << "\";" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* tmember = (*f_iter);
-    string mname = "_" + decapitalize(tmember->get_name());
-    string _v;
-
-    if (struct_member_persistent(tmember)) {
-
-      if (struct_member_omitable(tmember) && struct_member_default_cheaply_comparable(tmember)) {
-        _v = "_v";
-        // Avoid redundant encoding of members having default values.
-        indent(out) << "(match " << mname << " with "
-                    << render_const_value(tmember->get_type(), tmember->get_value()) << " -> () | "
-                    << _v << " -> " << endl;
-      } else {
-        _v = mname;
-        indent(out) << "(" << endl;
-      }
-
-    } else {
-
-      indent(out) << "(match " << mname << " with ";
-
-      if (struct_member_omitable(tmember)) {
-        out << "None -> ()";
-
-        if (struct_member_default_cheaply_comparable(tmember)) {
-          // Avoid redundant encoding of members having default values.
-          out << " | Some " << render_const_value(tmember->get_type(), tmember->get_value())
-              << " -> ()";
-        }
-        out << " | Some _v -> " << endl;
-      } else {
-        out << endl;
-        indent(out) << "| None -> raise (Field_empty \"" << type_name(tstruct) << "." << mname
-                    << "\")" << endl;
-        indent(out) << "| Some _v -> " << endl;
-      }
-
-      _v = "_v";
-    }
-    indent_up();
-    // Write field header
-    indent(out) << "oprot#writeFieldBegin(\"" << tmember->get_name() << "\","
-                << type_to_enum(tmember->get_type()) << "," << tmember->get_key() << ");" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, tmember, _v);
-
-    // Write field closer
-    indent(out) << "oprot#writeFieldEnd" << endl;
-
-    indent_down();
-    indent(out) << ");" << endl;
-  }
-
-  // Write the struct map
-  out << indent() << "oprot#writeFieldStop;" << endl << indent() << "oprot#writeStructEnd" << endl;
-
-  indent_down();
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_ocaml_generator::generate_service(t_service* tservice) {
-  string f_service_name = get_out_dir() + capitalize(service_name_) + ".ml";
-  f_service_.open(f_service_name.c_str());
-  string f_service_i_name = get_out_dir() + capitalize(service_name_) + ".mli";
-  f_service_i_.open(f_service_i_name.c_str());
-
-  f_service_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-  f_service_i_ << ocaml_autogen_comment() << endl << ocaml_imports() << endl;
-
-  /* if (tservice->get_extends() != NULL) {
-    f_service_ <<
-      "open " << capitalize(tservice->get_extends()->get_name()) << endl;
-    f_service_i_ <<
-      "open " << capitalize(tservice->get_extends()->get_name()) << endl;
-  }
-  */
-  f_service_ << "open " << capitalize(program_name_) << "_types" << endl << endl;
-
-  f_service_i_ << "open " << capitalize(program_name_) << "_types" << endl << endl;
-
-  // Generate the three main parts of the service
-  generate_service_helpers(tservice);
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-
-  // Close service file
-  f_service_.close();
-  f_service_i_.close();
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_ocaml_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  indent(f_service_) << "(* HELPER FUNCTIONS AND STRUCTURES *)" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_ocaml_struct_definition(f_service_, ts, false);
-    generate_ocaml_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_ocaml_generator::generate_ocaml_function_helpers(t_function* tfunction) {
-  t_struct result(program_, decapitalize(tfunction->get_name()) + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-  generate_ocaml_struct_definition(f_service_, &result, false);
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_ocaml_generator::generate_service_interface(t_service* tservice) {
-  f_service_ << indent() << "class virtual iface =" << endl << "object (self)" << endl;
-  f_service_i_ << indent() << "class virtual iface :" << endl << "object" << endl;
-
-  indent_up();
-
-  if (tservice->get_extends() != NULL) {
-    string extends = type_name(tservice->get_extends());
-    indent(f_service_) << "inherit " << extends << ".iface" << endl;
-    indent(f_service_i_) << "inherit " << extends << ".iface" << endl;
-  }
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string ft = function_type(*f_iter, true, true);
-    f_service_ << indent() << "method virtual " << decapitalize((*f_iter)->get_name()) << " : "
-               << ft << endl;
-    f_service_i_ << indent() << "method virtual " << decapitalize((*f_iter)->get_name()) << " : "
-                 << ft << endl;
-  }
-  indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
-}
-
-/**
- * Generates a service client definition. Note that in OCaml, the client doesn't implement iface.
- *This is because
- * The client does not (and should not have to) deal with arguments being None.
- *
- * @param tservice The service to generate a server for.
- */
-void t_ocaml_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  indent(f_service_) << "class client (iprot : Protocol.t) (oprot : Protocol.t) =" << endl
-                     << "object (self)" << endl;
-  indent(f_service_i_) << "class client : Protocol.t -> Protocol.t -> " << endl << "object" << endl;
-  indent_up();
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    indent(f_service_) << "inherit " << extends << ".client iprot oprot as super" << endl;
-    indent(f_service_i_) << "inherit " << extends << ".client" << endl;
-  }
-  indent(f_service_) << "val mutable seqid = 0" << endl;
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    indent(f_service_) << "method " << function_signature(*f_iter) << " = " << endl;
-    indent(f_service_i_) << "method " << decapitalize((*f_iter)->get_name()) << " : "
-                         << function_type(*f_iter, true, false) << endl;
-    indent_up();
-    indent(f_service_) << "self#send_" << funname;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << " " << decapitalize((*fld_iter)->get_name());
-    }
-    f_service_ << ";" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      f_service_ << "self#recv_" << funname << endl;
-    }
-    indent_down();
-
-    indent(f_service_) << "method private send_" << function_signature(*f_iter) << " = " << endl;
-    indent_up();
-
-    std::string argsname = decapitalize((*f_iter)->get_name() + "_args");
-
-    // Serialize the request header
-    f_service_ << indent() << "oprot#writeMessageBegin (\"" << (*f_iter)->get_name() << "\", "
-               << ((*f_iter)->is_oneway() ? "Protocol.ONEWAY" : "Protocol.CALL") << ", seqid);"
-               << endl;
-
-    f_service_ << indent() << "let args = new " << argsname << " in" << endl;
-    indent_up();
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args#set_" << (*fld_iter)->get_name() << " "
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    // Write to the stream
-    f_service_ << indent() << "args#write oprot;" << endl << indent() << "oprot#writeMessageEnd;"
-               << endl << indent() << "oprot#getTransport#flush" << endl;
-
-    indent_down();
-    indent_down();
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = decapitalize((*f_iter)->get_name() + "_result");
-      t_struct noargs(program_);
-
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs);
-      // Open function
-      f_service_ << indent() << "method private " << function_signature(&recv_function) << " ="
-                 << endl;
-      indent_up();
-
-      // TODO(mcslee): Validate message reply here, seq ids etc.
-
-      f_service_ << indent() << "let (fname, mtype, rseqid) = iprot#readMessageBegin in" << endl;
-      indent_up();
-      f_service_ << indent() << "(if mtype = Protocol.EXCEPTION then" << endl << indent()
-                 << "  let x = Application_Exn.read iprot in" << endl;
-      indent_up();
-      f_service_ << indent() << "  (iprot#readMessageEnd;" << indent()
-                 << "   raise (Application_Exn.E x))" << endl;
-      indent_down();
-      f_service_ << indent() << "else ());" << endl;
-      string res = "_";
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-
-      if (!(*f_iter)->get_returntype()->is_void() || xceptions.size() > 0) {
-        res = "result";
-      }
-      f_service_ << indent() << "let " << res << " = read_" << resultname << " iprot in" << endl;
-      indent_up();
-      f_service_ << indent() << "iprot#readMessageEnd;" << endl;
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "match result#get_success with Some v -> v | None -> (" << endl;
-        indent_up();
-      }
-
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "(match result#get_" << (*x_iter)->get_name()
-                   << " with None -> () | Some _v ->" << endl;
-        indent(f_service_) << "  raise (" << capitalize(type_name((*x_iter)->get_type()))
-                           << " _v));" << endl;
-      }
-
-      // Careful, only return _result if not a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "()" << endl;
-      } else {
-        f_service_
-            << indent()
-            << "raise (Application_Exn.E (Application_Exn.create Application_Exn.MISSING_RESULT \""
-            << (*f_iter)->get_name() << " failed: unknown result\")))" << endl;
-        indent_down();
-      }
-
-      // Close function
-      indent_down();
-      indent_down();
-      indent_down();
-    }
-  }
-
-  indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_ocaml_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  // Generate the header portion
-  indent(f_service_) << "class processor (handler : iface) =" << endl << indent() << "object (self)"
-                     << endl;
-  indent(f_service_i_) << "class processor : iface ->" << endl << indent() << "object" << endl;
-  indent_up();
-
-  f_service_ << indent() << "inherit Processor.t" << endl << endl;
-  f_service_i_ << indent() << "inherit Processor.t" << endl << endl;
-  string extends = "";
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    indent(f_service_) << "inherit " + extends + ".processor (handler :> " + extends + ".iface)"
-                       << endl;
-    indent(f_service_i_) << "inherit " + extends + ".processor" << endl;
-  }
-
-  if (extends.empty()) {
-    indent(f_service_) << "val processMap = Hashtbl.create " << functions.size() << endl;
-  }
-  indent(f_service_i_)
-      << "val processMap : (string, int * Protocol.t * Protocol.t -> unit) Hashtbl.t" << endl;
-
-  // Generate the server implementation
-  indent(f_service_) << "method process iprot oprot =" << endl;
-  indent(f_service_i_) << "method process : Protocol.t -> Protocol.t -> bool" << endl;
-  indent_up();
-
-  f_service_ << indent() << "let (name, typ, seqid)  = iprot#readMessageBegin in" << endl;
-  indent_up();
-  // TODO(mcslee): validate message
-
-  // HOT: dictionary function lookup
-  f_service_ << indent() << "if Hashtbl.mem processMap name then" << endl << indent()
-             << "  (Hashtbl.find processMap name) (seqid, iprot, oprot)" << endl << indent()
-             << "else (" << endl << indent() << "  iprot#skip(Protocol.T_STRUCT);" << endl
-             << indent() << "  iprot#readMessageEnd;" << endl << indent()
-             << "  let x = Application_Exn.create Application_Exn.UNKNOWN_METHOD (\"Unknown "
-                "function \"^name) in" << endl << indent()
-             << "    oprot#writeMessageBegin(name, Protocol.EXCEPTION, seqid);" << endl << indent()
-             << "    x#write oprot;" << endl << indent() << "    oprot#writeMessageEnd;" << endl
-             << indent() << "    oprot#getTransport#flush" << endl << indent() << ");" << endl;
-
-  // Read end of args field, the T_STOP, and the struct close
-  f_service_ << indent() << "true" << endl;
-  indent_down();
-  indent_down();
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent(f_service_) << "initializer" << endl;
-  indent_up();
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "Hashtbl.add processMap \"" << (*f_iter)->get_name()
-               << "\" self#process_" << (*f_iter)->get_name() << ";" << endl;
-  }
-  indent_down();
-
-  indent_down();
-  indent(f_service_) << "end" << endl << endl;
-  indent(f_service_i_) << "end" << endl << endl;
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_ocaml_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open function
-  indent(f_service_) << "method private process_" << tfunction->get_name()
-                     << " (seqid, iprot, oprot) =" << endl;
-  indent_up();
-
-  string argsname = decapitalize(tfunction->get_name()) + "_args";
-  string resultname = decapitalize(tfunction->get_name()) + "_result";
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  string args = "args";
-  if (fields.size() == 0) {
-    args = "_";
-  }
-
-  f_service_ << indent() << "let " << args << " = read_" << argsname << " iprot in" << endl;
-  indent_up();
-  f_service_ << indent() << "iprot#readMessageEnd;" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "let result = new " << resultname << " in" << endl;
-    indent_up();
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "(try" << endl;
-    indent_up();
-  }
-
-  f_service_ << indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "result#set_success ";
-  }
-  f_service_ << "(handler#" << tfunction->get_name();
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    f_service_ << " args#get_" << (*f_iter)->get_name();
-  }
-  f_service_ << ");" << endl;
-
-  if (xceptions.size() > 0) {
-    indent_down();
-    indent(f_service_) << "with" << endl;
-    indent_up();
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << indent() << "| " << capitalize(type_name((*x_iter)->get_type())) << " "
-                 << (*x_iter)->get_name() << " -> " << endl;
-      indent_up();
-      indent_up();
-      if (!tfunction->is_oneway()) {
-        f_service_ << indent() << "result#set_" << (*x_iter)->get_name() << " "
-                   << (*x_iter)->get_name() << endl;
-      } else {
-        indent(f_service_) << "()";
-      }
-      indent_down();
-      indent_down();
-    }
-    indent_down();
-    f_service_ << indent() << ");" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "()" << endl;
-    indent_down();
-    indent_down();
-    return;
-  }
-
-  f_service_ << indent() << "oprot#writeMessageBegin (\"" << tfunction->get_name()
-             << "\", Protocol.REPLY, seqid);" << endl << indent() << "result#write oprot;" << endl
-             << indent() << "oprot#writeMessageEnd;" << endl << indent()
-             << "oprot#getTransport#flush" << endl;
-
-  // Close function
-  indent_down();
-  indent_down();
-  indent_down();
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_ocaml_generator::generate_deserialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = tfield->get_type();
-
-  string name = decapitalize(tfield->get_name());
-  indent(out) << prefix << "#set_" << name << " ";
-  generate_deserialize_type(out, type);
-  out << endl;
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_ocaml_generator::generate_deserialize_type(ofstream& out, t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE";
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type);
-  } else if (type->is_base_type()) {
-    out << "iprot#";
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "compiler error: cannot serialize void field in a struct";
-      break;
-    case t_base_type::TYPE_STRING:
-      out << "readString";
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << "readBool";
-      break;
-    case t_base_type::TYPE_BYTE:
-      out << "readByte";
-      break;
-    case t_base_type::TYPE_I16:
-      out << "readI16";
-      break;
-    case t_base_type::TYPE_I32:
-      out << "readI32";
-      break;
-    case t_base_type::TYPE_I64:
-      out << "readI64";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      out << "readDouble";
-      break;
-    default:
-      throw "compiler error: no ocaml name for base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    string ename = capitalize(type->get_name());
-    out << "(" << ename << ".of_i iprot#readI32)";
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE TYPE '%s'\n", type->get_name().c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a struct, calling read()
- */
-void t_ocaml_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct) {
-  string prefix = "";
-  t_program* program = tstruct->get_program();
-  if (program != NULL && program != program_) {
-    prefix = capitalize(program->get_name()) + "_types.";
-  }
-  string name = decapitalize(tstruct->get_name());
-  out << "(" << prefix << "read_" << name << " iprot)";
-}
-
-/**
- * Serialize a container by writing out the header followed by
- * data and then a footer.
- */
-void t_ocaml_generator::generate_deserialize_container(ofstream& out, t_type* ttype) {
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-  string con = tmp("_con");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  out << endl;
-  indent_up();
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    indent(out) << "(let (" << ktype << "," << vtype << "," << size << ") = iprot#readMapBegin in"
-                << endl;
-    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << endl;
-    indent_up();
-    indent(out) << "for i = 1 to " << size << " do" << endl;
-    indent_up();
-    indent(out) << "let _k = ";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_key_type());
-    out << " in" << endl;
-    indent(out) << "let _v = ";
-    generate_deserialize_type(out, ((t_map*)ttype)->get_val_type());
-    out << " in" << endl;
-    indent_up();
-    indent(out) << "Hashtbl.add " << con << " _k _v" << endl;
-    indent_down();
-    indent_down();
-    indent(out) << "done; iprot#readMapEnd; " << con << ")";
-    indent_down();
-  } else if (ttype->is_set()) {
-    indent(out) << "(let (" << etype << "," << size << ") = iprot#readSetBegin in" << endl;
-    indent(out) << "let " << con << " = Hashtbl.create " << size << " in" << endl;
-    indent_up();
-    indent(out) << "for i = 1 to " << size << " do" << endl;
-    indent_up();
-    indent(out) << "Hashtbl.add " << con << " ";
-    generate_deserialize_type(out, ((t_set*)ttype)->get_elem_type());
-    out << " true" << endl;
-    indent_down();
-    indent(out) << "done; iprot#readSetEnd; " << con << ")";
-    indent_down();
-  } else if (ttype->is_list()) {
-    indent(out) << "(let (" << etype << "," << size << ") = iprot#readListBegin in" << endl;
-    indent_up();
-    indent(out) << "let " << con << " = (Array.to_list (Array.init " << size << " (fun _ -> ";
-    generate_deserialize_type(out, ((t_list*)ttype)->get_elem_type());
-    out << "))) in" << endl;
-    indent_up();
-    indent(out) << "iprot#readListEnd; " << con << ")";
-    indent_down();
-    indent_down();
-  }
-  indent_down();
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_ocaml_generator::generate_serialize_field(ofstream& out, t_field* tfield, string name) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + tfield->get_name();
-  }
-
-  if (name.length() == 0) {
-    name = decapitalize(tfield->get_name());
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    indent(out) << "oprot#";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << "writeString(" << name << ")";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ")";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ")";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ")";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ")";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ")";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ")";
-        break;
-      default:
-        throw "compiler error: no ocaml name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      string ename = capitalize(type->get_name());
-      out << "writeI32(" << ename << ".to_i " << name << ")";
-    }
-
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-  out << ";" << endl;
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_ocaml_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << prefix << "#write(oprot)";
-}
-
-void t_ocaml_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  if (ttype->is_map()) {
-    indent(out) << "oprot#writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ",";
-    out << type_to_enum(((t_map*)ttype)->get_val_type()) << ",";
-    out << "Hashtbl.length " << prefix << ");" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot#writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ",";
-    out << "Hashtbl.length " << prefix << ");" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot#writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                << ",";
-    out << "List.length " << prefix << ");" << endl;
-  }
-
-  if (ttype->is_map()) {
-    string kiter = tmp("_kiter");
-    string viter = tmp("_viter");
-    indent(out) << "Hashtbl.iter (fun " << kiter << " -> fun " << viter << " -> " << endl;
-    indent_up();
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
-  } else if (ttype->is_set()) {
-    string iter = tmp("_iter");
-    indent(out) << "Hashtbl.iter (fun " << iter << " -> fun _ -> ";
-    indent_up();
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
-  } else if (ttype->is_list()) {
-    string iter = tmp("_iter");
-    indent(out) << "List.iter (fun " << iter << " -> ";
-    indent_up();
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    indent_down();
-    indent(out) << ") " << prefix << ";" << endl;
-  }
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot#writeMapEnd";
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot#writeSetEnd";
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot#writeListEnd";
-  }
-}
-
-/**
- * Serializes the members of a map.
- *
- */
-void t_ocaml_generator::generate_serialize_map_element(ofstream& out,
-                                                       t_map* tmap,
-                                                       string kiter,
-                                                       string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield);
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield);
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_ocaml_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_ocaml_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Renders a function signature of the form 'name args'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_ocaml_generator::function_signature(t_function* tfunction, string prefix) {
-  return prefix + decapitalize(tfunction->get_name()) + " "
-         + argument_list(tfunction->get_arglist());
-}
-
-string t_ocaml_generator::function_type(t_function* tfunc, bool method, bool options) {
-  string result = "";
-
-  const vector<t_field*>& fields = tfunc->get_arglist()->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result += render_ocaml_type((*f_iter)->get_type());
-    if (options)
-      result += " option";
-    result += " -> ";
-  }
-  if (fields.empty() && !method) {
-    result += "unit -> ";
-  }
-  result += render_ocaml_type(tfunc->get_returntype());
-  return result;
-}
-
-/**
- * Renders a field list
- */
-string t_ocaml_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += " ";
-    }
-    result += (*f_iter)->get_name();
-  }
-  return result;
-}
-
-string t_ocaml_generator::type_name(t_type* ttype) {
-  string prefix = "";
-  t_program* program = ttype->get_program();
-  if (program != NULL && program != program_) {
-    if (!ttype->is_service()) {
-      prefix = capitalize(program->get_name()) + "_types.";
-    }
-  }
-
-  string name = ttype->get_name();
-  if (ttype->is_service()) {
-    name = capitalize(name);
-  } else {
-    name = decapitalize(name);
-  }
-  return prefix + name;
-}
-
-/**
- * Converts the parse type to a Protocol.t_type enum
- */
-string t_ocaml_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "Protocol.T_VOID";
-    case t_base_type::TYPE_STRING:
-      return "Protocol.T_STRING";
-    case t_base_type::TYPE_BOOL:
-      return "Protocol.T_BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "Protocol.T_BYTE";
-    case t_base_type::TYPE_I16:
-      return "Protocol.T_I16";
-    case t_base_type::TYPE_I32:
-      return "Protocol.T_I32";
-    case t_base_type::TYPE_I64:
-      return "Protocol.T_I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "Protocol.T_DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "Protocol.T_I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "Protocol.T_STRUCT";
-  } else if (type->is_map()) {
-    return "Protocol.T_MAP";
-  } else if (type->is_set()) {
-    return "Protocol.T_SET";
-  } else if (type->is_list()) {
-    return "Protocol.T_LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Converts the parse type to an ocaml type
- */
-string t_ocaml_generator::render_ocaml_type(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      return "unit";
-    case t_base_type::TYPE_STRING:
-      return "string";
-    case t_base_type::TYPE_BOOL:
-      return "bool";
-    case t_base_type::TYPE_BYTE:
-      return "int";
-    case t_base_type::TYPE_I16:
-      return "int";
-    case t_base_type::TYPE_I32:
-      return "Int32.t";
-    case t_base_type::TYPE_I64:
-      return "Int64.t";
-    case t_base_type::TYPE_DOUBLE:
-      return "float";
-    }
-  } else if (type->is_enum()) {
-    return capitalize(((t_enum*)type)->get_name()) + ".t";
-  } else if (type->is_struct() || type->is_xception()) {
-    return type_name((t_struct*)type);
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    return "(" + render_ocaml_type(ktype) + "," + render_ocaml_type(vtype) + ") Hashtbl.t";
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    return "(" + render_ocaml_type(etype) + ",bool) Hashtbl.t";
-  } else if (type->is_list()) {
-    t_type* etype = ((t_list*)type)->get_elem_type();
-    return render_ocaml_type(etype) + " list";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(ocaml, "OCaml", "")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_oop_generator.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_oop_generator.h b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_oop_generator.h
deleted file mode 100644
index 925d108..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_oop_generator.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_OOP_GENERATOR_H
-#define T_OOP_GENERATOR_H
-
-#include <string>
-#include <iostream>
-
-#include "globals.h"
-#include "t_generator.h"
-#include "version.h"
-
-#include <algorithm>
-
-/**
- * Class with utility methods shared across common object oriented languages.
- * Specifically, most of this stuff is for C++/Java.
- *
- */
-class t_oop_generator : public t_generator {
-public:
-  t_oop_generator(t_program* program) : t_generator(program) {}
-
-  /**
-   * Scoping, using curly braces!
-   */
-
-  void scope_up(std::ostream& out) {
-    indent(out) << "{" << std::endl;
-    indent_up();
-  }
-
-  void scope_down(std::ostream& out) {
-    indent_down();
-    indent(out) << "}" << std::endl;
-  }
-
-  std::string upcase_string(std::string original) {
-    std::transform(original.begin(), original.end(), original.begin(), (int (*)(int))toupper);
-    return original;
-  }
-
-  /**
-   * Generates a comment about this code being autogenerated, using C++ style
-   * comments, which are also fair game in Java / PHP, yay!
-   *
-   * @return C-style comment mentioning that this file is autogenerated.
-   */
-  virtual std::string autogen_comment() {
-    return std::string("/**\n") + " * " + autogen_summary() + "\n" + " *\n"
-           + " * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
-           + " *  @generated\n" + " */\n";
-  }
-
-  virtual std::string autogen_summary() {
-    return std::string("Autogenerated by Thrift Compiler (") + THRIFT_VERSION + ")";
-  }
-
-  virtual std::string get_enum_class_name(t_type* type) {
-    std::string package = "";
-    t_program* program = type->get_program();
-    if (program != NULL && program != program_) {
-      package = program->get_namespace("java") + ".";
-    }
-    return package + type->get_name();
-  }
-
-  virtual void generate_java_docstring_comment(std::ofstream& out, std::string contents) {
-    generate_docstring_comment(out, "/**\n", " * ", contents, " */\n");
-  }
-
-  virtual void generate_java_doc(std::ofstream& out, t_field* field) {
-    if (field->get_type()->is_enum()) {
-      std::string combined_message = field->get_doc() + "\n@see "
-                                     + get_enum_class_name(field->get_type());
-      generate_java_docstring_comment(out, combined_message);
-    } else {
-      generate_java_doc(out, (t_doc*)field);
-    }
-  }
-
-  /**
-   * Emits a JavaDoc comment if the provided object has a doc in Thrift
-   */
-  virtual void generate_java_doc(std::ofstream& out, t_doc* tdoc) {
-    if (tdoc->has_doc()) {
-      generate_java_docstring_comment(out, tdoc->get_doc());
-    }
-  }
-
-  /**
-   * Emits a JavaDoc comment if the provided function object has a doc in Thrift
-   */
-  virtual void generate_java_doc(std::ofstream& out, t_function* tfunction) {
-    if (tfunction->has_doc()) {
-      std::stringstream ss;
-      ss << tfunction->get_doc();
-      const std::vector<t_field*>& fields = tfunction->get_arglist()->get_members();
-      std::vector<t_field*>::const_iterator p_iter;
-      for (p_iter = fields.begin(); p_iter != fields.end(); ++p_iter) {
-        t_field* p = *p_iter;
-        ss << "\n@param " << p->get_name();
-        if (p->has_doc()) {
-          ss << " " << p->get_doc();
-        }
-      }
-      generate_docstring_comment(out, "/**\n", " * ", ss.str(), " */\n");
-    }
-  }
-};
-
-#endif


[49/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/CHANGES
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/CHANGES b/depends/thirdparty/thrift/CHANGES
deleted file mode 100644
index 8699261..0000000
--- a/depends/thirdparty/thrift/CHANGES
+++ /dev/null
@@ -1,1779 +0,0 @@
-Apache Thrift Changelog
-
-Thrift 0.9.3
---------------------------------------------------------------------------------
-## Bug
-    * [THRIFT-2441] - Cannot shutdown TThreadedServer when clients are still connected
-    * [THRIFT-2465] - TBinaryProtocolT breaks if copied/moved
-    * [THRIFT-2474] - thrift.h causes a compile failure
-    * [THRIFT-2540] - Running configure from outside the source directory fails
-    * [THRIFT-2598] - Add check for minimum Go version to configure.ac
-    * [THRIFT-2647] - compiler-hs: don't decapitalize field names, do decapitalize argument bindings
-    * [THRIFT-2773] - Generated Java code for 'oneway' methods is incorrect.
-    * [THRIFT-2789] - TNonblockingServer leaks socket FD's under load
-    * [THRIFT-2682] - TThreadedServer leaks per-thread memory
-    * [THRIFT-2674] - JavaScript: declare Accept: and Content-Type: in request
-    * [THRIFT-3078] - TNonblockingServerSocket's logger is not named after TNonblockingServerSocket
-    * [THRIFT-3077] - C++ TFileTransport ignores return code from ftruncate
-    * [THRIFT-3067] - C++ cppcheck performance related warnings
-    * [THRIFT-3066] - C++ TDenseProtocol assert modifies instead of checks
-    * [THRIFT-3071] - bootstrap.sh on Ubuntu 12.04 (Precise) automake error
-    * [THRIFT-3069] - C++ TServerSocket leaks socket on fcntl get or set flags error
-    * [THRIFT-3079] - TNonblockingServerSocket's logger is not named after TNonblockingServerSocket
-    * [THRIFT-3080] - C++ TNonblockingServer connection leak while accept huge number connections.
-    * [THRIFT-3086] - C++ Valgrind Error Cleanup
-    * [THRIFT-3085] - thrift_reconnecting_client never try to reconnect
-    * [THRIFT-3123] - Missing include in compiler/cpp/src/main.h breaks build in some environments
-    * [THRIFT-3125] - Fix the list of exported headers in automake input
-    * [THRIFT-3126] - PHP JSON serializer converts empty or int-indexed maps to lists
-    * [THRIFT-3132] - Properly format date in Java @Generated annotations
-    * [THRIFT-3137] - Travis build hangs after failure
-    * [THRIFT-3138] - "make check" parallel execution is underministic
-    * [THRIFT-3139] - JS library test is flaky
-    * [THRIFT-3140] - ConcurrentModificationException is thrown by JavaScript test server
-    * [THRIFT-3124] - Some signed/unsigned warnings while building compiler
-    * [THRIFT-3128] - Go generated code produces name collisions between services
-    * [THRIFT-3146] - Graphviz generates function name collisions between services
-    * [THRIFT-3147] - Segfault while receiving data
-    * [THRIFT-3148] - Markdown links to coding_standards are dead
-    * [THRIFT-3090] - cmake build is broken on MacOSX
-    * [THRIFT-3097] - cmake targets unconditionally depend on optional libraries
-    * [THRIFT-3094] - master as of 2015-APR-13 fails -DBOOST_THREADS cmake build
-    * [THRIFT-3099] - cmake build is broken on FreeBSD
-    * [THRIFT-3089] - Assigning default ENUM values results in non-compilable java code if java namespace is not defined
-    * [THRIFT-3093] - mingw compile fixes for c++ library 0.9.2
-    * [THRIFT-3098] - Thrift does not pretty print binary typedefs the way it does binary fields
-    * [THRIFT-3091] - c_glib service method should return result from handler method
-    * [THRIFT-3088] - TThreadPoolServer with Sasl auth may leak CLOSE_WAIT socket
-    * [THRIFT-3109] - Cross test log file cannot be browsed when served in HTTP server
-    * [THRIFT-3113] - m4 C++11 macro issue
-    * [THRIFT-3105] - C++ libthriftnb library on Windows build failure
-    * [THRIFT-3115] - Uncompileable code due to name collision with predefined used types
-    * [THRIFT-3117] - Java TSSLTransportFactory can't load certificates within JAR archive
-    * [THRIFT-3102] - could not make check for Go Library
-    * [THRIFT-3120] - Minor spelling errors and an outdated URL
-    * [THRIFT-3121] - Librt does not exist on OS X
-    * [THRIFT-3152] - Compiler error on Mac OSX (missing #include <cstdlib>)
-    * [THRIFT-3162] - make fails for dmd 2.067
-    * [THRIFT-3164] - Thrift C++ library SSL socket by default allows for unsecure SSLv3 negotiation
-    * [THRIFT-3168] - Fix Maven POM
-    * [THRIFT-3170] - Initialism code in the Go compiler causes chaos
-    * [THRIFT-3169] - Do not export thrift.TestStruct and thrift.TestEnum in thrift Go library 
-    * [THRIFT-3191] - Perl compiler does not add support for unexpected exception handling
-    * [THRIFT-3178] - glib C does not compile
-    * [THRIFT-3189] - Perl ServerSocket should allow a specific interface to be listened to
-    * [THRIFT-3252] - Missing TConcurrentClientSyncInfo.h in cpp Makefile, so doesn't install
-    * [THRIFT-3255] - Thrift generator doesn't exclude 'package' keyword for thrift property names breaking java builds
-    * [THRIFT-3260] - multiple warnings in c_glib tutorial
-    * [THRIFT-3256] - Some D test timings are too aggressive for slow machines
-    * [THRIFT-3257] - warning: extra tokens at end of #endif directive
-    * [THRIFT-3184] - Thrift Go leaves file descriptors open
-    * [THRIFT-3203] - DOAP - please fix "Ocaml" => "OCaml"
-    * [THRIFT-3210] - (uncompileable) code generated for server events while are events not enabled
-    * [THRIFT-3215] - TJSONProtocol '(c++) uses "throw new" to throw exceptions instead of "throw"
-    * [THRIFT-3202] - Allow HSHAServer to configure min and max worker threads separately.
-    * [THRIFT-3205] - TCompactProtocol return a wrong error when the io.EOF happens
-    * [THRIFT-3209] - LGPL mentioned in license file
-    * [THRIFT-3197] - keepAliveTime is hard coded as 60 sec in TThreadPoolServer
-    * [THRIFT-3196] - Misspelling in lua TBinaryProtocol (stirctWrite => strictWrite)
-    * [THRIFT-3198] - Allow construction of TTransportFactory with a specified maxLength
-    * [THRIFT-3192] - Go import paths changed in 1.4, and expired June 1
-    * [THRIFT-3271] - Could not find or load main class configtest_ax_javac_and_java on some non-english systems
-    * [THRIFT-3273] - c_glib: Generated code tries to convert between function and void pointers
-    * [THRIFT-3264] - Fix Erlang 16 namespaced types
-    * [THRIFT-3270] - reusing TNonblockingServer::TConnection cause dirty TSocket
-    * [THRIFT-3267] - c_glib: "Critical" failure during unit tests
-    * [THRIFT-3277] - THttpClient leaks connections if it's used for multiple requests
-    * [THRIFT-3278] - NodeJS: Fix exception stack traces and names
-    * [THRIFT-3279] - Fix a bug in retry_max_delay (NodeJS)
-    * [THRIFT-3280] - Initialize retry variables on construction
-    * [THRIFT-3283] - c_glib: Tutorial server always exits with warning
-    * [THRIFT-3284] - c_glib: Empty service produces unused-variable warning
-    * [THRIFT-1925] - c_glib generated code does not compile
-    * [THRIFT-1849] - after transport->open() opens isOpen returns true and next open() goes thru when it shall not
-    * [THRIFT-1866] - java compiler generates non-compiling code with const's defined in a thrift when name includes non-identifier chars
-    * [THRIFT-1938] - FunctionRunner.h -- uses wrong path for Thread.h when installed
-    * [THRIFT-1844] - Password string not cleared
-    * [THRIFT-2004] - Thrift::Union violates :== method contract and crashes
-    * [THRIFT-2073] - Thrift C++ THttpClient error: cannot refill buffer
-    * [THRIFT-2127] - Autoconf scripting does not properly account for cross-compile
-    * [THRIFT-2180] - Integer types issues in Cocoa lib on ARM64
-    * [THRIFT-2189] - Go needs "isset" to fully support "union" type (and optionals)
-    * [THRIFT-2192] - autotools on Redhat based systems
-    * [THRIFT-2546] - cross language tests fails at 'TestMultiException' when using nodejs server
-    * [THRIFT-2547] - nodejs servers and clients fails to connect with cpp using compact protocol
-    * [THRIFT-2548] - Nodejs servers and clients does not work properly with  -ssl
-    * [THRIFT-1471] - toString() does not print ByteBuffer values when nested in a List
-    * [THRIFT-1201] - getaddrinfo resource leak
-    * [THRIFT-615] - TThreadPoolServer doesn't call task_done after pulling tasks from it's clients queue
-    * [THRIFT-162] - Thrift structures are unhashable, preventing them from being used as set elements
-    * [THRIFT-810] - Crashed client on TSocket::close under loads
-    * [THRIFT-557] - charset problem with file Autogenerated by Thrift
-    * [THRIFT-233] - IDL doesn't support negative hex literals
-    * [THRIFT-1649] - contrib/zeromq does not build in 0.8.0
-    * [THRIFT-1642] - Miscalculation lead to throw unexpected "TTransportException::TIMED_OUT"(or called "EAGAIN (timed out)") exception
-    * [THRIFT-1587] - TSocket::setRecvTimeout error
-    * [THRIFT-1248] - pointer subtraction in TMemoryBuffer relies on undefined behavior
-    * [THRIFT-1774] - Sasl Transport client would hang when trying to connect non-sasl transport server
-    * [THRIFT-1754] - RangeError in buffer handling
-    * [THRIFT-1618] - static structMap in FieldMetaData is not thread safe and can lead to deadlocks
-    * [THRIFT-2335] - thrift incompatibility with py:tornado as server, java as client
-    * [THRIFT-2803] - TCP_DEFER_ACCEPT not supported with domain sockets
-    * [THRIFT-2799] - Build Problem(s): ld: library not found for -l:libboost_unit_test_framework.a
-    * [THRIFT-2801] - C++ test suite compilation warnings
-    * [THRIFT-2802] - C++ tutorial compilation warnings
-    * [THRIFT-2795] - thrift_binary_protocol.c: 'dereferencing type-punned pointer will break strict-aliasing rules'
-    * [THRIFT-2817] - TSimpleJSONProtocol reads beyond end of message
-    * [THRIFT-2826] - html:standalone sometimes ignored
-    * [THRIFT-2829] - Support haxelib installation via github
-    * [THRIFT-2828] - slightly wrong help screen indent
-    * [THRIFT-2831] - Removes dead code in web_server.js introduced in THRIFT-2819
-    * [THRIFT-2823] - All JS-tests are failing when run with grunt test
-    * [THRIFT-2827] - Thrift 0.9.2 fails to compile on Yosemite due to tr1/functional include in ProcessorTest.cpp
-    * [THRIFT-2843] - Automake configure.ac has possible typo related to Java
-    * [THRIFT-2813] - multiple haxe library fixes/improvements
-    * [THRIFT-2825] - Supplying unicode to python Thrift client can cause next request arguments to get overwritten
-    * [THRIFT-2840] - Cabal file points to LICENSE file outside the path of the Haskell project.
-    * [THRIFT-2818] - Trailing commas in array
-    * [THRIFT-2830] - Clean up ant warnings in tutorial dir
-    * [THRIFT-2842] - Erlang thrift client has infinite timeout
-    * [THRIFT-2810] - Do not leave the underlying ServerSocket open if construction of TServerSocket fails
-    * [THRIFT-2812] - Go server adding redundant buffering layer
-    * [THRIFT-2839] - TFramedTransport read bug
-    * [THRIFT-2844] - Nodejs support broken when running under Browserify
-    * [THRIFT-2814] - args/result classes not found when no namespace is set
-    * [THRIFT-2847] - function IfValue() is a duplicate of System.StrUtils.IfThen
-    * [THRIFT-2848] - certain Delphi tests do not build if TypeRegistry is used
-    * [THRIFT-2854] - Go Struct writer and reader looses important error information
-    * [THRIFT-2858] - Enable header field case insensitive match in THttpServer
-    * [THRIFT-2857] - C# generator creates uncompilable code for struct constants
-    * [THRIFT-2860] - Delphi server closes connection on unexpected exceptions
-    * [THRIFT-2868] - Enhance error handling in the Go client 
-    * [THRIFT-2879] - TMemoryBuffer: using lua string in wrong way
-    * [THRIFT-2851] - Remove strange public Peek() from Go transports
-    * [THRIFT-2852] - Better Open/IsOpen/Close behavior for StreamTransport.
-    * [THRIFT-2871] - Missing semicolon in thrift.js
-    * [THRIFT-2872] - ThreadManager deadlock for task expiration
-    * [THRIFT-2881] - Handle errors from Accept() correctly
-    * [THRIFT-2849] - Spell errors reported by codespell tool
-    * [THRIFT-2870] - C++ TJSONProtocol using locale dependent formatting
-    * [THRIFT-2882] - Lua Generator: using string.len funtion to get struct(map,list,set) size
-    * [THRIFT-2864] - JSON generator missing from Visual Studio build project 
-    * [THRIFT-2878] - Go validation support of required fields
-    * [THRIFT-2873] - TPipe and TPipeServer don't compile on Windows with UNICODE enabled
-    * [THRIFT-2888] - import of <limits> is missing in JSON generator
-    * [THRIFT-2900] - Python THttpClient does not reset socket timeout on exception
-    * [THRIFT-2907] - 'ntohll' macro redefined
-    * [THRIFT-2884] - Map does not serialize correctly for JSON protocol in Go library
-    * [THRIFT-2887] - --with-openssl configure flag is ignored
-    * [THRIFT-2894] - PHP json serializer skips maps with int/bool keys
-    * [THRIFT-2904] - json_protocol_test.go fails
-    * [THRIFT-2906] - library not found for -l:libboost_unit_test_framework.a
-    * [THRIFT-2890] - binary data may lose bytes with JSON transport under specific circumstances
-    * [THRIFT-2891] - binary data may cause a failure with JSON transport under specific circumstances
-    * [THRIFT-2901] - Fix for generated TypeScript functions + indentation of JavaScript maps
-    * [THRIFT-2916] - make check fails for D language
-    * [THRIFT-2918] - Race condition in Python TProcessPoolServer test
-    * [THRIFT-2920] - Erlang Thrift test uses wrong IDL file
-    * [THRIFT-2922] - $TRIAL is used with Python tests but not tested accordingly
-    * [THRIFT-2912] - Autotool build for C++ Qt library is invalid
-    * [THRIFT-2914] - explicit dependency to Lua5.2 fails on some systems
-    * [THRIFT-2910] - libevent is not really optional
-    * [THRIFT-2911] - fix c++ version zeromq transport, the old version cannot work
-    * [THRIFT-2915] - Lua generator missing from Visual Studio build project
-    * [THRIFT-2917] - "make clean" breaks test/c_glib
-    * [THRIFT-2919] - Haxe test server timeout too large
-    * [THRIFT-2923] - JavaScript client assumes a message being written
-    * [THRIFT-2924] - TNonblockingServer crashes when user-provided event_base is used
-    * [THRIFT-2925] - CMake build does not work with OpenSSL nor anything installed in non-system location
-    * [THRIFT-2931] - Access to undeclared static property: Thrift\Protocol\TProtocol::$TBINARYPROTOCOLACCELERATED
-    * [THRIFT-2893] - CMake build fails with boost thread or std thread
-    * [THRIFT-2902] - Generated c_glib code does not compile with clang
-    * [THRIFT-2903] - Qt4 library built with CMake does not work
-    * [THRIFT-2942] - CSharp generate invalid code for property named read or write
-    * [THRIFT-2932] - Node.js Thrift connection libraries throw Exceptions into event emitter
-    * [THRIFT-2933] - v0.9.2: doubles encoded in node with compact protocol cannot be decoded by python
-    * [THRIFT-2934] - createServer signature mismatch
-    * [THRIFT-2981] - IDL with no namespace produces unparsable PHP
-    * [THRIFT-2999] - Addition of .gitattributes text auto in THRIFT-2724 causes modified files on checkout
-    * [THRIFT-2949] - typo in compiler/cpp/README.md
-    * [THRIFT-2957] - warning: source file %s is in a subdirectory, but option 'subdir-objects' is disabled
-    * [THRIFT-2953] - TNamedPipeServerTransport is not Stop()able
-    * [THRIFT-2962] - Docker Thrift env for development and testing
-    * [THRIFT-2971] - C++ test and tutorial parallel build is unstable
-    * [THRIFT-2972] - Missing backslash in lib/cpp/test/Makefile.am
-    * [THRIFT-2951] - Fix Erlang name conflict test
-    * [THRIFT-2955] - Using list of typedefs does not compile on Go
-    * [THRIFT-2960] - namespace regression for Ruby
-    * [THRIFT-2959] - nodejs: fix binary unit tests
-    * [THRIFT-2966] - nodejs: Fix bad references to TProtocolException and TProtocolExceptionType
-    * [THRIFT-2970] - grunt-jsdoc fails due to dependency issues
-    * [THRIFT-3001] - C# Equals fails for binary fields (byte[])
-    * [THRIFT-3003] - Missing LICENSE file prevents package from being installed
-    * [THRIFT-3008] - Node.js server does not fully support exception
-    * [THRIFT-3007] - Travis build is broken because of directory conflict
-    * [THRIFT-3009] - TSSLSocket does not use the correct hostname (breaks certificate checks)
-    * [THRIFT-3011] - C# test server testException() not implemented according to specs
-    * [THRIFT-3012] - Timing problems in NamedPipe implementation due to unnecessary open/close
-    * [THRIFT-3019] - Golang generator missing docstring for structs
-    * [THRIFT-3021] - Service remote tool does not import stub package with package prefix
-    * [THRIFT-3026] - TMultiplexedProcessor does not have a constructor
-    * [THRIFT-3028] - Regression caused by THRIFT-2180
-    * [THRIFT-3017] - order of map key/value types incorrect for one CTOR
-    * [THRIFT-3020] - Cannot compile thrift as C++03
-    * [THRIFT-3024] - User-Agent "BattleNet" used in some Thrift library files
-    * [THRIFT-3047] - Uneven calls to indent_up and indent_down in Cocoa generator
-    * [THRIFT-3048] - NodeJS decoding of I64 is inconsistent across protocols
-    * [THRIFT-3043] - go compiler generator uses non C++98 code
-    * [THRIFT-3044] - Docker README.md paths to Dockerfiles are incorrect
-    * [THRIFT-3040] - bower.json wrong "main" path
-    * [THRIFT-3051] - Go Thrift generator creates bad go code
-    * [THRIFT-3057] - Java compiler build is broken
-    * [THRIFT-3061] - C++ TSSLSocket shutdown delay/vulnerability
-    * [THRIFT-3062] - C++ TServerSocket invalid port number (over 999999) causes stack corruption
-    * [THRIFT-3065] - Update libthrift dependencies (slf4j, httpcore, httpclient)
-    * [THRIFT-3244] - TypeScript: fix namespace of included types
-    * [THRIFT-3246] - Reduce the number of trivial warnings in Windows C++ CMake builds
-    * [THRIFT-3224] - Fix TNamedPipeServer unpredictable behavior on accept
-    * [THRIFT-3230] - Python compiler generates wrong code if there is function throwing a typedef of exception with another namespace
-    * [THRIFT-3236] - MaxSkipDepth never checked
-    * [THRIFT-3239] - Limit recursion depth
-    * [THRIFT-3241] - fatal error: runtime: cannot map pages in arena address space
-    * [THRIFT-3242] - OSGi Import-Package directive is missing the Apache HTTP packages
-    * [THRIFT-3234] - Limit recursion depth
-    * [THRIFT-3222] - TypeScript: Generated Enums are quoted
-    * [THRIFT-3229] - unexpected Timeout exception when desired bytes are only partially available
-    * [THRIFT-3231] - CPP: Limit recursion depth to 64
-    * [THRIFT-3235] - Limit recursion depth
-    * [THRIFT-3175] - fastbinary.c python deserialize can cause huge allocations from garbage
-    * [THRIFT-3176] - Union incorrectly implements ==
-    * [THRIFT-3177] - Fails to run rake test
-    * [THRIFT-3180] - lua plugin: framed transport do not work
-    * [THRIFT-3179] - lua plugin cant connect to remote server because function l_socket_create_and_connect always bind socket to localhost
-    * [THRIFT-3248] - TypeScript: additional comma in method signature without parameters
-    * [THRIFT-3302] - Go JSON protocol should encode Thrift byte type as signed integer string
-    * [THRIFT-3297] - c_glib: an abstract base class is not generated
-    * [THRIFT-3294] - TZlibTransport for Java does not write data correctly
-    * [THRIFT-3296] - Go cross test does not conform to spec
-    * [THRIFT-3295] - C# library does not build on Mono 4.0.2.5 or later
-    * [THRIFT-3293] - JavaScript: null values turn into empty structs in constructor
-    * [THRIFT-3310] - lib/erl/README.md has incorrect formatting
-    * [THRIFT-3319] - CSharp tutorial will not build using the *.sln
-    * [THRIFT-3335] - Ruby server does not handle processor exception
-    * [THRIFT-3338] - Stray underscore in generated go when service name starts with "New"
-    * [THRIFT-3324] - Update Go Docs for pulling all packages
-    * [THRIFT-3345] - Clients blocked indefinitely when a java.lang.Error is thrown
-    * [THRIFT-3332] - make dist fails on clean build
-    * [THRIFT-3326] - Tests do not compile under *BSD
-    * [THRIFT-3334] - Markdown notation of protocol spec is malformed
-    * [THRIFT-3331] - warning: \u2018etype\u2019 may be used uninitialized in this function
-    * [THRIFT-3349] - Python server does not handle processor exception
-    * [THRIFT-3343] - Fix haskell README
-    * [THRIFT-3340] - Python: enable json tests again
-    * [THRIFT-3311] - Top level README.md has incorrect formmating
-    * [THRIFT-2936] - Minor memory leak in SSL
-    * [THRIFT-3290] - Using from in variable names causes the generated Python code to have errors
-    * [THRIFT-3225] - Fix TPipeServer unpredictable behavior on interrupt()
-    * [THRIFT-3354] - Fix word-extraction substr bug in initialism code
-    * [THRIFT-2006] - TBinaryProtocol message header call name length is not validated and can be used to core the server
-    * [THRIFT-3329] - C++ library unit tests don't compile against the new boost-1.59 unit test framework
-    * [THRIFT-2630] - windows7 64bit pc. ipv4 and ipv6 pc.can't use
-    * [THRIFT-3336] - Thrift generated streaming operators added in 0.9.2 cannot be overridden
-    * [THRIFT-2681] - Core of unwind_cleanup
-    * [THRIFT-3317] - cpp namespace org.apache issue appears in 0.9
-
-## Documentation
-    * [THRIFT-3286] - Apache Ant is a necessary dependency
-
-## Improvement
-    * [THRIFT-227] - Byte[] in collections aren't pretty printed like regular binary fields
-    * [THRIFT-2744] - Vagrantfile for Centos 6.5
-    * [THRIFT-2644] - Haxe support
-    * [THRIFT-2756] - register Media Type @ IANA
-    * [THRIFT-3076] - Compatibility with Haxe 3.2.0
-    * [THRIFT-3081] - C++ Consolidate client processing loops in TServers
-    * [THRIFT-3083] - C++ Consolidate server processing loops in TSimpleServer, TThreadedServer, TThreadPoolServer
-    * [THRIFT-3084] - C++ add concurrent client limit to threaded servers
-    * [THRIFT-3074] -     Add compiler/cpp/lex.yythriftl.cc to gitignore.
-    * [THRIFT-3134] - Remove use of deprecated "phantom.args"
-    * [THRIFT-3133] - Allow "make cross" and "make precross" to run without building all languages
-    * [THRIFT-3142] - Make JavaScript use downloaded libraries
-    * [THRIFT-3141] - Improve logging of JavaScript test
-    * [THRIFT-3144] - Proposal: make String representation of enums in generated go code less verbose
-    * [THRIFT-3130] - Remove the last vestiges of THRIFT_OVERLOAD_IF from THRIFT-1316
-    * [THRIFT-3131] - Consolidate suggested import path for go thrift library to git.apache.org in docs and code
-    * [THRIFT-3092] - Generated Haskell types should derive Generic
-    * [THRIFT-3110] -  Print error log after cross test failures on Travis
-    * [THRIFT-3114] - Using local temp variables to not pollute the global table
-    * [THRIFT-3106] - CMake summary should give more information why a library is set to off
-    * [THRIFT-3119] - Java's TThreadedSelectorServer has indistinguishable log messages in run()
-    * [THRIFT-3122] - Javascript struct constructor should properly initialize struct and container members from plain js arguments
-    * [THRIFT-3151] - Fix links to git-wip* - should be git.apache.org
-    * [THRIFT-3167] - Windows build from source instructions need to be revised
-    * [THRIFT-3155] - move contrib/mingw32-toolchain.cmake to build/cmake/
-    * [THRIFT-3160] - Make generated go enums implement TextMarshaller and TextUnmarshaller interfaces
-    * [THRIFT-3150] - Add an option to thrift go generator to make Read and Write methods private
-    * [THRIFT-3149] - Make ReadFieldN methods in generated Go code private
-    * [THRIFT-3172] - Add tutorial to Thrift web site
-    * [THRIFT-3214] - Add Erlang option for using maps instead of dicts
-    * [THRIFT-3201] - Capture github test artifacts for failed builds
-    * [THRIFT-3266] - c_glib: Multiple compiler warnings building unit tests
-    * [THRIFT-3285] - c_glib: Build library with all warnings enabled, no warnings generated
-    * [THRIFT-1954] - Allow for a separate connection timeout value 
-    * [THRIFT-2098] - Add support for Qt5+
-    * [THRIFT-2199] - Remove Dense protocol (was: move to Contrib)
-    * [THRIFT-406] - C++ Test suite cleanup
-    * [THRIFT-902] - socket and connect timeout in TSocket should be distinguished
-    * [THRIFT-388] - Use a separate wire format for async calls
-    * [THRIFT-727] - support native C++ language specific exception message
-    * [THRIFT-1784] - pep-3110 compliance for exception handling 
-    * [THRIFT-1025] - C++ ServerSocket should inherit from Socket with the necessary Ctor to listen on connections from a specific host
-    * [THRIFT-2269] - Can deploy libthrift-source.jar to maven center repository
-    * [THRIFT-2804] - Pull an interface out of TBaseAsyncProcessor
-    * [THRIFT-2806] - more whitespace fixups
-    * [THRIFT-2811] - Make remote socket address accessible
-    * [THRIFT-2809] - .gitignore update for compiler's visual project
-    * [THRIFT-2846] - Expose ciphers parameter from ssl.wrap_socket()
-    * [THRIFT-2859] - JSON generator: output complete descriptors
-    * [THRIFT-2861] - add buffered transport
-    * [THRIFT-2865] - Test case for Go: SeqId out of sequence
-    * [THRIFT-2866] - Go generator source code is hard to read and maintain
-    * [THRIFT-2880] - Read the network address from the listener if available.
-    * [THRIFT-2875] - Typo in TDenseProtocol.h comment
-    * [THRIFT-2874] - TBinaryProtocol  member variable "string_buf_" is never used.
-    * [THRIFT-2855] - Move contributing.md to the root of the repository
-    * [THRIFT-2862] - Enable RTTI and/or build macros for generated code
-    * [THRIFT-2876] -  Add test for THRIFT-2526 Assignment operators and copy constructors in c++ don't copy the __isset struct
-    * [THRIFT-2897] - Generate -isEqual: and -hash methods
-    * [THRIFT-2909] - Improve travis build
-    * [THRIFT-2921] - Make Erlang impl ready for OTP 18 release (dict/0 and set/0 are deprecated)
-    * [THRIFT-2928] - Rename the erlang test_server module
-    * [THRIFT-2940] - Allow installing Thrift from git as NPM module by providing package.json in top level directory
-    * [THRIFT-2937] - Allow setting a maximum frame size in TFramedTransport
-    * [THRIFT-2976] - nodejs: xhr and websocket support for browserify
-    * [THRIFT-2996] - Test for Haxe 3.1.3 or better 
-    * [THRIFT-2969] - nodejs: DRY up library tests
-    * [THRIFT-2973] - Update Haxe lib readme regarding Haxe 3.1.3
-    * [THRIFT-2952] - Improve handling of Server.Stop() 
-    * [THRIFT-2964] - nodejs: move protocols and transports into separate files
-    * [THRIFT-2963] - nodejs - add test coverage
-    * [THRIFT-3006] - Attach 'omitempty' json tag for optional fields in Go
-    * [THRIFT-3027] - Go compiler does not ensure common initialisms have consistent case
-    * [THRIFT-3030] - TThreadedServer: Property for number of clientThreads
-    * [THRIFT-3023] - Go compiler is a little overly conservative with names of attributes
-    * [THRIFT-3018] - Compact protocol for Delphi
-    * [THRIFT-3025] - Change pure Int constants into @enums (where possible)
-    * [THRIFT-3031] - migrate "shouldStop" flag to TServer
-    * [THRIFT-3022] - Compact protocol for Haxe
-    * [THRIFT-3041] - Generate asynchronous clients for Cocoa
-    * [THRIFT-3053] - Perl SSL Socket Support (Encryption)
-    * [THRIFT-3247] - Generate a C++ thread-safe client
-    * [THRIFT-3217] - Provide a little endian variant of the binary protocol in C++
-    * [THRIFT-3223] - TypeScript: Add initial support for Enum Maps
-    * [THRIFT-3220] - Option to suppress @Generated Annotation entirely
-    * [THRIFT-3300] - Reimplement TZlibTransport in Java using streams
-    * [THRIFT-3288] - c_glib: Build unit tests with all warnings enabled, no warnings generated
-    * [THRIFT-3347] - Improve cross test servers and clients
-    * [THRIFT-3342] - Improve ruby cross test client and server compatibility
-    * [THRIFT-2296] - Add C++ Base class for service
-    * [THRIFT-3337] - Add testBool method to cross tests
-    * [THRIFT-3303] - Disable concurrent cabal jobs on Travis to avoid GHC crash
-    * [THRIFT-2623] - Docker container for Thrift
-    * [THRIFT-3298] - thrift endian converters may conflict with other libraries
-    * [THRIFT-1559] - Provide memory pool for TBinaryProtocol to eliminate memory fragmentation
-    * [THRIFT-424] - Steal ProtocolBuffers' VarInt implementation for C++
-
-## New Feature
-    * [THRIFT-3070] - Add ability to set the LocalCertificateSelectionCallback
-    * [THRIFT-1909] - Java: Add compiler flag to use the "option pattern" for optional fields
-    * [THRIFT-2099] - Stop TThreadPoolServer with alive connections.
-    * [THRIFT-123] - implement TZlibTransport in Java
-    * [THRIFT-2368] - New option: reuse-objects for Java generator
-    * [THRIFT-2836] - Optionally generate C++11 MoveConstructible types
-    * [THRIFT-2824] - Flag to disable html escaping doctext
-    * [THRIFT-2819] - Add WebsSocket client to node.js
-    * [THRIFT-3050] - Client certificate authentication for non-http TLS in C#
-    * [THRIFT-3292] - Implement TZlibTransport in Go
-
-## Question
-    * [THRIFT-2583] - Thrift on xPC target (SpeedGoat)
-    * [THRIFT-2592] - thrift server using c_glib
-    * [THRIFT-2832] - c_glib: Handle string lists correctly
-    * [THRIFT-3136] - thrift installation problem on mac
-    * [THRIFT-3346] - c_glib: Tutorials example crashes saying Calculator.ping implementation returned FALSE but did not set an error
-
-## Sub-task
-    * [THRIFT-2578] - Moving 'make cross' from test.sh to test.py
-    * [THRIFT-2734] - Go coding standards
-    * [THRIFT-2748] - Add Vagrantfile for Centos 6.5
-    * [THRIFT-2753] - Misc. Haxe improvements
-    * [THRIFT-2640] - Compact Protocol in Cocoa
-    * [THRIFT-3262] - warning: overflow in implicit constant conversion in DenseProtoTest.cpp
-    * [THRIFT-3194] - Can't build with go enabled.  gomock SCC path incorrect.
-    * [THRIFT-3275] - c_glib tutorial warnings in generated code
-    * [THRIFT-1125] - Multiplexing support for the Ruby Library
-    * [THRIFT-2807] - PHP Code Style
-    * [THRIFT-2841] - Add comprehensive integration tests for the whole Go stack
-    * [THRIFT-2815] - Haxe: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-2886] - Integrate binary type in standard Thrift cross test
-    * [THRIFT-2946] - Enhance usability of cross test framework
-    * [THRIFT-2967] - Add .editorconfig to root
-    * [THRIFT-3033] - Perl: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-3174] - Initialism code in the Go compiler doesn't check first word
-    * [THRIFT-3193] - Option to supress date value in @Generated annotation
-    * [THRIFT-3305] - Missing dist files for 0.9.3 release candidate
-    * [THRIFT-3341] - Add testBool methods
-    * [THRIFT-3308] - Fix broken test cases for 0.9.3 release candidate
-
-## Task
-    * [THRIFT-2834] - Remove semi-colons from python code generator
-    * [THRIFT-2853] - Adjust comments not applying anymore after THRIFT-2852
-
-## Test
-    * [THRIFT-3211] - Add make cross support for php TCompactProtocol
-
-## Wish
-    * [THRIFT-2838] - TNonblockingServer can bind to port 0 (i.e., get an OS-assigned port) but there is no way to get the port number
-
-
-
-Thrift 0.9.2
---------------------------------------------------------------------------------
-## Bug
-    * [THRIFT-2793] - Go compiler produces uncompilable code
-    * [THRIFT-1481] - Unix domain sockets in C++ do not support the abstract namespace
-    * [THRIFT-1455] - TBinaryProtocolT<Transport_>::writeString casts from size_t to uint32_t, which is not safe on 64-bit platforms
-    * [THRIFT-1579] - PHP Extention - function thrift_protocol_read_binary not working from TBinarySerializer::deserialize
-    * [THRIFT-1584] - Error: could not SetMinThreads in ThreadPool on single-core machines
-    * [THRIFT-1614] - Thrift build from svn repo sources fails with automake-1.12
-    * [THRIFT-1047] - rb_thrift_memory_buffer_write treats arg as string without check, segfaults if you pass non-string
-    * [THRIFT-1639] - Java/Python: Serialization/Deserialization of double type using CompactProtocol
-    * [THRIFT-1647] - NodeJS BufferedTransport does not work beyond the hello-world example
-    * [THRIFT-2130] - Thrift's D library/test: parts of "make check" code do not compile with recent dmd-2.062 through dmd-2.064alpha
-    * [THRIFT-2140] - Error compiling cpp tutorials
-    * [THRIFT-2139] - MSVC 2012 Error - Cannot compile due to BoostThreadFactory
-    * [THRIFT-2138] - pkgconfig file created with wrong include path
-    * [THRIFT-2160] - Warning in thrift.h when compiling with -Wunused and NDEBUG
-    * [THRIFT-2158] - Compact, JSON, and SimpleJSON protocols are not working correctly
-    * [THRIFT-2167] - nodejs lib throws error if options argument isn't passed
-    * [THRIFT-2288] - Go impl of Thrift JSON protocol wrongly writes/expects true/false for bools
-    * [THRIFT-2147] - Thrift IDL grammar allows for dotted identifier names
-    * [THRIFT-2145] - Rack and Thin are not just development dependencies
-    * [THRIFT-2267] - Should be able to choose socket family in Python TSocket
-    * [THRIFT-2276] - java path in spec file needs updating
-    * [THRIFT-2281] - Generated send/recv code ignores errors returned by the underlying protocol
-    * [THRIFT-2280] - TJSONProtocol.Flush() does not really flush the transport
-    * [THRIFT-2274] - TNonblockingServer and TThreadedSelectorServer do not close their channel selectors on exit and leak file descriptors
-    * [THRIFT-2265] - php library doesn't build
-    * [THRIFT-2232] - IsSet* broken in Go
-    * [THRIFT-2246] - Unset enum value is printed by ToString()
-    * [THRIFT-2240] - thrift.vim (contrib) does not correctly handle 'union'
-    * [THRIFT-2243] - TNonblockingServer in thrift crashes when TFramedTransport opens
-    * [THRIFT-2230] - Cannot Build on RHEL/Centos/Amazon Linux 6.x
-    * [THRIFT-2247] - Go generator doesn't deal well with map keys of type binary
-    * [THRIFT-2253] - Python Tornado TTornadoServer base class change
-    * [THRIFT-2261] - java: error: unmappable character for encoding ASCII
-    * [THRIFT-2259] - C#: unexpected null logDelegate() pointer causes AV in TServer.serve()
-    * [THRIFT-2225] - SSLContext destroy before cleanupOpenSSL
-    * [THRIFT-2224] - TSSLSocket.h and TSSLServerSocket.h should use the platfromsocket too
-    * [THRIFT-2229] - thrift failed to build on OSX 10.9 GM
-    * [THRIFT-2227] - Thrift compiler generates spurious warnings with Xlint
-    * [THRIFT-2219] - Thrift gem fails to build on OS X Mavericks with 1.9.3 rubies
-    * [THRIFT-2226] - TServerSocket - keepAlive wrong initialization order
-    * [THRIFT-2285] - TJsonProtocol implementation for Java doesn't allow a slash (/) to be escaped (\/)
-    * [THRIFT-2216] - Extraneous semicolon in TProtocolUtil.h makes clang mad
-    * [THRIFT-2215] - Generated HTML/Graphviz lists referenced enum identifiers as UNKNOWN.
-    * [THRIFT-2211] - Exception constructor does not contain namespace prefix.
-    * [THRIFT-2210] - lib/java TSimpleJSONProtocol can emit invalid JSON
-    * [THRIFT-2209] - Ruby generator -- please namespace classes
-    * [THRIFT-2202] - Delphi TServerImpl.DefaultLogDelegate may stop the server with I/O-Error 105
-    * [THRIFT-2201] - Ternary operator returns different types (build error for some compilers)
-    * [THRIFT-2200] - nested structs cause generate_fingerprint() to slow down at excessive CPU load
-    * [THRIFT-2197] - fix jar output directory in rpm spec file
-    * [THRIFT-2196] - Fix invalid dependency in Makefile.am
-    * [THRIFT-2194] - Node: Not actually prepending residual data in TFramedTransport.receiver
-    * [THRIFT-2193] - Java code generator emits spurious semicolon when deep copying binary data
-    * [THRIFT-2191] - Fix charp JSONProtocol.ReadJSONDouble (specify InvariantCulture)
-    * [THRIFT-2214] - System header sys/param.h is included inside the Thrift namespace
-    * [THRIFT-2178] - Thrift generator returns error exit code on --version
-    * [THRIFT-2171] - NodeJS implementation has extremely low test coverage
-    * [THRIFT-2183] - gem install fails on zsh
-    * [THRIFT-2182] - segfault in regression tests (GC bug in rb_thrift_memory_buffer_write)
-    * [THRIFT-2181] - oneway calls don't work in NodeJS
-    * [THRIFT-2169] - JavaME Thrift Library causes "java.io.IOException: No Response Entries Available" after using the Thrift client for some time
-    * [THRIFT-2168] - Node.js appears broken (at least, examples don't work as intended)
-    * [THRIFT-2293] - TSSLTransportFactory.createSSLContext() leaves files open
-    * [THRIFT-2279] - TSerializer only returns the first 1024 bytes serialized
-    * [THRIFT-2278] - Buffered transport doesn't support writes > buffer size
-    * [THRIFT-2275] - Fix memory leak in golang compact_protocol.
-    * [THRIFT-2282] - Incorect code generated for some typedefs
-    * [THRIFT-2009] - Go redeclaration error
-    * [THRIFT-1964] - 'Isset' causes problems with C#/.NET serializers
-    * [THRIFT-2026] - Fix TCompactProtocol 64 bit builds
-    * [THRIFT-2108] - Fix TAsyncClientManager timeout race
-    * [THRIFT-2068] - Multiple calls from same connection are not processed in node
-    * [THRIFT-1750] - Make compiler build cleanly under visual studio 10
-    * [THRIFT-1755] - Comment parsing bug
-    * [THRIFT-1771] - "make check" fails on x64 for libboost_unit_test_framework.a
-    * [THRIFT-1841] - NodeJS Thrift incorrectly parses non-UTF8-string types
-    * [THRIFT-1908] - Using php thrift_protocol accelerated transfer causes core dump
-    * [THRIFT-1892] - Socket timeouts are declared in milli-seconds, but are actually set in micro-seconds
-    * [THRIFT-2303] - TBufferredTransport not properly closing underlying transport
-    * [THRIFT-2313] - nodejs server crash after processing the first request when using MultiplexedProcessor/FramedBuffer/BinaryProtocol
-    * [THRIFT-2311] - Go: invalid code generated when exception name is a go keyword
-    * [THRIFT-2308] - node: TJSONProtocol parse error when reading from buffered message
-    * [THRIFT-2316] - ccp: TFileTransportTest
-    * [THRIFT-2352] - msvc failed to compile thrift tests
-    * [THRIFT-2337] - Golang does not report TIMED_OUT exceptions
-    * [THRIFT-2340] - Generated server implementation does not send response type EXCEPTION on the Thrift.TApplicationExceptionType.UNKNOWN_METHOD exception
-    * [THRIFT-2354] - Connection errors can lead to case_clause exceptions
-    * [THRIFT-2339] - Uncaught exception in thrift c# driver
-    * [THRIFT-2356] - c++ thrift client not working with ssl (SSL_connect hangs)
-    * [THRIFT-2331] - Missing call to ReadStructBegin() in TApplicationException.Read()
-    * [THRIFT-2323] - Uncompileable Delphi code generated for typedef'd structs
-    * [THRIFT-2322] - Correctly show the number of times ExecutorService (java) has rejected the client.
-    * [THRIFT-2389] - namespaces handled wrongly in acrionscript 3.0 implementation
-    * [THRIFT-2388] - GoLang - Fix data races in simple_server and server_socket
-    * [THRIFT-2386] - Thrift refuses to link yylex
-    * [THRIFT-2375] - Excessive <br>'s in generated HTML
-    * [THRIFT-2373] - warning CS0414 in THttpClient.cs: private field 'Thrift.Transport.THttpClient.connection' assigned but never used
-    * [THRIFT-2372] - thrift/json_protocol.go:160: function ends without a return statement
-    * [THRIFT-2371] - ruby bundler version fails on ~1.3.1, remove and take latest avail
-    * [THRIFT-2370] - Compiler SEGFAULTs generating HTML documentation for complex strucre
-    * [THRIFT-2384] - Binary map keys produce uncompilable code in go
-    * [THRIFT-2380] - unreachable code (CID 1174546, CID 1174679)
-    * [THRIFT-2378] - service method arguments of binary type lead to uncompileable Go code
-    * [THRIFT-2363] - Issue with character encoding of Success returned from Login using Thrift Proxy and NodeJS
-    * [THRIFT-2359] - TBufferedTransport doesn't clear it's buffer on a failed flush call
-    * [THRIFT-2428] - Python 3 setup.py support
-    * [THRIFT-2367] - Build failure: stdlib and boost both define uint64_t
-    * [THRIFT-2365] - C# decodes too many binary bytes from JSON
-    * [THRIFT-2402] - byte count of FrameBuffer in AWAITING_CLOSE state is not subtracted from readBufferBytesAllocated
-    * [THRIFT-2396] - Build Error on MacOSX
-    * [THRIFT-2395] - thrift Ruby gem requires development dependency 'thin' regardless of environment
-    * [THRIFT-2414] - c_glib fix several bug.
-    * [THRIFT-2420] - Go argument parser for methods without arguments does not skip fields
-    * [THRIFT-2439] - Bug in TProtocolDecorator Class causes parsing errors
-    * [THRIFT-2419] - golang - Fix fmt.Errorf in generated code
-    * [THRIFT-2418] - Go handler function panics on internal error
-    * [THRIFT-2405] - Node.js Multiplexer tests fail (silently)
-    * [THRIFT-2581] - TFDTransport destructor should not throw
-    * [THRIFT-2575] - Thrift includes siginfo_t within apache::thrift::protocol namespace
-    * [THRIFT-2577] - TFileTransport  missuse of closesocket on windows platform
-    * [THRIFT-2576] - Implement Thrift.Protocol.prototype.skip method in JavaScript library
-    * [THRIFT-2588] - Thrift compiler is not buildable in Visual Studio 2010
-    * [THRIFT-2594] - JS Compiler: Single quotes are not being escaped in constants.
-    * [THRIFT-2591] - TFramedTransport does not handle payloads split across packets correctly
-    * [THRIFT-2599] - Uncompileable Delphi code due to naming conflicts with IDL
-    * [THRIFT-2590] - C++ Visual Studio solution doesn't include Multiplexing support
-    * [THRIFT-2595] - Node.js: Fix global leaks and copy-paste errors
-    * [THRIFT-2565] - autoconf fails to find mingw-g++ cross compiler on travis CI
-    * [THRIFT-2555] - excessive "unused field" comments
-    * [THRIFT-2554] - double initialization in generated Read() method
-    * [THRIFT-2551] - OutOfMemoryError "unable to create new native thread" kills serve thread
-    * [THRIFT-2543] - Generated enum type in haskell should be qualified
-    * [THRIFT-2560] - Thrift compiler generator tries to concat ints with strings using +
-    * [THRIFT-2559] - Centos 6.5 unable to "make" with Thrift 0.9.1
-    * [THRIFT-2526] - Assignment operators and copy constructors in c++ don't copy the __isset struct
-    * [THRIFT-2454] - c_glib: There is no gethostbyname_r() in some OS.
-    * [THRIFT-2451] - Do not use pointers for optional fields with defaults. Do not write such fields if its value set to default. Also, do not use pointers for any optional fields mapped to go map or slice. generate Get accessors
-    * [THRIFT-2450] - include HowToContribute in the src repo
-    * [THRIFT-2448] - thrift/test/test.sh has incorrect Node.js test path
-    * [THRIFT-2460] - unopened socket fd must be less than zero.
-    * [THRIFT-2459] - --version should not exit 1
-    * [THRIFT-2468] - Timestamp handling
-    * [THRIFT-2467] - Unable to build contrib/fb303 on OSX 10.9.2
-    * [THRIFT-2466] - Improper error handling for SSL/TLS connections that don't complete a handshake
-    * [THRIFT-2463] - test/py/RunClientServer.py fails sometimes
-    * [THRIFT-2458] - Generated golang server code for "oneway" methods is incorrect
-    * [THRIFT-2456] - THttpClient fails when using async support outside Silverlight
-    * [THRIFT-2524] - Visual Studio project is missing TThreadedServer files
-    * [THRIFT-2523] - Visual Studio project is missing OverlappedSubmissionThread files
-    * [THRIFT-2520] - cpp:cob_style generates incorrect .tcc file
-    * [THRIFT-2508] - Uncompileable C# code due to language keywords in IDL
-    * [THRIFT-2506] - Update TProtocolException error codes to be used consistently throughout the library
-    * [THRIFT-2505] - go: struct should always be a pointer to avoid copying of potentially size-unbounded structs
-    * [THRIFT-2515] - TLS Method error during make
-    * [THRIFT-2503] - C++: Fix name collision when a struct has a member named "val"
-    * [THRIFT-2477] - thrift --help text with misplaced comma
-    * [THRIFT-2492] - test/cpp does not compile on mac
-    * [THRIFT-2500] - sending random data crashes thrift(golang) service
-    * [THRIFT-2475] - c_glib: buffered_transport_write function return always TRUE.
-    * [THRIFT-2495] - JavaScript/Node string constants lack proper escaping
-    * [THRIFT-2491] - unable to import generated ThriftTest service
-    * [THRIFT-2490] - c_glib: if fail to read a exception from server, client may be occurred double free
-    * [THRIFT-2470] - THttpHandler swallows exceptions from processor
-    * [THRIFT-2533] - Boost version in requirements should be updated
-    * [THRIFT-2532] - Java version in installation requirements should be updated
-    * [THRIFT-2529] - TBufferedTransport split  Tcp data bug in nodeJs
-    * [THRIFT-2537] - Path for "go get" does not work (pull request 115)
-    * [THRIFT-2443] - Node fails cross lang tests
-    * [THRIFT-2437] - Author fields in Python setup.py must be strings not lists.
-    * [THRIFT-2435] - Java compiler doesn't like struct member names that are identical to an existing enum or struct type
-    * [THRIFT-2434] - Missing namespace import for php TMultiplexedProcessor implementation
-    * [THRIFT-2432] - Flaky parallel build
-    * [THRIFT-2430] - Crash during TThreadPoolServer shutdown
-    * [THRIFT-667] - Period should not be allowed in identifier names
-    * [THRIFT-1212] - Members capital case conflict
-    * [THRIFT-2584] - Error handler not listened on javascript client
-    * [THRIFT-2294] - Incorrect Makefile generation
-    * [THRIFT-2601] - Fix vagrant to work again for builds again
-    * [THRIFT-2092] - TNonblocking server should release handler as soon as connection closes
-    * [THRIFT-2557] - CS0542 member names cannot be the same as their enclosing type
-    * [THRIFT-2605] - TSocket warning on gcc 4.8.3
-    * [THRIFT-2607] - ThreadManager.cpp warning on clang++ 3.4
-    * [THRIFT-1998] - TCompactProtocol.tcc - one more warning on Visual 2010
-    * [THRIFT-2610] - MSVC warning in TSocket.cpp
-    * [THRIFT-2614] - TNonblockingServer.cpp warnings on MSVC
-    * [THRIFT-2608] - TNonblockingServer.cpp warnings on clang 3.4
-    * [THRIFT-2606] - ThreadManager.h warning in clang++ 3.4
-    * [THRIFT-2609] - TFileTransport.h unused field warning (clang 3.4)
-    * [THRIFT-2416] - Cannot use TCompactProtocol with MSVC
-    * [THRIFT-1803] - Ruby Thrift 0.9.0 tries to encode UUID to UTF8 and crashes
-    * [THRIFT-2385] - Problem with gethostbyname2 during make check
-    * [THRIFT-2262] - thrift server 'MutateRow' operation gives no indication of success / failure
-    * [THRIFT-2048] - Prefer boolean context to nullptr_t conversion
-    * [THRIFT-2528] - Thrift Erlang Library: Multiple thrift applications in one bundle
-    * [THRIFT-1999] - warning on gcc 4.7 while compiling BoostMutex.cpp
-    * [THRIFT-2104] - Structs lose binary data when transferred from server to client in Java
-    * [THRIFT-2184] - undefined method rspec_verify for Thrift::MemoryBufferTransport
-    * [THRIFT-2351] - PHP TCompactProtocol has fails to decode messages
-    * [THRIFT-2016] - Resource Leak in thrift struct under compiler/cpp/src/parse/t_function.h
-    * [THRIFT-2273] - Please delete old releases from mirroring system
-    * [THRIFT-2270] - Faulty library version numbering at build or documentation
-    * [THRIFT-2203] - Tests keeping failing on Jenkins and Travis CI
-    * [THRIFT-2399] - thrift.el: recognize "//"-style comments in emacs thrift-mode
-    * [THRIFT-2582] - "FileTransport error" exception is raised when trying to use Java's TFileTransport
-    * [THRIFT-1682] - Multiple thread calling a Service function unsafely causes message corruption and terminates with Broken Pipe
-    * [THRIFT-2357] - recurse option has no effect when generating php
-    * [THRIFT-2248] - Go generator doesn't deal well with map keys of type binary
-    * [THRIFT-2426] - clarify IP rights and contributions from fbthrift
-    * [THRIFT-2041] - TNonblocking server compilation on windows (ARITHMETIC_RIGHT_SHIFT)
-    * [THRIFT-2400] - thrift.el: recognize "//"-style comments in emacs thrift-mode
-    * [THRIFT-1717] - Fix deb build in jenkins
-    * [THRIFT-2266] - ThreadManager.h:24:10: fatal error: 'tr1/functional' file not found on Mac 10.9 (Mavericks)
-    * [THRIFT-1300] - Test failures with parallel builds (make -j)
-    * [THRIFT-2487] - Tutorial requires two IDL files but only one is linked from the Thrift web site
-    * [THRIFT-2329] - missing release tags within git
-    * [THRIFT-2306] - concurent client calls with nodejs
-    * [THRIFT-2222] - ruby gem cannot be compiled on OS X mavericks
-    * [THRIFT-2381] - code which generated by thrift2/hbase.thrift compile error
-    * [THRIFT-2390] - no close event when connection lost
-    * [THRIFT-2146] - Unable to pass multiple "--gen" options to the thrift compiler
-    * [THRIFT-2438] - Unexpected readFieldEnd call causes JSON Parsing errors
-    * [THRIFT-2498] - Error message "Invalid method name" while trying to call HBase Thrift API
-    * [THRIFT-841] - Build cruft
-    * [THRIFT-2570] - Wrong URL given in http://thrift.apache.org/developers
-    * [THRIFT-2604] - Fix debian packaging
-    * [THRIFT-2618] - Unignore /aclocal files required for build
-    * [THRIFT-2562] - ./configure create MakeFile in lib/d with errors
-    * [THRIFT-2593] - Unable to build thrift on ubuntu-12.04 (Precise)
-    * [THRIFT-2461] - Can't install thrift-0.8.0 on OS X 10.9.2
-    * [THRIFT-2602] - Fix missing dist files
-    * [THRIFT-2620] - Fix python packaging
-    * [THRIFT-2545] - Test CPP fails to build (possibly typo)
-
-## Documentation
-    * [THRIFT-2155] - Adding one liner guide to rename the version.h.in and rename thrifty.cc.h
-    * [THRIFT-1991] - Add exceptions to examples
-    * [THRIFT-2334] - add a tutorial for node JS
-    * [THRIFT-2392] - Actionscript tutorial
-    * [THRIFT-2383] - contrib: sample for connecting Thrift with Rebus
-    * [THRIFT-2382] - contrib: sample for connecting Thrift with STOMP
-
-## Improvement
-    * [THRIFT-1457] - Capacity of TframedTransport write buffer is never reset
-    * [THRIFT-1135] - Node.js tutorial
-    * [THRIFT-1371] - Socket timeouts (SO_RCVTIMEO and SO_SNDTIMEO) not supported on Solaris
-    * [THRIFT-2142] - Minor tweaks to thrift.el for better emacs package compatibility
-    * [THRIFT-2268] - Modify TSaslTransport to ignore TCP health checks from loadbalancers
-    * [THRIFT-2264] - GitHub page incorrectly states that Thrift is still incubating
-    * [THRIFT-2263] - Always generate good hashCode for Java
-    * [THRIFT-2233] - Java compiler should defensively copy its binary inputs
-    * [THRIFT-2239] - Address FindBugs errors
-    * [THRIFT-2249] - Add SMP Build option to thrift.spec (and three config defines)
-    * [THRIFT-2254] - Exceptions generated by Go compiler should implement error interface
-    * [THRIFT-2260] - Thrift imposes unneeded dependency on commons-lang3
-    * [THRIFT-2258] - Add TLS v1.1/1.2 support to TSSLSocket.cpp
-    * [THRIFT-2205] - Node.js Test Server to support test.js JavaScript Browser test and sundry fixes
-    * [THRIFT-2204] - SSL client for the cocoa client
-    * [THRIFT-2172] - Java compiler allocates optionals array for every struct with an optional field
-    * [THRIFT-2185] - use cabal instead of runhaskell in haskell library
-    * [THRIFT-1926] - PHP Constant Generation Refactoring
-    * [THRIFT-2029] - Port C++ tests to Windows
-    * [THRIFT-2054] - TSimpleFileTransport - Java Lib has no straight forward TTransport based file transport
-    * [THRIFT-2040] - "uninitialized variable" warnings on MSVC/windows
-    * [THRIFT-2034] - Give developers' C++ code direct access to socket FDs on server side
-    * [THRIFT-2095] - Use print function for Python 3 compatiblity
-    * [THRIFT-1868] - Make the TPC backlog configurable in the Java servers
-    * [THRIFT-1813] - Add @Generated annotation to generated classes
-    * [THRIFT-1815] - Code generators line buffer output
-    * [THRIFT-2305] - TFramedTransport empty constructor should probably be private
-    * [THRIFT-2304] - Move client assignments from construtor in method
-    * [THRIFT-2309] - Ruby (gem) & PHP RPM subpackages
-    * [THRIFT-2318] - perl: dependency Class::Accessor not checked
-    * [THRIFT-2317] - exclude tutorial from build
-    * [THRIFT-2320] - Program level doctext does not get attached by parser
-    * [THRIFT-2349] - Golang - improve tutorial
-    * [THRIFT-2348] - PHP Generator: add array typehint to functions
-    * [THRIFT-2344] - configure.ac: compiler-only option
-    * [THRIFT-2343] - Golang - Return a single error for all exceptions instead of multiple return values
-    * [THRIFT-2341] - Enable generation of Delphi XMLDoc comments (a.k.a. "Help Insight")
-    * [THRIFT-2355] - Add SSL and Web Socket Support to Node and JavaScript
-    * [THRIFT-2350] - Add async calls to normal JavaScript
-    * [THRIFT-2330] - Generate PHPDoc comments
-    * [THRIFT-2332] - RPMBUILD: run bootstrap (if needed)
-    * [THRIFT-2391] - simple socket transport for actionscript 3.0
-    * [THRIFT-2376] - nodejs: allow Promise style calls for client and server
-    * [THRIFT-2369] - Add ssl support for nodejs implementation
-    * [THRIFT-2401] - Haskell tutorial compiles
-    * [THRIFT-2417] - C# Union classes are not partial
-    * [THRIFT-2415] - Named pipes server performance & message mode
-    * [THRIFT-2404] - emit warning on (typically inefficient) list<byte>
-    * [THRIFT-2398] - Improve Node Server Library
-    * [THRIFT-2397] - Add CORS and CSP support for JavaScript and Node.js libraries
-    * [THRIFT-2407] - use markdown (rename README => README.md)
-    * [THRIFT-2300] - D configure info output should follow same format as other languages
-    * [THRIFT-2579] - Windows CE support
-    * [THRIFT-2574] - Compiler option to generate namespace directories for Ruby
-    * [THRIFT-2571] - Simplify cross compilation using CMake
-    * [THRIFT-2569] - Introduce file to specify third party library locations on Windows
-    * [THRIFT-2568] - Implement own certificate handler
-    * [THRIFT-2552] - eliminate warning from configure.ac
-    * [THRIFT-2549] - Generate json tag for struct members. use go.tag annotation to override the default generated tag.
-    * [THRIFT-2544] - Add support for socket transport for c# library when using Windows Phone projects
-    * [THRIFT-2453] - haskell tutorial: fix up division by 0 example
-    * [THRIFT-2449] - Enhance typedef structure to distinguish between forwards and real typedefs
-    * [THRIFT-2446] - There is no way to handle server stream errors
-    * [THRIFT-2455] - Allow client certificates to be used with THttpClient
-    * [THRIFT-2511] - Node.js needs the compact protocol
-    * [THRIFT-2493] - Node.js lib needs HTTP client
-    * [THRIFT-2502] - Optimize go implementations of binary and compact protocols for speed
-    * [THRIFT-2494] - Add enum toString helper function in c_glib
-    * [THRIFT-2471] - Make cpp.ref annotation language agnostic
-    * [THRIFT-2497] - server and client for test/go, also several fixes and improvements
-    * [THRIFT-2535] - TJSONProtocol when serialized yields TField ids rather than names
-    * [THRIFT-2220] - Add a new struct structv?
-    * [THRIFT-1352] - Thrift server
-    * [THRIFT-989] - Push boost m4 macros upstream
-    * [THRIFT-1349] - Remove unnecessary print outs
-    * [THRIFT-2496] - server and client for test/go, also several fixes and improvements
-    * [THRIFT-1114] - Maven publish shouldn't require passwords hardcoded in settings.xml
-    * [THRIFT-2043] - visual 2010 warnings - unreachable code
-    * [THRIFT-1683] - Implement alternatives to Javascript Client side Transport protocol, just as NPAPI and WebSocket.
-    * [THRIFT-1746] - provide a SPDX file
-    * [THRIFT-1772] - Serialization does not check types of embedded structures.
-    * [THRIFT-2387] - nodejs: external imports should be centralized in index.js
-    * [THRIFT-2037] - More general macro THRIFT_UNUSED_VARIABLE
-
-## New Feature
-    * [THRIFT-1012] - Transport for DataInput DataOutput interface
-    * [THRIFT-2256] - Using c++11/c++0x std library  replace boost library
-    * [THRIFT-2250] - JSON and MemoryBuffer for JavaME
-    * [THRIFT-2114] - Python Service Remote SSL Option
-    * [THRIFT-1719] - SASL client support for Python
-    * [THRIFT-1894] - Thrift multi-threaded async Java Server using Java 7 AsynchronousChannelGroup
-    * [THRIFT-1893] - HTTP/JSON server/client for node js
-    * [THRIFT-2347] - C# TLS Transport based on THRIFT-181
-    * [THRIFT-2377] - Allow addition of custom HTTP Headers to an HTTP Transport
-    * [THRIFT-2408] - Named Pipe Transport Option for C#
-    * [THRIFT-2572] - Add string/collection length limit checks (from C++) to java protocol readers
-    * [THRIFT-2469] - "java:fullcamel" option to automatically camel-case underscored attribute names
-    * [THRIFT-795] - Importing service functions (simulation multiple inheritance)
-    * [THRIFT-2164] - Add a Get/Post Http Server to Node along with examples
-    * [THRIFT-2255] - add Parent Class for generated Struct class
-
-## Question
-    * [THRIFT-2539] - Tsocket.cpp addrinfo ai_flags = AI_ADDRCONFIG
-    * [THRIFT-2440] - how to connect as3 to java by thrift ,
-    * [THRIFT-2379] - Memmory leaking while using multithreading in C++ server.
-    * [THRIFT-2277] - Thrift: installing fb303 error
-    * [THRIFT-2567] - Csharp slow ?
-    * [THRIFT-2573] - thrift 0.9.2 release
-
-## Sub-task
-    * [THRIFT-981] - cocoa: add version Info to the library
-    * [THRIFT-2132] - Go: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-2299] - TJsonProtocol implementation for Ruby does not allow for both possible slash (solidus) encodings
-    * [THRIFT-2298] - TJsonProtocol implementation for C# does not allow for both possible slash (solidus) encodings
-    * [THRIFT-2297] - TJsonProtocol implementation for Delphi does not allow for both possible slash (solidus) encodings
-    * [THRIFT-2271] - JavaScript: Support for Multiplexing Services
-    * [THRIFT-2251] - go test for compact protocol is not running
-    * [THRIFT-2195] - Delphi: Add event handlers for server and processing events
-    * [THRIFT-2176] - TSimpleJSONProtocol.ReadFieldBegin() does not return field type and ID
-    * [THRIFT-2175] - Wrong field type set for binary
-    * [THRIFT-2174] - Deserializing JSON fails in specific cases
-    * [THRIFT-2053] - NodeJS: Support for Multiplexing Services
-    * [THRIFT-1914] - Python: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-1810] - add ruby to test/test.sh
-    * [THRIFT-2310] - PHP: Client-side support for Multiplexing Services
-    * [THRIFT-2346] - C#: UTF-8 sent by PHP as JSON is not understood by TJsonProtocol
-    * [THRIFT-2345] - Delphi: UTF-8 sent by PHP as JSON is not understood by TJsonProtocol
-    * [THRIFT-2338] - First doctext wrongly interpreted as program doctext in some cases
-    * [THRIFT-2325] - SSL test certificates
-    * [THRIFT-2358] - C++: add compact protocol to cross language test suite
-    * [THRIFT-2425] - PHP: Server-side support for Multiplexing Services
-    * [THRIFT-2421] - Tree/Recursive struct support in thrift
-    * [THRIFT-2290] - Update Go tutorial to align with THRIFT-2232
-    * [THRIFT-2558] - CSharp compiler generator tries to concat ints with strings using +
-    * [THRIFT-2507] - Additional LUA TProtocolException error code needed?
-    * [THRIFT-2499] - Compiler: allow annotations without "= value"
-    * [THRIFT-2534] - Cross language test results should recorded to a status.md or status.html file automatically
-    * [THRIFT-66] - Java: Allow multiplexing multiple services over a single TCP connection
-    * [THRIFT-1681] - Add Lua Support
-    * [THRIFT-1727] - Ruby-1.9: data loss: "binary" fields are re-encoded
-    * [THRIFT-1726] - Ruby-1.9: "binary" fields are represented by string whose encoding is "UTF-8"
-    * [THRIFT-988] - perl: add version Info to the library via configure
-    * [THRIFT-334] - Compact Protocol for PHP
-    * [THRIFT-2444] - pull request 88: thrift: clean up enum value assignment
-
-## Task
-    * [THRIFT-2223] - Spam links on wiki
-    * [THRIFT-2566] - Please create a DOAP file for your TLP
-    * [THRIFT-2237] - Update archive to contain all versions
-    * [THRIFT-962] - Tutorial page on our website is really unhelpful
-
-## Test
-    * [THRIFT-2327] - nodejs: nodejs test suite should be bundled with the library
-    * [THRIFT-2445] - THRIFT-2384 (code generation for go maps with binary keys) should be tested
-    * [THRIFT-2501] - C# The test parameters from the TestServer and TestClient are different from the http://thrift.apache.org/test/
-
-## Wish
-    * [THRIFT-2190] - Add the JavaScript thrift.js lib to the Bower registry
-    * [THRIFT-2076] - boost::optional instead of __isset
-
-
-
-Thrift 0.9.1
---------------------------------------------------------------------------------
-## Bug
-    * [THRIFT-1440] - debian packaging: minor-ish policy problems
-    * [THRIFT-1402] - Generated Y_types.js does not require() X_types.js when an include in the IDL file was used
-    * [THRIFT-1551] - 2 thrift file define only struct (no service), one include another, the gen nodejs file didn't have "requires" at the top
-    * [THRIFT-1264] - TSocketClient is queried by run loop after deallocation in Cocoa
-    * [THRIFT-1600] - Thrift Go Compiler and Library out of date with Go 1 Release.
-    * [THRIFT-1603] - Thrift IDL allows for multiple exceptions, args or struct member names to be the same
-    * [THRIFT-1062] - Problems with python tutorials
-    * [THRIFT-864] - default value fails if identifier is a struct
-    * [THRIFT-930] - Ruby and Haskell bindings don't properly support DESTDIR (makes packaging painful)
-    * [THRIFT-820] - The readLength attribute of TBinaryProtocol is used as an instance variable and is decremented on each call of checkReadLength
-    * [THRIFT-1640] - None of the tutorials linked on the website contain content
-    * [THRIFT-1637] - NPM registry does not include version 0.8
-    * [THRIFT-1648] - NodeJS clients always receive 0 for 'double' values.
-    * [THRIFT-1660] - Python Thrift library can be installed with pip but not easy_install
-    * [THRIFT-1657] - Chrome browser sending OPTIONS method before POST in xmlHttpRequest
-    * [THRIFT-2118] - Certificate error handling still incorrect
-    * [THRIFT-2137] - Ruby test lib fails jenkins build #864
-    * [THRIFT-2136] - Vagrant build not compiling java, ruby, php, go libs due to missing dependencies
-    * [THRIFT-2135] - GO lib leaves behind test files that are auto generated
-    * [THRIFT-2134] - mingw-cross-compile script failing with strip errors
-    * [THRIFT-2133] - java TestTBinaryProtocol.java test failing
-    * [THRIFT-2126] - lib/cpp/src/thrift/concurrency/STD* files missing from DIST
-    * [THRIFT-2125] - debian missing from DIST
-    * [THRIFT-2124] - .o, .so, .la, .deps, .libs, gen-* files left tutorials, test and lib/cpp when making DIST
-    * [THRIFT-2123] - GO lib missing files in DIST build
-    * [THRIFT-2121] - Compilation bug for Node.js
-    * [THRIFT-2129] - php ext missing from dist
-    * [THRIFT-2128] - lib GO tests fail with funct ends without a return statement
-    * [THRIFT-2286] - Failed to compile Thrift0.9.1 with boost1.55 by VS2010 if select Debug-mt&x64 mode.
-    * [THRIFT-1973] - TCompactProtocol in C# lib does not serialize and deserialize negative int32 and int64 number correctly
-    * [THRIFT-1992] - casts in TCompactProtocol.tcc causing "dereferencing type-punned pointer will break strict-aliasing rules" warnings from gcc
-    * [THRIFT-1930] - C# generates unsigned byte for Thrift "byte" type
-    * [THRIFT-1929] - Update website to use Mirrors for downloads
-    * [THRIFT-1928] - Race may still exist in TFileTransport::flush()
-    * [THRIFT-1934] - Tabs in Example section on main page are not working
-    * [THRIFT-1933] - Delphi generator crashes when a typedef references another typedef from an included file
-    * [THRIFT-1942] - Binary accelerated cpp extension does not use Thrift namespaces for Exceptions
-    * [THRIFT-1959] - C#: Add Union TMemoryBuffer support
-    * [THRIFT-1958] - C#: Use static Object.Equals instead of .Equals() calls in equals
-    * [THRIFT-1957] - NodeJS TFramedTransport and TBufferedTransport read bytes as unsigned
-    * [THRIFT-1955] - Union Type writer generated in C# does not WriteStructBegin
-    * [THRIFT-1952] - Travis CI
-    * [THRIFT-1949] - WP7 build broken
-    * [THRIFT-1943] - docstrings for enum values are ignored
-    * [THRIFT-2070] - Improper `HexChar' and 'HexVal' implementation in TJSONProtocol.cs
-    * [THRIFT-2017] - Resource Leak in thrift struct under compiler/cpp/src/parse/t_program.h
-    * [THRIFT-2032] - C# client leaks sockets/handles
-    * [THRIFT-1996] - JavaME Constants generation is broken / inconsistent with regular Java generation
-    * [THRIFT-2002] - Haskell: Test use Data.Maybe instead of Maybe
-    * [THRIFT-2051] - Vagrant fails to build erlang
-    * [THRIFT-2050] - Vagrant C# lib compile fails with TException missing
-    * [THRIFT-1978] - Ruby: Thrift should allow for the SSL verify mode to be set
-    * [THRIFT-1984] - namespace collision in python bindings
-    * [THRIFT-1988] - When trying to build a debian package it fails as the file NEWS doesn't exist
-    * [THRIFT-1975] - TBinaryProtocol CheckLength can't be used for a client
-    * [THRIFT-1995] - '.' allowed at end of identifier generates non-compilable code
-    * [THRIFT-2112] - Error in Go generator when using typedefs in map keys
-    * [THRIFT-2088] - Typos in Thrift compiler help text
-    * [THRIFT-2080] - C# multiplex processor does not catch IOException
-    * [THRIFT-2082] - Executing "gmake clean" is broken
-    * [THRIFT-2102] - constants are not referencing to correct type when included from another thrift file
-    * [THRIFT-2100] - typedefs are not correctly referenced when including from other thrift files
-    * [THRIFT-2066] - 'make install' does not install two headers required for C++ bindings
-    * [THRIFT-2065] - Not valid constants filename in Java
-    * [THRIFT-2047] - Thrift.Protocol.TCompactProtocol, intToZigZag data lost (TCompactProtocol.cs)
-    * [THRIFT-2036] - Thrift gem warns about class variable access from top level
-    * [THRIFT-2057] - Vagrant fails on php tests
-    * [THRIFT-2105] - Generated code for default values of collections ignores t_field::T_REQUIRED
-    * [THRIFT-2091] - Unnecessary 'friend' declaration causes warning in TWinsockSingleton
-    * [THRIFT-2090] - Go generator, fix including of other thrift files
-    * [THRIFT-2106] - Fix support for namespaces in GO generator
-    * [THRIFT-1783] - C# doesn't handle required fields correctly
-    * [THRIFT-1782] - async only defined in silverlight
-    * [THRIFT-1779] - Missing process_XXXX method in generated TProcessor implementation for all 'oneway' service functions
-    * [THRIFT-1692] - SO_REUSEADDR allows for socket hijacking on Windows
-    * [THRIFT-1720] - JRuby times out on successful connection
-    * [THRIFT-1713] - Named and Anonymous Pipe transport (Delphi)
-    * [THRIFT-1699] - Native Union#read has extra read_field_end call
-    * [THRIFT-1749] - Python TSSLSocket error handling obscures actual error
-    * [THRIFT-1748] - Guard and RWGuard macros defined in global namespace
-    * [THRIFT-1734] - Front webpage is still advertising v0.8 as current release
-    * [THRIFT-1729] - C glib refactor left empty folders in svn
-    * [THRIFT-1767] - unions can't have required fields (Delphi)
-    * [THRIFT-1765] - Incorrect error message printed for null or negative keys
-    * [THRIFT-1778] - Configure requires manual intervention due to tar failure
-    * [THRIFT-1777] - TPipeServer is UNSTOPPABLE
-    * [THRIFT-1753] - Multiple C++ Windows, OSX, and iOS portability issues
-    * [THRIFT-1756] - 'make -j 8' fails with "unterminated #ifdef" error
-    * [THRIFT-1773] - Python library should run on python 2.4
-    * [THRIFT-1769] - unions can't have required fields (C++)
-    * [THRIFT-1768] - unions can't have required fields (Compiler)
-    * [THRIFT-1666] - htonll usage in TBinaryProtocol.tcc generates warning with MSVC2010
-    * [THRIFT-1919] - libthrift depends on httpcore-4.1.3 (directly) and httpcore-4.1.4 (transitively)
-    * [THRIFT-1864] - implement event handler for non-blocking server
-    * [THRIFT-1859] - Generated error c++ code with -out and include_prefix param
-    * [THRIFT-1869] - TThreadPoolServer (java) dies when threadpool is consumed
-    * [THRIFT-1842] - Memory leak with Pipes
-    * [THRIFT-1838] - Can't build compiler on OS X because of missing thrifty.h
-    * [THRIFT-1846] - Restore socket.h header to support builds with Android NDK
-    * [THRIFT-1850] - make check hangs on TSocket tests in TransportTest.cpp
-    * [THRIFT-1873] - Binary protocol factory ignores struct read/write flags
-    * [THRIFT-1872] - issues with TBufferedTransport buffer
-    * [THRIFT-1904] - Incorrect code is generated for typedefs which use included types
-    * [THRIFT-1903] - PHP namespaces cause binary protocols to not be used
-    * [THRIFT-1895] - Delphi: reserved variable name "result" not detected properly
-    * [THRIFT-1881] - TNonblockingServer does not release open connections or threads on shutdown
-    * [THRIFT-1888] - Java Thrift client can't connect to Python Thrift server on same host
-    * [THRIFT-1831] - Bug in list deserializer
-    * [THRIFT-1824] - many compile warning, becase Thread.h includes config.h
-    * [THRIFT-1823] - Missing parenthesis breaks "IS_..." macro in generated code
-    * [THRIFT-1806] - Python generation always truncates __init__.py files
-    * [THRIFT-1795] - Race condition in TThreadedServerPool java implementation
-    * [THRIFT-1794] - C# asyncctp broken
-    * [THRIFT-1804] - Binary+compact protocol single byte error in Ruby library (ARM architecture): caused by different char signedness
-    * [THRIFT-1800] - Documentation text not always escaped correctly when rendered to HTML
-    * [THRIFT-1788] - C#: Constants static constructor does not compile
-    * [THRIFT-1816] - Need "require" included thrift files in "xxx_types.js"
-    * [THRIFT-1907] - Compiling namespace and sub-namespace directives for unrecognized generators should only be a warning
-    * [THRIFT-1913] - skipping unknown fields in java unions
-    * [THRIFT-2553] - C++ linker error - transport/TSocket
-    * [THRIFT-274] - Towards a working release/versioning process
-
-## Documentation
-    * [THRIFT-1971] - [Graphviz] Adds tutorial/general description documentation
-    * [THRIFT-2001] - http://thrift.apache.org/ Example "C++ Server" tab is broken
-
-## Improvement
-    * [THRIFT-1574] - Apache project branding requirements: DOAP file [PATCH]
-    * [THRIFT-1347] - Unify the exceptions returned in generated Go code
-    * [THRIFT-1353] - Switch to performance branch, get rid of BinaryParser
-    * [THRIFT-1629] - Ruby 1.9 Compatibility during Thrift configure, make, install
-    * [THRIFT-991] - Refactor Haskell code and generator
-    * [THRIFT-990] - Sanify gettimeofday usage codebase-wide
-    * [THRIFT-791] - Let C++ TSimpleServer be driven by an external main loop
-    * [THRIFT-2117] - Cocoa TBinaryProtocol strictWrite should be set to true by default
-    * [THRIFT-2014] - Change C++ lib includes to use <namespace/> style throughout
-    * [THRIFT-1972] - Add support for async processors
-    * [THRIFT-1970] - [Graphviz] Adds option to render exceptions relationships
-    * [THRIFT-1966] - Support different files for SSL certificates and keys
-    * [THRIFT-1965] - Adds Graphviz (graph description language) generator
-    * [THRIFT-1956] - Switch to Apache Commons Lang 3
-    * [THRIFT-1962] - Multiplex processor should send any TApplicationException back to client
-    * [THRIFT-1960] - main() declares 22 unused gen bools
-    * [THRIFT-1951] - libthrift.jar has source files in it
-    * [THRIFT-1997] - Add accept backlog configuration method to  TServerSocket
-    * [THRIFT-2003] - Deprecate senum
-    * [THRIFT-2052] - Vagrant machine image defaults to only 384MB of RAM
-    * [THRIFT-1980] - Modernize Go tooling, fix go client libary.
-    * [THRIFT-1977] - C# compiler should generate constant files prefixed with thrift file name
-    * [THRIFT-1985] - add a Vagrantfile to build and test Apache Thrift fully reproducable
-    * [THRIFT-1994] - Deprecate slist
-    * [THRIFT-1993] - Factory to create instances from known (generated) interface types with Delphi
-    * [THRIFT-2081] - Specified timeout should be used in TSocket.Open()
-    * [THRIFT-2084] - Delphi: Ability to create entity Thrift-generated instances based on TypeInfo
-    * [THRIFT-2083] - Improve the go lib: buffered Transport, save memory allocation, handle concurrent request
-    * [THRIFT-2109] - Secure connections should be supported in Go
-    * [THRIFT-2107] - minor Go generator fixes
-    * [THRIFT-1695] - allow warning-free compilation in VS 2012 and GNU 4.6
-    * [THRIFT-1735] - integrate tutorial into regular build
-    * [THRIFT-1716] - max allowed connections should be PIPE_UNLIMITED_INSTANCES
-    * [THRIFT-1715] - Allow excluding python parts when building contrib/fb303
-    * [THRIFT-1733] - Fix RPM build issues on RHEL6/OL6 systems
-    * [THRIFT-1728] - Upgradation of httpcomponents
-    * [THRIFT-1876] - Use enum names instead of casted integers in assignments
-    * [THRIFT-1874] - timeout for the server-side end of a named pipe
-    * [THRIFT-1897] - Support validation of required fields
-    * [THRIFT-1896] - Add TBase protocol for Cocoa
-    * [THRIFT-1880] - Make named pipes server work asynchronously (overlapped) to allow for clean server stops
-    * [THRIFT-1878] - Add the possibility to send custom headers
-    * [THRIFT-1882] - Use single include
-    * [THRIFT-1793] - C#: Use static read instead of instance read
-    * [THRIFT-1799] - Option to generate HTML in "standalone mode"
-    * [THRIFT-1815] - Code generators line buffer output
-    * [THRIFT-1890] - C++: Make named pipes server work asynchronously
-    * [THRIFT-474] - Generating Ruby on Rails friendly code
-
-## New Feature
-    * [THRIFT-801] - Provide an interactive shell (irb) when generating ruby bindings
-    * [THRIFT-2292] - Android Library Project
-    * [THRIFT-2012] - Modernizing Go
-    * [THRIFT-1969] - C#: Tests not properly linked from the solution
-    * [THRIFT-1785] - C#: Add TMemoryBuffer serializer/deserializer
-    * [THRIFT-1780] - Add option to generate nullable values
-    * [THRIFT-1786] - C# Union Typing
-    * [THRIFT-591] - Make the C++ runtime library be compatible with Windows and Visual Studio
-    * [THRIFT-514] - Add option to configure compiler output directory
-
-## Question
-    * [THRIFT-1764] - how to get the context of client when on a rpc call in server side?
-    * [THRIFT-1791] - thrift's namespace directive when generating haskell code
-
-## Sub-task
-    * [THRIFT-1594] - Java test clients should have a return codes that reflect whether it succeeds or not.
-    * [THRIFT-1595] - Java test server should follow the documented behavior as of THRIFT-1590
-    * [THRIFT-986] - st: add version Info to the library
-    * [THRIFT-985] - php: add version Info to the library
-    * [THRIFT-984] - ocaml: add version Info to the library
-    * [THRIFT-1924] - Delphi: Inconsistency in serialization of optional fields
-    * [THRIFT-1922] - C#: Inconsistency in serialization of optional fields
-    * [THRIFT-1961] - C# tests should be in lib/csharp/test/...
-    * [THRIFT-1822] - PHP unit test does not work
-    * [THRIFT-1902] - C++: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-1901] - C#: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-1899] - Delphi: Support for Multiplexing Services on any Transport, Protocol and Server
-    * [THRIFT-563] - Support for Multiplexing Services on any Transport, Protocol and Server
-
-
-
-Thrift 0.9
---------------------------------------------------------------------------------
-## Bug
-    * [THRIFT-1438] - lib/cpp/src/windows/config.h should read version from configure.ac rather than a #define
-    * [THRIFT-1446] - Compile error with Delphi 2009 in constant initializer
-    * [THRIFT-1450] - Problems building thrift 0.8.0 for Python and Ruby
-    * [THRIFT-1449] - Ruby client does not work on solaris (?)
-    * [THRIFT-1447] - NullpointerException in ProcessFunction.class :in "oneway" method
-    * [THRIFT-1433] - TServerSocket fix for MSVC
-    * [THRIFT-1429] - The nonblocking servers is supposed to use TransportFactory to read the data
-    * [THRIFT-1427] - PHP library uses non-multibyte safe functions with mbstring function overloading
-    * [THRIFT-1421] - Debian Packages can not be built
-    * [THRIFT-1394] - Treatment of optional fields is not consistent between C++ and Java
-    * [THRIFT-1511] - Server with oneway support ( JAVA )
-    * [THRIFT-1496] - PHP compiler not namespacing enums
-    * [THRIFT-1495] - PHP TestClient fatals on missing class
-    * [THRIFT-1508] - TServerSocket does not allow for the user to specify the IP address to bind to
-    * [THRIFT-1504] - Cocoa Generator should use local file imports for base Thrift headers
-    * [THRIFT-1512] - Thrift socket support for Windows XP
-    * [THRIFT-1502] - TSimpleServer::serve(): Do not print out error message if server was stopped.
-    * [THRIFT-1501] - PHP old namespaces not generated for enums
-    * [THRIFT-1483] - java compiler does not generate type parameters for services in extended clauses
-    * [THRIFT-1479] - Compiled PHP process functions missing writeMessageEnd()
-    * [THRIFT-1492] - enabling c_glib render thrift unusable (even for C++ code)
-    * [THRIFT-1491] - Uninitialize processorFactory_ member in TServer.h
-    * [THRIFT-1475] - Incomplete records generation for Erlang
-    * [THRIFT-1486] - Javascript manual testserver not returning content types
-    * [THRIFT-1488] - src/concurrency/Thread.h:91:58: error: invalid conversion from 'pthread_t {aka _opaque_pthread_t*}' to 'apache::thrift::concurrency::Thread::id_t {aka long long unsigned int}' [-fpermissive]
-    * [THRIFT-1490] - Windows-specific header files - fixes & tweaks
-    * [THRIFT-1526] - Union TupleSchemeFactory returns StandardSchemes
-    * [THRIFT-1527] - Generated implementation of tupleReadStruct in unions return null when the setfield is unrecognized
-    * [THRIFT-1524] - TNonBlockingServer does not compile in Visual Studio 2010
-    * [THRIFT-1529] - TupleProtocol can unintentionally include an extra byte in bit vectors when number of optional fields is an integral of 8
-    * [THRIFT-1473] - JSON context stack may be left in an incorrect state when an exception is thrown during read or write operations
-    * [THRIFT-1456] - System.Net.HttpWebRequest' does not contain a definition for 'Proxy'
-    * [THRIFT-1468] - Memory leak in TSaslServerTransport
-    * [THRIFT-1461] - Recent TNonblockingServer changes broke --enable-boostthreads=yes, Windows
-    * [THRIFT-1460] - why not add unicode strings support to python directly?
-    * [THRIFT-1464] - AbstractNonblockingServer.FrameBuffer TNonblockingTransport accessor changed from public to private
-    * [THRIFT-1467] - Possible AV with empty strings when using JSON protocol
-    * [THRIFT-1523] - clientTimeout not worked as expected in TServerSocket created by TSSLTransportFactory
-    * [THRIFT-1537] - TFramedTransport issues
-    * [THRIFT-1519] - Thirft Build Failure referencing rb_intern2 symbol
-    * [THRIFT-1518] - Generated C++ code only sends the first optional field in the write() function for a struct.
-    * [THRIFT-1515] - NameError: global name 'TApplicationException' is not defined
-    * [THRIFT-1554] - Inherited service methods are not resolved in derived service implementations
-    * [THRIFT-1553] - thrift nodejs service side can't read map structure, key as enum, value as Object
-    * [THRIFT-1575] - Typo in server/TThreadPoolServer.h
-    * [THRIFT-1327] - Fix Spec Suite under Ruby-1.8.7 (works for MRI Ruby-1.9.2)
-    * [THRIFT-1326] - on some platforms, #include <stdint.h> is necessary to be included in Thrift.h
-    * [THRIFT-1159] - THttpClient->Flush() issue (connection thru proxy)
-    * [THRIFT-1277] - Node.js serializes false booleans as null
-    * [THRIFT-1224] - Cannot insert UTF-8 text
-    * [THRIFT-1267] - Node.js can't throw exceptions.
-    * [THRIFT-1338] - Do not use an unpatched autoconf 2.65 to generate release tarball
-    * [THRIFT-1128] - MAC OS X: thrift.h incompatibility with Thrift.h
-    * [THRIFT-1631] - Fix C++ server constructor typos
-    * [THRIFT-1602] - PHP C Extension is not Compatible with PHP 5.4
-    * [THRIFT-1610] - IWebProxy not available on WP7 platform
-    * [THRIFT-1606] - Race condition in BoostThreadFactory.cpp
-    * [THRIFT-1604] - Python exception handeling for changes from PEP 3110
-    * [THRIFT-1607] - Incorrect file modes for several source files
-    * [THRIFT-1583] - c_glib leaks memory
-    * [THRIFT-1582] - Bad includes of nested thrift files in c_glib
-    * [THRIFT-1578] - C_GLib generated code does not compile
-    * [THRIFT-1597] - TJSONProtocol.php is missing from Makefile.am
-    * [THRIFT-1591] - Enable TCP_NODELAY for ruby gem
-    * [THRIFT-1624] - Isset Generated differently on different platforms
-    * [THRIFT-1622] - Incorrect size returned on read
-    * [THRIFT-1621] - Memory leaks
-    * [THRIFT-1612] - Base64 encoding is broken
-    * [THRIFT-1627] - compiler built using compilers.vcxproj cannot be used to build some test .thrift files
-    * [THRIFT-1571] - Update Ruby HTTP transport for recent Ruby versions
-    * [THRIFT-1023] - Thrift encoding  (UTF-8) issue with Ruby 1.9.2
-    * [THRIFT-1090] - Document the generation of a file called "Constants.java"
-    * [THRIFT-1082] - Thrift::FramedTransport sometimes calls close() on an undefined value
-    * [THRIFT-956] - Python module's version meta-data should be updated
-    * [THRIFT-973] - Cocoa library won't compile using clang
-    * [THRIFT-1632] - ruby: data corruption in thrift_native implementation of MemoryBufferTransport
-    * [THRIFT-1665] - TBinaryProtocol: exceeded message length raises generic TException
-    * [THRIFT-1664] - Reference to non-existing variable in build script
-    * [THRIFT-1663] - Java Thrift server is not throwing exceptions
-    * [THRIFT-1662] - "removeObject:" should be "removeObserver:" in [-TSocketServer dealloc]?
-    * [THRIFT-1643] - Denial of Service attack in TBinaryProtocol.readString
-    * [THRIFT-1674] - Update Thrift D library to be compatible with 2.060
-    * [THRIFT-1673] - Ruby compile flags for extension for multi arch builds (os x)
-    * [THRIFT-1655] - Configure still trying to use thrift_generators in output
-    * [THRIFT-1654] - c_glib thrift_socket_read() returns corrupted data
-    * [THRIFT-1653] - TThreadedSelectorServer leaks CLOSE_WAIT sockets
-    * [THRIFT-1658] - Java thrift server is not throwing TApplicationException
-    * [THRIFT-1656] - Setting proper headers in THttpServer.cpp so that "Cross-Origin Resource Sharing" on js client can work.
-    * [THRIFT-1652] - TSaslTransport does not log the error when kerberos auth fails
-    * [THRIFT-2272] - CLONE - Denial of Service attack in TBinaryProtocol.readString
-    * [THRIFT-2086] - Invalid generated code for Node.JS when using namespaces
-    * [THRIFT-1686] - t_php_generator.cc uses "and" instead of "&&", and causes compiler errors with Visual Studio
-    * [THRIFT-1693] - libthrift has dependency on two different versions of httpcore
-    * [THRIFT-1689] - don't exit(-1) in TNonblockingServer
-    * [THRIFT-1679] - NodeJS: protocol readString() should treat string as utf8, not binary
-    * [THRIFT-1721] - Dist broken due to 0.8.0 to 0.9.0 changes
-    * [THRIFT-1710] - Minor issues in test case code
-    * [THRIFT-1709] - Warning "Bitwise-or operator used on a sign-extended operand; consider casting to a smaller unsigned type first" in TBinaryProtocol.cs at ReadInt64()
-    * [THRIFT-1707] - [ruby] Adjust server_spec.rb for RSpec 2.11.x and Ruby 1.9.3
-    * [THRIFT-1671] - Cocoa code generator does not put keywords into generated method calls
-    * [THRIFT-1670] - Incompatibilities between different versions of a Thrift interface
-    * [THRIFT-1669] - NameError: global name 'TApplicationException' is not defined
-    * [THRIFT-1668] - Compile error in contrib/fb303, thrift/TDispatchProcessor.h: No such file or directory
-    * [THRIFT-1845] - Fix compiler warning caused by implicit string conversion with Xcode 4.6
-    * [THRIFT-304] - Building the Python library requires development headers
-    * [THRIFT-369] - sets and maps break equality
-    * [THRIFT-556] - Ruby compiler does not correctly referred to top-level modules when a submodule masks the top-level name
-    * [THRIFT-481] - indentation of ruby classes is off by a few
-
-## Improvement
-    * [THRIFT-1498] - Allow TThreadedPoolServer.Args to pass a ExecutorService
-    * [THRIFT-1444] - FunctionRunner - add syntactic sugar to create shared_ptrs
-    * [THRIFT-1443] - define a TProcessor helper class to implement process()
-    * [THRIFT-1441] - Generate constructor with parameters for exception class to let it update message property automatically.
-    * [THRIFT-1520] - Embed version number in erlang .app file
-    * [THRIFT-1480] - python: remove tabs, adjust whitespace and address PEP8 warnings
-    * [THRIFT-1485] - Performance: pass large and/or refcounted arguments as "const"
-    * [THRIFT-1484] - Introduce phpunit test suite
-    * [THRIFT-1532] - The type specifications in the generated Erlang code should include "undefined" where it's used as a default value
-    * [THRIFT-1534] - Required fields in the Delphi code generator.
-    * [THRIFT-1469] - Java isset space optimization
-    * [THRIFT-1465] - Visibility of methods in generated java code
-    * [THRIFT-1453] - Don't change types of arguments when serializing with thrift php extension
-    * [THRIFT-1452] - generate a swap() method for all generated structs
-    * [THRIFT-1451] - FramedTransport: Prevent infinite loop when writing
-    * [THRIFT-1521] - Two patches for more Performance
-    * [THRIFT-1555] - Delphi version of the tutorial code
-    * [THRIFT-1535] - Why thrift don't use wrapped class for optional fields ?
-    * [THRIFT-1204] - Ruby autogenerated files should require 'thrift' gem
-    * [THRIFT-1344] - Using the httpc module directly rather than the deprecated http layer
-    * [THRIFT-1343] - no_auto_import min/2 to avoid compile warning
-    * [THRIFT-1340] - Add support of ARC to Objective-C
-    * [THRIFT-1611] - Improved code generation for typedefs
-    * [THRIFT-1593] - Pass on errors like "connection closed" to the handler module
-    * [THRIFT-1615] - PHP Namespace
-    * [THRIFT-1567] - Thrift/cpp: Allow alternate classes to be used for
-    * [THRIFT-1072] - Missing - (id) initWithSharedProcessor in TSharedProcessorFactory.h
-    * [THRIFT-1650] - [ruby] Update clean items and svn:ignore entries for OS X artifacts
-    * [THRIFT-1661] - [PATCH] Add --with-qt4 configure option
-    * [THRIFT-1675] - Do we have any plan to support scala?
-    * [THRIFT-1645] - Replace Object#tee with more conventional Object#tap in specs
-    * [THRIFT-1644] - Upgrade RSpec to 2.10.x and refactor specs as needed
-    * [THRIFT-1672] - MonoTouch (and Mono for Android) compatibility
-    * [THRIFT-1702] - a thrift manual
-    * [THRIFT-1694] - Re-Enable serialization for WP7 Silverlight
-    * [THRIFT-1691] - Serializer/deserializer support for Delphi
-    * [THRIFT-1688] - Update IDL page markup
-    * [THRIFT-1725] - Tutorial web pages for Delphi and C#
-    * [THRIFT-1714] - [ruby] Explicitly add CWD to Ruby test_suites.rb
-    * [THRIFT-317] - Issues with Java struct validation
-    * [THRIFT-164] - Build web tutorial on Incubator web site
-    * [THRIFT-541] - Cocoa code generator doesn't put keywords before all arguments.
-    * [THRIFT-681] - The HTM

<TRUNCATED>


[03/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.cpp
deleted file mode 100644
index d9921aa..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.cpp
+++ /dev/null
@@ -1,374 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/Thrift.h>
-#include <thrift/concurrency/Mutex.h>
-#include <thrift/concurrency/Util.h>
-
-#include <assert.h>
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
-#include <signal.h>
-
-using boost::shared_ptr;
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-
-static sig_atomic_t mutexProfilingSampleRate = 0;
-static MutexWaitCallback mutexProfilingCallback = 0;
-
-volatile static sig_atomic_t mutexProfilingCounter = 0;
-
-void enableMutexProfiling(int32_t profilingSampleRate, MutexWaitCallback callback) {
-  mutexProfilingSampleRate = profilingSampleRate;
-  mutexProfilingCallback = callback;
-}
-
-#define PROFILE_MUTEX_START_LOCK() int64_t _lock_startTime = maybeGetProfilingStartTime();
-
-#define PROFILE_MUTEX_NOT_LOCKED()                                                                 \
-  do {                                                                                             \
-    if (_lock_startTime > 0) {                                                                     \
-      int64_t endTime = Util::currentTimeUsec();                                                   \
-      (*mutexProfilingCallback)(this, endTime - _lock_startTime);                                  \
-    }                                                                                              \
-  } while (0)
-
-#define PROFILE_MUTEX_LOCKED()                                                                     \
-  do {                                                                                             \
-    profileTime_ = _lock_startTime;                                                                \
-    if (profileTime_ > 0) {                                                                        \
-      profileTime_ = Util::currentTimeUsec() - profileTime_;                                       \
-    }                                                                                              \
-  } while (0)
-
-#define PROFILE_MUTEX_START_UNLOCK()                                                               \
-  int64_t _temp_profileTime = profileTime_;                                                        \
-  profileTime_ = 0;
-
-#define PROFILE_MUTEX_UNLOCKED()                                                                   \
-  do {                                                                                             \
-    if (_temp_profileTime > 0) {                                                                   \
-      (*mutexProfilingCallback)(this, _temp_profileTime);                                          \
-    }                                                                                              \
-  } while (0)
-
-static inline int64_t maybeGetProfilingStartTime() {
-  if (mutexProfilingSampleRate && mutexProfilingCallback) {
-    // This block is unsynchronized, but should produce a reasonable sampling
-    // rate on most architectures.  The main race conditions are the gap
-    // between the decrement and the test, the non-atomicity of decrement, and
-    // potential caching of different values at different CPUs.
-    //
-    // - if two decrements race, the likeliest result is that the counter
-    //      decrements slowly (perhaps much more slowly) than intended.
-    //
-    // - many threads could potentially decrement before resetting the counter
-    //      to its large value, causing each additional incoming thread to
-    //      profile every call.  This situation is unlikely to persist for long
-    //      as the critical gap is quite short, but profiling could be bursty.
-    sig_atomic_t localValue = --mutexProfilingCounter;
-    if (localValue <= 0) {
-      mutexProfilingCounter = mutexProfilingSampleRate;
-      return Util::currentTimeUsec();
-    }
-  }
-
-  return 0;
-}
-
-#else
-#define PROFILE_MUTEX_START_LOCK()
-#define PROFILE_MUTEX_NOT_LOCKED()
-#define PROFILE_MUTEX_LOCKED()
-#define PROFILE_MUTEX_START_UNLOCK()
-#define PROFILE_MUTEX_UNLOCKED()
-#endif // THRIFT_NO_CONTENTION_PROFILING
-
-/**
- * Implementation of Mutex class using POSIX mutex
- *
- * @version $Id:$
- */
-class Mutex::impl {
-public:
-  impl(Initializer init) : initialized_(false) {
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-    profileTime_ = 0;
-#endif
-    init(&pthread_mutex_);
-    initialized_ = true;
-  }
-
-  ~impl() {
-    if (initialized_) {
-      initialized_ = false;
-      int ret = pthread_mutex_destroy(&pthread_mutex_);
-      THRIFT_UNUSED_VARIABLE(ret);
-      assert(ret == 0);
-    }
-  }
-
-  void lock() const {
-    PROFILE_MUTEX_START_LOCK();
-    pthread_mutex_lock(&pthread_mutex_);
-    PROFILE_MUTEX_LOCKED();
-  }
-
-  bool trylock() const { return (0 == pthread_mutex_trylock(&pthread_mutex_)); }
-
-  bool timedlock(int64_t milliseconds) const {
-#if defined(_POSIX_TIMEOUTS) && _POSIX_TIMEOUTS >= 200112L
-    PROFILE_MUTEX_START_LOCK();
-
-    struct THRIFT_TIMESPEC ts;
-    Util::toTimespec(ts, milliseconds + Util::currentTime());
-    int ret = pthread_mutex_timedlock(&pthread_mutex_, &ts);
-    if (ret == 0) {
-      PROFILE_MUTEX_LOCKED();
-      return true;
-    }
-
-    PROFILE_MUTEX_NOT_LOCKED();
-    return false;
-#else
-    /* Otherwise follow solution used by Mono for Android */
-    struct THRIFT_TIMESPEC sleepytime, now, to;
-
-    /* This is just to avoid a completely busy wait */
-    sleepytime.tv_sec = 0;
-    sleepytime.tv_nsec = 10000000L; /* 10ms */
-
-    Util::toTimespec(to, milliseconds + Util::currentTime());
-
-    while ((trylock()) == false) {
-      Util::toTimespec(now, Util::currentTime());
-      if (now.tv_sec >= to.tv_sec && now.tv_nsec >= to.tv_nsec) {
-        return false;
-      }
-      nanosleep(&sleepytime, NULL);
-    }
-
-    return true;
-#endif
-  }
-
-  void unlock() const {
-    PROFILE_MUTEX_START_UNLOCK();
-    pthread_mutex_unlock(&pthread_mutex_);
-    PROFILE_MUTEX_UNLOCKED();
-  }
-
-  void* getUnderlyingImpl() const { return (void*)&pthread_mutex_; }
-
-private:
-  mutable pthread_mutex_t pthread_mutex_;
-  mutable bool initialized_;
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-  mutable int64_t profileTime_;
-#endif
-};
-
-Mutex::Mutex(Initializer init) : impl_(new Mutex::impl(init)) {
-}
-
-void* Mutex::getUnderlyingImpl() const {
-  return impl_->getUnderlyingImpl();
-}
-
-void Mutex::lock() const {
-  impl_->lock();
-}
-
-bool Mutex::trylock() const {
-  return impl_->trylock();
-}
-
-bool Mutex::timedlock(int64_t ms) const {
-  return impl_->timedlock(ms);
-}
-
-void Mutex::unlock() const {
-  impl_->unlock();
-}
-
-void Mutex::DEFAULT_INITIALIZER(void* arg) {
-  pthread_mutex_t* pthread_mutex = (pthread_mutex_t*)arg;
-  int ret = pthread_mutex_init(pthread_mutex, NULL);
-  THRIFT_UNUSED_VARIABLE(ret);
-  assert(ret == 0);
-}
-
-#if defined(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP)                                                 \
-    || defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
-static void init_with_kind(pthread_mutex_t* mutex, int kind) {
-  pthread_mutexattr_t mutexattr;
-  int ret = pthread_mutexattr_init(&mutexattr);
-  assert(ret == 0);
-
-  // Apparently, this can fail.  Should we really be aborting?
-  ret = pthread_mutexattr_settype(&mutexattr, kind);
-  assert(ret == 0);
-
-  ret = pthread_mutex_init(mutex, &mutexattr);
-  assert(ret == 0);
-
-  ret = pthread_mutexattr_destroy(&mutexattr);
-  assert(ret == 0);
-  THRIFT_UNUSED_VARIABLE(ret);
-}
-#endif
-
-#ifdef PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP
-void Mutex::ADAPTIVE_INITIALIZER(void* arg) {
-  // From mysql source: mysys/my_thr_init.c
-  // Set mutex type to "fast" a.k.a "adaptive"
-  //
-  // In this case the thread may steal the mutex from some other thread
-  // that is waiting for the same mutex. This will save us some
-  // context switches but may cause a thread to 'starve forever' while
-  // waiting for the mutex (not likely if the code within the mutex is
-  // short).
-  init_with_kind((pthread_mutex_t*)arg, PTHREAD_MUTEX_ADAPTIVE_NP);
-}
-#endif
-
-#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-void Mutex::RECURSIVE_INITIALIZER(void* arg) {
-  init_with_kind((pthread_mutex_t*)arg, PTHREAD_MUTEX_RECURSIVE_NP);
-}
-#endif
-
-/**
- * Implementation of ReadWriteMutex class using POSIX rw lock
- *
- * @version $Id:$
- */
-class ReadWriteMutex::impl {
-public:
-  impl() : initialized_(false) {
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-    profileTime_ = 0;
-#endif
-    int ret = pthread_rwlock_init(&rw_lock_, NULL);
-    THRIFT_UNUSED_VARIABLE(ret);
-    assert(ret == 0);
-    initialized_ = true;
-  }
-
-  ~impl() {
-    if (initialized_) {
-      initialized_ = false;
-      int ret = pthread_rwlock_destroy(&rw_lock_);
-      THRIFT_UNUSED_VARIABLE(ret);
-      assert(ret == 0);
-    }
-  }
-
-  void acquireRead() const {
-    PROFILE_MUTEX_START_LOCK();
-    pthread_rwlock_rdlock(&rw_lock_);
-    PROFILE_MUTEX_NOT_LOCKED(); // not exclusive, so use not-locked path
-  }
-
-  void acquireWrite() const {
-    PROFILE_MUTEX_START_LOCK();
-    pthread_rwlock_wrlock(&rw_lock_);
-    PROFILE_MUTEX_LOCKED();
-  }
-
-  bool attemptRead() const { return !pthread_rwlock_tryrdlock(&rw_lock_); }
-
-  bool attemptWrite() const { return !pthread_rwlock_trywrlock(&rw_lock_); }
-
-  void release() const {
-    PROFILE_MUTEX_START_UNLOCK();
-    pthread_rwlock_unlock(&rw_lock_);
-    PROFILE_MUTEX_UNLOCKED();
-  }
-
-private:
-  mutable pthread_rwlock_t rw_lock_;
-  mutable bool initialized_;
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-  mutable int64_t profileTime_;
-#endif
-};
-
-ReadWriteMutex::ReadWriteMutex() : impl_(new ReadWriteMutex::impl()) {
-}
-
-void ReadWriteMutex::acquireRead() const {
-  impl_->acquireRead();
-}
-
-void ReadWriteMutex::acquireWrite() const {
-  impl_->acquireWrite();
-}
-
-bool ReadWriteMutex::attemptRead() const {
-  return impl_->attemptRead();
-}
-
-bool ReadWriteMutex::attemptWrite() const {
-  return impl_->attemptWrite();
-}
-
-void ReadWriteMutex::release() const {
-  impl_->release();
-}
-
-NoStarveReadWriteMutex::NoStarveReadWriteMutex() : writerWaiting_(false) {
-}
-
-void NoStarveReadWriteMutex::acquireRead() const {
-  if (writerWaiting_) {
-    // writer is waiting, block on the writer's mutex until he's done with it
-    mutex_.lock();
-    mutex_.unlock();
-  }
-
-  ReadWriteMutex::acquireRead();
-}
-
-void NoStarveReadWriteMutex::acquireWrite() const {
-  // if we can acquire the rwlock the easy way, we're done
-  if (attemptWrite()) {
-    return;
-  }
-
-  // failed to get the rwlock, do it the hard way:
-  // locking the mutex and setting writerWaiting will cause all new readers to
-  // block on the mutex rather than on the rwlock.
-  mutex_.lock();
-  writerWaiting_ = true;
-  ReadWriteMutex::acquireWrite();
-  writerWaiting_ = false;
-  mutex_.unlock();
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.h
deleted file mode 100644
index 6f892dc..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Mutex.h
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_MUTEX_H_
-#define _THRIFT_CONCURRENCY_MUTEX_H_ 1
-
-#include <boost/shared_ptr.hpp>
-#include <boost/noncopyable.hpp>
-#include <stdint.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-#ifndef THRIFT_NO_CONTENTION_PROFILING
-
-/**
- * Determines if the Thrift Mutex and ReadWriteMutex classes will attempt to
- * profile their blocking acquire methods. If this value is set to non-zero,
- * Thrift will attempt to invoke the callback once every profilingSampleRate
- * times.  However, as the sampling is not synchronized the rate is not
- * guranateed, and could be subject to big bursts and swings.  Please ensure
- * your sampling callback is as performant as your application requires.
- *
- * The callback will get called with the wait time taken to lock the mutex in
- * usec and a (void*) that uniquely identifies the Mutex (or ReadWriteMutex)
- * being locked.
- *
- * The enableMutexProfiling() function is unsynchronized; calling this function
- * while profiling is already enabled may result in race conditions.  On
- * architectures where a pointer assignment is atomic, this is safe but there
- * is no guarantee threads will agree on a single callback within any
- * particular time period.
- */
-typedef void (*MutexWaitCallback)(const void* id, int64_t waitTimeMicros);
-void enableMutexProfiling(int32_t profilingSampleRate, MutexWaitCallback callback);
-
-#endif
-
-/**
- * A simple mutex class
- *
- * @version $Id:$
- */
-class Mutex {
-public:
-  typedef void (*Initializer)(void*);
-
-  Mutex(Initializer init = DEFAULT_INITIALIZER);
-  virtual ~Mutex() {}
-  virtual void lock() const;
-  virtual bool trylock() const;
-  virtual bool timedlock(int64_t milliseconds) const;
-  virtual void unlock() const;
-
-  void* getUnderlyingImpl() const;
-
-  static void DEFAULT_INITIALIZER(void*);
-  static void ADAPTIVE_INITIALIZER(void*);
-  static void RECURSIVE_INITIALIZER(void*);
-
-private:
-  class impl;
-  boost::shared_ptr<impl> impl_;
-};
-
-class ReadWriteMutex {
-public:
-  ReadWriteMutex();
-  virtual ~ReadWriteMutex() {}
-
-  // these get the lock and block until it is done successfully
-  virtual void acquireRead() const;
-  virtual void acquireWrite() const;
-
-  // these attempt to get the lock, returning false immediately if they fail
-  virtual bool attemptRead() const;
-  virtual bool attemptWrite() const;
-
-  // this releases both read and write locks
-  virtual void release() const;
-
-private:
-  class impl;
-  boost::shared_ptr<impl> impl_;
-};
-
-/**
- * A ReadWriteMutex that guarantees writers will not be starved by readers:
- * When a writer attempts to acquire the mutex, all new readers will be
- * blocked from acquiring the mutex until the writer has acquired and
- * released it. In some operating systems, this may already be guaranteed
- * by a regular ReadWriteMutex.
- */
-class NoStarveReadWriteMutex : public ReadWriteMutex {
-public:
-  NoStarveReadWriteMutex();
-
-  virtual void acquireRead() const;
-  virtual void acquireWrite() const;
-
-private:
-  Mutex mutex_;
-  mutable volatile bool writerWaiting_;
-};
-
-class Guard : boost::noncopyable {
-public:
-  Guard(const Mutex& value, int64_t timeout = 0) : mutex_(&value) {
-    if (timeout == 0) {
-      value.lock();
-    } else if (timeout < 0) {
-      if (!value.trylock()) {
-        mutex_ = NULL;
-      }
-    } else {
-      if (!value.timedlock(timeout)) {
-        mutex_ = NULL;
-      }
-    }
-  }
-  ~Guard() {
-    if (mutex_) {
-      mutex_->unlock();
-    }
-  }
-
-  operator bool() const { return (mutex_ != NULL); }
-
-private:
-  const Mutex* mutex_;
-};
-
-// Can be used as second argument to RWGuard to make code more readable
-// as to whether we're doing acquireRead() or acquireWrite().
-enum RWGuardType { RW_READ = 0, RW_WRITE = 1 };
-
-class RWGuard : boost::noncopyable {
-public:
-  RWGuard(const ReadWriteMutex& value, bool write = false) : rw_mutex_(value) {
-    if (write) {
-      rw_mutex_.acquireWrite();
-    } else {
-      rw_mutex_.acquireRead();
-    }
-  }
-
-  RWGuard(const ReadWriteMutex& value, RWGuardType type) : rw_mutex_(value) {
-    if (type == RW_WRITE) {
-      rw_mutex_.acquireWrite();
-    } else {
-      rw_mutex_.acquireRead();
-    }
-  }
-  ~RWGuard() { rw_mutex_.release(); }
-
-private:
-  const ReadWriteMutex& rw_mutex_;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_MUTEX_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
deleted file mode 100644
index 545b572..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PlatformThreadFactory.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_PLATFORMTHREADFACTORY_H_
-#define _THRIFT_CONCURRENCY_PLATFORMTHREADFACTORY_H_ 1
-
-// clang-format off
-#include <thrift/thrift-config.h>
-#if USE_BOOST_THREAD
-#  include <thrift/concurrency/BoostThreadFactory.h>
-#elif USE_STD_THREAD
-#  include <thrift/concurrency/StdThreadFactory.h>
-#else
-#  include <thrift/concurrency/PosixThreadFactory.h>
-#endif
-// clang-format on
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-// clang-format off
-#if USE_BOOST_THREAD
-  typedef BoostThreadFactory PlatformThreadFactory;
-#elif USE_STD_THREAD
-  typedef StdThreadFactory PlatformThreadFactory;
-#else
-  typedef PosixThreadFactory PlatformThreadFactory;
-#endif
-// clang-format on
-
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_PLATFORMTHREADFACTORY_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
deleted file mode 100644
index 47c5034..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.cpp
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/PosixThreadFactory.h>
-#include <thrift/concurrency/Exception.h>
-
-#if GOOGLE_PERFTOOLS_REGISTER_THREAD
-#include <google/profiler.h>
-#endif
-
-#include <assert.h>
-#include <pthread.h>
-
-#include <iostream>
-
-#include <boost/weak_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-using boost::shared_ptr;
-using boost::weak_ptr;
-
-/**
- * The POSIX thread class.
- *
- * @version $Id:$
- */
-class PthreadThread : public Thread {
-public:
-  enum STATE { uninitialized, starting, started, stopping, stopped };
-
-  static const int MB = 1024 * 1024;
-
-  static void* threadMain(void* arg);
-
-private:
-  pthread_t pthread_;
-  STATE state_;
-  int policy_;
-  int priority_;
-  int stackSize_;
-  weak_ptr<PthreadThread> self_;
-  bool detached_;
-
-public:
-  PthreadThread(int policy,
-                int priority,
-                int stackSize,
-                bool detached,
-                shared_ptr<Runnable> runnable)
-    :
-
-#ifndef _WIN32
-      pthread_(0),
-#endif // _WIN32
-
-      state_(uninitialized),
-      policy_(policy),
-      priority_(priority),
-      stackSize_(stackSize),
-      detached_(detached) {
-
-    this->Thread::runnable(runnable);
-  }
-
-  ~PthreadThread() {
-    /* Nothing references this thread, if is is not detached, do a join
-       now, otherwise the thread-id and, possibly, other resources will
-       be leaked. */
-    if (!detached_) {
-      try {
-        join();
-      } catch (...) {
-        // We're really hosed.
-      }
-    }
-  }
-
-  void start() {
-    if (state_ != uninitialized) {
-      return;
-    }
-
-    pthread_attr_t thread_attr;
-    if (pthread_attr_init(&thread_attr) != 0) {
-      throw SystemResourceException("pthread_attr_init failed");
-    }
-
-    if (pthread_attr_setdetachstate(&thread_attr,
-                                    detached_ ? PTHREAD_CREATE_DETACHED : PTHREAD_CREATE_JOINABLE)
-        != 0) {
-      throw SystemResourceException("pthread_attr_setdetachstate failed");
-    }
-
-    // Set thread stack size
-    if (pthread_attr_setstacksize(&thread_attr, MB * stackSize_) != 0) {
-      throw SystemResourceException("pthread_attr_setstacksize failed");
-    }
-
-// Set thread policy
-#ifdef _WIN32
-    // WIN32 Pthread implementation doesn't seem to support sheduling policies other then
-    // PosixThreadFactory::OTHER - runtime error
-    policy_ = PosixThreadFactory::OTHER;
-#endif
-
-    if (pthread_attr_setschedpolicy(&thread_attr, policy_) != 0) {
-      throw SystemResourceException("pthread_attr_setschedpolicy failed");
-    }
-
-    struct sched_param sched_param;
-    sched_param.sched_priority = priority_;
-
-    // Set thread priority
-    if (pthread_attr_setschedparam(&thread_attr, &sched_param) != 0) {
-      throw SystemResourceException("pthread_attr_setschedparam failed");
-    }
-
-    // Create reference
-    shared_ptr<PthreadThread>* selfRef = new shared_ptr<PthreadThread>();
-    *selfRef = self_.lock();
-
-    state_ = starting;
-
-    if (pthread_create(&pthread_, &thread_attr, threadMain, (void*)selfRef) != 0) {
-      throw SystemResourceException("pthread_create failed");
-    }
-  }
-
-  void join() {
-    if (!detached_ && state_ != uninitialized) {
-      void* ignore;
-      /* XXX
-         If join fails it is most likely due to the fact
-         that the last reference was the thread itself and cannot
-         join.  This results in leaked threads and will eventually
-         cause the process to run out of thread resources.
-         We're beyond the point of throwing an exception.  Not clear how
-         best to handle this. */
-      int res = pthread_join(pthread_, &ignore);
-      detached_ = (res == 0);
-      if (res != 0) {
-        GlobalOutput.printf("PthreadThread::join(): fail with code %d", res);
-      }
-    } else {
-      GlobalOutput.printf("PthreadThread::join(): detached thread");
-    }
-  }
-
-  Thread::id_t getId() {
-
-#ifndef _WIN32
-    return (Thread::id_t)pthread_;
-#else
-    return (Thread::id_t)pthread_.p;
-#endif // _WIN32
-  }
-
-  shared_ptr<Runnable> runnable() const { return Thread::runnable(); }
-
-  void runnable(shared_ptr<Runnable> value) { Thread::runnable(value); }
-
-  void weakRef(shared_ptr<PthreadThread> self) {
-    assert(self.get() == this);
-    self_ = weak_ptr<PthreadThread>(self);
-  }
-};
-
-void* PthreadThread::threadMain(void* arg) {
-  shared_ptr<PthreadThread> thread = *(shared_ptr<PthreadThread>*)arg;
-  delete reinterpret_cast<shared_ptr<PthreadThread>*>(arg);
-
-  if (thread == NULL) {
-    return (void*)0;
-  }
-
-  if (thread->state_ != starting) {
-    return (void*)0;
-  }
-
-#if GOOGLE_PERFTOOLS_REGISTER_THREAD
-  ProfilerRegisterThread();
-#endif
-
-  thread->state_ = started;
-  thread->runnable()->run();
-  if (thread->state_ != stopping && thread->state_ != stopped) {
-    thread->state_ = stopping;
-  }
-
-  return (void*)0;
-}
-
-/**
- * POSIX Thread factory implementation
- */
-class PosixThreadFactory::Impl {
-
-private:
-  POLICY policy_;
-  PRIORITY priority_;
-  int stackSize_;
-  bool detached_;
-
-  /**
-   * Converts generic posix thread schedule policy enums into pthread
-   * API values.
-   */
-  static int toPthreadPolicy(POLICY policy) {
-    switch (policy) {
-    case OTHER:
-      return SCHED_OTHER;
-    case FIFO:
-      return SCHED_FIFO;
-    case ROUND_ROBIN:
-      return SCHED_RR;
-    }
-    return SCHED_OTHER;
-  }
-
-  /**
-   * Converts relative thread priorities to absolute value based on posix
-   * thread scheduler policy
-   *
-   *  The idea is simply to divide up the priority range for the given policy
-   * into the correpsonding relative priority level (lowest..highest) and
-   * then pro-rate accordingly.
-   */
-  static int toPthreadPriority(POLICY policy, PRIORITY priority) {
-    int pthread_policy = toPthreadPolicy(policy);
-    int min_priority = 0;
-    int max_priority = 0;
-#ifdef HAVE_SCHED_GET_PRIORITY_MIN
-    min_priority = sched_get_priority_min(pthread_policy);
-#endif
-#ifdef HAVE_SCHED_GET_PRIORITY_MAX
-    max_priority = sched_get_priority_max(pthread_policy);
-#endif
-    int quanta = (HIGHEST - LOWEST) + 1;
-    float stepsperquanta = (float)(max_priority - min_priority) / quanta;
-
-    if (priority <= HIGHEST) {
-      return (int)(min_priority + stepsperquanta * priority);
-    } else {
-      // should never get here for priority increments.
-      assert(false);
-      return (int)(min_priority + stepsperquanta * NORMAL);
-    }
-  }
-
-public:
-  Impl(POLICY policy, PRIORITY priority, int stackSize, bool detached)
-    : policy_(policy), priority_(priority), stackSize_(stackSize), detached_(detached) {}
-
-  /**
-   * Creates a new POSIX thread to run the runnable object
-   *
-   * @param runnable A runnable object
-   */
-  shared_ptr<Thread> newThread(shared_ptr<Runnable> runnable) const {
-    shared_ptr<PthreadThread> result
-        = shared_ptr<PthreadThread>(new PthreadThread(toPthreadPolicy(policy_),
-                                                      toPthreadPriority(policy_, priority_),
-                                                      stackSize_,
-                                                      detached_,
-                                                      runnable));
-    result->weakRef(result);
-    runnable->thread(result);
-    return result;
-  }
-
-  int getStackSize() const { return stackSize_; }
-
-  void setStackSize(int value) { stackSize_ = value; }
-
-  PRIORITY getPriority() const { return priority_; }
-
-  /**
-   * Sets priority.
-   *
-   *  XXX
-   *  Need to handle incremental priorities properly.
-   */
-  void setPriority(PRIORITY value) { priority_ = value; }
-
-  bool isDetached() const { return detached_; }
-
-  void setDetached(bool value) { detached_ = value; }
-
-  Thread::id_t getCurrentThreadId() const {
-
-#ifndef _WIN32
-    return (Thread::id_t)pthread_self();
-#else
-    return (Thread::id_t)pthread_self().p;
-#endif // _WIN32
-  }
-};
-
-PosixThreadFactory::PosixThreadFactory(POLICY policy,
-                                       PRIORITY priority,
-                                       int stackSize,
-                                       bool detached)
-  : impl_(new PosixThreadFactory::Impl(policy, priority, stackSize, detached)) {
-}
-
-shared_ptr<Thread> PosixThreadFactory::newThread(shared_ptr<Runnable> runnable) const {
-  return impl_->newThread(runnable);
-}
-
-int PosixThreadFactory::getStackSize() const {
-  return impl_->getStackSize();
-}
-
-void PosixThreadFactory::setStackSize(int value) {
-  impl_->setStackSize(value);
-}
-
-PosixThreadFactory::PRIORITY PosixThreadFactory::getPriority() const {
-  return impl_->getPriority();
-}
-
-void PosixThreadFactory::setPriority(PosixThreadFactory::PRIORITY value) {
-  impl_->setPriority(value);
-}
-
-bool PosixThreadFactory::isDetached() const {
-  return impl_->isDetached();
-}
-
-void PosixThreadFactory::setDetached(bool value) {
-  impl_->setDetached(value);
-}
-
-Thread::id_t PosixThreadFactory::getCurrentThreadId() const {
-  return impl_->getCurrentThreadId();
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
deleted file mode 100644
index b26d296..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/PosixThreadFactory.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_POSIXTHREADFACTORY_H_
-#define _THRIFT_CONCURRENCY_POSIXTHREADFACTORY_H_ 1
-
-#include <thrift/concurrency/Thread.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * A thread factory to create posix threads
- *
- * @version $Id:$
- */
-class PosixThreadFactory : public ThreadFactory {
-
-public:
-  /**
-   * POSIX Thread scheduler policies
-   */
-  enum POLICY { OTHER, FIFO, ROUND_ROBIN };
-
-  /**
-   * POSIX Thread scheduler relative priorities,
-   *
-   * Absolute priority is determined by scheduler policy and OS. This
-   * enumeration specifies relative priorities such that one can specify a
-   * priority within a giving scheduler policy without knowing the absolute
-   * value of the priority.
-   */
-  enum PRIORITY {
-    LOWEST = 0,
-    LOWER = 1,
-    LOW = 2,
-    NORMAL = 3,
-    HIGH = 4,
-    HIGHER = 5,
-    HIGHEST = 6,
-    INCREMENT = 7,
-    DECREMENT = 8
-  };
-
-  /**
-   * Posix thread (pthread) factory.  All threads created by a factory are reference-counted
-   * via boost::shared_ptr and boost::weak_ptr.  The factory guarantees that threads and
-   * the Runnable tasks they host will be properly cleaned up once the last strong reference
-   * to both is given up.
-   *
-   * Threads are created with the specified policy, priority, stack-size and detachable-mode
-   * detached means the thread is free-running and will release all system resources the
-   * when it completes.  A detachable thread is not joinable.  The join method
-   * of a detachable thread will return immediately with no error.
-   *
-   * By default threads are not joinable.
-   */
-
-  PosixThreadFactory(POLICY policy = ROUND_ROBIN,
-                     PRIORITY priority = NORMAL,
-                     int stackSize = 1,
-                     bool detached = true);
-
-  // From ThreadFactory;
-  boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const;
-
-  // From ThreadFactory;
-  Thread::id_t getCurrentThreadId() const;
-
-  /**
-   * Gets stack size for created threads
-   *
-   * @return int size in megabytes
-   */
-  virtual int getStackSize() const;
-
-  /**
-   * Sets stack size for created threads
-   *
-   * @param value size in megabytes
-   */
-  virtual void setStackSize(int value);
-
-  /**
-   * Gets priority relative to current policy
-   */
-  virtual PRIORITY getPriority() const;
-
-  /**
-   * Sets priority relative to current policy
-   */
-  virtual void setPriority(PRIORITY priority);
-
-  /**
-   * Sets detached mode of threads
-   */
-  virtual void setDetached(bool detached);
-
-  /**
-   * Gets current detached mode
-   */
-  virtual bool isDetached() const;
-
-private:
-  class Impl;
-  boost::shared_ptr<Impl> impl_;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_POSIXTHREADFACTORY_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMonitor.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMonitor.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMonitor.cpp
deleted file mode 100644
index 7b3b209..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMonitor.cpp
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/Monitor.h>
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Util.h>
-#include <thrift/transport/PlatformSocket.h>
-#include <assert.h>
-
-#include <condition_variable>
-#include <chrono>
-#include <thread>
-#include <mutex>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Monitor implementation using the std thread library
- *
- * @version $Id:$
- */
-class Monitor::Impl {
-
-public:
-  Impl() : ownedMutex_(new Mutex()), conditionVariable_(), mutex_(NULL) { init(ownedMutex_.get()); }
-
-  Impl(Mutex* mutex) : ownedMutex_(), conditionVariable_(), mutex_(NULL) { init(mutex); }
-
-  Impl(Monitor* monitor) : ownedMutex_(), conditionVariable_(), mutex_(NULL) {
-    init(&(monitor->mutex()));
-  }
-
-  Mutex& mutex() { return *mutex_; }
-  void lock() { mutex_->lock(); }
-  void unlock() { mutex_->unlock(); }
-
-  /**
-   * Exception-throwing version of waitForTimeRelative(), called simply
-   * wait(int64) for historical reasons.  Timeout is in milliseconds.
-   *
-   * If the condition occurs,  this function returns cleanly; on timeout or
-   * error an exception is thrown.
-   */
-  void wait(int64_t timeout_ms) {
-    int result = waitForTimeRelative(timeout_ms);
-    if (result == THRIFT_ETIMEDOUT) {
-      throw TimedOutException();
-    } else if (result != 0) {
-      throw TException("Monitor::wait() failed");
-    }
-  }
-
-  /**
-   * Waits until the specified timeout in milliseconds for the condition to
-   * occur, or waits forever if timeout_ms == 0.
-   *
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTimeRelative(int64_t timeout_ms) {
-    if (timeout_ms == 0LL) {
-      return waitForever();
-    }
-
-    assert(mutex_);
-    std::timed_mutex* mutexImpl = static_cast<std::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    std::unique_lock<std::timed_mutex> lock(*mutexImpl, std::adopt_lock);
-    bool timedout = (conditionVariable_.wait_for(lock, std::chrono::milliseconds(timeout_ms))
-                     == std::cv_status::timeout);
-    lock.release();
-    return (timedout ? THRIFT_ETIMEDOUT : 0);
-  }
-
-  /**
-   * Waits until the absolute time specified using struct THRIFT_TIMESPEC.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const THRIFT_TIMESPEC* abstime) {
-    struct timeval temp;
-    temp.tv_sec = static_cast<long>(abstime->tv_sec);
-    temp.tv_usec = static_cast<long>(abstime->tv_nsec) / 1000;
-    return waitForTime(&temp);
-  }
-
-  /**
-   * Waits until the absolute time specified using struct timeval.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const struct timeval* abstime) {
-    assert(mutex_);
-    std::timed_mutex* mutexImpl = static_cast<std::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    struct timeval currenttime;
-    Util::toTimeval(currenttime, Util::currentTime());
-
-    long tv_sec = static_cast<long>(abstime->tv_sec - currenttime.tv_sec);
-    long tv_usec = static_cast<long>(abstime->tv_usec - currenttime.tv_usec);
-    if (tv_sec < 0)
-      tv_sec = 0;
-    if (tv_usec < 0)
-      tv_usec = 0;
-
-    std::unique_lock<std::timed_mutex> lock(*mutexImpl, std::adopt_lock);
-    bool timedout = (conditionVariable_.wait_for(lock,
-                                                 std::chrono::seconds(tv_sec)
-                                                 + std::chrono::microseconds(tv_usec))
-                     == std::cv_status::timeout);
-    lock.release();
-    return (timedout ? THRIFT_ETIMEDOUT : 0);
-  }
-
-  /**
-   * Waits forever until the condition occurs.
-   * Returns 0 if condition occurs, or an error code otherwise.
-   */
-  int waitForever() {
-    assert(mutex_);
-    std::timed_mutex* mutexImpl = static_cast<std::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    std::unique_lock<std::timed_mutex> lock(*mutexImpl, std::adopt_lock);
-    conditionVariable_.wait(lock);
-    lock.release();
-    return 0;
-  }
-
-  void notify() { conditionVariable_.notify_one(); }
-
-  void notifyAll() { conditionVariable_.notify_all(); }
-
-private:
-  void init(Mutex* mutex) { mutex_ = mutex; }
-
-  const std::unique_ptr<Mutex> ownedMutex_;
-  std::condition_variable_any conditionVariable_;
-  Mutex* mutex_;
-};
-
-Monitor::Monitor() : impl_(new Monitor::Impl()) {
-}
-Monitor::Monitor(Mutex* mutex) : impl_(new Monitor::Impl(mutex)) {
-}
-Monitor::Monitor(Monitor* monitor) : impl_(new Monitor::Impl(monitor)) {
-}
-
-Monitor::~Monitor() {
-  delete impl_;
-}
-
-Mutex& Monitor::mutex() const {
-  return const_cast<Monitor::Impl*>(impl_)->mutex();
-}
-
-void Monitor::lock() const {
-  const_cast<Monitor::Impl*>(impl_)->lock();
-}
-
-void Monitor::unlock() const {
-  const_cast<Monitor::Impl*>(impl_)->unlock();
-}
-
-void Monitor::wait(int64_t timeout) const {
-  const_cast<Monitor::Impl*>(impl_)->wait(timeout);
-}
-
-int Monitor::waitForTime(const THRIFT_TIMESPEC* abstime) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTime(abstime);
-}
-
-int Monitor::waitForTime(const timeval* abstime) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTime(abstime);
-}
-
-int Monitor::waitForTimeRelative(int64_t timeout_ms) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTimeRelative(timeout_ms);
-}
-
-int Monitor::waitForever() const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForever();
-}
-
-void Monitor::notify() const {
-  const_cast<Monitor::Impl*>(impl_)->notify();
-}
-
-void Monitor::notifyAll() const {
-  const_cast<Monitor::Impl*>(impl_)->notifyAll();
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMutex.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMutex.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMutex.cpp
deleted file mode 100644
index 69678a2..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdMutex.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/Mutex.h>
-#include <thrift/concurrency/Util.h>
-
-#include <cassert>
-#include <chrono>
-#include <mutex>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Implementation of Mutex class using C++11 std::timed_mutex
- *
- * @version $Id:$
- */
-class Mutex::impl : public std::timed_mutex {};
-
-Mutex::Mutex(Initializer init) : impl_(new Mutex::impl()) {
-}
-
-void* Mutex::getUnderlyingImpl() const {
-  return impl_.get();
-}
-
-void Mutex::lock() const {
-  impl_->lock();
-}
-
-bool Mutex::trylock() const {
-  return impl_->try_lock();
-}
-
-bool Mutex::timedlock(int64_t ms) const {
-  return impl_->try_lock_for(std::chrono::milliseconds(ms));
-}
-
-void Mutex::unlock() const {
-  impl_->unlock();
-}
-
-void Mutex::DEFAULT_INITIALIZER(void* arg) {
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
deleted file mode 100644
index d57e7ec..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.cpp
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#if USE_STD_THREAD
-
-#include <thrift/concurrency/StdThreadFactory.h>
-#include <thrift/concurrency/Exception.h>
-
-#include <cassert>
-
-#include <boost/enable_shared_from_this.hpp>
-#include <boost/weak_ptr.hpp>
-#include <thread>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * The C++11 thread class.
- *
- * Note that we use boost shared_ptr rather than std shared_ptrs here
- * because the Thread/Runnable classes use those and we don't want to
- * mix them.
- *
- * @version $Id:$
- */
-class StdThread : public Thread, public boost::enable_shared_from_this<StdThread> {
-public:
-  enum STATE { uninitialized, starting, started, stopping, stopped };
-
-  static void threadMain(boost::shared_ptr<StdThread> thread);
-
-private:
-  std::unique_ptr<std::thread> thread_;
-  STATE state_;
-  bool detached_;
-
-public:
-  StdThread(bool detached, boost::shared_ptr<Runnable> runnable)
-    : state_(uninitialized), detached_(detached) {
-    this->Thread::runnable(runnable);
-  }
-
-  ~StdThread() {
-    if (!detached_) {
-      try {
-        join();
-      } catch (...) {
-        // We're really hosed.
-      }
-    }
-  }
-
-  void start() {
-    if (state_ != uninitialized) {
-      return;
-    }
-
-    boost::shared_ptr<StdThread> selfRef = shared_from_this();
-    state_ = starting;
-
-    thread_ = std::unique_ptr<std::thread>(new std::thread(threadMain, selfRef));
-
-    if (detached_)
-      thread_->detach();
-  }
-
-  void join() {
-    if (!detached_ && state_ != uninitialized) {
-      thread_->join();
-    }
-  }
-
-  Thread::id_t getId() { return thread_.get() ? thread_->get_id() : std::thread::id(); }
-
-  boost::shared_ptr<Runnable> runnable() const { return Thread::runnable(); }
-
-  void runnable(boost::shared_ptr<Runnable> value) { Thread::runnable(value); }
-};
-
-void StdThread::threadMain(boost::shared_ptr<StdThread> thread) {
-  if (thread == NULL) {
-    return;
-  }
-
-  if (thread->state_ != starting) {
-    return;
-  }
-
-  thread->state_ = started;
-  thread->runnable()->run();
-
-  if (thread->state_ != stopping && thread->state_ != stopped) {
-    thread->state_ = stopping;
-  }
-
-  return;
-}
-
-/**
- * std::thread factory implementation
- */
-class StdThreadFactory::Impl {
-
-private:
-  bool detached_;
-
-public:
-  Impl(bool detached) : detached_(detached) {}
-
-  /**
-   * Creates a new std::thread to run the runnable object
-   *
-   * @param runnable A runnable object
-   */
-  boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const {
-    boost::shared_ptr<StdThread> result
-        = boost::shared_ptr<StdThread>(new StdThread(detached_, runnable));
-    runnable->thread(result);
-    return result;
-  }
-
-  bool isDetached() const { return detached_; }
-
-  void setDetached(bool value) { detached_ = value; }
-
-  Thread::id_t getCurrentThreadId() const { return std::this_thread::get_id(); }
-};
-
-StdThreadFactory::StdThreadFactory(bool detached) : impl_(new StdThreadFactory::Impl(detached)) {
-}
-
-boost::shared_ptr<Thread> StdThreadFactory::newThread(boost::shared_ptr<Runnable> runnable) const {
-  return impl_->newThread(runnable);
-}
-
-bool StdThreadFactory::isDetached() const {
-  return impl_->isDetached();
-}
-
-void StdThreadFactory::setDetached(bool value) {
-  impl_->setDetached(value);
-}
-
-Thread::id_t StdThreadFactory::getCurrentThreadId() const {
-  return impl_->getCurrentThreadId();
-}
-}
-}
-} // apache::thrift::concurrency
-
-#endif // USE_STD_THREAD

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.h
deleted file mode 100644
index fb86bbf..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/StdThreadFactory.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_STDTHREADFACTORY_H_
-#define _THRIFT_CONCURRENCY_STDTHREADFACTORY_H_ 1
-
-#include <thrift/concurrency/Thread.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * A thread factory to create std::threads.
- *
- * @version $Id:$
- */
-class StdThreadFactory : public ThreadFactory {
-
-public:
-  /**
-   * Std thread factory.  All threads created by a factory are reference-counted
-   * via boost::shared_ptr and boost::weak_ptr.  The factory guarantees that threads and
-   * the Runnable tasks they host will be properly cleaned up once the last strong reference
-   * to both is given up.
-   *
-   * By default threads are not joinable.
-   */
-
-  StdThreadFactory(bool detached = true);
-
-  // From ThreadFactory;
-  boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const;
-
-  // From ThreadFactory;
-  Thread::id_t getCurrentThreadId() const;
-
-  /**
-   * Sets detached mode of threads
-   */
-  virtual void setDetached(bool detached);
-
-  /**
-   * Gets current detached mode
-   */
-  virtual bool isDetached() const;
-
-private:
-  class Impl;
-  boost::shared_ptr<Impl> impl_;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_STDTHREADFACTORY_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Thread.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Thread.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Thread.h
deleted file mode 100644
index f5eb3a8..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Thread.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_THREAD_H_
-#define _THRIFT_CONCURRENCY_THREAD_H_ 1
-
-#include <stdint.h>
-#include <boost/shared_ptr.hpp>
-#include <boost/weak_ptr.hpp>
-
-#include <thrift/thrift-config.h>
-
-#if USE_BOOST_THREAD
-#include <boost/thread.hpp>
-#elif USE_STD_THREAD
-#include <thread>
-#else
-#ifdef HAVE_PTHREAD_H
-#include <pthread.h>
-#endif
-#endif
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-class Thread;
-
-/**
- * Minimal runnable class.  More or less analogous to java.lang.Runnable.
- *
- * @version $Id:$
- */
-class Runnable {
-
-public:
-  virtual ~Runnable(){};
-  virtual void run() = 0;
-
-  /**
-   * Gets the thread object that is hosting this runnable object  - can return
-   * an empty boost::shared pointer if no references remain on that thread object
-   */
-  virtual boost::shared_ptr<Thread> thread() { return thread_.lock(); }
-
-  /**
-   * Sets the thread that is executing this object.  This is only meant for
-   * use by concrete implementations of Thread.
-   */
-  virtual void thread(boost::shared_ptr<Thread> value) { thread_ = value; }
-
-private:
-  boost::weak_ptr<Thread> thread_;
-};
-
-/**
- * Minimal thread class. Returned by thread factory bound to a Runnable object
- * and ready to start execution.  More or less analogous to java.lang.Thread
- * (minus all the thread group, priority, mode and other baggage, since that
- * is difficult to abstract across platforms and is left for platform-specific
- * ThreadFactory implemtations to deal with
- *
- * @see apache::thrift::concurrency::ThreadFactory)
- */
-class Thread {
-
-public:
-#if USE_BOOST_THREAD
-  typedef boost::thread::id id_t;
-
-  static inline bool is_current(id_t t) { return t == boost::this_thread::get_id(); }
-  static inline id_t get_current() { return boost::this_thread::get_id(); }
-#elif USE_STD_THREAD
-  typedef std::thread::id id_t;
-
-  static inline bool is_current(id_t t) { return t == std::this_thread::get_id(); }
-  static inline id_t get_current() { return std::this_thread::get_id(); }
-#else
-  typedef pthread_t id_t;
-
-  static inline bool is_current(id_t t) { return pthread_equal(pthread_self(), t); }
-  static inline id_t get_current() { return pthread_self(); }
-#endif
-
-  virtual ~Thread(){};
-
-  /**
-   * Starts the thread. Does platform specific thread creation and
-   * configuration then invokes the run method of the Runnable object bound
-   * to this thread.
-   */
-  virtual void start() = 0;
-
-  /**
-   * Join this thread. Current thread blocks until this target thread
-   * completes.
-   */
-  virtual void join() = 0;
-
-  /**
-   * Gets the thread's platform-specific ID
-   */
-  virtual id_t getId() = 0;
-
-  /**
-   * Gets the runnable object this thread is hosting
-   */
-  virtual boost::shared_ptr<Runnable> runnable() const { return _runnable; }
-
-protected:
-  virtual void runnable(boost::shared_ptr<Runnable> value) { _runnable = value; }
-
-private:
-  boost::shared_ptr<Runnable> _runnable;
-};
-
-/**
- * Factory to create platform-specific thread object and bind them to Runnable
- * object for execution
- */
-class ThreadFactory {
-
-public:
-  virtual ~ThreadFactory() {}
-  virtual boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const = 0;
-
-  /** Gets the current thread id or unknown_thread_id if the current thread is not a thrift thread
-   */
-
-  static const Thread::id_t unknown_thread_id;
-
-  virtual Thread::id_t getCurrentThreadId() const = 0;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_THREAD_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
deleted file mode 100644
index a2b44d4..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.cpp
+++ /dev/null
@@ -1,561 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/ThreadManager.h>
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Monitor.h>
-#include <thrift/concurrency/Util.h>
-
-#include <boost/shared_ptr.hpp>
-
-#include <assert.h>
-#include <queue>
-#include <set>
-
-#if defined(DEBUG)
-#include <iostream>
-#endif // defined(DEBUG)
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-using boost::shared_ptr;
-using boost::dynamic_pointer_cast;
-
-/**
- * ThreadManager class
- *
- * This class manages a pool of threads. It uses a ThreadFactory to create
- * threads.  It never actually creates or destroys worker threads, rather
- * it maintains statistics on number of idle threads, number of active threads,
- * task backlog, and average wait and service times.
- *
- * @version $Id:$
- */
-class ThreadManager::Impl : public ThreadManager {
-
-public:
-  Impl()
-    : workerCount_(0),
-      workerMaxCount_(0),
-      idleCount_(0),
-      pendingTaskCountMax_(0),
-      expiredCount_(0),
-      state_(ThreadManager::UNINITIALIZED),
-      monitor_(&mutex_),
-      maxMonitor_(&mutex_) {}
-
-  ~Impl() { stop(); }
-
-  void start();
-
-  void stop() { stopImpl(false); }
-
-  void join() { stopImpl(true); }
-
-  ThreadManager::STATE state() const { return state_; }
-
-  shared_ptr<ThreadFactory> threadFactory() const {
-    Synchronized s(monitor_);
-    return threadFactory_;
-  }
-
-  void threadFactory(shared_ptr<ThreadFactory> value) {
-    Synchronized s(monitor_);
-    threadFactory_ = value;
-  }
-
-  void addWorker(size_t value);
-
-  void removeWorker(size_t value);
-
-  size_t idleWorkerCount() const { return idleCount_; }
-
-  size_t workerCount() const {
-    Synchronized s(monitor_);
-    return workerCount_;
-  }
-
-  size_t pendingTaskCount() const {
-    Synchronized s(monitor_);
-    return tasks_.size();
-  }
-
-  size_t totalTaskCount() const {
-    Synchronized s(monitor_);
-    return tasks_.size() + workerCount_ - idleCount_;
-  }
-
-  size_t pendingTaskCountMax() const {
-    Synchronized s(monitor_);
-    return pendingTaskCountMax_;
-  }
-
-  size_t expiredTaskCount() {
-    Synchronized s(monitor_);
-    size_t result = expiredCount_;
-    expiredCount_ = 0;
-    return result;
-  }
-
-  void pendingTaskCountMax(const size_t value) {
-    Synchronized s(monitor_);
-    pendingTaskCountMax_ = value;
-  }
-
-  bool canSleep();
-
-  void add(shared_ptr<Runnable> value, int64_t timeout, int64_t expiration);
-
-  void remove(shared_ptr<Runnable> task);
-
-  shared_ptr<Runnable> removeNextPending();
-
-  void removeExpiredTasks();
-
-  void setExpireCallback(ExpireCallback expireCallback);
-
-private:
-  void stopImpl(bool join);
-
-  size_t workerCount_;
-  size_t workerMaxCount_;
-  size_t idleCount_;
-  size_t pendingTaskCountMax_;
-  size_t expiredCount_;
-  ExpireCallback expireCallback_;
-
-  ThreadManager::STATE state_;
-  shared_ptr<ThreadFactory> threadFactory_;
-
-  friend class ThreadManager::Task;
-  std::queue<shared_ptr<Task> > tasks_;
-  Mutex mutex_;
-  Monitor monitor_;
-  Monitor maxMonitor_;
-  Monitor workerMonitor_;
-
-  friend class ThreadManager::Worker;
-  std::set<shared_ptr<Thread> > workers_;
-  std::set<shared_ptr<Thread> > deadWorkers_;
-  std::map<const Thread::id_t, shared_ptr<Thread> > idMap_;
-};
-
-class ThreadManager::Task : public Runnable {
-
-public:
-  enum STATE { WAITING, EXECUTING, CANCELLED, COMPLETE };
-
-  Task(shared_ptr<Runnable> runnable, int64_t expiration = 0LL)
-    : runnable_(runnable),
-      state_(WAITING),
-      expireTime_(expiration != 0LL ? Util::currentTime() + expiration : 0LL) {}
-
-  ~Task() {}
-
-  void run() {
-    if (state_ == EXECUTING) {
-      runnable_->run();
-      state_ = COMPLETE;
-    }
-  }
-
-  shared_ptr<Runnable> getRunnable() { return runnable_; }
-
-  int64_t getExpireTime() const { return expireTime_; }
-
-private:
-  shared_ptr<Runnable> runnable_;
-  friend class ThreadManager::Worker;
-  STATE state_;
-  int64_t expireTime_;
-};
-
-class ThreadManager::Worker : public Runnable {
-  enum STATE { UNINITIALIZED, STARTING, STARTED, STOPPING, STOPPED };
-
-public:
-  Worker(ThreadManager::Impl* manager) : manager_(manager), state_(UNINITIALIZED), idle_(false) {}
-
-  ~Worker() {}
-
-private:
-  bool isActive() const {
-    return (manager_->workerCount_ <= manager_->workerMaxCount_)
-           || (manager_->state_ == JOINING && !manager_->tasks_.empty());
-  }
-
-public:
-  /**
-   * Worker entry point
-   *
-   * As long as worker thread is running, pull tasks off the task queue and
-   * execute.
-   */
-  void run() {
-    bool active = false;
-    bool notifyManager = false;
-
-    /**
-     * Increment worker semaphore and notify manager if worker count reached
-     * desired max
-     *
-     * Note: We have to release the monitor and acquire the workerMonitor
-     * since that is what the manager blocks on for worker add/remove
-     */
-    {
-      Synchronized s(manager_->monitor_);
-      active = manager_->workerCount_ < manager_->workerMaxCount_;
-      if (active) {
-        manager_->workerCount_++;
-        notifyManager = manager_->workerCount_ == manager_->workerMaxCount_;
-      }
-    }
-
-    if (notifyManager) {
-      Synchronized s(manager_->workerMonitor_);
-      manager_->workerMonitor_.notify();
-      notifyManager = false;
-    }
-
-    while (active) {
-      shared_ptr<ThreadManager::Task> task;
-
-      /**
-       * While holding manager monitor block for non-empty task queue (Also
-       * check that the thread hasn't been requested to stop). Once the queue
-       * is non-empty, dequeue a task, release monitor, and execute. If the
-       * worker max count has been decremented such that we exceed it, mark
-       * ourself inactive, decrement the worker count and notify the manager
-       * (technically we're notifying the next blocked thread but eventually
-       * the manager will see it.
-       */
-      {
-        Guard g(manager_->mutex_);
-        active = isActive();
-
-        while (active && manager_->tasks_.empty()) {
-          manager_->idleCount_++;
-          idle_ = true;
-          manager_->monitor_.wait();
-          active = isActive();
-          idle_ = false;
-          manager_->idleCount_--;
-        }
-
-        if (active) {
-          manager_->removeExpiredTasks();
-
-          if (!manager_->tasks_.empty()) {
-            task = manager_->tasks_.front();
-            manager_->tasks_.pop();
-            if (task->state_ == ThreadManager::Task::WAITING) {
-              task->state_ = ThreadManager::Task::EXECUTING;
-            }
-          }
-
-          /* If we have a pending task max and we just dropped below it, wakeup any
-             thread that might be blocked on add. */
-          if (manager_->pendingTaskCountMax_ != 0
-                  && manager_->tasks_.size() <= manager_->pendingTaskCountMax_ - 1) {
-              manager_->maxMonitor_.notify();
-          }
-        } else {
-          idle_ = true;
-          manager_->workerCount_--;
-          notifyManager = (manager_->workerCount_ == manager_->workerMaxCount_);
-        }
-      }
-
-      if (task) {
-        if (task->state_ == ThreadManager::Task::EXECUTING) {
-          try {
-            task->run();
-          } catch (const std::exception& e) {
-            GlobalOutput.printf("[ERROR] task->run() raised an exception: %s", e.what());
-          } catch (...) {
-            GlobalOutput.printf("[ERROR] task->run() raised an unknown exception");
-          }
-        }
-      }
-    }
-
-    {
-      Synchronized s(manager_->workerMonitor_);
-      manager_->deadWorkers_.insert(this->thread());
-      if (notifyManager) {
-        manager_->workerMonitor_.notify();
-      }
-    }
-
-    return;
-  }
-
-private:
-  ThreadManager::Impl* manager_;
-  friend class ThreadManager::Impl;
-  STATE state_;
-  bool idle_;
-};
-
-void ThreadManager::Impl::addWorker(size_t value) {
-  std::set<shared_ptr<Thread> > newThreads;
-  for (size_t ix = 0; ix < value; ix++) {
-    shared_ptr<ThreadManager::Worker> worker
-        = shared_ptr<ThreadManager::Worker>(new ThreadManager::Worker(this));
-    newThreads.insert(threadFactory_->newThread(worker));
-  }
-
-  {
-    Synchronized s(monitor_);
-    workerMaxCount_ += value;
-    workers_.insert(newThreads.begin(), newThreads.end());
-  }
-
-  for (std::set<shared_ptr<Thread> >::iterator ix = newThreads.begin(); ix != newThreads.end();
-       ++ix) {
-    shared_ptr<ThreadManager::Worker> worker
-        = dynamic_pointer_cast<ThreadManager::Worker, Runnable>((*ix)->runnable());
-    worker->state_ = ThreadManager::Worker::STARTING;
-    (*ix)->start();
-    idMap_.insert(std::pair<const Thread::id_t, shared_ptr<Thread> >((*ix)->getId(), *ix));
-  }
-
-  {
-    Synchronized s(workerMonitor_);
-    while (workerCount_ != workerMaxCount_) {
-      workerMonitor_.wait();
-    }
-  }
-}
-
-void ThreadManager::Impl::start() {
-
-  if (state_ == ThreadManager::STOPPED) {
-    return;
-  }
-
-  {
-    Synchronized s(monitor_);
-    if (state_ == ThreadManager::UNINITIALIZED) {
-      if (!threadFactory_) {
-        throw InvalidArgumentException();
-      }
-      state_ = ThreadManager::STARTED;
-      monitor_.notifyAll();
-    }
-
-    while (state_ == STARTING) {
-      monitor_.wait();
-    }
-  }
-}
-
-void ThreadManager::Impl::stopImpl(bool join) {
-  bool doStop = false;
-  if (state_ == ThreadManager::STOPPED) {
-    return;
-  }
-
-  {
-    Synchronized s(monitor_);
-    if (state_ != ThreadManager::STOPPING && state_ != ThreadManager::JOINING
-        && state_ != ThreadManager::STOPPED) {
-      doStop = true;
-      state_ = join ? ThreadManager::JOINING : ThreadManager::STOPPING;
-    }
-  }
-
-  if (doStop) {
-    removeWorker(workerCount_);
-  }
-
-  // XXX
-  // should be able to block here for transition to STOPPED since we're no
-  // using shared_ptrs
-
-  {
-    Synchronized s(monitor_);
-    state_ = ThreadManager::STOPPED;
-  }
-}
-
-void ThreadManager::Impl::removeWorker(size_t value) {
-  std::set<shared_ptr<Thread> > removedThreads;
-  {
-    Synchronized s(monitor_);
-    if (value > workerMaxCount_) {
-      throw InvalidArgumentException();
-    }
-
-    workerMaxCount_ -= value;
-
-    if (idleCount_ < value) {
-      for (size_t ix = 0; ix < idleCount_; ix++) {
-        monitor_.notify();
-      }
-    } else {
-      monitor_.notifyAll();
-    }
-  }
-
-  {
-    Synchronized s(workerMonitor_);
-
-    while (workerCount_ != workerMaxCount_) {
-      workerMonitor_.wait();
-    }
-
-    for (std::set<shared_ptr<Thread> >::iterator ix = deadWorkers_.begin();
-         ix != deadWorkers_.end();
-         ++ix) {
-      idMap_.erase((*ix)->getId());
-      workers_.erase(*ix);
-    }
-
-    deadWorkers_.clear();
-  }
-}
-
-bool ThreadManager::Impl::canSleep() {
-  const Thread::id_t id = threadFactory_->getCurrentThreadId();
-  return idMap_.find(id) == idMap_.end();
-}
-
-void ThreadManager::Impl::add(shared_ptr<Runnable> value, int64_t timeout, int64_t expiration) {
-  Guard g(mutex_, timeout);
-
-  if (!g) {
-    throw TimedOutException();
-  }
-
-  if (state_ != ThreadManager::STARTED) {
-    throw IllegalStateException(
-        "ThreadManager::Impl::add ThreadManager "
-        "not started");
-  }
-
-  removeExpiredTasks();
-  if (pendingTaskCountMax_ > 0 && (tasks_.size() >= pendingTaskCountMax_)) {
-    if (canSleep() && timeout >= 0) {
-      while (pendingTaskCountMax_ > 0 && tasks_.size() >= pendingTaskCountMax_) {
-        // This is thread safe because the mutex is shared between monitors.
-        maxMonitor_.wait(timeout);
-      }
-    } else {
-      throw TooManyPendingTasksException();
-    }
-  }
-
-  tasks_.push(shared_ptr<ThreadManager::Task>(new ThreadManager::Task(value, expiration)));
-
-  // If idle thread is available notify it, otherwise all worker threads are
-  // running and will get around to this task in time.
-  if (idleCount_ > 0) {
-    monitor_.notify();
-  }
-}
-
-void ThreadManager::Impl::remove(shared_ptr<Runnable> task) {
-  (void)task;
-  Synchronized s(monitor_);
-  if (state_ != ThreadManager::STARTED) {
-    throw IllegalStateException(
-        "ThreadManager::Impl::remove ThreadManager not "
-        "started");
-  }
-}
-
-boost::shared_ptr<Runnable> ThreadManager::Impl::removeNextPending() {
-  Guard g(mutex_);
-  if (state_ != ThreadManager::STARTED) {
-    throw IllegalStateException(
-        "ThreadManager::Impl::removeNextPending "
-        "ThreadManager not started");
-  }
-
-  if (tasks_.empty()) {
-    return boost::shared_ptr<Runnable>();
-  }
-
-  shared_ptr<ThreadManager::Task> task = tasks_.front();
-  tasks_.pop();
-
-  return task->getRunnable();
-}
-
-void ThreadManager::Impl::removeExpiredTasks() {
-  int64_t now = 0LL; // we won't ask for the time untile we need it
-
-  // note that this loop breaks at the first non-expiring task
-  while (!tasks_.empty()) {
-    shared_ptr<ThreadManager::Task> task = tasks_.front();
-    if (task->getExpireTime() == 0LL) {
-      break;
-    }
-    if (now == 0LL) {
-      now = Util::currentTime();
-    }
-    if (task->getExpireTime() > now) {
-      break;
-    }
-    if (expireCallback_) {
-      expireCallback_(task->getRunnable());
-    }
-    tasks_.pop();
-    expiredCount_++;
-  }
-}
-
-void ThreadManager::Impl::setExpireCallback(ExpireCallback expireCallback) {
-  expireCallback_ = expireCallback;
-}
-
-class SimpleThreadManager : public ThreadManager::Impl {
-
-public:
-  SimpleThreadManager(size_t workerCount = 4, size_t pendingTaskCountMax = 0)
-    : workerCount_(workerCount), pendingTaskCountMax_(pendingTaskCountMax) {}
-
-  void start() {
-    ThreadManager::Impl::pendingTaskCountMax(pendingTaskCountMax_);
-    ThreadManager::Impl::start();
-    addWorker(workerCount_);
-  }
-
-private:
-  const size_t workerCount_;
-  const size_t pendingTaskCountMax_;
-  Monitor monitor_;
-};
-
-shared_ptr<ThreadManager> ThreadManager::newThreadManager() {
-  return shared_ptr<ThreadManager>(new ThreadManager::Impl());
-}
-
-shared_ptr<ThreadManager> ThreadManager::newSimpleThreadManager(size_t count,
-                                                                size_t pendingTaskCountMax) {
-  return shared_ptr<ThreadManager>(new SimpleThreadManager(count, pendingTaskCountMax));
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.h
deleted file mode 100644
index 2112845..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/ThreadManager.h
+++ /dev/null
@@ -1,198 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_THREADMANAGER_H_
-#define _THRIFT_CONCURRENCY_THREADMANAGER_H_ 1
-
-#include <boost/shared_ptr.hpp>
-#include <thrift/cxxfunctional.h>
-#include <sys/types.h>
-#include <thrift/concurrency/Thread.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Thread Pool Manager and related classes
- *
- * @version $Id:$
- */
-class ThreadManager;
-
-/**
- * ThreadManager class
- *
- * This class manages a pool of threads. It uses a ThreadFactory to create
- * threads. It never actually creates or destroys worker threads, rather
- * it maintains statistics on number of idle threads, number of active threads,
- * task backlog, and average wait and service times and informs the PoolPolicy
- * object bound to instances of this manager of interesting transitions. It is
- * then up the PoolPolicy object to decide if the thread pool size needs to be
- * adjusted and call this object addWorker and removeWorker methods to make
- * changes.
- *
- * This design allows different policy implementations to use this code to
- * handle basic worker thread management and worker task execution and focus on
- * policy issues. The simplest policy, StaticPolicy, does nothing other than
- * create a fixed number of threads.
- */
-class ThreadManager {
-
-protected:
-  ThreadManager() {}
-
-public:
-  typedef apache::thrift::stdcxx::function<void(boost::shared_ptr<Runnable>)> ExpireCallback;
-
-  virtual ~ThreadManager() {}
-
-  /**
-   * Starts the thread manager. Verifies all attributes have been properly
-   * initialized, then allocates necessary resources to begin operation
-   */
-  virtual void start() = 0;
-
-  /**
-   * Stops the thread manager. Aborts all remaining unprocessed task, shuts
-   * down all created worker threads, and realeases all allocated resources.
-   * This method blocks for all worker threads to complete, thus it can
-   * potentially block forever if a worker thread is running a task that
-   * won't terminate.
-   */
-  virtual void stop() = 0;
-
-  /**
-   * Joins the thread manager. This is the same as stop, except that it will
-   * block until all the workers have finished their work. At that point
-   * the ThreadManager will transition into the STOPPED state.
-   */
-  virtual void join() = 0;
-
-  enum STATE { UNINITIALIZED, STARTING, STARTED, JOINING, STOPPING, STOPPED };
-
-  virtual STATE state() const = 0;
-
-  virtual boost::shared_ptr<ThreadFactory> threadFactory() const = 0;
-
-  virtual void threadFactory(boost::shared_ptr<ThreadFactory> value) = 0;
-
-  virtual void addWorker(size_t value = 1) = 0;
-
-  virtual void removeWorker(size_t value = 1) = 0;
-
-  /**
-   * Gets the current number of idle worker threads
-   */
-  virtual size_t idleWorkerCount() const = 0;
-
-  /**
-   * Gets the current number of total worker threads
-   */
-  virtual size_t workerCount() const = 0;
-
-  /**
-   * Gets the current number of pending tasks
-   */
-  virtual size_t pendingTaskCount() const = 0;
-
-  /**
-   * Gets the current number of pending and executing tasks
-   */
-  virtual size_t totalTaskCount() const = 0;
-
-  /**
-   * Gets the maximum pending task count.  0 indicates no maximum
-   */
-  virtual size_t pendingTaskCountMax() const = 0;
-
-  /**
-   * Gets the number of tasks which have been expired without being run.
-   */
-  virtual size_t expiredTaskCount() = 0;
-
-  /**
-   * Adds a task to be executed at some time in the future by a worker thread.
-   *
-   * This method will block if pendingTaskCountMax() in not zero and pendingTaskCount()
-   * is greater than or equalt to pendingTaskCountMax().  If this method is called in the
-   * context of a ThreadManager worker thread it will throw a
-   * TooManyPendingTasksException
-   *
-   * @param task  The task to queue for execution
-   *
-   * @param timeout Time to wait in milliseconds to add a task when a pending-task-count
-   * is specified. Specific cases:
-   * timeout = 0  : Wait forever to queue task.
-   * timeout = -1 : Return immediately if pending task count exceeds specified max
-   * @param expiration when nonzero, the number of milliseconds the task is valid
-   * to be run; if exceeded, the task will be dropped off the queue and not run.
-   *
-   * @throws TooManyPendingTasksException Pending task count exceeds max pending task count
-   */
-  virtual void add(boost::shared_ptr<Runnable> task,
-                   int64_t timeout = 0LL,
-                   int64_t expiration = 0LL) = 0;
-
-  /**
-   * Removes a pending task
-   */
-  virtual void remove(boost::shared_ptr<Runnable> task) = 0;
-
-  /**
-   * Remove the next pending task which would be run.
-   *
-   * @return the task removed.
-   */
-  virtual boost::shared_ptr<Runnable> removeNextPending() = 0;
-
-  /**
-   * Remove tasks from front of task queue that have expired.
-   */
-  virtual void removeExpiredTasks() = 0;
-
-  /**
-   * Set a callback to be called when a task is expired and not run.
-   *
-   * @param expireCallback a function called with the shared_ptr<Runnable> for
-   * the expired task.
-   */
-  virtual void setExpireCallback(ExpireCallback expireCallback) = 0;
-
-  static boost::shared_ptr<ThreadManager> newThreadManager();
-
-  /**
-   * Creates a simple thread manager the uses count number of worker threads and has
-   * a pendingTaskCountMax maximum pending tasks. The default, 0, specified no limit
-   * on pending tasks
-   */
-  static boost::shared_ptr<ThreadManager> newSimpleThreadManager(size_t count = 4,
-                                                                 size_t pendingTaskCountMax = 0);
-
-  class Task;
-
-  class Worker;
-
-  class Impl;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_THREADMANAGER_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.cpp
deleted file mode 100644
index 122d26e..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/concurrency/TimerManager.h>
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Util.h>
-
-#include <assert.h>
-#include <iostream>
-#include <set>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-using boost::shared_ptr;
-
-/**
- * TimerManager class
- *
- * @version $Id:$
- */
-class TimerManager::Task : public Runnable {
-
-public:
-  enum STATE { WAITING, EXECUTING, CANCELLED, COMPLETE };
-
-  Task(shared_ptr<Runnable> runnable) : runnable_(runnable), state_(WAITING) {}
-
-  ~Task() {}
-
-  void run() {
-    if (state_ == EXECUTING) {
-      runnable_->run();
-      state_ = COMPLETE;
-    }
-  }
-
-private:
-  shared_ptr<Runnable> runnable_;
-  friend class TimerManager::Dispatcher;
-  STATE state_;
-};
-
-class TimerManager::Dispatcher : public Runnable {
-
-public:
-  Dispatcher(TimerManager* manager) : manager_(manager) {}
-
-  ~Dispatcher() {}
-
-  /**
-   * Dispatcher entry point
-   *
-   * As long as dispatcher thread is running, pull tasks off the task taskMap_
-   * and execute.
-   */
-  void run() {
-    {
-      Synchronized s(manager_->monitor_);
-      if (manager_->state_ == TimerManager::STARTING) {
-        manager_->state_ = TimerManager::STARTED;
-        manager_->monitor_.notifyAll();
-      }
-    }
-
-    do {
-      std::set<shared_ptr<TimerManager::Task> > expiredTasks;
-      {
-        Synchronized s(manager_->monitor_);
-        task_iterator expiredTaskEnd;
-        int64_t now = Util::currentTime();
-        while (manager_->state_ == TimerManager::STARTED
-               && (expiredTaskEnd = manager_->taskMap_.upper_bound(now))
-                  == manager_->taskMap_.begin()) {
-          int64_t timeout = 0LL;
-          if (!manager_->taskMap_.empty()) {
-            timeout = manager_->taskMap_.begin()->first - now;
-          }
-          assert((timeout != 0 && manager_->taskCount_ > 0)
-                 || (timeout == 0 && manager_->taskCount_ == 0));
-          try {
-            manager_->monitor_.wait(timeout);
-          } catch (TimedOutException&) {
-          }
-          now = Util::currentTime();
-        }
-
-        if (manager_->state_ == TimerManager::STARTED) {
-          for (task_iterator ix = manager_->taskMap_.begin(); ix != expiredTaskEnd; ix++) {
-            shared_ptr<TimerManager::Task> task = ix->second;
-            expiredTasks.insert(task);
-            if (task->state_ == TimerManager::Task::WAITING) {
-              task->state_ = TimerManager::Task::EXECUTING;
-            }
-            manager_->taskCount_--;
-          }
-          manager_->taskMap_.erase(manager_->taskMap_.begin(), expiredTaskEnd);
-        }
-      }
-
-      for (std::set<shared_ptr<Task> >::iterator ix = expiredTasks.begin();
-           ix != expiredTasks.end();
-           ++ix) {
-        (*ix)->run();
-      }
-
-    } while (manager_->state_ == TimerManager::STARTED);
-
-    {
-      Synchronized s(manager_->monitor_);
-      if (manager_->state_ == TimerManager::STOPPING) {
-        manager_->state_ = TimerManager::STOPPED;
-        manager_->monitor_.notify();
-      }
-    }
-    return;
-  }
-
-private:
-  TimerManager* manager_;
-  friend class TimerManager;
-};
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable : 4355) // 'this' used in base member initializer list
-#endif
-
-TimerManager::TimerManager()
-  : taskCount_(0),
-    state_(TimerManager::UNINITIALIZED),
-    dispatcher_(shared_ptr<Dispatcher>(new Dispatcher(this))) {
-}
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-TimerManager::~TimerManager() {
-
-  // If we haven't been explicitly stopped, do so now.  We don't need to grab
-  // the monitor here, since stop already takes care of reentrancy.
-
-  if (state_ != STOPPED) {
-    try {
-      stop();
-    } catch (...) {
-      throw;
-      // uhoh
-    }
-  }
-}
-
-void TimerManager::start() {
-  bool doStart = false;
-  {
-    Synchronized s(monitor_);
-    if (!threadFactory_) {
-      throw InvalidArgumentException();
-    }
-    if (state_ == TimerManager::UNINITIALIZED) {
-      state_ = TimerManager::STARTING;
-      doStart = true;
-    }
-  }
-
-  if (doStart) {
-    dispatcherThread_ = threadFactory_->newThread(dispatcher_);
-    dispatcherThread_->start();
-  }
-
-  {
-    Synchronized s(monitor_);
-    while (state_ == TimerManager::STARTING) {
-      monitor_.wait();
-    }
-    assert(state_ != TimerManager::STARTING);
-  }
-}
-
-void TimerManager::stop() {
-  bool doStop = false;
-  {
-    Synchronized s(monitor_);
-    if (state_ == TimerManager::UNINITIALIZED) {
-      state_ = TimerManager::STOPPED;
-    } else if (state_ != STOPPING && state_ != STOPPED) {
-      doStop = true;
-      state_ = STOPPING;
-      monitor_.notifyAll();
-    }
-    while (state_ != STOPPED) {
-      monitor_.wait();
-    }
-  }
-
-  if (doStop) {
-    // Clean up any outstanding tasks
-    taskMap_.clear();
-
-    // Remove dispatcher's reference to us.
-    dispatcher_->manager_ = NULL;
-  }
-}
-
-shared_ptr<const ThreadFactory> TimerManager::threadFactory() const {
-  Synchronized s(monitor_);
-  return threadFactory_;
-}
-
-void TimerManager::threadFactory(shared_ptr<const ThreadFactory> value) {
-  Synchronized s(monitor_);
-  threadFactory_ = value;
-}
-
-size_t TimerManager::taskCount() const {
-  return taskCount_;
-}
-
-void TimerManager::add(shared_ptr<Runnable> task, int64_t timeout) {
-  int64_t now = Util::currentTime();
-  timeout += now;
-
-  {
-    Synchronized s(monitor_);
-    if (state_ != TimerManager::STARTED) {
-      throw IllegalStateException();
-    }
-
-    // If the task map is empty, we will kick the dispatcher for sure. Otherwise, we kick him
-    // if the expiration time is shorter than the current value. Need to test before we insert,
-    // because the new task might insert at the front.
-    bool notifyRequired = (taskCount_ == 0) ? true : timeout < taskMap_.begin()->first;
-
-    taskCount_++;
-    taskMap_.insert(
-        std::pair<int64_t, shared_ptr<Task> >(timeout, shared_ptr<Task>(new Task(task))));
-
-    // If the task map was empty, or if we have an expiration that is earlier
-    // than any previously seen, kick the dispatcher so it can update its
-    // timeout
-    if (notifyRequired) {
-      monitor_.notify();
-    }
-  }
-}
-
-void TimerManager::add(shared_ptr<Runnable> task, const struct THRIFT_TIMESPEC& value) {
-
-  int64_t expiration;
-  Util::toMilliseconds(expiration, value);
-
-  int64_t now = Util::currentTime();
-
-  if (expiration < now) {
-    throw InvalidArgumentException();
-  }
-
-  add(task, expiration - now);
-}
-
-void TimerManager::add(shared_ptr<Runnable> task, const struct timeval& value) {
-
-  int64_t expiration;
-  Util::toMilliseconds(expiration, value);
-
-  int64_t now = Util::currentTime();
-
-  if (expiration < now) {
-    throw InvalidArgumentException();
-  }
-
-  add(task, expiration - now);
-}
-
-void TimerManager::remove(shared_ptr<Runnable> task) {
-  (void)task;
-  Synchronized s(monitor_);
-  if (state_ != TimerManager::STARTED) {
-    throw IllegalStateException();
-  }
-}
-
-TimerManager::STATE TimerManager::state() const {
-  return state_;
-}
-}
-}
-} // apache::thrift::concurrency



[17/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj b/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj
deleted file mode 100644
index 779c339..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj
+++ /dev/null
@@ -1,105 +0,0 @@
-?<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{85FBFB54-530B-498F-9F38-44BA204FAE6A}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>client</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../;../../../lib/cpp/src;../../../../boost;../../../../boost/boost/tr1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>../../../lib/cpp/$(Configuration);../../../../Boost/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libthrift.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../;../../../lib/cpp/src;../../../../boost;../../../../boost/boost/tr1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalLibraryDirectories>../../../lib/cpp/$(Configuration);../../../../Boost/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libthrift.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\gen-cpp\SampleCallback.h" />
-    <ClInclude Include="..\gen-cpp\SampleService.h" />
-    <ClInclude Include="..\gen-cpp\Sample_constants.h" />
-    <ClInclude Include="..\gen-cpp\Sample_types.h" />
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\ThriftCommon.cpp" />
-    <ClCompile Include="..\gen-cpp\SampleCallback.cpp" />
-    <ClCompile Include="..\gen-cpp\SampleService.cpp" />
-    <ClCompile Include="..\gen-cpp\Sample_constants.cpp" />
-    <ClCompile Include="..\gen-cpp\Sample_types.cpp" />
-    <ClCompile Include="client.cpp" />
-    <ClCompile Include="stdafx.cpp" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj.filters
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj.filters b/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj.filters
deleted file mode 100644
index 3ec7bde..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj.filters
+++ /dev/null
@@ -1,66 +0,0 @@
-?<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-    <Filter Include="Source Files\gen-cpp">
-      <UniqueIdentifier>{1265b3dc-91de-416f-aba6-7b750de4221e}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\Sample_types.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\SampleService.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\Sample_constants.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\SampleCallback.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="client.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\SampleService.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\Sample_constants.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\Sample_types.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\SampleCallback.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\ThriftCommon.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.cpp b/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.cpp
deleted file mode 100644
index 4bd151e..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// client.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.h b/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.h
deleted file mode 100644
index b005a83..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/targetver.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/targetver.h b/depends/thirdparty/thrift/contrib/transport-sample/client/targetver.h
deleted file mode 100644
index 87c0086..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/targetver.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/config.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/config.h b/depends/thirdparty/thrift/contrib/transport-sample/config.h
deleted file mode 100644
index a20d785..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/config.h
+++ /dev/null
@@ -1,24 +0,0 @@
-//Missing definitions for *NIX systems. This sample project
-//was initially created on Windows.
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-
-#define TEXT(str) str
-
-inline int Sleep(int ms)
-{
-	return sleep(ms/1000); //sleep() param is in seconds
-}
-
-inline int _tcscmp(const char* str1, const char* str2)
-{
-	return strcmp(str1, str2);
-}
-
-inline int _tstoi(const char* str)
-{
-	return atoi(str);
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/ReadMe.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/ReadMe.txt b/depends/thirdparty/thrift/contrib/transport-sample/server/ReadMe.txt
deleted file mode 100644
index 53c0ee5..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/ReadMe.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : server Project Overview
-========================================================================
-
-AppWizard has created this server application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your server application.
-
-
-server.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-server.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-server.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named server.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/server.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/server.cpp b/depends/thirdparty/thrift/contrib/transport-sample/server/server.cpp
deleted file mode 100644
index dba8368..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/server.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-// server.cpp : Defines the entry point for the console application.
-//
-// sample server command line app using Thrift IPC.
-//
-// This is a simple demonstration of full duplex RPC. That is, each
-// side runs both a client and server to enable bidirectional event 
-// signaling.
-//
-
-#ifdef _WIN32
-#  include "stdafx.h"
-#else
-#  include "config.h"
-#endif
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//Include this before the generated includes
-#include "ThriftCommon.h"
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//Tailor these to your generated files
-#include "../gen-cpp/SampleService.h"
-#include "../gen-cpp/SampleCallback.h"
-
-using namespace Sample; //declared in .thrift file
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-int16_t ClientPort_;
-std::string ClientPipeName_;
-void S2CThreadProc();
-
-//-----------------------------------------------------------------------------
-// RPC implementations
-//
-class SampleServiceHandler : virtual public SampleServiceIf {
- public:
-  SampleServiceHandler() {
-    // Your initialization goes here
-  }
-
-  void HelloThere(std::string& _return, const std::string& HelloString) {
-    // Your implementation goes here
-    printf("<<<HelloThere() received string: %s\n", HelloString.c_str());
-	_return = "Good thank you.";
-  }
-
-  void ServerDoSomething() {
-    // Your implementation goes here
-    printf("ServerDoSomething(): Simulating work for 5 seconds\n");
-    Sleep(5000);
-    printf("ServerDoSomething(): Done\n");
-  }
-
-  void ClientSideListenPort(const int16_t ClientListenPort)
-  {
-	ClientPort_ = ClientListenPort;
-	ClientPipeName_ = "";
-#ifdef _WIN32
-	printf(">>>Connecting to client on port %d\n", ClientPort_);
-	boost::thread Connect2ClientThread(S2CThreadProc);
-#endif
-  }
-
-  void ClientSidePipeName(const std::string& ClientPipeName)
-  {
-	ClientPipeName_ = ClientPipeName;
-	ClientPort_ = 0;
-#ifdef _WIN32
-	printf(">>>Connecting to client pipe %s\n", ClientPipeName_.c_str());
-	boost::thread Connect2ClientThread(S2CThreadProc);
-#endif
-  }
-};
-//-----------------------------------------------------------------------------
-
-#ifdef _WIN32
-int _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char **argv)
-#endif
-{
-	int port;
-	std::string pipename; //e.g. "affpipe"
-
-	bool usage = false;
-
-	//Process command line params
-	if(argc > 1)
-	{
-		if(_tcscmp(argv[1], TEXT("-sp")) == 0)
-		{	//Socket Port specified
-			port = _tstoi(argv[2]);
-#ifdef _WIN32
-			TWinsockSingleton::create();
-#endif
-			// Start the thrift server which is a blocking call.
-			thriftcommon::RunThriftServer<SampleServiceHandler, SampleServiceProcessor>(10, port);
-		}
-		else if(_tcscmp(argv[1], TEXT("-np")) == 0)
-		{	//Named Pipe specified
-#ifdef _WIN32
-			std::wstring wpipe(argv[2]);
-			pipename.resize(wpipe.length());
-			std::copy(wpipe.begin(), wpipe.end(), pipename.begin());
-#else
-			pipename = argv[2];
-#endif
-			printf("Using Named Pipe %s\n", pipename.c_str());
-
-			//Thrift over Named Pipe.
-			thriftcommon::RunThriftServer<SampleServiceHandler, SampleServiceProcessor>(10, pipename);
-		}
-		else if(_tcscmp(argv[1], TEXT("-ap")) == 0)
-		{	//Anonymous Pipe specified
-			//This is more involved because the child needs to be launched 
-			//after the transport is created but before the blocking server 
-			//call.
-#ifdef _WIN32
-			boost::shared_ptr<TServerTransport> transport(new TPipeServer()); //Anonymous pipe
-			thriftcommon::LaunchAnonPipeChild(".\\client.exe", transport);
-			boost::shared_ptr<SampleServiceHandler> handler(new SampleServiceHandler());
-			thriftcommon::RunThriftServer<SampleServiceHandler, SampleServiceProcessor>(handler, 10, transport);
-#else
-			printf("Anonymous pipes not (yet) supported under *NIX\n");
-#endif
-		}
-		else
-			usage = true;
-	}
-	else
-		usage = true;
-
-	if(usage)
-	{
-		printf("Thrift sample server usage:\n\n");
-		printf("Socket Port :   -sp <port#>\n");
-		printf("Named Pipe :    -np <pipename> (e.g. affpipe)\n");
-		printf("Anonymous Pipe: -ap\n");
-	}
-	return 0;
-}
-
-
-//Thread Routine that connects to the 'client'.
-void S2CThreadProc()
-{
-	//Master server's connection to client-side's server.
-	boost::shared_ptr<SampleCallbackClient> clientsrv; //Client class from Thrift-generated code.
-	boost::shared_ptr<TTransport> transport;
-	if(ClientPort_ != 0)
-		thriftcommon::ConnectToServer<SampleCallbackClient, TTransport>(clientsrv, transport, ClientPort_);
-	if(!ClientPipeName_.empty())
-		thriftcommon::ConnectToServer<SampleCallbackClient, TTransport>(clientsrv, transport, ClientPipeName_);
-
-	try {
-		transport->open();
-
-		clientsrv->pingclient();
-		Sleep(1500);
-		clientsrv->pingclient();
-		Sleep(1500);
-		clientsrv->pingclient();
-
-		transport->close();
-	} catch (TException &tx) {
-		printf("ERROR: %s\n", tx.what());
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj b/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj
deleted file mode 100644
index 8e39b26..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj
+++ /dev/null
@@ -1,106 +0,0 @@
-?<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{72FCAF29-506D-4164-9FA6-F54C5C28E79D}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>server</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>Application</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <LinkIncremental>true</LinkIncremental>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <LinkIncremental>false</LinkIncremental>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../;../../../lib/cpp/src;../../../../Boost/;../../../../Boost/boost/tr1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalLibraryDirectories>../../../lib/cpp/$(Configuration);../../../../Boost/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libthrift.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <AdditionalIncludeDirectories>../;../../../lib/cpp/src;../../../../Boost/;../../../../Boost/boost/tr1;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-    </ClCompile>
-    <Link>
-      <SubSystem>Console</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalLibraryDirectories>../../../lib/cpp/$(Configuration);../../../../Boost/lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
-      <AdditionalDependencies>libthrift.lib;ws2_32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="..\gen-cpp\SampleCallback.h" />
-    <ClInclude Include="..\gen-cpp\SampleService.h" />
-    <ClInclude Include="..\gen-cpp\Sample_constants.h" />
-    <ClInclude Include="..\gen-cpp\Sample_types.h" />
-    <ClInclude Include="stdafx.h" />
-    <ClInclude Include="targetver.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="..\ThriftCommon.cpp" />
-    <ClCompile Include="..\gen-cpp\SampleCallback.cpp" />
-    <ClCompile Include="..\gen-cpp\SampleService.cpp" />
-    <ClCompile Include="..\gen-cpp\Sample_constants.cpp" />
-    <ClCompile Include="..\gen-cpp\Sample_types.cpp" />
-    <ClCompile Include="server.cpp" />
-    <ClCompile Include="stdafx.cpp">
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
-      <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
-    </ClCompile>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj.filters
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj.filters b/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj.filters
deleted file mode 100644
index 8bb6dfb..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj.filters
+++ /dev/null
@@ -1,66 +0,0 @@
-?<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="Source Files">
-      <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
-      <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
-    </Filter>
-    <Filter Include="Header Files">
-      <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
-      <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
-    </Filter>
-    <Filter Include="Resource Files">
-      <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
-      <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
-    </Filter>
-    <Filter Include="Source Files\gen-cpp">
-      <UniqueIdentifier>{dab66db8-bc45-4518-aad2-7a75696226e3}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="ReadMe.txt" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="stdafx.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="targetver.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\Sample_types.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\SampleService.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\Sample_constants.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-    <ClInclude Include="..\gen-cpp\SampleCallback.h">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="stdafx.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="server.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\Sample_types.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\SampleService.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\Sample_constants.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\gen-cpp\SampleCallback.cpp">
-      <Filter>Source Files\gen-cpp</Filter>
-    </ClCompile>
-    <ClCompile Include="..\ThriftCommon.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-  </ItemGroup>
-</Project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.cpp b/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.cpp
deleted file mode 100644
index c25ff61..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.cpp
+++ /dev/null
@@ -1,8 +0,0 @@
-// stdafx.cpp : source file that includes just the standard includes
-// server.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-// TODO: reference any additional headers you need in STDAFX.H
-// and not in this file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.h b/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.h
deleted file mode 100644
index b005a83..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#pragma once
-
-#include "targetver.h"
-
-#include <stdio.h>
-#include <tchar.h>
-
-
-
-// TODO: reference additional headers your program requires here

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/server/targetver.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/server/targetver.h b/depends/thirdparty/thrift/contrib/transport-sample/server/targetver.h
deleted file mode 100644
index 87c0086..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/server/targetver.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-
-// Including SDKDDKVer.h defines the highest available Windows platform.
-
-// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
-// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
-
-#include <SDKDDKVer.h>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/thriftme.bat
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/thriftme.bat b/depends/thirdparty/thrift/contrib/transport-sample/thriftme.bat
deleted file mode 100644
index 4b1ef78..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/thriftme.bat
+++ /dev/null
@@ -1 +0,0 @@
-thrift.exe --gen cpp Sample.thrift

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/thriftme.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/thriftme.sh b/depends/thirdparty/thrift/contrib/transport-sample/thriftme.sh
deleted file mode 100644
index 3b18f90..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/thriftme.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-THRIFT_COMPILER=./thrift
-OUTPUT_FOLDER=$PWD
-
-if [ ! -e "${THRIFT_COMPILER}" ]
-then
-   THRIFT_COMPILER=thrift
-   command -v  ${THRIFT_COMPILER} >/dev/null 2>&1
-   if [ $? -eq 1 ]; then
-      echo
-      echo "thrift compiler not found."
-      echo
-      exit
-   fi
-fi
-
-${THRIFT_COMPILER} --gen cpp Sample.thrift
-
-echo
-echo "Files have been generated in gen-cpp."
-
-exit
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/transport-sample.sln
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/transport-sample.sln b/depends/thirdparty/thrift/contrib/transport-sample/transport-sample.sln
deleted file mode 100644
index a9fa1ef..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/transport-sample.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-?
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "server\server.vcxproj", "{72FCAF29-506D-4164-9FA6-F54C5C28E79D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client\client.vcxproj", "{85FBFB54-530B-498F-9F38-44BA204FAE6A}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Win32 = Debug|Win32
-		Release|Win32 = Release|Win32
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{72FCAF29-506D-4164-9FA6-F54C5C28E79D}.Debug|Win32.ActiveCfg = Debug|Win32
-		{72FCAF29-506D-4164-9FA6-F54C5C28E79D}.Debug|Win32.Build.0 = Debug|Win32
-		{72FCAF29-506D-4164-9FA6-F54C5C28E79D}.Release|Win32.ActiveCfg = Release|Win32
-		{72FCAF29-506D-4164-9FA6-F54C5C28E79D}.Release|Win32.Build.0 = Release|Win32
-		{85FBFB54-530B-498F-9F38-44BA204FAE6A}.Debug|Win32.ActiveCfg = Debug|Win32
-		{85FBFB54-530B-498F-9F38-44BA204FAE6A}.Debug|Win32.Build.0 = Debug|Win32
-		{85FBFB54-530B-498F-9F38-44BA204FAE6A}.Release|Win32.ActiveCfg = Release|Win32
-		{85FBFB54-530B-498F-9F38-44BA204FAE6A}.Release|Win32.Build.0 = Release|Win32
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/README.md b/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/README.md
deleted file mode 100644
index 76dca44..0000000
--- a/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-Apache Thrift Centos 6.5 Vagrant Support
-========================================
-This directory is the Vagrant project directory for Apache Thrift running on Centos 6.5. The Vagrantfile in this directory configures a Vagrant provisioned VM launched under VirtualBox. To use this project you must have a recent version of VirtualBox and Vagrant installed (in that order). To run the VM, open a shell, clone Apache Thrift, change to this directory and enter the Vagrant up command.
-
-   $ git clone https://github.com/apache/thrift
-   $ cd thrift/contrib/vagrant/centos-6.5
-   $ vagrant up
-
-This will download and launch the base box VM under VirtualBox and run the Apache Thrift provisioning script. This will take up to an hour depending on your hardware and network. Once complete you can login to the box with Vagrant ssh. The thrift source tree from your host os is mounted at /thrift.
-
-   $ vagrant ssh
-   [vagrant@thrift ~]$ cd /thrift
-   [vagrant@thrift thrift]$ compiler/cpp/thrift --version
-   Thrift version 1.0.0-dev
-
-The provisioning script (inside the Vagrantfile) runs ./bootstrap.sh, ./configure, make and make check, but does not install thrift. To install thrift run "make install".
-
-The Vagrant base box used here is a minimal Centos 6.5 VirtualBox with 2GB RAM and 2 CPUs. For more Vagrant information: https://www.vagrantup.com. A summary of the base box preparation follows:
-
-root password: vagrant
-
-#Create the vagrant user and give it sudo permission
-adduser vagrant
-passwd vagrant
-visudo  :  vagrant ALL=(ALL) NOPASSWD: ALL
-           #Defaults requiretty
-
-#Shut down the firewall and disable it
-service iptables stop
-chkconfig iptables off
-
-#Setup the vagrant ssh public key to allow vagrant to ssh
-mkdir /home/vagrant/.ssh
-chmod 700 /home/vagrant/.ssh
-cd /home/vagrant/.ssh
-wget --no-check-certificate 'https://raw.github.com/mitchellh/vagrant/master/keys/vagrant.pub' -O authorized_keys
-chmod 600 /home/vagrant/.ssh/authorized_keys
-chown -R vagrant /home/vagrant/.ssh
-
-#Install EPEL (Extra Packages for Enterprise Linux) but protect the base
-#repositories so that EPEL does not mask base packages
-yum -y install yum-plugin-protectbase
-rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
-
-#Install perl, dynamic kernel modules, dev tools and kernel headers to support
-#Virtual box additions
-yum -y install perl
-yum -y --enablerepo epel install dkms
-yum -y groupinstall "Development Tools"
-yum -y install kernel-devel
-
-#Update everything and reboot
-yum update
-reboot
-
-#Install the VirtualBox Guest additions (using VirtualBox iso)
-mount /dev/cdrom /mnt
-/mnt/VBoxLinuxAdditions.run
-umount /mnt
-
-See the Vagrantfile for further details

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/Vagrantfile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/Vagrantfile b/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/Vagrantfile
deleted file mode 100644
index 6207958..0000000
--- a/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/Vagrantfile
+++ /dev/null
@@ -1,274 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-# APACHE THRIFT PROVISIONING SCRIPT
-##############################################################
-# This script is used to configure the base Centos 6.5
-# Vagrant box for Apache Thrift compiler and lib builds.
-# The base box is Centos 6.5 with no additional packages
-# except those required to support VirtualBox Guest tools:
-# perl, dkms, kernel-devel and the "Development Tools" group.
-# The epel repo was also added along with the
-# yum-plugin-protectbase package to prefer base repo packages.
-# The script below provisions ALL languages. This will take
-# time. You can greatly reduce the build time by commenting
-# out the LIB provisioning for uneeded language libraries.
-# Expect full provisioning to take 30 minutes on a fast
-# machine with an excellent Internet connection (and another
-# 15 minutes for the build).
-#
-# Machine accounts:
-# - User: vagrant/vagrant
-# - Admin: root/vagrant
-# Vagrant public ssh key also installed
-##############################################################
-
-$build_and_test = <<SCRIPT
-echo "Provisioning system to compile and test Apache Thrift."
-date > /etc/vagrant.provision_begin
-
-# Apache Thrift compiler dependencies
-#####################################
-
-#install an updated autoconf
-wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz
-tar xvf autoconf-2.69.tar.gz
-cd autoconf-2.69
-./configure --prefix=/usr
-make
-sudo make install
-cd ..
-
-#install an updated automake
-wget http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz
-tar xvf automake-1.14.tar.gz
-cd automake-1.14
-./configure --prefix=/usr
-make
-sudo make install
-cd ..
-
-#install an updated bison
-wget http://ftp.gnu.org/gnu/bison/bison-2.5.1.tar.gz
-tar xvf bison-2.5.1.tar.gz
-cd bison-2.5.1
-./configure --prefix=/usr
-make
-sudo make install
-cd ..
-
-# C++98 LIB Dependencies
-#####################################
-sudo yum -y install libevent-devel zlib-devel openssl-devel
-
-#Install an updated Boost library
-wget http://sourceforge.net/projects/boost/files/boost/1.55.0/boost_1_55_0.tar.gz
-tar xvf boost_1_55_0.tar.gz
-cd boost_1_55_0
-./bootstrap.sh
-sudo ./b2 install
-
-# Java LIB Dependencies
-#####################################
-sudo yum install -y ant junit ant-nodeps ant-junit java-1.7.0-openjdk-devel
-
-# Python LIB Dependencies
-#####################################
-sudo yum install -y python-devel python-setuptools python-twisted
-
-# Ruby LIB Dependencies
-#####################################
-sudo yum install -y ruby ruby-devel rubygems
-sudo gem install bundler rake
-
-# Node.js LIB Dependencies
-#####################################
-sudo yum install -y nodejs nodejs-devel npm
-
-# Perl LIB Dependencies
-#####################################
-sudo yum install -y perl-Bit-Vector perl-Class-Accessor perl-ExtUtils-MakeMaker perl-Test-Simple
-
-# PHP LIB Dependencies
-#####################################
-sudo yum install -y php php-devel php-pear re2c
-
-# GLibC LIB Dependencies
-#####################################
-sudo yum install -y glib2-devel
-
-# Erlang LIB Dependencies
-#####################################
-sudo yum install -y erlang-kernel erlang-erts erlang-stdlib erlang-eunit erlang-rebar
-
-# Lua LIB Dependencies
-#####################################
-sudo yum install -y lua-devel
-
-# Go LIB Dependencies
-#####################################
-sudo yum install -y golang golang-pkg-linux-amd64
-
-# C# LIB Dependencies
-#####################################
-sudo yum install -y mono-core mono-devel mono-web-devel mono-extras mingw32-binutils mingw32-runtime mingw32-nsis
-
-# Haskell LIB Dependencies
-#####################################
-wget http://sherkin.justhub.org/el6/RPMS/x86_64/justhub-release-2.0-4.0.el6.x86_64.rpm
-sudo rpm -ivh justhub-release-2.0-4.0.el6.x86_64.rpm
-sudo yum -y install haskell
-sudo cabal update
-sudo cabal install cabal-install
-
-# Build and Test Apache Thrift
-#####################################
-date > /etc/vagrant.provision_end
-echo "Starting Apache Thrift build..."
-cd /thrift
-sh bootstrap.sh
-
-# At the time of this file's creation Ruby, Python, Go and Lua fail
-# their unit tests in this environment. To build and test any of these
-# libraries uncomment the appropriate --without switches below.
-
-sh configure --without-ruby --without-go --without-lua --without-python
-make
-echo "Starting Apache Thrift tests..."
-make check
-echo "Finished building and testing Apache Thrift."
-echo 'Use "make install" to install the compiler and libraries.'
-date > /etc/vagrant.make_end
-
-SCRIPT
-
-Vagrant.configure("2") do |config|
-  # Every Vagrant virtual environment requires a box to build off of.
-  ##### Centos 6.5 minimal system with VirtualBox Guest Additions
-  ##### Box maintained by ra@apache.org, see README.md for box config
-  config.vm.box = "RandyAbernethy/thrift-centos-6.5-64"
-
-  # Disable automatic box update checking. If you disable this, then
-  # boxes will only be checked for updates when the user runs
-  # `vagrant box outdated`. This is not recommended.
-  ##### This box will never change
-  config.vm.box_check_update = false
-
-  # Create a forwarded port mapping which allows access to a specific port
-  # within the machine from a port on the host machine. In the example below,
-  # accessing "localhost:8080" will access port 80 on the guest machine.
-  # config.vm.network "forwarded_port", guest: 80, host: 8080
-
-  # Create a private network, which allows host-only access to the machine
-  # using a specific IP.
-  # config.vm.network "private_network", ip: "192.168.33.10"
-
-  # Create a public network, which generally matched to bridged network.
-  # Bridged networks make the machine appear as another physical device on
-  # your network.
-  # config.vm.network "public_network"
-
-  # If true, then any SSH connections made will enable agent forwarding.
-  # Default value: false
-  # config.ssh.forward_agent = true
-
-  # Share an additional folder to the guest VM. The first argument is
-  # the path on the host to the actual folder. The second argument is
-  # the path on the guest to mount the folder. And the optional third
-  # argument is a set of non-required options.
-  # config.vm.synced_folder "../data", "/vagrant_data"
-  ##### By convention the thrift source tree is mapped to /thrift
-  config.vm.synced_folder "../../../", "/thrift"
-
-  # Provider-specific configuration so you can fine-tune various
-  # backing providers for Vagrant. These expose provider-specific options.
-  ##### The machine needs 2 CPUs and 2GB RAM for reasonable performance
-  config.vm.provider "virtualbox" do |vb|
-    vb.customize ["modifyvm", :id, "--memory", "2048"]
-    vb.customize ["modifyvm", :id, "--cpus", "2"]
-  end
-
-  # Enable provisioning with CFEngine. CFEngine Community packages are
-  # automatically installed. For example, configure the host as a
-  # policy server and optionally a policy file to run:
-  #
-  # config.vm.provision "cfengine" do |cf|
-  #   cf.am_policy_hub = true
-  #   # cf.run_file = "motd.cf"
-  # end
-  #
-  # You can also configure and bootstrap a client to an existing
-  # policy server:
-  #
-  # config.vm.provision "cfengine" do |cf|
-  #   cf.policy_server_address = "10.0.2.15"
-  # end
-
-  # Enable provisioning with Puppet stand alone.  Puppet manifests
-  # are contained in a directory path relative to this Vagrantfile.
-  # You will need to create the manifests directory and a manifest in
-  # the file default.pp in the manifests_path directory.
-  #
-  # config.vm.provision "puppet" do |puppet|
-  #   puppet.manifests_path = "manifests"
-  #   puppet.manifest_file  = "default.pp"
-  # end
-
-  # Enable provisioning with chef solo, specifying a cookbooks path, roles
-  # path, and data_bags path (all relative to this Vagrantfile), and adding
-  # some recipes and/or roles.
-  #
-  # config.vm.provision "chef_solo" do |chef|
-  #   chef.cookbooks_path = "../my-recipes/cookbooks"
-  #   chef.roles_path = "../my-recipes/roles"
-  #   chef.data_bags_path = "../my-recipes/data_bags"
-  #   chef.add_recipe "mysql"
-  #   chef.add_role "web"
-  #
-  #   # You may also specify custom JSON attributes:
-  #   chef.json = { mysql_password: "foo" }
-  # end
-
-  # Enable provisioning with chef server, specifying the chef server URL,
-  # and the path to the validation key (relative to this Vagrantfile).
-  #
-  # The Opscode Platform uses HTTPS. Substitute your organization for
-  # ORGNAME in the URL and validation key.
-  #
-  # If you have your own Chef Server, use the appropriate URL, which may be
-  # HTTP instead of HTTPS depending on your configuration. Also change the
-  # validation key to validation.pem.
-  #
-  # config.vm.provision "chef_client" do |chef|
-  #   chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
-  #   chef.validation_key_path = "ORGNAME-validator.pem"
-  # end
-  #
-  # If you're using the Opscode platform, your validator client is
-  # ORGNAME-validator, replacing ORGNAME with your organization name.
-  #
-  # If you have your own Chef Server, the default validation client name is
-  # chef-validator, unless you changed the configuration.
-  #
-  #   chef.validation_client_name = "ORGNAME-validator"
-
-  ##### Run the Apache Thrift provisioning script (declared above)
-  config.vm.provision :shell, :inline => $build_and_test
-end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/README.md b/depends/thirdparty/thrift/contrib/zeromq/README.md
deleted file mode 100644
index 9e0b5bd..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-This directory contains some glue code to allow Thrift RPCs to be sent over
-ZeroMQ.  Included are client and server implementations for Python and C++,
-along with a simple demo interface (with a working client and server for
-each language).
-
-Thrift was designed for stream-based interfaces like TCP, but ZeroMQ is
-message-based, so there is a small impedance mismatch.  Most of issues are
-hidden from developers, but one cannot be: oneway methods have to be handled
-differently from normal ones.  ZeroMQ requires the messaging pattern to be
-declared at socket creation time, so an application cannot decide on a
-message-by-message basis whether to send a reply.  Therefore, this
-implementation makes it the client's responsibility to ensure that ZMQ_REQ
-sockets are used for normal methods and ZMQ_DOWNSTREAM sockets are used for
-oneway methods.  In addition, services that expose both types of methods
-have to expose two servers (on two ports), but the TZmqMultiServer makes it
-easy to run the two together in the same thread.
-
-This code was tested with ZeroMQ 2.0.7 and pyzmq afabbb5b9bd3.
-
-To build, simply install Thrift and ZeroMQ, then run "make".  If you install
-in a non-standard location, make sure to set THRIFT to the location of the
-Thrift code generator on the make command line and PKG_CONFIG_PATH to a path
-that includes the pkgconfig files for both Thrift and ZeroMQ.  The test
-servers take no arguments.  Run the test clients with no arguments to
-retrieve the stored value or with an integer argument to increment it by
-that amount.
-
-This code is not quite what I would consider production-ready.  It doesn't
-support all of the normal hooks into Thrift, and its performance is
-sub-optimal because it does some unnecessary copying.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.cpp b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.cpp
deleted file mode 100644
index 56278f3..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "TZmqClient.h"
-#include <cstring>
-
-namespace apache { namespace thrift { namespace transport {
-
-uint32_t TZmqClient::read_virt(uint8_t* buf, uint32_t len) {
-  if (rbuf_.available_read() == 0) {
-    (void)sock_.recv(&msg_);
-    rbuf_.resetBuffer((uint8_t*)msg_.data(), msg_.size());
-  }
-  return rbuf_.read(buf, len);
-}
-
-void TZmqClient::write_virt(const uint8_t* buf, uint32_t len) {
-  return wbuf_.write(buf, len);
-}
-
-uint32_t TZmqClient::writeEnd() {
-  uint8_t* buf;
-  uint32_t size;
-  wbuf_.getBuffer(&buf, &size);
-  zmq::message_t msg(size);
-  std::memcpy(msg.data(), buf, size);
-  (void)sock_.send(msg);
-  wbuf_.resetBuffer(true);
-  return size;
-}
-
-}}} // apache::thrift::transport

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.h b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.h
deleted file mode 100644
index df16e03..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_TZMQCLIENT_H_
-#define _THRIFT_TRANSPORT_TZMQCLIENT_H_ 1
-
-#include <zmq.hpp>
-#include <thrift/transport/TBufferTransports.h>
-
-namespace apache { namespace thrift { namespace transport {
-
-class TZmqClient : public TTransport {
- public:
-  TZmqClient(zmq::context_t& ctx, const std::string& endpoint, int type)
-    : sock_(ctx, type)
-    , endpoint_(endpoint)
-    , wbuf_()
-    , rbuf_()
-    , msg_()
-    , zmq_type_(type)
-  {}
-
-  void open() {
-    if(zmq_type_ == ZMQ_PUB) {
-      sock_.bind(endpoint_.c_str());
-    }
-    else {
-      sock_.connect(endpoint_.c_str());
-    }
-  }
-
-  uint32_t read_virt(uint8_t* buf, uint32_t len);
-
-  void write_virt(const uint8_t* buf, uint32_t len);
-
-  uint32_t writeEnd();
-
- protected:
-  zmq::socket_t sock_;
-  std::string endpoint_;
-  TMemoryBuffer wbuf_;
-  TMemoryBuffer rbuf_;
-  zmq::message_t msg_;
-  int zmq_type_;
-};
-
-}}} // apache::thrift::transport
-
-#endif // #ifndef _THRIFT_TRANSPORT_TZMQCLIENT_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.py b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.py
deleted file mode 100644
index d560697..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-import zmq
-from cStringIO import StringIO
-from thrift.transport.TTransport import TTransportBase, CReadableTransport
-
-class TZmqClient(TTransportBase, CReadableTransport):
-  def __init__(self, ctx, endpoint, sock_type):
-    self._sock = ctx.socket(sock_type)
-    self._endpoint = endpoint
-    self._wbuf = StringIO()
-    self._rbuf = StringIO()
-
-  def open(self):
-    self._sock.connect(self._endpoint)
-
-  def read(self, size):
-    ret = self._rbuf.read(size)
-    if len(ret) != 0:
-      return ret
-    self._read_message()
-    return self._rbuf.read(size)
-
-  def _read_message(self):
-    msg = self._sock.recv()
-    self._rbuf = StringIO(msg)
-
-  def write(self, buf):
-    self._wbuf.write(buf)
-
-  def flush(self):
-    msg = self._wbuf.getvalue()
-    self._wbuf = StringIO()
-    self._sock.send(msg)
-
-  # Implement the CReadableTransport interface.
-  @property
-  def cstringio_buf(self):
-    return self._rbuf
-
-  # NOTE: This will probably not actually work.
-  def cstringio_refill(self, prefix, reqlen):
-    while len(prefix) < reqlen:
-      self.read_message()
-      prefix += self._rbuf.getvalue()
-    self._rbuf = StringIO(prefix)
-    return self._rbuf

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.cpp b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.cpp
deleted file mode 100644
index f031458..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.cpp
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "TZmqServer.h"
-#include <thrift/transport/TBufferTransports.h>
-#include <boost/scoped_ptr.hpp>
-
-using boost::shared_ptr;
-using apache::thrift::transport::TMemoryBuffer;
-using apache::thrift::protocol::TProtocol;
-
-namespace apache { namespace thrift { namespace server {
-
-bool TZmqServer::serveOne(int recv_flags) {
-  zmq::message_t msg;
-  bool received = sock_.recv(&msg, recv_flags);
-  if (!received) {
-    return false;
-  }
-  shared_ptr<TMemoryBuffer> inputTransport(new TMemoryBuffer((uint8_t*)msg.data(), msg.size()));
-  shared_ptr<TMemoryBuffer> outputTransport(new TMemoryBuffer());
-  shared_ptr<TProtocol> inputProtocol(
-      inputProtocolFactory_->getProtocol(inputTransport));
-  shared_ptr<TProtocol> outputProtocol(
-      outputProtocolFactory_->getProtocol(outputTransport));
-  shared_ptr<TMemoryBuffer> transport(new TMemoryBuffer);
-
-  processor_->process(inputProtocol, outputProtocol, NULL);
-
-  if (zmq_type_ == ZMQ_REP) {
-    uint8_t* buf;
-    uint32_t size;
-    outputTransport->getBuffer(&buf, &size);
-    msg.rebuild(size);
-    std::memcpy(msg.data(), buf, size);
-    (void)sock_.send(msg);
-  }
-
-  return true;
-}
-
-
-void TZmqMultiServer::serveOne(long timeout) {
-  boost::scoped_ptr<zmq::pollitem_t> items(setupPoll());
-  serveActive(items.get(), timeout);
-}
-
-
-void TZmqMultiServer::serveForever() {
-  boost::scoped_ptr<zmq::pollitem_t> items(setupPoll());
-  while (true) {
-    serveActive(items.get(), -1);
-  }
-}
-
-
-zmq::pollitem_t* TZmqMultiServer::setupPoll() {
-  zmq::pollitem_t* items = new zmq::pollitem_t[servers_.size()];
-  for (int i = 0; i < servers_.size(); ++i) {
-    items[i].socket = servers_[i]->getSocket();
-    items[i].events = ZMQ_POLLIN;
-  }
-  return items;
-}
-
-void TZmqMultiServer::serveActive(zmq::pollitem_t* items, long timeout) {
-  int rc = zmq::poll(items, servers_.size(), timeout);
-  if (rc == 0) {
-    return;
-  }
-  for (int i = 0; i < servers_.size(); ++i) {
-    if ((items[i].revents & ZMQ_POLLIN) != 0) {
-      // Should we pass ZMQ_NOBLOCK here to be safe?
-      servers_[i]->serveOne();
-    }
-  }
-}
-
-
-}}} // apache::thrift::server

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.h b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.h
deleted file mode 100644
index a840c86..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SERVER_TZMQSERVER_H_
-#define _THRIFT_SERVER_TZMQSERVER_H_ 1
-
-#include <zmq.hpp>
-#include <thrift/server/TServer.h>
-
-namespace apache { namespace thrift { namespace server {
-
-class TZmqServer : public TServer {
- public:
-  TZmqServer(
-      boost::shared_ptr<TProcessor> processor,
-      zmq::context_t& ctx, const std::string& endpoint, int type)
-    : TServer(processor)
-    , processor_(processor)
-    , zmq_type_(type)
-    , sock_(ctx, type)
-  {
-    if(zmq_type_ == ZMQ_SUB) {
-      sock_.setsockopt(ZMQ_SUBSCRIBE, "", 0) ; // listen to all messages
-      sock_.connect(endpoint.c_str()) ;
-    }
-    else {
-      sock_.bind(endpoint.c_str());
-    }
-  }
-
-  bool serveOne(int recv_flags = 0);
-  void serve() {
-    while (true) {
-      serveOne();
-    }
-  }
-
-  zmq::socket_t& getSocket() {
-    return sock_;
-  }
-
- private:
-  boost::shared_ptr<TProcessor> processor_;
-  int zmq_type_;
-  zmq::socket_t sock_;
-};
-
-
-class TZmqMultiServer {
- public:
-  void serveOne(long timeout = -1);
-  void serveForever();
-
-  std::vector<TZmqServer*>& servers() {
-    return servers_;
-  }
-
- private:
-  zmq::pollitem_t* setupPoll();
-  void serveActive(zmq::pollitem_t* items, long timeout);
-  std::vector<TZmqServer*> servers_;
-};
-
-
-}}} // apache::thrift::server
-
-#endif // #ifndef _THRIFT_SERVER_TZMQSERVER_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.py b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.py
deleted file mode 100644
index c83cc8d..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.py
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-import logging
-import zmq
-import thrift.server.TServer
-import thrift.transport.TTransport
-
-class TZmqServer(thrift.server.TServer.TServer):
-  def __init__(self, processor, ctx, endpoint, sock_type):
-    thrift.server.TServer.TServer.__init__(self, processor, None)
-    self.zmq_type = sock_type
-    self.socket = ctx.socket(sock_type)
-    self.socket.bind(endpoint)
-
-  def serveOne(self):
-    msg = self.socket.recv()
-    itrans = thrift.transport.TTransport.TMemoryBuffer(msg)
-    otrans = thrift.transport.TTransport.TMemoryBuffer()
-    iprot = self.inputProtocolFactory.getProtocol(itrans)
-    oprot = self.outputProtocolFactory.getProtocol(otrans)
-
-    try:
-      self.processor.process(iprot, oprot)
-    except Exception:
-      logging.exception("Exception while processing request")
-      # Fall through and send back a response, even if empty or incomplete.
-
-    if self.zmq_type == zmq.REP:
-      msg = otrans.getvalue()
-      self.socket.send(msg)
-
-  def serve(self):
-    while True:
-      self.serveOne()
-
-
-class TZmqMultiServer(object):
-  def __init__(self):
-    self.servers = []
-
-  def serveOne(self, timeout = -1):
-    self._serveActive(self._setupPoll(), timeout)
-
-  def serveForever(self):
-    poll_info = self._setupPoll()
-    while True:
-      self._serveActive(poll_info, -1)
-
-  def _setupPoll(self):
-    server_map = {}
-    poller = zmq.Poller()
-    for server in self.servers:
-      server_map[server.socket] = server
-      poller.register(server.socket, zmq.POLLIN)
-    return (server_map, poller)
-
-  def _serveActive(self, poll_info, timeout):
-    (server_map, poller) = poll_info
-    ready = dict(poller.poll())
-    for sock, state in ready.items():
-      assert (state & zmq.POLLIN) != 0
-      server_map[sock].serveOne()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/AssemblyInfo.cs b/depends/thirdparty/thrift/contrib/zeromq/csharp/AssemblyInfo.cs
deleted file mode 100644
index 12cd434..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/AssemblyInfo.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-// Information about this assembly is defined by the following attributes.
-// Change them to the values specific to your project.
-
-[assembly: AssemblyTitle("ZmqServer")]
-[assembly: AssemblyDescription("Zmq Examples")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("The Apache Software Foundation")]
-[assembly: AssemblyProduct("")]
-[assembly: AssemblyCopyright("The Apache Software Foundation")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
-// The form "{Major}.{Minor}.*" will automatically update the build and revision,
-// and "{Major}.{Minor}.{Build}.*" will update just the revision.
-
-[assembly: AssemblyVersion("1.0.*")]
-
-// The following attributes are used to specify the signing key for the assembly,
-// if desired. See the Mono documentation for more information about signing.
-
-//[assembly: AssemblyDelaySign(false)]
-//[assembly: AssemblyKeyFile("")]
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/Main.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/Main.cs b/depends/thirdparty/thrift/contrib/zeromq/csharp/Main.cs
deleted file mode 100644
index e66cfe0..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/Main.cs
+++ /dev/null
@@ -1,60 +0,0 @@
-using System;
-using System.Threading;
-using Thrift.Protocol;
-using ZMQ;
-using ZmqServer;
-using ZmqClient;
-
-namespace ZmqServer
-{
-	class MainClass
-	{
-		public static void Main (string[] args)
-		{
-			new Thread(Server.serve).Start();
-			Client.work();
-		}
-		
-		static class Server{
-			public static void serve(){
-				StorageHandler s=new StorageHandler();
-				Storage.Processor p=new Storage.Processor(s);
-				
-				ZMQ.Context c=new ZMQ.Context();
-				
-				TZmqServer tzs=new TZmqServer(p,c,"tcp://127.0.0.1:9090",ZMQ.SocketType.PAIR);
-				tzs.Serve();
-			}
-			
-			class StorageHandler:Storage.Iface{
-				int val=0;
-				
-				public void incr(int amount){
-					val+=amount;
-					Console.WriteLine("incr({0})",amount);
-				}
-				
-				public int get(){
-					return val;
-				} 
-			}
-		}
-		
-		static class Client{
-			public static void work()
-			{
-				Context ctx=new Context();
-				TZmqClient tzc=new TZmqClient(ctx,"tcp://127.0.0.1:9090",SocketType.PAIR);
-				TBinaryProtocol p=new TBinaryProtocol(tzc);
-				
-				Storage.Client client=new Storage.Client(p);
-				tzc.Open();
-				
-				Console.WriteLine(client.@get());
-				client.incr(1);
-				client.incr(41);
-				Console.WriteLine(client.@get());
-			}
-		}
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqClient.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqClient.cs b/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqClient.cs
deleted file mode 100644
index e9ab516..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqClient.cs
+++ /dev/null
@@ -1,78 +0,0 @@
-using System;
-using ZMQ;
-using System.IO;
-using Thrift.Transport;
-
-namespace ZmqClient
-{
-	public class TZmqClient : TTransport
-	{
-		Socket _sock;
-		String _endpoint;
-		MemoryStream _wbuf = new MemoryStream ();
-		MemoryStream _rbuf = new MemoryStream ();
-
-		void debug (string msg)
-		{
-			//Uncomment to enable debug
-//			Console.WriteLine (msg);
-		}
-
-		public TZmqClient (Context ctx, String endpoint, SocketType sockType)
-		{
-			_sock = ctx.Socket (sockType);
-			_endpoint = endpoint;
-		}
-
-		public override void Open ()
-		{
-			_sock.Connect (_endpoint);
-		}
-		
-		public override void Close ()
-		{
-			throw new NotImplementedException ();
-		}
-
-		public override bool IsOpen {
-			get {
-				throw new NotImplementedException ();
-			}
-		}
-
-		public override int Read (byte[] buf, int off, int len)
-		{
-			debug ("Client_Read");
-			if (off != 0 || len != buf.Length)
-				throw new NotImplementedException ();
-
-			if (_rbuf.Length == 0) {
-				//Fill the Buffer with the complete ZMQ Message which needs to be(?!) the complete Thrift response
-				debug ("Client_Read Filling buffer..");
-				byte[] tmpBuf = _sock.Recv ();
-				debug (string.Format("Client_Read filled with {0}b",tmpBuf.Length));
-				_rbuf.Write (tmpBuf, 0, tmpBuf.Length);
-				_rbuf.Position = 0;	//For reading
-			}
-			int ret = _rbuf.Read (buf, 0, len);
-			if (_rbuf.Length == _rbuf.Position)	//Finished reading
-				_rbuf.SetLength (0);
-			debug (string.Format ("Client_Read return {0}b, remaining  {1}b", ret, _rbuf.Length - _rbuf.Position));
-			return ret;
-		}
-
-		public override void Write (byte[] buf, int off, int len)
-		{
-			debug ("Client_Write");
-			_wbuf.Write (buf, off, len);
-		}
-
-		public override void Flush ()
-		{
-			debug ("Client_Flush");
-			_sock.Send (_wbuf.GetBuffer ());
-			_wbuf = new MemoryStream ();
-		}
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqServer.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqServer.cs b/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqServer.cs
deleted file mode 100644
index 535c623..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqServer.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System;
-using Thrift;
-using Thrift.Server;
-using Thrift.Transport;
-using Thrift.Protocol;
-using ZMQ;
-using System.IO;
-
-using System.Collections.Generic;
-
-namespace ZmqServer
-{
-	public class TZmqServer
-	{
-		Socket _socket ;
-		TProcessor _processor;
-		
-		void debug (string msg)
-		{
-			//Uncomment to enable debug
-//			Console.WriteLine (msg);
-		}
-
-		public TZmqServer (TProcessor processor, Context ctx, String endpoint, SocketType sockType)
-		{
-			new TSimpleServer (processor,null);
-			_socket = ctx.Socket (sockType);
-			_socket.Bind (endpoint);
-			_processor = processor;
-		}
-
-		public void ServeOne ()
-		{
-			debug ("Server_ServeOne");
-			Byte[] msg = _socket.Recv ();
-			MemoryStream istream = new MemoryStream (msg);
-			MemoryStream ostream = new MemoryStream ();
-			TProtocol tProtocol = new TBinaryProtocol (new TStreamTransport (istream, ostream));
-			_processor.Process (tProtocol, tProtocol);
-
-			if (ostream.Length != 0) {
-				byte[] newBuf = new byte[ostream.Length];
-				Array.Copy (ostream.GetBuffer (), newBuf, ostream.Length);
-				debug (string.Format ("Server_ServeOne sending {0}b", ostream.Length));
-				_socket.Send (newBuf);
-			}
-		}
-
-		public void Serve ()
-		{
-			while (true)
-				ServeOne ();
-		}
-	}
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.csproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.csproj b/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.csproj
deleted file mode 100755
index 958fc55..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.csproj
+++ /dev/null
@@ -1,91 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
-    <ProductVersion>9.0.21022</ProductVersion>
-    <SchemaVersion>2.0</SchemaVersion>
-    <ProjectGuid>{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <RootNamespace>ZmqServer</RootNamespace>
-    <AssemblyName>ThriftZMQ</AssemblyName>
-    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
-    <FileUpgradeFlags>
-    </FileUpgradeFlags>
-    <OldToolsVersion>3.5</OldToolsVersion>
-    <UpgradeBackupLocation />
-    <PublishUrl>publish\</PublishUrl>
-    <Install>true</Install>
-    <InstallFrom>Disk</InstallFrom>
-    <UpdateEnabled>false</UpdateEnabled>
-    <UpdateMode>Foreground</UpdateMode>
-    <UpdateInterval>7</UpdateInterval>
-    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
-    <UpdatePeriodically>false</UpdatePeriodically>
-    <UpdateRequired>false</UpdateRequired>
-    <MapFileExtensions>true</MapFileExtensions>
-    <ApplicationRevision>0</ApplicationRevision>
-    <ApplicationVersion>0.9.3.%2a</ApplicationVersion>
-    <IsWebBootstrapper>false</IsWebBootstrapper>
-    <UseApplicationTrust>false</UseApplicationTrust>
-    <BootstrapperEnabled>true</BootstrapperEnabled>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>DEBUG</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
-    <DebugType>none</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Release</OutputPath>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-    <PlatformTarget>x86</PlatformTarget>
-    <Externalconsole>true</Externalconsole>
-    <CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="clrzmq, Version=2.1.0.0, Culture=neutral, processorArchitecture=x86">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>.\clrzmq.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="Thrift, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>..\..\..\lib\csharp\Thrift.dll</HintPath>
-    </Reference>
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="Main.cs" />
-    <Compile Include="AssemblyInfo.cs" />
-    <Compile Include="TZmqServer.cs" />
-    <Compile Include="TZmqClient.cs" />
-    <Compile Include="..\gen-csharp\Storage.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <BootstrapperPackage Include="Microsoft.Net.Client.3.5">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
-      <Install>false</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
-      <Visible>False</Visible>
-      <ProductName>.NET Framework 3.5 SP1</ProductName>
-      <Install>true</Install>
-    </BootstrapperPackage>
-    <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
-      <Visible>False</Visible>
-      <ProductName>Windows Installer 3.1</ProductName>
-      <Install>true</Install>
-    </BootstrapperPackage>
-  </ItemGroup>
-  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
-</Project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.sln
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.sln b/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.sln
deleted file mode 100755
index 6af57b6..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.sln
+++ /dev/null
@@ -1,42 +0,0 @@
-\ufeff
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ThriftZMQ", "ThriftZMQ.csproj", "{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thrift", "..\..\..\lib\csharp\src\Thrift.csproj", "{499EB63C-D74C-47E8-AE48-A2FC94538E9D}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
-		Release|x86 = Release|x86
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Debug|Any CPU.ActiveCfg = Debug|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Debug|Mixed Platforms.Build.0 = Debug|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Debug|x86.ActiveCfg = Debug|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Debug|x86.Build.0 = Debug|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Release|Any CPU.ActiveCfg = Release|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Release|Mixed Platforms.ActiveCfg = Release|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Release|Mixed Platforms.Build.0 = Release|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Release|x86.ActiveCfg = Release|x86
-		{17C63B90-DFD7-42AC-A7B0-749E6876C0A1}.Release|x86.Build.0 = Release|x86
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Mixed Platforms.Build.0 = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|x86.ActiveCfg = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/storage.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/storage.thrift b/depends/thirdparty/thrift/contrib/zeromq/storage.thrift
deleted file mode 100644
index a1ea967..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/storage.thrift
+++ /dev/null
@@ -1,4 +0,0 @@
-service Storage {
-  oneway void incr(1: i32 amount);
-  i32 get();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-client.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-client.cpp b/depends/thirdparty/thrift/contrib/zeromq/test-client.cpp
deleted file mode 100644
index d2fc56c..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-client.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <iostream>
-#include <cstdlib>
-#include <thrift/protocol/TBinaryProtocol.h>
-
-#include "zmq.hpp"
-#include "TZmqClient.h"
-#include "Storage.h"
-
-using boost::shared_ptr;
-using apache::thrift::transport::TZmqClient;
-using apache::thrift::protocol::TBinaryProtocol;
-
-int main(int argc, char** argv) {
-  const char* endpoint = "tcp://127.0.0.1:9090";
-  int socktype = ZMQ_REQ;
-  int incr = 0;
-  if (argc > 1) {
-    incr = atoi(argv[1]);
-    if (incr) {
-      socktype = ZMQ_DOWNSTREAM;
-      endpoint = "tcp://127.0.0.1:9091";
-    }
-  }
-
-  zmq::context_t ctx(1);
-  shared_ptr<TZmqClient> transport(new TZmqClient(ctx, endpoint, socktype));
-  shared_ptr<TBinaryProtocol> protocol(new TBinaryProtocol(transport));
-  StorageClient client(protocol);
-  transport->open();
-
-  if (incr) {
-    client.incr(incr);
-    usleep(50000);
-  } else {
-    int value = client.get();
-    std::cout << value << std::endl;
-  }
-
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-client.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-client.py b/depends/thirdparty/thrift/contrib/zeromq/test-client.py
deleted file mode 100755
index 1886d9c..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-client.py
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/usr/bin/env python
-import sys
-import time
-import zmq
-import TZmqClient
-import thrift.protocol.TBinaryProtocol
-import storage.ttypes
-import storage.Storage
-
-
-def main(args):
-  endpoint = "tcp://127.0.0.1:9090"
-  socktype = zmq.REQ
-  incr = 0
-  if len(args) > 1:
-    incr = int(args[1])
-    if incr:
-      socktype = zmq.DOWNSTREAM
-      endpoint = "tcp://127.0.0.1:9091"
-
-  ctx = zmq.Context()
-  transport = TZmqClient.TZmqClient(ctx, endpoint, socktype)
-  protocol = thrift.protocol.TBinaryProtocol.TBinaryProtocolAccelerated(transport)
-  client = storage.Storage.Client(protocol)
-  transport.open()
-
-  if incr:
-    client.incr(incr)
-    time.sleep(0.05)
-  else:
-    value = client.get()
-    print value
-
-
-if __name__ == "__main__":
-  main(sys.argv)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-receiver.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-receiver.cpp b/depends/thirdparty/thrift/contrib/zeromq/test-receiver.cpp
deleted file mode 100644
index 8fe69da..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-receiver.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-#include "zmq.hpp"
-#include "TZmqServer.h"
-#include "Storage.h"
-
-using boost::shared_ptr;
-using apache::thrift::TProcessor;
-using apache::thrift::server::TZmqServer;
-using apache::thrift::server::TZmqMultiServer;
-
-class StorageHandler : virtual public StorageIf {
- public:
-  StorageHandler()
-    : value_(0)
-  {}
-
-  void incr(const int32_t amount) {
-    value_ += amount;
-    printf("value_: %i\n", value_) ;
-  }
-
-  int32_t get() {
-    return value_;
-  }
-
- private:
-  int32_t value_;
-
-};
-
-
-int main(int argc, char *argv[]) {
-  shared_ptr<StorageHandler> handler(new StorageHandler());
-  shared_ptr<TProcessor> processor(new StorageProcessor(handler));
-
-  zmq::context_t ctx(1);
-  TZmqServer oneway_server(processor, ctx, "epgm://eth0;239.192.1.1:5555", ZMQ_SUB);
-  oneway_server.serve();
-
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/zeromq/test-sender.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/zeromq/test-sender.cpp b/depends/thirdparty/thrift/contrib/zeromq/test-sender.cpp
deleted file mode 100644
index 6b0eef1..0000000
--- a/depends/thirdparty/thrift/contrib/zeromq/test-sender.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-#include <iostream>
-#include <cstdlib>
-#include <thrift/protocol/TBinaryProtocol.h>
-
-#include "zmq.hpp"
-#include "TZmqClient.h"
-#include "Storage.h"
-
-using boost::shared_ptr;
-using apache::thrift::transport::TZmqClient;
-using apache::thrift::protocol::TBinaryProtocol;
-
-int main(int argc, char** argv) {
-  const char* endpoint = "epgm://eth0;239.192.1.1:5555";
-  int socktype = ZMQ_PUB;
-  int incr = 1;
-  if (argc > 1) {
-    incr = atoi(argv[1]);
-  }
-
-  zmq::context_t ctx(1);
-  shared_ptr<TZmqClient> transport(new TZmqClient(ctx, endpoint, socktype));
-  shared_ptr<TBinaryProtocol> protocol(new TBinaryProtocol(transport));
-  StorageClient client(protocol);
-
-  transport->open();
-
-  client.incr(incr);
-  usleep(50000);
-
-  return 0;
-}



[35/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_haxe_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_haxe_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_haxe_generator.cc
deleted file mode 100644
index dfa36c5..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_haxe_generator.cc
+++ /dev/null
@@ -1,2966 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <sstream>
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <cctype>
-
-#include <sys/stat.h>
-#include <stdexcept>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Haxe code generator.
- *
- */
-class t_haxe_generator : public t_oop_generator {
-public:
-  t_haxe_generator(t_program* program,
-                   const std::map<std::string, std::string>& parsed_options,
-                   const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("callbacks");
-    callbacks_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("rtti");
-    rtti_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("buildmacro");
-    buildmacro_ = (iter != parsed_options.end()) ? (iter->second) : "";
-
-    out_dir_base_ = "gen-haxe";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool in_static,
-                         bool defval = false);
-  std::string render_const_value(ofstream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_haxe_struct(t_struct* tstruct, bool is_exception, bool is_result = false);
-
-  void generate_haxe_struct_definition(std::ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_xception = false,
-                                       bool is_result = false);
-  // removed -- equality,compare_to
-  void generate_haxe_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_haxe_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_haxe_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_haxe_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_haxe_struct_tostring(std::ofstream& out, t_struct* tstruct);
-  void generate_haxe_meta_data_map(std::ofstream& out, t_struct* tstruct);
-  void generate_field_value_meta_data(std::ofstream& out, t_type* type);
-  std::string get_haxe_type_string(t_type* type);
-  void generate_reflection_setters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_reflection_getters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct);
-  void generate_generic_isset_method(std::ofstream& out, t_struct* tstruct);
-  void generate_property_getters_setters(std::ofstream& out, t_struct* tstruct);
-
-  void generate_function_helpers(t_function* tfunction);
-  std::string get_cap_name(std::string name);
-  std::string generate_isset_check(t_field* field);
-  std::string generate_isset_check(std::string field);
-  void generate_isset_set(ofstream& out, t_field* field);
-  // removed std::string isset_field_id(t_field* field);
-
-  void generate_service_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-  void generate_service_method_signature(t_function* tfunction, bool is_interface);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map);
-
-  void generate_haxe_doc(std::ofstream& out, t_doc* tdoc);
-  void generate_haxe_doc(std::ofstream& out, t_function* tdoc);
-
-  void generate_rtti_decoration(std::ofstream& out);
-  void generate_macro_decoration(std::ofstream& out);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string haxe_package();
-  std::string haxe_type_imports();
-  std::string haxe_thrift_imports();
-  std::string haxe_thrift_gen_imports(t_struct* tstruct, string& imports);
-  std::string haxe_thrift_gen_imports(t_service* tservice);
-  std::string type_name(t_type* ttype, bool in_container = false, bool in_init = false);
-  std::string base_type_name(t_base_type* tbase, bool in_container = false);
-  std::string declare_field(t_field* tfield, bool init = false);
-  std::string function_signature_callback(t_function* tfunction);
-  std::string function_signature_normal(t_function* tfunction);
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string get_enum_class_name(t_type* type);
-  string generate_service_method_onsuccess(t_function* tfunction, bool as_type, bool omit_name);
-  void generate_service_method_signature_callback(t_function* tfunction, bool is_interface);
-  void generate_service_method_signature_normal(t_function* tfunction, bool is_interface);
-
-  bool type_can_be_null(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    if (ttype->is_container() || ttype->is_struct() || ttype->is_xception() || ttype->is_string()) {
-      return true;
-    }
-
-    if (ttype->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_STRING:
-        // case t_base_type::TYPE_I64:  - Int64 is not really nullable, even though it behaved that
-        // way before Haxe 3.2.0
-        return true;
-      default:
-        return false;
-      }
-    }
-
-    return false;
-  }
-
-  std::string constant_name(std::string name);
-
-private:
-  bool callbacks_;
-  bool rtti_;
-  string buildmacro_;
-
-  /**
-   * File streams
-   */
-
-  std::string package_name_;
-  std::ofstream f_service_;
-  std::string package_dir_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_haxe_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  package_name_ = program_->get_namespace("haxe");
-
-  // Haxe package names are lowercase
-  if (package_name_.length() > 0) {
-    package_name_[0] = tolower(package_name_[0]);
-    size_t index = package_name_.find('.');
-    while (index != std::string::npos) {
-      if (++index < package_name_.length()) {
-        package_name_[index] = tolower(package_name_[index]);
-      }
-      index = package_name_.find('.', index);
-    }
-  }
-
-  string dir = package_name_;
-  string subdir = get_out_dir();
-  string::size_type loc;
-  while ((loc = dir.find(".")) != string::npos) {
-    subdir = subdir + "/" + dir.substr(0, loc);
-    MKDIR(subdir.c_str());
-    dir = dir.substr(loc + 1);
-  }
-  if (dir.size() > 0) {
-    subdir = subdir + "/" + dir;
-    MKDIR(subdir.c_str());
-  }
-
-  package_dir_ = subdir;
-}
-
-/**
- * Packages the generated file
- *
- * @return String of the package, i.e. "package org.apache.thriftdemo;"
- */
-string t_haxe_generator::haxe_package() {
-  if (!package_name_.empty()) {
-    return string("package ") + package_name_;
-  }
-  return "package";
-}
-
-/**
- * Prints standard haxe imports
- *
- * @return List of imports for haxe types that are used in here
- */
-string t_haxe_generator::haxe_type_imports() {
-  return string() + "import org.apache.thrift.helper.*;\n" + "import haxe.io.Bytes;\n"
-         + "import haxe.ds.IntMap;\n" + "import haxe.ds.StringMap;\n"
-         + "import haxe.ds.ObjectMap;\n" + "\n" + "#if flash\n"
-         + "import flash.errors.ArgumentError;\n" + "#end\n" + "\n";
-}
-
-/**
- * Prints standard haxe imports
- *
- * @return List of imports necessary for thrift
- */
-string t_haxe_generator::haxe_thrift_imports() {
-  return string() + "import org.apache.thrift.*;\n" + "import org.apache.thrift.meta_data.*;\n"
-         + "import org.apache.thrift.protocol.*;\n" + "\n";
-}
-
-/**
- * Prints imports needed for a given type
- *
- * @return List of imports necessary for a given t_struct
- */
-string t_haxe_generator::haxe_thrift_gen_imports(t_struct* tstruct, string& imports) {
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  // For each type check if it is from a different namespace
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_program* program = (*m_iter)->get_type()->get_program();
-    if (program != NULL && program != program_) {
-      string package = program->get_namespace("haxe");
-      if (!package.empty()) {
-        if (imports.find(package + "." + (*m_iter)->get_type()->get_name()) == string::npos) {
-          imports.append("import " + package + "." + (*m_iter)->get_type()->get_name() + ";\n");
-        }
-      }
-    }
-  }
-  return imports;
-}
-
-/**
- * Prints imports needed for a given type
- *
- * @return List of imports necessary for a given t_service
- */
-string t_haxe_generator::haxe_thrift_gen_imports(t_service* tservice) {
-  string imports;
-  const vector<t_function*>& functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-
-  // For each type check if it is from a different namespace
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_program* program = (*f_iter)->get_returntype()->get_program();
-    if (program != NULL && program != program_) {
-      string package = program->get_namespace("haxe");
-      if (!package.empty()) {
-        if (imports.find(package + "." + (*f_iter)->get_returntype()->get_name()) == string::npos) {
-          imports.append("import " + package + "." + (*f_iter)->get_returntype()->get_name()
-                         + ";\n");
-        }
-      }
-    }
-
-    haxe_thrift_gen_imports((*f_iter)->get_arglist(), imports);
-    haxe_thrift_gen_imports((*f_iter)->get_xceptions(), imports);
-  }
-
-  return imports;
-}
-
-/**
- * Nothing in haxe
- */
-void t_haxe_generator::close_generator() {
-}
-
-/**
- * Generates a typedef. This is not done in haxe, since it does
- * not support arbitrary name replacements, and it'd be a wacky waste
- * of overhead to make wrapper classes.
- *
- * @param ttypedef The type definition
- */
-void t_haxe_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Enums are a class with a set of static constants.
- *
- * @param tenum The enumeration
- */
-void t_haxe_generator::generate_enum(t_enum* tenum) {
-  // Make output file
-  string f_enum_name = package_dir_ + "/" + get_cap_name(tenum->get_name()) + ".hx";
-  ofstream f_enum;
-  f_enum.open(f_enum_name.c_str());
-
-  // Comment and package it
-  f_enum << autogen_comment() << haxe_package() << ";" << endl << endl;
-
-  // Add haxe imports
-  f_enum << string() + "import org.apache.thrift.helper.*;" << endl << endl;
-
-  generate_rtti_decoration(f_enum);
-  generate_macro_decoration(f_enum);
-  indent(f_enum) << "class " << get_cap_name(tenum->get_name()) << " ";
-  scope_up(f_enum);
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_enum) << "public static inline var " << (*c_iter)->get_name() << " : Int = " << value
-                   << ";" << endl;
-  }
-
-  // Create a static Set with all valid values for this enum
-  f_enum << endl;
-
-  indent(f_enum) << "public static var VALID_VALUES = { new IntSet( [";
-  indent_up();
-  bool firstValue = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    // populate set
-    f_enum << (firstValue ? "" : ", ") << (*c_iter)->get_name();
-    firstValue = false;
-  }
-  indent_down();
-  f_enum << "]); };" << endl;
-
-  indent(f_enum) << "public static var VALUES_TO_NAMES = { [";
-  indent_up();
-  firstValue = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    f_enum << (firstValue ? "" : ",") << endl;
-    indent(f_enum) << (*c_iter)->get_name() << " => \"" << (*c_iter)->get_name() << "\"";
-    firstValue = false;
-  }
-  f_enum << endl;
-  indent_down();
-  indent(f_enum) << "]; };" << endl;
-
-  scope_down(f_enum); // end class
-
-  f_enum.close();
-}
-
-/**
- * Generates a class that holds all the constants.
- */
-void t_haxe_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-
-  string f_consts_name = package_dir_ + "/" + get_cap_name(program_name_) + "Constants.hx";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  // Print header
-  f_consts << autogen_comment() << haxe_package() << ";" << endl << endl;
-
-  f_consts << endl;
-
-  f_consts << haxe_type_imports();
-
-  generate_rtti_decoration(f_consts);
-  generate_macro_decoration(f_consts);
-  indent(f_consts) << "class " << get_cap_name(program_name_) << "Constants {" << endl << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    print_const_value(f_consts,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value(),
-                      false);
-  }
-  indent_down();
-  indent(f_consts) << "}" << endl;
-  f_consts.close();
-}
-
-void t_haxe_generator::print_const_value(std::ofstream& out,
-                                         string name,
-                                         t_type* type,
-                                         t_const_value* value,
-                                         bool in_static,
-                                         bool defval) {
-  type = get_true_type(type);
-
-  indent(out);
-  if (!defval) {
-    out << (in_static ? "var " : "public static inline var  ");
-  }
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = " << v2 << ";" << endl << endl;
-  } else if (type->is_enum()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = " << value->get_integer() << ";" << endl << endl;
-  } else if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    out << name << ":" << type_name(type) << " = new " << type_name(type, false, true) << "();"
-        << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function() : Void {" << endl;
-      indent_up();
-    }
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << ".";
-      out << v_iter->first->get_string() << " = " << val << ";" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_map()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function() : Void {" << endl;
-      indent_up();
-    }
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << "[" << key << "] = " << val << ";" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_list() || type->is_set()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function() : Void {" << endl;
-      indent_up();
-    }
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << "." << (type->is_list() ? "push" : "add") << "(" << val << ");"
-                  << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else {
-    throw "compiler error: no const of type " + type->get_name();
-  }
-}
-
-string t_haxe_generator::render_const_value(ofstream& out,
-                                            string name,
-                                            t_type* type,
-                                            t_const_value* value) {
-  (void)name;
-  type = get_true_type(type);
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-      render << "(byte)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I16:
-      render << "(short)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      render << value->get_integer() << "L";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << "(double)" << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << value->get_integer();
-  } else {
-    string t = tmp("tmp");
-    print_const_value(out, t, type, value, true);
-    render << t;
-  }
-
-  return render.str();
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is a class
- * with data members, read(), write(), and an inner Isset class.
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_struct(t_struct* tstruct) {
-  generate_haxe_struct(tstruct, false);
-}
-
-/**
- * Exceptions are structs, but they inherit from Exception
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_xception(t_struct* txception) {
-  generate_haxe_struct(txception, true);
-}
-
-/**
- * Haxe struct definition.
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_struct(t_struct* tstruct, bool is_exception, bool is_result) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + get_cap_name(tstruct->get_name()) + ".hx";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << haxe_package() << ";" << endl;
-
-  f_struct << endl;
-
-  string imports;
-
-  f_struct << haxe_type_imports() << haxe_thrift_imports()
-           << haxe_thrift_gen_imports(tstruct, imports) << endl;
-
-  generate_haxe_struct_definition(f_struct, tstruct, is_exception, is_result);
-
-  f_struct.close();
-}
-
-/**
- * haxe struct definition. This has various parameters, as it could be
- * generated standalone or inside another class as a helper. If it
- * is a helper than it is a static class.
- *
- * @param tstruct      The struct definition
- * @param is_exception Is this an exception?
- * @param in_class     If inside a class, needs to be static class
- * @param is_result    If this is a result it needs a different writer
- */
-void t_haxe_generator::generate_haxe_struct_definition(ofstream& out,
-                                                       t_struct* tstruct,
-                                                       bool is_exception,
-                                                       bool is_result) {
-  generate_haxe_doc(out, tstruct);
-
-  string clsname = get_cap_name(tstruct->get_name());
-
-  generate_rtti_decoration(out);
-  generate_macro_decoration(out);
-  indent(out) << "class " << clsname << " ";
-
-  if (is_exception) {
-    out << "extends TException ";
-  }
-  out << "implements TBase ";
-
-  scope_up(out);
-  indent(out) << endl;
-
-  indent(out) << "static var STRUCT_DESC = { new TStruct(\"" << tstruct->get_name() << "\"); };"
-              << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "static var " << constant_name((*m_iter)->get_name())
-                << "_FIELD_DESC = { new TField(\"" << (*m_iter)->get_name() << "\", "
-                << type_to_enum((*m_iter)->get_type()) << ", " << (*m_iter)->get_key() << "); };"
-                << endl;
-  }
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_haxe_doc(out, *m_iter);
-    // indent(out) << "private var _" << (*m_iter)->get_name() + " : " +
-    // type_name((*m_iter)->get_type()) << ";" << endl;
-    indent(out) << "@:isVar" << endl;
-    indent(out) << "public var "
-                << (*m_iter)->get_name() + "(get,set) : "
-                   + get_cap_name(type_name((*m_iter)->get_type())) << ";" << endl;
-  }
-
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "inline static var " << upcase_string((*m_iter)->get_name())
-                << "_FIELD_ID : Int = " << (*m_iter)->get_key() << ";" << endl;
-  }
-
-  out << endl;
-
-  // Inner Isset class
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (!type_can_be_null((*m_iter)->get_type())) {
-        indent(out) << "private var __isset_" << (*m_iter)->get_name() << " : Bool = false;"
-                    << endl;
-      }
-    }
-  }
-
-  out << endl;
-
-  // Static initializer to populate global class to struct metadata map
-  if (false) {
-    // TODO: reactivate when needed
-    generate_haxe_meta_data_map(out, tstruct);
-    indent(out) << "{" << endl;
-    indent_up();
-    indent(out) << "FieldMetaData.addStructMetaDataMap(" << type_name(tstruct) << ", metaDataMap);"
-                << endl;
-    indent_down();
-    indent(out) << "}" << endl;
-    indent(out) << "}" << endl;
-  }
-
-  // Default constructor
-  indent(out) << "public function new() {" << endl;
-  indent_up();
-  if (is_exception) {
-    indent(out) << "super();" << endl;
-  }
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if ((*m_iter)->get_value() != NULL) {
-      indent(out) << "this." << (*m_iter)->get_name() << " = "
-                  << (*m_iter)->get_value()->get_integer() << ";" << endl;
-    }
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  generate_property_getters_setters(out, tstruct);
-  generate_generic_field_getters_setters(out, tstruct);
-  generate_generic_isset_method(out, tstruct);
-
-  generate_haxe_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_haxe_struct_result_writer(out, tstruct);
-  } else {
-    generate_haxe_struct_writer(out, tstruct);
-  }
-  generate_haxe_struct_tostring(out, tstruct);
-  generate_haxe_validator(out, tstruct);
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generates a function to read all the fields of the struct.
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_struct_reader(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function read( iprot : TProtocol) : Void {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "iprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
-  scope_up(out);
-
-  // Declare stack tmp variables and read struct header
-  out << indent() << "var field : TField;" << endl << indent() << "iprot.readStructBegin();"
-      << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if (field.type == TType.STOP) { " << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Switch statement on the field we are reading
-  indent(out) << "switch (field.id)" << endl;
-
-  scope_up(out);
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << "_FIELD_ID:" << endl;
-    indent_up();
-    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    generate_deserialize_field(out, *f_iter, "this.");
-    generate_isset_set(out, *f_iter);
-    indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-        << endl << indent() << "}" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  out << indent() << "default:" << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-      << endl;
-
-  scope_down(out);
-
-  // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
-
-  scope_down(out);
-
-  out << indent() << "iprot.readStructEnd();" << endl << endl;
-
-  indent(out) << "iprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
-  scope_up(out);
-  indent(out) << "iprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
-  scope_down(out);
-
-  // check for required fields of primitive type
-  // (which can be checked here but not in the general validate method)
-  out << endl << indent() << "// check for required fields of primitive type, which can't be "
-                             "checked in the validate method" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
-      out << indent() << "if (!__isset_" << (*f_iter)->get_name() << ") {" << endl << indent()
-          << "  throw new TProtocolException(TProtocolException.UNKNOWN, \"Required field '"
-          << (*f_iter)->get_name()
-          << "' was not found in serialized data! Struct: \" + toString());" << endl << indent()
-          << "}" << endl;
-    }
-  }
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-// generates haxe method to perform various checks
-// (e.g. check that all required fields are set)
-void t_haxe_generator::generate_haxe_validator(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public function validate() : Void {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "// check for required fields" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      if (type_can_be_null((*f_iter)->get_type())) {
-        indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
-        indent(out)
-            << "  throw new TProtocolException(TProtocolException.UNKNOWN, \"Required field '"
-            << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << endl;
-        indent(out) << "}" << endl;
-      } else {
-        indent(out) << "// alas, we cannot check '" << (*f_iter)->get_name()
-                    << "' because it's a primitive." << endl;
-      }
-    }
-  }
-
-  // check that fields of type enum have valid values
-  out << indent() << "// check that fields of type enum have valid values" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = (*f_iter);
-    t_type* type = field->get_type();
-    // if field is an enum, check that its value is valid
-    if (type->is_enum()) {
-      indent(out) << "if (" << generate_isset_check(field) << " && !"
-                  << get_cap_name(get_enum_class_name(type)) << ".VALID_VALUES.contains("
-                  << field->get_name() << ")){" << endl;
-      indent_up();
-      indent(out) << "throw new TProtocolException(TProtocolException.UNKNOWN, \"The field '"
-                  << field->get_name() << "' has been assigned the invalid value \" + "
-                  << field->get_name() << ");" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_struct_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol) : Void {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
-  indent(out) << "oprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
-  scope_up(out);
-
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool null_allowed = type_can_be_null((*f_iter)->get_type());
-    if (null_allowed) {
-      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << endl;
-      indent_up();
-    }
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    if (null_allowed) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-  
-  indent(out) << "oprot.writeFieldStop();" << endl;
-  indent(out) << "oprot.writeStructEnd();" << endl;
-  
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
-  scope_up(out);
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
-  scope_down(out);
-  
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct,
- * which is a function result. These fields are only written
- * if they are set in the Isset array, and only one of them
- * can be set at a time.
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol) : Void {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "oprot.IncrementRecursionDepth();" << endl;
-  indent(out) << "try" << endl;
-  scope_up(out);
-  
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << endl << indent() << "if ";
-    } else {
-      out << " else if ";
-    }
-
-    out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
-
-    indent_up();
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}";
-  }
-  
-  indent(out) << endl;
-  indent(out) << "oprot.writeFieldStop();" << endl;
-  indent(out) << "oprot.writeStructEnd();" << endl;
-  
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-  indent(out) << "catch(e:Dynamic)" << endl;
-  scope_up(out);
-  indent(out) << "oprot.DecrementRecursionDepth();" << endl;
-  indent(out) << "throw e;" << endl;
-  scope_down(out);
-  
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-void t_haxe_generator::generate_reflection_getters(ostringstream& out,
-                                                   t_type* type,
-                                                   string field_name,
-                                                   string cap_name) {
-  (void)type;
-  (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << endl;
-  indent_up();
-  indent(out) << "return this." << field_name << ";" << endl;
-  indent_down();
-}
-
-void t_haxe_generator::generate_reflection_setters(ostringstream& out,
-                                                   t_type* type,
-                                                   string field_name,
-                                                   string cap_name) {
-  (void)type;
-  (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << "_FIELD_ID:" << endl;
-  indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  this." << field_name << " = value;" << endl;
-  indent(out) << "}" << endl << endl;
-
-  indent_down();
-}
-
-void t_haxe_generator::generate_generic_field_getters_setters(std::ofstream& out,
-                                                              t_struct* tstruct) {
-
-  std::ostringstream getter_stream;
-  std::ostringstream setter_stream;
-
-  // build up the bodies of both the getter and setter at once
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    indent_up();
-    generate_reflection_setters(setter_stream, type, field_name, cap_name);
-    generate_reflection_getters(getter_stream, type, field_name, cap_name);
-    indent_down();
-  }
-
-  // create the setter
-  indent(out) << "public function setFieldValue(fieldID : Int, value : Dynamic) : Void {" << endl;
-  indent_up();
-
-  if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
-    out << setter_stream.str();
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
-  } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  // create the getter
-  indent(out) << "public function getFieldValue(fieldID : Int) : Dynamic {" << endl;
-  indent_up();
-
-  if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
-    out << getter_stream.str();
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
-  } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-  }
-
-  indent_down();
-
-  indent(out) << "}" << endl << endl;
-}
-
-// Creates a generic isSet method that takes the field number as argument
-void t_haxe_generator::generate_generic_isset_method(std::ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // create the isSet method
-  indent(out) << "// Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise" << endl;
-  indent(out) << "public function isSet(fieldID : Int) : Bool {" << endl;
-  indent_up();
-  if (fields.size() > 0) {
-    indent(out) << "switch (fieldID) {" << endl;
-
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = *f_iter;
-      indent(out) << "case " << upcase_string(field->get_name()) << "_FIELD_ID:" << endl;
-      indent_up();
-      indent(out) << "return " << generate_isset_check(field) << ";" << endl;
-      indent_down();
-    }
-
-    indent(out) << "default:" << endl;
-    indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-    indent(out) << "}" << endl;
-  } else {
-    indent(out) << "throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a set of property setters/getters for the given struct.
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_property_getters_setters(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    // Simple getter
-    generate_haxe_doc(out, field);
-    indent(out) << "public function get_" << field_name << "() : " << get_cap_name(type_name(type))
-                << " {" << endl;
-    indent_up();
-    indent(out) << "return this." << field_name << ";" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Simple setter
-    generate_haxe_doc(out, field);
-    indent(out) << "public function set_" << field_name << "(" << field_name << ":"
-                << get_cap_name(type_name(type)) << ") : " << get_cap_name(type_name(type)) << " {"
-                << endl;
-    indent_up();
-    indent(out) << "this." << field_name << " = " << field_name << ";" << endl;
-    generate_isset_set(out, field);
-    indent(out) << "return this." << field_name << ";" << endl;
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Unsetter
-    indent(out) << "public function unset" << cap_name << "() : Void {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
-    } else {
-      indent(out) << "this.__isset_" << field_name << " = false;" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // isSet method
-    indent(out) << "// Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise" << endl;
-    indent(out) << "public function is" << get_cap_name("set") << cap_name << "() : Bool {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "return this." << field_name << " != null;" << endl;
-    } else {
-      indent(out) << "return this.__isset_" << field_name << ";" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a toString() method for the given struct
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_struct_tostring(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public "
-      << "function toString() : String {" << endl;
-  indent_up();
-
-  out << indent() << "var ret : String = \"" << tstruct->get_name() << "(\";" << endl;
-  out << indent() << "var first : Bool = true;" << endl << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
-    if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
-      indent_up();
-    }
-
-    t_field* field = (*f_iter);
-
-    if (!first) {
-      indent(out) << "if (!first) ret +=  \", \";" << endl;
-    }
-    indent(out) << "ret += \"" << (*f_iter)->get_name() << ":\";" << endl;
-    bool can_be_null = type_can_be_null(field->get_type());
-    if (can_be_null) {
-      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << endl;
-      indent(out) << "  ret += \"null\";" << endl;
-      indent(out) << "} else {" << endl;
-      indent_up();
-    }
-
-    if (field->get_type()->is_base_type() && ((t_base_type*)(field->get_type()))->is_binary()) {
-      indent(out) << "  ret += \"BINARY\";" << endl;
-    } else if (field->get_type()->is_enum()) {
-      indent(out) << "var " << field->get_name()
-                  << "_name : String = " << get_cap_name(get_enum_class_name(field->get_type()))
-                  << ".VALUES_TO_NAMES[this." << (*f_iter)->get_name() << "];" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += " << field->get_name() << "_name;" << endl;
-      indent(out) << "  ret += \" (\";" << endl;
-      indent(out) << "}" << endl;
-      indent(out) << "ret += this." << field->get_name() << ";" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += \")\";" << endl;
-      indent(out) << "}" << endl;
-    } else {
-      indent(out) << "ret += this." << (*f_iter)->get_name() << ";" << endl;
-    }
-
-    if (can_be_null) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    indent(out) << "first = false;" << endl;
-
-    if (could_be_unset) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    first = false;
-  }
-  out << indent() << "ret += \")\";" << endl << indent() << "return ret;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a static map with meta data to store information such as fieldID to
- * fieldName mapping
- *
- * @param tstruct The struct definition
- */
-void t_haxe_generator::generate_haxe_meta_data_map(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Static Map with fieldID -> FieldMetaData mappings
-  indent(out) << "inline static var metaDataMap : IntMap = new IntMap();" << endl;
-
-  if (fields.size() > 0) {
-    // Populate map
-    scope_up(out);
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = *f_iter;
-      std::string field_name = field->get_name();
-      indent(out) << "metaDataMap[" << upcase_string(field_name)
-                  << "_FIELD_ID] = new FieldMetaData(\"" << field_name << "\", ";
-
-      // Set field requirement type (required, optional, etc.)
-      if (field->get_req() == t_field::T_REQUIRED) {
-        out << "TFieldRequirementType.REQUIRED, ";
-      } else if (field->get_req() == t_field::T_OPTIONAL) {
-        out << "TFieldRequirementType.OPTIONAL, ";
-      } else {
-        out << "TFieldRequirementType.DEFAULT, ";
-      }
-
-      // Create value meta data
-      generate_field_value_meta_data(out, field->get_type());
-      out << ");" << endl;
-    }
-    scope_down(out);
-  }
-}
-
-/**
- * Returns a string with the haxe representation of the given thrift type
- * (e.g. for the type struct it returns "TType.STRUCT")
- */
-std::string t_haxe_generator::get_haxe_type_string(t_type* type) {
-  if (type->is_list()) {
-    return "TType.LIST";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_enum()) {
-    return "TType.I32";
-  } else if (type->is_typedef()) {
-    return get_haxe_type_string(((t_typedef*)type)->get_type());
-  } else if (type->is_base_type()) {
-    switch (((t_base_type*)type)->get_base()) {
-    case t_base_type::TYPE_VOID:
-      return "TType.VOID";
-      break;
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-      break;
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-      break;
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-      break;
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-      break;
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-      break;
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-      break;
-    default:
-      throw std::runtime_error("Unknown thrift type \"" + type->get_name()
-                               + "\" passed to t_haxe_generator::get_haxe_type_string!");
-      break; // This should never happen!
-    }
-  } else {
-    throw std::runtime_error(
-        "Unknown thrift type \"" + type->get_name()
-        + "\" passed to t_haxe_generator::get_haxe_type_string!"); // This should never happen!
-  }
-}
-
-void t_haxe_generator::generate_field_value_meta_data(std::ofstream& out, t_type* type) {
-  out << endl;
-  indent_up();
-  indent_up();
-  if (type->is_struct()) {
-    indent(out) << "new StructMetaData(TType.STRUCT, " << type_name(type);
-  } else if (type->is_container()) {
-    if (type->is_list()) {
-      indent(out) << "new ListMetaData(TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else if (type->is_set()) {
-      indent(out) << "new SetMetaData(TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else { // map
-      indent(out) << "new MapMetaData(TType.MAP, ";
-      t_type* key_type = ((t_map*)type)->get_key_type();
-      t_type* val_type = ((t_map*)type)->get_val_type();
-      generate_field_value_meta_data(out, key_type);
-      out << ", ";
-      generate_field_value_meta_data(out, val_type);
-    }
-  } else {
-    indent(out) << "new FieldValueMetaData(" << get_haxe_type_string(type);
-  }
-  out << ")";
-  indent_down();
-  indent_down();
-}
-
-/**
- * Generates a thrift service. In C++, this comprises an entirely separate
- * header and source file. The header file defines the methods and includes
- * the data types defined in the main header file, and the implementation
- * file contains implementations of the basic printer and default interfaces.
- *
- * @param tservice The service definition
- */
-void t_haxe_generator::generate_service(t_service* tservice) {
-  // Make interface file
-  string f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + ".hx";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl;
-
-  f_service_ << endl << haxe_type_imports() << haxe_thrift_imports()
-             << haxe_thrift_gen_imports(tservice);
-
-  if (tservice->get_extends() != NULL) {
-    t_type* parent = tservice->get_extends();
-    string parent_namespace = parent->get_program()->get_namespace("haxe");
-    if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << type_name(parent) << ";" << endl;
-    }
-  }
-
-  f_service_ << endl;
-
-  generate_service_interface(tservice);
-
-  f_service_.close();
-
-  // Now make the implementation/client file
-  f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + "Impl.hx";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl << endl << haxe_type_imports()
-             << haxe_thrift_imports() << haxe_thrift_gen_imports(tservice) << endl;
-
-  if (tservice->get_extends() != NULL) {
-    t_type* parent = tservice->get_extends();
-    string parent_namespace = parent->get_program()->get_namespace("haxe");
-    if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << type_name(parent) << "Impl;" << endl;
-    }
-  }
-
-  f_service_ << endl;
-
-  generate_service_client(tservice);
-
-  f_service_.close();
-
-  // Now make the helper class files
-  generate_service_helpers(tservice);
-
-  // Now make the processor/server file
-  f_service_name = package_dir_ + "/" + get_cap_name(service_name_) + "Processor.hx";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << haxe_package() << ";" << endl << endl << haxe_type_imports()
-             << haxe_thrift_imports() << haxe_thrift_gen_imports(tservice) << endl;
-
-  if (!package_name_.empty()) {
-    f_service_ << "import " << package_name_ << ".*;" << endl;
-    f_service_ << "import " << package_name_ << "." << get_cap_name(service_name_).c_str()
-               << "Impl;" << endl;
-    f_service_ << endl;
-  }
-
-  generate_service_server(tservice);
-
-  f_service_.close();
-}
-
-/**
- * Generates the code snippet for the onSuccess callbacks
- *
- * @param tfunction The service function to generate code for.
- */
-string t_haxe_generator::generate_service_method_onsuccess(t_function* tfunction,
-                                                           bool as_type,
-                                                           bool omit_name) {
-  if (tfunction->is_oneway()) {
-    return "";
-  }
-
-  string name = "";
-  if (!omit_name) {
-    name = "onSuccess";
-    if (as_type) {
-      name += " : ";
-    }
-  }
-
-  if (tfunction->get_returntype()->is_void()) {
-    if (as_type) {
-      return name + "Void->Void = null";
-    } else {
-      return name + "() : Void";
-    }
-  }
-
-  if (as_type) {
-    return name + type_name(tfunction->get_returntype()) + "->Void = null";
-  } else {
-    return name + "( retval : " + type_name(tfunction->get_returntype()) + ")";
-  }
-}
-
-/**
- * Generates a service method header
- *
- * @param tfunction The service function to generate code for.
- */
-void t_haxe_generator::generate_service_method_signature(t_function* tfunction, bool is_interface) {
-  if (callbacks_) {
-    generate_service_method_signature_callback(tfunction, is_interface);
-  } else {
-    generate_service_method_signature_normal(tfunction, is_interface);
-  }
-}
-
-/**
- * Generates a service method header in "normal" style
- *
- * @param tfunction The service function to generate code for.
- */
-void t_haxe_generator::generate_service_method_signature_normal(t_function* tfunction,
-                                                                bool is_interface) {
-  if (is_interface) {
-    indent(f_service_) << function_signature_normal(tfunction) << ";" << endl << endl;
-  } else {
-    indent(f_service_) << "public " << function_signature_normal(tfunction) << " {" << endl;
-  }
-}
-
-/**
- * Generates a service method header in "callback" style
- *
- * @param tfunction The service function to generate code for.
- */
-void t_haxe_generator::generate_service_method_signature_callback(t_function* tfunction,
-                                                                  bool is_interface) {
-  if (!tfunction->is_oneway()) {
-    std::string on_success_impl = generate_service_method_onsuccess(tfunction, false, false);
-    indent(f_service_) << "// function onError(Dynamic) : Void;" << endl;
-    indent(f_service_) << "// function " << on_success_impl.c_str() << ";" << endl;
-  }
-
-  if (is_interface) {
-    indent(f_service_) << function_signature_callback(tfunction) << ";" << endl << endl;
-  } else {
-    indent(f_service_) << "public " << function_signature_callback(tfunction) << " {" << endl;
-  }
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_haxe_generator::generate_service_interface(t_service* tservice) {
-  string extends_iface = "";
-  if (tservice->get_extends() != NULL) {
-    extends_iface = " extends " + tservice->get_extends()->get_name();
-  }
-
-  generate_haxe_doc(f_service_, tservice);
-  // generate_rtti_decoration(f_service_); - not yet, because of
-  // https://github.com/HaxeFoundation/haxe/issues/3626
-  generate_macro_decoration(f_service_);
-  f_service_ << indent() << "interface " << get_cap_name(service_name_) << extends_iface << " {"
-             << endl << endl;
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_haxe_doc(f_service_, *f_iter);
-    generate_service_method_signature(*f_iter, true);
-  }
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates structs for all the service args and return types
- *
- * @param tservice The service
- */
-void t_haxe_generator::generate_service_helpers(t_service* tservice) {
-  f_service_ << endl << endl;
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_haxe_struct(ts, false);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_haxe_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = get_cap_name(tservice->get_extends()->get_name());
-    extends_client = " extends " + extends + "Impl";
-  }
-
-  generate_rtti_decoration(f_service_);
-  // build macro is inherited from interface
-  indent(f_service_) << "class " << get_cap_name(service_name_) << "Impl" << extends_client
-                     << " implements " << get_cap_name(service_name_) << " {" << endl << endl;
-  indent_up();
-
-  indent(f_service_) << "public function new( iprot : TProtocol, oprot : TProtocol = null)" << endl;
-  scope_up(f_service_);
-  if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl;
-    f_service_ << indent() << "if (oprot == null) {" << endl;
-    indent_up();
-    f_service_ << indent() << "oprot_ = iprot;" << endl;
-    indent_down();
-    f_service_ << indent() << "} else {" << endl;
-    indent_up();
-    f_service_ << indent() << "oprot_ = oprot;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  } else {
-    f_service_ << indent() << "super(iprot, oprot);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "private var iprot_ : TProtocol;" << endl << indent()
-               << "private var oprot_ : TProtocol;" << endl << indent()
-               << "private var seqid_ : Int;" << endl << endl;
-
-    indent(f_service_) << "public function getInputProtocol() : TProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.iprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    indent(f_service_) << "public function getOutputProtocol() : TProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.oprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    generate_service_method_signature(*f_iter, false);
-
-    indent_up();
-
-    // Get the struct of function call params
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-
-    string argsname = get_cap_name((*f_iter)->get_name() + "_args");
-    vector<t_field*>::const_iterator fld_iter;
-    const vector<t_field*>& fields = arg_struct->get_members();
-
-    // Serialize the request
-    string calltype = (*f_iter)->is_oneway() ? "ONEWAY" : "CALL";
-    f_service_ << indent() << "oprot_.writeMessageBegin(new TMessage(\"" << funname
-               << "\", TMessageType." << calltype << ", seqid_));" << endl << indent()
-               << "var args : " << argsname << " = new " << argsname << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    f_service_ << indent() << "args.write(oprot_);" << endl << indent()
-               << "oprot_.writeMessageEnd();" << endl;
-
-    if (!((*f_iter)->is_oneway() || (*f_iter)->get_returntype()->is_void())) {
-      f_service_ << indent() << "var retval : " << type_name((*f_iter)->get_returntype()) << ";"
-                 << endl;
-    }
-
-    if ((*f_iter)->is_oneway()) {
-      f_service_ << indent() << "oprot_.getTransport().flush();" << endl;
-    } else {
-      indent(f_service_) << "oprot_.getTransport().flush(function(error:Dynamic) : Void {" << endl;
-      indent_up();
-      if (callbacks_) {
-        indent(f_service_) << "try {" << endl;
-        indent_up();
-      }
-      string resultname = get_cap_name((*f_iter)->get_name() + "_result");
-      indent(f_service_) << "if (error != null) {" << endl;
-      indent_up();
-      if (callbacks_) {
-        indent(f_service_) << "if (onError != null) onError(error);" << endl;
-        indent(f_service_) << "return;" << endl;
-      } else {
-        indent(f_service_) << "throw error;" << endl;
-      }
-      indent_down();
-      indent(f_service_) << "}" << endl;
-      indent(f_service_) << "var msg : TMessage = iprot_.readMessageBegin();" << endl;
-      indent(f_service_) << "if (msg.type == TMessageType.EXCEPTION) {" << endl;
-      indent_up();
-      indent(f_service_) << "var x = TApplicationException.read(iprot_);" << endl;
-      indent(f_service_) << "iprot_.readMessageEnd();" << endl;
-      if (callbacks_) {
-        indent(f_service_) << "if (onError != null) onError(x);" << endl;
-        indent(f_service_) << "return;" << endl;
-      } else {
-        indent(f_service_) << "throw x;" << endl;
-      }
-      indent_down();
-      indent(f_service_) << "}" << endl;
-      indent(f_service_) << "var result : " << resultname << " = new " << resultname << "();"
-                         << endl;
-      indent(f_service_) << "result.read(iprot_);" << endl;
-      indent(f_service_) << "iprot_.readMessageEnd();" << endl;
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "if (result." << generate_isset_check("success") << ") {" << endl;
-        indent_up();
-        if (callbacks_) {
-          indent(f_service_) << "if (onSuccess != null) onSuccess(result.success);" << endl;
-          indent(f_service_) << "return;" << endl;
-        } else {
-          indent(f_service_) << "retval = result.success;" << endl;
-          indent(f_service_) << "return;" << endl;
-        }
-        indent_down();
-        indent(f_service_) << "}" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        indent(f_service_) << "if (result." << (*x_iter)->get_name() << " != null) {" << endl;
-        indent_up();
-        if (callbacks_) {
-          indent(f_service_) << "if (onError != null) onError(result." << (*x_iter)->get_name()
-                             << ");" << endl;
-          indent(f_service_) << "return;" << endl;
-        } else {
-          indent(f_service_) << "throw result." << (*x_iter)->get_name() << ";" << endl;
-        }
-        indent_down();
-        indent(f_service_) << "}" << endl;
-      }
-
-      // If you get here it's an exception, unless a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        if (callbacks_) {
-          indent(f_service_) << "if (onSuccess != null) onSuccess();" << endl;
-        }
-        indent(f_service_) << "return;" << endl;
-      } else {
-        if (callbacks_) {
-          indent(f_service_) << "if (onError != null)" << endl;
-          indent_up();
-          indent(f_service_)
-              << "onError( new TApplicationException(TApplicationException.MISSING_RESULT," << endl;
-          indent(f_service_) << "                               \"" << (*f_iter)->get_name()
-                             << " failed: unknown result\"));" << endl;
-          indent_down();
-        } else {
-          indent(f_service_)
-              << "throw new TApplicationException(TApplicationException.MISSING_RESULT," << endl;
-          indent(f_service_) << "                            \"" << (*f_iter)->get_name()
-                             << " failed: unknown result\");" << endl;
-        }
-      }
-
-      if (callbacks_) {
-        indent_down();
-        indent(f_service_) << "} catch( e : TException) {" << endl;
-        indent_up();
-        indent(f_service_) << "if (onError != null) onError(e);" << endl;
-        indent_down();
-        indent(f_service_) << "}" << endl;
-      }
-
-      indent_down();
-      indent(f_service_) << "});" << endl;
-    }
-
-    if (!((*f_iter)->is_oneway() || (*f_iter)->get_returntype()->is_void())) {
-      f_service_ << indent() << "return retval;" << endl;
-    }
-
-    // Close function
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl;
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_haxe_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  // Extends stuff
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = get_cap_name(type_name(tservice->get_extends()));
-    extends_processor = " extends " + extends + "Processor";
-  }
-
-  // Generate the header portion
-  generate_rtti_decoration(f_service_);
-  generate_macro_decoration(f_service_);
-  indent(f_service_) << "class " << get_cap_name(service_name_) << "Processor" << extends_processor
-                     << " implements TProcessor {" << endl << endl;
-  indent_up();
-
-  f_service_ << indent() << "private var " << get_cap_name(service_name_)
-             << "_iface_ : " << get_cap_name(service_name_) << ";" << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent()
-               << "private var PROCESS_MAP = new StringMap< Int->TProtocol->TProtocol->Void >();"
-               << endl;
-  }
-
-  f_service_ << endl;
-
-  indent(f_service_) << "public function new( iface : " << get_cap_name(service_name_) << ")"
-                     << endl;
-  scope_up(f_service_);
-  if (!extends.empty()) {
-    f_service_ << indent() << "super(iface);" << endl;
-  }
-  f_service_ << indent() << get_cap_name(service_name_) << "_iface_ = iface;" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "PROCESS_MAP.set(\"" << (*f_iter)->get_name() << "\", "
-               << (*f_iter)->get_name() << "());" << endl;
-  }
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the server implementation
-  string override = "";
-  if (tservice->get_extends() != NULL) {
-    override = "override ";
-  }
-  indent(f_service_) << override
-                     << "public function process( iprot : TProtocol, oprot : TProtocol) : Bool"
-                     << endl;
-  scope_up(f_service_);
-
-  f_service_ << indent() << "var msg : TMessage = iprot.readMessageBegin();" << endl;
-
-  // TODO(mcslee): validate message, was the seqid etc. legit?
-  // AS- If all method is oneway:
-  // do you have an oprot?
-  // do you you need nullcheck?
-  f_service_
-      << indent() << "var fn  = PROCESS_MAP.get(msg.name);" << endl << indent()
-      << "if (fn == null) {" << endl << indent() << "  TProtocolUtil.skip(iprot, TType.STRUCT);"
-      << endl << indent() << "  iprot.readMessageEnd();" << endl << indent()
-      << "  var x = new TApplicationException(TApplicationException.UNKNOWN_METHOD, \"Invalid "
-         "method name: '\"+msg.name+\"'\");" << endl << indent()
-      << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));"
-      << endl << indent() << "  x.write(oprot);" << endl << indent() << "  oprot.writeMessageEnd();"
-      << endl << indent() << "  oprot.getTransport().flush();" << endl << indent()
-      << "  return true;" << endl << indent() << "}" << endl << indent()
-      << "fn( msg.seqid, iprot, oprot);" << endl;
-
-  f_service_ << indent() << "return true;" << endl;
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl << endl;
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_haxe_generator::generate_function_helpers(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return;
-  }
-
-  string resultname = get_cap_name(tfunction->get_name() + "_result");
-  t_struct result(program_, resultname);
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_haxe_struct(&result, false, true);
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_haxe_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open class
-  indent(f_service_) << "private function " << tfunction->get_name()
-                     << "() : Int->TProtocol->TProtocol->Void {" << endl;
-  indent_up();
-
-  // Open function
-  indent(f_service_) << "return function( seqid : Int, iprot : TProtocol, oprot : TProtocol) : Void"
-                     << endl;
-  scope_up(f_service_);
-
-  string argsname = get_cap_name(tfunction->get_name() + "_args");
-  string resultname = get_cap_name(tfunction->get_name() + "_result");
-
-  f_service_ << indent() << "var args : " << argsname << " = new " << argsname << "();" << endl
-             << indent() << "args.read(iprot);" << endl << indent() << "iprot.readMessageEnd();"
-             << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "var result : " << resultname << " = new " << resultname << "();"
-               << endl;
-  }
-
-  // Try block for any  function to catch (defined or undefined) exceptions
-  f_service_ << indent() << "try {" << endl;
-  indent_up();
-
-  if (callbacks_) {
-    // callback function style onError/onSuccess
-
-    // Generate the function call
-    t_struct* arg_struct = tfunction->get_arglist();
-    const std::vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    f_service_ << indent();
-    f_service_ << get_cap_name(service_name_) << "_iface_." << tfunction->get_name() << "(";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-
-    if (tfunction->is_oneway()) {
-      f_service_ << ");" << endl;
-    } else {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      string on_success = generate_service_method_onsuccess(tfunction, false, true);
-      indent_up();
-      f_service_ << endl;
-      indent(f_service_) << "null,  // errors are thrown by the handler" << endl;
-      if (tfunction->get_returntype()->is_void()) {
-        indent(f_service_) << "null); // no retval" << endl;
-      } else {
-        indent(f_service_) << "function" << on_success.c_str() << " {" << endl;
-        if (!tfunction->get_returntype()->is_void()) {
-          indent_up();
-          indent(f_service_) << "result.success = retval;" << endl;
-          indent_down();
-        }
-        indent(f_service_) << "});" << endl;
-      }
-      indent_down();
-    }
-
-  } else {
-    // normal function():result style
-
-    // Generate the function call
-    t_struct* arg_struct = tfunction->get_arglist();
-    const std::vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    f_service_ << indent();
-    if (!(tfunction->is_oneway() || tfunction->get_returntype()->is_void())) {
-      f_service_ << "result.success = ";
-    }
-    f_service_ << get_cap_name(service_name_) << "_iface_." << tfunction->get_name() << "(";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-    f_service_ << ");" << endl;
-  }
-
-  indent_down();
-  f_service_ << indent() << "}";
-  if (!tfunction->is_oneway()) {
-    // catch exceptions defined in the IDL
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << " catch (" << (*x_iter)->get_name() << ":"
-                 << get_cap_name(type_name((*x_iter)->get_type(), false, false)) << ") {" << endl;
-      if (!tfunction->is_oneway()) {
-        indent_up();
-        f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << ";" << endl;
-        indent_down();
-        f_service_ << indent() << "}";
-      } else {
-        f_service_ << "}";
-      }
-    }
-  }
-
-  // always catch all exceptions to prevent from service denial
-  f_service_ << " catch (th : Dynamic) {" << endl;
-  indent_up();
-  indent(f_service_) << "trace(\"Internal error processing " << tfunction->get_name() << "\", th);"
-                     << endl;
-  if (!tfunction->is_oneway()) {
-    indent(f_service_) << "var x = new TApplicationException(TApplicationException.INTERNAL_ERROR, "
-                          "\"Internal error processing " << tfunction->get_name() << "\");" << endl;
-    indent(f_service_) << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-                       << "\", TMessageType.EXCEPTION, seqid));" << endl;
-    indent(f_service_) << "x.write(oprot);" << endl;
-    indent(f_service_) << "oprot.writeMessageEnd();" << endl;
-    indent(f_service_) << "oprot.getTransport().flush();" << endl;
-  }
-  indent(f_service_) << "return;" << endl;
-  indent_down();
-  f_service_ << indent() << "}" << endl;
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    scope_down(f_service_);
-
-    // Close class
-    indent_down();
-    f_service_ << indent() << "}" << endl << endl;
-    return;
-  }
-
-  f_service_ << indent() << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.REPLY, seqid));" << endl << indent() << "result.write(oprot);"
-             << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-             << "oprot.getTransport().flush();" << endl;
-
-  // Close function
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Close class
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Deserializes a field of any type.
- *
- * @param tfield The field
- * @param prefix The variable name or container for this field
- */
-void t_haxe_generator::generate_deserialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    indent(out) << name << " = iprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "readBinary();";
-        } else {
-          out << "readString();";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool();";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte();";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16();";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32();";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64();";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble();";
-        break;
-      default:
-        throw "compiler error: no Haxe name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32();";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a struct, invokes read()
- */
-void t_haxe_generator::generate_deserialize_struct(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   string prefix) {
-  out << indent() << prefix << " = new " << get_cap_name(type_name(tstruct)) << "();" << endl
-      << indent() << prefix << ".read(iprot);" << endl;
-}
-
-/**
- * Deserializes a container by reading its size and then iterating
- */
-void t_haxe_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  string obj;
-
-  if (ttype->is_map()) {
-    obj = tmp("_map");
-  } else if (ttype->is_set()) {
-    obj = tmp("_set");
-  } else if (ttype->is_list()) {
-    obj = tmp("_list");
-  }
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    indent(out) << "var " << obj << " = iprot.readMapBegin();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "var " << obj << " = iprot.readSetBegin();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "var " << obj << " = iprot.readListBegin();" << endl;
-  }
-
-  indent(out) << prefix << " = new " << type_name(ttype, false, true)
-              // size the collection correctly
-              << "("
-              << ");" << endl;
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for( " << i << " in 0 ... " << obj << ".size)" << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_haxe_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("_key");
-  string val = tmp("_val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << prefix << ".set( " << key << ", " << val << ");" << endl;
-}
-
-/**
- * Deserializes a set element
- */
-void t_haxe_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
-}
-
-/**
- * Deserializes a list element
- */
-void t_haxe_generator::generate_deserialize_list_element(ofstream& out,
-                                                         t_list* tlist,
-                                                         string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_haxe_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + tfield->get_name());
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + tfield->get_name());
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = prefix + tfield->get_name();
-    indent(out) << "oprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "writeBinary(" << name << ");";
-        } else {
-          out << "writeString(" << name << ");";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ");";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ");";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ");";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ");";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ");";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ");";
-        break;
-      default:
-        throw "compiler error: no Haxe name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32(" << name << ");";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_haxe_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  out << indent() << prefix << ".write(oprot);" << endl;
-}
-
-/**
- * Serializes a container by writing its size then the elements.
- *
- * @param ttype  The type of container
- * @param prefix String prefix for fields
- */
-void t_haxe_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    string iter = tmp("_key");
-    string counter = tmp("_sizeCounter");
-    indent(out) << "var " << counter << " : Int = 0;" << endl;
-    indent(out) << "for( " << iter << " in " << prefix << ") {" << endl;
-    indent(out) << "  " << counter << +"++;" << endl;
-    indent(out) << "}" << endl;
-
-    indent(out) << "oprot.writeMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
-                << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << counter << "));"
-                << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".size));" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListBegin(new TList("
-                << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".length));"
-                << endl;
-  }
-
-  string iter = tmp("elem");
-  if (ttype->is_map()) {
-    indent(out) << "for( " << iter << " in " << prefix << ".keys())" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "for( " << iter << " in " << prefix << ".toArray())" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "for( " << iter << " in " << prefix << ")" << endl;
-  }
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_serialize_map_element(out, (t_map*)ttype, iter, prefix);
-  } else if (ttype->is_set()) {
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-  } else if (ttype->is_list()) {
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Serializes the members of a map.
- */
-void t_haxe_generator::generate_serialize_map_element(ofstream& out,
-                                                      t_map* tmap,
-                                                      string iter,
-                                                      string map) {
-  t_field kfield(tmap->get_key_type(), iter);
-  generate_serialize_field(out, &kfield, "");
-  t_field vfield(tmap->get_val_type(), map + ".get(" + iter 

<TRUNCATED>


[27/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_perl_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_perl_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_perl_generator.cc
deleted file mode 100644
index 5f52c24..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_perl_generator.cc
+++ /dev/null
@@ -1,1642 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <list>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_oop_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * PERL code generator.
- *
- */
-class t_perl_generator : public t_oop_generator {
-public:
-  t_perl_generator(t_program* program,
-                   const std::map<std::string, std::string>& parsed_options,
-                   const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-perl";
-    escape_['$'] = "\\$";
-    escape_['@'] = "\\@";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Structs!
-   */
-
-  void generate_perl_struct(t_struct* tstruct, bool is_exception);
-  void generate_perl_struct_definition(std::ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_xception = false);
-  void generate_perl_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_perl_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_perl_function_helpers(t_function* tfunction);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_rest(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_processor(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool inclass = false);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string perl_includes();
-  std::string declare_field(t_field* tfield, bool init = false, bool obj = false);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-
-  std::string autogen_comment() {
-    return std::string("#\n") + "# Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-           + "#\n" + "# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" + "#\n";
-  }
-
-  void perl_namespace_dirs(t_program* p, std::list<std::string>& dirs) {
-    std::string ns = p->get_namespace("perl");
-    std::string::size_type loc;
-
-    if (ns.size() > 0) {
-      while ((loc = ns.find(".")) != std::string::npos) {
-        dirs.push_back(ns.substr(0, loc));
-        ns = ns.substr(loc + 1);
-      }
-    }
-
-    if (ns.size() > 0) {
-      dirs.push_back(ns);
-    }
-  }
-
-  std::string perl_namespace(t_program* p) {
-    std::string ns = p->get_namespace("perl");
-    std::string result = "";
-    std::string::size_type loc;
-
-    if (ns.size() > 0) {
-      while ((loc = ns.find(".")) != std::string::npos) {
-        result += ns.substr(0, loc);
-        result += "::";
-        ns = ns.substr(loc + 1);
-      }
-
-      if (ns.size() > 0) {
-        result += ns + "::";
-      }
-    }
-
-    return result;
-  }
-
-  std::string get_namespace_out_dir() {
-    std::string outdir = get_out_dir();
-    std::list<std::string> dirs;
-    perl_namespace_dirs(program_, dirs);
-    std::list<std::string>::iterator it;
-    for (it = dirs.begin(); it != dirs.end(); it++) {
-      outdir += *it + "/";
-    }
-    return outdir;
-  }
-
-private:
-  /**
-   * File streams
-   */
-  std::ofstream f_types_;
-  std::ofstream f_consts_;
-  std::ofstream f_helpers_;
-  std::ofstream f_service_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_perl_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  string outdir = get_out_dir();
-  std::list<std::string> dirs;
-  perl_namespace_dirs(program_, dirs);
-  std::list<std::string>::iterator it;
-  for (it = dirs.begin(); it != dirs.end(); it++) {
-    outdir += *it + "/";
-    MKDIR(outdir.c_str());
-  }
-
-  // Make output file
-  string f_types_name = outdir + "Types.pm";
-  f_types_.open(f_types_name.c_str());
-  string f_consts_name = outdir + "Constants.pm";
-  f_consts_.open(f_consts_name.c_str());
-
-  // Print header
-  f_types_ << autogen_comment() << perl_includes();
-
-  // Print header
-  f_consts_ << autogen_comment() << "package " << perl_namespace(program_) << "Constants;" << endl
-            << perl_includes() << endl;
-}
-
-/**
- * Prints standard java imports
- */
-string t_perl_generator::perl_includes() {
-  string inc;
-
-  inc = "require 5.6.0;\n";
-  inc += "use strict;\n";
-  inc += "use warnings;\n";
-  inc += "use Thrift;\n\n";
-
-  return inc;
-}
-
-/**
- * Close up (or down) some filez.
- */
-void t_perl_generator::close_generator() {
-  // Close types file
-  f_types_ << "1;" << endl;
-  f_types_.close();
-
-  f_consts_ << "1;" << endl;
-  f_consts_.close();
-}
-
-/**
- * Generates a typedef. This is not done in PERL, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_perl_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Since define is expensive to lookup
- * in PERL, we use a global array for this.
- *
- * @param tenum The enumeration
- */
-void t_perl_generator::generate_enum(t_enum* tenum) {
-  f_types_ << "package " << perl_namespace(program_) << tenum->get_name() << ";" << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    f_types_ << "use constant " << (*c_iter)->get_name() << " => " << value << ";" << endl;
-  }
-}
-
-/**
- * Generate a constant value
- */
-void t_perl_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  f_consts_ << "use constant " << name << " => ";
-  f_consts_ << render_const_value(type, value);
-  f_consts_ << ";" << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_perl_generator::render_const_value(t_type* type, t_const_value* value) {
-  std::ostringstream out;
-
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "1" : "0");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    out << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "new " << perl_namespace(type->get_program()) << type->get_name() << "({" << endl;
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      out << render_const_value(g_type_string, v_iter->first);
-      out << " => ";
-      out << render_const_value(field_type, v_iter->second);
-      out << ",";
-      out << endl;
-    }
-
-    out << "})";
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
-
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << render_const_value(ktype, v_iter->first);
-      out << " => ";
-      out << render_const_value(vtype, v_iter->second);
-      out << "," << endl;
-    }
-
-    out << "}";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    out << "[" << endl;
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-
-      out << render_const_value(etype, *v_iter);
-      if (type->is_set()) {
-        out << " => 1";
-      }
-      out << "," << endl;
-    }
-    out << "]";
-  }
-  return out.str();
-}
-
-/**
- * Make a struct
- */
-void t_perl_generator::generate_struct(t_struct* tstruct) {
-  generate_perl_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_perl_generator::generate_xception(t_struct* txception) {
-  generate_perl_struct(txception, true);
-}
-
-/**
- * Structs can be normal or exceptions.
- */
-void t_perl_generator::generate_perl_struct(t_struct* tstruct, bool is_exception) {
-  generate_perl_struct_definition(f_types_, tstruct, is_exception);
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is nothing in PERL
- * where the objects are all just associative arrays (unless of course we
- * decide to start using objects for them...)
- *
- * @param tstruct The struct definition
- */
-void t_perl_generator::generate_perl_struct_definition(ofstream& out,
-                                                       t_struct* tstruct,
-                                                       bool is_exception) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  out << "package " << perl_namespace(tstruct->get_program()) << tstruct->get_name() << ";\n";
-  if (is_exception) {
-    out << "use base qw(Thrift::TException);\n";
-  }
-
-  // Create simple acessor methods
-  out << "use base qw(Class::Accessor);\n";
-
-  if (members.size() > 0) {
-    out << perl_namespace(tstruct->get_program()) << tstruct->get_name() << "->mk_accessors( qw( ";
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if (!t->is_xception()) {
-        out << (*m_iter)->get_name() << " ";
-      }
-    }
-
-    out << ") );\n";
-  }
-
-  out << endl;
-
-  // new()
-  indent_up();
-  out << "sub new {" << endl << indent() << "my $classname = shift;" << endl << indent()
-      << "my $self      = {};" << endl << indent() << "my $vals      = shift || {};" << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    string dval = "undef";
-    t_type* t = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL && !(t->is_struct() || t->is_xception())) {
-      dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
-    }
-    out << indent() << "$self->{" << (*m_iter)->get_name() << "} = " << dval << ";" << endl;
-  }
-
-  // Generate constructor from array
-  if (members.size() > 0) {
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if ((*m_iter)->get_value() != NULL && (t->is_struct() || t->is_xception())) {
-        indent(out) << "$self->{" << (*m_iter)->get_name()
-                    << "} = " << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
-      }
-    }
-
-    out << indent() << "if (UNIVERSAL::isa($vals,'HASH')) {" << endl;
-    indent_up();
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      out << indent() << "if (defined $vals->{" << (*m_iter)->get_name() << "}) {" << endl
-          << indent() << "  $self->{" << (*m_iter)->get_name() << "} = $vals->{"
-          << (*m_iter)->get_name() << "};" << endl << indent() << "}" << endl;
-    }
-    indent_down();
-    out << indent() << "}" << endl;
-  }
-
-  out << indent() << "return bless ($self, $classname);" << endl;
-  indent_down();
-  out << "}\n\n";
-
-  out << "sub getName {" << endl << indent() << "  return '" << tstruct->get_name() << "';" << endl
-      << indent() << "}" << endl << endl;
-
-  generate_perl_struct_reader(out, tstruct);
-  generate_perl_struct_writer(out, tstruct);
-}
-
-/**
- * Generates the read() method for a struct
- */
-void t_perl_generator::generate_perl_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << "sub read {" << endl;
-
-  indent_up();
-
-  out << indent() << "my ($self, $input) = @_;" << endl << indent() << "my $xfer  = 0;" << endl
-      << indent() << "my $fname;" << endl << indent() << "my $ftype = 0;" << endl << indent()
-      << "my $fid   = 0;" << endl;
-
-  indent(out) << "$xfer += $input->readStructBegin(\\$fname);" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (1) " << endl;
-
-  scope_up(out);
-
-  indent(out) << "$xfer += $input->readFieldBegin(\\$fname, \\$ftype, \\$fid);" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if ($ftype == TType::STOP) {" << endl;
-  indent_up();
-  indent(out) << "last;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Switch statement on the field we are reading
-  indent(out) << "SWITCH: for($fid)" << endl;
-
-  scope_up(out);
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-
-    indent(out) << "/^" << (*f_iter)->get_key() << "$/ && do{";
-    indent(out) << "if ($ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-
-    indent_up();
-    generate_deserialize_field(out, *f_iter, "self->");
-    indent_down();
-
-    indent(out) << "} else {" << endl;
-
-    indent(out) << "  $xfer += $input->skip($ftype);" << endl;
-
-    out << indent() << "}" << endl << indent() << "last; };" << endl;
-  }
-  // In the default case we skip the field
-
-  indent(out) << "  $xfer += $input->skip($ftype);" << endl;
-
-  scope_down(out);
-
-  indent(out) << "$xfer += $input->readFieldEnd();" << endl;
-
-  scope_down(out);
-
-  indent(out) << "$xfer += $input->readStructEnd();" << endl;
-
-  indent(out) << "return $xfer;" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates the write() method for a struct
- */
-void t_perl_generator::generate_perl_struct_writer(ofstream& out, t_struct* tstruct) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << "sub write {" << endl;
-
-  indent_up();
-  indent(out) << "my ($self, $output) = @_;" << endl;
-  indent(out) << "my $xfer   = 0;" << endl;
-
-  indent(out) << "$xfer += $output->writeStructBegin('" << name << "');" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if (defined $self->{" << (*f_iter)->get_name() << "}) {" << endl;
-    indent_up();
-
-    indent(out) << "$xfer += $output->writeFieldBegin("
-                << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ");" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "self->");
-
-    indent(out) << "$xfer += $output->writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}" << endl;
-  }
-
-  out << indent() << "$xfer += $output->writeFieldStop();" << endl << indent()
-      << "$xfer += $output->writeStructEnd();" << endl;
-
-  out << indent() << "return $xfer;" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_perl_generator::generate_service(t_service* tservice) {
-  string f_service_name = get_namespace_out_dir() + service_name_ + ".pm";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ <<
-      ///      "package "<<service_name_<<";"<<endl<<
-      autogen_comment() << perl_includes();
-
-  f_service_ << "use " << perl_namespace(tservice->get_program()) << "Types;" << endl;
-
-  t_service* extends_s = tservice->get_extends();
-  if (extends_s != NULL) {
-    f_service_ << "use " << perl_namespace(extends_s->get_program()) << extends_s->get_name() << ";"
-               << endl;
-  }
-
-  f_service_ << endl;
-
-  // Generate the three main parts of the service (well, two for now in PERL)
-  generate_service_helpers(tservice);
-  generate_service_interface(tservice);
-  generate_service_rest(tservice);
-  generate_service_client(tservice);
-  generate_service_processor(tservice);
-
-  // Close service file
-  f_service_ << "1;" << endl;
-  f_service_.close();
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_perl_generator::generate_service_processor(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-  t_service* extends_s = tservice->get_extends();
-  if (extends_s != NULL) {
-    extends = perl_namespace(extends_s->get_program()) + extends_s->get_name();
-    extends_processor = "use base qw(" + extends + "Processor);";
-  }
-
-  indent_up();
-
-  // Generate the header portion
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Processor;" << endl
-             << endl << "use strict;" << endl << extends_processor << endl << endl;
-
-  if (extends.empty()) {
-    f_service_ << "sub new {" << endl;
-
-    indent_up();
-
-    f_service_ << indent() << "my ($classname, $handler) = @_;" << endl << indent()
-               << "my $self      = {};" << endl;
-
-    f_service_ << indent() << "$self->{handler} = $handler;" << endl;
-
-    f_service_ << indent() << "return bless ($self, $classname);" << endl;
-
-    indent_down();
-
-    f_service_ << "}" << endl << endl;
-  }
-
-  // Generate the server implementation
-  f_service_ << "sub process {" << endl;
-  indent_up();
-
-  f_service_ << indent() << "my ($self, $input, $output) = @_;" << endl;
-
-  f_service_ << indent() << "my $rseqid = 0;" << endl << indent() << "my $fname  = undef;" << endl
-             << indent() << "my $mtype  = 0;" << endl << endl;
-
-  f_service_ << indent() << "$input->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);" << endl;
-
-  // HOT: check for method implementation
-  f_service_ << indent() << "my $methodname = 'process_'.$fname;" << endl << indent()
-             << "if (!$self->can($methodname)) {" << endl;
-  indent_up();
-
-  f_service_ << indent() << "$input->skip(TType::STRUCT);" << endl << indent()
-             << "$input->readMessageEnd();" << endl << indent()
-             << "my $x = new TApplicationException('Function '.$fname.' not implemented.', "
-                "TApplicationException::UNKNOWN_METHOD);" << endl << indent()
-             << "$output->writeMessageBegin($fname, TMessageType::EXCEPTION, $rseqid);" << endl
-             << indent() << "$x->write($output);" << endl << indent()
-             << "$output->writeMessageEnd();" << endl << indent()
-             << "$output->getTransport()->flush();" << endl << indent() << "return;" << endl;
-
-  indent_down();
-  f_service_ << indent() << "}" << endl << indent()
-             << "$self->$methodname($rseqid, $input, $output);" << endl << indent() << "return 1;"
-             << endl;
-
-  indent_down();
-
-  f_service_ << "}" << endl << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_perl_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  // Open function
-  f_service_ << "sub process_" << tfunction->get_name() << " {" << endl;
-
-  indent_up();
-
-  f_service_ << indent() << "my ($self, $seqid, $input, $output) = @_;" << endl;
-
-  string argsname = perl_namespace(tservice->get_program()) + service_name_ + "_"
-                    + tfunction->get_name() + "_args";
-  string resultname = perl_namespace(tservice->get_program()) + service_name_ + "_"
-                      + tfunction->get_name() + "_result";
-
-  f_service_ << indent() << "my $args = new " << argsname << "();" << endl << indent()
-             << "$args->read($input);" << endl;
-
-  f_service_ << indent() << "$input->readMessageEnd();" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "my $result = new " << resultname << "();" << endl;
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "eval {" << endl;
-    indent_up();
-  }
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_ << indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "$result->{success} = ";
-  }
-  f_service_ << "$self->{handler}->" << tfunction->get_name() << "(";
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_service_ << ", ";
-    }
-    f_service_ << "$args->" << (*f_iter)->get_name();
-  }
-  f_service_ << ");" << endl;
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    indent_down();
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << indent() << "}; if( UNIVERSAL::isa($@,'"
-                 << perl_namespace((*x_iter)->get_type()->get_program())
-                 << (*x_iter)->get_type()->get_name() << "') ){ " << endl;
-
-      indent_up();
-      f_service_ << indent() << "$result->{" << (*x_iter)->get_name() << "} = $@;" << endl;
-      f_service_ << indent() << "$@ = undef;" << endl;
-      indent_down();
-      f_service_ << indent();
-    }
-    f_service_ << "}" << endl;
-
-    // catch-all for unexpected exceptions (THRIFT-3191)
-    f_service_ << indent() << "if ($@) {" << endl;
-    indent_up();
-    f_service_ << indent() << "$@ =~ s/^\\s+|\\s+$//g;" << endl
-               << indent() << "my $err = new TApplicationException(\"Unexpected Exception: \" . $@, TApplicationException::INTERNAL_ERROR);" << endl
-               << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', TMessageType::EXCEPTION, $seqid);" << endl
-               << indent() << "$err->write($output);" << endl
-               << indent() << "$output->writeMessageEnd();" << endl
-               << indent() << "$output->getTransport()->flush();" << endl
-               << indent() << "$@ = undef;" << endl
-               << indent() << "return;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    indent_down();
-    f_service_ << "}" << endl;
-    return;
-  }
-
-  // Serialize the reply
-  f_service_ << indent() << "$output->writeMessageBegin('" << tfunction->get_name() << "', TMessageType::REPLY, $seqid);" << endl
-             << indent() << "$result->write($output);" << endl
-             << indent() << "$output->writeMessageEnd();" << endl
-             << indent() << "$output->getTransport()->flush();" << endl;
-
-  // Close function
-  indent_down();
-  f_service_ << "}" << endl << endl;
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_perl_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_ << "# HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    string name = ts->get_name();
-    ts->set_name(service_name_ + "_" + name);
-    generate_perl_struct_definition(f_service_, ts, false);
-    generate_perl_function_helpers(*f_iter);
-    ts->set_name(name);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_perl_generator::generate_perl_function_helpers(t_function* tfunction) {
-  t_struct result(program_, service_name_ + "_" + tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_perl_struct_definition(f_service_, &result, false);
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_perl_generator::generate_service_interface(t_service* tservice) {
-  string extends_if = "";
-  t_service* extends_s = tservice->get_extends();
-  if (extends_s != NULL) {
-    extends_if = "use base qw(" + perl_namespace(extends_s->get_program()) + extends_s->get_name()
-                 + "If);";
-  }
-
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "If;" << endl << endl
-             << "use strict;" << endl << extends_if << endl << endl;
-
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << "sub " << function_signature(*f_iter) << endl << "  die 'implement interface';\n}"
-               << endl << endl;
-  }
-  indent_down();
-}
-
-/**
- * Generates a REST interface
- */
-void t_perl_generator::generate_service_rest(t_service* tservice) {
-  string extends = "";
-  string extends_if = "";
-  t_service* extends_s = tservice->get_extends();
-  if (extends_s != NULL) {
-    extends = extends_s->get_name();
-    extends_if = "use base qw(" + perl_namespace(extends_s->get_program()) + extends_s->get_name()
-                 + "Rest);";
-  }
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Rest;" << endl << endl
-             << "use strict;" << endl << extends_if << endl << endl;
-
-  if (extends.empty()) {
-    f_service_ << "sub new {" << endl;
-
-    indent_up();
-
-    f_service_ << indent() << "my ($classname, $impl) = @_;" << endl << indent()
-               << "my $self     ={ impl => $impl };" << endl << endl << indent()
-               << "return bless($self,$classname);" << endl;
-
-    indent_down();
-
-    f_service_ << "}" << endl << endl;
-  }
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << "sub " << (*f_iter)->get_name() << "{" << endl;
-
-    indent_up();
-
-    f_service_ << indent() << "my ($self, $request) = @_;" << endl << endl;
-
-    const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
-      t_type* atype = get_true_type((*a_iter)->get_type());
-      string req = "$request->{'" + (*a_iter)->get_name() + "'}";
-      f_service_ << indent() << "my $" << (*a_iter)->get_name() << " = (" << req << ") ? " << req
-                 << " : undef;" << endl;
-      if (atype->is_string() && ((t_base_type*)atype)->is_string_list()) {
-        f_service_ << indent() << "my @" << (*a_iter)->get_name() << " = split(/,/, $"
-                   << (*a_iter)->get_name() << ");" << endl << indent() << "$"
-                   << (*a_iter)->get_name() << " = \\@" << (*a_iter)->get_name() << endl;
-      }
-    }
-    f_service_ << indent() << "return $self->{impl}->" << (*f_iter)->get_name() << "("
-               << argument_list((*f_iter)->get_arglist()) << ");" << endl;
-    indent_down();
-    indent(f_service_) << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_perl_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  t_service* extends_s = tservice->get_extends();
-  if (extends_s != NULL) {
-    extends = perl_namespace(extends_s->get_program()) + extends_s->get_name();
-    extends_client = "use base qw(" + extends + "Client);";
-  }
-
-  f_service_ << "package " << perl_namespace(program_) << service_name_ << "Client;" << endl << endl
-             << extends_client << endl << "use base qw(" << perl_namespace(program_)
-             << service_name_ << "If);" << endl;
-
-  // Constructor function
-  f_service_ << "sub new {" << endl;
-
-  indent_up();
-
-  f_service_ << indent() << "my ($classname, $input, $output) = @_;" << endl << indent()
-             << "my $self      = {};" << endl;
-
-  if (!extends.empty()) {
-    f_service_ << indent() << "$self = $classname->SUPER::new($input, $output);" << endl;
-  } else {
-    f_service_ << indent() << "$self->{input}  = $input;" << endl << indent()
-               << "$self->{output} = defined $output ? $output : $input;" << endl << indent()
-               << "$self->{seqid}  = 0;" << endl;
-  }
-
-  f_service_ << indent() << "return bless($self,$classname);" << endl;
-
-  indent_down();
-
-  f_service_ << "}" << endl << endl;
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    f_service_ << "sub " << function_signature(*f_iter) << endl;
-
-    indent_up();
-
-    indent(f_service_) << indent() << "$self->send_" << funname << "(";
-
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "$" << (*fld_iter)->get_name();
-    }
-    f_service_ << ");" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "$self->recv_" << funname << "();" << endl;
-    }
-
-    indent_down();
-
-    f_service_ << "}" << endl << endl;
-
-    f_service_ << "sub send_" << function_signature(*f_iter) << endl;
-
-    indent_up();
-
-    std::string argsname = perl_namespace(tservice->get_program()) + service_name_ + "_"
-                           + (*f_iter)->get_name() + "_args";
-
-    // Serialize the request header
-    f_service_ << indent() << "$self->{output}->writeMessageBegin('" << (*f_iter)->get_name()
-               << "', " << ((*f_iter)->is_oneway() ? "TMessageType::ONEWAY" : "TMessageType::CALL")
-               << ", $self->{seqid});" << endl;
-
-    f_service_ << indent() << "my $args = new " << argsname << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "$args->{" << (*fld_iter)->get_name() << "} = $"
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    // Write to the stream
-    f_service_ << indent() << "$args->write($self->{output});" << endl << indent()
-               << "$self->{output}->writeMessageEnd();" << endl << indent()
-               << "$self->{output}->getTransport()->flush();" << endl;
-
-    indent_down();
-
-    f_service_ << "}" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = perl_namespace(tservice->get_program()) + service_name_ + "_"
-                               + (*f_iter)->get_name() + "_result";
-      t_struct noargs(program_);
-
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs);
-      // Open function
-      f_service_ << endl << "sub " << function_signature(&recv_function) << endl;
-
-      indent_up();
-
-      f_service_ << indent() << "my $rseqid = 0;" << endl << indent() << "my $fname;" << endl
-                 << indent() << "my $mtype = 0;" << endl << endl;
-
-      f_service_ << indent() << "$self->{input}->readMessageBegin(\\$fname, \\$mtype, \\$rseqid);"
-                 << endl << indent() << "if ($mtype == TMessageType::EXCEPTION) {" << endl
-                 << indent() << "  my $x = new TApplicationException();" << endl << indent()
-                 << "  $x->read($self->{input});" << endl << indent()
-                 << "  $self->{input}->readMessageEnd();" << endl << indent() << "  die $x;" << endl
-                 << indent() << "}" << endl;
-
-      f_service_ << indent() << "my $result = new " << resultname << "();" << endl << indent()
-                 << "$result->read($self->{input});" << endl;
-
-      f_service_ << indent() << "$self->{input}->readMessageEnd();" << endl << endl;
-
-      // Careful, only return result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (defined $result->{success} ) {" << endl << indent()
-                   << "  return $result->{success};" << endl << indent() << "}" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (defined $result->{" << (*x_iter)->get_name() << "}) {"
-                   << endl << indent() << "  die $result->{" << (*x_iter)->get_name() << "};"
-                   << endl << indent() << "}" << endl;
-      }
-
-      // Careful, only return _result if not a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
-      } else {
-        f_service_ << indent() << "die \"" << (*f_iter)->get_name() << " failed: unknown result\";"
-                   << endl;
-      }
-
-      // Close function
-      indent_down();
-      f_service_ << "}" << endl;
-    }
-  }
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_perl_generator::generate_deserialize_field(ofstream& out,
-                                                  t_field* tfield,
-                                                  string prefix,
-                                                  bool inclass) {
-  (void)inclass;
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = tfield->get_name();
-
-  // Hack for when prefix is defined (always a hash ref)
-  if (!prefix.empty()) {
-    name = prefix + "{" + tfield->get_name() + "}";
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << "$xfer += $input->";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << "readString(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64(\\$" << name << ");";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble(\\$" << name << ");";
-        break;
-      default:
-        throw "compiler error: no PERL name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32(\\$" << name << ");";
-    }
-    out << endl;
-
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a variable. This makes two key assumptions,
- * first that there is a const char* variable named data that points to the
- * buffer for deserialization, and that there is a variable protocol which
- * is a reference to a TProtocol serialization object.
- */
-void t_perl_generator::generate_deserialize_struct(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   string prefix) {
-  out << indent() << "$" << prefix << " = new " << perl_namespace(tstruct->get_program())
-      << tstruct->get_name() << "();" << endl << indent() << "$xfer += $" << prefix
-      << "->read($input);" << endl;
-}
-
-void t_perl_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  out << indent() << "my $" << size << " = 0;" << endl;
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    out << indent() << "$" << prefix << " = {};" << endl << indent() << "my $" << ktype << " = 0;"
-        << endl << indent() << "my $" << vtype << " = 0;" << endl;
-
-    out << indent() << "$xfer += $input->readMapBegin("
-        << "\\$" << ktype << ", \\$" << vtype << ", \\$" << size << ");" << endl;
-
-  } else if (ttype->is_set()) {
-
-    out << indent() << "$" << prefix << " = {};" << endl << indent() << "my $" << etype << " = 0;"
-        << endl << indent() << "$xfer += $input->readSetBegin("
-        << "\\$" << etype << ", \\$" << size << ");" << endl;
-
-  } else if (ttype->is_list()) {
-
-    out << indent() << "$" << prefix << " = [];" << endl << indent() << "my $" << etype << " = 0;"
-        << endl << indent() << "$xfer += $input->readListBegin("
-        << "\\$" << etype << ", \\$" << size << ");" << endl;
-  }
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for (my $" << i << " = 0; $" << i << " < $" << size << "; ++$" << i << ")"
-              << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "$xfer += $input->readMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "$xfer += $input->readSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "$xfer += $input->readListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_perl_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("key");
-  string val = tmp("val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey, true, true) << endl;
-  indent(out) << declare_field(&fval, true, true) << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << "$" << prefix << "->{$" << key << "} = $" << val << ";" << endl;
-}
-
-void t_perl_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << "my $" << elem << " = undef;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << "$" << prefix << "->{$" << elem << "} = 1;" << endl;
-}
-
-void t_perl_generator::generate_deserialize_list_element(ofstream& out,
-                                                         t_list* tlist,
-                                                         string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << "my $" << elem << " = undef;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << "push(@{$" << prefix << "},$" << elem << ");" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_perl_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + "{" + tfield->get_name() + "}");
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + "{" + tfield->get_name() + "}");
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = tfield->get_name();
-
-    // Hack for when prefix is defined (always a hash ref)
-    if (!prefix.empty())
-      name = prefix + "{" + tfield->get_name() + "}";
-
-    indent(out) << "$xfer += $output->";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << "writeString($" << name << ");";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool($" << name << ");";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte($" << name << ");";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16($" << name << ");";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32($" << name << ");";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64($" << name << ");";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble($" << name << ");";
-        break;
-      default:
-        throw "compiler error: no PERL name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32($" << name << ");";
-    }
-    out << endl;
-
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_perl_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << "$xfer += $" << prefix << "->write($output);" << endl;
-}
-
-/**
- * Writes out a container
- */
-void t_perl_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "$xfer += $output->writeMapBegin("
-                << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "scalar(keys %{$" << prefix << "}));" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "$xfer += $output->writeSetBegin("
-                << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "scalar(@{$" << prefix << "}));" << endl;
-
-  } else if (ttype->is_list()) {
-
-    indent(out) << "$xfer += $output->writeListBegin("
-                << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", "
-                << "scalar(@{$" << prefix << "}));" << endl;
-  }
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    string kiter = tmp("kiter");
-    string viter = tmp("viter");
-    indent(out) << "while( my ($" << kiter << ",$" << viter << ") = each %{$" << prefix << "}) "
-                << endl;
-
-    scope_up(out);
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    scope_down(out);
-
-  } else if (ttype->is_set()) {
-    string iter = tmp("iter");
-    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "})" << endl;
-    scope_up(out);
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    scope_down(out);
-
-  } else if (ttype->is_list()) {
-    string iter = tmp("iter");
-    indent(out) << "foreach my $" << iter << " (@{$" << prefix << "}) " << endl;
-    scope_up(out);
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    scope_down(out);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "$xfer += $output->writeMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "$xfer += $output->writeSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "$xfer += $output->writeListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Serializes the members of a map.
- *
- */
-void t_perl_generator::generate_serialize_map_element(ofstream& out,
-                                                      t_map* tmap,
-                                                      string kiter,
-                                                      string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield);
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield);
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_perl_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_perl_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Declares a field, which may include initialization as necessary.
- *
- * @param ttype The type
- */
-string t_perl_generator::declare_field(t_field* tfield, bool init, bool obj) {
-  string result = "my $" + tfield->get_name();
-  if (init) {
-    t_type* type = get_true_type(tfield->get_type());
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        break;
-      case t_base_type::TYPE_STRING:
-        result += " = ''";
-        break;
-      case t_base_type::TYPE_BOOL:
-        result += " = 0";
-        break;
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-        result += " = 0";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        result += " = 0.0";
-        break;
-      default:
-        throw "compiler error: no PERL initializer for base type "
-            + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      result += " = 0";
-    } else if (type->is_container()) {
-      result += " = []";
-    } else if (type->is_struct() || type->is_xception()) {
-      if (obj) {
-        result += " = new " + perl_namespace(type->get_program()) + type->get_name() + "()";
-      } else {
-        result += " = undef";
-      }
-    }
-  }
-  return result + ";";
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_perl_generator::function_signature(t_function* tfunction, string prefix) {
-
-  string str;
-
-  str = prefix + tfunction->get_name() + "{\n";
-  str += "  my $self = shift;\n";
-
-  // Need to create perl function arg inputs
-  const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    str += "  my $" + (*f_iter)->get_name() + " = shift;\n";
-  }
-
-  return str;
-}
-
-/**
- * Renders a field list
- */
-string t_perl_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += "$" + (*f_iter)->get_name();
-  }
-  return result;
-}
-
-/**
- * Converts the parse type to a C++ enum string for the given type.
- */
-string t_perl_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType::STRING";
-    case t_base_type::TYPE_BOOL:
-      return "TType::BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "TType::BYTE";
-    case t_base_type::TYPE_I16:
-      return "TType::I16";
-    case t_base_type::TYPE_I32:
-      return "TType::I32";
-    case t_base_type::TYPE_I64:
-      return "TType::I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType::DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "TType::I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType::STRUCT";
-  } else if (type->is_map()) {
-    return "TType::MAP";
-  } else if (type->is_set()) {
-    return "TType::SET";
-  } else if (type->is_list()) {
-    return "TType::LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(perl, "Perl", "")


[41/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_csharp_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_csharp_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_csharp_generator.cc
deleted file mode 100644
index 6a21801..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_csharp_generator.cc
+++ /dev/null
@@ -1,2867 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <cassert>
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <cctype>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-class t_csharp_generator : public t_oop_generator {
-public:
-  t_csharp_generator(t_program* program,
-                     const std::map<std::string, std::string>& parsed_options,
-                     const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("async");
-    async_ = (iter != parsed_options.end());
-    iter = parsed_options.find("asyncctp");
-    async_ctp_ = (iter != parsed_options.end());
-    if (async_ && async_ctp_) {
-      throw "argument error: Cannot specify both async and asyncctp; they are incompatible.";
-    }
-
-    iter = parsed_options.find("nullable");
-    nullable_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("hashcode");
-    hashcode_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("union");
-    union_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("serial");
-    serialize_ = (iter != parsed_options.end());
-    if (serialize_) {
-      wcf_namespace_ = iter->second; // since there can be only one namespace
-    }
-
-    iter = parsed_options.find("wcf");
-    wcf_ = (iter != parsed_options.end());
-    if (wcf_) {
-      wcf_namespace_ = iter->second;
-    }
-
-    out_dir_base_ = "gen-csharp";
-  }
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_union(t_struct* tunion);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-  void generate_property(ofstream& out, t_field* tfield, bool isPublic, bool generateIsset);
-  void generate_csharp_property(ofstream& out,
-                                t_field* tfield,
-                                bool isPublic,
-                                bool includeIsset = true,
-                                std::string fieldPrefix = "");
-  bool print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool in_static,
-                         bool defval = false,
-                         bool needtype = false);
-  std::string render_const_value(std::ofstream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-  void print_const_constructor(std::ofstream& out, std::vector<t_const*> consts);
-  void print_const_def_value(std::ofstream& out,
-                             std::string name,
-                             t_type* type,
-                             t_const_value* value);
-
-  void generate_csharp_struct(t_struct* tstruct, bool is_exception);
-  void generate_csharp_union(t_struct* tunion);
-  void generate_csharp_struct_definition(std::ofstream& out,
-                                         t_struct* tstruct,
-                                         bool is_xception = false,
-                                         bool in_class = false,
-                                         bool is_result = false);
-  void generate_csharp_union_definition(std::ofstream& out, t_struct* tunion);
-  void generate_csharp_union_class(std::ofstream& out, t_struct* tunion, t_field* tfield);
-  void generate_csharp_wcffault(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_tostring(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_equals(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_struct_hashcode(std::ofstream& out, t_struct* tstruct);
-  void generate_csharp_union_reader(std::ofstream& out, t_struct* tunion);
-
-  void generate_function_helpers(t_function* tfunction);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* function);
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool is_propertyless = false);
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-  void generate_deserialize_list_element(std::ofstream& out, t_list* list, std::string prefix = "");
-  void generate_serialize_field(std::ofstream& out,
-                                t_field* tfield,
-                                std::string prefix = "",
-                                bool is_element = false,
-                                bool is_propertyless = false);
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map);
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_csharp_doc(std::ofstream& out, t_field* field);
-  void generate_csharp_doc(std::ofstream& out, t_doc* tdoc);
-  void generate_csharp_doc(std::ofstream& out, t_function* tdoc);
-  void generate_csharp_docstring_comment(std::ofstream& out, string contents);
-
-  void start_csharp_namespace(std::ofstream& out);
-  void end_csharp_namespace(std::ofstream& out);
-
-  std::string csharp_type_usings();
-  std::string csharp_thrift_usings();
-
-  std::string type_name(t_type* ttype,
-                        bool in_countainer = false,
-                        bool in_init = false,
-                        bool in_param = false,
-                        bool is_required = false);
-  std::string base_type_name(t_base_type* tbase,
-                             bool in_container = false,
-                             bool in_param = false,
-                             bool is_required = false);
-  std::string declare_field(t_field* tfield, bool init = false, std::string prefix = "");
-  std::string function_signature_async_begin(t_function* tfunction, std::string prefix = "");
-  std::string function_signature_async_end(t_function* tfunction, std::string prefix = "");
-  std::string function_signature_async(t_function* tfunction, std::string prefix = "");
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string prop_name(t_field* tfield, bool suppress_mapping = false);
-  std::string get_enum_class_name(t_type* type);
-
-  bool field_has_default(t_field* tfield) { return tfield->get_value() != NULL; }
-
-  bool field_is_required(t_field* tfield) { return tfield->get_req() == t_field::T_REQUIRED; }
-
-  bool type_can_be_null(t_type* ttype) {
-    while (ttype->is_typedef()) {
-      ttype = ((t_typedef*)ttype)->get_type();
-    }
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception()
-           || ttype->is_string();
-  }
-
-private:
-  std::string namespace_name_;
-  std::ofstream f_service_;
-  std::string namespace_dir_;
-  bool async_;
-  bool async_ctp_;
-  bool nullable_;
-  bool union_;
-  bool hashcode_;
-  bool serialize_;
-  bool wcf_;
-  std::string wcf_namespace_;
-
-  std::map<std::string, int> csharp_keywords;
-
-  void* member_mapping_scope;
-  std::map<std::string, std::string> member_name_mapping;
-
-  void init_keywords();
-  std::string normalize_name(std::string name);
-  std::string make_valid_csharp_identifier(std::string const& fromName);
-  void prepare_member_name_mapping(t_struct* tstruct);
-  void prepare_member_name_mapping(void* scope,
-                                   const vector<t_field*>& members,
-                                   const string& structname);
-  void cleanup_member_name_mapping(void* scope);
-  string get_mapped_member_name(string oldname);
-};
-
-void t_csharp_generator::init_generator() {
-  MKDIR(get_out_dir().c_str());
-  namespace_name_ = program_->get_namespace("csharp");
-
-  string dir = namespace_name_;
-  string subdir = get_out_dir().c_str();
-  string::size_type loc;
-
-  while ((loc = dir.find(".")) != string::npos) {
-    subdir = subdir + "/" + dir.substr(0, loc);
-    MKDIR(subdir.c_str());
-    dir = dir.substr(loc + 1);
-  }
-  if (dir.size() > 0) {
-    subdir = subdir + "/" + dir;
-    MKDIR(subdir.c_str());
-  }
-
-  namespace_dir_ = subdir;
-  init_keywords();
-  member_mapping_scope = NULL;
-
-  pverbose("C# options:\n");
-  pverbose("- async ...... %s\n", (async_ ? "ON" : "off"));
-  pverbose("- async_ctp .. %s\n", (async_ctp_ ? "ON" : "off"));
-  pverbose("- nullable ... %s\n", (nullable_ ? "ON" : "off"));
-  pverbose("- union ...... %s\n", (union_ ? "ON" : "off"));
-  pverbose("- hashcode ... %s\n", (hashcode_ ? "ON" : "off"));
-  pverbose("- serialize .. %s\n", (serialize_ ? "ON" : "off"));
-  pverbose("- wcf ........ %s\n", (wcf_ ? "ON" : "off"));
-}
-
-std::string t_csharp_generator::normalize_name(std::string name) {
-  string tmp(name);
-  std::transform(tmp.begin(), tmp.end(), tmp.begin(), static_cast<int (*)(int)>(std::tolower));
-
-  // un-conflict keywords by prefixing with "@"
-  if (csharp_keywords.find(tmp) != csharp_keywords.end()) {
-    return "@" + name;
-  }
-
-  // no changes necessary
-  return name;
-}
-
-void t_csharp_generator::init_keywords() {
-  csharp_keywords.clear();
-
-  // C# keywords
-  csharp_keywords["abstract"] = 1;
-  csharp_keywords["as"] = 1;
-  csharp_keywords["base"] = 1;
-  csharp_keywords["bool"] = 1;
-  csharp_keywords["break"] = 1;
-  csharp_keywords["byte"] = 1;
-  csharp_keywords["case"] = 1;
-  csharp_keywords["catch"] = 1;
-  csharp_keywords["char"] = 1;
-  csharp_keywords["checked"] = 1;
-  csharp_keywords["class"] = 1;
-  csharp_keywords["const"] = 1;
-  csharp_keywords["continue"] = 1;
-  csharp_keywords["decimal"] = 1;
-  csharp_keywords["default"] = 1;
-  csharp_keywords["delegate"] = 1;
-  csharp_keywords["do"] = 1;
-  csharp_keywords["double"] = 1;
-  csharp_keywords["else"] = 1;
-  csharp_keywords["enum"] = 1;
-  csharp_keywords["event"] = 1;
-  csharp_keywords["explicit"] = 1;
-  csharp_keywords["extern"] = 1;
-  csharp_keywords["false"] = 1;
-  csharp_keywords["finally"] = 1;
-  csharp_keywords["fixed"] = 1;
-  csharp_keywords["float"] = 1;
-  csharp_keywords["for"] = 1;
-  csharp_keywords["foreach"] = 1;
-  csharp_keywords["goto"] = 1;
-  csharp_keywords["if"] = 1;
-  csharp_keywords["implicit"] = 1;
-  csharp_keywords["in"] = 1;
-  csharp_keywords["int"] = 1;
-  csharp_keywords["interface"] = 1;
-  csharp_keywords["internal"] = 1;
-  csharp_keywords["is"] = 1;
-  csharp_keywords["lock"] = 1;
-  csharp_keywords["long"] = 1;
-  csharp_keywords["namespace"] = 1;
-  csharp_keywords["new"] = 1;
-  csharp_keywords["null"] = 1;
-  csharp_keywords["object"] = 1;
-  csharp_keywords["operator"] = 1;
-  csharp_keywords["out"] = 1;
-  csharp_keywords["override"] = 1;
-  csharp_keywords["params"] = 1;
-  csharp_keywords["private"] = 1;
-  csharp_keywords["protected"] = 1;
-  csharp_keywords["public"] = 1;
-  csharp_keywords["readonly"] = 1;
-  csharp_keywords["ref"] = 1;
-  csharp_keywords["return"] = 1;
-  csharp_keywords["sbyte"] = 1;
-  csharp_keywords["sealed"] = 1;
-  csharp_keywords["short"] = 1;
-  csharp_keywords["sizeof"] = 1;
-  csharp_keywords["stackalloc"] = 1;
-  csharp_keywords["static"] = 1;
-  csharp_keywords["string"] = 1;
-  csharp_keywords["struct"] = 1;
-  csharp_keywords["switch"] = 1;
-  csharp_keywords["this"] = 1;
-  csharp_keywords["throw"] = 1;
-  csharp_keywords["true"] = 1;
-  csharp_keywords["try"] = 1;
-  csharp_keywords["typeof"] = 1;
-  csharp_keywords["uint"] = 1;
-  csharp_keywords["ulong"] = 1;
-  csharp_keywords["unchecked"] = 1;
-  csharp_keywords["unsafe"] = 1;
-  csharp_keywords["ushort"] = 1;
-  csharp_keywords["using"] = 1;
-  csharp_keywords["virtual"] = 1;
-  csharp_keywords["void"] = 1;
-  csharp_keywords["volatile"] = 1;
-  csharp_keywords["while"] = 1;
-
-  // C# contextual keywords
-  csharp_keywords["add"] = 1;
-  csharp_keywords["alias"] = 1;
-  csharp_keywords["ascending"] = 1;
-  csharp_keywords["async"] = 1;
-  csharp_keywords["await"] = 1;
-  csharp_keywords["descending"] = 1;
-  csharp_keywords["dynamic"] = 1;
-  csharp_keywords["from"] = 1;
-  csharp_keywords["get"] = 1;
-  csharp_keywords["global"] = 1;
-  csharp_keywords["group"] = 1;
-  csharp_keywords["into"] = 1;
-  csharp_keywords["join"] = 1;
-  csharp_keywords["let"] = 1;
-  csharp_keywords["orderby"] = 1;
-  csharp_keywords["partial"] = 1;
-  csharp_keywords["remove"] = 1;
-  csharp_keywords["select"] = 1;
-  csharp_keywords["set"] = 1;
-  csharp_keywords["value"] = 1;
-  csharp_keywords["var"] = 1;
-  csharp_keywords["where"] = 1;
-  csharp_keywords["yield"] = 1;
-}
-
-void t_csharp_generator::start_csharp_namespace(ofstream& out) {
-  if (!namespace_name_.empty()) {
-    out << "namespace " << namespace_name_ << "\n";
-    scope_up(out);
-  }
-}
-
-void t_csharp_generator::end_csharp_namespace(ofstream& out) {
-  if (!namespace_name_.empty()) {
-    scope_down(out);
-  }
-}
-
-string t_csharp_generator::csharp_type_usings() {
-  return string() + "using System;\n" + "using System.Collections;\n"
-         + "using System.Collections.Generic;\n" + "using System.Text;\n" + "using System.IO;\n"
-         + ((async_ || async_ctp_) ? "using System.Threading.Tasks;\n" : "") + "using Thrift;\n"
-         + "using Thrift.Collections;\n" + ((serialize_ || wcf_) ? "#if !SILVERLIGHT\n" : "")
-         + ((serialize_ || wcf_) ? "using System.Xml.Serialization;\n" : "")
-         + ((serialize_ || wcf_) ? "#endif\n" : "") + (wcf_ ? "//using System.ServiceModel;\n" : "")
-         + "using System.Runtime.Serialization;\n";
-}
-
-string t_csharp_generator::csharp_thrift_usings() {
-  return string() + "using Thrift.Protocol;\n" + "using Thrift.Transport;\n";
-}
-
-void t_csharp_generator::close_generator() {
-}
-void t_csharp_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-void t_csharp_generator::generate_enum(t_enum* tenum) {
-  string f_enum_name = namespace_dir_ + "/" + (tenum->get_name()) + ".cs";
-  ofstream f_enum;
-  f_enum.open(f_enum_name.c_str());
-
-  f_enum << autogen_comment() << endl;
-
-  start_csharp_namespace(f_enum);
-
-  generate_csharp_doc(f_enum, tenum);
-
-  indent(f_enum) << "public enum " << tenum->get_name() << "\n";
-  scope_up(f_enum);
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    generate_csharp_doc(f_enum, *c_iter);
-
-    int value = (*c_iter)->get_value();
-    indent(f_enum) << (*c_iter)->get_name() << " = " << value << "," << endl;
-  }
-
-  scope_down(f_enum);
-
-  end_csharp_namespace(f_enum);
-
-  f_enum.close();
-}
-
-void t_csharp_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-  string f_consts_name = namespace_dir_ + '/' + program_name_ + ".Constants.cs";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  f_consts << autogen_comment() << csharp_type_usings() << endl;
-
-  start_csharp_namespace(f_consts);
-
-  indent(f_consts) << "public static class " << make_valid_csharp_identifier(program_name_)
-                   << "Constants" << endl;
-  scope_up(f_consts);
-
-  vector<t_const*>::iterator c_iter;
-  bool need_static_constructor = false;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    generate_csharp_doc(f_consts, (*c_iter));
-    if (print_const_value(f_consts,
-                          (*c_iter)->get_name(),
-                          (*c_iter)->get_type(),
-                          (*c_iter)->get_value(),
-                          false)) {
-      need_static_constructor = true;
-    }
-  }
-
-  if (need_static_constructor) {
-    print_const_constructor(f_consts, consts);
-  }
-
-  scope_down(f_consts);
-  end_csharp_namespace(f_consts);
-  f_consts.close();
-}
-
-void t_csharp_generator::print_const_def_value(std::ofstream& out,
-                                               string name,
-                                               t_type* type,
-                                               t_const_value* value) {
-  if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    prepare_member_name_mapping((t_struct*)type);
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_field* field = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field = (*f_iter);
-        }
-      }
-      if (field == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      t_type* field_type = field->get_type();
-      string val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << "." << prop_name(field) << " = " << val << ";" << endl;
-    }
-    cleanup_member_name_mapping((t_struct*)type);
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << "[" << key << "]"
-                  << " = " << val << ";" << endl;
-    }
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << ".Add(" << val << ");" << endl;
-    }
-  }
-}
-
-void t_csharp_generator::print_const_constructor(std::ofstream& out, std::vector<t_const*> consts) {
-  indent(out) << "static " << make_valid_csharp_identifier(program_name_).c_str() << "Constants()"
-              << endl;
-  scope_up(out);
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    t_type* type = (*c_iter)->get_type();
-    t_const_value* value = (*c_iter)->get_value();
-
-    print_const_def_value(out, name, type, value);
-  }
-  scope_down(out);
-}
-
-// it seems like all that methods that call this are using in_static to be the opposite of what it
-// would imply
-bool t_csharp_generator::print_const_value(std::ofstream& out,
-                                           string name,
-                                           t_type* type,
-                                           t_const_value* value,
-                                           bool in_static,
-                                           bool defval,
-                                           bool needtype) {
-  indent(out);
-  bool need_static_construction = !in_static;
-  while (type->is_typedef()) {
-    type = ((t_typedef*)type)->get_type();
-  }
-
-  if (!defval || needtype) {
-    out << (in_static ? "" : type->is_base_type() ? "public const " : "public static ")
-        << type_name(type) << " ";
-  }
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
-    out << name << " = " << v2 << ";" << endl;
-    need_static_construction = false;
-  } else if (type->is_enum()) {
-    out << name << " = " << type_name(type, false, true) << "." << value->get_identifier_name()
-        << ";" << endl;
-    need_static_construction = false;
-  } else if (type->is_struct() || type->is_xception()) {
-    out << name << " = new " << type_name(type) << "();" << endl;
-  } else if (type->is_map()) {
-    out << name << " = new " << type_name(type, true, true) << "();" << endl;
-  } else if (type->is_list() || type->is_set()) {
-    out << name << " = new " << type_name(type) << "();" << endl;
-  }
-
-  if (defval && !type->is_base_type() && !type->is_enum()) {
-    print_const_def_value(out, name, type, value);
-  }
-
-  return need_static_construction;
-}
-
-std::string t_csharp_generator::render_const_value(ofstream& out,
-                                                   string name,
-                                                   t_type* type,
-                                                   t_const_value* value) {
-  (void)name;
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << type->get_name() << "." << value->get_identifier_name();
-  } else {
-    string t = tmp("tmp");
-    print_const_value(out, t, type, value, true, true, true);
-    render << t;
-  }
-
-  return render.str();
-}
-
-void t_csharp_generator::generate_struct(t_struct* tstruct) {
-  if (union_ && tstruct->is_union()) {
-    generate_csharp_union(tstruct);
-  } else {
-    generate_csharp_struct(tstruct, false);
-  }
-}
-
-void t_csharp_generator::generate_xception(t_struct* txception) {
-  generate_csharp_struct(txception, true);
-}
-
-void t_csharp_generator::generate_csharp_struct(t_struct* tstruct, bool is_exception) {
-  string f_struct_name = namespace_dir_ + "/" + (tstruct->get_name()) + ".cs";
-  ofstream f_struct;
-
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << csharp_type_usings() << csharp_thrift_usings() << endl;
-
-  generate_csharp_struct_definition(f_struct, tstruct, is_exception);
-
-  f_struct.close();
-}
-
-void t_csharp_generator::generate_csharp_struct_definition(ofstream& out,
-                                                           t_struct* tstruct,
-                                                           bool is_exception,
-                                                           bool in_class,
-                                                           bool is_result) {
-
-  if (!in_class) {
-    start_csharp_namespace(out);
-  }
-
-  out << endl;
-
-  generate_csharp_doc(out, tstruct);
-  prepare_member_name_mapping(tstruct);
-
-  indent(out) << "#if !SILVERLIGHT" << endl;
-  indent(out) << "[Serializable]" << endl;
-  indent(out) << "#endif" << endl;
-  if ((serialize_ || wcf_) && !is_exception) {
-    indent(out) << "[DataContract(Namespace=\"" << wcf_namespace_ << "\")]"
-                << endl; // do not make exception classes directly WCF serializable, we provide a
-                         // separate "fault" for that
-  }
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  indent(out) << "public " << (is_final ? "sealed " : "") << "partial class "
-              << normalize_name(tstruct->get_name()) << " : ";
-
-  if (is_exception) {
-    out << "TException, ";
-  }
-  out << "TBase";
-
-  out << endl;
-
-  scope_up(out);
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  // make private members with public Properties
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    // if the field is requied, then we use auto-properties
-    if (!field_is_required((*m_iter)) && (!nullable_ || field_has_default((*m_iter)))) {
-      indent(out) << "private " << declare_field(*m_iter, false, "_") << endl;
-    }
-  }
-  out << endl;
-
-  bool has_non_required_fields = false;
-  bool has_non_required_default_value_fields = false;
-  bool has_required_fields = false;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_csharp_doc(out, *m_iter);
-    generate_property(out, *m_iter, true, true);
-    bool is_required = field_is_required((*m_iter));
-    bool has_default = field_has_default((*m_iter));
-    if (is_required) {
-      has_required_fields = true;
-    } else {
-      if (has_default) {
-        has_non_required_default_value_fields = true;
-      }
-      has_non_required_fields = true;
-    }
-  }
-
-  bool generate_isset = (nullable_ && has_non_required_default_value_fields)
-                        || (!nullable_ && has_non_required_fields);
-  if (generate_isset) {
-    out << endl;
-    if (serialize_ || wcf_) {
-      out << indent() << "[XmlIgnore] // XmlSerializer" << endl << indent()
-          << "[DataMember(Order = 1)]  // XmlObjectSerializer, DataContractJsonSerializer, etc."
-          << endl;
-    }
-    out << indent() << "public Isset __isset;" << endl << indent() << "#if !SILVERLIGHT" << endl
-        << indent() << "[Serializable]" << endl << indent() << "#endif" << endl;
-    if (serialize_ || wcf_) {
-      indent(out) << "[DataContract]" << endl;
-    }
-    indent(out) << "public struct Isset {" << endl;
-    indent_up();
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      bool is_required = field_is_required((*m_iter));
-      bool has_default = field_has_default((*m_iter));
-      // if it is required, don't need Isset for that variable
-      // if it is not required, if it has a default value, we need to generate Isset
-      // if we are not nullable, then we generate Isset
-      if (!is_required && (!nullable_ || has_default)) {
-        if (serialize_ || wcf_) {
-          indent(out) << "[DataMember]" << endl;
-        }
-        indent(out) << "public bool " << normalize_name((*m_iter)->get_name()) << ";" << endl;
-      }
-    }
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    if (generate_isset && (serialize_ || wcf_)) {
-      indent(out) << "#region XmlSerializer support" << endl << endl;
-
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        bool is_required = field_is_required((*m_iter));
-        bool has_default = field_has_default((*m_iter));
-        // if it is required, don't need Isset for that variable
-        // if it is not required, if it has a default value, we need to generate Isset
-        // if we are not nullable, then we generate Isset
-        if (!is_required && (!nullable_ || has_default)) {
-          indent(out) << "public bool ShouldSerialize" << prop_name((*m_iter)) << "()" << endl;
-          indent(out) << "{" << endl;
-          indent_up();
-          indent(out) << "return __isset." << normalize_name((*m_iter)->get_name()) << ";" << endl;
-          indent_down();
-          indent(out) << "}" << endl << endl;
-        }
-      }
-
-      indent(out) << "#endregion XmlSerializer support" << endl << endl;
-    }
-  }
-
-  // We always want a default, no argument constructor for Reading
-  indent(out) << "public " << normalize_name(tstruct->get_name()) << "() {" << endl;
-  indent_up();
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = (*m_iter)->get_type();
-    while (t->is_typedef()) {
-      t = ((t_typedef*)t)->get_type();
-    }
-    if ((*m_iter)->get_value() != NULL) {
-      if (field_is_required((*m_iter))) {
-        print_const_value(out, "this." + prop_name(*m_iter), t, (*m_iter)->get_value(), true, true);
-      } else {
-        print_const_value(out,
-                          "this._" + (*m_iter)->get_name(),
-                          t,
-                          (*m_iter)->get_value(),
-                          true,
-                          true);
-        // Optionals with defaults are marked set
-        indent(out) << "this.__isset." << normalize_name((*m_iter)->get_name()) << " = true;"
-                    << endl;
-      }
-    }
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  if (has_required_fields) {
-    indent(out) << "public " << tstruct->get_name() << "(";
-    bool first = true;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (field_is_required((*m_iter))) {
-        if (first) {
-          first = false;
-        } else {
-          out << ", ";
-        }
-        out << type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name();
-      }
-    }
-    out << ") : this() {" << endl;
-    indent_up();
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (field_is_required((*m_iter))) {
-        indent(out) << "this." << prop_name((*m_iter)) << " = " << (*m_iter)->get_name() << ";"
-                    << endl;
-      }
-    }
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-
-  generate_csharp_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_csharp_struct_result_writer(out, tstruct);
-  } else {
-    generate_csharp_struct_writer(out, tstruct);
-  }
-  if (hashcode_) {
-    generate_csharp_struct_equals(out, tstruct);
-    generate_csharp_struct_hashcode(out, tstruct);
-  }
-  generate_csharp_struct_tostring(out, tstruct);
-  scope_down(out);
-  out << endl;
-
-  // generate a corresponding WCF fault to wrap the exception
-  if ((serialize_ || wcf_) && is_exception) {
-    generate_csharp_wcffault(out, tstruct);
-  }
-
-  cleanup_member_name_mapping(tstruct);
-  if (!in_class) {
-    end_csharp_namespace(out);
-  }
-}
-
-void t_csharp_generator::generate_csharp_wcffault(ofstream& out, t_struct* tstruct) {
-  out << endl;
-  indent(out) << "#if !SILVERLIGHT" << endl;
-  indent(out) << "[Serializable]" << endl;
-  indent(out) << "#endif" << endl;
-  indent(out) << "[DataContract]" << endl;
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  indent(out) << "public " << (is_final ? "sealed " : "") << "partial class " << tstruct->get_name()
-              << "Fault" << endl;
-
-  scope_up(out);
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  // make private members with public Properties
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "private " << declare_field(*m_iter, false, "_") << endl;
-  }
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_property(out, *m_iter, true, false);
-  }
-
-  scope_down(out);
-  out << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_reader(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public void Read (TProtocol iprot)" << endl;
-  scope_up(out);
-
-  out << indent() << "iprot.IncrementRecursionDepth();" << endl;
-  out << indent() << "try" << endl;
-  scope_up(out);
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Required variables aren't in __isset, so we need tmp vars to check them
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (field_is_required((*f_iter))) {
-      indent(out) << "bool isset_" << (*f_iter)->get_name() << " = false;" << endl;
-    }
-  }
-
-  indent(out) << "TField field;" << endl << indent() << "iprot.ReadStructBegin();" << endl;
-
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  indent(out) << "field = iprot.ReadFieldBegin();" << endl;
-
-  indent(out) << "if (field.Type == TType.Stop) { " << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent(out) << "switch (field.ID)" << endl;
-
-  scope_up(out);
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool is_required = field_is_required((*f_iter));
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-    indent_up();
-    indent(out) << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    generate_deserialize_field(out, *f_iter);
-    if (is_required) {
-      indent(out) << "isset_" << (*f_iter)->get_name() << " = true;" << endl;
-    }
-
-    indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.Skip(iprot, field.Type);"
-        << endl << indent() << "}" << endl << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default: " << endl;
-  indent_up();
-  indent(out) << "TProtocolUtil.Skip(iprot, field.Type);" << endl;
-  indent(out) << "break;" << endl;
-  indent_down();
-
-  scope_down(out);
-
-  indent(out) << "iprot.ReadFieldEnd();" << endl;
-
-  scope_down(out);
-
-  indent(out) << "iprot.ReadStructEnd();" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (field_is_required((*f_iter))) {
-      indent(out) << "if (!isset_" << (*f_iter)->get_name() << ")" << endl;
-      indent_up();
-      indent(out) << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << endl;
-      indent_down();
-    }
-  }
-
-  scope_down(out);
-  out << indent() << "finally" << endl;
-  scope_up(out);
-  out << indent() << "iprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-
-  indent_down();
-
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public void Write(TProtocol oprot) {" << endl;
-  indent_up();
-  
-  out << indent() << "oprot.IncrementRecursionDepth();" << endl;
-  out << indent() << "try" << endl;
-  scope_up(out);
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "TStruct struc = new TStruct(\"" << name << "\");" << endl;
-  indent(out) << "oprot.WriteStructBegin(struc);" << endl;
-
-  if (fields.size() > 0) {
-    indent(out) << "TField field = new TField();" << endl;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      bool is_required = field_is_required((*f_iter));
-      bool has_default = field_has_default((*f_iter));
-      if (nullable_ && !has_default && !is_required) {
-        indent(out) << "if (" << prop_name((*f_iter)) << " != null) {" << endl;
-        indent_up();
-      } else if (!is_required) {
-        bool null_allowed = type_can_be_null((*f_iter)->get_type());
-        if (null_allowed) {
-          indent(out) << "if (" << prop_name((*f_iter)) << " != null && __isset."
-                      << normalize_name((*f_iter)->get_name()) << ") {" << endl;
-          indent_up();
-        } else {
-          indent(out) << "if (__isset." << normalize_name((*f_iter)->get_name()) << ") {" << endl;
-          indent_up();
-        }
-      }
-      indent(out) << "field.Name = \"" << (*f_iter)->get_name() << "\";" << endl;
-      indent(out) << "field.Type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl;
-      indent(out) << "field.ID = " << (*f_iter)->get_key() << ";" << endl;
-      indent(out) << "oprot.WriteFieldBegin(field);" << endl;
-
-      generate_serialize_field(out, *f_iter);
-
-      indent(out) << "oprot.WriteFieldEnd();" << endl;
-      if (!is_required) {
-        indent_down();
-        indent(out) << "}" << endl;
-      }
-    }
-  }
-
-  indent(out) << "oprot.WriteFieldStop();" << endl;
-  indent(out) << "oprot.WriteStructEnd();" << endl;
-
-  scope_down(out);
-  out << indent() << "finally" << endl;
-  scope_up(out);
-  out << indent() << "oprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-
-  indent_down();
-  
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public void Write(TProtocol oprot) {" << endl;
-  indent_up();
-
-  out << indent() << "oprot.IncrementRecursionDepth();" << endl;
-  out << indent() << "try" << endl;
-  scope_up(out);
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "TStruct struc = new TStruct(\"" << name << "\");" << endl;
-  indent(out) << "oprot.WriteStructBegin(struc);" << endl;
-
-  if (fields.size() > 0) {
-    indent(out) << "TField field = new TField();" << endl;
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-        out << endl << indent() << "if ";
-      } else {
-        out << " else if ";
-      }
-
-      if (nullable_) {
-        out << "(this." << prop_name((*f_iter)) << " != null) {" << endl;
-      } else {
-        out << "(this.__isset." << normalize_name((*f_iter)->get_name()) << ") {" << endl;
-      }
-      indent_up();
-
-      bool null_allowed = !nullable_ && type_can_be_null((*f_iter)->get_type());
-      if (null_allowed) {
-        indent(out) << "if (" << prop_name(*f_iter) << " != null) {" << endl;
-        indent_up();
-      }
-
-      indent(out) << "field.Name = \"" << prop_name(*f_iter) << "\";" << endl;
-      indent(out) << "field.Type = " << type_to_enum((*f_iter)->get_type()) << ";" << endl;
-      indent(out) << "field.ID = " << (*f_iter)->get_key() << ";" << endl;
-      indent(out) << "oprot.WriteFieldBegin(field);" << endl;
-
-      generate_serialize_field(out, *f_iter);
-
-      indent(out) << "oprot.WriteFieldEnd();" << endl;
-
-      if (null_allowed) {
-        indent_down();
-        indent(out) << "}" << endl;
-      }
-
-      indent_down();
-      indent(out) << "}";
-    }
-  }
-
-  out << endl << indent() << "oprot.WriteFieldStop();" << endl << indent()
-      << "oprot.WriteStructEnd();" << endl;
-
-  scope_down(out);
-  out << indent() << "finally" << endl;
-  scope_up(out);
-  out << indent() << "oprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-
-  indent_down();
-
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_tostring(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public override string ToString() {" << endl;
-  indent_up();
-
-  indent(out) << "StringBuilder __sb = new StringBuilder(\"" << tstruct->get_name() << "(\");"
-              << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  bool useFirstFlag = false;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (!field_is_required((*f_iter))) {
-      indent(out) << "bool __first = true;" << endl;
-      useFirstFlag = true;
-    }
-    break;
-  }
-
-  bool had_required = false; // set to true after first required field has been processed
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool is_required = field_is_required((*f_iter));
-    bool has_default = field_has_default((*f_iter));
-    if (nullable_ && !has_default && !is_required) {
-      indent(out) << "if (" << prop_name((*f_iter)) << " != null) {" << endl;
-      indent_up();
-    } else if (!is_required) {
-      bool null_allowed = type_can_be_null((*f_iter)->get_type());
-      if (null_allowed) {
-        indent(out) << "if (" << prop_name((*f_iter)) << " != null && __isset."
-                    << normalize_name((*f_iter)->get_name()) << ") {" << endl;
-        indent_up();
-      } else {
-        indent(out) << "if (__isset." << normalize_name((*f_iter)->get_name()) << ") {" << endl;
-        indent_up();
-      }
-    }
-
-    if (useFirstFlag && (!had_required)) {
-      indent(out) << "if(!__first) { __sb.Append(\", \"); }" << endl;
-      if (!is_required) {
-        indent(out) << "__first = false;" << endl;
-      }
-      indent(out) << "__sb.Append(\"" << prop_name((*f_iter)) << ": \");" << endl;
-    } else {
-      indent(out) << "__sb.Append(\", " << prop_name((*f_iter)) << ": \");" << endl;
-    }
-
-    t_type* ttype = (*f_iter)->get_type();
-    if (ttype->is_xception() || ttype->is_struct()) {
-      indent(out) << "__sb.Append(" << prop_name((*f_iter))
-                  << "== null ? \"<null>\" : " << prop_name((*f_iter)) << ".ToString());" << endl;
-    } else {
-      indent(out) << "__sb.Append(" << prop_name((*f_iter)) << ");" << endl;
-    }
-
-    if (!is_required) {
-      indent_down();
-      indent(out) << "}" << endl;
-    } else {
-      had_required = true; // now __first must be false, so we don't need to check it anymore
-    }
-  }
-
-  indent(out) << "__sb.Append(\")\");" << endl;
-  indent(out) << "return __sb.ToString();" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_union(t_struct* tunion) {
-  string f_union_name = namespace_dir_ + "/" + (tunion->get_name()) + ".cs";
-  ofstream f_union;
-
-  f_union.open(f_union_name.c_str());
-
-  f_union << autogen_comment() << csharp_type_usings() << csharp_thrift_usings() << endl;
-
-  generate_csharp_union_definition(f_union, tunion);
-
-  f_union.close();
-}
-
-void t_csharp_generator::generate_csharp_union_definition(std::ofstream& out, t_struct* tunion) {
-  // Let's define the class first
-  start_csharp_namespace(out);
-
-  indent(out) << "public abstract partial class " << tunion->get_name() << " : TAbstractBase {"
-              << endl;
-
-  indent_up();
-
-  indent(out) << "public abstract void Write(TProtocol protocol);" << endl;
-  indent(out) << "public readonly bool Isset;" << endl;
-  indent(out) << "public abstract object Data { get; }" << endl;
-
-  indent(out) << "protected " << tunion->get_name() << "(bool isset) {" << endl;
-  indent_up();
-  indent(out) << "Isset = isset;" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "public class ___undefined : " << tunion->get_name() << " {" << endl;
-  indent_up();
-
-  indent(out) << "public override object Data { get { return null; } }" << endl;
-
-  indent(out) << "public ___undefined() : base(false) {}" << endl << endl;
-
-  indent(out) << "public override void Write(TProtocol protocol) {" << endl;
-  indent_up();
-  indent(out) << "throw new TProtocolException( TProtocolException.INVALID_DATA, \"Cannot persist "
-                 "an union type which is not set.\");" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  const vector<t_field*>& fields = tunion->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    generate_csharp_union_class(out, tunion, (*f_iter));
-  }
-
-  generate_csharp_union_reader(out, tunion);
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  end_csharp_namespace(out);
-}
-
-void t_csharp_generator::generate_csharp_union_class(std::ofstream& out,
-                                                     t_struct* tunion,
-                                                     t_field* tfield) {
-  indent(out) << "public class " << tfield->get_name() << " : " << tunion->get_name() << " {"
-              << endl;
-  indent_up();
-  indent(out) << "private " << type_name(tfield->get_type()) << " _data;" << endl;
-  indent(out) << "public override object Data { get { return _data; } }" << endl;
-  indent(out) << "public " << tfield->get_name() << "(" << type_name(tfield->get_type())
-              << " data) : base(true) {" << endl;
-  indent_up();
-  indent(out) << "this._data = data;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-  indent(out) << "public override void Write(TProtocol oprot) {" << endl;
-  indent_up();
-
-  out << indent() << "oprot.IncrementRecursionDepth();" << endl;
-  out << indent() << "try" << endl;
-  scope_up(out);
-
-  indent(out) << "TStruct struc = new TStruct(\"" << tunion->get_name() << "\");" << endl;
-  indent(out) << "oprot.WriteStructBegin(struc);" << endl;
-
-  indent(out) << "TField field = new TField();" << endl;
-  indent(out) << "field.Name = \"" << tfield->get_name() << "\";" << endl;
-  indent(out) << "field.Type = " << type_to_enum(tfield->get_type()) << ";" << endl;
-  indent(out) << "field.ID = " << tfield->get_key() << ";" << endl;
-  indent(out) << "oprot.WriteFieldBegin(field);" << endl;
-
-  generate_serialize_field(out, tfield, "_data", true, true);
-
-  indent(out) << "oprot.WriteFieldEnd();" << endl;
-  indent(out) << "oprot.WriteFieldStop();" << endl;
-  indent(out) << "oprot.WriteStructEnd();" << endl;
-  indent_down();
-
-  scope_down(out);
-  out << indent() << "finally" << endl;
-  scope_up(out);
-  out << indent() << "oprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_equals(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public override bool Equals(object that) {" << endl;
-  indent_up();
-
-  indent(out) << "var other = that as " << type_name(tstruct) << ";" << endl;
-  indent(out) << "if (other == null) return false;" << endl;
-  indent(out) << "if (ReferenceEquals(this, other)) return true;" << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  bool first = true;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      indent(out) << "return ";
-      indent_up();
-    } else {
-      out << endl;
-      indent(out) << "&& ";
-    }
-    if (!field_is_required((*f_iter)) && !(nullable_ && !field_has_default((*f_iter)))) {
-      out << "((__isset." << normalize_name((*f_iter)->get_name()) << " == other.__isset."
-          << normalize_name((*f_iter)->get_name()) << ") && ((!__isset."
-          << normalize_name((*f_iter)->get_name()) << ") || (";
-    }
-    t_type* ttype = (*f_iter)->get_type();
-    if (ttype->is_container() || (ttype->is_base_type() && (((t_base_type*)ttype)->is_binary()))) {
-      out << "TCollections.Equals(";
-    } else {
-      out << "System.Object.Equals(";
-    }
-    out << prop_name((*f_iter)) << ", other." << prop_name((*f_iter)) << ")";
-    if (!field_is_required((*f_iter)) && !(nullable_ && !field_has_default((*f_iter)))) {
-      out << ")))";
-    }
-  }
-  if (first) {
-    indent(out) << "return true;" << endl;
-  } else {
-    out << ";" << endl;
-    indent_down();
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_csharp_struct_hashcode(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public override int GetHashCode() {" << endl;
-  indent_up();
-
-  indent(out) << "int hashcode = 0;" << endl;
-  indent(out) << "unchecked {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_type* ttype = (*f_iter)->get_type();
-    indent(out) << "hashcode = (hashcode * 397) ^ ";
-    if (field_is_required((*f_iter))) {
-      out << "(";
-    } else if (nullable_) {
-      out << "(" << prop_name((*f_iter)) << " == null ? 0 : ";
-    } else {
-      out << "(!__isset." << normalize_name((*f_iter)->get_name()) << " ? 0 : ";
-    }
-    if (ttype->is_container()) {
-      out << "(TCollections.GetHashCode(" << prop_name((*f_iter)) << "))";
-    } else {
-      out << "(" << prop_name((*f_iter)) << ".GetHashCode())";
-    }
-    out << ");" << endl;
-  }
-
-  indent_down();
-  indent(out) << "}" << endl;
-  indent(out) << "return hashcode;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_service(t_service* tservice) {
-  string f_service_name = namespace_dir_ + "/" + service_name_ + ".cs";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << csharp_type_usings() << csharp_thrift_usings() << endl;
-
-  start_csharp_namespace(f_service_);
-
-  indent(f_service_) << "public partial class " << normalize_name(service_name_) << " {" << endl;
-  indent_up();
-
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-
-  indent_down();
-
-  indent(f_service_) << "}" << endl;
-  end_csharp_namespace(f_service_);
-  f_service_.close();
-}
-
-void t_csharp_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_iface = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_iface = " : " + extends + ".Iface";
-  }
-
-  generate_csharp_doc(f_service_, tservice);
-
-  if (wcf_) {
-    indent(f_service_) << "[ServiceContract(Namespace=\"" << wcf_namespace_ << "\")]" << endl;
-  }
-  indent(f_service_) << "public interface Iface" << extends_iface << " {" << endl;
-
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_csharp_doc(f_service_, *f_iter);
-
-    // if we're using WCF, add the corresponding attributes
-    if (wcf_) {
-      indent(f_service_) << "[OperationContract]" << endl;
-
-      const std::vector<t_field*>& xceptions = (*f_iter)->get_xceptions()->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        indent(f_service_) << "[FaultContract(typeof("
-                              + type_name((*x_iter)->get_type(), false, false) + "Fault))]" << endl;
-      }
-    }
-
-    indent(f_service_) << function_signature(*f_iter) << ";" << endl;
-    if (!async_) {
-      indent(f_service_) << "#if SILVERLIGHT" << endl;
-    }
-    indent(f_service_) << function_signature_async_begin(*f_iter, "Begin_") << ";" << endl;
-    indent(f_service_) << function_signature_async_end(*f_iter, "End_") << ";" << endl;
-    if (async_ || async_ctp_) {
-      indent(f_service_) << function_signature_async(*f_iter) << ";" << endl;
-    }
-    if (!async_) {
-      indent(f_service_) << "#endif" << endl;
-    }
-  }
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_csharp_struct_definition(f_service_, ts, false, true);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-void t_csharp_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_client = extends + ".Client, ";
-  } else {
-    extends_client = "IDisposable, ";
-  }
-
-  generate_csharp_doc(f_service_, tservice);
-
-  indent(f_service_) << "public class Client : " << extends_client << "Iface {" << endl;
-  indent_up();
-  indent(f_service_) << "public Client(TProtocol prot) : this(prot, prot)" << endl;
-  scope_up(f_service_);
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  indent(f_service_) << "public Client(TProtocol iprot, TProtocol oprot)";
-  if (!extends.empty()) {
-    f_service_ << " : base(iprot, oprot)";
-  }
-  f_service_ << endl;
-
-  scope_up(f_service_);
-  if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl << indent() << "oprot_ = oprot;" << endl;
-  }
-  scope_down(f_service_);
-
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected TProtocol iprot_;" << endl << indent()
-               << "protected TProtocol oprot_;" << endl << indent() << "protected int seqid_;"
-               << endl << endl;
-
-    f_service_ << indent() << "public TProtocol InputProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "get { return iprot_; }" << endl;
-    scope_down(f_service_);
-
-    f_service_ << indent() << "public TProtocol OutputProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "get { return oprot_; }" << endl;
-    scope_down(f_service_);
-    f_service_ << endl << endl;
-
-    indent(f_service_) << "#region \" IDisposable Support \"" << endl;
-    indent(f_service_) << "private bool _IsDisposed;" << endl << endl;
-    indent(f_service_) << "// IDisposable" << endl;
-    indent(f_service_) << "public void Dispose()" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "Dispose(true);" << endl;
-    scope_down(f_service_);
-    indent(f_service_) << endl << endl;
-    indent(f_service_) << "protected virtual void Dispose(bool disposing)" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "if (!_IsDisposed)" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "if (disposing)" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "if (iprot_ != null)" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "((IDisposable)iprot_).Dispose();" << endl;
-    scope_down(f_service_);
-    indent(f_service_) << "if (oprot_ != null)" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "((IDisposable)oprot_).Dispose();" << endl;
-    scope_down(f_service_);
-    scope_down(f_service_);
-    scope_down(f_service_);
-    indent(f_service_) << "_IsDisposed = true;" << endl;
-    scope_down(f_service_);
-    indent(f_service_) << "#endregion" << endl;
-    f_service_ << endl << endl;
-  }
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-
-    indent(f_service_) << endl;
-
-    if (!async_) {
-      indent(f_service_) << "#if SILVERLIGHT" << endl;
-    }
-    // Begin_
-    indent(f_service_) << "public " << function_signature_async_begin(*f_iter, "Begin_") << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return "
-                       << "send_" << funname << "(callback, state";
-
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    prepare_member_name_mapping(arg_struct);
-
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << ", ";
-      f_service_ << normalize_name((*fld_iter)->get_name());
-    }
-    f_service_ << ");" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    // End
-    indent(f_service_) << "public " << function_signature_async_end(*f_iter, "End_") << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "oprot_.Transport.EndFlush(asyncResult);" << endl;
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "recv_" << funname << "();" << endl;
-    }
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    // async
-    bool first;
-    if (async_ || async_ctp_) {
-      indent(f_service_) << "public async " << function_signature_async(*f_iter, "") << endl;
-      scope_up(f_service_);
-
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << type_name((*f_iter)->get_returntype()) << " retval;" << endl;
-        indent(f_service_) << "retval = ";
-      } else {
-        indent(f_service_);
-      }
-      if (async_) {
-        f_service_ << "await Task.Run(() =>" << endl;
-      } else {
-        f_service_ << "await TaskEx.Run(() =>" << endl;
-      }
-      scope_up(f_service_);
-      indent(f_service_);
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << funname << "(";
-      first = true;
-      for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-        if (first) {
-          first = false;
-        } else {
-          f_service_ << ", ";
-        }
-        f_service_ << (*fld_iter)->get_name();
-      }
-      f_service_ << ");" << endl;
-      indent_down();
-      indent(f_service_) << "});" << endl;
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return retval;" << endl;
-      }
-      scope_down(f_service_);
-      f_service_ << endl;
-    }
-
-    if (!async_) {
-      indent(f_service_) << "#endif" << endl << endl;
-    }
-
-    // "Normal" Synchronous invoke
-    generate_csharp_doc(f_service_, *f_iter);
-    indent(f_service_) << "public " << function_signature(*f_iter) << endl;
-    scope_up(f_service_);
-
-    if (!async_) {
-      indent(f_service_) << "#if !SILVERLIGHT" << endl;
-      indent(f_service_) << "send_" << funname << "(";
-
-      first = true;
-      for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-        if (first) {
-          first = false;
-        } else {
-          f_service_ << ", ";
-        }
-        f_service_ << normalize_name((*fld_iter)->get_name());
-      }
-      f_service_ << ");" << endl;
-
-      if (!(*f_iter)->is_oneway()) {
-        f_service_ << indent();
-        if (!(*f_iter)->get_returntype()->is_void()) {
-          f_service_ << "return ";
-        }
-        f_service_ << "recv_" << funname << "();" << endl;
-      }
-      f_service_ << endl;
-
-      indent(f_service_) << "#else" << endl;
-    }
-
-    // Silverlight synchronous invoke
-    indent(f_service_) << "var asyncResult = Begin_" << funname << "(null, null";
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << ", " << normalize_name((*fld_iter)->get_name());
-    }
-    f_service_ << ");" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "End_" << funname << "(asyncResult);" << endl;
-    }
-    f_service_ << endl;
-
-    if (!async_) {
-      indent(f_service_) << "#endif" << endl;
-    }
-    scope_down(f_service_);
-
-    // Send
-    t_function send_function(g_type_void,
-                             string("send_") + (*f_iter)->get_name(),
-                             (*f_iter)->get_arglist());
-
-    string argsname = (*f_iter)->get_name() + "_args";
-
-    if (!async_) {
-      indent(f_service_) << "#if SILVERLIGHT" << endl;
-    }
-    indent(f_service_) << "public " << function_signature_async_begin(&send_function) << endl;
-    if (!async_) {
-      indent(f_service_) << "#else" << endl;
-      indent(f_service_) << "public " << function_signature(&send_function) << endl;
-      indent(f_service_) << "#endif" << endl;
-    }
-    scope_up(f_service_);
-
-    f_service_ << indent() << "oprot_.WriteMessageBegin(new TMessage(\"" << funname << "\", "
-               << ((*f_iter)->is_oneway() ? "TMessageType.Oneway" : "TMessageType.Call")
-               << ", seqid_));" << endl << indent() << argsname << " args = new " << argsname
-               << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args." << prop_name(*fld_iter) << " = "
-                 << normalize_name((*fld_iter)->get_name()) << ";" << endl;
-    }
-
-    f_service_ << indent() << "args.Write(oprot_);" << endl << indent()
-               << "oprot_.WriteMessageEnd();" << endl;
-    ;
-
-    if (!async_) {
-      indent(f_service_) << "#if SILVERLIGHT" << endl;
-    }
-    indent(f_service_) << "return oprot_.Transport.BeginFlush(callback, state);" << endl;
-    if (!async_) {
-      indent(f_service_) << "#else" << endl;
-      indent(f_service_) << "oprot_.Transport.Flush();" << endl;
-      indent(f_service_) << "#endif" << endl;
-    }
-
-    cleanup_member_name_mapping(arg_struct);
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      string resultname = (*f_iter)->get_name() + "_result";
-
-      t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs,
-                               (*f_iter)->get_xceptions());
-      indent(f_service_) << "public " << function_signature(&recv_function) << endl;
-      scope_up(f_service_);
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      prepare_member_name_mapping(xs, xs->get_members(), resultname);
-
-      f_service_ << indent() << "TMessage msg = iprot_.ReadMessageBegin();" << endl << indent()
-                 << "if (msg.Type == TMessageType.Exception) {" << endl;
-      indent_up();
-      f_service_ << indent() << "TApplicationException x = TApplicationException.Read(iprot_);"
-                 << endl << indent() << "iprot_.ReadMessageEnd();" << endl << indent() << "throw x;"
-                 << endl;
-      indent_down();
-      f_service_ << indent() << "}" << endl << indent() << resultname << " result = new "
-                 << resultname << "();" << endl << indent() << "result.Read(iprot_);" << endl
-                 << indent() << "iprot_.ReadMessageEnd();" << endl;
-
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        if (nullable_) {
-          if (type_can_be_null((*f_iter)->get_returntype())) {
-            f_service_ << indent() << "if (result.Success != null) {" << endl << indent()
-                       << "  return result.Success;" << endl << indent() << "}" << endl;
-          } else {
-            f_service_ << indent() << "if (result.Success.HasValue) {" << endl << indent()
-                       << "  return result.Success.Value;" << endl << indent() << "}" << endl;
-          }
-        } else {
-          f_service_ << indent() << "if (result.__isset.success) {" << endl << indent()
-                     << "  return result.Success;" << endl << indent() << "}" << endl;
-        }
-      }
-
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        if (nullable_) {
-          f_service_ << indent() << "if (result." << prop_name(*x_iter) << " != null) {" << endl
-                     << indent() << "  throw result." << prop_name(*x_iter) << ";" << endl
-                     << indent() << "}" << endl;
-        } else {
-          f_service_ << indent() << "if (result.__isset." << normalize_name((*x_iter)->get_name())
-                     << ") {" << endl << indent() << "  throw result." << prop_name(*x_iter) << ";"
-                     << endl << indent() << "}" << endl;
-        }
-      }
-
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "return;" << endl;
-      } else {
-        f_service_ << indent()
-                   << "throw new "
-                      "TApplicationException(TApplicationException.ExceptionType.MissingResult, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\");" << endl;
-      }
-
-      cleanup_member_name_mapping((*f_iter)->get_xceptions());
-      scope_down(f_service_);
-      f_service_ << endl;
-    }
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl;
-}
-
-void t_csharp_generator::generate_service_server(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_processor = extends + ".Processor, ";
-  }
-
-  indent(f_service_) << "public class Processor : " << extends_processor << "TProcessor {" << endl;
-  indent_up();
-
-  indent(f_service_) << "public Processor(Iface iface)";
-  if (!extends.empty()) {
-    f_service_ << " : base(iface)";
-  }
-  f_service_ << endl;
-  scope_up(f_service_);
-  f_service_ << indent() << "iface_ = iface;" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "processMap_[\"" << (*f_iter)->get_name()
-               << "\"] = " << (*f_iter)->get_name() << "_Process;" << endl;
-  }
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_
-        << indent()
-        << "protected delegate void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);"
-        << endl;
-  }
-
-  f_service_ << indent() << "private Iface iface_;" << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected Dictionary<string, ProcessFunction> processMap_ = new "
-                              "Dictionary<string, ProcessFunction>();" << endl;
-  }
-
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    indent(f_service_) << "public bool Process(TProtocol iprot, TProtocol oprot)" << endl;
-  } else {
-    indent(f_service_) << "public new bool Process(TProtocol iprot, TProtocol oprot)" << endl;
-  }
-  scope_up(f_service_);
-
-  f_service_ << indent() << "try" << endl;
-  scope_up(f_service_);
-
-  f_service_ << indent() << "TMessage msg = iprot.ReadMessageBegin();" << endl;
-
-  f_service_
-      << indent() << "ProcessFunction fn;" << endl << indent()
-      << "processMap_.TryGetValue(msg.Name, out fn);" << endl << indent() << "if (fn == null) {"
-      << endl << indent() << "  TProtocolUtil.Skip(iprot, TType.Struct);" << endl << indent()
-      << "  iprot.ReadMessageEnd();" << endl << indent()
-      << "  TApplicationException x = new TApplicationException "
-         "(TApplicationException.ExceptionType.UnknownMethod, \"Invalid method name: '\" + "
-         "msg.Name + \"'\");" << endl << indent()
-      << "  oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));"
-      << endl << indent() << "  x.Write(oprot);" << endl << indent() << "  oprot.WriteMessageEnd();"
-      << endl << indent() << "  oprot.Transport.Flush();" << endl << indent() << "  return true;"
-      << endl << indent() << "}" << endl << indent() << "fn(msg.SeqID, iprot, oprot);" << endl;
-
-  scope_down(f_service_);
-
-  f_service_ << indent() << "catch (IOException)" << endl;
-  scope_up(f_service_);
-  f_service_ << indent() << "return false;" << endl;
-  scope_down(f_service_);
-
-  f_service_ << indent() << "return true;" << endl;
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_function_helpers(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return;
-  }
-
-  t_struct result(program_, tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_csharp_struct_definition(f_service_, &result, false, true, true);
-}
-
-void t_csharp_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  indent(f_service_) << "public void " << tfunction->get_name()
-                     << "_Process(int seqid, TProtocol iprot, TProtocol oprot)" << endl;
-  scope_up(f_service_);
-
-  string argsname = tfunction->get_name() + "_args";
-  string resultname = tfunction->get_name() + "_result";
-
-  f_service_ << indent() << argsname << " args = new " << argsname << "();" << endl << indent()
-             << "args.Read(iprot);" << endl << indent() << "iprot.ReadMessageEnd();" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << resultname << " result = new " << resultname << "();" << endl;
-  }
-
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
-    indent_up();
-  }
-
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_ << indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "result.Success = ";
-  }
-  f_service_ << "iface_." << normalize_name(tfunction->get_name()) << "(";
-  bool first = true;
-  prepare_member_name_mapping(arg_struct);
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_service_ << ", ";
-    }
-    f_service_ << "args." << prop_name(*f_iter);
-    if (nullable_ && !type_can_be_null((*f_iter)->get_type())) {
-      f_service_ << ".Value";
-    }
-  }
-  cleanup_member_name_mapping(arg_struct);
-  f_service_ << ");" << endl;
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    indent_down();
-    f_service_ << indent() << "}";
-    prepare_member_name_mapping(xs, xs->get_members(), resultname);
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << " catch (" << type_name((*x_iter)->get_type(), false, false) << " "
-                 << (*x_iter)->get_name() << ") {" << endl;
-      if (!tfunction->is_oneway()) {
-        indent_up();
-        f_service_ << indent() << "result." << prop_name(*x_iter) << " = " << (*x_iter)->get_name()
-                   << ";" << endl;
-        indent_down();
-        f_service_ << indent() << "}";
-      } else {
-        f_service_ << "}";
-      }
-    }
-    cleanup_member_name_mapping(xs);
-    f_service_ << endl;
-  }
-
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    scope_down(f_service_);
-
-    return;
-  }
-
-  f_service_ << indent() << "oprot.WriteMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.Reply, seqid)); " << endl << indent() << "result.Write(oprot);"
-             << endl << indent() << "oprot.WriteMessageEnd();" << endl << indent()
-             << "oprot.Transport.Flush();" << endl;
-
-  scope_down(f_service_);
-
-  f_service_ << endl;
-}
-
-void t_csharp_generator::generate_csharp_union_reader(std::ofstream& out, t_struct* tunion) {
-  // Thanks to THRIFT-1768, we don't need to check for required fields in the union
-  const vector<t_field*>& fields = tunion->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "public static " << tunion->get_name() << " Read(TProtocol iprot)" << endl;
-  scope_up(out);
-
-  out << indent() << "iprot.IncrementRecursionDepth();" << endl;
-  out << indent() << "try" << endl;
-  scope_up(out);
-
-  indent(out) << tunion->get_name() << " retval;" << endl;
-  indent(out) << "iprot.ReadStructBegin();" << endl;
-  indent(out) << "TField field = iprot.ReadFieldBegin();" << endl;
-  // we cannot have the first field be a stop -- we must have a single field defined
-  indent(out) << "if (field.Type == TType.Stop)" << endl;
-  scope_up(out);
-  indent(out) << "iprot.ReadFieldEnd();" << endl;
-  indent(out) << "retval = new ___undefined();" << endl;
-  scope_down(out);
-  indent(out) << "else" << endl;
-  scope_up(out);
-  indent(out) << "switch (field.ID)" << endl;
-  scope_up(out);
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-    indent_up();
-    indent(out) << "if (field.Type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    indent(out) << type_name((*f_iter)->get_type()) << " temp;" << endl;
-    generate_deserialize_field(out, (*f_iter), "temp", true);
-    indent(out) << "retval = new " << (*f_iter)->get_name() << "(temp);" << endl;
-
-    indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.Skip(iprot, field.Type);"
-        << endl << indent() << "  retval = new ___undefined();" << endl << indent() << "}" << endl
-        << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default: " << endl;
-  indent_up();
-  indent(out) << "TProtocolUtil.Skip(iprot, field.Type);" << endl << indent()
-              << "retval = new ___undefined();" << endl;
-  indent(out) << "break;" << endl;
-  indent_down();
-
-  scope_down(out);
-
-  indent(out) << "iprot.ReadFieldEnd();" << endl;
-
-  indent(out) << "if (iprot.ReadFieldBegin().Type != TType.Stop)" << endl;
-  scope_up(out);
-  indent(out) << "throw new TProtocolException(TProtocolException.INVALID_DATA);" << endl;
-  scope_down(out);
-
-  // end of else for TStop
-  scope_down(out);
-  indent(out) << "iprot.ReadStructEnd();" << endl;
-  indent(out) << "return retval;" << endl;
-  indent_down();
-
-  scope_down(out);
-  out << indent() << "finally" << endl;
-  scope_up(out);
-  out << indent() << "iprot.DecrementRecursionDepth();" << endl;
-  scope_down(out);
-
-  indent(out) << "}" << endl << endl;
-}
-
-void t_csharp_generator::generate_deserialize_field(ofstream& out,
-                                                    t_field* tfield,
-                                                    string prefix,
-                                                    bool is_propertyless) {
-  t_type* type = tfield->get_type();
-  while (type->is_typedef()) {
-    type = ((t_typedef*)type)->get_type();
-  }
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + (is_propertyless ? "" : prop_name(tfield));
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << name << " = ";
-
-    if (type->is_enum()) {
-      out << "(" << type_name(type, false, true) << ")";
-    }
-
-    out << "iprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "ReadBinary();";
-        } else {
-          out << "ReadString();";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "ReadBool();";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "ReadByte();";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "ReadI16();";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "ReadI32();";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "ReadI64();";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "ReadDouble();";
-        break;
-      default:
-        throw "compiler error: no C# name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "ReadI32();";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-void t_csharp_generator::generate_deserialize_struct(ofstream& out,
-                                                     t_struct* tstruct,
-                                                     string prefix) {
-  if (union_ && tstruct->is_union()) {
-    out << indent() << prefix << " = " << type_name(tstruct) << ".Read(iprot);" << endl;
-  } else {
-    out << indent() << prefix << " = new " << type_name(tstruct) << "();" << endl << indent()
-        << prefix << ".Read(iprot);" << endl;
-  }
-}
-
-void t_csharp_generator::generate_deserialize_container(ofstream& out,
-                                                        t_type* ttype,
-                                                        string prefix) {
-  scope_up(out);
-
-  string obj;
-
-  if (ttype->is_map()) {
-    obj = tmp("_map");
-  } else if (ttype->is_set()) {
-    obj = tmp("_set");
-  } else if (ttype->is_list()) {
-    obj = tmp("_list");
-  }
-
-  indent(out) << prefix << " = new " << type_name(ttype, false, true) << "();" << endl;
-  if (ttype->is_map()) {
-    out << indent() << "TMap " << obj << " = iprot.ReadMapBegin();" << endl;
-  } else if (ttype->is_set()) {
-    out << indent() << "TSet " << obj << " = iprot.ReadSetBegin();" << endl;
-  } else if (ttype->is_list()) {
-    out << indent() << "TList " << obj << " = iprot.ReadListBegin();" << endl;
-  }
-
-  string i = tmp("_i");
-  indent(out) << "for( int " << i << " = 0; " << i << " < " << obj << ".Count"
-              << "; "
-              << "++" << i << ")" << endl;
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "iprot.ReadMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "iprot.ReadSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "iprot.ReadListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-void t_csharp_generator::generate_deserialize_map_element(ofstream& out,
-                                                          t_map* tmap,
-                                                          string prefix) {
-  string key = tmp("_key");
-  string val = tmp("_val");
-
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << prefix << "[" << key << "] = " << val << ";" << endl;
-}
-
-void t_csharp_generator::generate_deserialize_set_element(ofstream& out,
-                                                          t_set* tset,
-                                                          string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".Add(" << elem << ");" << endl;
-}
-
-void t_csharp_generator::generate_deserialize_list_element(ofstream& out,
-                                                           t_list* tlist,
-                                                           string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".Add(" << elem << ");" << endl;
-}
-
-void t_csharp_generator::generate_serialize_field(ofstream& out,
-                                                  t_field* tfield,
-                                                  string prefix,
-                                                  bool is_element,
-                                                  bool is_propertyless) {
-  t_type* type = tfield->get_type();
-  while (type->is_typedef()) {
-    type = ((t_typedef*)type)->get_type();
-  }
-
-  string name = prefix + (is_propertyless ? "" : prop_name(tfield));
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + name;
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << "oprot.";
-
-    string nullable_name = nullable_ && !is_element && !field_is_required(tfield) ? name + ".Value"
-                                                                                  : name;
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "WriteBinary(";
-        } else {
-          out << "WriteString(";
-        }
-        out << name << ");";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "WriteBool(" << nullable_name << ");";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "WriteByte(" << nullable_name << ");";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "WriteI16(" << nullable_name << ");";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "WriteI32(" << nullable_name << ");";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "WriteI64(" << nullable_name << ");";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "WriteDouble(" << nullable_name << ");";
-        break;
-      default:
-        throw "compiler error: no C# name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "WriteI32((int)" << nullable_name << ");";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-void t_csharp_generator::generate_serialize_struct(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   string prefix) {
-  (void)tstruct;
-  out << indent() << prefix << ".Write(oprot);" << endl;
-}
-
-void t_csharp_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot.WriteMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
-                << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << prefix
-                << ".Count));" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.WriteSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".Count));" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.WriteListBegin(new TList("
-                << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".Count));"
-                << endl;
-  }
-
-  string iter = tmp("_iter");
-  if (ttype->is_map()) {
-    indent(out) << "foreach (" << type_name(((t_map*)ttype)->get_key_type()) << " " << iter
-                << " in " << prefix << ".Keys)";
-  } else if (ttype->is_set()) {
-    indent(out) << "foreach (" << type_name(((t_set*)ttype)->get_elem_type()) << " " << iter
-                << " in " << prefix << ")";
-  } else if (ttype->is_list()) {
-    indent(out) << "foreach (" << type_name(((t_list*)ttype)->get_elem_type()) << " " << iter
-                << " in " << prefix << ")";
-  }
-
-  out << endl;
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_serialize_map_element(out, (t_map*)ttype, iter, prefix);
-  } else if (ttype->is_set()) {
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-  } else if (ttype->is_list()) {
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot.WriteMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.WriteSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.WriteListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-void t_csharp_generator::generate_serialize_map_element(ofstream& out,
-                                                        t_map* tmap,
-                                                        string iter,
-                                                        string map) {
-  t_field kfield(tmap->get_key_type(), iter);
-  generate_serialize_field(out, &kfield, "", true);
-  t_field vfield(tmap->get_val_type(), map + "[" + iter + "]");
-  generate_serialize_field(out, &vfield, "", true);
-}
-
-void t_csharp_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "", true);
-}
-
-vo

<TRUNCATED>


[25/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_py_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_py_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_py_generator.cc
deleted file mode 100644
index 9c43b1f..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_py_generator.cc
+++ /dev/null
@@ -1,2461 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-#include <algorithm>
-#include "t_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Python code generator.
- *
- */
-class t_py_generator : public t_generator {
-public:
-  t_py_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("new_style");
-    gen_newstyle_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("slots");
-    gen_slots_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("dynamic");
-    gen_dynamic_ = (iter != parsed_options.end());
-
-    if (gen_dynamic_) {
-      gen_newstyle_ = 0; // dynamic is newstyle
-      gen_dynbaseclass_ = "TBase";
-      gen_dynbaseclass_exc_ = "TExceptionBase";
-      import_dynbase_ = "from thrift.protocol.TBase import TBase, TExceptionBase, TTransport\n";
-    }
-
-    iter = parsed_options.find("dynbase");
-    if (iter != parsed_options.end()) {
-      gen_dynbase_ = true;
-      gen_dynbaseclass_ = (iter->second);
-    }
-
-    iter = parsed_options.find("dynexc");
-    if (iter != parsed_options.end()) {
-      gen_dynbaseclass_exc_ = (iter->second);
-    }
-
-    iter = parsed_options.find("dynimport");
-    if (iter != parsed_options.end()) {
-      gen_dynbase_ = true;
-      import_dynbase_ = (iter->second);
-    }
-
-    iter = parsed_options.find("twisted");
-    gen_twisted_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("tornado");
-    gen_tornado_ = (iter != parsed_options.end());
-
-    if (gen_twisted_ && gen_tornado_) {
-      throw "at most one of 'twisted' and 'tornado' are allowed";
-    }
-
-    iter = parsed_options.find("utf8strings");
-    gen_utf8strings_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("coding");
-    if (iter != parsed_options.end()) {
-        coding_ = iter->second;
-    }
-
-    copy_options_ = option_string;
-
-    if (gen_twisted_) {
-      out_dir_base_ = "gen-py.twisted";
-    } else if (gen_tornado_) {
-      out_dir_base_ = "gen-py.tornado";
-    } else {
-      out_dir_base_ = "gen-py";
-    }
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_py_struct(t_struct* tstruct, bool is_exception);
-  void generate_py_struct_definition(std::ofstream& out,
-                                     t_struct* tstruct,
-                                     bool is_xception = false,
-                                     bool is_result = false);
-  void generate_py_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_py_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_py_struct_required_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_py_function_helpers(t_function* tfunction);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_remote(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool inclass = false);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_python_docstring(std::ofstream& out, t_struct* tstruct);
-
-  void generate_python_docstring(std::ofstream& out, t_function* tfunction);
-
-  void generate_python_docstring(std::ofstream& out,
-                                 t_doc* tdoc,
-                                 t_struct* tstruct,
-                                 const char* subheader);
-
-  void generate_python_docstring(std::ofstream& out, t_doc* tdoc);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string py_autogen_comment();
-  std::string py_imports();
-  std::string render_includes();
-  std::string render_fastbinary_includes();
-  std::string declare_argument(t_field* tfield);
-  std::string render_field_default_value(t_field* tfield);
-  std::string type_name(t_type* ttype);
-  std::string function_signature(t_function* tfunction, bool interface = false);
-  std::string argument_list(t_struct* tstruct,
-                            std::vector<std::string>* pre = NULL,
-                            std::vector<std::string>* post = NULL);
-  std::string type_to_enum(t_type* ttype);
-  std::string type_to_spec_args(t_type* ttype);
-
-  static bool is_valid_namespace(const std::string& sub_namespace) {
-    return sub_namespace == "twisted";
-  }
-
-  static std::string get_real_py_module(const t_program* program, bool gen_twisted) {
-    if (gen_twisted) {
-      std::string twisted_module = program->get_namespace("py.twisted");
-      if (!twisted_module.empty()) {
-        return twisted_module;
-      }
-    }
-
-    std::string real_module = program->get_namespace("py");
-    if (real_module.empty()) {
-      return program->get_name();
-    }
-    return real_module;
-  }
-
-private:
-  /**
-   * True if we should generate new-style classes.
-   */
-  bool gen_newstyle_;
-
-  /**
-  * True if we should generate dynamic style classes.
-  */
-  bool gen_dynamic_;
-
-  bool gen_dynbase_;
-  std::string gen_dynbaseclass_;
-  std::string gen_dynbaseclass_exc_;
-
-  std::string import_dynbase_;
-
-  bool gen_slots_;
-
-  std::string copy_options_;
-
-  /**
-   * True if we should generate Twisted-friendly RPC services.
-   */
-  bool gen_twisted_;
-
-  /**
-   * True if we should generate code for use with Tornado
-   */
-  bool gen_tornado_;
-
-  /**
-   * True if strings should be encoded using utf-8.
-   */
-  bool gen_utf8strings_;
-
-  /**
-   * specify generated file encoding
-   * eg. # -*- coding: utf-8 -*-
-   */
-  string coding_;
-
-  /**
-   * File streams
-   */
-
-  std::ofstream f_types_;
-  std::ofstream f_consts_;
-  std::ofstream f_service_;
-
-  std::string package_dir_;
-  std::string module_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_py_generator::init_generator() {
-  // Make output directory
-  string module = get_real_py_module(program_, gen_twisted_);
-  package_dir_ = get_out_dir();
-  module_ = module;
-  while (true) {
-    // TODO: Do better error checking here.
-    MKDIR(package_dir_.c_str());
-    std::ofstream init_py((package_dir_ + "/__init__.py").c_str(), std::ios_base::app);
-    init_py.close();
-    if (module.empty()) {
-      break;
-    }
-    string::size_type pos = module.find('.');
-    if (pos == string::npos) {
-      package_dir_ += "/";
-      package_dir_ += module;
-      module.clear();
-    } else {
-      package_dir_ += "/";
-      package_dir_ += module.substr(0, pos);
-      module.erase(0, pos + 1);
-    }
-  }
-
-  // Make output file
-  string f_types_name = package_dir_ + "/" + "ttypes.py";
-  f_types_.open(f_types_name.c_str());
-
-  string f_consts_name = package_dir_ + "/" + "constants.py";
-  f_consts_.open(f_consts_name.c_str());
-
-  string f_init_name = package_dir_ + "/__init__.py";
-  ofstream f_init;
-  f_init.open(f_init_name.c_str());
-  f_init << "__all__ = ['ttypes', 'constants'";
-  vector<t_service*> services = program_->get_services();
-  vector<t_service*>::iterator sv_iter;
-  for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-    f_init << ", '" << (*sv_iter)->get_name() << "'";
-  }
-  f_init << "]" << endl;
-  f_init.close();
-
-  // Print header
-  f_types_ << py_autogen_comment() << endl << py_imports() << endl << render_includes() << endl
-           << render_fastbinary_includes() << endl << endl;
-
-  f_consts_ << py_autogen_comment() << endl << py_imports() << endl << "from ttypes import *"
-            << endl << endl;
-}
-
-/**
- * Renders all the imports necessary for including another Thrift program
- */
-string t_py_generator::render_includes() {
-  const vector<t_program*>& includes = program_->get_includes();
-  string result = "";
-  for (size_t i = 0; i < includes.size(); ++i) {
-    result += "import " + get_real_py_module(includes[i], gen_twisted_) + ".ttypes\n";
-  }
-  if (includes.size() > 0) {
-    result += "\n";
-  }
-  return result;
-}
-
-/**
- * Renders all the imports necessary to use the accelerated TBinaryProtocol
- */
-string t_py_generator::render_fastbinary_includes() {
-  string hdr = "";
-  if (gen_dynamic_) {
-    hdr += std::string(import_dynbase_);
-  } else {
-    hdr += "from thrift.transport import TTransport\n"
-           "from thrift.protocol import TBinaryProtocol, TProtocol\n"
-           "try:\n"
-           "  from thrift.protocol import fastbinary\n"
-           "except:\n"
-           "  fastbinary = None\n";
-  }
-  return hdr;
-}
-
-/**
- * Autogen'd comment
- */
-string t_py_generator::py_autogen_comment() {
-  string coding;
-  if (!coding_.empty()) {
-      coding = "# -*- coding: " + coding_ + " -*-\n";
-  }
-  return coding + std::string("#\n") + "# Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-         + "#\n" + "# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" + "#\n"
-         + "#  options string: " + copy_options_ + "\n" + "#\n";
-}
-
-/**
- * Prints standard thrift imports
- */
-string t_py_generator::py_imports() {
-  return string("from thrift.Thrift import TType, TMessageType, TException, TApplicationException");
-}
-
-/**
- * Closes the type files
- */
-void t_py_generator::close_generator() {
-  // Close types file
-  f_types_.close();
-  f_consts_.close();
-}
-
-/**
- * Generates a typedef. This is not done in Python, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_py_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Done using a class to scope
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_py_generator::generate_enum(t_enum* tenum) {
-  std::ostringstream to_string_mapping, from_string_mapping;
-
-  f_types_ << "class " << tenum->get_name() << (gen_newstyle_ ? "(object)" : "")
-           << (gen_dynamic_ ? "(" + gen_dynbaseclass_ + ")" : "") << ":" << endl;
-  indent_up();
-  generate_python_docstring(f_types_, tenum);
-
-  to_string_mapping << indent() << "_VALUES_TO_NAMES = {" << endl;
-  from_string_mapping << indent() << "_NAMES_TO_VALUES = {" << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_types_) << (*c_iter)->get_name() << " = " << value << endl;
-
-    // Dictionaries to/from string names of enums
-    to_string_mapping << indent() << indent() << value << ": \""
-                      << escape_string((*c_iter)->get_name()) << "\"," << endl;
-    from_string_mapping << indent() << indent() << '"' << escape_string((*c_iter)->get_name())
-                        << "\": " << value << ',' << endl;
-  }
-  to_string_mapping << indent() << "}" << endl;
-  from_string_mapping << indent() << "}" << endl;
-
-  indent_down();
-  f_types_ << endl;
-  f_types_ << to_string_mapping.str() << endl << from_string_mapping.str() << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_py_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  indent(f_consts_) << name << " = " << render_const_value(type, value);
-  f_consts_ << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_py_generator::render_const_value(t_type* type, t_const_value* value) {
-  type = get_true_type(type);
-  std::ostringstream out;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "True" : "False");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << type_name(type) << "(**{" << endl;
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      out << indent();
-      out << render_const_value(g_type_string, v_iter->first);
-      out << " : ";
-      out << render_const_value(field_type, v_iter->second);
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << "})";
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
-    indent_up();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent();
-      out << render_const_value(ktype, v_iter->first);
-      out << " : ";
-      out << render_const_value(vtype, v_iter->second);
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << "}";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    if (type->is_set()) {
-      out << "set(";
-    }
-    out << "[" << endl;
-    indent_up();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent();
-      out << render_const_value(etype, *v_iter);
-      out << "," << endl;
-    }
-    indent_down();
-    indent(out) << "]";
-    if (type->is_set()) {
-      out << ")";
-    }
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-
-  return out.str();
-}
-
-/**
- * Generates a python struct
- */
-void t_py_generator::generate_struct(t_struct* tstruct) {
-  generate_py_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_py_generator::generate_xception(t_struct* txception) {
-  generate_py_struct(txception, true);
-}
-
-/**
- * Generates a python struct
- */
-void t_py_generator::generate_py_struct(t_struct* tstruct, bool is_exception) {
-  generate_py_struct_definition(f_types_, tstruct, is_exception);
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_py_generator::generate_py_struct_definition(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   bool is_exception,
-                                                   bool is_result) {
-  (void)is_result;
-  const vector<t_field*>& members = tstruct->get_members();
-  const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  out << std::endl << "class " << tstruct->get_name();
-  if (is_exception) {
-    if (gen_dynamic_) {
-      out << "(" << gen_dynbaseclass_exc_ << ")";
-    } else {
-      out << "(TException)";
-    }
-  } else {
-    if (gen_newstyle_) {
-      out << "(object)";
-    } else if (gen_dynamic_) {
-      out << "(" << gen_dynbaseclass_ << ")";
-    }
-  }
-  out << ":" << endl;
-  indent_up();
-  generate_python_docstring(out, tstruct);
-
-  out << endl;
-
-  /*
-     Here we generate the structure specification for the fastbinary codec.
-     These specifications have the following structure:
-     thrift_spec -> tuple of item_spec
-     item_spec -> None | (tag, type_enum, name, spec_args, default)
-     tag -> integer
-     type_enum -> TType.I32 | TType.STRING | TType.STRUCT | ...
-     name -> string_literal
-     default -> None  # Handled by __init__
-     spec_args -> None  # For simple types
-                | (type_enum, spec_args)  # Value type for list/set
-                | (type_enum, spec_args, type_enum, spec_args)
-                  # Key and value for map
-                | (class_name, spec_args_ptr) # For struct/exception
-     class_name -> identifier  # Basically a pointer to the class
-     spec_args_ptr -> expression  # just class_name.spec_args
-
-     TODO(dreiss): Consider making this work for structs with negative tags.
-  */
-
-  if (gen_slots_) {
-    indent(out) << "__slots__ = [ " << endl;
-    indent_up();
-    for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
-      indent(out) << "'" << (*m_iter)->get_name() << "'," << endl;
-    }
-    indent_down();
-    indent(out) << " ]" << endl << endl;
-  }
-
-  // TODO(dreiss): Look into generating an empty tuple instead of None
-  // for structures with no members.
-  // TODO(dreiss): Test encoding of structs where some inner structs
-  // don't have thrift_spec.
-  if (sorted_members.empty() || (sorted_members[0]->get_key() >= 0)) {
-    indent(out) << "thrift_spec = (" << endl;
-    indent_up();
-
-    int sorted_keys_pos = 0;
-    for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
-
-      for (; sorted_keys_pos != (*m_iter)->get_key(); sorted_keys_pos++) {
-        indent(out) << "None, # " << sorted_keys_pos << endl;
-      }
-
-      indent(out) << "(" << (*m_iter)->get_key() << ", " << type_to_enum((*m_iter)->get_type())
-                  << ", "
-                  << "'" << (*m_iter)->get_name() << "'"
-                  << ", " << type_to_spec_args((*m_iter)->get_type()) << ", "
-                  << render_field_default_value(*m_iter) << ", "
-                  << "),"
-                  << " # " << sorted_keys_pos << endl;
-
-      sorted_keys_pos++;
-    }
-
-    indent_down();
-    indent(out) << ")" << endl << endl;
-  } else {
-    indent(out) << "thrift_spec = None" << endl;
-  }
-
-  if (members.size() > 0) {
-    out << indent() << "def __init__(self,";
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      // This fills in default values, as opposed to nulls
-      out << " " << declare_argument(*m_iter) << ",";
-    }
-
-    out << "):" << endl;
-
-    indent_up();
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      // Initialize fields
-      t_type* type = (*m_iter)->get_type();
-      if (!type->is_base_type() && !type->is_enum() && (*m_iter)->get_value() != NULL) {
-        indent(out) << "if " << (*m_iter)->get_name() << " is "
-                    << "self.thrift_spec[" << (*m_iter)->get_key() << "][4]:" << endl;
-        indent(out) << "  " << (*m_iter)->get_name() << " = " << render_field_default_value(*m_iter)
-                    << endl;
-      }
-      indent(out) << "self." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << endl;
-    }
-
-    indent_down();
-
-    out << endl;
-  }
-
-  if (!gen_dynamic_) {
-    generate_py_struct_reader(out, tstruct);
-    generate_py_struct_writer(out, tstruct);
-  }
-
-  // For exceptions only, generate a __str__ method. This is
-  // because when raised exceptions are printed to the console, __repr__
-  // isn't used. See python bug #5882
-  if (is_exception) {
-    out << indent() << "def __str__(self):" << endl << indent() << "  return repr(self)" << endl
-        << endl;
-  }
-
-  out << indent() << "def __hash__(self):" << endl;
-  indent_up();
-  indent(out) << "value = 17" << endl; // PYTHONHASHSEED would be better, but requires Python 3.2.3
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "value = (value * 31) ^ hash(self." << (*m_iter)->get_name() + ")" << endl;
-  }
-  indent(out) << "return value" << endl;
-  indent_down();
-  out << endl;
-
-  if (!gen_slots_) {
-    // Printing utilities so that on the command line thrift
-    // structs look pretty like dictionaries
-    out << indent() << "def __repr__(self):" << endl << indent() << "  L = ['%s=%r' % (key, value)"
-        << endl << indent() << "    for key, value in self.__dict__.iteritems()]" << endl
-        << indent() << "  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << endl
-        << endl;
-
-    // Equality and inequality methods that compare by value
-    out << indent() << "def __eq__(self, other):" << endl;
-    indent_up();
-    out << indent() << "return isinstance(other, self.__class__) and "
-                       "self.__dict__ == other.__dict__" << endl;
-    indent_down();
-    out << endl;
-
-    out << indent() << "def __ne__(self, other):" << endl;
-    indent_up();
-
-    out << indent() << "return not (self == other)" << endl;
-    indent_down();
-  } else if (!gen_dynamic_) {
-    // no base class available to implement __eq__ and __repr__ and __ne__ for us
-    // so we must provide one that uses __slots__
-    out << indent() << "def __repr__(self):" << endl << indent()
-        << "  L = ['%s=%r' % (key, getattr(self, key))" << endl << indent()
-        << "    for key in self.__slots__]" << endl << indent()
-        << "  return '%s(%s)' % (self.__class__.__name__, ', '.join(L))" << endl << endl;
-
-    // Equality method that compares each attribute by value and type, walking __slots__
-    out << indent() << "def __eq__(self, other):" << endl << indent()
-        << "  if not isinstance(other, self.__class__):" << endl << indent() << "    return False"
-        << endl << indent() << "  for attr in self.__slots__:" << endl << indent()
-        << "    my_val = getattr(self, attr)" << endl << indent()
-        << "    other_val = getattr(other, attr)" << endl << indent()
-        << "    if my_val != other_val:" << endl << indent() << "      return False" << endl
-        << indent() << "  return True" << endl << endl;
-
-    out << indent() << "def __ne__(self, other):" << endl << indent()
-        << "  return not (self == other)" << endl << endl;
-  }
-  indent_down();
-}
-
-/**
- * Generates the read method for a struct
- */
-void t_py_generator::generate_py_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "def read(self, iprot):" << endl;
-  indent_up();
-
-  indent(out) << "if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated "
-                 "and isinstance(iprot.trans, TTransport.CReadableTransport) "
-                 "and self.thrift_spec is not None "
-                 "and fastbinary is not None:" << endl;
-  indent_up();
-
-  indent(out) << "fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec))"
-              << endl;
-  indent(out) << "return" << endl;
-  indent_down();
-
-  indent(out) << "iprot.readStructBegin()" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while True:" << endl;
-  indent_up();
-
-  // Read beginning field marker
-  indent(out) << "(fname, ftype, fid) = iprot.readFieldBegin()" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if ftype == TType.STOP:" << endl;
-  indent_up();
-  indent(out) << "break" << endl;
-  indent_down();
-
-  // Switch statement on the field we are reading
-  bool first = true;
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << indent() << "if ";
-    } else {
-      out << indent() << "elif ";
-    }
-    out << "fid == " << (*f_iter)->get_key() << ":" << endl;
-    indent_up();
-    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << ":" << endl;
-    indent_up();
-    generate_deserialize_field(out, *f_iter, "self.");
-    indent_down();
-    out << indent() << "else:" << endl << indent() << "  iprot.skip(ftype)" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  out << indent() << "else:" << endl << indent() << "  iprot.skip(ftype)" << endl;
-
-  // Read field end marker
-  indent(out) << "iprot.readFieldEnd()" << endl;
-
-  indent_down();
-
-  indent(out) << "iprot.readStructEnd()" << endl;
-
-  indent_down();
-  out << endl;
-}
-
-void t_py_generator::generate_py_struct_writer(ofstream& out, t_struct* tstruct) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "def write(self, oprot):" << endl;
-  indent_up();
-
-  indent(out) << "if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated "
-                 "and self.thrift_spec is not None "
-                 "and fastbinary is not None:" << endl;
-  indent_up();
-
-  indent(out)
-      << "oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec)))"
-      << endl;
-  indent(out) << "return" << endl;
-  indent_down();
-
-  indent(out) << "oprot.writeStructBegin('" << name << "')" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    // Write field header
-    indent(out) << "if self." << (*f_iter)->get_name() << " is not None:" << endl;
-    indent_up();
-    indent(out) << "oprot.writeFieldBegin("
-                << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ")" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "self.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd()" << endl;
-
-    indent_down();
-  }
-
-  // Write the struct map
-  out << indent() << "oprot.writeFieldStop()" << endl << indent() << "oprot.writeStructEnd()"
-      << endl;
-
-  out << endl;
-
-  indent_down();
-  generate_py_struct_required_validator(out, tstruct);
-  out << endl;
-}
-
-void t_py_generator::generate_py_struct_required_validator(ofstream& out, t_struct* tstruct) {
-  indent(out) << "def validate(self):" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-
-  if (fields.size() > 0) {
-    vector<t_field*>::const_iterator f_iter;
-
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = (*f_iter);
-      if (field->get_req() == t_field::T_REQUIRED) {
-        indent(out) << "if self." << field->get_name() << " is None:" << endl;
-        indent(out) << "  raise TProtocol.TProtocolException(message='Required field "
-                    << field->get_name() << " is unset!')" << endl;
-      }
-    }
-  }
-
-  indent(out) << "return" << endl << endl;
-  indent_down();
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_py_generator::generate_service(t_service* tservice) {
-  string f_service_name = package_dir_ + "/" + service_name_ + ".py";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << py_autogen_comment() << endl << py_imports() << endl;
-
-  if (tservice->get_extends() != NULL) {
-    f_service_ << "import "
-               << get_real_py_module(tservice->get_extends()->get_program(), gen_twisted_) << "."
-               << tservice->get_extends()->get_name() << endl;
-  }
-
-  f_service_ << "import logging" << endl
-             << "from ttypes import *" << endl
-             << "from thrift.Thrift import TProcessor" << endl
-             << render_fastbinary_includes() << endl;
-
-  if (gen_twisted_) {
-    f_service_ << "from zope.interface import Interface, implements" << endl
-               << "from twisted.internet import defer" << endl
-               << "from thrift.transport import TTwisted" << endl;
-  } else if (gen_tornado_) {
-    f_service_ << "from tornado import gen" << endl;
-    f_service_ << "from tornado import concurrent" << endl;
-    f_service_ << "from thrift.transport import TTransport" << endl;
-  }
-
-  f_service_ << endl;
-
-  // Generate the three main parts of the service
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-  generate_service_remote(tservice);
-
-  // Close service file
-  f_service_.close();
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_py_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_ << "# HELPER FUNCTIONS AND STRUCTURES" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_py_struct_definition(f_service_, ts, false);
-    generate_py_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_py_generator::generate_py_function_helpers(t_function* tfunction) {
-  if (!tfunction->is_oneway()) {
-    t_struct result(program_, tfunction->get_name() + "_result");
-    t_field success(tfunction->get_returntype(), "success", 0);
-    if (!tfunction->get_returntype()->is_void()) {
-      result.append(&success);
-    }
-
-    t_struct* xs = tfunction->get_xceptions();
-    const vector<t_field*>& fields = xs->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      result.append(*f_iter);
-    }
-    generate_py_struct_definition(f_service_, &result, false, true);
-  }
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_py_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_if = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_if = "(" + extends + ".Iface)";
-  } else {
-    if (gen_twisted_) {
-      extends_if = "(Interface)";
-    } else if (gen_newstyle_ || gen_dynamic_ || gen_tornado_) {
-      extends_if = "(object)";
-    }
-  }
-
-  f_service_ << "class Iface" << extends_if << ":" << endl;
-  indent_up();
-  generate_python_docstring(f_service_, tservice);
-  vector<t_function*> functions = tservice->get_functions();
-  if (functions.empty()) {
-    f_service_ << indent() << "pass" << endl;
-  } else {
-    vector<t_function*>::iterator f_iter;
-    for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      f_service_ << indent() << "def " << function_signature(*f_iter, true) << ":" << endl;
-      indent_up();
-      generate_python_docstring(f_service_, (*f_iter));
-      f_service_ << indent() << "pass" << endl << endl;
-      indent_down();
-    }
-  }
-
-  indent_down();
-  f_service_ << endl;
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_py_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    if (gen_twisted_) {
-      extends_client = "(" + extends + ".Client)";
-    } else {
-      extends_client = extends + ".Client, ";
-    }
-  } else {
-    if (gen_twisted_ && (gen_newstyle_ || gen_dynamic_)) {
-      extends_client = "(object)";
-    }
-  }
-
-  if (gen_twisted_) {
-    f_service_ << "class Client" << extends_client << ":" << endl << "  implements(Iface)" << endl
-               << endl;
-  } else {
-    f_service_ << "class Client(" << extends_client << "Iface):" << endl;
-  }
-  indent_up();
-  generate_python_docstring(f_service_, tservice);
-
-  // Constructor function
-  if (gen_twisted_) {
-    f_service_ << indent() << "def __init__(self, transport, oprot_factory):" << endl;
-  } else if (gen_tornado_) {
-    f_service_ << indent()
-               << "def __init__(self, transport, iprot_factory, oprot_factory=None):" << endl;
-  } else {
-    f_service_ << indent() << "def __init__(self, iprot, oprot=None):" << endl;
-  }
-  if (extends.empty()) {
-    if (gen_twisted_) {
-      f_service_ << indent() << "  self._transport = transport" << endl << indent()
-                 << "  self._oprot_factory = oprot_factory" << endl << indent()
-                 << "  self._seqid = 0" << endl << indent() << "  self._reqs = {}" << endl << endl;
-    } else if (gen_tornado_) {
-      f_service_ << indent() << "  self._transport = transport" << endl << indent()
-                 << "  self._iprot_factory = iprot_factory" << endl << indent()
-                 << "  self._oprot_factory = (oprot_factory if oprot_factory is not None" << endl
-                 << indent() << "                         else iprot_factory)" << endl << indent()
-                 << "  self._seqid = 0" << endl << indent() << "  self._reqs = {}" << endl
-                 << indent() << "  self._transport.io_loop.spawn_callback(self._start_receiving)"
-                 << endl << endl;
-    } else {
-      f_service_ << indent() << "  self._iprot = self._oprot = iprot" << endl << indent()
-                 << "  if oprot is not None:" << endl << indent() << "    self._oprot = oprot"
-                 << endl << indent() << "  self._seqid = 0" << endl << endl;
-    }
-  } else {
-    if (gen_twisted_) {
-      f_service_ << indent() << "  " << extends
-                 << ".Client.__init__(self, transport, oprot_factory)" << endl << endl;
-    } else if (gen_tornado_) {
-      f_service_ << indent() << "  " << extends
-                 << ".Client.__init__(self, transport, iprot_factory, oprot_factory)" << endl
-                 << endl;
-    } else {
-      f_service_ << indent() << "  " << extends << ".Client.__init__(self, iprot, oprot)" << endl
-                 << endl;
-    }
-  }
-
-  if (gen_tornado_ && extends.empty()) {
-    f_service_ << indent() << "@gen.engine" << endl << indent()
-               << "def _start_receiving(self):" << endl << indent() << "  while True:" << endl
-               << indent() << "    try:" << endl << indent()
-               << "      frame = yield self._transport.readFrame()" << endl << indent()
-               << "    except TTransport.TTransportException as e:" << endl << indent()
-               << "      for future in self._reqs.itervalues():" << endl << indent()
-               << "        future.set_exception(e)" << endl << indent() << "      self._reqs = {}"
-               << endl << indent() << "      return" << endl << indent()
-               << "    tr = TTransport.TMemoryBuffer(frame)" << endl << indent()
-               << "    iprot = self._iprot_factory.getProtocol(tr)" << endl << indent()
-               << "    (fname, mtype, rseqid) = iprot.readMessageBegin()" << endl << indent()
-               << "    future = self._reqs.pop(rseqid, None)" << endl << indent()
-               << "    if not future:" << endl << indent()
-               << "      # future has already been discarded" << endl << indent()
-               << "      continue" << endl << indent()
-               << "    method = getattr(self, 'recv_' + fname)" << endl << indent()
-               << "    try:" << endl << indent() << "      result = method(iprot, mtype, rseqid)"
-               << endl << indent() << "    except Exception as e:" << endl << indent()
-               << "      future.set_exception(e)" << endl << indent() << "    else:" << endl
-               << indent() << "      future.set_result(result)" << endl << endl;
-  }
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    indent(f_service_) << "def " << function_signature(*f_iter, false) << ":" << endl;
-    indent_up();
-    generate_python_docstring(f_service_, (*f_iter));
-    if (gen_twisted_) {
-      indent(f_service_) << "seqid = self._seqid = self._seqid + 1" << endl;
-      indent(f_service_) << "self._reqs[seqid] = defer.Deferred()" << endl << endl;
-      indent(f_service_) << "d = defer.maybeDeferred(self.send_" << funname;
-
-    } else if (gen_tornado_) {
-      indent(f_service_) << "self._seqid += 1" << endl;
-      if (!(*f_iter)->is_oneway()) {
-        indent(f_service_) << "future = self._reqs[self._seqid] = concurrent.Future()" << endl;
-      }
-      indent(f_service_) << "self.send_" << funname << "(";
-
-    } else {
-      indent(f_service_) << "self.send_" << funname << "(";
-    }
-
-    bool first = true;
-    if (gen_twisted_) {
-      // we need a leading comma if there are args, since it's called as maybeDeferred(funcname,
-      // arg)
-      first = false;
-    }
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << (*fld_iter)->get_name();
-    }
-
-    f_service_ << ")" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      if (gen_twisted_) {
-        // nothing. See the next block.
-      } else if (gen_tornado_) {
-        indent(f_service_) << "return future" << endl;
-      } else {
-        f_service_ << indent();
-        if (!(*f_iter)->get_returntype()->is_void()) {
-          f_service_ << "return ";
-        }
-        f_service_ << "self.recv_" << funname << "()" << endl;
-      }
-    }
-    indent_down();
-
-    if (gen_twisted_) {
-      // This block injects the body of the send_<> method for twisted (and a cb/eb pair)
-      indent_up();
-      indent(f_service_) << "d.addCallbacks(" << endl;
-
-      indent_up();
-      f_service_ << indent() << "callback=self.cb_send_" << funname << "," << endl << indent()
-                 << "callbackArgs=(seqid,)," << endl << indent() << "errback=self.eb_send_"
-                 << funname << "," << endl << indent() << "errbackArgs=(seqid,))" << endl;
-      indent_down();
-
-      indent(f_service_) << "return d" << endl;
-      indent_down();
-      f_service_ << endl;
-
-      indent(f_service_) << "def cb_send_" << funname << "(self, _, seqid):" << endl;
-      indent_up();
-      if ((*f_iter)->is_oneway()) {
-        // if one-way, fire the deferred & remove it from _reqs
-        f_service_ << indent() << "d = self._reqs.pop(seqid)" << endl << indent()
-                   << "d.callback(None)" << endl << indent() << "return d" << endl;
-      } else {
-        f_service_ << indent() << "return self._reqs[seqid]" << endl;
-      }
-      indent_down();
-      f_service_ << endl;
-
-      // add an errback to fail the request if the call to send_<> raised an exception
-      indent(f_service_) << "def eb_send_" << funname << "(self, f, seqid):" << endl;
-      indent_up();
-      f_service_ << indent() << "d = self._reqs.pop(seqid)" << endl << indent() << "d.errback(f)"
-                 << endl << indent() << "return d" << endl;
-      indent_down();
-    }
-
-    f_service_ << endl;
-    indent(f_service_) << "def send_" << function_signature(*f_iter, false) << ":" << endl;
-    indent_up();
-
-    std::string argsname = (*f_iter)->get_name() + "_args";
-    std::string messageType = (*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL";
-
-    // Serialize the request header
-    if (gen_twisted_ || gen_tornado_) {
-      f_service_ << indent() << "oprot = self._oprot_factory.getProtocol(self._transport)" << endl
-                 << indent() << "oprot.writeMessageBegin('" << (*f_iter)->get_name() << "', "
-                 << messageType << ", self._seqid)" << endl;
-    } else {
-      f_service_ << indent() << "self._oprot.writeMessageBegin('" << (*f_iter)->get_name() << "', "
-                 << messageType << ", self._seqid)" << endl;
-    }
-
-    f_service_ << indent() << "args = " << argsname << "()" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << endl;
-    }
-
-    // Write to the stream
-    if (gen_twisted_ || gen_tornado_) {
-      f_service_ << indent() << "args.write(oprot)" << endl << indent() << "oprot.writeMessageEnd()"
-                 << endl << indent() << "oprot.trans.flush()" << endl;
-    } else {
-      f_service_ << indent() << "args.write(self._oprot)" << endl << indent()
-                 << "self._oprot.writeMessageEnd()" << endl << indent()
-                 << "self._oprot.trans.flush()" << endl;
-    }
-
-    indent_down();
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = (*f_iter)->get_name() + "_result";
-      // Open function
-      f_service_ << endl;
-      if (gen_twisted_ || gen_tornado_) {
-        f_service_ << indent() << "def recv_" << (*f_iter)->get_name()
-                   << "(self, iprot, mtype, rseqid):" << endl;
-      } else {
-        t_struct noargs(program_);
-        t_function recv_function((*f_iter)->get_returntype(),
-                                 string("recv_") + (*f_iter)->get_name(),
-                                 &noargs);
-        f_service_ << indent() << "def " << function_signature(&recv_function) << ":" << endl;
-      }
-      indent_up();
-
-      // TODO(mcslee): Validate message reply here, seq ids etc.
-
-      if (gen_twisted_) {
-        f_service_ << indent() << "d = self._reqs.pop(rseqid)" << endl;
-      } else if (gen_tornado_) {
-      } else {
-        f_service_ << indent() << "iprot = self._iprot" << endl << indent()
-                   << "(fname, mtype, rseqid) = iprot.readMessageBegin()" << endl;
-      }
-
-      f_service_ << indent() << "if mtype == TMessageType.EXCEPTION:" << endl << indent()
-                 << "  x = TApplicationException()" << endl;
-
-      if (gen_twisted_) {
-        f_service_ << indent() << "  x.read(iprot)" << endl << indent()
-                   << "  iprot.readMessageEnd()" << endl << indent() << "  return d.errback(x)"
-                   << endl << indent() << "result = " << resultname << "()" << endl << indent()
-                   << "result.read(iprot)" << endl << indent() << "iprot.readMessageEnd()" << endl;
-      } else {
-        f_service_ << indent() << "  x.read(iprot)" << endl << indent()
-                   << "  iprot.readMessageEnd()" << endl << indent() << "  raise x" << endl
-                   << indent() << "result = " << resultname << "()" << endl << indent()
-                   << "result.read(iprot)" << endl << indent() << "iprot.readMessageEnd()" << endl;
-      }
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if result.success is not None:" << endl;
-        if (gen_twisted_) {
-          f_service_ << indent() << "  return d.callback(result.success)" << endl;
-        } else {
-          f_service_ << indent() << "  return result.success" << endl;
-        }
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if result." << (*x_iter)->get_name() << " is not None:" << endl;
-        if (gen_twisted_) {
-          f_service_ << indent() << "  return d.errback(result." << (*x_iter)->get_name() << ")"
-                     << endl;
-        } else {
-          f_service_ << indent() << "  raise result." << (*x_iter)->get_name() << "" << endl;
-        }
-      }
-
-      // Careful, only return _result if not a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        if (gen_twisted_) {
-          f_service_ << indent() << "return d.callback(None)" << endl;
-        } else {
-          f_service_ << indent() << "return" << endl;
-        }
-      } else {
-        if (gen_twisted_) {
-          f_service_
-              << indent()
-              << "return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, \""
-              << (*f_iter)->get_name() << " failed: unknown result\"))" << endl;
-        } else {
-          f_service_ << indent()
-                     << "raise TApplicationException(TApplicationException.MISSING_RESULT, \""
-                     << (*f_iter)->get_name() << " failed: unknown result\")" << endl;
-        }
-      }
-
-      // Close function
-      indent_down();
-      f_service_ << endl;
-    }
-  }
-
-  indent_down();
-  f_service_ << endl;
-}
-
-/**
- * Generates a command line tool for making remote requests
- *
- * @param tservice The service to generate a remote for.
- */
-void t_py_generator::generate_service_remote(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  // Get all function from parents
-  t_service* parent = tservice->get_extends();
-  while (parent != NULL) {
-    vector<t_function*> p_functions = parent->get_functions();
-    functions.insert(functions.end(), p_functions.begin(), p_functions.end());
-    parent = parent->get_extends();
-  }
-  vector<t_function*>::iterator f_iter;
-
-  string f_remote_name = package_dir_ + "/" + service_name_ + "-remote";
-  ofstream f_remote;
-  f_remote.open(f_remote_name.c_str());
-
-  f_remote << "#!/usr/bin/env python" << endl << py_autogen_comment() << endl << "import sys"
-           << endl << "import pprint" << endl << "from urlparse import urlparse" << endl
-           << "from thrift.transport import TTransport" << endl
-           << "from thrift.transport import TSocket" << endl
-           << "from thrift.transport import TSSLSocket" << endl
-           << "from thrift.transport import THttpClient" << endl
-           << "from thrift.protocol import TBinaryProtocol" << endl << endl;
-
-  f_remote << "from " << module_ << " import " << service_name_ << endl << "from " << module_
-           << ".ttypes import *" << endl << endl;
-
-  f_remote << "if len(sys.argv) <= 1 or sys.argv[1] == '--help':" << endl << "  print('')" << endl
-           << "  print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] "
-              "function [arg1 [arg2...]]')" << endl << "  print('')" << endl
-           << "  print('Functions:')" << endl;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_remote << "  print('  " << (*f_iter)->get_returntype()->get_name() << " "
-             << (*f_iter)->get_name() << "(";
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const std::vector<t_field*>& args = arg_struct->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    std::vector<t_field*>::size_type num_args = args.size();
-    bool first = true;
-    for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) {
-      if (first) {
-        first = false;
-      } else {
-        f_remote << ", ";
-      }
-      f_remote << args[i]->get_type()->get_name() << " " << args[i]->get_name();
-    }
-    f_remote << ")')" << endl;
-  }
-  f_remote << "  print('')" << endl << "  sys.exit(0)" << endl << endl;
-
-  f_remote << "pp = pprint.PrettyPrinter(indent = 2)" << endl << "host = 'localhost'" << endl
-           << "port = 9090" << endl << "uri = ''" << endl << "framed = False" << endl
-           << "ssl = False" << endl << "http = False" << endl << "argi = 1" << endl << endl
-           << "if sys.argv[argi] == '-h':" << endl << "  parts = sys.argv[argi+1].split(':')"
-           << endl << "  host = parts[0]" << endl << "  if len(parts) > 1:" << endl
-           << "    port = int(parts[1])" << endl << "  argi += 2" << endl << endl
-           << "if sys.argv[argi] == '-u':" << endl << "  url = urlparse(sys.argv[argi+1])" << endl
-           << "  parts = url[1].split(':')" << endl << "  host = parts[0]" << endl
-           << "  if len(parts) > 1:" << endl << "    port = int(parts[1])" << endl
-           << "  else:" << endl << "    port = 80" << endl << "  uri = url[2]" << endl
-           << "  if url[4]:" << endl << "    uri += '?%s' % url[4]" << endl << "  http = True"
-           << endl << "  argi += 2" << endl << endl
-           << "if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':" << endl
-           << "  framed = True" << endl << "  argi += 1" << endl << endl
-           << "if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':" << endl << "  ssl = True"
-           << endl << "  argi += 1" << endl << endl << "cmd = sys.argv[argi]" << endl
-           << "args = sys.argv[argi+1:]" << endl << endl << "if http:" << endl
-           << "  transport = THttpClient.THttpClient(host, port, uri)" << endl << "else:" << endl
-           << "  socket = TSSLSocket.TSSLSocket(host, port, validate=False) if ssl else "
-              "TSocket.TSocket(host, port)" << endl << "  if framed:" << endl
-           << "    transport = TTransport.TFramedTransport(socket)" << endl << "  else:" << endl
-           << "    transport = TTransport.TBufferedTransport(socket)" << endl
-           << "protocol = TBinaryProtocol.TBinaryProtocol(transport)" << endl
-           << "client = " << service_name_ << ".Client(protocol)" << endl << "transport.open()"
-           << endl << endl;
-
-  // Generate the dispatch methods
-  bool first = true;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_remote << "el";
-    }
-
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const std::vector<t_field*>& args = arg_struct->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    std::vector<t_field*>::size_type num_args = args.size();
-
-    f_remote << "if cmd == '" << (*f_iter)->get_name() << "':" << endl
-             << "  if len(args) != " << num_args << ":" << endl << "    print('"
-             << (*f_iter)->get_name() << " requires " << num_args << " args')" << endl
-             << "    sys.exit(1)" << endl << "  pp.pprint(client." << (*f_iter)->get_name() << "(";
-    for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) {
-      if (args[i]->get_type()->is_string()) {
-        f_remote << "args[" << i << "],";
-      } else {
-        f_remote << "eval(args[" << i << "]),";
-      }
-    }
-    f_remote << "))" << endl;
-
-    f_remote << endl;
-  }
-
-  if (functions.size() > 0) {
-    f_remote << "else:" << endl;
-    f_remote << "  print('Unrecognized method %s' % cmd)" << endl;
-    f_remote << "  sys.exit(1)" << endl;
-    f_remote << endl;
-  }
-
-  f_remote << "transport.close()" << endl;
-
-  // Close service file
-  f_remote.close();
-
-#ifndef _MSC_VER
-
-  // Make file executable, love that bitwise OR action
-  chmod(f_remote_name.c_str(),
-        S_IRUSR | S_IWUSR | S_IXUSR
-#ifndef _WIN32
-        | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH
-#endif
-        );
-
-#endif // _MSC_VER
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_py_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_processor = extends + ".Processor, ";
-  }
-
-  // Generate the header portion
-  if (gen_twisted_) {
-    f_service_ << "class Processor(" << extends_processor << "TProcessor):" << endl
-               << "  implements(Iface)" << endl << endl;
-  } else {
-    f_service_ << "class Processor(" << extends_processor << "Iface, TProcessor):" << endl;
-  }
-
-  indent_up();
-
-  indent(f_service_) << "def __init__(self, handler):" << endl;
-  indent_up();
-  if (extends.empty()) {
-    if (gen_twisted_) {
-      f_service_ << indent() << "self._handler = Iface(handler)" << endl;
-    } else {
-      f_service_ << indent() << "self._handler = handler" << endl;
-    }
-
-    f_service_ << indent() << "self._processMap = {}" << endl;
-  } else {
-    if (gen_twisted_) {
-      f_service_ << indent() << extends << ".Processor.__init__(self, Iface(handler))" << endl;
-    } else {
-      f_service_ << indent() << extends << ".Processor.__init__(self, handler)" << endl;
-    }
-  }
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "self._processMap[\"" << (*f_iter)->get_name()
-               << "\"] = Processor.process_" << (*f_iter)->get_name() << endl;
-  }
-  indent_down();
-  f_service_ << endl;
-
-  // Generate the server implementation
-  f_service_ << indent() << "def process(self, iprot, oprot):" << endl;
-  indent_up();
-
-  f_service_ << indent() << "(name, type, seqid) = iprot.readMessageBegin()" << endl;
-
-  // TODO(mcslee): validate message
-
-  // HOT: dictionary function lookup
-  f_service_ << indent() << "if name not in self._processMap:" << endl << indent()
-             << "  iprot.skip(TType.STRUCT)" << endl << indent() << "  iprot.readMessageEnd()"
-             << endl << indent()
-             << "  x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown "
-                "function %s' % (name))" << endl << indent()
-             << "  oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid)" << endl << indent()
-             << "  x.write(oprot)" << endl << indent() << "  oprot.writeMessageEnd()" << endl
-             << indent() << "  oprot.trans.flush()" << endl;
-
-  if (gen_twisted_) {
-    f_service_ << indent() << "  return defer.succeed(None)" << endl;
-  } else {
-    f_service_ << indent() << "  return" << endl;
-  }
-
-  f_service_ << indent() << "else:" << endl;
-
-  if (gen_twisted_ || gen_tornado_) {
-    f_service_ << indent() << "  return self._processMap[name](self, seqid, iprot, oprot)" << endl;
-  } else {
-    f_service_ << indent() << "  self._processMap[name](self, seqid, iprot, oprot)" << endl;
-
-    // Read end of args field, the T_STOP, and the struct close
-    f_service_ << indent() << "return True" << endl;
-  }
-
-  indent_down();
-  f_service_ << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  f_service_ << endl;
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_py_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open function
-  if (gen_tornado_) {
-    f_service_ << indent() << "@gen.coroutine" << endl << indent() << "def process_"
-               << tfunction->get_name() << "(self, seqid, iprot, oprot):" << endl;
-  } else {
-    f_service_ << indent() << "def process_" << tfunction->get_name()
-               << "(self, seqid, iprot, oprot):" << endl;
-  }
-
-  indent_up();
-
-  string argsname = tfunction->get_name() + "_args";
-  string resultname = tfunction->get_name() + "_result";
-
-  f_service_ << indent() << "args = " << argsname << "()" << endl << indent() << "args.read(iprot)"
-             << endl << indent() << "iprot.readMessageEnd()" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "result = " << resultname << "()" << endl;
-  }
-
-  if (gen_twisted_) {
-    // TODO: Propagate arbitrary exception raised by handler to client as does plain "py"
-
-    // Generate the function call
-    t_struct* arg_struct = tfunction->get_arglist();
-    const std::vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    f_service_ << indent() << "d = defer.maybeDeferred(self._handler." << tfunction->get_name()
-               << ", ";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-    f_service_ << ")" << endl;
-
-    // Shortcut out here for oneway functions
-    if (tfunction->is_oneway()) {
-      f_service_ << indent() << "return d" << endl;
-      indent_down();
-      f_service_ << endl;
-      return;
-    }
-
-    f_service_ << indent() << "d.addCallback(self.write_results_success_" << tfunction->get_name()
-               << ", result, seqid, oprot)" << endl;
-
-    if (xceptions.size() > 0) {
-      f_service_ << indent() << "d.addErrback(self.write_results_exception_"
-                 << tfunction->get_name() << ", result, seqid, oprot)" << endl;
-    }
-
-    f_service_ << indent() << "return d" << endl;
-
-    indent_down();
-    f_service_ << endl;
-
-    indent(f_service_) << "def write_results_success_" << tfunction->get_name()
-                       << "(self, success, result, seqid, oprot):" << endl;
-    indent_up();
-    f_service_ << indent() << "result.success = success" << endl << indent()
-               << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-               << "\", TMessageType.REPLY, seqid)" << endl << indent() << "result.write(oprot)"
-               << endl << indent() << "oprot.writeMessageEnd()" << endl << indent()
-               << "oprot.trans.flush()" << endl;
-    indent_down();
-    f_service_ << endl;
-
-    // Try block for a function with exceptions
-    if (!tfunction->is_oneway() && xceptions.size() > 0) {
-      indent(f_service_) << "def write_results_exception_" << tfunction->get_name()
-                         << "(self, error, result, seqid, oprot):" << endl;
-      indent_up();
-      f_service_ << indent() << "try:" << endl;
-
-      // Kinda absurd
-      f_service_ << indent() << "  error.raiseException()" << endl;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
-                   << (*x_iter)->get_name() << ":" << endl;
-        if (!tfunction->is_oneway()) {
-          indent_up();
-          f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                     << (*x_iter)->get_name() << endl;
-          indent_down();
-        } else {
-          f_service_ << indent() << "pass" << endl;
-        }
-      }
-      f_service_ << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", TMessageType.REPLY, seqid)" << endl << indent() << "result.write(oprot)"
-                 << endl << indent() << "oprot.writeMessageEnd()" << endl << indent()
-                 << "oprot.trans.flush()" << endl;
-      indent_down();
-      f_service_ << endl;
-    }
-
-  } else if (gen_tornado_) {
-    /*
-    if (!tfunction->is_oneway() && xceptions.size() > 0) {
-      f_service_ <<
-        endl <<
-        indent() << "def handle_exception(xtype, value, traceback):" << endl;
-
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ <<
-          indent() << "  if xtype == " << type_name((*x_iter)->get_type()) << ":" << endl;
-        if (!tfunction->is_oneway()) {
-          f_service_ <<
-            indent() << "    result." << (*x_iter)->get_name() << " = value" << endl;
-        }
-        f_service_ <<
-          indent() << "    return True" << endl;
-      }
-
-      f_service_ <<
-        endl <<
-        indent() << "try:" << endl;
-      indent_up();
-    }
-    */
-
-    // TODO: Propagate arbitrary exception raised by handler to client as does plain "py"
-
-    // Generate the function call
-    t_struct* arg_struct = tfunction->get_arglist();
-    const std::vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    if (xceptions.size() > 0) {
-      f_service_ << indent() << "try:" << endl;
-      indent_up();
-    }
-    f_service_ << indent();
-    if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-      f_service_ << "result.success = ";
-    }
-    f_service_ << "yield gen.maybe_future(self._handler." << tfunction->get_name() << "(";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-    f_service_ << "))" << endl;
-
-    if (!tfunction->is_oneway() && xceptions.size() > 0) {
-      indent_down();
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
-                   << (*x_iter)->get_name() << ":" << endl;
-        if (!tfunction->is_oneway()) {
-          indent_up();
-          f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                     << (*x_iter)->get_name() << endl;
-          indent_down();
-        } else {
-          f_service_ << indent() << "pass" << endl;
-        }
-      }
-    }
-
-    if (!tfunction->is_oneway()) {
-      f_service_ << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", TMessageType.REPLY, seqid)" << endl << indent() << "result.write(oprot)"
-                 << endl << indent() << "oprot.writeMessageEnd()" << endl << indent()
-                 << "oprot.trans.flush()" << endl;
-    }
-
-    // Close function
-    indent_down();
-    f_service_ << endl;
-
-  } else { // py
-    // Try block for a function with exceptions
-    // It also catches arbitrary exceptions raised by handler method to propagate them to the client
-    f_service_ << indent() << "try:" << endl;
-    indent_up();
-
-    // Generate the function call
-    t_struct* arg_struct = tfunction->get_arglist();
-    const std::vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    f_service_ << indent();
-    if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-      f_service_ << "result.success = ";
-    }
-    f_service_ << "self._handler." << tfunction->get_name() << "(";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-    f_service_ << ")" << endl << indent() << "msg_type = TMessageType.REPLY" << endl;
-
-    indent_down();
-    f_service_ << indent()
-               << "except (TTransport.TTransportException, KeyboardInterrupt, SystemExit):" << endl
-               << indent() << "  raise" << endl;
-
-    if (!tfunction->is_oneway()) {
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "except " << type_name((*x_iter)->get_type()) << " as "
-                   << (*x_iter)->get_name() << ":" << endl;
-        indent_up();
-        f_service_ << indent() << "msg_type = TMessageType.REPLY" << endl
-                   << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << endl;
-        indent_down();
-      }
-
-      f_service_ << indent() << "except Exception as ex:" << endl
-                 << indent() << "  msg_type = TMessageType.EXCEPTION" << endl
-                 << indent() << "  logging.exception(ex)" << endl
-                 << indent()
-                 << "  result = TApplicationException(TApplicationException.INTERNAL_ERROR, "
-                    "'Internal error')" << endl
-                 << indent() << "oprot.writeMessageBegin(\"" << tfunction->get_name()
-                 << "\", msg_type, seqid)" << endl
-                 << indent() << "result.write(oprot)" << endl
-                 << indent() << "oprot.writeMessageEnd()" << endl
-                 << indent() << "oprot.trans.flush()" << endl;
-    } else {
-      f_service_ << indent() << "except:" << endl
-                 << indent() << "  pass" << endl;
-    }
-
-    // Close function
-    indent_down();
-    f_service_ << endl;
-  }
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_py_generator::generate_deserialize_field(ofstream& out,
-                                                t_field* tfield,
-                                                string prefix,
-                                                bool inclass) {
-  (void)inclass;
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << name << " = iprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary() || !gen_utf8strings_) {
-          out << "readString()";
-        } else {
-          out << "readString().decode('utf-8')";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool()";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte()";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16()";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32()";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64()";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble()";
-        break;
-      default:
-        throw "compiler error: no Python name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32()";
-    }
-    out << endl;
-
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a struct, calling read()
- */
-void t_py_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  out << indent() << prefix << " = " << type_name(tstruct) << "()" << endl << indent() << prefix
-      << ".read(iprot)" << endl;
-}
-
-/**
- * Serialize a container by writing out the header followed by
- * data and then a footer.
- */
-void t_py_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    out << indent() << prefix << " = {}" << endl << indent() << "(" << ktype << ", " << vtype
-        << ", " << size << " ) = iprot.readMapBegin()" << endl;
-  } else if (ttype->is_set()) {
-    out << indent() << prefix << " = set()" << endl << indent() << "(" << etype << ", " << size
-        << ") = iprot.readSetBegin()" << endl;
-  } else if (ttype->is_list()) {
-    out << indent() << prefix << " = []" << endl << indent() << "(" << etype << ", " << size
-        << ") = iprot.readListBegin()" << endl;
-  }
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for " << i << " in xrange(" << size << "):" << endl;
-
-  indent_up();
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  indent_down();
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd()" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd()" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd()" << endl;
-  }
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_py_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("_key");
-  string val = tmp("_val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << prefix << "[" << key << "] = " << val << endl;
-}
-
-/**
- * Write a set element
- */
-void t_py_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".add(" << elem << ")" << endl;
-}
-
-/**
- * Write a list element
- */
-void t_py_generator::generate_deserialize_list_element(ofstream& out,
-                                                       t_list* tlist,
-                                                       string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".append(" << elem << ")" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_py_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + tfield->get_name());
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + tfield->get_name());
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = prefix + tfield->get_name();
-
-    indent(out) << "oprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary() || !gen_utf8strings_) {
-          out << "writeString(" << name << ")";
-        } else {
-          out << "writeString(" << name << ".encode('utf-8'))";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ")";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ")";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ")";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ")";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ")";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ")";
-        break;
-      default:
-        throw "compiler error: no Python name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32(" << name << ")";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_py_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << prefix << ".write(oprot)" << endl;
-}
-
-void t_py_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "len(" << prefix << "))" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "len(" << prefix << "))" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                << ", "
-                << "len(" << prefix << "))" << endl;
-  }
-
-  if (ttype->is_map()) {
-    string kiter = tmp("kiter");
-    string viter = tmp("viter");
-    indent(out) << "for " << kiter << "," << viter << " in " << prefix << ".items():" << endl;
-    indent_up();
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    indent_down();
-  } else if (ttype->is_set()) {
-    string iter = tmp("iter");
-    indent(out) << "for " << iter << " in " << prefix << ":" << endl;
-    indent_up();
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    indent_down();
-  } else if (ttype->is_list()) {
-    string iter = tmp("iter");
-    indent(out) << "for " << iter << " in " << prefix << ":" << endl;
-    indent_up();
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    indent_down();
-  }
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd()" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd()" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd()" << endl;
-  }
-}
-
-/**
- * Serializes the members of a map.
- *
- */
-void t_py_generator::generate_serialize_map_element(ofstream& out,
-                                                    t_map* tmap,
-                                                    string kiter,
-                                                    string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield, "");
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield, "");
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_py_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_py_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Generates the docstring for a given struct.
- */
-void t_py_generator::generate_python_docstring(ofstream& out, t_struct* tstruct) {
-  generate_python_docstring(out, tstruct, tstruct, "Attributes");
-}
-
-/**
- * Generates the docstring for a given function.
- */
-void t_py_generator::generate_python_docstring(ofstream& out, t_function* tfunction) {
-  generate_python_docstring(out, tfunction, tfunction->get_arglist(), "Parameters");
-}
-
-/**
- * Generates the docstring for a struct or function.
- */
-void t_py_generator::generate_python_docstring(ofstream& out,
-                                               t_doc* tdoc,
-                                               t_struct* tstruct,
-                                               const char* subheader) {
-  bool has_doc = false;
-  stringstream ss;
-  if (tdoc->has_doc()) {
-    has_doc = true;
-    ss << tdoc->get_doc();
-  }
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  if (fields.size() > 0) {
-    if (has_doc) {
-      ss << endl;
-    }
-    has_doc = true;
-    ss << subheader << ":\n";
-    vector<t_field*>::const_iterator p_iter;
-    for (p_iter = fields.begin(); p_iter != fields.end(); ++p_iter) {
-      t_field* p = *p_iter;
-      ss << " - " << p->get_name();
-      if (p->has_doc()) {
-        ss << ": " << p->get_doc();
-      } else {
-        ss << endl;
-      }
-    }
-  }
-
-  if (has_doc) {
-    generate_docstring_comment(out, "\"\"\"\n", "", ss.str(), "\"\"\"\n");
-  }
-}
-
-/**
- * Generates the docstring for a generic object.
- */
-void t_py_generator::generate_python_docstring(ofstream& out, t_doc* tdoc) {
-  if (tdoc->has_doc()) {
-    generate_docstring_comment(out, "\"\"\"\n", "", tdoc->get_doc(), "\"\"\"\n");
-  }
-}
-
-/**
- * Declares an argument, which may include initialization as necessary.
- *
- * @param tfield The field
- */
-string t_py_generator::declare_argument(t_field* tfield) {
-  std::ostringstream result;
-  result << tfield->get_name() << "=";
-  if (tfield->get_value() != NULL) {
-    result << "thrift_spec[" << tfield->get_key() << "][4]";
-  } else {
-    result << "None";
-  }
-  return result.str();
-}
-
-/**
- * Renders a field default value, returns None otherwise.
- *
- * @param tfield The field
- */
-string t_py_generator::render_field_default_value(t_field* tfield) {
-  t_type* type = get_true_type(tfield->get_type());
-  if (tfield->get_value() != NULL) {
-    return render_const_value(type, tfield->get_value());
-  } else {
-    return "None";
-  }
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_py_generator::function_signature(t_function* tfunction, bool interface) {
-  vector<string> pre;
-  vector<string> post;
-  string signature = tfunction->get_name() + "(";
-
-  if (!(gen_twisted_ && interface)) {
-    pre.push_back("self");
-  }
-
-  signature += argument_list(tfunction->get_arglist(), &pre, &post) + ")";
-  return signature;
-}
-
-/**
- * Renders a field list
- */
-string t_py_generator::argument_list(t_struct* tstruct, vector<string>* pre, vector<string>* post) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  vector<string>::const_iterator s_iter;
-  bool first = true;
-  if (pre) {
-    for (s_iter = pre->begin(); s_iter != pre->end(); ++s_iter) {
-      if (first) {
-        first = false;
-      } else {
-        result += ", ";
-      }
-      result += *s_iter;
-    }
-  }
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += (*f_iter)->get_name();
-  }
-  if (post) {
-    for (s_iter = post->begin(); s_iter != post->end(); ++s_iter) {
-      if (first) {
-        first = false;
-      } else {
-        result += ", ";
-      }
-      result += *s_iter;
-    }
-  }
-  return result;
-}
-
-string t_py_generator::type_name(t_type* ttype) {
-  while (ttype->is_typedef()) {
-    ttype = ((t_typedef*)ttype)->get_type();
-  }
-
-  t_program* program = ttype->get_program();
-  if (ttype->is_service()) {
-    return get_real_py_module(program, gen_twisted_) + "." + ttype->get_name();
-  }
-  if (program != NULL && program != program_) {
-    return get_real_py_module(program, gen_twisted_) + ".ttypes." + ttype->get_name();
-  }
-  return ttype->get_name();
-}
-
-/**
- * Converts the parse type to a Python tyoe
- */
-string t_py_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "TType.I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_list()) {
-    return "TType.LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/** See the comment inside generate_py_struct_definition for what this is. */
-string t_py_generator::type_to_spec_args(t_type* ttype) {
-  while (ttype->is_typedef()) {
-    ttype = ((t_typedef*)ttype)->get_type();
-  }
-
-  if (ttype->is_base_type() || ttype->is_enum()) {
-    return "None";
-  } else if (ttype->is_struct() || ttype->is_xception()) {
-    return "(" + type_name(ttype) + ", " + type_name(ttype) + ".thrift_spec)";
-  } else if (ttype->is_map()) {
-    return "(" + type_to_enum(((t_map*)ttype)->get_key_type()) + ","
-           + type_to_spec_args(((t_map*)ttype)->get_key_type()) + ","
-           + type_to_enum(((t_map*)ttype)->get_val_type()) + ","
-           + type_to_spec_args(((t_map*)ttype)->get_val_type()) + ")";
-
-  } else if (ttype->is_set()) {
-    return "(" + type_to_enum(((t_set*)ttype)->get_elem_type()) + ","
-           + type_to_spec_args(((t_set*)ttype)->get_elem_type()) + ")";
-
-  } else if (ttype->is_list()) {
-    return "(" + type_to_enum(((t_list*)ttype)->get_elem_type()) + ","
-           + type_to_spec_args(((t_list*)ttype)->get_elem_type()) + ")";
-  }
-
-  throw "INVALID TYPE IN type_to_spec_args: " + ttype->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(
-    py,
-    "Python",
-    "    new_style:       Generate new-style classes.\n"
-    "    twisted:         Generate Twisted-friendly RPC services.\n"
-    "    tornado:         Generate code for use with Tornado.\n"
-    "    utf8strings:     Encode/decode strings using utf8 in the generated code.\n"
-    "    coding=CODING:   Add file encoding declare in generated file.\n"
-    "    slots:           Generate code using slots for instance members.\n"
-    "    dynamic:         Generate dynamic code, less code generated but slower.\n"
-    "    dynbase=CLS      Derive generated classes from class CLS instead of TBase.\n"
-    "    dynexc=CLS       Derive generated exceptions from CLS instead of TExceptionBase.\n"
-    "    dynimport='from foo.bar import CLS'\n"
-    "                     Add an import line to generated code to find the dynbase class.\n")



[20/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Client.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Client.cs b/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Client.cs
deleted file mode 100644
index 2408041..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Client.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Rebus;
-using Rebus.Configuration;
-using Rebus.Messages;
-using Rebus.RabbitMQ;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Thrift.Protocol;
-using Thrift.Transport;
-
-/*
- * The client emits calls to BasicMathServers
- * 
- * The client implements the BasicMathClient service. 
- * If the server has processed our request, we get the results back through this service
- */
-
-namespace RebusSample.Client
-{
-
-    // handler to be registered with Rebus
-    class MathResponseCallHandler : IHandleMessages<MathResponseCall>
-    {
-        public void Handle(MathResponseCall message)
-        {
-            // Thrift protocol/transport stack
-            var stm = new MemoryStream(message.rawBytes);
-            var trns = new TStreamTransport(stm, null);
-            var prot = new TBinaryProtocol(trns);
-
-            // create a processor and let him handle the call
-            var hndl = new MathResponsesHandler();
-            var proc = new BasicMathClient.Processor(hndl);
-            proc.Process(prot, null);  // oneway only
-        }      
-    }
-
-
-    // serves incoming responses with calculation results
-    internal class MathResponsesHandler : BasicMathClient.Iface
-    {
-        public void FourResults(int added, int multiplied, int subtracted, int divided)
-        {
-            Console.WriteLine("added = {0}", added);
-            Console.WriteLine("multiplied= {0}", multiplied);
-            Console.WriteLine("subtracted = {0}", subtracted);
-            Console.WriteLine("divided = {0}", divided);
-
-            PingAndDoAnotherCalculation();
-        }
-
-
-        public void ThreeResults(int added, int multiplied, int subtracted)
-        {
-            Console.WriteLine("added = {0}", added);
-            Console.WriteLine("multiplied= {0}", multiplied);
-            Console.WriteLine("subtracted = {0}", subtracted);
-            Console.WriteLine("DIV/0 error during division");
-
-            PingAndDoAnotherCalculation();
-        }
-
-
-        public void Pong(long value)
-        {
-            var latency = DateTime.Now.Ticks - value;
-            Console.WriteLine("Ping took {0} ms", new DateTime(latency).Millisecond);
-        }
-
-
-        private void PingAndDoAnotherCalculation()
-        {
-            var random = new Random();
-            var client = new MathRequestClient("localhost");
-            client.Ping(DateTime.Now.Ticks);
-            client.DoTheMath(random.Next(), random.Next());
-        }
-    }
-
-
-    // provides the client-side interface for calculation requests
-    internal class MathRequestClient : BasicMathServer.Iface
-    {
-        private BuiltinContainerAdapter MQAdapter;
-
-
-        public MathRequestClient(string server)
-        {
-            MQAdapter = new BuiltinContainerAdapter();
-            Configure.With(MQAdapter)
-                .Transport(t => t.UseRabbitMqInOneWayMode("amqp://" + server))  // we need send only
-                .MessageOwnership(o => o.FromRebusConfigurationSection())
-                .CreateBus().Start();
-        }
-
-
-        public void SerializeThriftCall(Action<BasicMathServer.Iface> action)
-        {
-            // Thrift protocol/transport stack
-            var stm = new MemoryStream();
-            var trns = new TStreamTransport(null, stm);
-            var prot = new TBinaryProtocol(trns);
-            
-            // serialize the call into a bunch of bytes
-            var client = new BasicMathServer.Client(prot);
-            if( action != null)
-                action(client);
-            else
-                throw new ArgumentException("action must not be null");
-
-            // make sure everything is written to the MemoryStream
-            trns.Flush();
-
-            // send the message
-            var msg = new MathRequestCall() { rawBytes = stm.ToArray() };
-            MQAdapter.Bus.Send(msg);
-        }
-
-
-        public void Ping(long value)
-        {
-            SerializeThriftCall(client =>
-            {
-                client.Ping(value);
-            });
-        }
-
-
-        public void DoTheMath( int arg1, int arg2)
-        {
-            SerializeThriftCall(client =>
-            {
-                client.DoTheMath(arg1, arg2);
-            });
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Server.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Server.cs b/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Server.cs
deleted file mode 100644
index 149d513..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Server.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Rebus;
-using Rebus.Configuration;
-using Rebus.Messages;
-using Rebus.RabbitMQ;
-using System;
-using System.Collections.Generic;
-using System.IO;
-using Thrift.Protocol;
-using Thrift.Transport;
-
-/*
- * The server implements the BasicMathServer service .
- * All results are sent back to the client via the BasicMathClient service
- */
-
-
-namespace RebusSample.Server
-{
-    // handler to be registered with Rebus
-    class MathRequestCallHandler : IHandleMessages<MathRequestCall>
-    {
-        public void Handle(MathRequestCall message)
-        {
-            // Thrift protocol/transport stack
-            var stm = new MemoryStream(message.rawBytes);
-            var trns = new TStreamTransport(stm, null);
-            var prot = new TBinaryProtocol(trns);
-
-            // create a processor and let him handle the call
-            var hndl = new MathRequestsHandler();
-            var proc = new BasicMathServer.Processor(hndl);
-            proc.Process(prot, null);  // oneway only
-        }
-    }
-
-
-    // serves incoming calculation requests
-    internal class MathRequestsHandler : BasicMathServer.Iface
-    {
-        public void Ping(long value)
-        {
-            var client = new MathResponseClient("localhost");
-            client.Pong(value);
-        }
-
-
-        public void DoTheMath(int arg1, int arg2)
-        {
-            var client = new MathResponseClient("localhost");
-            if( arg2 != 0)
-                client.FourResults( arg1+arg2, arg1*arg2, arg1-arg2, arg1/arg2);
-            else
-                client.ThreeResults( arg1+arg2, arg1*arg2, arg1-arg2);
-        }
-    }
-
-
-    // provides the client-side interface for calculation responses
-    internal class MathResponseClient : BasicMathClient.Iface
-    {
-        private BuiltinContainerAdapter MQAdapter;
-
-
-        public MathResponseClient(string server)
-        {
-            MQAdapter = new BuiltinContainerAdapter();
-            Configure.With(MQAdapter)
-                .Transport(t => t.UseRabbitMqInOneWayMode("amqp://" + server))  // we need send only
-                .MessageOwnership(o => o.FromRebusConfigurationSection())
-                .CreateBus().Start();
-        }
-
-
-        public void SerializeThriftCall(Action<BasicMathClient.Iface> action)
-        {
-            // Thrift protocol/transport stack
-            var stm = new MemoryStream();
-            var trns = new TStreamTransport(null, stm);
-            var prot = new TBinaryProtocol(trns);
-
-            // serialize the call into a bunch of bytes
-            var client = new BasicMathClient.Client(prot);
-            if (action != null)
-                action(client);
-            else
-                throw new ArgumentException("action must not be null");
-
-            // make sure everything is written to the MemoryStream
-            trns.Flush();
-
-            // send the message
-            var msg = new MathResponseCall() { rawBytes = stm.ToArray() };
-            MQAdapter.Bus.Send(msg);
-        }
-
-
-        public void Pong(long value)
-        {
-            SerializeThriftCall(client =>
-            {
-                client.Pong(value);
-            });
-        }
-
-
-        public void ThreeResults(int added, int multiplied, int suctracted)
-        {
-            SerializeThriftCall(client =>
-            {
-                client.ThreeResults(added, multiplied, suctracted);
-            });
-        }
-
-
-        public void FourResults(int added, int multiplied, int suctracted, int divided)
-        {
-            SerializeThriftCall(client =>
-            {
-                client.FourResults(added, multiplied, suctracted, divided);
-            });
-        }
-    }
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/sample.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/sample.thrift b/depends/thirdparty/thrift/contrib/Rebus/sample.thrift
deleted file mode 100644
index 785e2d3..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/sample.thrift
+++ /dev/null
@@ -1,30 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-service BasicMathServer {
-    oneway void DoTheMath( 1: i32 arg1,  2: i32 arg2)
-    oneway void Ping(1: i64 value)
-}
-
-service BasicMathClient {
-    oneway void ThreeResults( 1 : i32 added, 2 : i32 multiplied, 3 : i32 subtracted);
-    oneway void FourResults(  1 : i32 added, 2 : i32 multiplied, 3 : i32 subtracted, 4 : i32 divided);
-    oneway void Pong(1: i64 value)
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Stomp/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Stomp/README.md b/depends/thirdparty/thrift/contrib/Stomp/README.md
deleted file mode 100644
index 2e5f21c..0000000
--- a/depends/thirdparty/thrift/contrib/Stomp/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-Sample code for STOMP-based Thrift clients and/or servers.
-
-Although the sample Thrift STOMP Transport is written in 
-Delphi/Pascal, it can easily serve as a starting point for 
-similar implementations in other languages.
-
-STOMP is a protocol widely supported by many messaging systems,
-such as Apache ActiveMQ, RabbitMQ and many others. In particular,
-it can be used to communicate with Service-Bus products like Rebus
-or NServiceBus, when running against a STOMP-capable MQ system.
-
-A prerequisite for this sample is the Delphi STOMP Adapter written
-by Daniele Teti (http://www.danieleteti.it/stomp-client), currently
-hosted at Google Code (http://code.google.com/p/delphistompclient).
-
-At the time of writing, the STOMP adapter does not fully support 
-binary data. Please check whether this has been fixed, otherwise 
-you have to use the JSON protocol (or to fix it on your own).

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Stomp/Thrift.Transport.STOMP.pas
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Stomp/Thrift.Transport.STOMP.pas b/depends/thirdparty/thrift/contrib/Stomp/Thrift.Transport.STOMP.pas
deleted file mode 100644
index 7dfb376..0000000
--- a/depends/thirdparty/thrift/contrib/Stomp/Thrift.Transport.STOMP.pas
+++ /dev/null
@@ -1,200 +0,0 @@
-(*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *)
-
-unit Thrift.Transport.STOMP;
-
-interface
-
-uses
-  Classes,Windows, SysUtils,
-  Thrift,
-  Thrift.Transport,
-  Thrift.Protocol,
-  Thrift.Stream,
-  StompClient,
-  StompTypes;
-
-type
-  TStompTransportImpl = class( TStreamTransportImpl)
-  strict private
-    FData     : TStringStream;
-    FServer   : string;
-    FOutQueue : string;
-    FStompCli : IStompClient;
-  protected
-    function GetIsOpen: Boolean; override;
-    function Peek: Boolean; override;
-  public
-    constructor Create( const aServerAndPort, aOutQueue : string);
-    destructor Destroy;  override;
-
-    procedure Open();  override;
-    procedure Close();  override;
-    procedure Flush;  override;
-  end;
-
-
-  TStompServerTransportImpl = class( TServerTransportImpl)
-  strict private
-    FServer  : string;
-    FInQueue : string;
-    FClient  : IStompClient;
-  protected
-    procedure Listen; override;
-    procedure Close; override;
-    function Accept( const fnAccepting: TProc): ITransport; override;
-  public
-    constructor Create( const aServerAndPort, aInQueue : string);
-    destructor Destroy;  override;
-  end;
-
-
-const
-  QUEUE_PREFIX    = '/queue/';
-  TOPIC_PREFIX    = '/topic/';
-  EXCHANGE_PREFIX = '/exchange/';
-
-
-implementation
-
-
-
-constructor TStompTransportImpl.Create( const aServerAndPort, aOutQueue : string);
-var adapter : IThriftStream;
-begin
-  FData     := TStringStream.Create;
-  FServer   := aServerAndPort;
-  FOutQueue := aOutQueue;
-
-  adapter := TThriftStreamAdapterDelphi.Create( FData, FALSE);
-  inherited Create( nil, adapter);  // output only
-end;
-
-
-destructor TStompTransportImpl.Destroy;
-begin
-  inherited Destroy;
-  FreeAndNil( FData);
-  FStompCli := nil;
-end;
-
-
-function TStompTransportImpl.GetIsOpen: Boolean;
-begin
-  result := (FStompCli <> nil);
-end;
-
-
-function TStompTransportImpl.Peek: Boolean;
-begin
-  result := FALSE;  // output only
-end;
-
-
-procedure TStompTransportImpl.Open;
-begin
-  if FStompCli <> nil
-  then raise TTransportException.Create( TTransportException.TExceptionType.AlreadyOpen, 'already open')
-  else FStompCli := StompUtils.NewStomp( FServer);
-end;
-
-
-procedure TStompTransportImpl.Close;
-begin
-  FStompCli := nil;
-  FData.Clear;
-end;
-
-
-procedure TStompTransportImpl.Flush;
-begin
-  if FStompCli = nil
-  then raise TTransportException.Create( TTransportException.TExceptionType.NotOpen, 'not open');
-
-  FStompCli.Send( FOutQueue, FData.DataString);
-  FData.Clear;
-end;
-
-
-//--- TStompServerTransportImpl --------------------------------------------
-
-
-constructor TStompServerTransportImpl.Create( const aServerAndPort, aInQueue : string);
-begin
-  inherited Create;
-  FServer  := aServerAndPort;
-  FInQueue := aInQueue;
-end;
-
-
-destructor TStompServerTransportImpl.Destroy;
-begin
-  try
-    Close;
-  finally
-    inherited Destroy;
-  end;
-end;
-
-
-procedure TStompServerTransportImpl.Listen;
-begin
-  FClient := StompUtils.NewStomp(FServer);
-  FClient.Subscribe( FInQueue);
-end;
-
-
-procedure TStompServerTransportImpl.Close;
-begin
-  if FClient <> nil then begin
-    FClient.Unsubscribe( FInQueue);
-    FClient := nil;
-  end;
-end;
-
-
-function TStompServerTransportImpl.Accept( const fnAccepting: TProc): ITransport;
-var frame   : IStompFrame;
-    adapter : IThriftStream;
-    stream  : TStringStream;
-begin
-  if FClient = nil
-  then raise TTransportException.Create( TTransportException.TExceptionType.NotOpen,
-                                         'Not connected.');
-
-  if Assigned(fnAccepting)
-  then fnAccepting();
-
-  try
-    frame := FClient.Receive(MAXINT);
-    if frame = nil then Exit(nil);
-
-    stream  := TStringStream.Create( frame.GetBody);
-    adapter := TThriftStreamAdapterDelphi.Create( stream, TRUE);
-    result  := TStreamTransportImpl.Create( adapter, nil);
-
-  except
-    on E: Exception
-    do raise TTransportException.Create( E.ToString );
-  end;
-end;
-
-
-end.
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Vagrantfile
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Vagrantfile b/depends/thirdparty/thrift/contrib/Vagrantfile
deleted file mode 100644
index d9a908d..0000000
--- a/depends/thirdparty/thrift/contrib/Vagrantfile
+++ /dev/null
@@ -1,133 +0,0 @@
-# -*- mode: ruby -*-
-# vi: set ft=ruby :
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-$build_and_test = <<SCRIPT
-echo "Provisioning system to compile and test Apache Thrift."
-
-# Create swap space
-sudo fallocate -l 2G /swapfile
-sudo chmod 600 /swapfile
-sudo mkswap /swapfile
-sudo swapon /swapfile
-sudo swapon -s
-
-# Update the system
-sudo DEBIAN_FRONTEND=noninteractive apt-get update -qq -y
-sudo DEBIAN_FRONTEND=noninteractive apt-get upgrade -qq -y
-
-# Install Dependencies
-# ---
-# General dependencies
-sudo apt-get install -qq automake libtool flex bison pkg-config g++ libssl-dev make libqt4-dev git debhelper
-
-# C++ dependencies
-sudo apt-get install -qq libboost-dev libboost-test-dev libboost-program-options-dev libboost-filesystem-dev libboost-system-dev libevent-dev 
-
-# Java dependencies
-sudo apt-get install -qq ant openjdk-7-jdk maven
-
-# Python dependencies
-sudo apt-get install -qq python-all python-all-dev python-all-dbg python-setuptools python-support
-
-# Ruby dependencies
-sudo apt-get install -qq ruby ruby-dev
-sudo gem install bundler rake
-
-# Perl dependencies
-sudo apt-get install -qq libbit-vector-perl libclass-accessor-class-perl
-
-# Php dependencies
-sudo apt-get install -qq php5 php5-dev php5-cli php-pear re2c
-
-# GlibC dependencies
-sudo apt-get install -qq libglib2.0-dev
-
-# Erlang dependencies
-sudo apt-get install -qq erlang-base erlang-eunit erlang-dev
-
-# GO dependencies
-echo "golang-go golang-go/dashboard boolean false" | debconf-set-selections
-sudo apt-get -y install -qq golang golang-go
-
-# Haskell dependencies
-sudo apt-get install -qq ghc cabal-install libghc-binary-dev libghc-network-dev libghc-http-dev libghc-hashable-dev libghc-unordered-containers-dev libghc-vector-dev
-sudo cabal update
-
-# Lua dependencies
-sudo apt-get install -qq lua5.2 lua5.2-dev
-
-# Node.js dependencies
-sudo apt-get install -qq nodejs nodejs-dev nodejs-legacy npm
-
-# CSharp
-sudo apt-get install -qq mono-gmcs mono-devel mono-xbuild mono-complete libmono-system-web2.0-cil
-sudo apt-get install -qq mingw32 mingw32-binutils mingw32-runtime nsis
-
-# D dependencies
-sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list
-sudo apt-get update && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring && sudo apt-get update
-sudo apt-get install -qq xdg-utils dmd-bin
-
-# Customize the system
-# ---
-# Default java to latest 1.7 version
-update-java-alternatives -s java-1.7.0-openjdk-amd64 
-
-# PHPUnit package broken in ubuntu. see https://bugs.launchpad.net/ubuntu/+source/phpunit/+bug/701544
-sudo apt-get upgrade pear
-sudo pear channel-discover pear.phpunit.de
-sudo pear channel-discover pear.symfony.com
-sudo pear channel-discover components.ez.no
-sudo pear update-channels
-sudo pear upgrade-all
-sudo pear install --alldeps phpunit/PHPUnit
-
-date > /etc/vagrant.provisioned
-
-# Start the source build
-# ---
-echo "Starting Apache Thrift build..."
-cd /thrift
-sh bootstrap.sh
-sh configure
-make
-make check
-echo "Finished building Apache Thrift."
-
-SCRIPT
-
-Vagrant.configure("2") do |config|
-  # Ubuntu 14.04 LTS (Trusty Tahr)
-  config.vm.box = "trusty64"
-  config.vm.box_url = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
-
-  config.vm.synced_folder "../", "/thrift"
-
-  config.vm.provider :virtualbox do |vbox|
-    vbox.customize ["modifyvm", :id, "--memory", "1024"]
-    vbox.customize ["modifyvm", :id, "--cpus", "2"]
-    vbox.customize ["modifyvm", :id, "--rtcuseutc", "on"]
-  end
-
-  # Run the build script to configure the system
-  config.vm.provision :shell, :inline => $build_and_test
-end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/async-test/aggr.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/async-test/aggr.thrift b/depends/thirdparty/thrift/contrib/async-test/aggr.thrift
deleted file mode 100644
index c016a65..0000000
--- a/depends/thirdparty/thrift/contrib/async-test/aggr.thrift
+++ /dev/null
@@ -1,8 +0,0 @@
-exception Error {
-  1: string desc;
-}
-
-service Aggr {
-  void addValue(1: i32 value);
-  list<i32> getValues() throws (1: Error err);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/async-test/test-leaf.py
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/async-test/test-leaf.py b/depends/thirdparty/thrift/contrib/async-test/test-leaf.py
deleted file mode 100755
index 8b7c3e3..0000000
--- a/depends/thirdparty/thrift/contrib/async-test/test-leaf.py
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/usr/bin/env python
-import sys
-import time
-from thrift.transport import TTransport
-from thrift.transport import TSocket
-from thrift.protocol import TBinaryProtocol
-from thrift.server import THttpServer
-from aggr import Aggr
-
-class AggrHandler(Aggr.Iface):
-  def __init__(self):
-    self.values = []
-
-  def addValue(self, value):
-    self.values.append(value)
-
-  def getValues(self, ):
-    time.sleep(1)
-    return self.values
-
-processor = Aggr.Processor(AggrHandler())
-pfactory = TBinaryProtocol.TBinaryProtocolFactory()
-THttpServer.THttpServer(processor, ('', int(sys.argv[1])), pfactory).serve()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/async-test/test-server.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/async-test/test-server.cpp b/depends/thirdparty/thrift/contrib/async-test/test-server.cpp
deleted file mode 100644
index b304e1b..0000000
--- a/depends/thirdparty/thrift/contrib/async-test/test-server.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include <tr1/functional>
-#include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/async/TAsyncProtocolProcessor.h>
-#include <thrift/async/TEvhttpServer.h>
-#include <thrift/async/TEvhttpClientChannel.h>
-#include "Aggr.h"
-
-using std::tr1::bind;
-using std::tr1::placeholders::_1;
-
-using apache::thrift::TException;
-using apache::thrift::protocol::TBinaryProtocolFactory;
-using apache::thrift::protocol::TProtocolFactory;
-using apache::thrift::async::TEvhttpServer;
-using apache::thrift::async::TAsyncProcessor;
-using apache::thrift::async::TAsyncBufferProcessor;
-using apache::thrift::async::TAsyncProtocolProcessor;
-using apache::thrift::async::TAsyncChannel;
-using apache::thrift::async::TEvhttpClientChannel;
-
-class AggrAsyncHandler : public AggrCobSvIf {
- protected:
-  struct RequestContext {
-    std::tr1::function<void(std::vector<int32_t> const& _return)> cob;
-    std::vector<int32_t> ret;
-    int pending_calls;
-  };
-
- public:
-  AggrAsyncHandler()
-    : eb_(NULL)
-    , pfact_(new TBinaryProtocolFactory())
-  {
-    leaf_ports_.push_back(8081);
-    leaf_ports_.push_back(8082);
-  }
-
-  void addValue(std::tr1::function<void()> cob, const int32_t value) {
-    // Silently drop writes to the aggrgator.
-    return cob();
-  }
-
-  void getValues(std::tr1::function<void(
-        std::vector<int32_t> const& _return)> cob,
-      std::tr1::function<void(::apache::thrift::TDelayedException* _throw)> exn_cob) {
-    RequestContext* ctx = new RequestContext();
-    ctx->cob = cob;
-    ctx->pending_calls = leaf_ports_.size();
-    for (std::vector<int>::iterator it = leaf_ports_.begin();
-        it != leaf_ports_.end(); ++it) {
-      boost::shared_ptr<TAsyncChannel> channel(
-          new TEvhttpClientChannel(
-            "localhost", "/", "127.0.0.1", *it, eb_));
-      AggrCobClient* client = new AggrCobClient(channel, pfact_.get());
-      client->getValues(std::tr1::bind(&AggrAsyncHandler::clientReturn, this, ctx, _1));
-    }
-  }
-
-  void setEventBase(struct event_base* eb) {
-    eb_ = eb;
-  }
-
-  void clientReturn(RequestContext* ctx, AggrCobClient* client) {
-    ctx->pending_calls -= 1;
-
-    try {
-      std::vector<int32_t> subret;
-      client->recv_getValues(subret);
-      ctx->ret.insert(ctx->ret.end(), subret.begin(), subret.end());
-    } catch (TException& exn) {
-      // TODO: Log error
-    }
-
-    delete client;
-
-    if (ctx->pending_calls == 0) {
-      ctx->cob(ctx->ret);
-      delete ctx;
-    }
-  }
-
- protected:
-  struct event_base* eb_;
-  std::vector<int> leaf_ports_;
-  boost::shared_ptr<TProtocolFactory> pfact_;
-};
-
-
-int main() {
-  boost::shared_ptr<AggrAsyncHandler> handler(new AggrAsyncHandler());
-  boost::shared_ptr<TAsyncProcessor> proc(new AggrAsyncProcessor(handler));
-  boost::shared_ptr<TProtocolFactory> pfact(new TBinaryProtocolFactory());
-  boost::shared_ptr<TAsyncBufferProcessor> bufproc(new TAsyncProtocolProcessor(proc, pfact));
-  boost::shared_ptr<TEvhttpServer> server(new TEvhttpServer(bufproc, 8080));
-  handler->setEventBase(server->getEventBase());
-  server->serve();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/LICENSE
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/LICENSE b/depends/thirdparty/thrift/contrib/fb303/LICENSE
deleted file mode 100644
index 4eacb64..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/Makefile.am b/depends/thirdparty/thrift/contrib/fb303/Makefile.am
deleted file mode 100644
index e773e52..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/Makefile.am
+++ /dev/null
@@ -1,46 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-@GLOBAL_HEADER_MK@
-
-@PRODUCT_MK@
-
-SUBDIRS = .
-
-if WITH_CPP
-SUBDIRS += cpp
-endif
-
-if WITH_JAVA
-SUBDIRS += java
-endif
-
-if WITH_PHP
-SUBDIRS += php
-endif
-
-if WITH_PYTHON
-SUBDIRS += py
-endif
-
-BUILT_SOURCES =
-
-clean-local: clean-common
-
-@GLOBAL_FOOTER_MK@

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/README.md b/depends/thirdparty/thrift/contrib/fb303/README.md
deleted file mode 100644
index 8ade560..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/README.md
+++ /dev/null
@@ -1,37 +0,0 @@
-Project FB303: The Facebook Bassline
-------------------------------------
-
-* Curious about the 303? *
-http://en.wikipedia.org/wiki/Roland_TB-303
-
-* Why the name? *
-The TB303 makes bass lines.
-.Bass is what lies underneath any strong tune.
-..fb303 is the shared root of all thrift services.
-...fb303 => FacebookBase303.
-
-* How do I use this? *
-Take a look at the examples to see how your backend project can
-and should inherit from this service.
-
-* What does it provide? *
-A standard interface to monitoring, dynamic options and configuration,
-uptime reports, activity, etc.
-
-* I want more. *
-Think carefully first about whether the functionality you are going to add
-belongs here or in your application. If it can be abstracted and is generally
-useful, then it probably belongs somewhere in the fb303 tree. Keep in mind,
-not every product has to use ALL the functionality of fb303, but every product
-CANNOT use functionality that is NOT in fb303.
-
-* Is this open source? *
-Yes. fb303 is distributed under the Thrift Software License. See the
-LICENSE file for more details.
-
-* Installation *
-fb303 is configured/built/installed similar to Thrift.  See the README
-in the Thrift root directory for more information.
-
-* Who wrote this README? *
-mcslee@facebook.com

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/TClientInfo.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/TClientInfo.cpp b/depends/thirdparty/thrift/contrib/fb303/TClientInfo.cpp
deleted file mode 100644
index 1fc6612..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/TClientInfo.cpp
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/server/TClientInfo.h>
-
-namespace apache { namespace thrift { namespace server {
-
-using namespace apache::thrift;
-using namespace apache::thrift::transport;
-
-TClientInfoConnection::TClientInfoConnection() {
-  call_[kNameLen - 1] = '\0';    // insure NUL terminator is there
-  eraseAddr();
-  eraseCall();
-}
-
-void TClientInfoConnection::recordAddr(const sockaddr* addr) {
-  eraseAddr();
-  initTime();
-  ncalls_ = 0;
-  if (addr != NULL) {
-    if (addr->sa_family == AF_INET) {
-      memcpy((void*)&addr_.ipv4, (const void *)addr, sizeof(sockaddr_in));
-    }
-    else if (addr->sa_family == AF_INET6) {
-      memcpy((void*)&addr_.ipv6, (const void *)addr, sizeof(sockaddr_in6));
-    }
-  }
-}
-
-void TClientInfoConnection::eraseAddr() {
-  addr_.ipv4.sin_family = AF_UNSPEC;
-}
-
-const char* TClientInfoConnection::getAddr(char* buf, int len) const {
-  switch (addr_.ipv4.sin_family) {
-  case AF_INET:
-    return inet_ntop(AF_INET, &addr_.ipv4.sin_addr, buf, len);
-  case AF_INET6:
-    return inet_ntop(AF_INET6, &addr_.ipv6.sin6_addr, buf, len);
-  default:
-    return NULL;
-  }
-}
-
-void TClientInfoConnection::recordCall(const char* name) {
-  strncpy(call_, name, kNameLen - 1);   // NUL terminator set in constructor
-  ncalls_++;
-}
-
-void TClientInfoConnection::eraseCall() {
-  call_[0] = '\0';
-}
-
-const char* TClientInfoConnection::getCall() const {
-  if (call_[0] == '\0') {
-      return NULL;
-  }
-  return call_;
-}
-
-void TClientInfoConnection::getTime(timespec* time) const {
-  *time = time_;
-}
-
-uint64_t TClientInfoConnection::getNCalls() const {
-  return ncalls_;
-}
-
-void TClientInfoConnection::initTime() {
-  clock_gettime(CLOCK_REALTIME, &time_);
-}
-
-
-TClientInfoConnection* TClientInfo::getConnection(int fd, bool grow) {
-  if (fd < 0 || (!grow && fd >= info_.size())) {
-    return NULL;
-  }
-  return &info_[fd];
-}
-
-size_t TClientInfo::size() const {
-    return info_.size();
-}
-
-void* TClientInfoServerHandler::createContext(boost::shared_ptr<TProtocol> input,
-                                              boost::shared_ptr<TProtocol> output) {
-  (void)input;
-  (void)output;
-  return (void*) new Connect(&clientInfo_);
-}
-
-void TClientInfoServerHandler::deleteContext(void* connectionContext,
-                                             boost::shared_ptr<TProtocol> input,
-                                             boost::shared_ptr<TProtocol> output) {
-  Connect* call = static_cast<Connect*>(connectionContext);
-  if (call->callInfo_) {
-    call->callInfo_->eraseCall();
-  }
-  delete call;
-}
-
-void TClientInfoServerHandler::processContext(void* connectionContext,
-                                              shared_ptr<TTransport> transport) {
-  Connect* call = static_cast<Connect*>(connectionContext);
-  if (call->callInfo_ == NULL) {
-    if (typeid(*(transport.get())) == typeid(TSocket)) {
-      TSocket* tsocket = static_cast<TSocket*>(transport.get());
-      int fd = tsocket->getSocketFD();
-      if (fd < 0) {
-        return;
-      }
-      call->callInfo_ = call->clientInfo_->getConnection(fd, true);
-      assert(call->callInfo_ != NULL);
-      socklen_t len;
-        call->callInfo_->recordAddr(tsocket->getCachedAddress(&len));
-    }
-  }
-}
-
-void TClientInfoServerHandler::getStatsStrings(vector<string>& result) {
-  result.clear();
-  timespec now;
-  clock_gettime(CLOCK_REALTIME, &now);
-
-  for (int i = 0; i < clientInfo_.size(); ++i) {
-    TClientInfoConnection* info = clientInfo_.getConnection(i, false);
-    const char* callStr = info->getCall();
-    if (callStr == NULL) {
-      continue;
-    }
-
-    char addrBuf[INET6_ADDRSTRLEN];
-    const char* addrStr = info->getAddr(addrBuf, sizeof addrBuf);
-    if (addrStr == NULL) {
-      // cerr << "no addr!" << endl;
-      continue;
-    }
-
-    timespec start;
-    info->getTime(&start);
-    double secs = (double)(now.tv_sec - start.tv_sec) + (now.tv_nsec - start.tv_nsec)*0.000000001;
-
-    char buf[256];
-    snprintf(buf, sizeof buf, "%d %s %s %.3f %llu", i, addrStr, callStr, secs,
-             (uint64_t)info->getNCalls());
-               
-    result.push_back(buf);
-  }
-}
-
-void* TClientInfoCallHandler::getContext(const char* fn_name, void* serverContext) {
-  if (serverContext) {
-    TClientInfoConnection* callInfo =  static_cast<TClientInfoServerHandler::Connect*>(serverContext)->callInfo_;
-    if (callInfo != NULL) {
-      callInfo->recordCall(fn_name);
-    }
-  }
-  return NULL;
-}
-
-} } } // namespace apache::thrift::server

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/TClientInfo.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/TClientInfo.h b/depends/thirdparty/thrift/contrib/fb303/TClientInfo.h
deleted file mode 100644
index 6668c19..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/TClientInfo.h
+++ /dev/null
@@ -1,320 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _FACEBOOK_THRIFT_SERVER_TCLIENTINFO_H_
-#define _FACEBOOK_THRIFT_SERVER_TCLIENTINFO_H_ 1
-
-// for inet_ntop --
-#include <arpa/inet.h>
-#include <thrift/server/TServer.h>
-#include <thrift/transport/TSocket.h>
-#include <thrift/concurrency/Mutex.h>
-
-namespace apache { namespace thrift { namespace server {
-
-using namespace apache::thrift;
-using namespace apache::thrift::transport;
-using namespace apache::thrift::concurrency;
-using boost::shared_ptr;
-using std::string;
-using std::vector;
-
-/**
- * StableVector -- a minimal vector class where growth is automatic and
- * vector elements never move as the vector grows.  Allocates new space
- * as needed, but does not copy old values.
- *
- * A level vector stores a list of storage vectors containing the actual
- * elements.  Levels are added as needed, doubling in size each time.
- * Locking is only done when a level is added.  Access is amortized
- * constant time.
- */
-template <typename T>
-class StableVector {
-  /// The initial allocation as an exponent of 2
-  static const uint32_t kInitialSizePowOf2 = 10;
-  /// The initial allocation size
-  static const uint32_t kInitialVectorSize = 1 << kInitialSizePowOf2;
-  /// This bound is guaranteed not to be exceeded on 64-bit archs
-  static const int kMaxLevels = 64;
-
-  /// Values are kept in one or more of these
-  typedef vector<T> Vect;
-  /// One or more value vectors are kept in one of these
-  typedef vector<Vect*> LevelVector;
-
-  Mutex mutex_;
-  /// current size
-  size_t size_;
-  _Atomic_word vectLvl_;
-  LevelVector vects_;
-
- public:
-  /**
-   * Constructor -- initialize the level vector and allocate the
-   * initial storage vector
-   */
-  StableVector()
-    : size_(0) 
-    , vectLvl_(0) {
-    vects_.reserve(kMaxLevels);
-    Vect* storageVector(new Vect(1 << kInitialSizePowOf2));
-    vects_.push_back(storageVector);
-  }
-
- private:
-  /**
-   * make sure the requested number of storage levels have been allocated.
-   */
-  void expand(uint32_t level) {
-    // we need the guard to insure that we only allocate once.
-    Guard g(mutex_);
-    while (level > vectLvl_) {
-      Vect* levelVect(new Vect(1 << (vectLvl_ + kInitialSizePowOf2)));
-      vects_.push_back(levelVect);
-      // we need to make sure this is done after levelVect is inserted
-      // (what we want is effectively a memory barrier here).
-      __gnu_cxx::__atomic_add(&vectLvl_, 1);
-    }
-  }
-
-  /**
-   * Given an index, determine which level and element of that level is
-   * required.  Grows if needed.
-   */
-  void which(uint32_t n, uint32_t* vno, uint32_t* idx) {
-    if (n >= size_) {
-      size_ = n + 1;
-    }
-    if (n < kInitialVectorSize) {
-      *idx = n;
-      *vno = 0;
-    } else {
-      uint32_t upper = n >> kInitialSizePowOf2;
-      *vno = CHAR_BIT*sizeof(upper) - __builtin_clz(upper);
-      *idx = n - (1 << (*vno + kInitialSizePowOf2 - 1));
-      if (*vno > vectLvl_) {
-        expand(*vno);
-      }
-    }
-  }
-
- public:
-  /**
-   * Given an index, return a reference to that element, perhaps after
-   * allocating additional space.
-   *
-   * @param n a positive integer
-   */
-  T& operator[](uint32_t n) {
-    uint32_t vno;
-    uint32_t idx;
-    which(n, &vno, &idx);
-    return (*vects_[vno])[idx];
-  }
-
-  /**
-   * Return the present size of the vector.
-   */
-  size_t size() const { return size_; }
-};
-
-
-/**
- * This class embodies the representation of a single connection during
- * processing.  We'll keep one of these per file descriptor in TClientInfo.
- */
-class TClientInfoConnection {
- public:
-  const static int kNameLen = 32;
-
- private:
-  typedef union IPAddrUnion {
-    sockaddr_in ipv4;
-    sockaddr_in6 ipv6;
-  };
-
-  char call_[kNameLen];            ///< The name of the thrift call
-  IPAddrUnion addr_;               ///< The client's IP address
-  timespec time_;                  ///< Time processing started
-  uint64_t ncalls_;                ///< # of calls processed
-
- public:
-  /**
-   * Constructor; insure that no client address or thrift call name is
-   * represented.
-   */
-  TClientInfoConnection();
-
-  /**
-   * A connection has been made; record its address.  Since this is the
-   * first we'll know of a connection we start the timer here as well.
-   */
-  void recordAddr(const sockaddr* addr);
-
-  /**
-   * Mark the address as empty/unknown.
-   */
-  void eraseAddr();
-
-  /**
-   * Return a string representing the present address, or NULL if none.
-   * Copies the string into the buffer provided.
-   */
-  const char* getAddr(char* buf, int len) const;
-
-  /**
-   * A call has been made on this connection; record its name.  Since this is
-   * called for every thrift call processed, we also do our call count here.
-   */ 
-  void recordCall(const char* name);
-
-  /**
-   * Invoked when processing has ended to clear the call name.
-   */
-  void eraseCall();
-
-  /**
-   * Return as string the thrift call either currently being processed or
-   * most recently processed if the connection is still open for additional
-   * calls.  Returns NULL if a call hasn't been made yet or processing
-   * has ended.
-   */
-  const char* getCall() const;
-
-  /**
-   * Get the timespec for the start of this connection (specifically, when
-   * recordAddr() was first called).
-   */
-  void getTime(timespec* time) const;
-
-  /**
-   * Return the number of calls made on this connection.
-   */
-  uint64_t getNCalls() const;
-
- private:
-  void initTime();
-};
-
-
-/**
- * Store for info about a server's clients -- specifically, the client's IP
- * address and the call it is executing.  This information is indexed by
- * socket file descriptor and in the present implementation is updated
- * asynchronously, so it may only approximate reality.
- */
-class TClientInfo {
- private:
-  StableVector<TClientInfoConnection> info_;
-
- public:
-  /**
-   * Return the info object for a given file descriptor.  If "grow" is true
-   * extend the info vector if required (such as for a file descriptor not seen
-   * before).  If "grow" is false and the info vector isn't large enough,
-   * or if "fd" is negative, return NULL.
-   */
-  TClientInfoConnection* getConnection(int fd, bool grow);
-
-  size_t size() const;
-};
-
-/**
- * This derivation of TServerEventHandler encapsulates the main status vector
- * and provides context to the server's processing loop via overrides.
- * Together with TClientInfoCallHandler (derived from TProcessorEventHandler) 
- * it integrates client info collection into the server.
- */
-class TClientInfoServerHandler : public TServerEventHandler {
- private:
-  TClientInfo clientInfo_;
-
- public:
-  /**
-   * One of these is constructed for each open connection/descriptor and links
-   * to both the status vector (clientInfo_) and that descriptor's entry
-   * within it.
-   */
-  struct Connect {
-    TClientInfo* clientInfo_;
-    TClientInfoConnection* callInfo_;
-
-    explicit Connect(TClientInfo* clientInfo)
-      : clientInfo_(clientInfo)
-      , callInfo_(NULL) {
-    }
-  };
-
-  /**
-   * Generate processor context; we don't know what descriptor we belong to
-   * yet -- we'll get hooked up in contextProcess(). 
-   */
-  void* createContext(boost::shared_ptr<TProtocol> input,
-                      boost::shared_ptr<TProtocol> output);
-
-  /**
-   * Mark our slot as unused and delete the context created in createContext().
-   */
-  void deleteContext(void* processorContext,
-                     boost::shared_ptr<TProtocol> input,
-                     boost::shared_ptr<TProtocol> output);
-  
-  /**
-   * Called in the processing loop just before the server invokes the
-   * processor itself, on the first call we establish which descriptor
-   * we correspond to and set it to that socket's peer IP address.  This
-   * also has the side effect of initializing call counting and connection
-   * timing.  We won't know which call we're handling until the handler
-   * first gets called in TClientInfoCallHandler::getContext().
-   */
-  void processContext(void* processorContext,
-                      shared_ptr<TTransport> transport);
-
-  /**
-   * Get status report for server in the form of a vector of strings.
-   * Each active client appears as one string in the format:
-   *
-   *     FD IPADDR CALLNAME DURATION NCALLS
-   *
-   * where "FD" is the file descriptor for the client's socket, "IPADDR"
-   * is the IP address (as reported by accept()), "CALLNAME" is the
-   * current or most recent Thrift function name, "DURATION" is the
-   * duration of the connection, while NCALLS is the number of Thrift
-   * calls made since the connection was made.  A single space separates
-   * fields.
-   */
-  void getStatsStrings(vector<string>& result);
-};
-
-/**
- * This class derives from TProcessorEventHandler to gain access to the
- * function name for the current Thrift call.  We need two versions of
- * this -- TClientInfoCallStatsHandler is the other -- since in the latter
- * case we pass through to TFunctionStatHandler to perform Thrift call
- * stats.
- */
-class TClientInfoCallHandler : public TProcessorEventHandler {
- public:
-  virtual void* getContext(const char* fn_name, void* serverContext);
-};
-
-} } } // namespace apache::thrift::server
-
-#endif // !_FACEBOOK_THRIFT_SERVER_TCLIENTINFO_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_boost_base.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_boost_base.m4 b/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_boost_base.m4
deleted file mode 100644
index e56bb73..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_boost_base.m4
+++ /dev/null
@@ -1,198 +0,0 @@
-##### http://autoconf-archive.cryp.to/ax_boost_base.html
-#
-# SYNOPSIS
-#
-#   AX_BOOST_BASE([MINIMUM-VERSION])
-#
-# DESCRIPTION
-#
-#   Test for the Boost C++ libraries of a particular version (or newer)
-#
-#   If no path to the installed boost library is given the macro
-#   searchs under /usr, /usr/local, /opt and /opt/local and evaluates
-#   the $BOOST_ROOT environment variable. Further documentation is
-#   available at <http://randspringer.de/boost/index.html>.
-#
-#   This macro calls:
-#
-#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
-#
-#   And sets:
-#
-#     HAVE_BOOST
-#
-# LAST MODIFICATION
-#
-#   2007-07-28
-#
-# COPYLEFT
-#
-#   Copyright (c) 2007 Thomas Porschberg <th...@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
-AC_DEFUN([AX_BOOST_BASE],
-[
-AC_ARG_WITH([boost],
-	AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
-	[
-    if test "$withval" = "no"; then
-		want_boost="no"
-    elif test "$withval" = "yes"; then
-        want_boost="yes"
-        ac_boost_path=""
-    else
-	    want_boost="yes"
-        ac_boost_path="$withval"
-	fi
-    ],
-    [want_boost="yes"])
-
-if test "x$want_boost" = "xyes"; then
-	boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
-	boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
-	boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
-	boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
-	boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
-	if test "x$boost_lib_version_req_sub_minor" = "x" ; then
-		boost_lib_version_req_sub_minor="0"
-    	fi
-	WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+  $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
-	AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
-	succeeded=no
-
-	dnl first we check the system location for boost libraries
-	dnl this location ist chosen if boost libraries are installed with the --layout=system option
-	dnl or if you install boost with RPM
-	if test "$ac_boost_path" != ""; then
-		BOOST_LDFLAGS="-L$ac_boost_path/lib"
-		BOOST_CPPFLAGS="-I$ac_boost_path/include"
-	else
-		for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
-			if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
-				BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
-				BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
-				break;
-			fi
-		done
-	fi
-
-	CPPFLAGS_SAVED="$CPPFLAGS"
-	CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
-	export CPPFLAGS
-
-	LDFLAGS_SAVED="$LDFLAGS"
-	LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
-	export LDFLAGS
-
-	AC_LANG_PUSH(C++)
-     	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-	@%:@include <boost/version.hpp>
-	]], [[
-	#if BOOST_VERSION >= $WANT_BOOST_VERSION
-	// Everything is okay
-	#else
-	#  error Boost version is too old
-	#endif
-	]])],[
-        AC_MSG_RESULT(yes)
-	succeeded=yes
-	found_system=yes
-       	],[
-       	])
-	AC_LANG_POP([C++])
-
-
-
-	dnl if we found no boost with system layout we search for boost libraries
-	dnl built and installed without the --layout=system option or for a staged(not installed) version
-	if test "x$succeeded" != "xyes"; then
-		_version=0
-		if test "$ac_boost_path" != ""; then
-               		BOOST_LDFLAGS="-L$ac_boost_path/lib"
-			if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-				for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-					_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
-					V_CHECK=`expr $_version_tmp \> $_version`
-					if test "$V_CHECK" = "1" ; then
-						_version=$_version_tmp
-					fi
-					VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-					BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
-				done
-			fi
-		else
-			for ac_boost_path in /usr /usr/local /opt /opt/local ; do
-				if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-					for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-						_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
-						V_CHECK=`expr $_version_tmp \> $_version`
-						if test "$V_CHECK" = "1" ; then
-							_version=$_version_tmp
-	               					best_path=$ac_boost_path
-						fi
-					done
-				fi
-			done
-
-			VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-			BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
-			BOOST_LDFLAGS="-L$best_path/lib"
-
-	    		if test "x$BOOST_ROOT" != "x"; then
-				if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
-					version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
-					stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
-			        	stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
-					V_CHECK=`expr $stage_version_shorten \>\= $_version`
-				        if test "$V_CHECK" = "1" ; then
-						AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
-						BOOST_CPPFLAGS="-I$BOOST_ROOT"
-						BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
-					fi
-				fi
-	    		fi
-		fi
-
-		CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
-		export CPPFLAGS
-		LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
-		export LDFLAGS
-
-		AC_LANG_PUSH(C++)
-	     	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-		@%:@include <boost/version.hpp>
-		]], [[
-		#if BOOST_VERSION >= $WANT_BOOST_VERSION
-		// Everything is okay
-		#else
-		#  error Boost version is too old
-		#endif
-		]])],[
-        	AC_MSG_RESULT(yes)
-		succeeded=yes
-		found_system=yes
-       		],[
-	       	])
-		AC_LANG_POP([C++])
-	fi
-
-	if test "$succeeded" != "yes" ; then
-		if test "$_version" = "0" ; then
-			AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
-		else
-			AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
-		fi
-	else
-		AC_SUBST(BOOST_CPPFLAGS)
-		AC_SUBST(BOOST_LDFLAGS)
-		AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
-	fi
-
-        CPPFLAGS="$CPPFLAGS_SAVED"
-       	LDFLAGS="$LDFLAGS_SAVED"
-fi
-
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_cxx_compile_stdcxx_11.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_cxx_compile_stdcxx_11.m4 b/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_cxx_compile_stdcxx_11.m4
deleted file mode 100644
index a4c9189..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_cxx_compile_stdcxx_11.m4
+++ /dev/null
@@ -1,134 +0,0 @@
-# ============================================================================
-#  http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-#   AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
-#
-# DESCRIPTION
-#
-#   Check for baseline language coverage in the compiler for the C++11
-#   standard; if necessary, add switches to CXXFLAGS to enable support.
-#
-#   The first argument, if specified, indicates whether you insist on an
-#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-#   -std=c++11).  If neither is specified, you get whatever works, with
-#   preference for an extended mode.
-#
-#   The second argument, if specified 'mandatory' or if left unspecified,
-#   indicates that baseline C++11 support is required and that the macro
-#   should error out if no mode with that support is found.  If specified
-#   'optional', then configuration proceeds regardless, after defining
-#   HAVE_CXX11 if and only if a supporting mode is found.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Benjamin Kosnik <bk...@redhat.com>
-#   Copyright (c) 2012 Zack Weinberg <za...@panix.com>
-#   Copyright (c) 2013 Roy Stogner <ro...@ices.utexas.edu>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 3
-
-m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [
-  template <typename T>
-    struct check
-    {
-      static_assert(sizeof(int) <= sizeof(T), "not big enough");
-    };
-
-    typedef check<check<bool>> right_angle_brackets;
-
-    int a;
-    decltype(a) b;
-
-    typedef check<int> check_type;
-    check_type c;
-    check_type&& cr = static_cast<check_type&&>(c);
-
-    auto d = a;
-])
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
-  m4_if([$1], [], [],
-        [$1], [ext], [],
-        [$1], [noext], [],
-        [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
-  m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
-        [$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
-        [$2], [optional], [ax_cxx_compile_cxx11_required=false],
-        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])dnl
-  AC_LANG_PUSH([C++])dnl
-  ac_success=no
-  AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
-  ax_cv_cxx_compile_cxx11,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-    [ax_cv_cxx_compile_cxx11=yes],
-    [ax_cv_cxx_compile_cxx11=no])])
-  if test x$ax_cv_cxx_compile_cxx11 = xyes; then
-    ac_success=yes
-  fi
-
-  m4_if([$1], [noext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=gnu++11; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-
-  m4_if([$1], [ext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=c++11; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-  AC_LANG_POP([C++])
-  if test x$ax_cxx_compile_cxx11_required = xtrue; then
-    if test x$ac_success = xno; then
-      AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
-    fi
-  else
-    if test x$ac_success = xno; then
-      HAVE_CXX11=0
-      AC_MSG_NOTICE([No compiler with C++11 support was found])
-    else
-      HAVE_CXX11=1
-      AC_DEFINE(HAVE_CXX11,1,
-                [define if the compiler supports basic C++11 syntax])
-    fi
-
-    AC_SUBST(HAVE_CXX11)
-  fi
-])
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_javac_and_java.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_javac_and_java.m4 b/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_javac_and_java.m4
deleted file mode 100644
index 581b450..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_javac_and_java.m4
+++ /dev/null
@@ -1,121 +0,0 @@
-dnl @synopsis AX_JAVAC_AND_JAVA
-dnl @synopsis AX_CHECK_JAVA_CLASS(CLASSNAME)
-dnl
-dnl Test for the presence of a JDK, and (optionally) specific classes.
-dnl
-dnl If "JAVA" is defined in the environment, that will be the only
-dnl java command tested.  Otherwise, a hard-coded list will be used.
-dnl Similarly for "JAVAC".
-dnl
-dnl AX_JAVAC_AND_JAVA does not currently support testing for a particular
-dnl Java version, testing for only one of "java" and "javac", or
-dnl compiling or running user-provided Java code.
-dnl
-dnl After AX_JAVAC_AND_JAVA runs, the shell variables "success" and
-dnl "ax_javac_and_java" are set to "yes" or "no", and "JAVAC" and
-dnl "JAVA" are set to the appropriate commands.
-dnl
-dnl AX_CHECK_JAVA_CLASS must be run after AX_JAVAC_AND_JAVA.
-dnl It tests for the presence of a class based on a fully-qualified name.
-dnl It sets the shell variable "success" to "yes" or "no".
-dnl
-dnl @category Java
-dnl @version 2009-02-09
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-
-AC_DEFUN([AX_JAVAC_AND_JAVA],
-         [
-
-          dnl Hard-coded default commands to test.
-          JAVAC_PROGS="javac,jikes,gcj -C"
-          JAVA_PROGS="java,kaffe"
-
-          dnl Allow the user to specify an alternative.
-          if test -n "$JAVAC" ; then
-            JAVAC_PROGS="$JAVAC"
-          fi
-          if test -n "$JAVA" ; then
-            JAVA_PROGS="$JAVA"
-          fi
-
-          AC_MSG_CHECKING(for javac and java)
-
-          echo "public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
-          success=no
-          oIFS="$IFS"
-
-          IFS=","
-          for JAVAC in $JAVAC_PROGS ; do
-            IFS="$oIFS"
-
-            echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
-            if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-
-              IFS=","
-              for JAVA in $JAVA_PROGS ; do
-                IFS="$oIFS"
-
-                echo "Running \"$JAVA configtest_ax_javac_and_java\"" >&AS_MESSAGE_LOG_FD
-                if $JAVA configtest_ax_javac_and_java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-                  success=yes
-                  break 2
-                fi
-
-              done
-
-            fi
-
-          done
-
-          rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
-
-          if test "$success" != "yes" ; then
-            AC_MSG_RESULT(no)
-            JAVAC=""
-            JAVA=""
-          else
-            AC_MSG_RESULT(yes)
-          fi
-
-          ax_javac_and_java="$success"
-
-          ])
-
-
-AC_DEFUN([AX_CHECK_JAVA_CLASS],
-         [
-          AC_MSG_CHECKING(for Java class [$1])
-
-          echo "import $1; public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
-
-          echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
-          if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-            AC_MSG_RESULT(yes)
-            success=yes
-          else
-            AC_MSG_RESULT(no)
-            success=no
-          fi
-
-          rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
-          ])
-
-
-AC_DEFUN([AX_CHECK_ANT_VERSION],
-         [
-          AC_MSG_CHECKING(for ant version > $2)
-          ANT_VALID=`expr $($1 -version 2>/dev/null | sed -n 's/.*version \(@<:@0-9\.@:>@*\).*/\1/p') \>= $2`
-          if test "x$ANT_VALID" = "x1" ; then
-            AC_MSG_RESULT(yes)
-          else
-            AC_MSG_RESULT(no)
-            ANT=""
-          fi
-          ])
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_thrift_internal.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_thrift_internal.m4 b/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_thrift_internal.m4
deleted file mode 100644
index 8c0e3cb..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/aclocal/ax_thrift_internal.m4
+++ /dev/null
@@ -1,28 +0,0 @@
-dnl @synopsis AX_THRIFT_GEN(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
-dnl @synopsis AX_THRIFT_LIB(SHORT_LANGUAGE, LONG_LANGUAGE, DEFAULT)
-dnl
-dnl Allow a particular language generator to be disabled.
-dnl Allow a particular language library to be disabled.
-dnl
-dnl These macros have poor error handling and are poorly documented.
-dnl They are intended only for internal use by the Thrift compiler.
-dnl
-dnl @version 2008-02-20
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-AC_DEFUN([AX_THRIFT_LIB],
-         [
-          AC_ARG_WITH($1,
-                      AC_HELP_STRING([--with-$1], [build the $2 library @<:@default=$3@:>@]),
-                      [with_$1="$withval"],
-                      [with_$1=$3]
-                      )
-          have_$1=no
-          dnl What we do here is going to vary from library to library,
-          dnl so we can't really generalize (yet!).
-         ])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/bootstrap.sh
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/bootstrap.sh b/depends/thirdparty/thrift/contrib/fb303/bootstrap.sh
deleted file mode 100755
index 3cbeddb..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/bootstrap.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# To be safe include -I flag
-aclocal -I ./aclocal
-automake -a
-autoconf
-./configure --config-cache $*

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/configure.ac
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/configure.ac b/depends/thirdparty/thrift/contrib/fb303/configure.ac
deleted file mode 100644
index 73b35ba..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/configure.ac
+++ /dev/null
@@ -1,164 +0,0 @@
-# Autoconf input file
-# $Id$
-
-# AC - autoconf
-# FB - facebook
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#########################################################################
-# DO NOT TOUCH EXCEPT TO CHANGE REV# IN AC_INIT
-
-AC_PREREQ(2.52)
-AC_INIT([libfb303],[20080209])
-#AC_CONFIG_AUX_DIR([/usr/share/automake-1.9])
-# To install locally
-FB_INITIALIZE([localinstall])
-AC_PREFIX_DEFAULT([/usr/local])
-
-############################################################################
-# User Configurable. Change With CAUTION!
-# User can include custom makefile rules. Uncomment and update only <name> in PRODUCT_MK.
-# Include where appropriate in any Makefile.am as @PRODUCT_MK@
-
-#PRODUCT_MK="include ${EXTERNAL_PATH}/shared/build/<name>.mk"
-
-# Default path to external Facebook components and shared build toools I.e fb303 etc.
-# To point to other locations set  environment variable EXTERNAL_PATH.
-# To change the current default you must change bootstrap.sh.
-FB_WITH_EXTERNAL_PATH([`pwd`])
-
-AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
-                         (Normal --prefix is ignored for Python because
-                         Python has different conventions.)
-                         Default = "/usr"])
-AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
-
-##########################################################################
-# User Configurable
-
-# Pre-defined macro to set opt build mode. Run with --disable-shared option to turn off optimization.
-FB_ENABLE_DEFAULT_OPT_BUILD
-
-# Predefined macro to set static library mode. Run with --disable-static option to turn off static lib mode.
-FB_ENABLE_DEFAULT_STATIC
-
-# Personalized feature generator. Creates defines/conditionals and --enable --disable command line options.
-# FB_ENABLE_FEATURE([FEATURE], [feature]) OR FB_ENABLE_FEATURE([FEATURE], [feature], [\"<value>\"])
-
-# Example: Macro supplies -DFACEBOOK at compile time and "if FACEBOOK endif" capabilities.
-
-# Personalized path generator Sets default paths. Provides --with-xx=DIR options.
-# FB_WITH_PATH([<var>_home], [<var>path], [<default location>]
-
-# Example: sets $(thrift_home) variable with default path set to /usr/local.
-FB_WITH_PATH([thrift_home], [thriftpath], [/usr/local])
-
-AX_CXX_COMPILE_STDCXX_11([noext])
-AX_THRIFT_LIB(cpp, [C++], yes)
-have_cpp=no
-if test "$with_cpp" = "yes"; then
-  # Require boost 1.40.0 or later
-  AX_BOOST_BASE([1.40.0])
-  if test "x$succeeded" = "xyes"; then
-    have_cpp="yes"
-  fi
-fi
-AM_CONDITIONAL([WITH_CPP], [test "$have_cpp" = "yes"])
-
-AX_THRIFT_LIB(java, [Java], yes)
-if test "$with_java" = "yes"; then
-  AX_JAVAC_AND_JAVA
-  AC_PATH_PROG([ANT], [ant])
-  AX_CHECK_ANT_VERSION($ANT, 1.7)
-  AC_SUBST(CLASSPATH)
-  AC_SUBST(ANT_FLAGS)
-  if test "x$JAVAC" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then
-    have_java="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_JAVA, [test "$have_java" = "yes"])
-
-AX_THRIFT_LIB(php, [PHP], yes)
-if test "$with_php" = "yes"; then
-  AC_PATH_PROG([PHP], [php])
-  if test "x$PHP" != "x" && test "x$PHP" != "x:" ; then
-    have_php="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_PHP, [test "$have_php" = "yes"])
-
-AX_THRIFT_LIB(python, [Python], yes)
-if test "$with_python" = "yes"; then
-  AM_PATH_PYTHON(2.4,, :)
-  if test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then
-    have_python="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"])
-
-# Generates Makefile from Makefile.am. Modify when new subdirs are added.
-# Change Makefile.am also to add subdirectly.
-AC_CONFIG_FILES(Makefile cpp/Makefile py/Makefile)
-
-# Check for headers
-AC_CHECK_HEADERS([inttypes.h])
-AC_CHECK_HEADERS([netinet/in.h])
-
-############################################################################
-# DO NOT TOUCH.
-
-AC_SUBST(PRODUCT_MK)
-AC_OUTPUT
-
-#############################################################################
-######### FINISH ############################################################
-
-echo "EXTERNAL_PATH $EXTERNAL_PATH"
-echo
-echo "Building C++ Library ......... : $have_cpp"
-echo "Building Java Library ........ : $have_java"
-echo "Building Python Library ...... : $have_python"
-echo "Building PHP Library ......... : $have_php"
-
-
-#
-# NOTES FOR USER
-# Short cut to create conditional flags.
-#enable_facebook="yes"
-#AM_CONDITIONAL([FACEBOOK], [test "$enable_facebook" = yes])
-#enable_hdfs="yes"
-#AM_CONDITIONAL([HDFS], [test "$enable_hdfs" = yes])
-
-# Enable options with --enable and --disable configurable.
-#AC_MSG_CHECKING([whether to enable FACEBOOK])
-#FACEBOOK=""
-#AC_ARG_ENABLE([facebook],
-#  [  --enable-facebook     Enable facebook.],
-#  [
-#     ENABLE_FACEBOOK=$enableval
-#  ],
-#  [
-#     ENABLE_FACEBOOK="no"
-#  ]
-#)
-#AM_CONDITIONAL([FACEBOOK], [test "$ENABLE_FACEBOOK" = yes])
-#AC_MSG_RESULT($ENABLE_FACEBOOK)
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.cpp b/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.cpp
deleted file mode 100644
index 3c56975..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "FacebookBase.h"
-
-using namespace facebook::fb303;
-using apache::thrift::concurrency::Guard;
-
-FacebookBase::FacebookBase(std::string name) :
-  name_(name) {
-  aliveSince_ = (int64_t) time(NULL);
-}
-
-inline void FacebookBase::getName(std::string& _return) {
-  _return = name_;
-}
-
-void FacebookBase::setOption(const std::string& key, const std::string& value) {
-  Guard g(optionsLock_);
-  options_[key] = value;
-}
-
-void FacebookBase::getOption(std::string& _return, const std::string& key) {
-  Guard g(optionsLock_);
-  _return = options_[key];
-}
-
-void FacebookBase::getOptions(std::map<std::string, std::string> & _return) {
-  Guard g(optionsLock_);
-  _return = options_;
-}
-
-int64_t FacebookBase::incrementCounter(const std::string& key, int64_t amount) {
-  counters_.acquireRead();
-
-  // if we didn't find the key, we need to write lock the whole map to create it
-  ReadWriteCounterMap::iterator it = counters_.find(key);
-  if (it == counters_.end()) {
-    counters_.release();
-    counters_.acquireWrite();
-
-    // we need to check again to make sure someone didn't create this key
-    // already while we released the lock
-    it = counters_.find(key);
-    if(it == counters_.end()){
-      counters_[key].value = amount;
-      counters_.release();
-      return amount;
-    }
-  }
-
-  it->second.acquireWrite();
-  int64_t count = it->second.value + amount;
-  it->second.value = count;
-  it->second.release();
-  counters_.release();
-  return count;
-}
-
-int64_t FacebookBase::setCounter(const std::string& key, int64_t value) {
-  counters_.acquireRead();
-
-  // if we didn't find the key, we need to write lock the whole map to create it
-  ReadWriteCounterMap::iterator it = counters_.find(key);
-  if (it == counters_.end()) {
-    counters_.release();
-    counters_.acquireWrite();
-    counters_[key].value = value;
-    counters_.release();
-    return value;
-  }
-
-  it->second.acquireWrite();
-  it->second.value = value;
-  it->second.release();
-  counters_.release();
-  return value;
-}
-
-void FacebookBase::getCounters(std::map<std::string, int64_t>& _return) {
-  // we need to lock the whole thing and actually build the map since we don't
-  // want our read/write structure to go over the wire
-  counters_.acquireRead();
-  for(ReadWriteCounterMap::iterator it = counters_.begin();
-      it != counters_.end(); ++it)
-  {
-    _return[it->first] = it->second.value;
-  }
-  counters_.release();
-}
-
-int64_t FacebookBase::getCounter(const std::string& key) {
-  int64_t rv = 0;
-  counters_.acquireRead();
-  ReadWriteCounterMap::iterator it = counters_.find(key);
-  if (it != counters_.end()) {
-    it->second.acquireRead();
-    rv = it->second.value;
-    it->second.release();
-  }
-  counters_.release();
-  return rv;
-}
-
-inline int64_t FacebookBase::aliveSince() {
-  return aliveSince_;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.h b/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.h
deleted file mode 100644
index 2159c95..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/cpp/FacebookBase.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _FACEBOOK_TB303_FACEBOOKBASE_H_
-#define _FACEBOOK_TB303_FACEBOOKBASE_H_ 1
-
-#include "FacebookService.h"
-
-#include <thrift/server/TServer.h>
-#include <thrift/concurrency/Mutex.h>
-
-#include <time.h>
-#include <string>
-#include <map>
-
-namespace facebook { namespace fb303 {
-
-using apache::thrift::concurrency::Mutex;
-using apache::thrift::concurrency::ReadWriteMutex;
-using apache::thrift::server::TServer;
-
-struct ReadWriteInt : ReadWriteMutex {int64_t value;};
-struct ReadWriteCounterMap : ReadWriteMutex,
-                             std::map<std::string, ReadWriteInt> {};
-
-/**
- * Base Facebook service implementation in C++.
- *
- */
-class FacebookBase : virtual public FacebookServiceIf {
- protected:
-  FacebookBase(std::string name);
-  virtual ~FacebookBase() {}
-
- public:
-  void getName(std::string& _return);
-  virtual void getVersion(std::string& _return) { _return = ""; }
-
-  virtual fb_status getStatus() = 0;
-  virtual void getStatusDetails(std::string& _return) { _return = ""; }
-
-  void setOption(const std::string& key, const std::string& value);
-  void getOption(std::string& _return, const std::string& key);
-  void getOptions(std::map<std::string, std::string> & _return);
-
-  int64_t aliveSince();
-
-  virtual void reinitialize() {}
-
-  virtual void shutdown() {
-    if (server_.get() != NULL) {
-      server_->stop();
-    }
-  }
-
-  int64_t incrementCounter(const std::string& key, int64_t amount = 1);
-  int64_t setCounter(const std::string& key, int64_t value);
-
-  void getCounters(std::map<std::string, int64_t>& _return);
-  int64_t getCounter(const std::string& key);
-
-  /**
-   * Set server handle for shutdown method
-   */
-  void setServer(boost::shared_ptr<TServer> server) {
-    server_ = server;
-  }
-
-  void getCpuProfile(std::string& _return, int32_t durSecs) { _return = ""; }
-
- private:
-
-  std::string name_;
-  int64_t aliveSince_;
-
-  std::map<std::string, std::string> options_;
-  Mutex optionsLock_;
-
-  ReadWriteCounterMap counters_;
-
-  boost::shared_ptr<TServer> server_;
-
-};
-
-}} // facebook::tb303
-
-#endif // _FACEBOOK_TB303_FACEBOOKBASE_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/fb303/cpp/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/fb303/cpp/Makefile.am b/depends/thirdparty/thrift/contrib/fb303/cpp/Makefile.am
deleted file mode 100644
index 748d329..0000000
--- a/depends/thirdparty/thrift/contrib/fb303/cpp/Makefile.am
+++ /dev/null
@@ -1,84 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-@GLOBAL_HEADER_MK@
-
-@PRODUCT_MK@
-
-
-# User specified path variables set in configure.ac.
-# thrift_home
-#
-THRIFT = $(thrift_home)/bin/thrift
-
-# User defined conditionals and conditonal statements set up in configure.ac.
-if DEBUG
-   DEBUG_CPPFLAGS = -DDEBUG_TIMING
-endif
-
-# Set common flags recognized by automake.
-# DO NOT USE CPPFLAGS, CXXFLAGS, CFLAGS, LDFLAGS here! Set in configure.ac and|or override on command line.
-# USE flags AM_CXXFLAGS, AM_CFLAGS, AM_CPPFLAGS, AM_LDFLAGS, LDADD in this section.
-
-AM_CPPFLAGS = -I..
-AM_CPPFLAGS += -Igen-cpp
-AM_CPPFLAGS += -I$(thrift_home)/include/thrift 
-AM_CPPFLAGS += $(BOOST_CPPFLAGS)
-AM_CPPFLAGS += $(FB_CPPFLAGS) $(DEBUG_CPPFLAGS)
-
-# GENERATE BUILD RULES
-# Set Program/library specific flags recognized by automake.
-# Use <progname|libname>_<FLAG> to set prog / lib specific flag s
-# foo_CXXFLAGS foo_CPPFLAGS foo_LDFLAGS foo_LDADD
-
-fb303_lib = gen-cpp/FacebookService.cpp gen-cpp/fb303_constants.cpp gen-cpp/fb303_types.cpp FacebookBase.cpp ServiceTracker.cpp
-
-# Static -- multiple libraries can be defined
-if STATIC
-lib_LIBRARIES = libfb303.a
-libfb303_a_SOURCES = $(fb303_lib)
-INTERNAL_LIBS = libfb303.a
-endif
-
-# Shared -- multiple libraries can be defined
-if SHARED
-shareddir = $(prefix)/lib
-shared_PROGRAMS = libfb303.so
-libfb303_so_SOURCES = $(fb303_lib)
-libfb303_so_CXXFLAGS = $(SHARED_CXXFLAGS)
-libfb303_so_LDFLAGS = $(SHARED_LDFLAGS)
-INTERNAL_LIBS =  libfb303.so
-endif
-
-# Set up Thrift specific activity here.
-# We assume that a <name>+types.cpp will always be built from <name>.thrift.
-$(eval $(call thrift_template,.,../if/fb303.thrift,-I $(thrift_home)/share  --gen cpp:pure_enums ))
-
-include_fb303dir = $(includedir)/thrift/fb303
-include_fb303_HEADERS = FacebookBase.h ServiceTracker.h gen-cpp/FacebookService.h gen-cpp/fb303_constants.h gen-cpp/fb303_types.h
-
-include_fb303ifdir = $(prefix)/share/fb303/if
-include_fb303if_HEADERS = ../if/fb303.thrift
-
-BUILT_SOURCES = thriftstyle
-
-# Add to pre-existing target clean
-clean-local: clean-common
-
-@GLOBAL_FOOTER_MK@


[30/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_js_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_js_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_js_generator.cc
deleted file mode 100644
index c348774..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_js_generator.cc
+++ /dev/null
@@ -1,2179 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <map>
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <list>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-#include "t_oop_generator.h"
-
-
-/**
- * JS code generator.
- */
-class t_js_generator : public t_oop_generator {
-public:
-  t_js_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("node");
-    gen_node_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("jquery");
-    gen_jquery_ = (iter != parsed_options.end());
-
-    if (!gen_node_) {
-      iter = parsed_options.find("ts");
-      gen_ts_ = (iter != parsed_options.end());
-    } else {
-      gen_ts_ = false;
-    }
-
-    if (gen_node_ && gen_jquery_) {
-      throw "Invalid switch: [-gen js:node,jquery] options not compatible, try: [-gen js:node -gen "
-            "js:jquery]";
-    }
-
-    if (gen_node_) {
-      out_dir_base_ = "gen-nodejs";
-    } else {
-      out_dir_base_ = "gen-js";
-    }
-
-    escape_['\''] = "\\'";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_recv_throw(std::string var);
-  std::string render_recv_return(std::string var);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Structs!
-   */
-  void generate_js_struct(t_struct* tstruct, bool is_exception);
-  void generate_js_struct_definition(std::ofstream& out,
-                                     t_struct* tstruct,
-                                     bool is_xception = false,
-                                     bool is_exported = true);
-  void generate_js_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_js_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_js_function_helpers(t_function* tfunction);
-
-  /**
-   * Service-level generation functions
-   */
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_rest(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_processor(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool inclass = false);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string js_includes();
-  std::string render_includes();
-  std::string declare_field(t_field* tfield, bool init = false, bool obj = false);
-  std::string function_signature(t_function* tfunction,
-                                 std::string prefix = "",
-                                 bool include_callback = false);
-  std::string argument_list(t_struct* tstruct, bool include_callback = false);
-  std::string type_to_enum(t_type* ttype);
-
-  std::string autogen_comment() {
-    return std::string("//\n") + "// Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-           + "//\n" + "// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
-           + "//\n";
-  }
-
-  t_type* get_contained_type(t_type* t);
-
-  std::vector<std::string> js_namespace_pieces(t_program* p) {
-    std::string ns = p->get_namespace("js");
-
-    std::string::size_type loc;
-    std::vector<std::string> pieces;
-
-    if (ns.size() > 0) {
-      while ((loc = ns.find(".")) != std::string::npos) {
-        pieces.push_back(ns.substr(0, loc));
-        ns = ns.substr(loc + 1);
-      }
-    }
-
-    if (ns.size() > 0) {
-      pieces.push_back(ns);
-    }
-
-    return pieces;
-  }
-
-  std::string js_type_namespace(t_program* p) {
-    if (gen_node_) {
-      if (p != NULL && p != program_) {
-        return p->get_name() + "_ttypes.";
-      }
-      return "ttypes.";
-    }
-    return js_namespace(p);
-  }
-
-  std::string js_export_namespace(t_program* p) {
-    if (gen_node_) {
-      return "exports.";
-    }
-    return js_namespace(p);
-  }
-
-  std::string js_namespace(t_program* p) {
-    std::string ns = p->get_namespace("js");
-    if (ns.size() > 0) {
-      ns += ".";
-    }
-
-    return ns;
-  }
-
-  /**
-   * TypeScript Definition File helper functions
-   */
-
-  string ts_function_signature(t_function* tfunction, bool include_callback);
-  string ts_get_type(t_type* type);
-
-  /**
-   * Special indentation for TypeScript Definitions because of the module.
-   * Returns the normal indentation + "  " if a module was defined.
-   * @return string
-   */
-  string ts_indent() { return indent() + (!ts_module_.empty() ? "  " : ""); }
-
-  /**
-   * Returns "declare " if no module was defined.
-   * @return string
-   */
-  string ts_declare() { return (ts_module_.empty() ? "declare " : ""); }
-
-  /**
-   * Returns "?" if the given field is optional.
-   * @param t_field The field to check
-   * @return string
-   */
-  string ts_get_req(t_field* field) { return (field->get_req() == t_field::T_OPTIONAL ? "?" : ""); }
-
-  /**
-   * Returns the documentation, if the provided documentable object has one.
-   * @param t_doc The object to get the documentation from
-   * @return string The documentation
-   */
-  string ts_print_doc(t_doc* tdoc) {
-    string result = endl;
-
-    if (tdoc->has_doc()) {
-      std::stringstream doc(tdoc->get_doc());
-      string item;
-
-      result += ts_indent() + "/**" + endl;
-      while (std::getline(doc, item)) {
-        result += ts_indent() + " * " + item + endl;
-      }
-      result += ts_indent() + " */" + endl;
-    }
-    return result;
-  }
-
-private:
-  /**
-   * True if we should generate NodeJS-friendly RPC services.
-   */
-  bool gen_node_;
-
-  /**
-   * True if we should generate services that use jQuery ajax (async/sync).
-   */
-  bool gen_jquery_;
-
-  /**
-   * True if we should generate a TypeScript Definition File for each service.
-   */
-  bool gen_ts_;
-
-  /**
-   * The name of the defined module(s), for TypeScript Definition Files.
-   */
-  string ts_module_;
-
-  /**
-   * File streams
-   */
-  std::ofstream f_types_;
-  std::ofstream f_service_;
-  std::ofstream f_types_ts_;
-  std::ofstream f_service_ts_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_js_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  string outdir = get_out_dir();
-
-  // Make output file(s)
-  string f_types_name = outdir + program_->get_name() + "_types.js";
-  f_types_.open(f_types_name.c_str());
-
-  if (gen_ts_) {
-    string f_types_ts_name = outdir + program_->get_name() + "_types.d.ts";
-    f_types_ts_.open(f_types_ts_name.c_str());
-  }
-
-  // Print header
-  f_types_ << autogen_comment() << js_includes() << endl << render_includes() << endl;
-
-  if (gen_ts_) {
-    f_types_ts_ << autogen_comment() << endl;
-  }
-
-  if (gen_node_) {
-    f_types_ << "var ttypes = module.exports = {};" << endl;
-  }
-
-  string pns;
-
-  // setup the namespace
-  // TODO should the namespace just be in the directory structure for node?
-  vector<string> ns_pieces = js_namespace_pieces(program_);
-  if (ns_pieces.size() > 0) {
-    for (size_t i = 0; i < ns_pieces.size(); ++i) {
-      pns += ((i == 0) ? "" : ".") + ns_pieces[i];
-      f_types_ << "if (typeof " << pns << " === 'undefined') {" << endl;
-      f_types_ << "  " << pns << " = {};" << endl;
-      f_types_ << "}" << endl;
-    }
-    if (gen_ts_) {
-      ts_module_ = pns;
-      f_types_ts_ << "declare module " << ts_module_ << " {";
-    }
-  }
-}
-
-/**
- * Prints standard js imports
- */
-string t_js_generator::js_includes() {
-  if (gen_node_) {
-    return string(
-        "var thrift = require('thrift');\n"
-        "var Thrift = thrift.Thrift;\n"
-        "var Q = thrift.Q;\n");
-  }
-
-  return "";
-}
-
-/**
- * Renders all the imports necessary for including another Thrift program
- */
-string t_js_generator::render_includes() {
-  string result = "";
-
-  if (gen_node_) {
-    const vector<t_program*>& includes = program_->get_includes();
-    for (size_t i = 0; i < includes.size(); ++i) {
-      result += "var " + includes[i]->get_name() + "_ttypes = require('./" + includes[i]->get_name()
-                + "_types')\n";
-    }
-    if (includes.size() > 0) {
-      result += "\n";
-    }
-  }
-
-  return result;
-}
-
-/**
- * Close up (or down) some filez.
- */
-void t_js_generator::close_generator() {
-  // Close types file(s)
-
-  f_types_.close();
-
-  if (gen_ts_) {
-    if (!ts_module_.empty()) {
-      f_types_ts_ << "}";
-    }
-    f_types_ts_.close();
-  }
-}
-
-/**
- * Generates a typedef. This is not done in JS, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_js_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Since define is expensive to lookup
- * in JS, we use a global array for this.
- *
- * @param tenum The enumeration
- */
-void t_js_generator::generate_enum(t_enum* tenum) {
-  f_types_ << js_type_namespace(tenum->get_program()) << tenum->get_name() << " = {" << endl;
-
-  if (gen_ts_) {
-    f_types_ts_ << ts_print_doc(tenum) << ts_indent() << ts_declare() << "enum "
-                << tenum->get_name() << " {" << endl;
-  }
-
-  indent_up();
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    if (gen_ts_) {
-      f_types_ts_ << ts_indent() << (*c_iter)->get_name() << " = " << value << "," << endl;
-      // add 'value: key' in addition to 'key: value' for TypeScript enums
-      f_types_ << indent() << "'" << value << "' : '" << (*c_iter)->get_name() << "'," << endl;
-    }
-    f_types_ << indent() << "'" << (*c_iter)->get_name() << "' : " << value;
-    if (c_iter != constants.end() - 1) {
-      f_types_ << ",";
-    }
-    f_types_ << endl;
-  }
-
-  indent_down();
-
-  f_types_ << "};" << endl;
-
-  if (gen_ts_) {
-    f_types_ts_ << ts_indent() << "}" << endl;
-  }
-}
-
-/**
- * Generate a constant value
- */
-void t_js_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  f_types_ << js_type_namespace(program_) << name << " = ";
-  f_types_ << render_const_value(type, value) << ";" << endl;
-
-  if (gen_ts_) {
-    f_types_ts_ << ts_print_doc(tconst) << ts_indent() << ts_declare() << "var " << name << ": "
-                << ts_get_type(type) << ";" << endl;
-  }
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_js_generator::render_const_value(t_type* type, t_const_value* value) {
-  std::ostringstream out;
-
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << "'" << get_escaped_string(value) << "'";
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    out << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "new " << js_type_namespace(type->get_program()) << type->get_name() << "({" << endl;
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      if (v_iter != val.begin())
-        out << ",";
-      out << render_const_value(g_type_string, v_iter->first);
-      out << " : ";
-      out << render_const_value(field_type, v_iter->second);
-    }
-
-    out << "})";
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
-    indent_up();
-
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      if (v_iter != val.begin())
-        out << "," << endl;
-
-      out << indent() << render_const_value(ktype, v_iter->first);
-
-      out << " : ";
-      out << render_const_value(vtype, v_iter->second);
-    }
-
-    indent_down();
-    out << endl << "}";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    out << "[";
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      if (v_iter != val.begin())
-        out << ",";
-      out << render_const_value(etype, *v_iter);
-    }
-    out << "]";
-  }
-  return out.str();
-}
-
-/**
- * Make a struct
- */
-void t_js_generator::generate_struct(t_struct* tstruct) {
-  generate_js_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_js_generator::generate_xception(t_struct* txception) {
-  generate_js_struct(txception, true);
-}
-
-/**
- * Structs can be normal or exceptions.
- */
-void t_js_generator::generate_js_struct(t_struct* tstruct, bool is_exception) {
-  generate_js_struct_definition(f_types_, tstruct, is_exception);
-}
-
-/**
- * Return type of contained elements for a container type. For maps
- * this is type of value (keys are always strings in js)
- */
-t_type* t_js_generator::get_contained_type(t_type* t) {
-  t_type* etype;
-  if (t->is_list()) {
-    etype = ((t_list*)t)->get_elem_type();
-  } else if (t->is_set()) {
-    etype = ((t_set*)t)->get_elem_type();
-  } else {
-    etype = ((t_map*)t)->get_val_type();
-  }
-  return etype;
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is nothing in JS
- * where the objects are all just associative arrays (unless of course we
- * decide to start using objects for them...)
- *
- * @param tstruct The struct definition
- */
-void t_js_generator::generate_js_struct_definition(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   bool is_exception,
-                                                   bool is_exported) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  if (gen_node_) {
-    if (is_exported) {
-      out << js_namespace(tstruct->get_program()) << tstruct->get_name() << " = "
-          << "module.exports." << tstruct->get_name() << " = function(args) {" << endl;
-    } else {
-      out << js_namespace(tstruct->get_program()) << tstruct->get_name() << " = function(args) {"
-          << endl;
-    }
-  } else {
-    out << js_namespace(tstruct->get_program()) << tstruct->get_name() << " = function(args) {"
-        << endl;
-    if (gen_ts_) {
-      f_types_ts_ << ts_print_doc(tstruct) << ts_indent() << ts_declare() << "class "
-                  << tstruct->get_name() << (is_exception ? " extends Thrift.TException" : "")
-                  << " {" << endl;
-    }
-  }
-
-  indent_up();
-
-  if (gen_node_ && is_exception) {
-    out << indent() << "Thrift.TException.call(this, \"" << js_namespace(tstruct->get_program())
-        << tstruct->get_name() << "\")" << endl;
-    out << indent() << "this.name = \"" << js_namespace(tstruct->get_program())
-        << tstruct->get_name() << "\"" << endl;
-  }
-
-  // members with arguments
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    string dval = declare_field(*m_iter, false, true);
-    t_type* t = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL && !(t->is_struct() || t->is_xception())) {
-      dval = render_const_value((*m_iter)->get_type(), (*m_iter)->get_value());
-      out << indent() << "this." << (*m_iter)->get_name() << " = " << dval << ";" << endl;
-    } else {
-      out << indent() << dval << ";" << endl;
-    }
-    if (gen_ts_) {
-      f_types_ts_ << ts_indent() << (*m_iter)->get_name() << ": "
-                  << ts_get_type((*m_iter)->get_type()) << ";" << endl;
-    }
-  }
-
-  // Generate constructor from array
-  if (members.size() > 0) {
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if ((*m_iter)->get_value() != NULL && (t->is_struct() || t->is_xception())) {
-        indent(out) << "this." << (*m_iter)->get_name() << " = "
-                    << render_const_value(t, (*m_iter)->get_value()) << ";" << endl;
-      }
-    }
-
-    // Early returns for exceptions
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if (t->is_xception()) {
-        out << indent() << "if (args instanceof " << js_type_namespace(t->get_program())
-            << t->get_name() << ") {" << endl << indent() << indent() << "this."
-            << (*m_iter)->get_name() << " = args;" << endl << indent() << indent() << "return;"
-            << endl << indent() << "}" << endl;
-      }
-    }
-
-    out << indent() << "if (args) {" << endl;
-    if (gen_ts_) {
-      f_types_ts_ << endl << ts_indent() << "constructor(args?: { ";
-    }
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      out << indent() << indent() << "if (args." << (*m_iter)->get_name() << " !== undefined && args." << (*m_iter)->get_name() << " !== null) {"
-          << endl << indent() << indent() << indent() << "this." << (*m_iter)->get_name();
-
-      if (t->is_struct()) {
-        out << (" = new " + js_type_namespace(t->get_program()) + t->get_name() +
-                "(args."+(*m_iter)->get_name() +");");
-        out << endl;
-      } else if (t->is_container()) {
-        t_type* etype = get_contained_type(t);
-        string copyFunc = t->is_map() ? "Thrift.copyMap" : "Thrift.copyList";
-        string type_list = "";
-
-        while (etype->is_container()) {
-          if (type_list.length() > 0) {
-            type_list += ", ";
-          }
-          type_list += etype->is_map() ? "Thrift.copyMap" : "Thrift.copyList";
-          etype = get_contained_type(etype);
-        }
-
-        if (etype->is_struct()) {
-          if (type_list.length() > 0) {
-            type_list += ", ";
-          }
-          type_list += js_type_namespace(etype->get_program()) + etype->get_name();
-        }
-        else {
-          if (type_list.length() > 0) {
-            type_list += ", ";
-          }
-          type_list += "null";
-        }
-
-        out << (" = " + copyFunc + "(args." + (*m_iter)->get_name() +
-                ", [" + type_list + "]);");
-        out << endl;
-      } else {
-        out << " = args." << (*m_iter)->get_name() << ";" << endl;
-      }
-
-      if (!(*m_iter)->get_req()) {
-        out << indent() << indent() << "} else {" << endl << indent() << indent() << indent()
-            << "throw new Thrift.TProtocolException(Thrift.TProtocolExceptionType.UNKNOWN, "
-               "'Required field " << (*m_iter)->get_name() << " is unset!');" << endl;
-      }
-      out << indent() << indent() << "}" << endl;
-      if (gen_ts_) {
-        f_types_ts_ << (*m_iter)->get_name() << ts_get_req(*m_iter) << ": "
-                    << ts_get_type((*m_iter)->get_type()) << "; ";
-      }
-    }
-
-    out << indent() << "}" << endl;
-    if (gen_ts_) {
-      f_types_ts_ << "});" << endl;
-    }
-  }
-
-  indent_down();
-  out << "};" << endl;
-  if (gen_ts_) {
-    f_types_ts_ << ts_indent() << "}" << endl;
-  }
-
-  if (is_exception) {
-    out << "Thrift.inherits(" << js_namespace(tstruct->get_program()) << tstruct->get_name()
-        << ", Thrift.TException);" << endl;
-    out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype.name = '"
-        << tstruct->get_name() << "';" << endl;
-  } else {
-    // init prototype
-    out << js_namespace(tstruct->get_program()) << tstruct->get_name() << ".prototype = {};"
-        << endl;
-  }
-
-  generate_js_struct_reader(out, tstruct);
-  generate_js_struct_writer(out, tstruct);
-}
-
-/**
- * Generates the read() method for a struct
- */
-void t_js_generator::generate_js_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << js_namespace(tstruct->get_program()) << tstruct->get_name()
-      << ".prototype.read = function(input) {" << endl;
-
-  indent_up();
-
-  indent(out) << "input.readStructBegin();" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-
-  scope_up(out);
-
-  indent(out) << "var ret = input.readFieldBegin();" << endl;
-  indent(out) << "var fname = ret.fname;" << endl;
-  indent(out) << "var ftype = ret.ftype;" << endl;
-  indent(out) << "var fid = ret.fid;" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if (ftype == Thrift.Type.STOP) {" << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-  if (!fields.empty()) {
-    // Switch statement on the field we are reading
-    indent(out) << "switch (fid)" << endl;
-
-    scope_up(out);
-
-    // Generate deserialization code for known cases
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-
-      indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-
-      indent_up();
-      generate_deserialize_field(out, *f_iter, "this.");
-      indent_down();
-
-      indent(out) << "} else {" << endl;
-
-      indent(out) << "  input.skip(ftype);" << endl;
-
-      out << indent() << "}" << endl << indent() << "break;" << endl;
-    }
-    if (fields.size() == 1) {
-      // pseudo case to make jslint happy
-      indent(out) << "case 0:" << endl;
-      indent(out) << "  input.skip(ftype);" << endl;
-      indent(out) << "  break;" << endl;
-    }
-    // In the default case we skip the field
-    indent(out) << "default:" << endl;
-    indent(out) << "  input.skip(ftype);" << endl;
-
-    scope_down(out);
-  } else {
-    indent(out) << "input.skip(ftype);" << endl;
-  }
-
-  indent(out) << "input.readFieldEnd();" << endl;
-
-  scope_down(out);
-
-  indent(out) << "input.readStructEnd();" << endl;
-
-  indent(out) << "return;" << endl;
-
-  indent_down();
-  out << indent() << "};" << endl << endl;
-}
-
-/**
- * Generates the write() method for a struct
- */
-void t_js_generator::generate_js_struct_writer(ofstream& out, t_struct* tstruct) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << js_namespace(tstruct->get_program()) << tstruct->get_name()
-      << ".prototype.write = function(output) {" << endl;
-
-  indent_up();
-
-  indent(out) << "output.writeStructBegin('" << name << "');" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << indent() << "if (this." << (*f_iter)->get_name() << " !== null && this."
-        << (*f_iter)->get_name() << " !== undefined) {" << endl;
-    indent_up();
-
-    indent(out) << "output.writeFieldBegin("
-                << "'" << (*f_iter)->get_name() << "', " << type_to_enum((*f_iter)->get_type())
-                << ", " << (*f_iter)->get_key() << ");" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    indent(out) << "output.writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}" << endl;
-  }
-
-  out << indent() << "output.writeFieldStop();" << endl << indent() << "output.writeStructEnd();"
-      << endl;
-
-  out << indent() << "return;" << endl;
-
-  indent_down();
-  out << indent() << "};" << endl << endl;
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_js_generator::generate_service(t_service* tservice) {
-  string f_service_name = get_out_dir() + service_name_ + ".js";
-  f_service_.open(f_service_name.c_str());
-
-  if (gen_ts_) {
-    string f_service_ts_name = get_out_dir() + service_name_ + ".d.ts";
-    f_service_ts_.open(f_service_ts_name.c_str());
-  }
-
-  f_service_ << autogen_comment() << js_includes() << endl << render_includes() << endl;
-
-  if (gen_ts_) {
-    if (tservice->get_extends() != NULL) {
-      f_service_ts_ << "/// <reference path=\"" << tservice->get_extends()->get_name()
-                    << ".d.ts\" />" << endl;
-    }
-    f_service_ts_ << autogen_comment() << endl;
-    if (!ts_module_.empty()) {
-      f_service_ts_ << "declare module " << ts_module_ << " {";
-    }
-  }
-
-  if (gen_node_) {
-    if (tservice->get_extends() != NULL) {
-      f_service_ << "var " << tservice->get_extends()->get_name() << " = require('./"
-                 << tservice->get_extends()->get_name() << "')" << endl << "var "
-                 << tservice->get_extends()->get_name()
-                 << "Client = " << tservice->get_extends()->get_name() << ".Client" << endl
-                 << "var " << tservice->get_extends()->get_name()
-                 << "Processor = " << tservice->get_extends()->get_name() << ".Processor" << endl;
-    }
-
-    f_service_ << "var ttypes = require('./" + program_->get_name() + "_types');" << endl;
-  }
-
-  generate_service_helpers(tservice);
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-
-  if (gen_node_) {
-    generate_service_processor(tservice);
-  }
-
-  f_service_.close();
-  if (gen_ts_) {
-    if (!ts_module_.empty()) {
-      f_service_ts_ << "}";
-    }
-    f_service_ts_.close();
-  }
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_js_generator::generate_service_processor(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Processor = "
-             << "exports.Processor = function(handler) ";
-
-  scope_up(f_service_);
-
-  f_service_ << indent() << "this._handler = handler" << endl;
-
-  scope_down(f_service_);
-
-  if (tservice->get_extends() != NULL) {
-    indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program())
-                       << service_name_ << "Processor, " << tservice->get_extends()->get_name()
-                       << "Processor)" << endl;
-  }
-
-  // Generate the server implementation
-  indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                     << "Processor.prototype.process = function(input, output) ";
-
-  scope_up(f_service_);
-
-  f_service_ << indent() << "var r = input.readMessageBegin();" << endl << indent()
-             << "if (this['process_' + r.fname]) {" << endl << indent()
-             << "  return this['process_' + r.fname].call(this, r.rseqid, input, output);" << endl
-             << indent() << "} else {" << endl << indent() << "  input.skip(Thrift.Type.STRUCT);"
-             << endl << indent() << "  input.readMessageEnd();" << endl << indent()
-             << "  var x = new "
-                "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN_METHOD, "
-                "'Unknown function ' + r.fname);" << endl << indent()
-             << "  output.writeMessageBegin(r.fname, Thrift.MessageType.EXCEPTION, r.rseqid);"
-             << endl << indent() << "  x.write(output);" << endl << indent()
-             << "  output.writeMessageEnd();" << endl << indent() << "  output.flush();" << endl
-             << indent() << "}" << endl;
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_js_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                     << "Processor.prototype.process_" + tfunction->get_name()
-                        + " = function(seqid, input, output) ";
-
-  scope_up(f_service_);
-
-  string argsname = js_namespace(program_) + service_name_ + "_" + tfunction->get_name() + "_args";
-  string resultname = js_namespace(program_) + service_name_ + "_" + tfunction->get_name()
-                      + "_result";
-
-  f_service_ << indent() << "var args = new " << argsname << "();" << endl << indent()
-             << "args.read(input);" << endl << indent() << "input.readMessageEnd();" << endl;
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    indent(f_service_) << "this._handler." << tfunction->get_name() << "(";
-
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-
-    f_service_ << ")" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-    return;
-  }
-
-  f_service_ << indent() << "if (this._handler." << tfunction->get_name()
-             << ".length === " << fields.size() << ") {" << endl;
-  indent_up();
-  indent(f_service_) << "Q.fcall(this._handler." << tfunction->get_name();
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    f_service_ << ", args." << (*f_iter)->get_name();
-  }
-
-  f_service_ << ")" << endl;
-  indent_up();
-  indent(f_service_) << ".then(function(result) {" << endl;
-  indent_up();
-  f_service_ << indent() << "var result = new " << resultname << "({success: result});" << endl
-             << indent() << "output.writeMessageBegin(\"" << tfunction->get_name()
-             << "\", Thrift.MessageType.REPLY, seqid);" << endl << indent()
-             << "result.write(output);" << endl << indent() << "output.writeMessageEnd();" << endl
-             << indent() << "output.flush();" << endl;
-  indent_down();
-  indent(f_service_) << "}, function (err) {" << endl;
-  indent_up();
-
-  bool has_exception = false;
-  t_struct* exceptions = tfunction->get_xceptions();
-  if (exceptions) {
-    const vector<t_field*>& members = exceptions->get_members();
-    for (vector<t_field*>::const_iterator it = members.begin(); it != members.end(); ++it) {
-      t_type* t = get_true_type((*it)->get_type());
-      if (t->is_xception()) {
-        if (!has_exception) {
-          has_exception = true;
-          indent(f_service_) << "if (err instanceof " << js_type_namespace(t->get_program())
-                             << t->get_name();
-        } else {
-          f_service_ << " || err instanceof " << js_type_namespace(t->get_program())
-                     << t->get_name();
-        }
-      }
-    }
-  }
-
-  if (has_exception) {
-    f_service_ << ") {" << endl;
-    indent_up();
-    f_service_ << indent() << "var result = new " << resultname << "(err);" << endl << indent()
-               << "output.writeMessageBegin(\"" << tfunction->get_name()
-               << "\", Thrift.MessageType.REPLY, seqid);" << endl;
-
-    indent_down();
-    indent(f_service_) << "} else {" << endl;
-    indent_up();
-  }
-
-  f_service_ << indent() << "var result = new "
-                            "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN,"
-                            " err.message);" << endl << indent() << "output.writeMessageBegin(\""
-             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << endl;
-
-  if (has_exception) {
-    indent_down();
-    indent(f_service_) << "}" << endl;
-  }
-
-  f_service_ << indent() << "result.write(output);" << endl << indent()
-             << "output.writeMessageEnd();" << endl << indent() << "output.flush();" << endl;
-  indent_down();
-  indent(f_service_) << "});" << endl;
-  indent_down();
-  indent_down();
-  indent(f_service_) << "} else {" << endl;
-  indent_up();
-  indent(f_service_) << "this._handler." << tfunction->get_name() << "(";
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    f_service_ << "args." << (*f_iter)->get_name() << ", ";
-  }
-
-  f_service_ << "function (err, result) {" << endl;
-  indent_up();
-
-  indent(f_service_) << "if (err == null";
-  if (has_exception) {
-    const vector<t_field*>& members = exceptions->get_members();
-    for (vector<t_field*>::const_iterator it = members.begin(); it != members.end(); ++it) {
-      t_type* t = get_true_type((*it)->get_type());
-      if (t->is_xception()) {
-        f_service_ << " || err instanceof " << js_type_namespace(t->get_program()) << t->get_name();
-      }
-    }
-  }
-  f_service_ << ") {" << endl;
-  indent_up();
-  f_service_ << indent() << "var result = new " << resultname
-             << "((err != null ? err : {success: result}));" << endl << indent()
-             << "output.writeMessageBegin(\"" << tfunction->get_name()
-             << "\", Thrift.MessageType.REPLY, seqid);" << endl;
-  indent_down();
-  indent(f_service_) << "} else {" << endl;
-  indent_up();
-  f_service_ << indent() << "var result = new "
-                            "Thrift.TApplicationException(Thrift.TApplicationExceptionType.UNKNOWN,"
-                            " err.message);" << endl << indent() << "output.writeMessageBegin(\""
-             << tfunction->get_name() << "\", Thrift.MessageType.EXCEPTION, seqid);" << endl;
-  indent_down();
-  f_service_ << indent() << "}" << endl << indent() << "result.write(output);" << endl << indent()
-             << "output.writeMessageEnd();" << endl << indent() << "output.flush();" << endl;
-
-  indent_down();
-  indent(f_service_) << "});" << endl;
-  indent_down();
-  indent(f_service_) << "}" << endl;
-  scope_down(f_service_);
-  f_service_ << endl;
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_js_generator::generate_service_helpers(t_service* tservice) {
-  // Do not generate TS definitions for helper functions
-  bool gen_ts_tmp = gen_ts_;
-  gen_ts_ = false;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_ << "//HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    string name = ts->get_name();
-    ts->set_name(service_name_ + "_" + name);
-    generate_js_struct_definition(f_service_, ts, false, false);
-    generate_js_function_helpers(*f_iter);
-    ts->set_name(name);
-  }
-
-  gen_ts_ = gen_ts_tmp;
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_js_generator::generate_js_function_helpers(t_function* tfunction) {
-  t_struct result(program_, service_name_ + "_" + tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_js_struct_definition(f_service_, &result, false, false);
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_js_generator::generate_service_interface(t_service* tservice) {
-  (void)tservice;
-}
-
-/**
- * Generates a REST interface
- */
-void t_js_generator::generate_service_rest(t_service* tservice) {
-  (void)tservice;
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_js_generator::generate_service_client(t_service* tservice) {
-  if (gen_node_) {
-    f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Client = "
-               << "exports.Client = function(output, pClass) {" << endl;
-  } else {
-    f_service_ << js_namespace(tservice->get_program()) << service_name_
-               << "Client = function(input, output) {" << endl;
-    if (gen_ts_) {
-      f_service_ts_ << ts_print_doc(tservice) << ts_indent() << ts_declare() << "class "
-                    << service_name_ << "Client ";
-      if (tservice->get_extends() != NULL) {
-        f_service_ts_ << "extends " << tservice->get_extends()->get_name() << "Client ";
-      }
-      f_service_ts_ << "{" << endl;
-    }
-  }
-
-  indent_up();
-
-  if (gen_node_) {
-    f_service_ << indent() << "  this.output = output;" << endl << indent()
-               << "  this.pClass = pClass;" << endl << indent() << "  this._seqid = 0;" << endl
-               << indent() << "  this._reqs = {};" << endl;
-  } else {
-    f_service_ << indent() << "  this.input = input;" << endl << indent()
-               << "  this.output = (!output) ? input : output;" << endl << indent()
-               << "  this.seqid = 0;" << endl;
-    if (gen_ts_) {
-      f_service_ts_ << ts_indent() << "input: Thrift.TJSONProtocol;" << endl << ts_indent()
-                    << "output: Thrift.TJSONProtocol;" << endl << ts_indent() << "seqid: number;"
-                    << endl << endl << ts_indent()
-                    << "constructor(input: Thrift.TJSONProtocol, output?: Thrift.TJSONProtocol);"
-                    << endl;
-    }
-  }
-
-  indent_down();
-
-  f_service_ << indent() << "};" << endl;
-
-  if (tservice->get_extends() != NULL) {
-    indent(f_service_) << "Thrift.inherits(" << js_namespace(tservice->get_program())
-                       << service_name_ << "Client, "
-                       << js_namespace(tservice->get_extends()->get_program())
-                       << tservice->get_extends()->get_name() << "Client);" << endl;
-  } else {
-    // init prototype
-    indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                       << "Client.prototype = {};" << endl;
-  }
-
-  // utils for multiplexed services
-  if (gen_node_) {
-    indent(f_service_) << js_namespace(tservice->get_program()) << service_name_
-                       << "Client.prototype.seqid = function() { return this._seqid; }" << endl
-                       << js_namespace(tservice->get_program()) << service_name_
-                       << "Client.prototype.new_seqid = function() { return this._seqid += 1; }"
-                       << endl;
-  }
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-    string arglist = argument_list(arg_struct);
-
-    // Open function
-    f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype."
-               << function_signature(*f_iter, "", true) << " {" << endl;
-
-    indent_up();
-
-    if (gen_ts_) {
-      f_service_ts_ << ts_print_doc(*f_iter) <<
-          // function definition without callback
-          ts_indent() << ts_function_signature(*f_iter, false) << endl << ts_print_doc(*f_iter) <<
-          // overload with callback
-          ts_indent() << ts_function_signature(*f_iter, true) << endl;
-    }
-
-    if (gen_node_) { // Node.js output      ./gen-nodejs
-      f_service_ << indent() << "this._seqid = this.new_seqid();" << endl << indent()
-                 << "if (callback === undefined) {" << endl;
-      indent_up();
-      f_service_ << indent() << "var _defer = Q.defer();" << endl << indent()
-                 << "this._reqs[this.seqid()] = function(error, result) {" << endl;
-      indent_up();
-      indent(f_service_) << "if (error) {" << endl;
-      indent_up();
-      indent(f_service_) << "_defer.reject(error);" << endl;
-      indent_down();
-      indent(f_service_) << "} else {" << endl;
-      indent_up();
-      indent(f_service_) << "_defer.resolve(result);" << endl;
-      indent_down();
-      indent(f_service_) << "}" << endl;
-      indent_down();
-      indent(f_service_) << "};" << endl;
-      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << endl
-                 << indent() << "return _defer.promise;" << endl;
-      indent_down();
-      indent(f_service_) << "} else {" << endl;
-      indent_up();
-      f_service_ << indent() << "this._reqs[this.seqid()] = callback;" << endl << indent()
-                 << "this.send_" << funname << "(" << arglist << ");" << endl;
-      indent_down();
-      indent(f_service_) << "}" << endl;
-    } else if (gen_jquery_) { // jQuery output       ./gen-js
-      f_service_ << indent() << "if (callback === undefined) {" << endl;
-      indent_up();
-      f_service_ << indent() << "this.send_" << funname << "(" << arglist << ");" << endl;
-      if (!(*f_iter)->is_oneway()) {
-        f_service_ << indent();
-        if (!(*f_iter)->get_returntype()->is_void()) {
-          f_service_ << "return ";
-        }
-        f_service_ << "this.recv_" << funname << "();" << endl;
-      }
-      indent_down();
-      f_service_ << indent() << "} else {" << endl;
-      indent_up();
-      f_service_ << indent() << "var postData = this.send_" << funname << "(" << arglist
-                 << (arglist.empty() ? "" : ", ") << "true);" << endl;
-      f_service_ << indent() << "return this.output.getTransport()" << endl;
-      indent_up();
-      f_service_ << indent() << ".jqRequest(this, postData, arguments, this.recv_" << funname
-                 << ");" << endl;
-      indent_down();
-      indent_down();
-      f_service_ << indent() << "}" << endl;
-    } else { // Standard JavaScript ./gen-js
-      f_service_ << indent() << "this.send_" << funname << "(" << arglist
-                 << (arglist.empty() ? "" : ", ") << "callback); " << endl;
-      if (!(*f_iter)->is_oneway()) {
-        f_service_ << indent() << "if (!callback) {" << endl;
-        f_service_ << indent();
-        if (!(*f_iter)->get_returntype()->is_void()) {
-          f_service_ << "  return ";
-        }
-        f_service_ << "this.recv_" << funname << "();" << endl;
-        f_service_ << indent() << "}" << endl;
-      }
-    }
-
-    indent_down();
-
-    f_service_ << "};" << endl << endl;
-
-    // Send function
-    f_service_ << js_namespace(tservice->get_program()) << service_name_ << "Client.prototype.send_"
-               << function_signature(*f_iter, "", !gen_node_) << " {" << endl;
-
-    indent_up();
-
-    std::string outputVar;
-    if (gen_node_) {
-      f_service_ << indent() << "var output = new this.pClass(this.output);" << endl;
-      outputVar = "output";
-    } else {
-      outputVar = "this.output";
-    }
-
-    std::string argsname = js_namespace(program_) + service_name_ + "_" + (*f_iter)->get_name()
-                           + "_args";
-
-    std::string messageType = (*f_iter)->is_oneway() ? "Thrift.MessageType.ONEWAY"
-                                                     : "Thrift.MessageType.CALL";
-
-    // Serialize the request header
-    if (gen_node_) {
-      f_service_ << indent() << outputVar << ".writeMessageBegin('" << (*f_iter)->get_name()
-                 << "', " << messageType << ", this.seqid());" << endl;
-    } else {
-      f_service_ << indent() << outputVar << ".writeMessageBegin('" << (*f_iter)->get_name()
-                 << "', " << messageType << ", this.seqid);" << endl;
-    }
-
-    f_service_ << indent() << "var args = new " << argsname << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    // Write to the stream
-    f_service_ << indent() << "args.write(" << outputVar << ");" << endl << indent() << outputVar
-               << ".writeMessageEnd();" << endl;
-
-    if (gen_node_) {
-      f_service_ << indent() << "return this.output.flush();" << endl;
-    } else {
-      if (gen_jquery_) {
-        f_service_ << indent() << "return this.output.getTransport().flush(callback);" << endl;
-      } else {
-        f_service_ << indent() << "if (callback) {" << endl;
-        f_service_ << indent() << "  var self = this;" << endl;
-        f_service_ << indent() << "  this.output.getTransport().flush(true, function() {" << endl;
-        f_service_ << indent() << "    var result = null;" << endl;
-        f_service_ << indent() << "    try {" << endl;
-        f_service_ << indent() << "      result = self.recv_" << funname << "();" << endl;
-        f_service_ << indent() << "    } catch (e) {" << endl;
-        f_service_ << indent() << "      result = e;" << endl;
-        f_service_ << indent() << "    }" << endl;
-        f_service_ << indent() << "    callback(result);" << endl;
-        f_service_ << indent() << "  });" << endl;
-        f_service_ << indent() << "} else {" << endl;
-        f_service_ << indent() << "  return this.output.getTransport().flush();" << endl;
-        f_service_ << indent() << "}" << endl;
-      }
-    }
-
-    indent_down();
-
-    f_service_ << "};" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = js_namespace(tservice->get_program()) + service_name_ + "_"
-                               + (*f_iter)->get_name() + "_result";
-
-      if (gen_node_) {
-        // Open function
-        f_service_ << endl << js_namespace(tservice->get_program()) << service_name_
-                   << "Client.prototype.recv_" << (*f_iter)->get_name()
-                   << " = function(input,mtype,rseqid) {" << endl;
-      } else {
-        t_struct noargs(program_);
-
-        t_function recv_function((*f_iter)->get_returntype(),
-                                 string("recv_") + (*f_iter)->get_name(),
-                                 &noargs);
-        // Open function
-        f_service_ << endl << js_namespace(tservice->get_program()) << service_name_
-                   << "Client.prototype." << function_signature(&recv_function) << " {" << endl;
-      }
-
-      indent_up();
-
-      std::string inputVar;
-      if (gen_node_) {
-        inputVar = "input";
-      } else {
-        inputVar = "this.input";
-      }
-
-      if (gen_node_) {
-        f_service_ << indent() << "var callback = this._reqs[rseqid] || function() {};" << endl
-                   << indent() << "delete this._reqs[rseqid];" << endl;
-      } else {
-        f_service_ << indent() << "var ret = this.input.readMessageBegin();" << endl << indent()
-                   << "var fname = ret.fname;" << endl << indent() << "var mtype = ret.mtype;"
-                   << endl << indent() << "var rseqid = ret.rseqid;" << endl;
-      }
-
-      f_service_ << indent() << "if (mtype == Thrift.MessageType.EXCEPTION) {" << endl << indent()
-                 << "  var x = new Thrift.TApplicationException();" << endl << indent()
-                 << "  x.read(" << inputVar << ");" << endl << indent() << "  " << inputVar
-                 << ".readMessageEnd();" << endl << indent() << "  " << render_recv_throw("x")
-                 << endl << indent() << "}" << endl;
-
-      f_service_ << indent() << "var result = new " << resultname << "();" << endl << indent()
-                 << "result.read(" << inputVar << ");" << endl;
-
-      f_service_ << indent() << inputVar << ".readMessageEnd();" << endl << endl;
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (null !== result." << (*x_iter)->get_name() << ") {" << endl
-                   << indent() << "  " << render_recv_throw("result." + (*x_iter)->get_name())
-                   << endl << indent() << "}" << endl;
-      }
-
-      // Careful, only return result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (null !== result.success) {" << endl << indent() << "  "
-                   << render_recv_return("result.success") << endl << indent() << "}" << endl;
-        f_service_ << indent()
-                   << render_recv_throw("'" + (*f_iter)->get_name() + " failed: unknown result'")
-                   << endl;
-      } else {
-        if (gen_node_) {
-          indent(f_service_) << "callback(null)" << endl;
-        } else {
-          indent(f_service_) << "return;" << endl;
-        }
-      }
-
-      // Close function
-      indent_down();
-      f_service_ << "};" << endl;
-    }
-  }
-
-  if (gen_ts_) {
-    f_service_ts_ << ts_indent() << "}" << endl;
-  }
-}
-
-std::string t_js_generator::render_recv_throw(std::string var) {
-  if (gen_node_) {
-    return "return callback(" + var + ");";
-  } else {
-    return "throw " + var + ";";
-  }
-}
-
-std::string t_js_generator::render_recv_return(std::string var) {
-  if (gen_node_) {
-    return "return callback(null, " + var + ");";
-  } else {
-    return "return " + var + ";";
-  }
-}
-
-/**
- * Deserializes a field of any type.
- */
-void t_js_generator::generate_deserialize_field(ofstream& out,
-                                                t_field* tfield,
-                                                string prefix,
-                                                bool inclass) {
-  (void)inclass;
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << name << " = input.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << (((t_base_type*)type)->is_binary() ? "readBinary()" : "readString()");
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool()";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte()";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16()";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32()";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64()";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble()";
-        break;
-      default:
-        throw "compiler error: no JS name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32()";
-    }
-
-    if (!gen_node_) {
-      out << ".value";
-    }
-
-    out << ";" << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a variable. This makes two key assumptions,
- * first that there is a const char* variable named data that points to the
- * buffer for deserialization, and that there is a variable protocol which
- * is a reference to a TProtocol serialization object.
- */
-void t_js_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  out << indent() << prefix << " = new " << js_type_namespace(tstruct->get_program())
-      << tstruct->get_name() << "();" << endl << indent() << prefix << ".read(input);" << endl;
-}
-
-void t_js_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-  string rtmp3 = tmp("_rtmp3");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  out << indent() << "var " << size << " = 0;" << endl;
-  out << indent() << "var " << rtmp3 << ";" << endl;
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    out << indent() << prefix << " = {};" << endl << indent() << "var " << ktype << " = 0;" << endl
-        << indent() << "var " << vtype << " = 0;" << endl;
-
-    out << indent() << rtmp3 << " = input.readMapBegin();" << endl;
-    out << indent() << ktype << " = " << rtmp3 << ".ktype;" << endl;
-    out << indent() << vtype << " = " << rtmp3 << ".vtype;" << endl;
-    out << indent() << size << " = " << rtmp3 << ".size;" << endl;
-
-  } else if (ttype->is_set()) {
-
-    out << indent() << prefix << " = [];" << endl << indent() << "var " << etype << " = 0;" << endl
-        << indent() << rtmp3 << " = input.readSetBegin();" << endl << indent() << etype << " = "
-        << rtmp3 << ".etype;" << endl << indent() << size << " = " << rtmp3 << ".size;" << endl;
-
-  } else if (ttype->is_list()) {
-
-    out << indent() << prefix << " = [];" << endl << indent() << "var " << etype << " = 0;" << endl
-        << indent() << rtmp3 << " = input.readListBegin();" << endl << indent() << etype << " = "
-        << rtmp3 << ".etype;" << endl << indent() << size << " = " << rtmp3 << ".size;" << endl;
-  }
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for (var " << i << " = 0; " << i << " < " << size << "; ++" << i << ")" << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    if (!gen_node_) {
-      out << indent() << "if (" << i << " > 0 ) {" << endl << indent()
-          << "  if (input.rstack.length > input.rpos[input.rpos.length -1] + 1) {" << endl
-          << indent() << "    input.rstack.pop();" << endl << indent() << "  }" << endl << indent()
-          << "}" << endl;
-    }
-
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "input.readMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "input.readSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "input.readListEnd();" << endl;
-  }
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_js_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("key");
-  string val = tmp("val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey, false, false) << ";" << endl;
-  indent(out) << declare_field(&fval, false, false) << ";" << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << prefix << "[" << key << "] = " << val << ";" << endl;
-}
-
-void t_js_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << "var " << elem << " = null;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".push(" << elem << ");" << endl;
-}
-
-void t_js_generator::generate_deserialize_list_element(ofstream& out,
-                                                       t_list* tlist,
-                                                       string prefix) {
-  string elem = tmp("elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << "var " << elem << " = null;" << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".push(" << elem << ");" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_js_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + tfield->get_name());
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + tfield->get_name());
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = tfield->get_name();
-
-    // Hack for when prefix is defined (always a hash ref)
-    if (!prefix.empty())
-      name = prefix + tfield->get_name();
-
-    indent(out) << "output.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << (((t_base_type*)type)->is_binary() ? "writeBinary(" : "writeString(") << name << ")";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ")";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ")";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ")";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ")";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ")";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ")";
-        break;
-      default:
-        throw "compiler error: no JS name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32(" << name << ")";
-    }
-    out << ";" << endl;
-
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_js_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << prefix << ".write(output);" << endl;
-}
-
-/**
- * Writes out a container
- */
-void t_js_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  if (ttype->is_map()) {
-    indent(out) << "output.writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "Thrift.objectLength(" << prefix << "));" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "output.writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << prefix << ".length);" << endl;
-
-  } else if (ttype->is_list()) {
-
-    indent(out) << "output.writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                << ", " << prefix << ".length);" << endl;
-  }
-
-  if (ttype->is_map()) {
-    string kiter = tmp("kiter");
-    string viter = tmp("viter");
-    indent(out) << "for (var " << kiter << " in " << prefix << ")" << endl;
-    scope_up(out);
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << kiter << "))" << endl;
-    scope_up(out);
-    indent(out) << "var " << viter << " = " << prefix << "[" << kiter << "];" << endl;
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    scope_down(out);
-    scope_down(out);
-
-  } else if (ttype->is_set()) {
-    string iter = tmp("iter");
-    indent(out) << "for (var " << iter << " in " << prefix << ")" << endl;
-    scope_up(out);
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << "))" << endl;
-    scope_up(out);
-    indent(out) << iter << " = " << prefix << "[" << iter << "];" << endl;
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    scope_down(out);
-    scope_down(out);
-
-  } else if (ttype->is_list()) {
-    string iter = tmp("iter");
-    indent(out) << "for (var " << iter << " in " << prefix << ")" << endl;
-    scope_up(out);
-    indent(out) << "if (" << prefix << ".hasOwnProperty(" << iter << "))" << endl;
-    scope_up(out);
-    indent(out) << iter << " = " << prefix << "[" << iter << "];" << endl;
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    scope_down(out);
-    scope_down(out);
-  }
-
-  if (ttype->is_map()) {
-    indent(out) << "output.writeMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "output.writeSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "output.writeListEnd();" << endl;
-  }
-}
-
-/**
- * Serializes the members of a map.
- *
- */
-void t_js_generator::generate_serialize_map_element(ofstream& out,
-                                                    t_map* tmap,
-                                                    string kiter,
-                                                    string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield);
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield);
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_js_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_js_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield);
-}
-
-/**
- * Declares a field, which may include initialization as necessary.
- *
- * @param ttype The type
- */
-string t_js_generator::declare_field(t_field* tfield, bool init, bool obj) {
-  string result = "this." + tfield->get_name();
-
-  if (!obj) {
-    result = "var " + tfield->get_name();
-  }
-
-  if (init) {
-    t_type* type = get_true_type(tfield->get_type());
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        break;
-      case t_base_type::TYPE_STRING:
-      case t_base_type::TYPE_BOOL:
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-      case t_base_type::TYPE_DOUBLE:
-        result += " = null";
-        break;
-      default:
-        throw "compiler error: no JS initializer for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      result += " = null";
-    } else if (type->is_map()) {
-      result += " = null";
-    } else if (type->is_container()) {
-      result += " = null";
-    } else if (type->is_struct() || type->is_xception()) {
-      if (obj) {
-        result += " = new " + js_type_namespace(type->get_program()) + type->get_name() + "()";
-      } else {
-        result += " = null";
-      }
-    }
-  } else {
-    result += " = null";
-  }
-  return result;
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_js_generator::function_signature(t_function* tfunction,
-                                          string prefix,
-                                          bool include_callback) {
-
-  string str;
-
-  str = prefix + tfunction->get_name() + " = function(";
-
-  str += argument_list(tfunction->get_arglist(), include_callback);
-
-  str += ")";
-  return str;
-}
-
-/**
- * Renders a field list
- */
-string t_js_generator::argument_list(t_struct* tstruct, bool include_callback) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += (*f_iter)->get_name();
-  }
-
-  if (include_callback) {
-    if (!fields.empty()) {
-      result += ", ";
-    }
-    result += "callback";
-  }
-
-  return result;
-}
-
-/**
- * Converts the parse type to a C++ enum string for the given type.
- */
-string t_js_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "Thrift.Type.STRING";
-    case t_base_type::TYPE_BOOL:
-      return "Thrift.Type.BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "Thrift.Type.BYTE";
-    case t_base_type::TYPE_I16:
-      return "Thrift.Type.I16";
-    case t_base_type::TYPE_I32:
-      return "Thrift.Type.I32";
-    case t_base_type::TYPE_I64:
-      return "Thrift.Type.I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "Thrift.Type.DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "Thrift.Type.I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "Thrift.Type.STRUCT";
-  } else if (type->is_map()) {
-    return "Thrift.Type.MAP";
-  } else if (type->is_set()) {
-    return "Thrift.Type.SET";
-  } else if (type->is_list()) {
-    return "Thrift.Type.LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Converts a t_type to a TypeScript type (string).
- * @param t_type Type to convert to TypeScript
- * @return String TypeScript type
- */
-string t_js_generator::ts_get_type(t_type* type) {
-  std::string ts_type;
-
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      ts_type = "string";
-      break;
-    case t_base_type::TYPE_BOOL:
-      ts_type = "boolean";
-      break;
-    case t_base_type::TYPE_BYTE:
-      ts_type = "any";
-      break;
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-    case t_base_type::TYPE_DOUBLE:
-      ts_type = "number";
-      break;
-    case t_base_type::TYPE_VOID:
-      ts_type = "void";
-    }
-  } else if (type->is_enum() || type->is_struct() || type->is_xception()) {
-    std::string type_name;
-    if (type->get_program()) {
-      type_name = js_namespace(type->get_program());
-    }
-    type_name.append(type->get_name());
-    ts_type = type_name;
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-
-    ts_type = ts_get_type(etype) + "[]";
-  } else if (type->is_map()) {
-    string ktype = ts_get_type(((t_map*)type)->get_key_type());
-    string vtype = ts_get_type(((t_map*)type)->get_val_type());
-
-
-    if (ktype == "number" || ktype == "string" ) {
-      ts_type = "{ [k: " + ktype + "]: " + vtype + "; }";
-    } else if ((((t_map*)type)->get_key_type())->is_enum()) {
-      // Not yet supported (enum map): https://github.com/Microsoft/TypeScript/pull/2652
-      //ts_type = "{ [k: " + ktype + "]: " + vtype + "; }";
-      ts_type = "{ [k: number /*" + ktype + "*/]: " + vtype + "; }";
-    } else {
-      ts_type = "any";
-    }
-  }
-
-  return ts_type;
-}
-
-/**
- * Renders a TypeScript function signature of the form 'name(args: types): type;'
- *
- * @param t_function Function definition
- * @param bool in-/exclude the callback argument
- * @return String of rendered function definition
- */
-std::string t_js_generator::ts_function_signature(t_function* tfunction, bool include_callback) {
-  string str;
-  const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  str = tfunction->get_name() + "(";
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    str += (*f_iter)->get_name() + ts_get_req(*f_iter) + ": " + ts_get_type((*f_iter)->get_type());
-
-    if (f_iter + 1 != fields.end() || (include_callback && fields.size() > 0)) {
-      str += ", ";
-    }
-  }
-
-  if (include_callback) {
-    str += "callback: Function): ";
-
-    if (gen_jquery_) {
-      str += "JQueryXHR;";
-    } else {
-      str += "void;";
-    }
-  } else {
-    str += "): " + ts_get_type(tfunction->get_returntype()) + ";";
-  }
-
-  return str;
-}
-
-THRIFT_REGISTER_GENERATOR(js,
-                          "Javascript",
-                          "    jquery:          Generate jQuery compatible code.\n"
-                          "    node:            Generate node.js compatible code.\n"
-                          "    ts:              Generate TypeScript definition files.\n")


[42/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cpp_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cpp_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cpp_generator.cc
deleted file mode 100644
index 4e03d94..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_cpp_generator.cc
+++ /dev/null
@@ -1,4367 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <cassert>
-
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include <sys/stat.h>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::string;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * C++ code generator. This is legitimacy incarnate.
- *
- */
-class t_cpp_generator : public t_oop_generator {
-public:
-  t_cpp_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("pure_enums");
-    gen_pure_enums_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("include_prefix");
-    use_include_prefix_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("cob_style");
-    gen_cob_style_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("no_client_completion");
-    gen_no_client_completion_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("no_default_operators");
-    gen_no_default_operators_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("templates");
-    gen_templates_ = (iter != parsed_options.end());
-
-    gen_templates_only_ = (iter != parsed_options.end() && iter->second == "only");
-
-    iter = parsed_options.find("moveable_types");
-    gen_moveable_ = (iter != parsed_options.end());
-
-    out_dir_base_ = "gen-cpp";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_forward_declaration(t_struct* tstruct);
-  void generate_struct(t_struct* tstruct) { generate_cpp_struct(tstruct, false); }
-  void generate_xception(t_struct* txception) { generate_cpp_struct(txception, true); }
-  void generate_cpp_struct(t_struct* tstruct, bool is_exception);
-
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out, std::string name, t_type* type, t_const_value* value);
-  std::string render_const_value(std::ofstream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-
-  void generate_struct_declaration(std::ofstream& out,
-                                   t_struct* tstruct,
-                                   bool is_exception = false,
-                                   bool pointers = false,
-                                   bool read = true,
-                                   bool write = true,
-                                   bool swap = false,
-                                   bool stream = false);
-  void generate_struct_definition(std::ofstream& out,
-                                  std::ofstream& force_cpp_out,
-                                  t_struct* tstruct,
-                                  bool setters = true);
-  void generate_copy_constructor(std::ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_move_constructor(std::ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_constructor_helper(std::ofstream& out,
-                                   t_struct* tstruct,
-                                   bool is_excpetion,
-                                   bool is_move);
-  void generate_assignment_operator(std::ofstream& out, t_struct* tstruct);
-  void generate_move_assignment_operator(std::ofstream& out, t_struct* tstruct);
-  void generate_assignment_helper(std::ofstream& out, t_struct* tstruct, bool is_move);
-  void generate_struct_reader(std::ofstream& out, t_struct* tstruct, bool pointers = false);
-  void generate_struct_writer(std::ofstream& out, t_struct* tstruct, bool pointers = false);
-  void generate_struct_result_writer(std::ofstream& out, t_struct* tstruct, bool pointers = false);
-  void generate_struct_swap(std::ofstream& out, t_struct* tstruct);
-  void generate_struct_print_method(std::ofstream& out, t_struct* tstruct);
-  void generate_exception_what_method(std::ofstream& out, t_struct* tstruct);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_interface(t_service* tservice, string style);
-  void generate_service_interface_factory(t_service* tservice, string style);
-  void generate_service_null(t_service* tservice, string style);
-  void generate_service_multiface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice, string style);
-  void generate_service_processor(t_service* tservice, string style);
-  void generate_service_skeleton(t_service* tservice);
-  void generate_process_function(t_service* tservice,
-                                 t_function* tfunction,
-                                 string style,
-                                 bool specialized = false);
-  void generate_function_helpers(t_service* tservice, t_function* tfunction);
-  void generate_service_async_skeleton(t_service* tservice);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  std::string suffix = "");
-
-  void generate_deserialize_struct(std::ofstream& out,
-                                   t_struct* tstruct,
-                                   std::string prefix = "",
-                                   bool pointer = false);
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix,
-                                         bool push_back,
-                                         std::string index);
-
-  void generate_serialize_field(std::ofstream& out,
-                                t_field* tfield,
-                                std::string prefix = "",
-                                std::string suffix = "");
-
-  void generate_serialize_struct(std::ofstream& out,
-                                 t_struct* tstruct,
-                                 std::string prefix = "",
-                                 bool pointer = false);
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out, t_map* tmap, std::string iter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_function_call(ostream& out,
-                              t_function* tfunction,
-                              string target,
-                              string iface,
-                              string arg_prefix);
-  /*
-   * Helper rendering functions
-   */
-
-  std::string namespace_prefix(std::string ns);
-  std::string namespace_open(std::string ns);
-  std::string namespace_close(std::string ns);
-  std::string type_name(t_type* ttype, bool in_typedef = false, bool arg = false);
-  std::string base_type_name(t_base_type::t_base tbase);
-  std::string declare_field(t_field* tfield,
-                            bool init = false,
-                            bool pointer = false,
-                            bool constant = false,
-                            bool reference = false);
-  std::string function_signature(t_function* tfunction,
-                                 std::string style,
-                                 std::string prefix = "",
-                                 bool name_params = true);
-  std::string cob_function_signature(t_function* tfunction,
-                                     std::string prefix = "",
-                                     bool name_params = true);
-  std::string argument_list(t_struct* tstruct, bool name_params = true, bool start_comma = false);
-  std::string type_to_enum(t_type* ttype);
-
-  void generate_enum_constant_list(std::ofstream& f,
-                                   const vector<t_enum_value*>& constants,
-                                   const char* prefix,
-                                   const char* suffix,
-                                   bool include_values);
-
-  void generate_struct_ostream_operator(std::ofstream& f, t_struct* tstruct);
-  void generate_struct_print_method_decl(std::ofstream& f, t_struct* tstruct);
-  void generate_exception_what_method_decl(std::ofstream& f,
-                                           t_struct* tstruct,
-                                           bool external = false);
-
-  bool is_reference(t_field* tfield) { return tfield->get_reference(); }
-
-  bool is_complex_type(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception()
-           || (ttype->is_base_type()
-               && (((t_base_type*)ttype)->get_base() == t_base_type::TYPE_STRING));
-  }
-
-  void set_use_include_prefix(bool use_include_prefix) { use_include_prefix_ = use_include_prefix; }
-
-private:
-  /**
-   * Returns the include prefix to use for a file generated by program, or the
-   * empty string if no include prefix should be used.
-   */
-  std::string get_include_prefix(const t_program& program) const;
-
-  /**
-   * True if we should generate pure enums for Thrift enums, instead of wrapper classes.
-   */
-  bool gen_pure_enums_;
-
-  /**
-   * True if we should generate templatized reader/writer methods.
-   */
-  bool gen_templates_;
-
-  /**
-   * True iff we should generate process function pointers for only templatized
-   * reader/writer methods.
-   */
-  bool gen_templates_only_;
-
-  /**
-   * True if we should generate move constructors & assignment operators.
-   */
-  bool gen_moveable_;
-
-  /**
-   * True iff we should use a path prefix in our #include statements for other
-   * thrift-generated header files.
-   */
-  bool use_include_prefix_;
-
-  /**
-   * True if we should generate "Continuation OBject"-style classes as well.
-   */
-  bool gen_cob_style_;
-
-  /**
-   * True if we should omit calls to completion__() in CobClient class.
-   */
-  bool gen_no_client_completion_;
-
-  /**
-   * True if we should omit generating the default opeartors ==, != and <.
-   */
-  bool gen_no_default_operators_;
-
-  /**
-   * Strings for namespace, computed once up front then used directly
-   */
-
-  std::string ns_open_;
-  std::string ns_close_;
-
-  /**
-   * File streams, stored here to avoid passing them as parameters to every
-   * function.
-   */
-
-  std::ofstream f_types_;
-  std::ofstream f_types_impl_;
-  std::ofstream f_types_tcc_;
-  std::ofstream f_header_;
-  std::ofstream f_service_;
-  std::ofstream f_service_tcc_;
-
-  // The ProcessorGenerator is used to generate parts of the code,
-  // so it needs access to many of our protected members and methods.
-  //
-  // TODO: The code really should be cleaned up so that helper methods for
-  // writing to the output files are separate from the generator classes
-  // themselves.
-  friend class ProcessorGenerator;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- */
-void t_cpp_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // Make output file
-  string f_types_name = get_out_dir() + program_name_ + "_types.h";
-  f_types_.open(f_types_name.c_str());
-
-  string f_types_impl_name = get_out_dir() + program_name_ + "_types.cpp";
-  f_types_impl_.open(f_types_impl_name.c_str());
-
-  if (gen_templates_) {
-    // If we don't open the stream, it appears to just discard data,
-    // which is fine.
-    string f_types_tcc_name = get_out_dir() + program_name_ + "_types.tcc";
-    f_types_tcc_.open(f_types_tcc_name.c_str());
-  }
-
-  // Print header
-  f_types_ << autogen_comment();
-  f_types_impl_ << autogen_comment();
-  f_types_tcc_ << autogen_comment();
-
-  // Start ifndef
-  f_types_ << "#ifndef " << program_name_ << "_TYPES_H" << endl << "#define " << program_name_
-           << "_TYPES_H" << endl << endl;
-  f_types_tcc_ << "#ifndef " << program_name_ << "_TYPES_TCC" << endl << "#define " << program_name_
-               << "_TYPES_TCC" << endl << endl;
-
-  // Include base types
-  f_types_ << "#include <iosfwd>" << endl
-           << endl
-           << "#include <thrift/Thrift.h>" << endl
-           << "#include <thrift/TApplicationException.h>" << endl
-           << "#include <thrift/protocol/TProtocol.h>" << endl
-           << "#include <thrift/transport/TTransport.h>" << endl
-           << endl;
-  // Include C++xx compatibility header
-  f_types_ << "#include <thrift/cxxfunctional.h>" << endl;
-
-  // Include other Thrift includes
-  const vector<t_program*>& includes = program_->get_includes();
-  for (size_t i = 0; i < includes.size(); ++i) {
-    f_types_ << "#include \"" << get_include_prefix(*(includes[i])) << includes[i]->get_name()
-             << "_types.h\"" << endl;
-
-    // XXX(simpkins): If gen_templates_ is enabled, we currently assume all
-    // included files were also generated with templates enabled.
-    f_types_tcc_ << "#include \"" << get_include_prefix(*(includes[i])) << includes[i]->get_name()
-                 << "_types.tcc\"" << endl;
-  }
-  f_types_ << endl;
-
-  // Include custom headers
-  const vector<string>& cpp_includes = program_->get_cpp_includes();
-  for (size_t i = 0; i < cpp_includes.size(); ++i) {
-    if (cpp_includes[i][0] == '<') {
-      f_types_ << "#include " << cpp_includes[i] << endl;
-    } else {
-      f_types_ << "#include \"" << cpp_includes[i] << "\"" << endl;
-    }
-  }
-  f_types_ << endl;
-
-  // Include the types file
-  f_types_impl_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-                << "_types.h\"" << endl << endl;
-  f_types_tcc_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-               << "_types.h\"" << endl << endl;
-
-  // The swap() code needs <algorithm> for std::swap()
-  f_types_impl_ << "#include <algorithm>" << endl;
-  // for operator<<
-  f_types_impl_ << "#include <ostream>" << endl << endl;
-  f_types_impl_ << "#include <thrift/TToString.h>" << endl << endl;
-
-  // Open namespace
-  ns_open_ = namespace_open(program_->get_namespace("cpp"));
-  ns_close_ = namespace_close(program_->get_namespace("cpp"));
-
-  f_types_ << ns_open_ << endl << endl;
-
-  f_types_impl_ << ns_open_ << endl << endl;
-
-  f_types_tcc_ << ns_open_ << endl << endl;
-}
-
-/**
- * Closes the output files.
- */
-void t_cpp_generator::close_generator() {
-  // Close namespace
-  f_types_ << ns_close_ << endl << endl;
-  f_types_impl_ << ns_close_ << endl;
-  f_types_tcc_ << ns_close_ << endl << endl;
-
-  // Include the types.tcc file from the types header file,
-  // so clients don't have to explicitly include the tcc file.
-  // TODO(simpkins): Make this a separate option.
-  if (gen_templates_) {
-    f_types_ << "#include \"" << get_include_prefix(*get_program()) << program_name_
-             << "_types.tcc\"" << endl << endl;
-  }
-
-  // Close ifndef
-  f_types_ << "#endif" << endl;
-  f_types_tcc_ << "#endif" << endl;
-
-  // Close output file
-  f_types_.close();
-  f_types_impl_.close();
-  f_types_tcc_.close();
-}
-
-/**
- * Generates a typedef. This is just a simple 1-liner in C++
- *
- * @param ttypedef The type definition
- */
-void t_cpp_generator::generate_typedef(t_typedef* ttypedef) {
-  f_types_ << indent() << "typedef " << type_name(ttypedef->get_type(), true) << " "
-           << ttypedef->get_symbolic() << ";" << endl << endl;
-}
-
-void t_cpp_generator::generate_enum_constant_list(std::ofstream& f,
-                                                  const vector<t_enum_value*>& constants,
-                                                  const char* prefix,
-                                                  const char* suffix,
-                                                  bool include_values) {
-  f << " {" << endl;
-  indent_up();
-
-  vector<t_enum_value*>::const_iterator c_iter;
-  bool first = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f << "," << endl;
-    }
-    indent(f) << prefix << (*c_iter)->get_name() << suffix;
-    if (include_values) {
-      f << " = " << (*c_iter)->get_value();
-    }
-  }
-
-  f << endl;
-  indent_down();
-  indent(f) << "};" << endl;
-}
-
-/**
- * Generates code for an enumerated type. In C++, this is essentially the same
- * as the thrift definition itself, using the enum keyword in C++.
- *
- * @param tenum The enumeration
- */
-void t_cpp_generator::generate_enum(t_enum* tenum) {
-  vector<t_enum_value*> constants = tenum->get_constants();
-
-  std::string enum_name = tenum->get_name();
-  if (!gen_pure_enums_) {
-    enum_name = "type";
-    f_types_ << indent() << "struct " << tenum->get_name() << " {" << endl;
-    indent_up();
-  }
-  f_types_ << indent() << "enum " << enum_name;
-
-  generate_enum_constant_list(f_types_, constants, "", "", true);
-
-  if (!gen_pure_enums_) {
-    indent_down();
-    f_types_ << "};" << endl;
-  }
-
-  f_types_ << endl;
-
-  /**
-     Generate a character array of enum names for debugging purposes.
-  */
-  std::string prefix = "";
-  if (!gen_pure_enums_) {
-    prefix = tenum->get_name() + "::";
-  }
-
-  f_types_impl_ << indent() << "int _k" << tenum->get_name() << "Values[] =";
-  generate_enum_constant_list(f_types_impl_, constants, prefix.c_str(), "", false);
-
-  f_types_impl_ << indent() << "const char* _k" << tenum->get_name() << "Names[] =";
-  generate_enum_constant_list(f_types_impl_, constants, "\"", "\"", false);
-
-  f_types_ << indent() << "extern const std::map<int, const char*> _" << tenum->get_name()
-           << "_VALUES_TO_NAMES;" << endl << endl;
-
-  f_types_impl_ << indent() << "const std::map<int, const char*> _" << tenum->get_name()
-                << "_VALUES_TO_NAMES(::apache::thrift::TEnumIterator(" << constants.size() << ", _k"
-                << tenum->get_name() << "Values"
-                << ", _k" << tenum->get_name() << "Names), "
-                << "::apache::thrift::TEnumIterator(-1, NULL, NULL));" << endl << endl;
-}
-
-/**
- * Generates a class that holds all the constants.
- */
-void t_cpp_generator::generate_consts(std::vector<t_const*> consts) {
-  string f_consts_name = get_out_dir() + program_name_ + "_constants.h";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  string f_consts_impl_name = get_out_dir() + program_name_ + "_constants.cpp";
-  ofstream f_consts_impl;
-  f_consts_impl.open(f_consts_impl_name.c_str());
-
-  // Print header
-  f_consts << autogen_comment();
-  f_consts_impl << autogen_comment();
-
-  // Start ifndef
-  f_consts << "#ifndef " << program_name_ << "_CONSTANTS_H" << endl << "#define " << program_name_
-           << "_CONSTANTS_H" << endl << endl << "#include \"" << get_include_prefix(*get_program())
-           << program_name_ << "_types.h\"" << endl << endl << ns_open_ << endl << endl;
-
-  f_consts_impl << "#include \"" << get_include_prefix(*get_program()) << program_name_
-                << "_constants.h\"" << endl << endl << ns_open_ << endl << endl;
-
-  f_consts << "class " << program_name_ << "Constants {" << endl << " public:" << endl << "  "
-           << program_name_ << "Constants();" << endl << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    t_type* type = (*c_iter)->get_type();
-    f_consts << indent() << type_name(type) << " " << name << ";" << endl;
-  }
-  indent_down();
-  f_consts << "};" << endl;
-
-  f_consts_impl << "const " << program_name_ << "Constants g_" << program_name_ << "_constants;"
-                << endl << endl << program_name_ << "Constants::" << program_name_
-                << "Constants() {" << endl;
-  indent_up();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    print_const_value(f_consts_impl,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value());
-  }
-  indent_down();
-  indent(f_consts_impl) << "}" << endl;
-
-  f_consts << endl << "extern const " << program_name_ << "Constants g_" << program_name_
-           << "_constants;" << endl << endl << ns_close_ << endl << endl << "#endif" << endl;
-  f_consts.close();
-
-  f_consts_impl << endl << ns_close_ << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-void t_cpp_generator::print_const_value(ofstream& out,
-                                        string name,
-                                        t_type* type,
-                                        t_const_value* value) {
-  type = get_true_type(type);
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
-    indent(out) << name << " = " << v2 << ";" << endl << endl;
-  } else if (type->is_enum()) {
-    indent(out) << name << " = (" << type_name(type) << ")" << value->get_integer() << ";" << endl
-                << endl;
-  } else if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    bool is_nonrequired_field = false;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      is_nonrequired_field = false;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-          is_nonrequired_field = (*f_iter)->get_req() != t_field::T_REQUIRED;
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << "." << v_iter->first->get_string() << " = " << val << ";" << endl;
-      if (is_nonrequired_field) {
-        indent(out) << name << ".__isset." << v_iter->first->get_string() << " = true;" << endl;
-      }
-    }
-    out << endl;
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << ".insert(std::make_pair(" << key << ", " << val << "));" << endl;
-    }
-    out << endl;
-  } else if (type->is_list()) {
-    t_type* etype = ((t_list*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << ".push_back(" << val << ");" << endl;
-    }
-    out << endl;
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << ".insert(" << val << ");" << endl;
-    }
-    out << endl;
-  } else {
-    throw "INVALID TYPE IN print_const_value: " + type->get_name();
-  }
-}
-
-/**
- *
- */
-string t_cpp_generator::render_const_value(ofstream& out,
-                                           string name,
-                                           t_type* type,
-                                           t_const_value* value) {
-  (void)name;
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      render << value->get_integer() << "LL";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << "(" << type_name(type) << ")" << value->get_integer();
-  } else {
-    string t = tmp("tmp");
-    indent(out) << type_name(type) << " " << t << ";" << endl;
-    print_const_value(out, t, type, value);
-    render << t;
-  }
-
-  return render.str();
-}
-
-void t_cpp_generator::generate_forward_declaration(t_struct* tstruct) {
-  // Forward declare struct def
-  f_types_ << indent() << "class " << tstruct->get_name() << ";" << endl << endl;
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is a class
- * with data members and a read/write() function, plus a mirroring isset
- * inner class.
- *
- * @param tstruct The struct definition
- */
-void t_cpp_generator::generate_cpp_struct(t_struct* tstruct, bool is_exception) {
-  generate_struct_declaration(f_types_, tstruct, is_exception, false, true, true, true, true);
-  generate_struct_definition(f_types_impl_, f_types_impl_, tstruct);
-
-  std::ofstream& out = (gen_templates_ ? f_types_tcc_ : f_types_impl_);
-  generate_struct_reader(out, tstruct);
-  generate_struct_writer(out, tstruct);
-  generate_struct_swap(f_types_impl_, tstruct);
-  generate_copy_constructor(f_types_impl_, tstruct, is_exception);
-  if (gen_moveable_) {
-    generate_move_constructor(f_types_impl_, tstruct, is_exception);
-  }
-  generate_assignment_operator(f_types_impl_, tstruct);
-  if (gen_moveable_) {
-    generate_move_assignment_operator(f_types_impl_, tstruct);
-  }
-  generate_struct_print_method(f_types_impl_, tstruct);
-  if (is_exception) {
-    generate_exception_what_method(f_types_impl_, tstruct);
-  }
-}
-
-void t_cpp_generator::generate_copy_constructor(ofstream& out,
-                                                t_struct* tstruct,
-                                                bool is_exception) {
-  generate_constructor_helper(out, tstruct, is_exception, /*is_move=*/false);
-}
-
-void t_cpp_generator::generate_move_constructor(ofstream& out,
-                                                t_struct* tstruct,
-                                                bool is_exception) {
-  generate_constructor_helper(out, tstruct, is_exception, /*is_move=*/true);
-}
-
-namespace {
-// Helper to convert a variable to rvalue, if move is enabled
-std::string maybeMove(std::string const& other, bool move) {
-  if (move) {
-    return "std::move(" + other + ")";
-  }
-  return other;
-}
-}
-
-void t_cpp_generator::generate_constructor_helper(ofstream& out,
-                                                  t_struct* tstruct,
-                                                  bool is_exception,
-                                                  bool is_move) {
-
-  std::string tmp_name = tmp("other");
-
-  indent(out) << tstruct->get_name() << "::" << tstruct->get_name();
-
-  if (is_move) {
-    out << "( " << tstruct->get_name() << "&& ";
-  } else {
-    out << "(const " << tstruct->get_name() << "& ";
-  }
-  out << tmp_name << ") ";
-  if (is_exception)
-    out << ": TException() ";
-  out << "{" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-
-  // eliminate compiler unused warning
-  if (members.empty())
-    indent(out) << "(void) " << tmp_name << ";" << endl;
-
-  vector<t_field*>::const_iterator f_iter;
-  bool has_nonrequired_fields = false;
-  for (f_iter = members.begin(); f_iter != members.end(); ++f_iter) {
-    if ((*f_iter)->get_req() != t_field::T_REQUIRED)
-      has_nonrequired_fields = true;
-    indent(out) << (*f_iter)->get_name() << " = "
-                << maybeMove(tmp_name + "." + (*f_iter)->get_name(), is_move) << ";" << endl;
-  }
-
-  if (has_nonrequired_fields) {
-    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", is_move) << ";" << endl;
-  }
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_cpp_generator::generate_assignment_operator(ofstream& out, t_struct* tstruct) {
-  generate_assignment_helper(out, tstruct, /*is_move=*/false);
-}
-
-void t_cpp_generator::generate_move_assignment_operator(ofstream& out, t_struct* tstruct) {
-  generate_assignment_helper(out, tstruct, /*is_move=*/true);
-}
-
-void t_cpp_generator::generate_assignment_helper(ofstream& out, t_struct* tstruct, bool is_move) {
-  std::string tmp_name = tmp("other");
-
-  indent(out) << tstruct->get_name() << "& " << tstruct->get_name() << "::operator=(";
-
-  if (is_move) {
-    out << tstruct->get_name() << "&& ";
-  } else {
-    out << "const " << tstruct->get_name() << "& ";
-  }
-  out << tmp_name << ") {" << endl;
-
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-
-  // eliminate compiler unused warning
-  if (members.empty())
-    indent(out) << "(void) " << tmp_name << ";" << endl;
-
-  vector<t_field*>::const_iterator f_iter;
-  bool has_nonrequired_fields = false;
-  for (f_iter = members.begin(); f_iter != members.end(); ++f_iter) {
-    if ((*f_iter)->get_req() != t_field::T_REQUIRED)
-      has_nonrequired_fields = true;
-    indent(out) << (*f_iter)->get_name() << " = "
-                << maybeMove(tmp_name + "." + (*f_iter)->get_name(), is_move) << ";" << endl;
-  }
-  if (has_nonrequired_fields) {
-    indent(out) << "__isset = " << maybeMove(tmp_name + ".__isset", is_move) << ";" << endl;
-  }
-
-  indent(out) << "return *this;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-/**
- * Writes the struct declaration into the header file
- *
- * @param out Output stream
- * @param tstruct The struct
- */
-void t_cpp_generator::generate_struct_declaration(ofstream& out,
-                                                  t_struct* tstruct,
-                                                  bool is_exception,
-                                                  bool pointers,
-                                                  bool read,
-                                                  bool write,
-                                                  bool swap,
-                                                  bool stream) {
-  string extends = "";
-  if (is_exception) {
-    extends = " : public ::apache::thrift::TException";
-  }
-
-  // Get members
-  vector<t_field*>::const_iterator m_iter;
-  const vector<t_field*>& members = tstruct->get_members();
-
-  // Write the isset structure declaration outside the class. This makes
-  // the generated code amenable to processing by SWIG.
-  // We only declare the struct if it gets used in the class.
-
-  // Isset struct has boolean fields, but only for non-required fields.
-  bool has_nonrequired_fields = false;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if ((*m_iter)->get_req() != t_field::T_REQUIRED)
-      has_nonrequired_fields = true;
-  }
-
-  if (has_nonrequired_fields && (!pointers || read)) {
-
-    out << indent() << "typedef struct _" << tstruct->get_name() << "__isset {" << endl;
-    indent_up();
-
-    indent(out) << "_" << tstruct->get_name() << "__isset() ";
-    bool first = true;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() == t_field::T_REQUIRED) {
-        continue;
-      }
-      string isSet = ((*m_iter)->get_value() != NULL) ? "true" : "false";
-      if (first) {
-        first = false;
-        out << ": " << (*m_iter)->get_name() << "(" << isSet << ")";
-      } else {
-        out << ", " << (*m_iter)->get_name() << "(" << isSet << ")";
-      }
-    }
-    out << " {}" << endl;
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        indent(out) << "bool " << (*m_iter)->get_name() << " :1;" << endl;
-      }
-    }
-
-    indent_down();
-    indent(out) << "} _" << tstruct->get_name() << "__isset;" << endl;
-  }
-
-  out << endl;
-
-  // Open struct def
-  out << indent() << "class " << tstruct->get_name() << extends << " {" << endl << indent()
-      << " public:" << endl << endl;
-  indent_up();
-
-  if (!pointers) {
-    // Copy constructor
-    indent(out) << tstruct->get_name() << "(const " << tstruct->get_name() << "&);" << endl;
-
-    // Move constructor
-    if (gen_moveable_) {
-      indent(out) << tstruct->get_name() << "(" << tstruct->get_name() << "&&);" << endl;
-    }
-
-    // Assignment Operator
-    indent(out) << tstruct->get_name() << "& operator=(const " << tstruct->get_name() << "&);"
-                << endl;
-
-    // Move assignment operator
-    if (gen_moveable_) {
-      indent(out) << tstruct->get_name() << "& operator=(" << tstruct->get_name() << "&&);" << endl;
-    }
-
-    // Default constructor
-    indent(out) << tstruct->get_name() << "()";
-
-    bool init_ctor = false;
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-      if (t->is_base_type() || t->is_enum() || is_reference(*m_iter)) {
-        string dval;
-        if (t->is_enum()) {
-          dval += "(" + type_name(t) + ")";
-        }
-        dval += (t->is_string() || is_reference(*m_iter)) ? "" : "0";
-        t_const_value* cv = (*m_iter)->get_value();
-        if (cv != NULL) {
-          dval = render_const_value(out, (*m_iter)->get_name(), t, cv);
-        }
-        if (!init_ctor) {
-          init_ctor = true;
-          out << " : ";
-          out << (*m_iter)->get_name() << "(" << dval << ")";
-        } else {
-          out << ", " << (*m_iter)->get_name() << "(" << dval << ")";
-        }
-      }
-    }
-    out << " {" << endl;
-    indent_up();
-    // TODO(dreiss): When everything else in Thrift is perfect,
-    // do more of these in the initializer list.
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = get_true_type((*m_iter)->get_type());
-
-      if (!t->is_base_type()) {
-        t_const_value* cv = (*m_iter)->get_value();
-        if (cv != NULL) {
-          print_const_value(out, (*m_iter)->get_name(), t, cv);
-        }
-      }
-    }
-    scope_down(out);
-  }
-
-  if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) {
-    out << endl << indent() << "virtual ~" << tstruct->get_name() << "() throw();" << endl;
-  }
-
-  // Declare all fields
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << declare_field(*m_iter,
-                                 false,
-                                 (pointers && !(*m_iter)->get_type()->is_xception()),
-                                 !read) << endl;
-  }
-
-  // Add the __isset data member if we need it, using the definition from above
-  if (has_nonrequired_fields && (!pointers || read)) {
-    out << endl << indent() << "_" << tstruct->get_name() << "__isset __isset;" << endl;
-  }
-
-  // Create a setter function for each field
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (pointers) {
-      continue;
-    }
-    if (is_reference((*m_iter))) {
-      out << endl << indent() << "void __set_" << (*m_iter)->get_name() << "(boost::shared_ptr<"
-          << type_name((*m_iter)->get_type(), false, false) << ">";
-      out << " val);" << endl;
-    } else {
-      out << endl << indent() << "void __set_" << (*m_iter)->get_name() << "("
-          << type_name((*m_iter)->get_type(), false, true);
-      out << " val);" << endl;
-    }
-  }
-  out << endl;
-
-  if (!pointers) {
-    // Should we generate default operators?
-    if (!gen_no_default_operators_) {
-      // Generate an equality testing operator.  Make it inline since the compiler
-      // will do a better job than we would when deciding whether to inline it.
-      out << indent() << "bool operator == (const " << tstruct->get_name() << " & "
-          << (members.size() > 0 ? "rhs" : "/* rhs */") << ") const" << endl;
-      scope_up(out);
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        // Most existing Thrift code does not use isset or optional/required,
-        // so we treat "default" fields as required.
-        if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-          out << indent() << "if (!(" << (*m_iter)->get_name() << " == rhs."
-              << (*m_iter)->get_name() << "))" << endl << indent() << "  return false;" << endl;
-        } else {
-          out << indent() << "if (__isset." << (*m_iter)->get_name() << " != rhs.__isset."
-              << (*m_iter)->get_name() << ")" << endl << indent() << "  return false;" << endl
-              << indent() << "else if (__isset." << (*m_iter)->get_name() << " && !("
-              << (*m_iter)->get_name() << " == rhs." << (*m_iter)->get_name() << "))" << endl
-              << indent() << "  return false;" << endl;
-        }
-      }
-      indent(out) << "return true;" << endl;
-      scope_down(out);
-      out << indent() << "bool operator != (const " << tstruct->get_name() << " &rhs) const {"
-          << endl << indent() << "  return !(*this == rhs);" << endl << indent() << "}" << endl
-          << endl;
-
-      // Generate the declaration of a less-than operator.  This must be
-      // implemented by the application developer if they wish to use it.  (They
-      // will get a link error if they try to use it without an implementation.)
-      out << indent() << "bool operator < (const " << tstruct->get_name() << " & ) const;" << endl
-          << endl;
-    }
-  }
-
-  if (read) {
-    if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl << indent()
-          << "uint32_t read(Protocol_* iprot);" << endl;
-    } else {
-      out << indent() << "uint32_t read("
-          << "::apache::thrift::protocol::TProtocol* iprot);" << endl;
-    }
-  }
-  if (write) {
-    if (gen_templates_) {
-      out << indent() << "template <class Protocol_>" << endl << indent()
-          << "uint32_t write(Protocol_* oprot) const;" << endl;
-    } else {
-      out << indent() << "uint32_t write("
-          << "::apache::thrift::protocol::TProtocol* oprot) const;" << endl;
-    }
-  }
-  out << endl;
-
-  if (stream) {
-    out << indent() << "virtual ";
-    generate_struct_print_method_decl(out, NULL);
-    out << ";" << endl;
-  }
-
-  // std::exception::what()
-  if (is_exception) {
-    out << indent() << "mutable std::string thriftTExceptionMessageHolder_;" << endl;
-    out << indent();
-    generate_exception_what_method_decl(out, tstruct, false);
-    out << ";" << endl;
-  }
-
-  indent_down();
-  indent(out) << "};" << endl << endl;
-
-  if (swap) {
-    // Generate a namespace-scope swap() function
-    out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
-        << " &b);" << endl << endl;
-  }
-
-  if (stream) {
-    generate_struct_ostream_operator(out, tstruct);
-  }
-}
-
-void t_cpp_generator::generate_struct_definition(ofstream& out,
-                                                 ofstream& force_cpp_out,
-                                                 t_struct* tstruct,
-                                                 bool setters) {
-  // Get members
-  vector<t_field*>::const_iterator m_iter;
-  const vector<t_field*>& members = tstruct->get_members();
-
-  // Destructor
-  if (tstruct->annotations_.find("final") == tstruct->annotations_.end()) {
-    force_cpp_out << endl << indent() << tstruct->get_name() << "::~" << tstruct->get_name()
-                  << "() throw() {" << endl;
-    indent_up();
-
-    indent_down();
-    force_cpp_out << indent() << "}" << endl << endl;
-  }
-
-  // Create a setter function for each field
-  if (setters) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (is_reference((*m_iter))) {
-        std::string type = type_name((*m_iter)->get_type());
-        out << endl << indent() << "void " << tstruct->get_name() << "::__set_"
-            << (*m_iter)->get_name() << "(boost::shared_ptr<"
-            << type_name((*m_iter)->get_type(), false, false) << ">";
-        out << " val) {" << endl;
-      } else {
-        out << endl << indent() << "void " << tstruct->get_name() << "::__set_"
-            << (*m_iter)->get_name() << "(" << type_name((*m_iter)->get_type(), false, true);
-        out << " val) {" << endl;
-      }
-      indent_up();
-      out << indent() << "this->" << (*m_iter)->get_name() << " = val;" << endl;
-      indent_down();
-
-      // assume all fields are required except optional fields.
-      // for optional fields change __isset.name to true
-      bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
-      if (is_optional) {
-        out << indent() << indent() << "__isset." << (*m_iter)->get_name() << " = true;" << endl;
-      }
-      out << indent() << "}" << endl;
-    }
-  }
-  out << endl;
-}
-
-/**
- * Makes a helper function to gen a struct reader.
- *
- * @param out Stream to write to
- * @param tstruct The struct
- */
-void t_cpp_generator::generate_struct_reader(ofstream& out, t_struct* tstruct, bool pointers) {
-  if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::read(Protocol_* iprot) {" << endl;
-  } else {
-    indent(out) << "uint32_t " << tstruct->get_name()
-                << "::read(::apache::thrift::protocol::TProtocol* iprot) {" << endl;
-  }
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Declare stack tmp variables
-  out << endl
-      << indent() << "apache::thrift::protocol::TInputRecursionTracker tracker(*iprot);" << endl
-      << indent() << "uint32_t xfer = 0;" << endl
-      << indent() << "std::string fname;" << endl
-      << indent() << "::apache::thrift::protocol::TType ftype;" << endl
-      << indent() << "int16_t fid;" << endl
-      << endl
-      << indent() << "xfer += iprot->readStructBegin(fname);" << endl
-      << endl
-      << indent() << "using ::apache::thrift::protocol::TProtocolException;" << endl
-      << endl;
-
-  // Required variables aren't in __isset, so we need tmp vars to check them.
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED)
-      indent(out) << "bool isset_" << (*f_iter)->get_name() << " = false;" << endl;
-  }
-  out << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  // Read beginning field marker
-  indent(out) << "xfer += iprot->readFieldBegin(fname, ftype, fid);" << endl;
-
-  // Check for field STOP marker
-  out << indent() << "if (ftype == ::apache::thrift::protocol::T_STOP) {" << endl << indent()
-      << "  break;" << endl << indent() << "}" << endl;
-
-  if (fields.empty()) {
-    out << indent() << "xfer += iprot->skip(ftype);" << endl;
-  } else {
-    // Switch statement on the field we are reading
-    indent(out) << "switch (fid)" << endl;
-
-    scope_up(out);
-
-    // Generate deserialization code for known cases
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      indent(out) << "case " << (*f_iter)->get_key() << ":" << endl;
-      indent_up();
-      indent(out) << "if (ftype == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-      indent_up();
-
-      const char* isset_prefix = ((*f_iter)->get_req() != t_field::T_REQUIRED) ? "this->__isset."
-                                                                               : "isset_";
-
-#if 0
-          // This code throws an exception if the same field is encountered twice.
-          // We've decided to leave it out for performance reasons.
-          // TODO(dreiss): Generate this code and "if" it out to make it easier
-          // for people recompiling thrift to include it.
-          out <<
-            indent() << "if (" << isset_prefix << (*f_iter)->get_name() << ")" << endl <<
-            indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl;
-#endif
-
-      if (pointers && !(*f_iter)->get_type()->is_xception()) {
-        generate_deserialize_field(out, *f_iter, "(*(this->", "))");
-      } else {
-        generate_deserialize_field(out, *f_iter, "this->");
-      }
-      out << indent() << isset_prefix << (*f_iter)->get_name() << " = true;" << endl;
-      indent_down();
-      out << indent() << "} else {" << endl << indent() << "  xfer += iprot->skip(ftype);" << endl
-          <<
-          // TODO(dreiss): Make this an option when thrift structs
-          // have a common base class.
-          // indent() << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl <<
-          indent() << "}" << endl << indent() << "break;" << endl;
-      indent_down();
-    }
-
-    // In the default case we skip the field
-    out << indent() << "default:" << endl << indent() << "  xfer += iprot->skip(ftype);" << endl
-        << indent() << "  break;" << endl;
-
-    scope_down(out);
-  } //!fields.empty()
-  // Read field end marker
-  indent(out) << "xfer += iprot->readFieldEnd();" << endl;
-
-  scope_down(out);
-
-  out << endl << indent() << "xfer += iprot->readStructEnd();" << endl;
-
-  // Throw if any required fields are missing.
-  // We do this after reading the struct end so that
-  // there might possibly be a chance of continuing.
-  out << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED)
-      out << indent() << "if (!isset_" << (*f_iter)->get_name() << ')' << endl << indent()
-          << "  throw TProtocolException(TProtocolException::INVALID_DATA);" << endl;
-  }
-
-  indent(out) << "return xfer;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates the write function.
- *
- * @param out Stream to write to
- * @param tstruct The struct
- */
-void t_cpp_generator::generate_struct_writer(ofstream& out, t_struct* tstruct, bool pointers) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << endl;
-  } else {
-    indent(out) << "uint32_t " << tstruct->get_name()
-                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << endl;
-  }
-  indent_up();
-
-  out << indent() << "uint32_t xfer = 0;" << endl;
-
-  indent(out) << "apache::thrift::protocol::TOutputRecursionTracker tracker(*oprot);" << endl;
-  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool check_if_set = (*f_iter)->get_req() == t_field::T_OPTIONAL
-                        || (*f_iter)->get_type()->is_xception();
-    if (check_if_set) {
-      out << endl << indent() << "if (this->__isset." << (*f_iter)->get_name() << ") {" << endl;
-      indent_up();
-    } else {
-      out << endl;
-    }
-
-    // Write field header
-    out << indent() << "xfer += oprot->writeFieldBegin("
-        << "\"" << (*f_iter)->get_name() << "\", " << type_to_enum((*f_iter)->get_type()) << ", "
-        << (*f_iter)->get_key() << ");" << endl;
-    // Write field contents
-    if (pointers && !(*f_iter)->get_type()->is_xception()) {
-      generate_serialize_field(out, *f_iter, "(*(this->", "))");
-    } else {
-      generate_serialize_field(out, *f_iter, "this->");
-    }
-    // Write field closer
-    indent(out) << "xfer += oprot->writeFieldEnd();" << endl;
-    if (check_if_set) {
-      indent_down();
-      indent(out) << '}';
-    }
-  }
-
-  out << endl;
-
-  // Write the struct map
-  out << indent() << "xfer += oprot->writeFieldStop();" << endl << indent()
-      << "xfer += oprot->writeStructEnd();" << endl << indent()
-      << "return xfer;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Struct writer for result of a function, which can have only one of its
- * fields set and does a conditional if else look up into the __isset field
- * of the struct.
- *
- * @param out Output stream
- * @param tstruct The result struct
- */
-void t_cpp_generator::generate_struct_result_writer(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    bool pointers) {
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  if (gen_templates_) {
-    out << indent() << "template <class Protocol_>" << endl << indent() << "uint32_t "
-        << tstruct->get_name() << "::write(Protocol_* oprot) const {" << endl;
-  } else {
-    indent(out) << "uint32_t " << tstruct->get_name()
-                << "::write(::apache::thrift::protocol::TProtocol* oprot) const {" << endl;
-  }
-  indent_up();
-
-  out << endl << indent() << "uint32_t xfer = 0;" << endl << endl;
-
-  indent(out) << "xfer += oprot->writeStructBegin(\"" << name << "\");" << endl;
-
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << endl << indent() << "if ";
-    } else {
-      out << " else if ";
-    }
-
-    out << "(this->__isset." << (*f_iter)->get_name() << ") {" << endl;
-
-    indent_up();
-
-    // Write field header
-    out << indent() << "xfer += oprot->writeFieldBegin("
-        << "\"" << (*f_iter)->get_name() << "\", " << type_to_enum((*f_iter)->get_type()) << ", "
-        << (*f_iter)->get_key() << ");" << endl;
-    // Write field contents
-    if (pointers) {
-      generate_serialize_field(out, *f_iter, "(*(this->", "))");
-    } else {
-      generate_serialize_field(out, *f_iter, "this->");
-    }
-    // Write field closer
-    indent(out) << "xfer += oprot->writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}";
-  }
-
-  // Write the struct map
-  out << endl << indent() << "xfer += oprot->writeFieldStop();" << endl << indent()
-      << "xfer += oprot->writeStructEnd();" << endl << indent() << "return xfer;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates the swap function.
- *
- * @param out Stream to write to
- * @param tstruct The struct
- */
-void t_cpp_generator::generate_struct_swap(ofstream& out, t_struct* tstruct) {
-  out << indent() << "void swap(" << tstruct->get_name() << " &a, " << tstruct->get_name()
-      << " &b) {" << endl;
-  indent_up();
-
-  // Let argument-dependent name lookup find the correct swap() function to
-  // use based on the argument types.  If none is found in the arguments'
-  // namespaces, fall back to ::std::swap().
-  out << indent() << "using ::std::swap;" << endl;
-
-  bool has_nonrequired_fields = false;
-  const vector<t_field*>& fields = tstruct->get_members();
-  for (vector<t_field*>::const_iterator f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* tfield = *f_iter;
-
-    if (tfield->get_req() != t_field::T_REQUIRED) {
-      has_nonrequired_fields = true;
-    }
-
-    out << indent() << "swap(a." << tfield->get_name() << ", b." << tfield->get_name() << ");"
-        << endl;
-  }
-
-  if (has_nonrequired_fields) {
-    out << indent() << "swap(a.__isset, b.__isset);" << endl;
-  }
-
-  // handle empty structs
-  if (fields.size() == 0) {
-    out << indent() << "(void) a;" << endl;
-    out << indent() << "(void) b;" << endl;
-  }
-
-  scope_down(out);
-  out << endl;
-}
-
-void t_cpp_generator::generate_struct_ostream_operator(std::ofstream& out, t_struct* tstruct) {
-  out << "inline std::ostream& operator<<(std::ostream& out, const "
-      << tstruct->get_name()
-      << "& obj)" << endl;
-  scope_up(out);
-  out << indent() << "obj.printTo(out);" << endl
-      << indent() << "return out;" << endl;
-  scope_down(out);
-  out << endl;
-}
-
-void t_cpp_generator::generate_struct_print_method_decl(std::ofstream& out, t_struct* tstruct) {
-  out << "void ";
-  if (tstruct) {
-    out << tstruct->get_name() << "::";
-  }
-  out << "printTo(std::ostream& out) const";
-}
-
-void t_cpp_generator::generate_exception_what_method_decl(std::ofstream& out,
-                                                          t_struct* tstruct,
-                                                          bool external) {
-  out << "const char* ";
-  if (external) {
-    out << tstruct->get_name() << "::";
-  }
-  out << "what() const throw()";
-}
-
-namespace struct_ostream_operator_generator {
-void generate_required_field_value(std::ofstream& out, const t_field* field) {
-  out << " << to_string(" << field->get_name() << ")";
-}
-
-void generate_optional_field_value(std::ofstream& out, const t_field* field) {
-  out << "; (__isset." << field->get_name() << " ? (out";
-  generate_required_field_value(out, field);
-  out << ") : (out << \"<null>\"))";
-}
-
-void generate_field_value(std::ofstream& out, const t_field* field) {
-  if (field->get_req() == t_field::T_OPTIONAL)
-    generate_optional_field_value(out, field);
-  else
-    generate_required_field_value(out, field);
-}
-
-void generate_field_name(std::ofstream& out, const t_field* field) {
-  out << "\"" << field->get_name() << "=\"";
-}
-
-void generate_field(std::ofstream& out, const t_field* field) {
-  generate_field_name(out, field);
-  generate_field_value(out, field);
-}
-
-void generate_fields(std::ofstream& out,
-                     const vector<t_field*>& fields,
-                     const std::string& indent) {
-  const vector<t_field*>::const_iterator beg = fields.begin();
-  const vector<t_field*>::const_iterator end = fields.end();
-
-  for (vector<t_field*>::const_iterator it = beg; it != end; ++it) {
-    out << indent << "out << ";
-
-    if (it != beg) {
-      out << "\", \" << ";
-    }
-
-    generate_field(out, *it);
-    out << ";" << endl;
-  }
-}
-}
-
-/**
- * Generates operator<<
- */
-void t_cpp_generator::generate_struct_print_method(std::ofstream& out, t_struct* tstruct) {
-  out << indent();
-  generate_struct_print_method_decl(out, tstruct);
-  out << " {" << endl;
-
-  indent_up();
-
-  out << indent() << "using ::apache::thrift::to_string;" << endl;
-  out << indent() << "out << \"" << tstruct->get_name() << "(\";" << endl;
-  struct_ostream_operator_generator::generate_fields(out, tstruct->get_members(), indent());
-  out << indent() << "out << \")\";" << endl;
-
-  indent_down();
-  out << "}" << endl << endl;
-}
-
-/**
- * Generates what() method for exceptions
- */
-void t_cpp_generator::generate_exception_what_method(std::ofstream& out, t_struct* tstruct) {
-  out << indent();
-  generate_exception_what_method_decl(out, tstruct, true);
-  out << " {" << endl;
-
-  indent_up();
-  out << indent() << "try {" << endl;
-
-  indent_up();
-  out << indent() << "std::stringstream ss;" << endl;
-  out << indent() << "ss << \"TException - service has thrown: \" << *this;" << endl;
-  out << indent() << "this->thriftTExceptionMessageHolder_ = ss.str();" << endl;
-  out << indent() << "return this->thriftTExceptionMessageHolder_.c_str();" << endl;
-  indent_down();
-
-  out << indent() << "} catch (const std::exception&) {" << endl;
-
-  indent_up();
-  out << indent() << "return \"TException - service has thrown: " << tstruct->get_name() << "\";"
-      << endl;
-  indent_down();
-
-  out << indent() << "}" << endl;
-
-  indent_down();
-  out << "}" << endl << endl;
-}
-
-/**
- * Generates a thrift service. In C++, this comprises an entirely separate
- * header and source file. The header file defines the methods and includes
- * the data types defined in the main header file, and the implementation
- * file contains implementations of the basic printer and default interfaces.
- *
- * @param tservice The service definition
- */
-void t_cpp_generator::generate_service(t_service* tservice) {
-  string svcname = tservice->get_name();
-
-  // Make output files
-  string f_header_name = get_out_dir() + svcname + ".h";
-  f_header_.open(f_header_name.c_str());
-
-  // Print header file includes
-  f_header_ << autogen_comment();
-  f_header_ << "#ifndef " << svcname << "_H" << endl << "#define " << svcname << "_H" << endl
-            << endl;
-  if (gen_cob_style_) {
-    f_header_ << "#include <thrift/transport/TBufferTransports.h>" << endl << // TMemoryBuffer
-        "#include <thrift/cxxfunctional.h>" << endl
-              << "namespace apache { namespace thrift { namespace async {" << endl
-              << "class TAsyncChannel;" << endl << "}}}" << endl;
-  }
-  f_header_ << "#include <thrift/TDispatchProcessor.h>" << endl;
-  if (gen_cob_style_) {
-    f_header_ << "#include <thrift/async/TAsyncDispatchProcessor.h>" << endl;
-  }
-  f_header_ << "#include <thrift/async/TConcurrentClientSyncInfo.h>" << endl;
-  f_header_ << "#include \"" << get_include_prefix(*get_program()) << program_name_ << "_types.h\""
-            << endl;
-
-  t_service* extends_service = tservice->get_extends();
-  if (extends_service != NULL) {
-    f_header_ << "#include \"" << get_include_prefix(*(extends_service->get_program()))
-              << extends_service->get_name() << ".h\"" << endl;
-  }
-
-  f_header_ << endl << ns_open_ << endl << endl;
-
-  f_header_ <<
-    "#ifdef _WIN32\n"
-    "  #pragma warning( push )\n"
-    "  #pragma warning (disable : 4250 ) //inheriting methods via dominance \n"
-    "#endif\n\n";
-
-  // Service implementation file includes
-  string f_service_name = get_out_dir() + svcname + ".cpp";
-  f_service_.open(f_service_name.c_str());
-  f_service_ << autogen_comment();
-  f_service_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl;
-  if (gen_cob_style_) {
-    f_service_ << "#include \"thrift/async/TAsyncChannel.h\"" << endl;
-  }
-  if (gen_templates_) {
-    f_service_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".tcc\""
-               << endl;
-
-    string f_service_tcc_name = get_out_dir() + svcname + ".tcc";
-    f_service_tcc_.open(f_service_tcc_name.c_str());
-    f_service_tcc_ << autogen_comment();
-    f_service_tcc_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\""
-                   << endl;
-
-    f_service_tcc_ << "#ifndef " << svcname << "_TCC" << endl << "#define " << svcname << "_TCC"
-                   << endl << endl;
-
-    if (gen_cob_style_) {
-      f_service_tcc_ << "#include \"thrift/async/TAsyncChannel.h\"" << endl;
-    }
-  }
-
-  f_service_ << endl << ns_open_ << endl << endl;
-  f_service_tcc_ << endl << ns_open_ << endl << endl;
-
-  // Generate all the components
-  generate_service_interface(tservice, "");
-  generate_service_interface_factory(tservice, "");
-  generate_service_null(tservice, "");
-  generate_service_helpers(tservice);
-  generate_service_client(tservice, "");
-  generate_service_processor(tservice, "");
-  generate_service_multiface(tservice);
-  generate_service_skeleton(tservice);
-  generate_service_client(tservice, "Concurrent");
-
-  // Generate all the cob components
-  if (gen_cob_style_) {
-    generate_service_interface(tservice, "CobCl");
-    generate_service_interface(tservice, "CobSv");
-    generate_service_interface_factory(tservice, "CobSv");
-    generate_service_null(tservice, "CobSv");
-    generate_service_client(tservice, "Cob");
-    generate_service_processor(tservice, "Cob");
-    generate_service_async_skeleton(tservice);
-  }
-
-  f_header_ <<
-    "#ifdef _WIN32\n"
-    "  #pragma warning( pop )\n"
-    "#endif\n\n";
-
-  // Close the namespace
-  f_service_ << ns_close_ << endl << endl;
-  f_service_tcc_ << ns_close_ << endl << endl;
-  f_header_ << ns_close_ << endl << endl;
-
-  // TODO(simpkins): Make this a separate option
-  if (gen_templates_) {
-    f_header_ << "#include \"" << get_include_prefix(*get_program()) << svcname << ".tcc\"" << endl
-              << "#include \"" << get_include_prefix(*get_program()) << program_name_
-              << "_types.tcc\"" << endl << endl;
-  }
-
-  f_header_ << "#endif" << endl;
-  f_service_tcc_ << "#endif" << endl;
-
-  // Close the files
-  f_service_tcc_.close();
-  f_service_.close();
-  f_header_.close();
-}
-
-/**
- * Generates helper functions for a service. Basically, this generates types
- * for all the arguments and results to functions.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_cpp_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  std::ofstream& out = (gen_templates_ ? f_service_tcc_ : f_service_);
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    string name_orig = ts->get_name();
-
-    // TODO(dreiss): Why is this stuff not in generate_function_helpers?
-    ts->set_name(tservice->get_name() + "_" + (*f_iter)->get_name() + "_args");
-    generate_struct_declaration(f_header_, ts, false);
-    generate_struct_definition(out, f_service_, ts, false);
-    generate_struct_reader(out, ts);
-    generate_struct_writer(out, ts);
-    ts->set_name(tservice->get_name() + "_" + (*f_iter)->get_name() + "_pargs");
-    generate_struct_declaration(f_header_, ts, false, true, false, true);
-    generate_struct_definition(out, f_service_, ts, false);
-    generate_struct_writer(out, ts, true);
-    ts->set_name(name_orig);
-
-    generate_function_helpers(tservice, *f_iter);
-  }
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_cpp_generator::generate_service_interface(t_service* tservice, string style) {
-
-  string service_if_name = service_name_ + style + "If";
-  if (style == "CobCl") {
-    // Forward declare the client.
-    string client_name = service_name_ + "CobClient";
-    if (gen_templates_) {
-      client_name += "T";
-      service_if_name += "T";
-      indent(f_header_) << "template <class Protocol_>" << endl;
-    }
-    indent(f_header_) << "class " << client_name << ";" << endl << endl;
-  }
-
-  string extends = "";
-  if (tservice->get_extends() != NULL) {
-    extends = " : virtual public " + type_name(tservice->get_extends()) + style + "If";
-    if (style == "CobCl" && gen_templates_) {
-      // TODO(simpkins): If gen_templates_ is enabled, we currently assume all
-      // parent services were also generated with templates enabled.
-      extends += "T<Protocol_>";
-    }
-  }
-
-  if (style == "CobCl" && gen_templates_) {
-    f_header_ << "template <class Protocol_>" << endl;
-  }
-  f_header_ << "class " << service_if_name << extends << " {" << endl << " public:" << endl;
-  indent_up();
-  f_header_ << indent() << "virtual ~" << service_if_name << "() {}" << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    if ((*f_iter)->has_doc())
-      f_header_ << endl;
-    generate_java_doc(f_header_, *f_iter);
-    f_header_ << indent() << "virtual " << function_signature(*f_iter, style) << " = 0;" << endl;
-  }
-  indent_down();
-  f_header_ << "};" << endl << endl;
-
-  if (style == "CobCl" && gen_templates_) {
-    // generate a backwards-compatible typedef for clients that do not
-    // know about the new template-style code
-    f_header_ << "typedef " << service_if_name << "< ::apache::thrift::protocol::TProtocol> "
-              << service_name_ << style << "If;" << endl << endl;
-  }
-}
-
-/**
- * Generates a service interface factory.
- *
- * @param tservice The service to generate an interface factory for.
- */
-void t_cpp_generator::generate_service_interface_factory(t_service* tservice, string style) {
-  string service_if_name = service_name_ + style + "If";
-
-  // Figure out the name of the upper-most parent class.
-  // Getting everything to work out properly with inheritance is annoying.
-  // Here's what we're doing for now:
-  //
-  // - All handlers implement getHandler(), but subclasses use covariant return
-  //   types to return their specific service interface class type.  We have to
-  //   use raw pointers because of this; shared_ptr<> can't be used for
-  //   covariant return types.
-  //
-  // - Since we're not using shared_ptr<>, we also provide a releaseHandler()
-  //   function that must be called to release a pointer to a handler obtained
-  //   via getHandler().
-  //
-  //   releaseHandler() always accepts a pointer to the upper-most parent class
-  //   type.  This is necessary since the parent versions of releaseHandler()
-  //   may accept any of the parent types, not just the most specific subclass
-  //   type.  Implementations can use dynamic_cast to cast the pointer to the
-  //   subclass type if desired.
-  t_service* base_service = tservice;
-  while (base_service->get_extends() != NULL) {
-    base_service = base_service->get_extends();
-  }
-  string base_if_name = type_name(base_service) + style + "If";
-
-  // Generate the abstract factory class
-  string factory_name = service_if_name + "Factory";
-  string extends;
-  if (tservice->get_extends() != NULL) {
-    extends = " : virtual public " + type_name(tservice->get_extends()) + style + "IfFactory";
-  }
-
-  f_header_ << "class " << factory_name << extends << " {" << endl << " public:" << endl;
-  indent_up();
-  f_header_ << indent() << "typedef " << service_if_name << " Handler;" << endl << endl << indent()
-            << "virtual ~" << factory_name << "() {}" << endl << endl << indent() << "virtual "
-            << service_if_name << "* getHandler("
-            << "const ::apache::thrift::TConnectionInfo& connInfo) = 0;" << endl << indent()
-            << "virtual void releaseHandler(" << base_if_name << "* /* handler */) = 0;" << endl;
-
-  indent_down();
-  f_header_ << "};" << endl << endl;
-
-  // Generate the singleton factory class
-  string singleton_factory_name = service_if_name + "SingletonFactory";
-  f_header_ << "class " << singleton_factory_name << " : virtual public " << factory_name << " {"
-            << endl << " public:" << endl;
-  indent_up();
-  f_header_ << indent() << singleton_factory_name << "(const boost::shared_ptr<" << service_if_name
-            << ">& iface) : iface_(iface) {}" << endl << indent() << "virtual ~"
-            << singleton_factory_name << "() {}" << endl << endl << indent() << "virtual "
-            << service_if_name << "* getHandler("
-            << "const ::apache::thrift::TConnectionInfo&) {" << endl << indent()
-            << "  return iface_.get();" << endl << indent() << "}" << endl << indent()
-            << "virtual void releaseHandler(" << base_if_name << "* /* handler */) {}" << endl;
-
-  f_header_ << endl << " protected:" << endl << indent() << "boost::shared_ptr<" << service_if_name
-            << "> iface_;" << endl;
-
-  indent_down();
-  f_header_ << "};" << endl << endl;
-}
-
-/**
- * Generates a null implementation of the service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_cpp_generator::generate_service_null(t_service* tservice, string style) {
-  string extends = "";
-  if (tservice->get_extends() != NULL) {
-    extends = " , virtual public " + type_name(tservice->get_extends()) + style + "Null";
-  }
-  f_header_ << "class " << service_name_ << style << "Null : virtual public " << service_name_
-            << style << "If" << extends << " {" << endl << " public:" << endl;
-  indent_up();
-  f_header_ << indent() << "virtual ~" << service_name_ << style << "Null() {}" << endl;
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_header_ << indent() << function_signature(*f_iter, style, "", false) << " {" << endl;
-    indent_up();
-
-    t_type* returntype = (*f_iter)->get_returntype();
-    t_field returnfield(returntype, "_return");
-
-    if (style == "") {
-      if (returntype->is_void() || is_complex_type(returntype)) {
-        f_header_ << indent() << "return;" << endl;
-      } else {
-        f_header_ << indent() << declare_field(&returnfield, true) << endl << indent()
-                  << "return _return;" << endl;
-      }
-    } else if (style == "CobSv") {
-      if (returntype->is_void()) {
-        f_header_ << indent() << "return cob();" << endl;
-      } else {
-        t_field returnfield(returntype, "_return");
-        f_header_ << indent() << declare_field(&returnfield, true) << endl << indent()
-                  << "return cob(_return);" << endl;
-      }
-
-    } else {
-      throw "UNKNOWN STYLE";
-    }
-
-    indent_down();
-    f_header_ << indent() << "}" << endl;
-  }
-  indent_down();
-  f_header_ << "};" << endl << endl;
-}
-
-void t_cpp_generator::generate_function_call(ostream& out,
-                                             t_function* tfunction,
-                                             string target,
-                                             string iface,
-                                             string arg_prefix) {
-  bool first = true;
-  t_type* ret_type = get_true_type(tfunction->get_returntype());
-  out << indent();
-  if (!tfunction->is_oneway() && !ret_type->is_void()) {
-    if (is_complex_type(ret_type)) {
-      first = false;
-      out << iface << "->" << tfunction->get_name() << "(" << target;
-    } else {
-      out << target << " = " << iface << "->" << tfunction->get_name() << "(";
-    }
-  } else {
-    out << iface << "->" << tfunction->get_name() << "(";
-  }
-  const std::vector<t_field*>& fields = tfunction->get_arglist()->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      out << ", ";
-    }
-    out << arg_prefix << (*f_iter)->get_name();
-  }
-  out << ");" << endl;
-}
-
-void t_cpp_generator::generate_service_async_skeleton(t_service* tservice) {
-  string svcname = tservice->get_name();
-
-  // Service implementation file includes
-  string f_skeleton_name = get_out_dir() + svcname + "_async_server.skeleton.cpp";
-
-  string ns = namespace_prefix(tservice->get_program()->get_namespace("cpp"));
-
-  ofstream f_skeleton;
-  f_skeleton.open(f_skeleton_name.c_str());
-  f_skeleton << "// This autogenerated skeleton file illustrates one way to adapt a synchronous"
-             << endl << "// interface into an asynchronous interface. You should copy it to another"
-             << endl
-             << "// filename to avoid overwriting it and rewrite as asynchronous any functions"
-             << endl << "// that would otherwise introduce unwanted latency." << endl << endl
-             << "#include \"" << get_include_prefix(*get_program()) << svcname << ".h\"" << endl
-             << "#include <thrift/protocol/TBinaryProtocol.h>" << endl << endl
-             << "using namespace ::apache::thrift;" << endl
-             << "using namespace ::apache::thrift::protocol;" << endl
-             << "using namespace ::apache::thrift::transport;" << endl
-             << "using namespace ::apache::thrift::async;" << endl << endl
-             << "using boost::shared_ptr;" << endl << endl;
-
-  // the following code would not compile:
-  // using namespace ;
-  // using namespace ::;
-  if ((!ns.empty()) && (ns.compare(" ::") != 0)) {
-    f_skeleton << "using namespace " << string(ns, 0, ns.size() - 2) << ";" << endl << endl;
-  }
-
-  f_skeleton << "class " << svcname << "AsyncHandler : "
-             << "public " << svcname << "CobSvIf {" << endl << " public:" << endl;
-  indent_up();
-  f_skeleton << indent() << svcname << "AsyncHandler() {" << endl << indent()
-             << "  syncHandler_ = std::auto_ptr<" << svcname << "Handler>(new " << svcname
-             << "Handler);" << endl << indent() << "  // Your initialization goes here" << endl
-             << indent() << "}" << endl;
-  f_skeleton << indent() << "virtual ~" << service_name_ << "AsyncHandler();" << endl;
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_skeleton << endl << indent() << function_signature(*f_iter, "CobSv", "", true) << " {"
-               << endl;
-    indent_up();
-
-    t_type* returntype = (*f_iter)->get_returntype();
-    t_field returnfield(returntype, "_return");
-
-    string target = returntype->is_void() ? "" : "_return";
-    if (!returntype->is_void()) {
-      f_skeleton << indent() << declare_field(&returnfield, true) << endl;
-    }
-    generate_function_call(f_skeleton, *f_iter, target, "syncHandler_", "");
-    f_skeleton << indent() << "return cob(" << target << ");" << endl;
-
-    scope_down(f_skeleton);
-  }
-  f_skeleton << endl << " protected:" << endl << indent() << "std::auto_ptr<" << svcname
-             << "Handler> syncHandler_;" << endl;
-  indent_down();
-  f_skeleton << "};" << endl << endl;
-}
-
-/**
- * Generates a multiface, which is a single server that just takes a set
- * of objects implementing the interface and calls them all, returning the
- * value of the last one to be called.
- *
- * @param tservice The service to generate a multiserver for.
- */
-void t_cpp_generator::generate_service_multiface(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_multiface = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_multiface = ", public " + extends + "Multiface";
-  }
-
-  string list_type = string("std::vector<boost::shared_ptr<") + service_name_ + "If> >";
-
-  // Generate the header portion
-  f_header_ << "class " << service_name_ << "Multiface : "
-            << "virtual public " << service_name_ << "If" << extends_multiface << " {" << endl
-            << " public:" << endl;
-  indent_up();
-  f_header_ << indent() << service_name_ << "Multiface(" << list_type
-            << "& ifaces) : ifaces_(ifaces) {" << endl;
-  if (!extends.empty()) {
-    f_header_ << indent()
-              << "  std::vector<boost::shared_ptr<" + service_name_ + "If> >::iterator iter;"
-              << endl << indent() << "  for (iter = ifaces.begin(); iter != ifaces.end(); ++iter) {"
-              << endl << indent() << "    " << extends << "Multiface::add(*iter);" << endl
-              << indent() << "  }" << endl;
-  }
-  f_header_ << indent() << "}" << endl << indent() << "virtual ~" << service_name_
-            << "Multiface() {}" << endl;
-  indent_down();
-
-  // Protected data members
-  f_header_ << " protected:" << endl;
-  indent_up();
-  f_header_ << indent() << list_type << " ifaces_;" << endl << indent() << service_name_
-            << "Multiface() {}" << endl << indent() << "void add(boost::shared_ptr<"
-            << service_name_ << "If> iface) {" << endl;
-  if (!extends.empty()) {
-    f_header_ << indent() << "  " << extends << "Multiface::add(iface);" << endl;
-  }
-  f_header_ << indent() << "  ifaces_.push_back(iface);" << endl << indent() << "}" << endl;
-  indent_down();
-
-  f_header_ << indent() << " public:" << endl;
-  indent_up();
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arglist = (*f_iter)->get_arglist();
-    const vector<t_field*>& args = arglist->get_members();
-    vector<t_field*>::const_iterator a_iter;
-
-    string call = string("ifaces_[i]->") + (*f_iter)->get_name() + "(";
-    bool first = true;
-    if (is_complex_type((*f_iter)->get_returntype())) {
-      call += "_return";
-      first = false;
-    }
-    for (a_iter = args.begin(); a_iter != args.end(); ++a_iter) {
-      if (first) {
-        first = false;
-      } else {
-        call += ", ";
-      }
-      call += (*a_iter)->get_name();
-    }
-    call += ")";
-
-    f_header_ << indent() << function_signature(*f_iter, "") << " {" << endl;
-    indent_up();
-    f_header_ << indent() << "size_t sz = ifaces_.size();" << endl << indent() << "size_t i = 0;"
-              << endl << indent() << "for (; i < (sz - 1); ++i) {" << endl;
-    indent_up();
-    f_header_ << indent() << call << ";" << endl;
-    indent_down();
-    f_header_ << indent() << "}" << endl;
-
-    if (!(*f_iter)->get_returntype()->is_void()) {
-      if (is_complex_type((*f_iter)->get_returntype())) {
-        f_header_ << indent() << call << ";" << endl << indent() << "return;" << endl;
-      } else {
-        f_header_ << indent() << "return " << call << ";" << endl;
-      }
-    } else {
-      f_header_ << indent() << call << ";" << endl;
-    }
-
-    indent_down();
-    f_header_ << indent() << "}" << endl << endl;
-  }
-
-  indent_down();
-  f_header_ << indent() << "};" << endl << endl;
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_cpp_generator::generate_service_client(t_service* tservice, string style) {
-  string ifstyle;
-  if (style == "Cob") {
-    ifstyle = "CobCl";
-  }
-
-  std::ofstream& out = (gen_templates_ ? f_service_tcc_ : f_service_);
-  string template_header, template_suffix, short_suffix, protocol_type, _this;
-  string const prot_factory_type = "::apache::thrift::protocol::TProtocolFactory";
-  if (gen_templates_) {
-    template_header = "template <class Protocol_>\n";
-    short_suffix = "T";
-    template_suffix = "T<Protocol_>";
-    protocol_type = "Protocol_";
-    _this = "this->";
-  } else {
-    protocol_type = "::apache::thrift::protocol::TProtocol";
-  }
-  string prot_ptr = "boost::shared_ptr< " + protocol_type + ">";
-  string client_suffix = "Client" + template_suffix;
-  string if_suffix = "If";
-  if (style == "Cob") {
-    if_suffix += template_suffix;
-  }
-
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    // TODO(simpkins): If gen_templates_ is enabled, we currently assume all
-    // parent services were also generated with templates enabled.
-    extends = type_name(tservice->get_extends());
-    extends_client = ", public " + extends + style + client_suffix;
-  }
-
-  // Generate the header portion
-  if(style == "Concurrent")
-  {
-    f_header_ << 
-      "// The \'concurrent\' client is a thread safe client that correctly handles\n"
-      "// out of order responses.  It is slower than the regular client, so should\n"
-      "// only be used when you need to share a connection among multiple threads\n";
-  }
-  f_header_ << template_header << "class " << service_name_ << style << "Client" << short_suffix
-            << " : "
-            << "virtual public " << service_name_ << ifstyle << if_suffix << extends_client << " {"
-            << endl << " public:" << endl;
-
-  indent_up();
-  if (style != "Cob") {
-    f_header_ << indent() << service_name_ << style << "Client" << short_suffix << "(" << prot_ptr
-              << " prot) ";
-
-    if (extends.empty()) {
-      f_header_ << "{" << endl;
-      f_header_ << indent() << "  setProtocol" << short_suffix << "(prot);" << endl << indent()
-                << "}" << endl;
-    } else {
-      f_header_ << ":" << endl;
-      f_header_ << indent() << "  " << extends << style << client_suffix << "(prot, prot) {}"
-                << endl;
-    }
-
-    f_header_ << indent() << service_name_ << style << "Client" << short_suffix << "(" << prot_ptr
-              << " iprot, " << prot_ptr << " oprot) ";
-    if (extends.empty()) {
-      f_header_ << "{" << endl;
-      f_header_ << indent() << "  setProtocol" << short_suffix << "(iprot,oprot);" << endl
-                << indent() << "}" << endl;
-    } else {
-      f_header_ << ":" << indent() << "  " << extends << style << client_suffix
-                << "(iprot, oprot) {}" << endl;
-    }
-
-    // create the setProtocol methods
-    if (extends.empty()) {
-      f_header_ << " private:" << endl;
-      // 1: one parameter
-      f_header_ << indent() << "void setProtocol" << short_suffix << "(" << prot_ptr << " prot) {"
-                << endl;
-      f_header_ << indent() << "setProtocol" << short_suffix << "(prot,prot);" << endl;
-      f_header_ << indent() << "}" << endl;
-      // 2: two parameter
-      f_header_ << indent() << "void setProtocol" << short_suffix << "(" << prot_ptr << " iprot, "
-                << prot_ptr << " oprot) {" << endl;
-
-      f_header_ << indent() << "  piprot_=iprot;" << endl << indent() << "  poprot_=oprot;" << endl
-                << indent() << "  iprot_ = iprot.get();" << endl << indent()
-                << "  oprot_ = oprot.get();" << endl;
-
-      f_header_ << indent() << "}" << endl;
-      f_header_ << " public:" << endl;
-    }
-
-    // Generate getters for the protocols.
-    // Note that these are not currently templated for simplicity.
-    // TODO(simpkins): should they be templated?
-    f_header_ << indent()
-              << "boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getInputProtocol() {"
-              << endl << indent() << "  return " << _this << "piprot_;" << endl << indent() << "}"
-              << endl;
-
-    f_header_ << indent()
-              << "boost::shared_ptr< ::apache::thrift::protocol::TProtocol> getOutputProtocol() {"
-              << endl << indent() << "  return " << _this << "poprot_;" << endl << indent() << "}"
-              << endl;
-
-  } else /* if (style == "Cob") */ {
-    f_header_ << indent() << service_name_ << style << "Client" << short_suffix << "("
-              << "boost::shared_ptr< ::apache::thrift::async::TAsyncChannel> channel, "
-              << "::apache::thrift::protocol::TProtocolFactory* protocolFactory) :" << endl;
-    if (extends.empty()) {
-      f_header_ << indent() << "  channel_(channel)," << endl << indent()
-                << "  itrans_(new ::apache::thrift::transport::TMemoryBuffer())," << endl
-                << indent() << "  otrans_(new ::apache::thrift::transport::TMemoryBuffer()),"
-                << endl;
-      if (gen_templates_) {
-        // TProtocolFactory classes return generic TProtocol pointers.
-        // We have to dynamic cast to the Protocol_ type we are expecting.
-        f_header_ << indent() << "  piprot_(boost::dynamic_pointer_cast<Protocol_>("
-                  << "protocolFactory->getProtocol(itrans_)))," << endl << indent()
-                  << "  poprot_(boost::dynamic_pointer_cast<Protocol_>("
-                  << "protocolFactory->getProtocol(otrans_))) {" << endl;
-        // Throw a TException if either dynamic cast failed.
-        f_header_ << indent() << "  if (!piprot_ || !poprot_) {" << endl << indent()
-                  << "    throw ::apache::thrift::TException(\""
-                  << "TProtocolFactory returned unexpected protocol type in " << service_name_
-                  << style << "Client" << short_suffix << " constructor\");" << endl << indent()
-                  << "  }" << endl;
-      } else {
-        f_header_ << indent() << "  piprot_(protocolFactory->getProtocol(itrans_))," << endl
-                  << indent() << "  poprot_(protocolFactory->getProtocol(otrans_)) {" << endl;
-      }
-      f_header_ << indent() << "  iprot_ = piprot_.get();" << endl << indent()
-                << "  oprot_ = poprot_.get();" << endl << indent() << "}" << endl;
-    } else {
-      f_header_ << indent() << "  " << extends << style << client_suffix
-                << "(channel, protocolFactory) {}" << endl;
-    }
-  }
-
-  if (style == "Cob") {
-    f_header_ << indent()
-              << "boost::shared_ptr< ::apache::thrift::async::TAsyncChannel> getChannel() {" << endl
-              << indent() << "  return " << _this << "channel_;" << endl << indent() << "}" << endl;
-    if (!gen_no_client_completion_) {
-      f_header_ << indent() << "virtual void completed__(bool /* success */) {}" << endl;
-    }
-  }
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent(f_header_) << function_signature(*f_iter, ifstyle) << ";" << endl;
-    // TODO(dreiss): Use private inheritance to avoid generating thise in cob-style.
-    if(style == "Concurrent" && !(*f_iter)->is_oneway()) {
-      // concurrent clients need to move the seqid from the send function to the
-      // recv function.  Oneway methods don't have a recv function, so we don't need to
-      // move the seqid for them.  Attempting to do so would result in a seqid leak.
-      t_function send_function(g_type_i32, /*returning seqid*/
-          string("send_") + (*f_iter)->get_name(),
-          (*f_iter)->get_arglist());
-      indent(f_header_) << function_signature(&send_function, "") << ";" << endl;
-    }
-    else {
-      t_function send_function(g_type_void,
-          string("send_") + (*f_iter)->get_name(),
-          (*f_iter)->get_arglist());
-      indent(f_header_) << function_signature(&send_fu

<TRUNCATED>


[45/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_as3_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_as3_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_as3_generator.cc
deleted file mode 100644
index 2c43430..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_as3_generator.cc
+++ /dev/null
@@ -1,2579 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <sstream>
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <cctype>
-
-#include <sys/stat.h>
-#include <stdexcept>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * AS3 code generator.
- *
- */
-class t_as3_generator : public t_oop_generator {
-public:
-  t_as3_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("bindable");
-    bindable_ = (iter != parsed_options.end());
-
-    out_dir_base_ = "gen-as3";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool in_static,
-                         bool defval = false);
-  std::string render_const_value(ofstream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_as3_struct(t_struct* tstruct, bool is_exception);
-
-  void generate_as3_struct_definition(std::ofstream& out,
-                                      t_struct* tstruct,
-                                      bool is_xception = false,
-                                      bool in_class = false,
-                                      bool is_result = false);
-  // removed -- equality,compare_to
-  void generate_as3_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_as3_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_as3_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_as3_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_as3_struct_tostring(std::ofstream& out, t_struct* tstruct, bool bindable);
-  void generate_as3_meta_data_map(std::ofstream& out, t_struct* tstruct);
-  void generate_field_value_meta_data(std::ofstream& out, t_type* type);
-  std::string get_as3_type_string(t_type* type);
-  void generate_reflection_setters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_reflection_getters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct);
-  void generate_generic_isset_method(std::ofstream& out, t_struct* tstruct);
-  void generate_as3_bean_boilerplate(std::ofstream& out, t_struct* tstruct, bool bindable);
-
-  void generate_function_helpers(t_function* tfunction);
-  std::string get_cap_name(std::string name);
-  std::string generate_isset_check(t_field* field);
-  std::string generate_isset_check(std::string field);
-  void generate_isset_set(ofstream& out, t_field* field);
-  // removed std::string isset_field_id(t_field* field);
-
-  void generate_service_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_as3_doc(std::ofstream& out, t_doc* tdoc);
-
-  void generate_as3_doc(std::ofstream& out, t_function* tdoc);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string as3_package();
-  std::string as3_type_imports();
-  std::string as3_thrift_imports();
-  std::string as3_thrift_gen_imports(t_struct* tstruct, string& imports);
-  std::string as3_thrift_gen_imports(t_service* tservice);
-  std::string type_name(t_type* ttype, bool in_container = false, bool in_init = false);
-  std::string base_type_name(t_base_type* tbase, bool in_container = false);
-  std::string declare_field(t_field* tfield, bool init = false);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string get_enum_class_name(t_type* type);
-
-  bool type_can_be_null(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception()
-           || ttype->is_string();
-  }
-
-  std::string constant_name(std::string name);
-
-private:
-  /**
-   * File streams
-   */
-
-  std::string package_name_;
-  std::ofstream f_service_;
-  std::string package_dir_;
-
-  bool bindable_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_as3_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  package_name_ = program_->get_namespace("as3");
-
-  string dir = package_name_;
-  string subdir = get_out_dir();
-  string::size_type loc;
-  while ((loc = dir.find(".")) != string::npos) {
-    subdir = subdir + "/" + dir.substr(0, loc);
-    MKDIR(subdir.c_str());
-    dir = dir.substr(loc + 1);
-  }
-  if (dir.size() > 0) {
-    subdir = subdir + "/" + dir;
-    MKDIR(subdir.c_str());
-  }
-
-  package_dir_ = subdir;
-}
-
-/**
- * Packages the generated file
- *
- * @return String of the package, i.e. "package org.apache.thriftdemo;"
- */
-string t_as3_generator::as3_package() {
-  if (!package_name_.empty()) {
-    return string("package ") + package_name_ + " ";
-  }
-  return "package ";
-}
-
-/**
- * Prints standard as3 imports
- *
- * @return List of imports for As3 types that are used in here
- */
-string t_as3_generator::as3_type_imports() {
-  return string() + "import org.apache.thrift.Set;\n" + "import flash.utils.ByteArray;\n"
-         + "import flash.utils.Dictionary;\n\n";
-}
-
-/**
- * Prints standard as3 imports
- *
- * @return List of imports necessary for thrift
- */
-string t_as3_generator::as3_thrift_imports() {
-  return string() + "import org.apache.thrift.*;\n" + "import org.apache.thrift.meta_data.*;\n"
-         + "import org.apache.thrift.protocol.*;\n\n";
-}
-
-/**
- * Prints imports needed for a given type
- *
- * @return List of imports necessary for a given t_struct
- */
-string t_as3_generator::as3_thrift_gen_imports(t_struct* tstruct, string& imports) {
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  // For each type check if it is from a differnet namespace
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_program* program = (*m_iter)->get_type()->get_program();
-    if (program != NULL && program != program_) {
-      string package = program->get_namespace("as3");
-      if (!package.empty()) {
-        if (imports.find(package + "." + (*m_iter)->get_type()->get_name()) == string::npos) {
-          imports.append("import " + package + "." + (*m_iter)->get_type()->get_name() + ";\n");
-        }
-      }
-    }
-  }
-  return imports;
-}
-
-/**
- * Prints imports needed for a given type
- *
- * @return List of imports necessary for a given t_service
- */
-string t_as3_generator::as3_thrift_gen_imports(t_service* tservice) {
-  string imports;
-  const vector<t_function*>& functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-
-  // For each type check if it is from a differnet namespace
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_program* program = (*f_iter)->get_returntype()->get_program();
-    if (program != NULL && program != program_) {
-      string package = program->get_namespace("as3");
-      if (!package.empty()) {
-        if (imports.find(package + "." + (*f_iter)->get_returntype()->get_name()) == string::npos) {
-          imports.append("import " + package + "." + (*f_iter)->get_returntype()->get_name()
-                         + ";\n");
-        }
-      }
-    }
-
-    as3_thrift_gen_imports((*f_iter)->get_arglist(), imports);
-    as3_thrift_gen_imports((*f_iter)->get_xceptions(), imports);
-  }
-
-  return imports;
-}
-
-/**
- * Nothing in As3
- */
-void t_as3_generator::close_generator() {
-}
-
-/**
- * Generates a typedef. This is not done in As3, since it does
- * not support arbitrary name replacements, and it'd be a wacky waste
- * of overhead to make wrapper classes.
- *
- * @param ttypedef The type definition
- */
-void t_as3_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Enums are a class with a set of static constants.
- *
- * @param tenum The enumeration
- */
-void t_as3_generator::generate_enum(t_enum* tenum) {
-  // Make output file
-  string f_enum_name = package_dir_ + "/" + (tenum->get_name()) + ".as";
-  ofstream f_enum;
-  f_enum.open(f_enum_name.c_str());
-
-  // Comment and package it
-  f_enum << autogen_comment() << as3_package() << endl;
-
-  scope_up(f_enum);
-  // Add as3 imports
-  f_enum << string() + "import org.apache.thrift.Set;" << endl << "import flash.utils.Dictionary;"
-         << endl;
-
-  indent(f_enum) << "public class " << tenum->get_name() << " ";
-  scope_up(f_enum);
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_enum) << "public static const " << (*c_iter)->get_name() << ":int = " << value << ";"
-                   << endl;
-  }
-
-  // Create a static Set with all valid values for this enum
-  f_enum << endl;
-
-  indent(f_enum) << "public static const VALID_VALUES:Set = new Set(";
-  indent_up();
-  bool firstValue = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    // populate set
-    f_enum << (firstValue ? "" : ", ") << (*c_iter)->get_name();
-    firstValue = false;
-  }
-  indent_down();
-  f_enum << ");" << endl;
-
-  indent(f_enum) << "public static const VALUES_TO_NAMES:Dictionary = new Dictionary();" << endl;
-
-  scope_up(f_enum);
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    indent(f_enum) << "VALUES_TO_NAMES[" << (*c_iter)->get_name() << "] = \""
-                   << (*c_iter)->get_name() << "\";" << endl;
-  }
-  f_enum << endl;
-
-  scope_down(f_enum);
-
-  scope_down(f_enum); // end class
-
-  scope_down(f_enum); // end package
-
-  f_enum.close();
-}
-
-/**
- * Generates a class that holds all the constants.
- */
-void t_as3_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-
-  string f_consts_name = package_dir_ + "/" + program_name_ + "Constants.as";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  // Print header
-  f_consts << autogen_comment() << as3_package();
-
-  scope_up(f_consts);
-  f_consts << endl;
-
-  f_consts << as3_type_imports();
-
-  indent(f_consts) << "public class " << program_name_ << "Constants {" << endl << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    print_const_value(f_consts,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value(),
-                      false);
-  }
-  indent_down();
-  indent(f_consts) << "}" << endl;
-  scope_down(f_consts);
-  f_consts.close();
-}
-
-void t_as3_generator::print_const_value(std::ofstream& out,
-                                        string name,
-                                        t_type* type,
-                                        t_const_value* value,
-                                        bool in_static,
-                                        bool defval) {
-  type = get_true_type(type);
-
-  indent(out);
-  if (!defval) {
-    out << (in_static ? "var " : "public static const ");
-  }
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, name, type, value);
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = " << v2 << ";" << endl << endl;
-  } else if (type->is_enum()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = " << value->get_integer() << ";" << endl << endl;
-  } else if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    out << name << ":" << type_name(type) << " = new " << type_name(type, false, true) << "();"
-        << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function():void {" << endl;
-      indent_up();
-    }
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(out, name, field_type, v_iter->second);
-      indent(out) << name << ".";
-      out << v_iter->first->get_string() << " = " << val << ";" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_map()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function():void {" << endl;
-      indent_up();
-    }
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, name, ktype, v_iter->first);
-      string val = render_const_value(out, name, vtype, v_iter->second);
-      indent(out) << name << "[" << key << "] = " << val << ";" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_list() || type->is_set()) {
-    out << name;
-    if (!defval) {
-      out << ":" << type_name(type);
-    }
-    out << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "{" << endl;
-      indent_up();
-      indent(out) << "new function():void {" << endl;
-      indent_up();
-    }
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, name, etype, *v_iter);
-      indent(out) << name << "." << (type->is_list() ? "push" : "add") << "(" << val << ");"
-                  << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}();" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else {
-    throw "compiler error: no const of type " + type->get_name();
-  }
-}
-
-string t_as3_generator::render_const_value(ofstream& out,
-                                           string name,
-                                           t_type* type,
-                                           t_const_value* value) {
-  (void)name;
-  type = get_true_type(type);
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-      render << "(byte)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I16:
-      render << "(short)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      render << value->get_integer() << "L";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << "(double)" << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << value->get_integer();
-  } else {
-    string t = tmp("tmp");
-    print_const_value(out, t, type, value, true);
-    render << t;
-  }
-
-  return render.str();
-}
-
-/**
- * Generates a struct definition for a thrift data type. This is a class
- * with data members, read(), write(), and an inner Isset class.
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_struct(t_struct* tstruct) {
-  generate_as3_struct(tstruct, false);
-}
-
-/**
- * Exceptions are structs, but they inherit from Exception
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_xception(t_struct* txception) {
-  generate_as3_struct(txception, true);
-}
-
-/**
- * As3 struct definition.
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_struct(t_struct* tstruct, bool is_exception) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + (tstruct->get_name()) + ".as";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << as3_package();
-
-  scope_up(f_struct);
-  f_struct << endl;
-
-  string imports;
-
-  f_struct << as3_type_imports() << as3_thrift_imports() << as3_thrift_gen_imports(tstruct, imports)
-           << endl;
-
-  if (bindable_ && !is_exception) {
-    f_struct << "import flash.events.Event;" << endl << "import flash.events.EventDispatcher;"
-             << endl << "import mx.events.PropertyChangeEvent;" << endl;
-  }
-
-  generate_as3_struct_definition(f_struct, tstruct, is_exception);
-
-  scope_down(f_struct); // end of package
-  f_struct.close();
-}
-
-/**
- * As3 struct definition. This has various parameters, as it could be
- * generated standalone or inside another class as a helper. If it
- * is a helper than it is a static class.
- *
- * @param tstruct      The struct definition
- * @param is_exception Is this an exception?
- * @param in_class     If inside a class, needs to be static class
- * @param is_result    If this is a result it needs a different writer
- */
-void t_as3_generator::generate_as3_struct_definition(ofstream& out,
-                                                     t_struct* tstruct,
-                                                     bool is_exception,
-                                                     bool in_class,
-                                                     bool is_result) {
-  generate_as3_doc(out, tstruct);
-
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-  bool bindable = !is_exception && !in_class && bindable_;
-
-  indent(out) << (in_class ? "" : "public ") << (is_final ? "final " : "") << "class "
-              << tstruct->get_name() << " ";
-
-  if (is_exception) {
-    out << "extends Error ";
-  } else if (bindable) {
-    out << "extends EventDispatcher ";
-  }
-  out << "implements TBase ";
-
-  scope_up(out);
-
-  indent(out) << "private static const STRUCT_DESC:TStruct = new TStruct(\"" << tstruct->get_name()
-              << "\");" << endl;
-
-  // Members are public for -as3, private for -as3bean
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << "private static const " << constant_name((*m_iter)->get_name())
-                << "_FIELD_DESC:TField = new TField(\"" << (*m_iter)->get_name() << "\", "
-                << type_to_enum((*m_iter)->get_type()) << ", " << (*m_iter)->get_key() << ");"
-                << endl;
-  }
-
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_as3_doc(out, *m_iter);
-    indent(out) << "private var _" << (*m_iter)->get_name() + ":" + type_name((*m_iter)->get_type())
-                << ";" << endl;
-
-    indent(out) << "public static const " << upcase_string((*m_iter)->get_name())
-                << ":int = " << (*m_iter)->get_key() << ";" << endl;
-  }
-
-  out << endl;
-
-  // Inner Isset class
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (!type_can_be_null((*m_iter)->get_type())) {
-        indent(out) << "private var __isset_" << (*m_iter)->get_name() << ":Boolean = false;"
-                    << endl;
-      }
-    }
-  }
-
-  out << endl;
-
-  generate_as3_meta_data_map(out, tstruct);
-
-  // Static initializer to populate global class to struct metadata map
-  indent(out) << "{" << endl;
-  indent_up();
-  indent(out) << "FieldMetaData.addStructMetaDataMap(" << type_name(tstruct) << ", metaDataMap);"
-              << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  // Default constructor
-  indent(out) << "public function " << tstruct->get_name() << "() {" << endl;
-  indent_up();
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if ((*m_iter)->get_value() != NULL) {
-      indent(out) << "this._" << (*m_iter)->get_name() << " = "
-                  << (*m_iter)->get_value()->get_integer() << ";" << endl;
-    }
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  generate_as3_bean_boilerplate(out, tstruct, bindable);
-  generate_generic_field_getters_setters(out, tstruct);
-  generate_generic_isset_method(out, tstruct);
-
-  generate_as3_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_as3_struct_result_writer(out, tstruct);
-  } else {
-    generate_as3_struct_writer(out, tstruct);
-  }
-  generate_as3_struct_tostring(out, tstruct, bindable);
-  generate_as3_validator(out, tstruct);
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * Generates a function to read all the fields of the struct.
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_struct_reader(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function read(iprot:TProtocol):void {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Declare stack tmp variables and read struct header
-  out << indent() << "var field:TField;" << endl << indent() << "iprot.readStructBegin();" << endl;
-
-  // Loop over reading in fields
-  indent(out) << "while (true)" << endl;
-  scope_up(out);
-
-  // Read beginning field marker
-  indent(out) << "field = iprot.readFieldBegin();" << endl;
-
-  // Check for field STOP marker and break
-  indent(out) << "if (field.type == TType.STOP) { " << endl;
-  indent_up();
-  indent(out) << "break;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  // Switch statement on the field we are reading
-  indent(out) << "switch (field.id)" << endl;
-
-  scope_up(out);
-
-  // Generate deserialization code for known cases
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "case " << upcase_string((*f_iter)->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << "if (field.type == " << type_to_enum((*f_iter)->get_type()) << ") {" << endl;
-    indent_up();
-
-    generate_deserialize_field(out, *f_iter, "this.");
-    generate_isset_set(out, *f_iter);
-    indent_down();
-    out << indent() << "} else { " << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-        << endl << indent() << "}" << endl << indent() << "break;" << endl;
-    indent_down();
-  }
-
-  // In the default case we skip the field
-  out << indent() << "default:" << endl << indent() << "  TProtocolUtil.skip(iprot, field.type);"
-      << endl << indent() << "  break;" << endl;
-
-  scope_down(out);
-
-  // Read field end marker
-  indent(out) << "iprot.readFieldEnd();" << endl;
-
-  scope_down(out);
-
-  out << indent() << "iprot.readStructEnd();" << endl << endl;
-
-  // in non-beans style, check for required fields of primitive type
-  // (which can be checked here but not in the general validate method)
-  out << endl << indent() << "// check for required fields of primitive type, which can't be "
-                             "checked in the validate method" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED && !type_can_be_null((*f_iter)->get_type())) {
-      out << indent() << "if (!__isset_" << (*f_iter)->get_name() << ") {" << endl << indent()
-          << "  throw new TProtocolError(TProtocolError.UNKNOWN, \"Required field '"
-          << (*f_iter)->get_name()
-          << "' was not found in serialized data! Struct: \" + toString());" << endl << indent()
-          << "}" << endl;
-    }
-  }
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-// generates as3 method to perform various checks
-// (e.g. check that all required fields are set)
-void t_as3_generator::generate_as3_validator(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public function validate():void {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "// check for required fields" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      if (type_can_be_null((*f_iter)->get_type())) {
-        indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
-        indent(out) << "  throw new TProtocolError(TProtocolError.UNKNOWN, \"Required field '"
-                    << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());"
-                    << endl;
-        indent(out) << "}" << endl;
-      } else {
-        indent(out) << "// alas, we cannot check '" << (*f_iter)->get_name()
-                    << "' because it's a primitive and you chose the non-beans generator." << endl;
-      }
-    }
-  }
-
-  // check that fields of type enum have valid values
-  out << indent() << "// check that fields of type enum have valid values" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = (*f_iter);
-    t_type* type = field->get_type();
-    // if field is an enum, check that its value is valid
-    if (type->is_enum()) {
-      indent(out) << "if (" << generate_isset_check(field) << " && !" << get_enum_class_name(type)
-                  << ".VALID_VALUES.contains(" << field->get_name() << ")){" << endl;
-      indent_up();
-      indent(out) << "throw new TProtocolError(TProtocolError.UNKNOWN, \"The field '"
-                  << field->get_name() << "' has been assigned the invalid value \" + "
-                  << field->get_name() << ");" << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_struct_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol):void {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // performs various checks (e.g. check that all required fields are set)
-  indent(out) << "validate();" << endl << endl;
-
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool null_allowed = type_can_be_null((*f_iter)->get_type());
-    if (null_allowed) {
-      out << indent() << "if (this." << (*f_iter)->get_name() << " != null) {" << endl;
-      indent_up();
-    }
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    if (null_allowed) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-  // Write the struct map
-  out << indent() << "oprot.writeFieldStop();" << endl << indent() << "oprot.writeStructEnd();"
-      << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct,
- * which is a function result. These fields are only written
- * if they are set in the Isset array, and only one of them
- * can be set at a time.
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  out << indent() << "public function write(oprot:TProtocol):void {" << endl;
-  indent_up();
-
-  string name = tstruct->get_name();
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  indent(out) << "oprot.writeStructBegin(STRUCT_DESC);" << endl;
-
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-      out << endl << indent() << "if ";
-    } else {
-      out << " else if ";
-    }
-
-    out << "(this." << generate_isset_check(*f_iter) << ") {" << endl;
-
-    indent_up();
-
-    indent(out) << "oprot.writeFieldBegin(" << constant_name((*f_iter)->get_name())
-                << "_FIELD_DESC);" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "this.");
-
-    // Write field closer
-    indent(out) << "oprot.writeFieldEnd();" << endl;
-
-    indent_down();
-    indent(out) << "}";
-  }
-  // Write the struct map
-  out << endl << indent() << "oprot.writeFieldStop();" << endl << indent()
-      << "oprot.writeStructEnd();" << endl;
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-void t_as3_generator::generate_reflection_getters(ostringstream& out,
-                                                  t_type* type,
-                                                  string field_name,
-                                                  string cap_name) {
-  (void)type;
-  (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << ":" << endl;
-  indent_up();
-  indent(out) << "return this." << field_name << ";" << endl;
-  indent_down();
-}
-
-void t_as3_generator::generate_reflection_setters(ostringstream& out,
-                                                  t_type* type,
-                                                  string field_name,
-                                                  string cap_name) {
-  (void)type;
-  (void)cap_name;
-  indent(out) << "case " << upcase_string(field_name) << ":" << endl;
-  indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  this." << field_name << " = value;" << endl;
-  indent(out) << "}" << endl;
-  indent(out) << "break;" << endl << endl;
-
-  indent_down();
-}
-
-void t_as3_generator::generate_generic_field_getters_setters(std::ofstream& out,
-                                                             t_struct* tstruct) {
-
-  std::ostringstream getter_stream;
-  std::ostringstream setter_stream;
-
-  // build up the bodies of both the getter and setter at once
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    indent_up();
-    generate_reflection_setters(setter_stream, type, field_name, cap_name);
-    generate_reflection_getters(getter_stream, type, field_name, cap_name);
-    indent_down();
-  }
-
-  // create the setter
-  indent(out) << "public function setFieldValue(fieldID:int, value:*):void {" << endl;
-  indent_up();
-
-  indent(out) << "switch (fieldID) {" << endl;
-
-  out << setter_stream.str();
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  // create the getter
-  indent(out) << "public function getFieldValue(fieldID:int):* {" << endl;
-  indent_up();
-
-  indent(out) << "switch (fieldID) {" << endl;
-
-  out << getter_stream.str();
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-
-  indent(out) << "}" << endl;
-
-  indent_down();
-
-  indent(out) << "}" << endl << endl;
-}
-
-// Creates a generic isSet method that takes the field number as argument
-void t_as3_generator::generate_generic_isset_method(std::ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // create the isSet method
-  indent(out) << "// Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise" << endl;
-  indent(out) << "public function isSet(fieldID:int):Boolean {" << endl;
-  indent_up();
-  indent(out) << "switch (fieldID) {" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    indent(out) << "case " << upcase_string(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << "return " << generate_isset_check(field) << ";" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new ArgumentError(\"Field \" + fieldID + \" doesn't exist!\");" << endl;
-
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a set of As3 Bean boilerplate functions (setters, getters, etc.)
- * for the given struct.
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_bean_boilerplate(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    bool bindable) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    // Simple getter
-    generate_as3_doc(out, field);
-    indent(out) << "public function get " << field_name << "():" << type_name(type) << " {" << endl;
-    indent_up();
-    indent(out) << "return this._" << field_name << ";" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Simple setter
-    generate_as3_doc(out, field);
-    std::string propName = tmp("thriftPropertyChange");
-    if (bindable) {
-      indent(out) << "[Bindable(event=\"" << propName << "\")]" << endl;
-    }
-    indent(out) << "public function set " << field_name << "(" << field_name << ":"
-                << type_name(type) << "):void {" << endl;
-    indent_up();
-    indent(out) << "this._" << field_name << " = " << field_name << ";" << endl;
-    generate_isset_set(out, field);
-
-    if (bindable) {
-      // We have to use a custom event rather than the default, because if you use the default,
-      // the setter only gets called if the value has changed - this means calling
-      // foo.setIntValue(0)
-      // will not cause foo.isIntValueSet() to return true since the value of foo._intValue wasn't
-      // changed
-      // so the setter was never called.
-      indent(out) << "dispatchEvent(new Event(\"" << propName << "\"));" << endl;
-
-      // However, if you just use a custom event, then collections won't be able to detect when
-      // elements
-      // in the collections have changed since they listed for PropertyChangeEvents.  So, we
-      // dispatch both.
-      indent(out) << "dispatchEvent(new PropertyChangeEvent(PropertyChangeEvent.PROPERTY_CHANGE));"
-                  << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // Unsetter
-    indent(out) << "public function unset" << cap_name << "():void {" << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "this." << field_name << " = null;" << endl;
-    } else {
-      indent(out) << "this.__isset_" << field_name << " = false;" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-
-    // isSet method
-    indent(out) << "// Returns true if field " << field_name
-                << " is set (has been assigned a value) and false otherwise" << endl;
-    indent(out) << "public function is" << get_cap_name("set") << cap_name << "():Boolean {"
-                << endl;
-    indent_up();
-    if (type_can_be_null(type)) {
-      indent(out) << "return this." << field_name << " != null;" << endl;
-    } else {
-      indent(out) << "return this.__isset_" << field_name << ";" << endl;
-    }
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a toString() method for the given struct
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_struct_tostring(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   bool bindable) {
-  // If it's bindable, it extends EventDispatcher so toString is an override.
-  out << indent() << "public " << (bindable ? "override " : "") << "function toString():String {"
-      << endl;
-  indent_up();
-
-  out << indent() << "var ret:String = new String(\"" << tstruct->get_name() << "(\");" << endl;
-  out << indent() << "var first:Boolean = true;" << endl << endl;
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    bool could_be_unset = (*f_iter)->get_req() == t_field::T_OPTIONAL;
-    if (could_be_unset) {
-      indent(out) << "if (" << generate_isset_check(*f_iter) << ") {" << endl;
-      indent_up();
-    }
-
-    t_field* field = (*f_iter);
-
-    if (!first) {
-      indent(out) << "if (!first) ret +=  \", \";" << endl;
-    }
-    indent(out) << "ret += \"" << (*f_iter)->get_name() << ":\";" << endl;
-    bool can_be_null = type_can_be_null(field->get_type());
-    if (can_be_null) {
-      indent(out) << "if (this." << (*f_iter)->get_name() << " == null) {" << endl;
-      indent(out) << "  ret += \"null\";" << endl;
-      indent(out) << "} else {" << endl;
-      indent_up();
-    }
-
-    if (field->get_type()->is_base_type() && ((t_base_type*)(field->get_type()))->is_binary()) {
-      indent(out) << "  ret += \"BINARY\";" << endl;
-    } else if (field->get_type()->is_enum()) {
-      indent(out) << "var " << field->get_name()
-                  << "_name:String = " << get_enum_class_name(field->get_type())
-                  << ".VALUES_TO_NAMES[this." << (*f_iter)->get_name() << "];" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += " << field->get_name() << "_name;" << endl;
-      indent(out) << "  ret += \" (\";" << endl;
-      indent(out) << "}" << endl;
-      indent(out) << "ret += this." << field->get_name() << ";" << endl;
-      indent(out) << "if (" << field->get_name() << "_name != null) {" << endl;
-      indent(out) << "  ret += \")\";" << endl;
-      indent(out) << "}" << endl;
-    } else {
-      indent(out) << "ret += this." << (*f_iter)->get_name() << ";" << endl;
-    }
-
-    if (can_be_null) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    indent(out) << "first = false;" << endl;
-
-    if (could_be_unset) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    first = false;
-  }
-  out << indent() << "ret += \")\";" << endl << indent() << "return ret;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a static map with meta data to store information such as fieldID to
- * fieldName mapping
- *
- * @param tstruct The struct definition
- */
-void t_as3_generator::generate_as3_meta_data_map(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // Static Map with fieldID -> FieldMetaData mappings
-  indent(out) << "public static const metaDataMap:Dictionary = new Dictionary();" << endl;
-
-  if (fields.size() > 0) {
-    // Populate map
-    scope_up(out);
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* field = *f_iter;
-      std::string field_name = field->get_name();
-      indent(out) << "metaDataMap[" << upcase_string(field_name) << "] = new FieldMetaData(\""
-                  << field_name << "\", ";
-
-      // Set field requirement type (required, optional, etc.)
-      if (field->get_req() == t_field::T_REQUIRED) {
-        out << "TFieldRequirementType.REQUIRED, ";
-      } else if (field->get_req() == t_field::T_OPTIONAL) {
-        out << "TFieldRequirementType.OPTIONAL, ";
-      } else {
-        out << "TFieldRequirementType.DEFAULT, ";
-      }
-
-      // Create value meta data
-      generate_field_value_meta_data(out, field->get_type());
-      out << ");" << endl;
-    }
-    scope_down(out);
-  }
-}
-
-/**
- * Returns a string with the as3 representation of the given thrift type
- * (e.g. for the type struct it returns "TType.STRUCT")
- */
-std::string t_as3_generator::get_as3_type_string(t_type* type) {
-  if (type->is_list()) {
-    return "TType.LIST";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_enum()) {
-    return "TType.I32";
-  } else if (type->is_typedef()) {
-    return get_as3_type_string(((t_typedef*)type)->get_type());
-  } else if (type->is_base_type()) {
-    switch (((t_base_type*)type)->get_base()) {
-    case t_base_type::TYPE_VOID:
-      return "TType.VOID";
-      break;
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-      break;
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-      break;
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-      break;
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-      break;
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-      break;
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-      break;
-    default:
-      throw std::runtime_error("Unknown thrift type \"" + type->get_name()
-                               + "\" passed to t_as3_generator::get_as3_type_string!");
-      break; // This should never happen!
-    }
-  } else {
-    throw std::runtime_error(
-        "Unknown thrift type \"" + type->get_name()
-        + "\" passed to t_as3_generator::get_as3_type_string!"); // This should never happen!
-  }
-}
-
-void t_as3_generator::generate_field_value_meta_data(std::ofstream& out, t_type* type) {
-  out << endl;
-  indent_up();
-  indent_up();
-  if (type->is_struct()) {
-    indent(out) << "new StructMetaData(TType.STRUCT, " << type_name(type);
-  } else if (type->is_container()) {
-    if (type->is_list()) {
-      indent(out) << "new ListMetaData(TType.LIST, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else if (type->is_set()) {
-      indent(out) << "new SetMetaData(TType.SET, ";
-      t_type* elem_type = ((t_list*)type)->get_elem_type();
-      generate_field_value_meta_data(out, elem_type);
-    } else { // map
-      indent(out) << "new MapMetaData(TType.MAP, ";
-      t_type* key_type = ((t_map*)type)->get_key_type();
-      t_type* val_type = ((t_map*)type)->get_val_type();
-      generate_field_value_meta_data(out, key_type);
-      out << ", ";
-      generate_field_value_meta_data(out, val_type);
-    }
-  } else {
-    indent(out) << "new FieldValueMetaData(" << get_as3_type_string(type);
-  }
-  out << ")";
-  indent_down();
-  indent_down();
-}
-
-/**
- * Generates a thrift service. In C++, this comprises an entirely separate
- * header and source file. The header file defines the methods and includes
- * the data types defined in the main header file, and the implementation
- * file contains implementations of the basic printer and default interfaces.
- *
- * @param tservice The service definition
- */
-void t_as3_generator::generate_service(t_service* tservice) {
-  // Make interface file
-  string f_service_name = package_dir_ + "/" + service_name_ + ".as";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << as3_package();
-
-  scope_up(f_service_);
-
-  f_service_ << endl << as3_type_imports() << as3_thrift_imports()
-             << as3_thrift_gen_imports(tservice);
-
-  if (tservice->get_extends() != NULL) {
-    t_type* parent = tservice->get_extends();
-    string parent_namespace = parent->get_program()->get_namespace("as3");
-    if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << type_name(parent) << ";" << endl;
-    }
-  }
-
-  f_service_ << endl;
-
-  generate_service_interface(tservice);
-
-  scope_down(f_service_);
-  f_service_.close();
-
-  // Now make the implementation/client file
-  f_service_name = package_dir_ + "/" + service_name_ + "Impl.as";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << as3_package();
-
-  scope_up(f_service_);
-
-  f_service_ << endl << as3_type_imports() << as3_thrift_imports()
-             << as3_thrift_gen_imports(tservice);
-
-  if (tservice->get_extends() != NULL) {
-    t_type* parent = tservice->get_extends();
-    string parent_namespace = parent->get_program()->get_namespace("as3");
-    if (!parent_namespace.empty() && parent_namespace != package_name_) {
-      f_service_ << "import " << type_name(parent) << "Impl;" << endl;
-    }
-  }
-
-  f_service_ << endl;
-
-  generate_service_client(tservice);
-  scope_down(f_service_);
-
-  f_service_ << as3_type_imports();
-  f_service_ << as3_thrift_imports();
-  f_service_ << as3_thrift_gen_imports(tservice);
-  if (!package_name_.empty()) {
-    f_service_ << "import " << package_name_ << ".*;" << endl;
-  }
-
-  generate_service_helpers(tservice);
-
-  f_service_.close();
-
-  // Now make the processor/server file
-  f_service_name = package_dir_ + "/" + service_name_ + "Processor.as";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << autogen_comment() << as3_package();
-
-  scope_up(f_service_);
-
-  f_service_ << endl << as3_type_imports() << as3_thrift_imports()
-             << as3_thrift_gen_imports(tservice) << endl;
-
-  generate_service_server(tservice);
-  scope_down(f_service_);
-
-  f_service_ << as3_type_imports();
-  f_service_ << as3_thrift_imports();
-  f_service_ << as3_thrift_gen_imports(tservice) << endl;
-  if (!package_name_.empty()) {
-    f_service_ << "import " << package_name_ << ".*;" << endl;
-  }
-
-  generate_service_helpers(tservice);
-
-  f_service_.close();
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_as3_generator::generate_service_interface(t_service* tservice) {
-  string extends_iface = "";
-  if (tservice->get_extends() != NULL) {
-    extends_iface = " extends " + tservice->get_extends()->get_name();
-  }
-
-  generate_as3_doc(f_service_, tservice);
-  f_service_ << indent() << "public interface " << service_name_ << extends_iface << " {" << endl
-             << endl;
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_as3_doc(f_service_, *f_iter);
-    if (!(*f_iter)->is_oneway()) {
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "//function onError(Error):void;" << endl;
-        indent(f_service_) << "//function onSuccess():void;" << endl;
-      } else {
-        indent(f_service_) << "//function onError(Error):void;" << endl;
-        indent(f_service_) << "//function onSuccess(" << type_name((*f_iter)->get_returntype())
-                           << "):void;" << endl;
-      }
-    }
-    indent(f_service_) << function_signature(*f_iter) << ";" << endl << endl;
-  }
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates structs for all the service args and return types
- *
- * @param tservice The service
- */
-void t_as3_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_as3_struct_definition(f_service_, ts, false, true);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_as3_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = tservice->get_extends()->get_name();
-    extends_client = " extends " + extends + "Impl";
-  }
-
-  indent(f_service_) << "public class " << service_name_ << "Impl" << extends_client
-                     << " implements " << service_name_ << " {" << endl;
-  indent_up();
-
-  indent(f_service_) << "public function " << service_name_ << "Impl"
-                     << "(iprot:TProtocol, oprot:TProtocol=null)" << endl;
-  scope_up(f_service_);
-  if (extends.empty()) {
-    f_service_ << indent() << "iprot_ = iprot;" << endl;
-    f_service_ << indent() << "if (oprot == null) {" << endl;
-    indent_up();
-    f_service_ << indent() << "oprot_ = iprot;" << endl;
-    indent_down();
-    f_service_ << indent() << "} else {" << endl;
-    indent_up();
-    f_service_ << indent() << "oprot_ = oprot;" << endl;
-    indent_down();
-    f_service_ << indent() << "}";
-  } else {
-    f_service_ << indent() << "super(iprot, oprot);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected var iprot_:TProtocol;" << endl << indent()
-               << "protected var oprot_:TProtocol;" << endl << endl << indent()
-               << "protected var seqid_:int;" << endl << endl;
-
-    indent(f_service_) << "public function getInputProtocol():TProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.iprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    indent(f_service_) << "public function getOutputProtocol():TProtocol" << endl;
-    scope_up(f_service_);
-    indent(f_service_) << "return this.oprot_;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    if (!(*f_iter)->is_oneway()) {
-      if ((*f_iter)->get_returntype()->is_void()) {
-        indent(f_service_) << "//function onError(Error):void;" << endl;
-        indent(f_service_) << "//function onSuccess():void;" << endl;
-      } else {
-        indent(f_service_) << "//function onError(Error):void;" << endl;
-        indent(f_service_) << "//function onSuccess(" << type_name((*f_iter)->get_returntype())
-                           << "):void;" << endl;
-      }
-    }
-    indent(f_service_) << "public " << function_signature(*f_iter) << endl;
-    scope_up(f_service_);
-
-    // Get the struct of function call params
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-
-    string argsname = (*f_iter)->get_name() + "_args";
-    vector<t_field*>::const_iterator fld_iter;
-    const vector<t_field*>& fields = arg_struct->get_members();
-
-    // Serialize the request
-    f_service_ << indent() << "oprot_.writeMessageBegin(new TMessage(\"" << funname << "\", "
-               << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-               << ", seqid_));" << endl << indent() << "var args:" << argsname << " = new "
-               << argsname << "();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << "args." << (*fld_iter)->get_name() << " = "
-                 << (*fld_iter)->get_name() << ";" << endl;
-    }
-
-    f_service_ << indent() << "args.write(oprot_);" << endl << indent()
-               << "oprot_.writeMessageEnd();" << endl;
-
-    if ((*f_iter)->is_oneway()) {
-      f_service_ << indent() << "oprot_.getTransport().flush();" << endl;
-    } else {
-      f_service_ << indent() << "oprot_.getTransport().flush(function(error:Error):void {" << endl;
-      indent_up();
-      f_service_ << indent() << "try {" << endl;
-      indent_up();
-      string resultname = (*f_iter)->get_name() + "_result";
-      f_service_ << indent() << "if (error != null) {" << endl << indent()
-                 << "  if (onError != null) onError(error);" << endl << indent() << "  return;"
-                 << endl << indent() << "}" << endl << indent()
-                 << "var msg:TMessage = iprot_.readMessageBegin();" << endl << indent()
-                 << "if (msg.type == TMessageType.EXCEPTION) {" << endl << indent()
-                 << "  var x:TApplicationError = TApplicationError.read(iprot_);" << endl
-                 << indent() << "  iprot_.readMessageEnd();" << endl << indent()
-                 << "  if (onError != null) onError(x);" << endl << indent() << "  return;" << endl
-                 << indent() << "}" << endl << indent() << "var result :" << resultname << " = new "
-                 << resultname << "();" << endl << indent() << "result.read(iprot_);" << endl
-                 << indent() << "iprot_.readMessageEnd();" << endl;
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (result." << generate_isset_check("success") << ") {" << endl
-                   << indent() << "  if (onSuccess != null) onSuccess(result.success);" << endl
-                   << indent() << "  return;" << endl << indent() << "}" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_ << indent() << "if (result." << (*x_iter)->get_name() << " != null) {" << endl
-                   << indent() << "  if (onError != null) onError(result." << (*x_iter)->get_name()
-                   << ");" << endl << indent() << "  return;" << endl << indent() << "}" << endl;
-      }
-
-      // If you get here it's an exception, unless a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "if (onSuccess != null) onSuccess();" << endl << indent()
-                   << "return;" << endl;
-      } else {
-
-        f_service_ << indent() << "if (onError != null) onError(new "
-                                  "TApplicationError(TApplicationError.MISSING_RESULT, \""
-                   << (*f_iter)->get_name() << " failed: unknown result\"));" << endl;
-      }
-      indent_down();
-      f_service_ << indent() << "} catch (e:TError) {" << endl << indent()
-                 << "  if (onError != null) onError(e);" << endl << indent() << "}" << endl;
-
-      indent_down();
-      indent(f_service_) << "});" << endl;
-    }
-    // Close function
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl;
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_as3_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  // Extends stuff
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_processor = " extends " + extends + "Processor";
-  }
-
-  // Generate the header portion
-  indent(f_service_) << "public class " << service_name_ << "Processor" << extends_processor
-                     << " implements TProcessor {" << endl;
-  indent_up();
-
-  indent(f_service_) << "public function " << service_name_ << "Processor(iface:" << service_name_
-                     << ")" << endl;
-  scope_up(f_service_);
-  if (!extends.empty()) {
-    f_service_ << indent() << "super(iface);" << endl;
-  }
-  f_service_ << indent() << "iface_ = iface;" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_service_ << indent() << "PROCESS_MAP[\"" << (*f_iter)->get_name()
-               << "\"] = " << (*f_iter)->get_name() << "();" << endl;
-  }
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  f_service_ << indent() << "private var iface_:" << service_name_ << ";" << endl;
-
-  if (extends.empty()) {
-    f_service_ << indent() << "protected const PROCESS_MAP:Dictionary = new Dictionary();" << endl;
-  }
-
-  f_service_ << endl;
-
-  // Generate the server implementation
-  string override = "";
-  if (tservice->get_extends() != NULL) {
-    override = "override ";
-  }
-  indent(f_service_) << override
-                     << "public function process(iprot:TProtocol, oprot:TProtocol):Boolean" << endl;
-  scope_up(f_service_);
-
-  f_service_ << indent() << "var msg:TMessage = iprot.readMessageBegin();" << endl;
-
-  // TODO(mcslee): validate message, was the seqid etc. legit?
-  // AS- If all method is oneway:
-  // do you have an oprot?
-  // do you you need nullcheck?
-  f_service_
-      << indent() << "var fn:Function = PROCESS_MAP[msg.name];" << endl << indent()
-      << "if (fn == null) {" << endl << indent() << "  TProtocolUtil.skip(iprot, TType.STRUCT);"
-      << endl << indent() << "  iprot.readMessageEnd();" << endl << indent()
-      << "  var x:TApplicationError = new TApplicationError(TApplicationError.UNKNOWN_METHOD, "
-         "\"Invalid method name: '\"+msg.name+\"'\");" << endl << indent()
-      << "  oprot.writeMessageBegin(new TMessage(msg.name, TMessageType.EXCEPTION, msg.seqid));"
-      << endl << indent() << "  x.write(oprot);" << endl << indent() << "  oprot.writeMessageEnd();"
-      << endl << indent() << "  oprot.getTransport().flush();" << endl << indent()
-      << "  return true;" << endl << indent() << "}" << endl << indent()
-      << "fn.call(this,msg.seqid, iprot, oprot);" << endl;
-
-  f_service_ << indent() << "return true;" << endl;
-
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  indent_down();
-  indent(f_service_) << "}" << endl << endl;
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_as3_generator::generate_function_helpers(t_function* tfunction) {
-  if (tfunction->is_oneway()) {
-    return;
-  }
-
-  t_struct result(program_, tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-
-  generate_as3_struct_definition(f_service_, &result, false, true, true);
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_as3_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open class
-  indent(f_service_) << "private function " << tfunction->get_name() << "():Function {" << endl;
-  indent_up();
-
-  // Open function
-  indent(f_service_) << "return function(seqid:int, iprot:TProtocol, oprot:TProtocol):void" << endl;
-  scope_up(f_service_);
-
-  string argsname = tfunction->get_name() + "_args";
-  string resultname = tfunction->get_name() + "_result";
-
-  f_service_ << indent() << "var args:" << argsname << " = new " << argsname << "();" << endl
-             << indent() << "args.read(iprot);" << endl << indent() << "iprot.readMessageEnd();"
-             << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_ << indent() << "var result:" << resultname << " = new " << resultname << "();"
-               << endl;
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_ << indent() << "try {" << endl;
-    indent_up();
-  }
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_ << indent();
-  if (tfunction->is_oneway()) {
-    f_service_ << "iface_." << tfunction->get_name() << "(";
-    bool first = true;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << "args." << (*f_iter)->get_name();
-    }
-    f_service_ << ");" << endl;
-  } else {
-    f_service_ << "// sorry this operation is not supported yet" << endl;
-    f_service_ << indent() << "throw new Error(\"This is not yet supported\");" << endl;
-  }
-
-  // Set isset on success field
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()
-      && !type_can_be_null(tfunction->get_returntype())) {
-    f_service_ << indent() << "result.set" << get_cap_name("success") << get_cap_name("isSet")
-               << "(true);" << endl;
-  }
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    indent_down();
-    f_service_ << indent() << "}";
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_ << " catch (" << (*x_iter)->get_name() << ":"
-                 << type_name((*x_iter)->get_type(), false, false) << ") {" << endl;
-      if (!tfunction->is_oneway()) {
-        indent_up();
-        f_service_ << indent() << "result." << (*x_iter)->get_name() << " = "
-                   << (*x_iter)->get_name() << ";" << endl;
-        indent_down();
-        f_service_ << indent() << "}";
-      } else {
-        f_service_ << "}";
-      }
-    }
-    f_service_ << " catch (th:Error) {" << endl;
-    indent_up();
-    f_service_ << indent() << "trace(\"Internal error processing " << tfunction->get_name()
-               << "\", th);" << endl << indent()
-               << "var x:TApplicationError = new "
-                  "TApplicationError(TApplicationError.INTERNAL_ERROR, \"Internal error processing "
-               << tfunction->get_name() << "\");" << endl << indent()
-               << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-               << "\", TMessageType.EXCEPTION, seqid));" << endl << indent() << "x.write(oprot);"
-               << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-               << "oprot.getTransport().flush();" << endl << indent() << "return;" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_ << indent() << "return;" << endl;
-    scope_down(f_service_);
-
-    // Close class
-    indent_down();
-    f_service_ << indent() << "}" << endl << endl;
-    return;
-  }
-
-  f_service_ << indent() << "oprot.writeMessageBegin(new TMessage(\"" << tfunction->get_name()
-             << "\", TMessageType.REPLY, seqid));" << endl << indent() << "result.write(oprot);"
-             << endl << indent() << "oprot.writeMessageEnd();" << endl << indent()
-             << "oprot.getTransport().flush();" << endl;
-
-  // Close function
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Close class
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Deserializes a field of any type.
- *
- * @param tfield The field
- * @param prefix The variable name or container for this field
- */
-void t_as3_generator::generate_deserialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    indent(out) << name << " = iprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "readBinary();";
-        } else {
-          out << "readString();";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool();";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte();";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16();";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32();";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64();";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble();";
-        break;
-      default:
-        throw "compiler error: no As3 name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32();";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Generates an unserializer for a struct, invokes read()
- */
-void t_as3_generator::generate_deserialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  out << indent() << prefix << " = new " << type_name(tstruct) << "();" << endl << indent()
-      << prefix << ".read(iprot);" << endl;
-}
-
-/**
- * Deserializes a container by reading its size and then iterating
- */
-void t_as3_generator::generate_deserialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  string obj;
-
-  if (ttype->is_map()) {
-    obj = tmp("_map");
-  } else if (ttype->is_set()) {
-    obj = tmp("_set");
-  } else if (ttype->is_list()) {
-    obj = tmp("_list");
-  }
-
-  // Declare variables, read header
-  if (ttype->is_map()) {
-    indent(out) << "var " << obj << ":TMap = iprot.readMapBegin();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "var " << obj << ":TSet = iprot.readSetBegin();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "var " << obj << ":TList = iprot.readListBegin();" << endl;
-  }
-
-  indent(out) << prefix << " = new " << type_name(ttype, false, true)
-              // size the collection correctly
-              << "("
-              << ");" << endl;
-
-  // For loop iterates over elements
-  string i = tmp("_i");
-  indent(out) << "for (var " << i << ":int = 0; " << i << " < " << obj << ".size"
-              << "; "
-              << "++" << i << ")" << endl;
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  scope_down(out);
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "iprot.readMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "iprot.readSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "iprot.readListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Generates code to deserialize a map
- */
-void t_as3_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  string key = tmp("_key");
-  string val = tmp("_val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  indent(out) << declare_field(&fkey) << endl;
-  indent(out) << declare_field(&fval) << endl;
-
-  generate_deserialize_field(out, &fkey);
-  generate_deserialize_field(out, &fval);
-
-  indent(out) << prefix << "[" << key << "] = " << val << ";" << endl;
-}
-
-/**
- * Deserializes a set element
- */
-void t_as3_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".add(" << elem << ");" << endl;
-}
-
-/**
- * Deserializes a list element
- */
-void t_as3_generator::generate_deserialize_list_element(ofstream& out,
-                                                        t_list* tlist,
-                                                        string prefix) {
-  string elem = tmp("_elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  indent(out) << declare_field(&felem) << endl;
-
-  generate_deserialize_field(out, &felem);
-
-  indent(out) << prefix << ".push(" << elem << ");" << endl;
-}
-
-/**
- * Serializes a field of any type.
- *
- * @param tfield The field to serialize
- * @param prefix Name to prepend to field name
- */
-void t_as3_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, prefix + tfield->get_name());
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, prefix + tfield->get_name());
-  } else if (type->is_base_type() || type->is_enum()) {
-
-    string name = prefix + tfield->get_name();
-    indent(out) << "oprot.";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        if (((t_base_type*)type)->is_binary()) {
-          out << "writeBinary(" << name << ");";
-        } else {
-          out << "writeString(" << name << ");";
-        }
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ");";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ");";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ");";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ");";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ");";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ");";
-        break;
-      default:
-        throw "compiler error: no As3 name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32(" << name << ");";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s%s' TYPE '%s'\n",
-           prefix.c_str(),
-           tfield->get_name().c_str(),
-           type_name(type).c_str());
-  }
-}
-
-/**
- * Serializes all the members of a struct.
- *
- * @param tstruct The struct to serialize
- * @param prefix  String prefix to attach to all fields
- */
-void t_as3_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  out << indent() << prefix << ".write(oprot);" << endl;
-}
-
-/**
- * Serializes a container by writing its size then the elements.
- *
- * @param ttype  The type of container
- * @param prefix String prefix for fields
- */
-void t_as3_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    string iter = tmp("_key");
-    string counter = tmp("_sizeCounter");
-    indent(out) << "var " << counter << ":int = 0;" << endl;
-    indent(out) << "for (var " << iter << ":* in " << prefix << ") {" << endl;
-    indent(out) << "  " << counter << +"++;" << endl;
-    indent(out) << "}" << endl;
-
-    indent(out) << "oprot.writeMapBegin(new TMap(" << type_to_enum(((t_map*)ttype)->get_key_type())
-                << ", " << type_to_enum(((t_map*)ttype)->get_val_type()) << ", " << counter << "));"
-                << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetBegin(new TSet(" << type_to_enum(((t_set*)ttype)->get_elem_type())
-                << ", " << prefix << ".size));" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListBegin(new TList("
-                << type_to_enum(((t_list*)ttype)->get_elem_type()) << ", " << prefix << ".length));"
-                << endl;
-  }
-
-  string iter = tmp("elem");
-  if (ttype->is_map()) {
-    indent(out) << "for (var " << iter << ":* in " << prefix << ")";
-  } else if (ttype->is_set()) {
-    indent(out) << "for each (var " << iter << ":* in " << prefix << ".toArray())";
-  } else if (ttype->is_list()) {
-    indent(out) << "for each (var " << iter << ":* in " << prefix << ")";
-  }
-
-  scope_up(out);
-
-  if (ttype->is_map()) {
-    generate_serialize_map_element(out, (t_map*)ttype, iter, prefix);
-  } else if (ttype->is_set()) {
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-  } else if (ttype->is_list()) {
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-  }
-
-  scope_down(out);
-
-  if (ttype->is_map()) {
-    indent(out) << "oprot.writeMapEnd();" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot.writeSetEnd();" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot.writeListEnd();" << endl;
-  }
-
-  scope_down(out);
-}
-
-/**
- * Serializes the members of a map.
- */
-void t_as3_generator::generate_serialize_map_element(ofstream& out,
-                                                     t_map* tmap,
-                                                     string iter,
-                                                     string map) {
-  t_field kfield(tmap->get_key_type(), iter);
-  generate_serialize_field(out, &kfield, "");
-  t_field vfield(tmap->get_val_type(), map + "[" + iter + "]");
-  generate_serialize_field(out, &vfield, "");
-}
-
-/**
- * Serializes the members of a set.
- */
-void t_as3_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Serializes the members of a list.
- */
-void t_as3_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- * Returns a As3 type name
- *
- * @param ttype The type
- * @param container Is the type going inside a container?
- * @return As3 type name, i.e. HashMap<Key,Value>
- */
-string t_as3_generator::type_name(t_type* ttype, bool in_container, bool in_init) {
-  (void)in_init;
-  // In As3 typedefs are just resolved to their real type
-  ttype = get_true_type(ttype);
-  string prefix;
-
-  if (ttype->is_base_type()) {
-    return base_type_name((t_base_type*)ttype, in_container);
-  } else if (ttype->is_enum()) {
-    return "int";
-  } else if (ttype->is_map()) {
-    return "Dictionary";
-  } else if (ttype->is_set()) {
-    return "Set";
-  } else if (ttype->is_list()) {
-    return "Array";
-  }
-
-  // Check for namespacing
-  t_program* program = ttype->get_program();
-  if (program != NULL && program != program_) {
-    string package = program->get_namespace("as3");
-    if (!package.empty()) {
-      return package + "." + ttype->get_name();
-    }
-  }
-
-  return ttype->get_name();
-}
-
-/**
- * Returns the AS3 type that corresponds to the thrift type.
- *
- * @param tbase The base type
- * @param container Is it going in a As3 container?
- */
-string t_as3_generator::base_type_name(t_base_type* type, bool in_container) {
-  (void)in_container;
-  t_base_type::t_base tbase = type->get_base();
-
-  switch (tbase) {
-  case t_base_type::TYPE_VOID:
-    return "void";
-  case t_base_type::TYPE_STRING:
-    if (type->is_binary()) {
-      return "ByteArray";
-    } else {
-      return "String";
-    }
-  case t_base_type::TYPE_BOOL:
-    return "Boolean";
-  case t_base_type::TYPE_BYTE:
-  case t_base_type::TYPE_I16:
-  case t_base_type::TYPE_I32:
-    return "int";
-  case t_base_type::TYPE_I64:
-    throw "i64 is not yet supported in as3";
-  case t_base_type::TYPE_DOUBLE:
-    return "Number";
-  default:
-    throw "compiler error: no As3 name for base type " + t_base_type::t_base_name(tbase);
-  }
-}
-
-/**
- * Declares a field, which may include initialization as necessary.
- *
- * @param ttype The type
- */
-string t_as3_generator::declare_field(t_field* tfield, bool init) {
-  // TODO(mcslee): do we ever need to initialize the field?
-  string result = "var " + tfield->get_name() + ":" + type_name(tfield->get_type());
-  if (init) {
-    t_type* ttype = get_true_type(tfield->get_type());
-    if (ttype->is_base_type() && tfield->get_value() != NULL) {
-      ofstream dummy;
-      result += " = " + render_const_value(dummy, tfield->get_name(), ttype, tfield->get_value());
-    } else if (ttype->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)ttype)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "NO T_VOID CONSTRUCT";
-      case t_base_type::TYPE_STRING:
-        result += " = null";
-        break;
-      case t_base_type::TYPE_BOOL:
-        result += " = false";
-        break;
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-        result += " = 0";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        result += " = (double)0";
-        break;
-      }
-
-    } else if (ttype->is_enum()) {
-      result += " = 0";
-    } else if (ttype->is_container()) {
-      result += " = new " + type_name(ttype, false, true) + "()";
-    } else {
-      result += " = new " + type_name(ttype, false, true) + "()";
-      ;
-    }
-  }
-  return result + ";";
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_as3_generator::function_signature(t_function* tfunction, string prefix) {
-  std::string arguments = argument_list(tfunction->get_arglist());
-  if (!tfunction->is_oneway()) {
-    if (arguments != "") {
-      arguments += ", ";
-    }
-    arguments += "onError:Function, onSuccess:Function";
-  }
-
-  std::string result = "function " + prefix + tfunction->get_name() + "(" + arguments + "):void";
-  return result;
-}
-
-/**
- * Renders a comma separated field list, with type names
- */
-string t_as3_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += (*f_iter)->get_name() + ":" + type_name((*f_iter)->get_type());
-  }
-  return result;
-}
-
-/**
- * Converts the parse type to a C++ enum string for the given type.
- */
-string t_as3_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "TType.I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_list()) {
-    return "TType.LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Applies the correct style to a string based on the value of nocamel_style_
- */
-std::string t_as3_generator::get_cap_name(std::string name) {
-  name[0] = toupper(name[0]);
-  return name;
-}
-
-string t_as3_generator::constant_name(string name) {
-  string constant_name;
-
-  bool is_first = true;
-  bool was_previous_char_upper = false;
-  for (string::iterator iter = name.begin(); iter != name.end(); ++iter) {
-    string::value_type character = (*iter);
-
-    bool is_upper = isupper(character);
-
-    if (is_upper && !is_first && !was_previous_char_upper) {
-      constant_name += '_';
-    }
-    constant_name += toupper(character);
-
-    is_first = false;
-    was_previous_char_upper = is_upper;
-  }
-
-  return constant_name;
-}
-
-/**
- * Emits a As3Doc comment if the provided object has a doc in Thrift
- */
-void t_as3_generator::generate_as3_doc(ofstream& out, t_doc* tdoc) {
-  if (tdoc->has_doc()) {
-    generate_docstring_comment(out, "/**\n", " * ", tdoc->get_doc(), " */\n");
-  }
-}
-
-/**
- * Emits a As3Doc comm

<TRUNCATED>


[18/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
deleted file mode 100644
index 63451c3..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/AbstractThriftMojo.java
+++ /dev/null
@@ -1,377 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.maven;
-
-import com.google.common.base.Joiner;
-import com.google.common.collect.ImmutableSet;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.io.RawInputStreamFacade;
-import java.io.File;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.security.MessageDigest;
-import java.security.NoSuchAlgorithmException;
-import java.util.List;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Sets.newHashSet;
-import static java.lang.String.format;
-import static java.util.Arrays.asList;
-import static java.util.Collections.list;
-import static org.codehaus.plexus.util.FileUtils.cleanDirectory;
-import static org.codehaus.plexus.util.FileUtils.copyStreamToFile;
-import static org.codehaus.plexus.util.FileUtils.getFiles;
-
-/**
- * Abstract Mojo implementation.
- * <p/>
- * This class is extended by {@link org.apache.thrift.maven.ThriftCompileMojo} and
- * {@link org.apache.thrift.maven.ThriftTestCompileMojo} in order to override the specific configuration for
- * compiling the main or test classes respectively.
- */
-abstract class AbstractThriftMojo extends AbstractMojo {
-
-    private static final String THRIFT_FILE_SUFFIX = ".thrift";
-
-    private static final String DEFAULT_INCLUDES = "**/*" + THRIFT_FILE_SUFFIX;
-
-    /**
-     * The current Maven project.
-     *
-     * @parameter default-value="${project}"
-     * @readonly
-     * @required
-     */
-    protected MavenProject project;
-
-    /**
-     * A helper used to add resources to the project.
-     *
-     * @component
-     * @required
-     */
-    protected MavenProjectHelper projectHelper;
-
-    /**
-     * This is the path to the {@code thrift} executable. By default it will search the {@code $PATH}.
-     *
-     * @parameter default-value="thrift"
-     * @required
-     */
-    private String thriftExecutable;
-
-    /**
-     * This string is passed to the {@code --gen} option of the {@code thrift} parameter. By default
-     * it will generate Java output. The main reason for this option is to be able to add options
-     * to the Java generator - if you generate something else, you're on your own.
-     *
-     * @parameter default-value="java:hashcode"
-     */
-    private String generator;
-
-    /**
-     * @parameter
-     */
-    private File[] additionalThriftPathElements = new File[]{};
-
-    /**
-     * Since {@code thrift} cannot access jars, thrift files in dependencies are extracted to this location
-     * and deleted on exit. This directory is always cleaned during execution.
-     *
-     * @parameter property="${project.build.directory}/thrift-dependencies"
-     * @required
-     */
-    private File temporaryThriftFileDirectory;
-
-    /**
-     * This is the path to the local maven {@code repository}.
-     *
-     * @parameter default-value="${localRepository}"
-     * @required
-     */
-    private ArtifactRepository localRepository;
-
-    /**
-     * Set this to {@code false} to disable hashing of dependent jar paths.
-     * <p/>
-     * This plugin expands jars on the classpath looking for embedded .thrift files.
-     * Normally these paths are hashed (MD5) to avoid issues with long file names on windows.
-     * However if this property is set to {@code false} longer paths will be used.
-     *
-     * @parameter default-value="true"
-     * @required
-     */
-    private boolean hashDependentPaths;
-
-    /**
-     * @parameter
-     */
-    private Set<String> includes = ImmutableSet.of(DEFAULT_INCLUDES);
-
-    /**
-     * @parameter
-     */
-    private Set<String> excludes = ImmutableSet.of();
-
-    /**
-     * @parameter
-     */
-    private long staleMillis = 0;
-
-    /**
-     * @parameter
-     */
-    private boolean checkStaleness = false;
-
-    /**
-     * Executes the mojo.
-     */
-    public void execute() throws MojoExecutionException, MojoFailureException {
-        checkParameters();
-        final File thriftSourceRoot = getThriftSourceRoot();
-        if (thriftSourceRoot.exists()) {
-            try {
-                ImmutableSet<File> thriftFiles = findThriftFilesInDirectory(thriftSourceRoot);
-                final File outputDirectory = getOutputDirectory();
-                ImmutableSet<File> outputFiles = findGeneratedFilesInDirectory(getOutputDirectory());
-
-                if (thriftFiles.isEmpty()) {
-                    getLog().info("No thrift files to compile.");
-                } else if (checkStaleness && ((lastModified(thriftFiles) + staleMillis) < lastModified(outputFiles))) {
-                    getLog().info("Skipping compilation because target directory newer than sources.");
-                    attachFiles();
-                } else {
-                    ImmutableSet<File> derivedThriftPathElements =
-                            makeThriftPathFromJars(temporaryThriftFileDirectory, getDependencyArtifactFiles());
-                    outputDirectory.mkdirs();
-
-                    // Quick fix to fix issues with two mvn installs in a row (ie no clean)
-                    // cleanDirectory(outputDirectory);
-
-                    Thrift thrift = new Thrift.Builder(thriftExecutable, outputDirectory)
-                            .setGenerator(generator)
-                            .addThriftPathElement(thriftSourceRoot)
-                            .addThriftPathElements(derivedThriftPathElements)
-                            .addThriftPathElements(asList(additionalThriftPathElements))
-                            .addThriftFiles(thriftFiles)
-                            .build();
-                    final int exitStatus = thrift.compile();
-                    if (exitStatus != 0) {
-                        getLog().error("thrift failed output: " + thrift.getOutput());
-                        getLog().error("thrift failed error: " + thrift.getError());
-                        throw new MojoFailureException(
-                                "thrift did not exit cleanly. Review output for more information.");
-                    }
-                    attachFiles();
-                }
-            } catch (IOException e) {
-                throw new MojoExecutionException("An IO error occurred", e);
-            } catch (IllegalArgumentException e) {
-                throw new MojoFailureException("thrift failed to execute because: " + e.getMessage(), e);
-            } catch (CommandLineException e) {
-                throw new MojoExecutionException("An error occurred while invoking thrift.", e);
-            }
-        } else {
-            getLog().info(format("%s does not exist. Review the configuration or consider disabling the plugin.",
-                    thriftSourceRoot));
-        }
-    }
-
-    ImmutableSet<File> findGeneratedFilesInDirectory(File directory) throws IOException {
-        if (directory == null || !directory.isDirectory())
-            return ImmutableSet.of();
-
-        List<File> javaFilesInDirectory = getFiles(directory, "**/*.java", null);
-        return ImmutableSet.copyOf(javaFilesInDirectory);
-    }
-
-    private long lastModified(ImmutableSet<File> files) {
-        long result = 0;
-        for (File file : files) {
-            if (file.lastModified() > result)
-                result = file.lastModified();
-        }
-        return result;
-    }
-
-    private void checkParameters() {
-        checkNotNull(project, "project");
-        checkNotNull(projectHelper, "projectHelper");
-        checkNotNull(thriftExecutable, "thriftExecutable");
-        checkNotNull(generator, "generator");
-        final File thriftSourceRoot = getThriftSourceRoot();
-        checkNotNull(thriftSourceRoot);
-        checkArgument(!thriftSourceRoot.isFile(), "thriftSourceRoot is a file, not a diretory");
-        checkNotNull(temporaryThriftFileDirectory, "temporaryThriftFileDirectory");
-        checkState(!temporaryThriftFileDirectory.isFile(), "temporaryThriftFileDirectory is a file, not a directory");
-        final File outputDirectory = getOutputDirectory();
-        checkNotNull(outputDirectory);
-        checkState(!outputDirectory.isFile(), "the outputDirectory is a file, not a directory");
-    }
-
-    protected abstract File getThriftSourceRoot();
-
-    protected abstract List<Artifact> getDependencyArtifacts();
-
-    protected abstract File getOutputDirectory();
-
-    protected abstract void attachFiles();
-
-    /**
-     * Gets the {@link File} for each dependency artifact.
-     *
-     * @return A set of all dependency artifacts.
-     */
-    private ImmutableSet<File> getDependencyArtifactFiles() {
-        Set<File> dependencyArtifactFiles = newHashSet();
-        for (Artifact artifact : getDependencyArtifacts()) {
-            dependencyArtifactFiles.add(artifact.getFile());
-        }
-        return ImmutableSet.copyOf(dependencyArtifactFiles);
-    }
-
-    /**
-     * @throws IOException
-     */
-    ImmutableSet<File> makeThriftPathFromJars(File temporaryThriftFileDirectory, Iterable<File> classpathElementFiles)
-            throws IOException, MojoExecutionException {
-        checkNotNull(classpathElementFiles, "classpathElementFiles");
-        // clean the temporary directory to ensure that stale files aren't used
-        if (temporaryThriftFileDirectory.exists()) {
-            cleanDirectory(temporaryThriftFileDirectory);
-        }
-        Set<File> thriftDirectories = newHashSet();
-        for (File classpathElementFile : classpathElementFiles) {
-            // for some reason under IAM, we receive poms as dependent files
-            // I am excluding .xml rather than including .jar as there may be other extensions in use (sar, har, zip)
-            if (classpathElementFile.isFile() && classpathElementFile.canRead() &&
-                    !classpathElementFile.getName().endsWith(".xml")) {
-
-                // create the jar file. the constructor validates.
-                JarFile classpathJar;
-                try {
-                    classpathJar = new JarFile(classpathElementFile);
-                } catch (IOException e) {
-                    throw new IllegalArgumentException(format(
-                            "%s was not a readable artifact", classpathElementFile));
-                }
-                for (JarEntry jarEntry : list(classpathJar.entries())) {
-                    final String jarEntryName = jarEntry.getName();
-                    if (jarEntry.getName().endsWith(THRIFT_FILE_SUFFIX)) {
-                        final File uncompressedCopy =
-                                new File(new File(temporaryThriftFileDirectory,
-                                        truncatePath(classpathJar.getName())), jarEntryName);
-                        uncompressedCopy.getParentFile().mkdirs();
-                        copyStreamToFile(new RawInputStreamFacade(classpathJar
-                                .getInputStream(jarEntry)), uncompressedCopy);
-                        thriftDirectories.add(uncompressedCopy.getParentFile());
-                    }
-                }
-            } else if (classpathElementFile.isDirectory()) {
-                File[] thriftFiles = classpathElementFile.listFiles(new FilenameFilter() {
-                    public boolean accept(File dir, String name) {
-                        return name.endsWith(THRIFT_FILE_SUFFIX);
-                    }
-                });
-
-                if (thriftFiles.length > 0) {
-                    thriftDirectories.add(classpathElementFile);
-                }
-            }
-        }
-        return ImmutableSet.copyOf(thriftDirectories);
-    }
-
-    ImmutableSet<File> findThriftFilesInDirectory(File directory) throws IOException {
-        checkNotNull(directory);
-        checkArgument(directory.isDirectory(), "%s is not a directory", directory);
-        List<File> thriftFilesInDirectory = getFiles(directory, 
-        		Joiner.on(",").join(includes),
-        		Joiner.on(",").join(excludes));
-        return ImmutableSet.copyOf(thriftFilesInDirectory);
-    }
-
-    ImmutableSet<File> findThriftFilesInDirectories(Iterable<File> directories) throws IOException {
-        checkNotNull(directories);
-        Set<File> thriftFiles = newHashSet();
-        for (File directory : directories) {
-            thriftFiles.addAll(findThriftFilesInDirectory(directory));
-        }
-        return ImmutableSet.copyOf(thriftFiles);
-    }
-
-    /**
-     * Truncates the path of jar files so that they are relative to the local repository.
-     *
-     * @param jarPath the full path of a jar file.
-     * @return the truncated path relative to the local repository or root of the drive.
-     */
-    String truncatePath(final String jarPath) throws MojoExecutionException {
-
-        if (hashDependentPaths) {
-            try {
-                return toHexString(MessageDigest.getInstance("MD5").digest(jarPath.getBytes()));
-            } catch (NoSuchAlgorithmException e) {
-                throw new MojoExecutionException("Failed to expand dependent jar", e);
-            }
-        }
-
-        String repository = localRepository.getBasedir().replace('\\', '/');
-        if (!repository.endsWith("/")) {
-            repository += "/";
-        }
-
-        String path = jarPath.replace('\\', '/');
-        int repositoryIndex = path.indexOf(repository);
-        if (repositoryIndex != -1) {
-            path = path.substring(repositoryIndex + repository.length());
-        }
-
-        // By now the path should be good, but do a final check to fix windows machines.
-        int colonIndex = path.indexOf(':');
-        if (colonIndex != -1) {
-            // 2 = :\ in C:\
-            path = path.substring(colonIndex + 2);
-        }
-
-        return path;
-    }
-
-    private static final char[] HEX_CHARS = "0123456789abcdef".toCharArray();
-
-    public static String toHexString(byte[] byteArray) {
-        final StringBuilder hexString = new StringBuilder(2 * byteArray.length);
-        for (final byte b : byteArray) {
-            hexString.append(HEX_CHARS[(b & 0xF0) >> 4]).append(HEX_CHARS[b & 0x0F]);
-        }
-        return hexString.toString();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/Thrift.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/Thrift.java b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/Thrift.java
deleted file mode 100644
index 6eea954..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/Thrift.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.maven;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableSet;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-import org.codehaus.plexus.util.cli.Commandline;
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-import static com.google.common.base.Preconditions.checkState;
-import static com.google.common.collect.Lists.newLinkedList;
-import static com.google.common.collect.Sets.newHashSet;
-
-/**
- * This class represents an invokable configuration of the {@code thrift}
- * compiler. The actual executable is invoked using the plexus
- * {@link Commandline}.
- * <p/>
- * This class currently only supports generating java source files.
- */
-final class Thrift {
-
-    final static String GENERATED_JAVA = "gen-java";
-
-    private final String executable;
-    private final String generator;
-    private final ImmutableSet<File> thriftPathElements;
-    private final ImmutableSet<File> thriftFiles;
-    private final File javaOutputDirectory;
-    private final CommandLineUtils.StringStreamConsumer output;
-    private final CommandLineUtils.StringStreamConsumer error;
-
-    /**
-     * Constructs a new instance. This should only be used by the {@link Builder}.
-     *
-     * @param executable          The path to the {@code thrift} executable.
-     * @param generator           The value for the {@code --gen} option.
-     * @param thriftPath          The directories in which to search for imports.
-     * @param thriftFiles         The thrift source files to compile.
-     * @param javaOutputDirectory The directory into which the java source files
-     *                            will be generated.
-     */
-    private Thrift(String executable, String generator, ImmutableSet<File> thriftPath,
-                   ImmutableSet<File> thriftFiles, File javaOutputDirectory) {
-        this.executable = checkNotNull(executable, "executable");
-        this.generator = checkNotNull(generator, "generator");
-        this.thriftPathElements = checkNotNull(thriftPath, "thriftPath");
-        this.thriftFiles = checkNotNull(thriftFiles, "thriftFiles");
-        this.javaOutputDirectory = checkNotNull(javaOutputDirectory, "javaOutputDirectory");
-        this.error = new CommandLineUtils.StringStreamConsumer();
-        this.output = new CommandLineUtils.StringStreamConsumer();
-    }
-
-    /**
-     * Invokes the {@code thrift} compiler using the configuration specified at
-     * construction.
-     *
-     * @return The exit status of {@code thrift}.
-     * @throws CommandLineException
-     */
-    public int compile() throws CommandLineException {
-
-        for (File thriftFile : thriftFiles) {
-            Commandline cl = new Commandline();
-            cl.setExecutable(executable);
-            cl.addArguments(buildThriftCommand(thriftFile).toArray(new String[]{}));
-            final int result = CommandLineUtils.executeCommandLine(cl, null, output, error);
-
-            if (result != 0) {
-                return result;
-            }
-        }
-
-        // result will always be 0 here.
-        return 0;
-    }
-
-    /**
-     * Creates the command line arguments.
-     * <p/>
-     * This method has been made visible for testing only.
-     *
-     * @param thriftFile
-     * @return A list consisting of the executable followed by any arguments.
-     */
-    ImmutableList<String> buildThriftCommand(final File thriftFile) {
-        final List<String> command = newLinkedList();
-        // add the executable
-        for (File thriftPathElement : thriftPathElements) {
-            command.add("-I");
-            command.add(thriftPathElement.toString());
-        }
-        command.add("-out");
-        command.add(javaOutputDirectory.toString());
-        command.add("--gen");
-        command.add(generator);
-        command.add(thriftFile.toString());
-        return ImmutableList.copyOf(command);
-    }
-
-    /**
-     * @return the output
-     */
-    public String getOutput() {
-        return output.getOutput();
-    }
-
-    /**
-     * @return the error
-     */
-    public String getError() {
-        return error.getOutput();
-    }
-
-    /**
-     * This class builds {@link Thrift} instances.
-     */
-    static final class Builder {
-        private final String executable;
-        private final File javaOutputDirectory;
-        private Set<File> thriftPathElements;
-        private Set<File> thriftFiles;
-        private String generator;
-
-        /**
-         * Constructs a new builder. The two parameters are present as they are
-         * required for all {@link Thrift} instances.
-         *
-         * @param executable          The path to the {@code thrift} executable.
-         * @param javaOutputDirectory The directory into which the java source files
-         *                            will be generated.
-         * @throws NullPointerException     If either of the arguments are {@code null}.
-         * @throws IllegalArgumentException If the {@code javaOutputDirectory} is
-         *                                  not a directory.
-         */
-        public Builder(String executable, File javaOutputDirectory) {
-            this.executable = checkNotNull(executable, "executable");
-            this.javaOutputDirectory = checkNotNull(javaOutputDirectory);
-            checkArgument(javaOutputDirectory.isDirectory());
-            this.thriftFiles = newHashSet();
-            this.thriftPathElements = newHashSet();
-        }
-
-        /**
-         * Adds a thrift file to be compiled. Thrift files must be on the thriftpath
-         * and this method will fail if a thrift file is added without first adding a
-         * parent directory to the thriftpath.
-         *
-         * @param thriftFile
-         * @return The builder.
-         * @throws IllegalStateException If a thrift file is added without first
-         *                               adding a parent directory to the thriftpath.
-         * @throws NullPointerException  If {@code thriftFile} is {@code null}.
-         */
-        public Builder addThriftFile(File thriftFile) {
-            checkNotNull(thriftFile);
-            checkArgument(thriftFile.isFile());
-            checkArgument(thriftFile.getName().endsWith(".thrift"));
-            checkThriftFileIsInThriftPath(thriftFile);
-            thriftFiles.add(thriftFile);
-            return this;
-        }
-
-        /**
-         * Adds the option string for the Thrift executable's {@code --gen} parameter.
-         *
-         * @param generator
-         * @return The builder
-         * @throws NullPointerException If {@code generator} is {@code null}.
-         */
-        public Builder setGenerator(String generator) {
-            checkNotNull(generator);
-            this.generator = generator;
-            return this;
-        }
-
-        private void checkThriftFileIsInThriftPath(File thriftFile) {
-            assert thriftFile.isFile();
-            checkState(checkThriftFileIsInThriftPathHelper(thriftFile.getParentFile()));
-        }
-
-        private boolean checkThriftFileIsInThriftPathHelper(File directory) {
-            assert directory.isDirectory();
-            if (thriftPathElements.contains(directory)) {
-                return true;
-            } else {
-                final File parentDirectory = directory.getParentFile();
-                return (parentDirectory == null) ? false
-                        : checkThriftFileIsInThriftPathHelper(parentDirectory);
-            }
-        }
-
-        /**
-         * @see #addThriftFile(File)
-         */
-        public Builder addThriftFiles(Iterable<File> thriftFiles) {
-            for (File thriftFile : thriftFiles) {
-                addThriftFile(thriftFile);
-            }
-            return this;
-        }
-
-        /**
-         * Adds the {@code thriftPathElement} to the thriftPath.
-         *
-         * @param thriftPathElement A directory to be searched for imported thrift message
-         *                          buffer definitions.
-         * @return The builder.
-         * @throws NullPointerException     If {@code thriftPathElement} is {@code null}.
-         * @throws IllegalArgumentException If {@code thriftPathElement} is not a
-         *                                  directory.
-         */
-        public Builder addThriftPathElement(File thriftPathElement) {
-            checkNotNull(thriftPathElement);
-            checkArgument(thriftPathElement.isDirectory());
-            thriftPathElements.add(thriftPathElement);
-            return this;
-        }
-
-        /**
-         * @see #addThriftPathElement(File)
-         */
-        public Builder addThriftPathElements(Iterable<File> thriftPathElements) {
-            for (File thriftPathElement : thriftPathElements) {
-                addThriftPathElement(thriftPathElement);
-            }
-            return this;
-        }
-
-        /**
-         * @return A configured {@link Thrift} instance.
-         * @throws IllegalStateException If no thrift files have been added.
-         */
-        public Thrift build() {
-            checkState(!thriftFiles.isEmpty());
-            return new Thrift(executable, generator, ImmutableSet.copyOf(thriftPathElements),
-                    ImmutableSet.copyOf(thriftFiles), javaOutputDirectory);
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftCompileMojo.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftCompileMojo.java b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftCompileMojo.java
deleted file mode 100644
index b4f7571..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftCompileMojo.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.maven;
-
-import java.io.File;
-import java.util.List;
-import org.apache.maven.artifact.Artifact;
-import com.google.common.collect.ImmutableList;
-
-/**
- * This mojo executes the {@code thrift} compiler for generating java sources
- * from thrift definitions. It also searches dependency artifacts for
- * thrift files and includes them in the thriftPath so that they can be
- * referenced. Finally, it adds the thrift files to the project as resources so
- * that they are included in the final artifact.
- *
- * @phase generate-sources
- * @goal compile
- * @requiresDependencyResolution compile
- */
-public final class ThriftCompileMojo extends AbstractThriftMojo {
-
-    /**
-     * The source directories containing the sources to be compiled.
-     *
-     * @parameter default-value="${basedir}/src/main/thrift"
-     * @required
-     */
-    private File thriftSourceRoot;
-
-    /**
-     * This is the directory into which the {@code .java} will be created.
-     *
-     * @parameter default-value="${project.build.directory}/generated-sources/thrift"
-     * @required
-     */
-    private File outputDirectory;
-
-    @Override
-    protected List<Artifact> getDependencyArtifacts() {
-        List<Artifact> compileArtifacts = project.getCompileArtifacts();
-        return compileArtifacts;
-    }
-
-    @Override
-    protected File getOutputDirectory() {
-        return outputDirectory;
-    }
-
-    @Override
-    protected File getThriftSourceRoot() {
-        return thriftSourceRoot;
-    }
-
-    @Override
-    protected void attachFiles() {
-        project.addCompileSourceRoot(outputDirectory.getAbsolutePath());
-        projectHelper.addResource(project, thriftSourceRoot.getAbsolutePath(),
-        		ImmutableList.of("**/*.thrift"), null);
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftTestCompileMojo.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftTestCompileMojo.java b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftTestCompileMojo.java
deleted file mode 100644
index fb89d96..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/main/java/org/apache/thrift/maven/ThriftTestCompileMojo.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.maven;
-
-import java.io.File;
-import java.util.List;
-import org.apache.maven.artifact.Artifact;
-import com.google.common.collect.ImmutableList;
-
-/**
- * @phase generate-test-sources
- * @goal testCompile
- * @requiresDependencyResolution test
- */
-public final class ThriftTestCompileMojo extends AbstractThriftMojo {
-
-    /**
-     * The source directories containing the sources to be compiled.
-     *
-     * @parameter default-value="${basedir}/src/test/thrift"
-     * @required
-     */
-    private File thriftTestSourceRoot;
-
-    /**
-     * This is the directory into which the {@code .java} will be created.
-     *
-     * @parameter default-value="${project.build.directory}/generated-test-sources/thrift"
-     * @required
-     */
-    private File outputDirectory;
-
-    @Override
-    protected void attachFiles() {
-        project.addTestCompileSourceRoot(outputDirectory.getAbsolutePath());
-        projectHelper.addTestResource(project, thriftTestSourceRoot.getAbsolutePath(),
-        		ImmutableList.of("**/*.thrift"), null);
-    }
-
-    @Override
-    protected List<Artifact> getDependencyArtifacts() {
-        // TODO(gak): maven-project needs generics
-        @SuppressWarnings("unchecked")
-        List<Artifact> testArtifacts = project.getTestArtifacts();
-        return testArtifacts;
-    }
-
-    @Override
-    protected File getOutputDirectory() {
-        return outputDirectory;
-    }
-
-    @Override
-    protected File getThriftSourceRoot() {
-        return thriftTestSourceRoot;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestThrift.java
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestThrift.java b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestThrift.java
deleted file mode 100644
index 3ecd094..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/java/org/apache/thrift/maven/TestThrift.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.thrift.maven;
-
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-
-import java.io.File;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-public class TestThrift {
-
-    private File testRootDir;
-    private File idlDir;
-    private File genJavaDir;
-    private Thrift.Builder builder;
-
-    @Before
-    public void setup() throws Exception {
-        final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
-        testRootDir = new File(tmpDir, "thrift-test");
-
-        if (testRootDir.exists()) {
-            FileUtils.cleanDirectory(testRootDir);
-        } else {
-            assertTrue("Failed to create output directory for test: " + testRootDir.getPath(), testRootDir.mkdir());
-        }
-
-        File testResourceDir = new File("src/test/resources");
-        assertTrue("Unable to find test resources", testRootDir.exists());
-
-        String thriftExecutable = System.getProperty("thriftExecutable", "thrift");
-        if (!(new File(thriftExecutable).exists())) {
-            thriftExecutable = "thrift";
-        }
-        System.out.println("Thrift compiler: " + thriftExecutable);
-
-        idlDir = new File(testResourceDir, "idl");
-        genJavaDir = new File(testRootDir, Thrift.GENERATED_JAVA);
-        builder = new Thrift.Builder(thriftExecutable, testRootDir);
-        builder
-            .setGenerator("java")
-            .addThriftPathElement(idlDir);
-    }
-
-    @Test
-    public void testThriftCompile() throws Exception {
-        executeThriftCompile();
-    }
-
-    @Test
-    public void testThriftCompileWithGeneratorOption() throws Exception {
-        builder.setGenerator("java:private-members,hashcode");
-        executeThriftCompile();
-    }
-
-    private void executeThriftCompile() throws CommandLineException {
-        final File thriftFile = new File(idlDir, "shared.thrift");
-
-        builder.addThriftFile(thriftFile);
-
-        final Thrift thrift = builder.build();
-
-        assertTrue("File not found: shared.thrift", thriftFile.exists());
-        assertFalse("gen-java directory should not exist", genJavaDir.exists());
-
-        // execute the compile
-        final int result = thrift.compile();
-        assertEquals(0, result);
-
-        assertFalse("gen-java directory was not removed", genJavaDir.exists());
-        assertTrue("generated java code doesn't exist",
-            new File(testRootDir, "shared/SharedService.java").exists());
-    }
-
-    @Test
-    public void testThriftMultipleFileCompile() throws Exception {
-        final File sharedThrift = new File(idlDir, "shared.thrift");
-        final File tutorialThrift = new File(idlDir, "tutorial.thrift");
-
-        builder.addThriftFile(sharedThrift);
-        builder.addThriftFile(tutorialThrift);
-
-        final Thrift thrift = builder.build();
-
-        assertTrue("File not found: shared.thrift", sharedThrift.exists());
-        assertFalse("gen-java directory should not exist", genJavaDir.exists());
-
-        // execute the compile
-        final int result = thrift.compile();
-        assertEquals(0, result);
-
-        assertFalse("gen-java directory was not removed", genJavaDir.exists());
-        assertTrue("generated java code doesn't exist",
-            new File(testRootDir, "shared/SharedService.java").exists());
-        assertTrue("generated java code doesn't exist",
-            new File(testRootDir, "tutorial/InvalidOperation.java").exists());
-    }
-
-    @Test
-    public void testBadCompile() throws Exception {
-        final File thriftFile = new File(testRootDir, "missing.thrift");
-        builder.addThriftPathElement(testRootDir);
-
-        // Hacking around checks in addThrift file.
-        assertTrue(thriftFile.createNewFile());
-        builder.addThriftFile(thriftFile);
-        assertTrue(thriftFile.delete());
-
-        final Thrift thrift = builder.build();
-
-        assertTrue(!thriftFile.exists());
-        assertFalse("gen-java directory should not exist", genJavaDir.exists());
-
-        // execute the compile
-        final int result = thrift.compile();
-        assertEquals(1, result);
-    }
-
-    @Test
-    public void testFileInPathPreCondition() throws Exception {
-        final File thriftFile = new File(testRootDir, "missing.thrift");
-
-        // Hacking around checks in addThrift file.
-        assertTrue(thriftFile.createNewFile());
-        try {
-            builder.addThriftFile(thriftFile);
-            fail("Expected IllegalStateException");
-        } catch (IllegalStateException e) {
-        }
-    }
-
-    @After
-    public void cleanup() throws Exception {
-        if (testRootDir.exists()) {
-            FileUtils.cleanDirectory(testRootDir);
-            assertTrue("Failed to delete output directory for test: " + testRootDir.getPath(), testRootDir.delete());
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/shared.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/shared.thrift b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/shared.thrift
deleted file mode 100644
index 475e7f8..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/shared.thrift
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * This Thrift file can be included by other Thrift files that want to share
- * these definitions.
- */
-
-namespace cpp shared
-namespace java shared
-namespace perl shared
-
-struct SharedStruct {
-  1: i32 key
-  2: string value
-}
-
-service SharedService {
-  SharedStruct getStruct(1: i32 key)
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/tutorial.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/tutorial.thrift b/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/tutorial.thrift
deleted file mode 100644
index 86e433d..0000000
--- a/depends/thirdparty/thrift/contrib/thrift-maven-plugin/src/test/resources/idl/tutorial.thrift
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-# Thrift Tutorial
-# Mark Slee (mcslee@facebook.com)
-#
-# This file aims to teach you how to use Thrift, in a .thrift file. Neato. The
-# first thing to notice is that .thrift files support standard shell comments.
-# This lets you make your thrift file executable and include your Thrift build
-# step on the top line. And you can place comments like this anywhere you like.
-#
-# Before running this file, you will need to have installed the thrift compiler
-# into /usr/local/bin.
-
-/**
- * The first thing to know about are types. The available types in Thrift are:
- *
- *  bool        Boolean, one byte
- *  byte        Signed byte
- *  i16         Signed 16-bit integer
- *  i32         Signed 32-bit integer
- *  i64         Signed 64-bit integer
- *  double      64-bit floating point value
- *  string      String
- *  binary      Blob (byte array)
- *  map<t1,t2>  Map from one type to another
- *  list<t1>    Ordered list of one type
- *  set<t1>     Set of unique elements of one type
- *
- * Did you also notice that Thrift supports C style comments?
- */
-
-// Just in case you were wondering... yes. We support simple C comments too.
-
-/**
- * Thrift files can reference other Thrift files to include common struct
- * and service definitions. These are found using the current path, or by
- * searching relative to any paths specified with the -I compiler flag.
- *
- * Included objects are accessed using the name of the .thrift file as a
- * prefix. i.e. shared.SharedObject
- */
-include "shared.thrift"
-
-/**
- * Thrift files can namespace, package, or prefix their output in various
- * target languages.
- */
-namespace cpp tutorial
-namespace java tutorial
-namespace php tutorial
-namespace perl tutorial
-namespace smalltalk.category Thrift.Tutorial
-
-/**
- * Thrift lets you do typedefs to get pretty names for your types. Standard
- * C style here.
- */
-typedef i32 MyInteger
-
-/**
- * Thrift also lets you define constants for use across languages. Complex
- * types and structs are specified using JSON notation.
- */
-const i32 INT32CONSTANT = 9853
-const map<string,string> MAPCONSTANT = {'hello':'world', 'goodnight':'moon'}
-
-/**
- * You can define enums, which are just 32 bit integers. Values are optional
- * and start at 1 if not supplied, C style again.
- */
-enum Operation {
-  ADD = 1,
-  SUBTRACT = 2,
-  MULTIPLY = 3,
-  DIVIDE = 4
-}
-
-/**
- * Structs are the basic complex data structures. They are comprised of fields
- * which each have an integer identifier, a type, a symbolic name, and an
- * optional default value.
- *
- * Fields can be declared "optional", which ensures they will not be included
- * in the serialized output if they aren't set.  Note that this requires some
- * manual management in some languages.
- */
-struct Work {
-  1: i32 num1 = 0,
-  2: i32 num2,
-  3: Operation op,
-  4: optional string comment,
-}
-
-/**
- * Structs can also be exceptions, if they are nasty.
- */
-exception InvalidOperation {
-  1: i32 what,
-  2: string why
-}
-
-/**
- * Ahh, now onto the cool part, defining a service. Services just need a name
- * and can optionally inherit from another service using the extends keyword.
- */
-service Calculator extends shared.SharedService {
-
-  /**
-   * A method definition looks like C code. It has a return type, arguments,
-   * and optionally a list of exceptions that it may throw. Note that argument
-   * lists and exception lists are specified using the exact same syntax as
-   * field lists in struct or exception definitions.
-   */
-
-   void ping(),
-
-   i32 add(1:i32 num1, 2:i32 num2),
-
-   i32 calculate(1:i32 logid, 2:Work w) throws (1:InvalidOperation ouch),
-
-   /**
-    * This method has a oneway modifier. That means the client only makes
-    * a request and does not listen for any response at all. Oneway methods
-    * must be void.
-    */
-   oneway void zip()
-
-}
-
-/**
- * That just about covers the basics. Take a look in the test/ folder for more
- * detailed examples. After you run this file, your generated code shows up
- * in folders with names gen-<language>. The generated code isn't too scary
- * to look at. It even has pretty indentation.
- */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift.el
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift.el b/depends/thirdparty/thrift/contrib/thrift.el
deleted file mode 100644
index 941a99f..0000000
--- a/depends/thirdparty/thrift/contrib/thrift.el
+++ /dev/null
@@ -1,140 +0,0 @@
-;;; thrift.el --- Major mode for Apache Thrift files
-
-;; Keywords: files
-
-;; Licensed to the Apache Software Foundation (ASF) under one
-;; or more contributor license agreements. See the NOTICE file
-;; distributed with this work for additional information
-;; regarding copyright ownership. The ASF licenses this file
-;; to you under the Apache License, Version 2.0 (the
-;; "License"); you may not use this file except in compliance
-;; with the License. You may obtain a copy of the License at
-;;
-;;   http://www.apache.org/licenses/LICENSE-2.0
-;;
-;; Unless required by applicable law or agreed to in writing,
-;; software distributed under the License is distributed on an
-;; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-;; KIND, either express or implied. See the License for the
-;; specific language governing permissions and limitations
-;; under the License.
-;;
-
-;;; Commentary:
-
-;;
-
-;;; Code:
-
-(require 'font-lock)
-
-(defvar thrift-mode-hook nil)
-;;;###autoload
-(add-to-list 'auto-mode-alist '("\\.thrift\\'" . thrift-mode))
-
-(defvar thrift-indent-level 2
-  "Defines 2 spaces for thrift indentation.")
-
-;; syntax coloring
-(defconst thrift-font-lock-keywords
-  (list
-   '("\\<\\(include\\|struct\\|exception\\|typedef\\|const\\|enum\\|service\\|extends\\|void\\|oneway\\|throws\\|optional\\|required\\)\\>" . font-lock-keyword-face)  ;; keywords
-   '("\\<\\(bool\\|byte\\|i16\\|i32\\|i64\\|double\\|string\\|binary\\|map\\|list\\|set\\)\\>" . font-lock-type-face)  ;; built-in types
-   '("\\<\\([0-9]+\\)\\>" . font-lock-variable-name-face)   ;; ordinals
-   '("\\<\\(\\w+\\)\\s-*(" (1 font-lock-function-name-face))  ;; functions
-   )
-  "Thrift Keywords.")
-
-;; indentation
-(defun thrift-indent-line ()
-  "Indent current line as Thrift code."
-  (interactive)
-  (beginning-of-line)
-  (if (bobp)
-      (indent-line-to 0)
-    (let ((not-indented t) cur-indent)
-      (if (looking-at "^[ \t]*\\(}\\|throws\\)")
-          (if (looking-at "^[ \t]*}")
-              (progn
-                (save-excursion
-                  (forward-line -1)
-                  (setq cur-indent (- (current-indentation) thrift-indent-level)))
-                (if (< cur-indent 0)
-                    (setq cur-indent 0)))
-            (progn
-              (save-excursion
-                (forward-line -1)
-                (if (looking-at "^[ \t]*[\\.<>[:word:]]+[ \t]+[\\.<>[:word:]]+[ \t]*(")
-                    (setq cur-indent (+ (current-indentation) thrift-indent-level))
-                  (setq cur-indent (current-indentation))))))
-        (save-excursion
-          (while not-indented
-            (forward-line -1)
-            (if (looking-at "^[ \t]*}")
-                (progn
-                  (setq cur-indent (current-indentation))
-                  (setq not-indented nil))
-              (if (looking-at "^.*{[^}]*$")
-                  (progn
-                    (setq cur-indent (+ (current-indentation) thrift-indent-level))
-                    (setq not-indented nil))
-                (if (bobp)
-                    (setq not-indented nil)))
-              (if (looking-at "^[ \t]*throws")
-                  (progn
-                    (setq cur-indent (- (current-indentation) thrift-indent-level))
-                    (if (< cur-indent 0)
-                        (setq cur-indent 0))
-                    (setq not-indented nil))
-                (if (bobp)
-                    (setq not-indented nil)))
-              (if (looking-at "^[ \t]*[\\.<>[:word:]]+[ \t]+[\\.<>[:word:]]+[ \t]*([^)]*$")
-                  (progn
-                    (setq cur-indent (+ (current-indentation) thrift-indent-level))
-                    (setq not-indented nil))
-                (if (bobp)
-                    (setq not-indented nil)))
-              (if (looking-at "^[ \t]*\\/\\*")
-                  (progn
-                    (setq cur-indent (+ (current-indentation) 1))
-                    (setq not-indented nil))
-                (if (bobp)
-                    (setq not-indented nil)))
-              (if (looking-at "^[ \t]*\\*\\/")
-                  (progn
-                    (setq cur-indent (- (current-indentation) 1))
-                    (setq not-indented nil))
-                (if (bobp)
-                    (setq not-indented nil)))
-              ))))
-      (if cur-indent
-          (indent-line-to cur-indent)
-        (indent-line-to 0)))))
-
-;; C/C++- and sh-style comments; also allowing underscore in words
-(defvar thrift-mode-syntax-table
-  (let ((thrift-mode-syntax-table (make-syntax-table)))
-    (modify-syntax-entry ?_ "w" thrift-mode-syntax-table)
-    (modify-syntax-entry ?# "<" thrift-mode-syntax-table) ; sh-style comments
-    (modify-syntax-entry ?/ ". 124" thrift-mode-syntax-table) ; c/c++-style comments
-    (modify-syntax-entry ?* ". 23b" thrift-mode-syntax-table)
-    (modify-syntax-entry ?\n ">" thrift-mode-syntax-table)
-    thrift-mode-syntax-table)
-  "Syntax table for thrift-mode")
-
-;;;###autoload
-(defun thrift-mode ()
-  "Mode for editing Thrift files."
-  (interactive)
-  (kill-all-local-variables)
-  (set-syntax-table thrift-mode-syntax-table)
-  (set (make-local-variable 'font-lock-defaults) '(thrift-font-lock-keywords))
-  (setq major-mode 'thrift-mode)
-  (setq mode-name "Thrift")
-  (run-hooks 'thrift-mode-hook)
-  (set (make-local-variable 'indent-line-function) 'thrift-indent-line)
-  )
-
-(provide 'thrift)
-;;; thrift.el ends here
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift.spec
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift.spec b/depends/thirdparty/thrift/contrib/thrift.spec
deleted file mode 100644
index dab3275..0000000
--- a/depends/thirdparty/thrift/contrib/thrift.spec
+++ /dev/null
@@ -1,238 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-%define without_java 1
-%define without_python 1
-%define without_tests 1
-
-%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-
-Name:           thrift
-License:        Apache License v2.0
-Group:          Development
-Summary:        RPC and serialization framework
-Version:        0.9.3
-Release:        0
-URL:            http://thrift.apache.org
-Packager:       Thrift Developers <de...@thrift.apache.org>
-Source0:        %{name}-%{version}.tar.gz
-
-BuildRequires:  gcc >= 3.4.6
-BuildRequires:  gcc-c++
-
-%if 0%{!?without_java:1}
-BuildRequires:  java-devel >= 0:1.5.0
-BuildRequires:  ant >= 0:1.6.5
-%endif
-
-%if 0%{!?without_python:1}
-BuildRequires:  python-devel
-%endif
-
-%if 0%{!?without_ruby:1}
-%define gem_name %{name}
-BuildRequires:  ruby-devel
-BuildRequires:  rubygems-devel
-%endif
-
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-%description
-Thrift is a software framework for scalable cross-language services
-development. It combines a powerful software stack with a code generation
-engine to build services that work efficiently and seamlessly between C++,
-Java, C#, Python, Ruby, Perl, PHP, Objective C/Cocoa, Smalltalk, Erlang,
-Objective Caml, and Haskell.
-
-%files
-%defattr(-,root,root)
-%{_bindir}/thrift
-
-
-%package lib-cpp
-Summary: Thrift C++ library
-Group:   Libraries
-
-%description lib-cpp
-C++ libraries for Thrift.
-
-%files lib-cpp
-%defattr(-,root,root)
-%{_libdir}/libthrift*.so.*
-%{_libdir}/libthrift*.so
-
-
-%package lib-cpp-devel
-Summary:   Thrift C++ library development files
-Group:     Libraries
-Requires:  %{name} = %{version}-%{release}
-Requires:  boost-devel
-%if 0%{!?without_libevent:1}
-Requires:  libevent-devel >= 1.2
-%endif
-%if 0%{!?without_zlib:1}
-Requires:  zlib-devel
-%endif
-
-%description lib-cpp-devel
-C++ static libraries and headers for Thrift.
-
-%files lib-cpp-devel
-%defattr(-,root,root)
-%{_includedir}/thrift/
-%{_libdir}/libthrift*.*a
-%{_libdir}/pkgconfig/thrift*.pc
-
-
-%if 0%{!?without_java:1}
-%package lib-java
-Summary:   Thrift Java library
-Group:     Libraries
-Requires:  java >= 0:1.5.0
-
-%description lib-java
-Java libraries for Thrift.
-
-%files lib-java
-%defattr(-,root,root)
-%{_javadir}/*
-%endif
-
-
-%if 0%{!?without_python:1}
-%package lib-python
-Summary: Thrift Python library
-Group:   Libraries
-
-%description lib-python
-Python libraries for Thrift.
-
-%files lib-python
-%defattr(-,root,root)
-%{python_sitearch}/*
-%endif
-
-
-%if 0%{!?without_ruby:1}
-%package -n rubygem-%{gem_name}
-Summary: Thrift Ruby library
-Group:   Libraries
-Obsoletes: %{name}-lib-ruby
-
-%description -n rubygem-%{gem_name}
-Ruby libraries for Thrift.
-
-%files -n rubygem-%{gem_name}
-%defattr(-,root,root)
-%{gem_dir}/*
-%endif
-
-
-%if 0%{!?without_php:1}
-%package lib-php
-Summary: Thrift PHP library
-Group:   Libraries
-
-%description lib-php
-PHP libraries for Thrift.
-
-%files lib-php
-%defattr(-,root,root)
-/usr/lib/php/*
-%endif
-
-
-%prep
-%setup -q
-
-%build
-[[ -e Makefile.in ]] || ./bootstrap.sh
-export GEM_HOME=${PWD}/.gem-home
-export RUBYLIB=${PWD}/lib/rb/lib
-%configure \
-  %{?without_libevent: --without-libevent } \
-  %{?without_zlib:     --without-zlib     } \
-  %{?without_tests:    --without-tests    } \
-  %{?without_java:     --without-java     } \
-  %{?without_python:   --without-python   } \
-  %{?without_ruby:     --without-ruby     } \
-  %{?without_php:      --without-php      } \
-  %{!?without_php:     PHP_PREFIX=${RPM_BUILD_ROOT}/usr/lib/php } \
-  --without-csharp \
-  --without-erlang \
-
-make %{?_smp_mflags}
-
-%if 0%{!?without_java:1}
-cd lib/java
-%ant
-cd ../..
-%endif
-
-%if 0%{!?without_python:1}
-cd lib/py
-CFLAGS="%{optflags}" %{__python} setup.py build
-cd ../..
-%endif
-
-%if 0%{!?without_ruby:1}
-%gem_install -n lib/rb/thrift*.gem
-%endif
-
-%install
-export GEM_HOME=${PWD}/.gem-home
-export RUBYLIB=${PWD}/lib/rb/lib
-%makeinstall
-ln -s libthrift-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthrift.so.0
-ln -s libthriftnb-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftnb.so.0
-ln -s libthriftz-%{version}.so ${RPM_BUILD_ROOT}%{_libdir}/libthriftz.so.0
-
-%if 0%{!?without_java:1}
-mkdir -p $RPM_BUILD_ROOT%{_javadir}
-cp -p lib/java/build/*.jar $RPM_BUILD_ROOT%{_javadir}
-%endif
-
-%if 0%{!?without_python:1}
-cd lib/py
-%{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT
-cd ../..
-%endif
-
-%if 0%{!?without_ruby:1}
-mkdir -p %{buildroot}%{gem_dir}
-cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
-%endif
-
-%clean
-rm -rf ${RPM_BUILD_ROOT}
-
-
-%post
-umask 007
-/sbin/ldconfig > /dev/null 2>&1
-
-
-%postun
-umask 007
-/sbin/ldconfig > /dev/null 2>&1
-
-%changelog
-* Wed Sept 25 2015 Thrift Dev <de...@thrift.apache.org>
-- Thrift 0.9.3 release.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift.vim
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift.vim b/depends/thirdparty/thrift/contrib/thrift.vim
deleted file mode 100644
index 3000b46..0000000
--- a/depends/thirdparty/thrift/contrib/thrift.vim
+++ /dev/null
@@ -1,91 +0,0 @@
-" Vim syntax file
-" Language: Thrift
-" Maintainer: Martin Smith <ma...@facebook.com>
-" Last Change: $Date: $
-" Copy to ~/.vim/
-" Add to ~/.vimrc
-"  au BufRead,BufNewFile *.thrift set filetype=thrift
-"  au! Syntax thrift source ~/.vim/thrift.vim
-"
-" $Id: $
-"
-" Licensed to the Apache Software Foundation (ASF) under one
-" or more contributor license agreements. See the NOTICE file
-" distributed with this work for additional information
-" regarding copyright ownership. The ASF licenses this file
-" to you under the Apache License, Version 2.0 (the
-" "License"); you may not use this file except in compliance
-" with the License. You may obtain a copy of the License at
-"
-"   http://www.apache.org/licenses/LICENSE-2.0
-"
-" Unless required by applicable law or agreed to in writing,
-" software distributed under the License is distributed on an
-" "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-" KIND, either express or implied. See the License for the
-" specific language governing permissions and limitations
-" under the License.
-"
-
-if version < 600
-  syntax clear
-elseif exists("b:current_syntax")
-  finish
-endif
-
-" Todo
-syn keyword thriftTodo TODO todo FIXME fixme XXX xxx contained
-
-" Comments
-syn match thriftComment "#.*" contains=thriftTodo
-syn region thriftComment start="/\*" end="\*/" contains=thriftTodo
-syn match thriftComment "//.\{-}\(?>\|$\)\@="
-
-" String
-syn region thriftStringDouble matchgroup=None start=+"+  end=+"+
-
-" Number
-syn match thriftNumber "-\=\<\d\+\>" contained
-
-" Keywords
-syn keyword thriftKeyword namespace
-syn keyword thriftKeyword xsd_all xsd_optional xsd_nillable xsd_attrs
-syn keyword thriftKeyword include cpp_include cpp_type const optional required
-syn keyword thriftBasicTypes void bool byte i16 i32 i64 double string binary
-syn keyword thriftStructure map list set struct typedef exception enum throws union
-
-" Special
-syn match thriftSpecial "\d\+:"
-
-" Structure
-syn keyword thriftStructure service oneway extends
-"async"         { return tok_async;         }
-"exception"     { return tok_xception;      }
-"extends"       { return tok_extends;       }
-"throws"        { return tok_throws;        }
-"service"       { return tok_service;       }
-"enum"          { return tok_enum;          }
-"const"         { return tok_const;         }
-
-if version >= 508 || !exists("did_thrift_syn_inits")
-  if version < 508
-    let did_thrift_syn_inits = 1
-    command! -nargs=+ HiLink hi link <args>
-  else
-    command! -nargs=+ HiLink hi def link <args>
-  endif
-
-  HiLink thriftComment Comment
-  HiLink thriftKeyword Special
-  HiLink thriftBasicTypes Type
-  HiLink thriftStructure StorageClass
-  HiLink thriftTodo Todo
-  HiLink thriftString String
-  HiLink thriftNumber Number
-  HiLink thriftSpecial Special
-  HiLink thriftStructure Structure
-
-  delcommand HiLink
-endif
-
-let b:current_syntax = "thrift"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/thrift_dump.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/thrift_dump.cpp b/depends/thirdparty/thrift/contrib/thrift_dump.cpp
deleted file mode 100644
index 59c8ac8..0000000
--- a/depends/thirdparty/thrift/contrib/thrift_dump.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <cstdlib>
-#include <iostream>
-
-#include <thrift/transport/TBufferTransports.h>
-#include <thrift/transport/TFDTransport.h>
-#include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/protocol/TDebugProtocol.h>
-#include <thrift/protocol/TProtocolTap.h>
-
-using namespace std;
-using boost::shared_ptr;
-using namespace apache::thrift::transport;
-using namespace apache::thrift::protocol;
-
-void usage() {
-  fprintf(stderr,
-      "usage: thrift_dump {-b|-f|-s} < input > ouput\n"
-      "  -b TBufferedTransport messages\n"
-      "  -f TFramedTransport messages\n"
-      "  -s Raw structures\n");
-  exit(EXIT_FAILURE);
-}
-
-int main(int argc, char *argv[]) {
-  if (argc != 2) {
-    usage();
-  }
-
-  shared_ptr<TTransport> stdin_trans(new TFDTransport(STDIN_FILENO));
-  shared_ptr<TTransport> itrans;
-
-  if (argv[1] == std::string("-b") || argv[1] == std::string("-s")) {
-    itrans.reset(new TBufferedTransport(stdin_trans));
-  } else if (argv[1] == std::string("-f")) {
-    itrans.reset(new TFramedTransport(stdin_trans));
-  } else {
-    usage();
-  }
-
-  shared_ptr<TProtocol> iprot(new TBinaryProtocol(itrans));
-  shared_ptr<TProtocol> oprot(
-      new TDebugProtocol(
-        shared_ptr<TTransport>(new TBufferedTransport(
-          shared_ptr<TTransport>(new TFDTransport(STDOUT_FILENO))))));
-
-  TProtocolTap tap(iprot, oprot);
-
-  try {
-    if (argv[1] == std::string("-s")) {
-      for (;;) {
-        tap.skip(T_STRUCT);
-      }
-    } else {
-      std::string name;
-      TMessageType messageType;
-      int32_t seqid;
-      for (;;) {
-        tap.readMessageBegin(name, messageType, seqid);
-        tap.skip(T_STRUCT);
-        tap.readMessageEnd();
-      }
-    }
-  } catch (TProtocolException exn) {
-    cout << "Protocol Exception: " << exn.what() << endl;
-  } catch (...) {
-    oprot->getTransport()->flush();
-  }
-
-  cout << endl;
-
-  return 0;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/README.md b/depends/thirdparty/thrift/contrib/transport-sample/README.md
deleted file mode 100644
index a1dfc0a..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/README.md
+++ /dev/null
@@ -1,61 +0,0 @@
-Thrift transport sample project
--------------------------------
-
-This cross-platform project has been built with Windows Visual Studio 10 and 
-OSX 10.7.1's g++.  The client and server support socket and pipe transports 
-through command-line switches.
-
-Windows supports both named & anonymous pipes; *NIX gets only named 
-'pipes' at this time.
-
-Windows-only at this time:
-The client & server are double-ended. Both sides run a server and client to 
-enable full duplex bidirectional event signaling. They are simple command 
-line apps. The server runs until it's aborted (Ctl-C). The client connects to
-the server, informs the server of its listening pipe/port, runs some more RPCs 
-and exits. The server also makes RPC calls to the client to demonstrate 
-bidirectional operation.
-
-Prequisites:
-Boost -- tested with Boost 1.47, other versions may work.
-libthrift library -- build the library under "thrift/lib/cpp/"
-thrift IDL compiler -- download from http://thrift.apache.org/download/ 
-   or build from "thrift/compiler/cpp".  The IDL compiler version should
-   match the thrift source distribution's version. For instance, thrift-0.9.0
-   has a different directory structure than thrift-0.8.0 and the generated
-   files are not compatible.
-
-Note: Bulding the thrift IDL compiler and library are beyond the scope
-of this article. Please refer to the Thrift documentation in the respective
-directories and online.
-
-
-Microsoft Windows with Visual Studio 10
-----------------------------------------
-Copy the IDL compiler 'thrift.exe' to this project folder or to a location in the path.
-Run thriftme.bat to generate the interface source from the thrift files.
-
-Open transport-sample.sln and...
-Adapt the Boost paths for the client and server projects. Right-click on each project, select
-Properties, then:
-Configuration Properties -> C/C++ -> General -> Additional Include Directories
-Configuration Properties -> Linker -> General -> Additional Include Directories
-
-The stock path assumes that Boost is located at the same level as the thrift repo root.
-
-Run the following in separate command prompts from the Release or Debug 
-build folder:
- server.exe -np test
- client.exe -np test
-
-
-*NIX flavors
-------------
-Build the thrift cpp library.
-Build the IDL compiler and copy it to this project folder.
-Run thriftme.sh to generate the interface source from the thrift files.
-Run 'make'
-
-Run the following in separate shells:
- server/server -np /tmp/test
- client/client -np /tmp/test

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/Sample.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/Sample.thrift b/depends/thirdparty/thrift/contrib/transport-sample/Sample.thrift
deleted file mode 100644
index 3040e25..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/Sample.thrift
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- transport-sample thrift IDL file .
- Execute thriftme.bat under Windows to generate the cpp stubs from this IDL.
- */
-
-// See thrift/tutorial/tutorial.thrift and shared.thrift for more extensive examples.
-
-
-namespace cpp Sample
-namespace java Sample
-namespace perl Sample
-
-//This struct is not used in the sample. Shown here for illustrative purposes only.
-//
-struct SampleStruct
-{
-  1: i32 key
-  2: string value
-}
-
-
-//A service contains the RPC(s).
-//
-service SampleService
-{
-  string HelloThere(1:string HelloString),
-  void ServerDoSomething(),
-
-  //Client calls this to tell server which port to connect back on.
-  void ClientSideListenPort(1:i16 Port),
-  //Named pipe version
-  void ClientSidePipeName(1:string name),
-}
-
-//Sample RPC on the 'client' side that the master server can call.
-service SampleCallback
-{
-  void pingclient(),
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.cpp b/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.cpp
deleted file mode 100644
index 60ebf7a..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-// ThriftCommon.cpp : Common functions for sample Thrift client and server
-//
-
-#include "ThriftCommon.h"
-
-namespace thriftcommon
-{
-	//----------------------------------------------------------------------------
-	//Launch child process and pass R/W anonymous pipe handles on cmd line.
-	//This is a simple example and does not include elevation or other 
-	//advanced features.
-	//
-	bool LaunchAnonPipeChild(std::string app, boost::shared_ptr<TServerTransport> transport)
-	{
-#ifdef _WIN32
-		PROCESS_INFORMATION pi;
-		STARTUPINFOA si;
-		GetStartupInfoA(&si);  //set startupinfo for the spawned process
-		char handles[MAX_PATH];  //Stores pipe handles converted to text
-
-		sprintf(handles, "%s %d %d", app.c_str(),
-			(int)boost::shared_dynamic_cast<TPipeServer>(transport)->getClientRdPipeHandle(),
-			(int)boost::shared_dynamic_cast<TPipeServer>(transport)->getClientWrtPipeHandle());
-
-		//spawn the child process
-		if (!CreateProcessA(NULL, handles, NULL,NULL,TRUE,0,NULL,NULL,&si,&pi))
-		{
-			GlobalOutput.perror("TPipeServer CreateProcess failed, GLE=", GetLastError());
-			return false;
-		}
-
-		CloseHandle(pi.hThread);
-		CloseHandle(pi.hProcess);
-#endif
-		return true;
-	}
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.h b/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.h
deleted file mode 100644
index d24d1a7..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/ThriftCommon.h
+++ /dev/null
@@ -1,207 +0,0 @@
-// ThriftCommon.h : Common includes, namespaces and templates 
-// for sample Thrift client and server
-//
-// Add the following paths to the Project's properties:
-//
-// Configuration Properties -> C/C++ -> General-> Additional Include Directories --
-// ../;../../../lib/cpp/src;../../../../boost;../../../../boost/boost/tr1;
-//
-// Configuration Properties -> Linker -> General -> Additional Library Directories --
-// ../../../lib/cpp/$(Configuration);../../../../Boost/lib
-//
-// Configuration Properties -> Linker -> Input -> Additional Dependencies --
-// libthrift.lib
-//
-// ... adjust relative paths as necessary.
-//
-
-#ifdef _WIN32 //thrift is crashing when using boost threads on Mac OSX
-#  define USE_BOOST_THREAD 1
-#  include <boost/thread.hpp>
-#else
-#  include <sys/socket.h>
-#  include <netinet/in.h>
-#endif
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Required Includes
-//'server' side #includes
-#include <thrift/concurrency/ThreadManager.h>
-#include <thrift/concurrency/PlatformThreadFactory.h>
-#include <thrift/server/TThreadPoolServer.h>
-#include <thrift/server/TSimpleServer.h>
-//'client' side #includes
-#include <thrift/transport/TPipeServer.h>
-#include <thrift/transport/TPipe.h>
-#include <thrift/transport/TBufferTransports.h>
-#include <thrift/transport/TSocket.h>
-#include <thrift/transport/TTransport.h>
-
-#include <thrift/protocol/TBinaryProtocol.h>
-
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-// Required Namespaces
-//'server' side namespaces
-using namespace apache::thrift::server;
-using namespace apache::thrift::concurrency;
-//common namespaces
-using namespace apache::thrift;
-using namespace apache::thrift::protocol;
-using namespace apache::thrift::transport;
-//using namespace boost; //using ns boost can introduce type conflicts
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-namespace thriftcommon
-{
-	//----------------------------------------------------------------------------
-	//
-	//Start the thrift 'server' (both server & client side run one for bidir event signaling)
-	// *** This function template will block ***
-	//
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (boost::shared_ptr<MyHandler> hndlr, 
-		                  int NumThreads, 
-						  boost::shared_ptr<TServerTransport> transport,
-						  boost::shared_ptr<TServer> &server)
-	{
-#ifdef _WIN32
-		if (!hndlr.get())
-			throw std::exception("RunThriftServer() invalid handler");
-		if (!transport.get())
-			throw std::exception("RunThriftServer() invalid transport");
-#else
-		if ( !hndlr.get() || !transport.get() )
-			throw std::exception();
-#endif
-
-		boost::shared_ptr<MyHandler> handler(hndlr);
-		boost::shared_ptr<TProcessor> processor(new MyProcessor(handler));
-		boost::shared_ptr<TTransportFactory> tfactory(new TBufferedTransportFactory());
-		boost::shared_ptr<TProtocolFactory> pfactory(new TBinaryProtocolFactory());
-
-		if(NumThreads <= 1)
-		{	//Single-threaded server
-			server.reset(new TSimpleServer(processor, transport, tfactory, pfactory));
-		}
-		else
-		{	//Multi-threaded server
-			boost::shared_ptr<ThreadManager> threadManager = ThreadManager::newSimpleThreadManager(NumThreads);
-			boost::shared_ptr<PlatformThreadFactory> threadFactory = boost::shared_ptr<PlatformThreadFactory>(new PlatformThreadFactory());
-			threadManager->threadFactory(threadFactory);
-			threadManager->start();
-			server.reset(new TThreadPoolServer(processor, transport, tfactory, pfactory, threadManager));
-		}
-
-		printf("Starting the 'server'...\n");
-		server->serve();
-		printf("done.\n");
-	}
-
-	// Thrift server wrapper function that accepts a pipe name.
-	// A handler must be passed in to this version.
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (boost::shared_ptr<MyHandler> hndlr, int NumThreads, std::string pipename, boost::shared_ptr<TServer> &svr)
-	{
-#ifndef _WIN32  //Mac, *nix
-		unlink(pipename.c_str());
-#endif
-		boost::shared_ptr<TServerTransport> transport(new TPipeServer(pipename, 1024, NumThreads)); //Named pipe
-		RunThriftServer<MyHandler, MyProcessor>(hndlr, NumThreads, transport, svr);
-	}
-
-	// Thrift server wrapper function that accepts a pipe name.
-	// This version instantiates its own handler.
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (int NumThreads, std::string pipename)
-	{
-		boost::shared_ptr<MyHandler> handler(new MyHandler());
-		boost::shared_ptr<TServer> server;
-
-		RunThriftServer<MyHandler, MyProcessor>(handler, NumThreads, pipename, server);
-	}
-
-	// Thrift server wrapper function that accepts a socket port number.
-	// A handler must be passed in to this version.
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (boost::shared_ptr<MyHandler> hndlr, int NumThreads, int Port)
-	{
-		boost::shared_ptr<TServerTransport> transport(new TServerSocket(Port));
-		boost::shared_ptr<TServer> server;
-		RunThriftServer<MyHandler, MyProcessor>(hndlr, NumThreads, transport, server);
-	}
-
-	// Thrift server wrapper function that accepts a socket port number.
-	// This version instantiates its own handler.
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (int NumThreads, int Port)
-	{
-		boost::shared_ptr<MyHandler> handler(new MyHandler());
-
-		RunThriftServer<MyHandler, MyProcessor>(handler, NumThreads, Port);
-	}
-
-	//
-	template <class MyHandler, class MyProcessor>
-	void RunThriftServer (boost::shared_ptr<MyHandler> hndlr, int NumThreads, boost::shared_ptr<TServerTransport> transport)
-	{
-		boost::shared_ptr<TServer> server;
-		RunThriftServer<MyHandler, MyProcessor>(hndlr, NumThreads, transport, server);
-	}
-
-	//----------------------------------------------------------------------------
-	//Connect to thrift 'server' - Socket version
-	//(both server & client side run one for bidir event signaling)
-	//
-	template <class MyClient, class MyTransport>
-	void ConnectToServer (boost::shared_ptr<MyClient> &client, boost::shared_ptr<MyTransport> &transport, int Port)
-	{
-		//Client side connection using sockets transport.
-		boost::shared_ptr<TTransport> socket(new TSocket("localhost", Port));
-		transport.reset(new TBufferedTransport(socket));
-		boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
-
-		client.reset(new MyClient(protocol));
-	}
-
-	//Connect to thrift 'server' - Named Pipe version
-	template <class MyClient, class MyTransport>
-	void ConnectToServer (boost::shared_ptr<MyClient> &client, boost::shared_ptr<MyTransport> &transport, std::string pipename)
-	{
-		//Client side connection using Named Pipe transport.
-		boost::shared_ptr<TTransport> pipe(new TPipe(pipename));
-		transport.reset(new TBufferedTransport(pipe));
-		boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
-
-		client.reset(new MyClient(protocol));
-	}
-
-	//Connect to thrift 'server' - Anonymous Pipe version
-	//Currently only supported under Windows
-#ifdef _WIN32
-	template <class MyClient, class MyTransport>
-	void ConnectToServer (boost::shared_ptr<MyClient> &client, boost::shared_ptr<MyTransport> &transport, HANDLE RdPipe, HANDLE WrtPipe)
-	{
-		//Client side connection using sockets transport.
-#ifdef _WIN32
-		boost::shared_ptr<TTransport> pipe(new TPipe((int)RdPipe, (int)WrtPipe));
-		transport.reset(new TBufferedTransport(pipe));
-#else
-		boost::shared_ptr<TTransport> socket(new TSocket("localhost"));
-		transport.reset(new TBufferedTransport(socket));
-#endif
-		boost::shared_ptr<TProtocol> protocol(new TBinaryProtocol(transport));
-
-		client.reset(new MyClient(protocol));
-	}
-#endif
-
-	//----------------------------------------------------------------------------
-	//Launch child process and pass R/W anonymous pipe handles on cmd line.
-	//Currently only supported under Windows
-#ifdef _WIN32
-	bool LaunchAnonPipeChild(std::string app, boost::shared_ptr<TServerTransport> transport);
-#endif
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/ReadMe.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/ReadMe.txt b/depends/thirdparty/thrift/contrib/transport-sample/client/ReadMe.txt
deleted file mode 100644
index 6c49a96..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/ReadMe.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-========================================================================
-    CONSOLE APPLICATION : client Project Overview
-========================================================================
-
-AppWizard has created this client application for you.
-
-This file contains a summary of what you will find in each of the files that
-make up your client application.
-
-
-client.vcxproj
-    This is the main project file for VC++ projects generated using an Application Wizard.
-    It contains information about the version of Visual C++ that generated the file, and
-    information about the platforms, configurations, and project features selected with the
-    Application Wizard.
-
-client.vcxproj.filters
-    This is the filters file for VC++ projects generated using an Application Wizard. 
-    It contains information about the association between the files in your project 
-    and the filters. This association is used in the IDE to show grouping of files with
-    similar extensions under a specific node (for e.g. ".cpp" files are associated with the
-    "Source Files" filter).
-
-client.cpp
-    This is the main application source file.
-
-/////////////////////////////////////////////////////////////////////////////
-Other standard files:
-
-StdAfx.h, StdAfx.cpp
-    These files are used to build a precompiled header (PCH) file
-    named client.pch and a precompiled types file named StdAfx.obj.
-
-/////////////////////////////////////////////////////////////////////////////
-Other notes:
-
-AppWizard uses "TODO:" comments to indicate parts of the source code you
-should add to or customize.
-
-/////////////////////////////////////////////////////////////////////////////

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/transport-sample/client/client.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/transport-sample/client/client.cpp b/depends/thirdparty/thrift/contrib/transport-sample/client/client.cpp
deleted file mode 100644
index 45fbef1..0000000
--- a/depends/thirdparty/thrift/contrib/transport-sample/client/client.cpp
+++ /dev/null
@@ -1,195 +0,0 @@
-// client->cpp : Defines the entry point for the console application.
-//
-// sample client command line app using Thrift IPC.
-// Quick n Dirty example, may not have very robust error handling
-// for the sake of simplicity.
-
-#ifdef _WIN32
-#  include "stdafx.h"
-#else
-#  include "config.h"
-#endif
-
-
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//Include this before the generated includes
-#include "ThriftCommon.h"
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//Tailor these to your generated files
-#include "../gen-cpp/SampleService.h"
-#include "../gen-cpp/SampleCallback.h"
-
-using namespace Sample; //declared in .thrift file
-//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-void ClientListenerThreadProc();
-bool bSocket = false;
-bool bAnonPipe = false;
-int srvPort;
-std::string pipename;
-std::string pipename_client;
-#ifdef _WIN32
- HANDLE hConsole;
-#endif
-
-//Customized version of printf that changes the text color
-//This depends on hConsole global being initialized
-void hlprintf(const char* _Format, ...)
-{
-#ifdef _WIN32
-	SetConsoleTextAttribute(hConsole, 0xE);
-#endif
-	va_list ap;
-	int r;
-	va_start (ap, _Format);
-	r = vprintf (_Format, ap);
-	va_end (ap);
-#ifdef _WIN32
-	SetConsoleTextAttribute(hConsole, 7);
-#endif
-}
-
-//-----------------------------------------------------------------------------
-// Client-side RPC implementations: Called by the server to the client for 
-// bidirectional eventing.
-//
-class SampleCallbackHandler : virtual public SampleCallbackIf {
- public:
-  SampleCallbackHandler() {
-    // initialization goes here
-  }
-
-  void pingclient()
-  {
-    hlprintf("<<<Ping received from server (server-to-client event).\n");
-  }
-
-};
-//-----------------------------------------------------------------------------
-
-
-#ifdef _WIN32
-int _tmain(int argc, _TCHAR* argv[])
-#else
-int main(int argc, char **argv)
-#endif
-{
-	//Process cmd line args to determine named vs anon pipes.
-	bool usage = false;
-#ifdef _WIN32
-	HANDLE ReadPipe, WritePipe;
-	hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
-#endif
-
-	//Process command line params
-	if(argc > 1)
-	{
-		if(_tcscmp(argv[1], TEXT("-sp")) == 0)
-		{	//Socket Port specified
-			srvPort = _tstoi(argv[2]);
-			bSocket = true;
-		}
-		else if(_tcscmp(argv[1], TEXT("-np")) == 0)
-		{	//Named Pipe specified
-#ifdef _WIN32
-                        std::wstring wpipe(argv[2]);
-                        pipename.resize(wpipe.length());
-                        std::copy(wpipe.begin(), wpipe.end(), pipename.begin());
-#else
-                        pipename = argv[2];
-#endif
-			pipename_client = pipename + "_client";
-		}
-		else if(argc == 3)
-		{	//Anonymous Pipe specified
-#ifdef _WIN32
-			ReadPipe  = (HANDLE)_tstoi(argv[1]);
-			WritePipe = (HANDLE)_tstoi(argv[2]);
-			bAnonPipe = true;
-#else
-                        printf("Anonymous pipes not (yet) supported under *NIX\n");
-#endif
-		}
-		else
-			usage = true;
-	}
-	else
-		usage = true;
-
-	if(usage)
-	{
-		hlprintf("Thrift sample client usage:\n\n");
-		hlprintf("Socket Port to connect to: -sp <port#>\n");
-		hlprintf("Named Pipe to connect to:  -np <pipename> (e.g. affpipe)\n");
-		hlprintf("Anonymous Pipe (must be launched by anon pipe creator):\n");
-		hlprintf("                           <Read Handle> <Write Handle>\n");
-		return 0;
-	}
-
-	//Client side connection to server.
-	boost::shared_ptr<SampleServiceClient> client; //Client class from Thrift-generated code.
-	boost::shared_ptr<TTransport> transport;
-
-	if(bSocket)
-	{	//Socket transport
-#ifdef _WIN32
-		TWinsockSingleton::create();
-#endif
-		hlprintf("Using socket transport port %d\n", srvPort);
-		thriftcommon::ConnectToServer<SampleServiceClient, TTransport>(client, transport, srvPort);
-	}
-	else if(!bAnonPipe)
-	{
-		hlprintf("Using Named Pipe %s\n", pipename.c_str());
-		thriftcommon::ConnectToServer<SampleServiceClient, TTransport>(client, transport, pipename);
-	}
-	else
-	{
-#ifdef _WIN32
-		hlprintf("Using Anonymous Pipe transport\n");
-		thriftcommon::ConnectToServer<SampleServiceClient, TTransport>(client, transport, ReadPipe, WritePipe);
-#endif
-	}
-
-#ifdef _WIN32
-	//Start a thread to receive inbound connection from server for 2-way event signaling.
-	boost::thread ClientListenerThread(ClientListenerThreadProc);
-#endif
-
-	try {
-		transport->open();
-
-		//Notify server what to connect back on.
-		if(bSocket)
-			client->ClientSideListenPort(srvPort + 1); //Socket
-		else if(!bAnonPipe)
-			client->ClientSidePipeName(pipename_client); //Named Pipe
-
-		//Run some more RPCs
-		std::string hellostr = "Hello how are you?";
-		std::string returnstr;
-		client->HelloThere(returnstr, hellostr);
-		hlprintf("\n>>>Sent: %s\n", hellostr.c_str());
-		hlprintf("<<<Received: %s\n", returnstr.c_str());
-
-		hlprintf("\n>>>Calling ServerDoSomething() which delays for 5 seconds.\n");
-		client->ServerDoSomething();
-		hlprintf(">>>ServerDoSomething() done.\n\n");
-
-		transport->close();
-	} catch (TException &tx) {
-		hlprintf("ERROR: %s\n", tx.what());
-	}
-
-	return 0;
-}
-
-
-//Thread Routine
-void ClientListenerThreadProc()
-{
-	if(bSocket)
-		thriftcommon::RunThriftServer<SampleCallbackHandler, SampleCallbackProcessor>(1, srvPort + 1);
-	else if(!bAnonPipe)
-		thriftcommon::RunThriftServer<SampleCallbackHandler, SampleCallbackProcessor>(1, pipename_client);
-}



[12/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c
deleted file mode 100644
index d6315d8..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.c
+++ /dev/null
@@ -1,589 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-/* define the GError domain string */
-#define THRIFT_PROTOCOL_ERROR_DOMAIN "thrift-protocol-error-quark"
-
-/* object properties */
-enum _ThriftProtocolProperties
-{
-  PROP_0,
-  PROP_THRIFT_PROTOCOL_TRANSPORT
-};
-
-G_DEFINE_ABSTRACT_TYPE(ThriftProtocol, thrift_protocol, G_TYPE_OBJECT)
-
-void
-thrift_protocol_get_property (GObject *object, guint property_id,
-                              GValue *value, GParamSpec *pspec)
-{
-  ThriftProtocol *protocol = THRIFT_PROTOCOL (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_PROTOCOL_TRANSPORT:
-      g_value_set_object (value, protocol->transport);
-      break;
-  }
-}
-
-void
-thrift_protocol_set_property (GObject *object, guint property_id,
-                              const GValue *value, GParamSpec *pspec)
-{
-
-  ThriftProtocol *protocol = THRIFT_PROTOCOL (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_PROTOCOL_TRANSPORT:
-      protocol->transport = g_value_get_object (value);
-      break;
-  }
-}
-
-
-gint32
-thrift_protocol_write_message_begin (ThriftProtocol *protocol, 
-                                     const gchar *name, 
-                                     const ThriftMessageType message_type,
-                                     const gint32 seqid, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_message_begin
-                                                   (protocol, name,
-                                                    message_type, seqid,
-                                                    error);
-}
-
-gint32
-thrift_protocol_write_message_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_message_end (protocol,
-                                                                  error);
-}
-
-gint32
-thrift_protocol_write_struct_begin (ThriftProtocol *protocol, const gchar *name,
-                                    GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_struct_begin (protocol,
-                                                   name, error);
-}
-
-gint32
-thrift_protocol_write_struct_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_struct_end (protocol,
-                                                                 error);
-}
-
-gint32
-thrift_protocol_write_field_begin (ThriftProtocol *protocol,
-                                   const gchar *name,
-                                   const ThriftType field_type,
-                                   const gint16 field_id,
-                                   GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_begin (protocol,
-                                                   name, field_type,
-                                                   field_id, error);
-}
-
-gint32
-thrift_protocol_write_field_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_end (protocol,
-                                                                error);
-}
-
-gint32
-thrift_protocol_write_field_stop (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_field_stop (protocol,
-                                                                 error);
-}
-
-gint32
-thrift_protocol_write_map_begin (ThriftProtocol *protocol,
-                                 const ThriftType key_type,
-                                 const ThriftType value_type,
-                                 const guint32 size, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_map_begin (protocol,
-                                                   key_type, value_type,
-                                                   size, error);
-}
-
-gint32
-thrift_protocol_write_map_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_map_end (protocol,
-                                                              error);
-}
-
-gint32
-thrift_protocol_write_list_begin (ThriftProtocol *protocol,
-                                  const ThriftType element_type,
-                                  const guint32 size, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_list_begin (protocol,
-                                                   element_type, size,
-                                                   error);
-}
-
-gint32
-thrift_protocol_write_list_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_list_end (protocol,
-                                                               error);
-}
-
-gint32
-thrift_protocol_write_set_begin (ThriftProtocol *protocol,
-                                 const ThriftType element_type,
-                                 const guint32 size, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_set_begin (protocol,
-                                                   element_type, size,
-                                                   error);
-}
-
-gint32
-thrift_protocol_write_set_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_set_end (protocol,
-                                                              error);
-}
-
-gint32
-thrift_protocol_write_bool (ThriftProtocol *protocol,
-                            const gboolean value, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_bool (protocol, value,
-                                                           error);
-}
-
-gint32
-thrift_protocol_write_byte (ThriftProtocol *protocol, const gint8 value,
-                            GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_byte (protocol, value,
-                                                           error);
-}
-
-gint32
-thrift_protocol_write_i16 (ThriftProtocol *protocol, const gint16 value,
-                           GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i16 (protocol, value,
-                                                          error);
-}
-
-gint32
-thrift_protocol_write_i32 (ThriftProtocol *protocol, const gint32 value,
-                           GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i32 (protocol, value,
-                                                          error);
-}
-
-gint32
-thrift_protocol_write_i64 (ThriftProtocol *protocol, const gint64 value,
-                           GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_i64 (protocol, value,
-                                                          error);
-}
-
-gint32
-thrift_protocol_write_double (ThriftProtocol *protocol,
-                              const gdouble value, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_double (protocol,
-                                                             value, error);
-}
-
-gint32
-thrift_protocol_write_string (ThriftProtocol *protocol,
-                              const gchar *str, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_string (protocol, str,
-                                                             error);
-}
-
-gint32
-thrift_protocol_write_binary (ThriftProtocol *protocol, const gpointer buf,
-                              const guint32 len, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->write_binary (protocol, buf,
-                                                             len, error);
-}
-
-gint32 
-thrift_protocol_read_message_begin (ThriftProtocol *protocol,
-                                    gchar **name,
-                                    ThriftMessageType *message_type,
-                                    gint32 *seqid, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_message_begin (protocol,
-                                                   name, message_type,
-                                                   seqid, error);
-}
-
-gint32 
-thrift_protocol_read_message_end (ThriftProtocol *protocol,
-                                  GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_message_end (protocol,
-                                                                 error);
-}
-
-gint32 
-thrift_protocol_read_struct_begin (ThriftProtocol *protocol,
-                                   gchar **name,
-                                   GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_struct_begin (protocol,
-                                                                  name,
-                                                                  error);
-}
-
-gint32
-thrift_protocol_read_struct_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_struct_end (protocol,
-                                                                error);
-}
-
-gint32 
-thrift_protocol_read_field_begin (ThriftProtocol *protocol,
-                                  gchar **name,
-                                  ThriftType *field_type,
-                                  gint16 *field_id,
-                                  GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_field_begin (protocol,
-                                                                 name,
-                                                                 field_type,
-                                                                 field_id,
-                                                                 error);
-}
-
-gint32 
-thrift_protocol_read_field_end (ThriftProtocol *protocol,
-                                GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_field_end (protocol,
-                                                               error);
-}
-
-gint32 
-thrift_protocol_read_map_begin (ThriftProtocol *protocol,
-                                ThriftType *key_type,
-                                ThriftType *value_type, guint32 *size,
-                                GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_map_begin (protocol,
-                                                               key_type,
-                                                               value_type,
-                                                               size,
-                                                               error); 
-}
-
-gint32 
-thrift_protocol_read_map_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_map_end (protocol,
-                                                             error);
-}
-
-gint32 
-thrift_protocol_read_list_begin (ThriftProtocol *protocol,
-                                 ThriftType *element_type,
-                                 guint32 *size, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_list_begin (protocol,
-                                                                element_type,
-                                                                size, error);
-}
-
-gint32
-thrift_protocol_read_list_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_list_end (protocol,
-                                                              error);
-}
-
-gint32
-thrift_protocol_read_set_begin (ThriftProtocol *protocol,
-                                ThriftType *element_type,
-                                guint32 *size, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_set_begin (protocol,
-                                                               element_type,
-                                                               size, error);
-}
-
-gint32
-thrift_protocol_read_set_end (ThriftProtocol *protocol, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_set_end (protocol,
-                                                             error);
-}
-
-gint32
-thrift_protocol_read_bool (ThriftProtocol *protocol, gboolean *value,
-                           GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_bool (protocol, value,
-                                                          error);
-}
-
-gint32
-thrift_protocol_read_byte (ThriftProtocol *protocol, gint8 *value,
-                           GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_byte (protocol, value,
-                                                          error);
-}
-
-gint32
-thrift_protocol_read_i16 (ThriftProtocol *protocol, gint16 *value,
-                          GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i16 (protocol, value,
-                                                         error);
-}
-
-gint32
-thrift_protocol_read_i32 (ThriftProtocol *protocol, gint32 *value,
-                          GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i32 (protocol, value,
-                                                         error);
-}
-
-gint32
-thrift_protocol_read_i64 (ThriftProtocol *protocol, gint64 *value,
-                          GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_i64 (protocol, value,
-                                                         error);
-}
-
-gint32
-thrift_protocol_read_double (ThriftProtocol *protocol,
-                             gdouble *value, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_double (protocol, value,
-                                                            error);
-}
-
-gint32
-thrift_protocol_read_string (ThriftProtocol *protocol,
-                             gchar **str, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_string (protocol, str,
-                                                            error);
-}
-
-gint32
-thrift_protocol_read_binary (ThriftProtocol *protocol, gpointer *buf, 
-                             guint32 *len, GError **error)
-{
-  return THRIFT_PROTOCOL_GET_CLASS (protocol)->read_binary (protocol, buf,
-                                                            len, error);
-}
-
-gint32
-thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type, GError **error)
-{
-  switch (type)
-  {
-    case T_BOOL:
-      {
-        gboolean boolv;
-        return thrift_protocol_read_bool (protocol, &boolv, error);
-      }
-    case T_BYTE:
-      {
-        gint8 bytev;
-        return thrift_protocol_read_byte (protocol, &bytev, error);
-      }
-
-    case T_I16:
-      {
-        gint16 i16;
-        return thrift_protocol_read_i16 (protocol, &i16, error);
-      }
-    case T_I32:
-      {
-        gint32 i32;
-        return thrift_protocol_read_i32 (protocol, &i32, error);
-      }
-    case T_I64:
-      {
-        gint64 i64;
-        return thrift_protocol_read_i64 (protocol, &i64, error);
-      }
-    case T_DOUBLE:
-      {
-        gdouble dub;
-        return thrift_protocol_read_double (protocol, &dub, error);
-      }
-    case T_STRING:
-      {
-        gpointer data;
-        guint32 len;
-        gint32 ret = thrift_protocol_read_binary (protocol, &data, &len, error);
-        g_free (data);
-        return ret;
-      }
-    case T_STRUCT:
-      {
-        guint32 result = 0;
-        gchar *name;
-        gint16 fid;
-        ThriftType ftype;
-        result += thrift_protocol_read_struct_begin (protocol, &name, error);
-
-        while (1)
-        {
-          result += thrift_protocol_read_field_begin (protocol, &name, &ftype,
-                                                      &fid, error);
-          if (ftype == T_STOP)
-          {
-            break;
-          }
-          result += thrift_protocol_skip (protocol, ftype, error);
-          result += thrift_protocol_read_field_end (protocol, error);
-        }
-        result += thrift_protocol_read_struct_end (protocol, error);
-        return result;
-      }
-    case T_MAP:
-      {
-        guint32 result = 0;
-        ThriftType elem_type;
-        guint32 i, size;
-        result += thrift_protocol_read_set_begin (protocol, &elem_type, &size,
-                                                  error);
-        for (i = 0; i < size; i++)
-        {
-          result += thrift_protocol_skip (protocol, elem_type, error);
-        }
-        result += thrift_protocol_read_set_end (protocol, error);
-        return result;
-      }
-    case T_LIST:
-      {
-        guint32 result = 0;
-        ThriftType elem_type;
-        guint32 i, size;
-        result += thrift_protocol_read_list_begin (protocol, &elem_type, &size,
-                                                   error);
-        for (i = 0; i < size; i++)
-        {
-          result += thrift_protocol_skip (protocol, elem_type, error);
-        }
-        result += thrift_protocol_read_list_end (protocol, error);
-        return result;
-      }
-    default:
-      return 0;
-  }
-}
-
-/* define the GError domain for Thrift protocols */
-GQuark
-thrift_protocol_error_quark (void)
-{
-  return g_quark_from_static_string (THRIFT_PROTOCOL_ERROR_DOMAIN);
-}
-
-
-static void
-thrift_protocol_init (ThriftProtocol *protocol)
-{
-  protocol->transport = NULL;
-}
-
-static void
-thrift_protocol_class_init (ThriftProtocolClass *cls)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-
-  gobject_class->get_property = thrift_protocol_get_property;
-  gobject_class->set_property = thrift_protocol_set_property;
-
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_PROTOCOL_TRANSPORT,
-      g_param_spec_object ("transport", "Transport", "Thrift Transport",
-                           THRIFT_TYPE_TRANSPORT,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-  cls->write_message_begin = thrift_protocol_write_message_begin;
-  cls->write_message_end = thrift_protocol_write_message_end;
-  cls->write_struct_begin = thrift_protocol_write_struct_begin;
-  cls->write_struct_end = thrift_protocol_write_struct_end;
-  cls->write_field_begin = thrift_protocol_write_field_begin;
-  cls->write_field_end = thrift_protocol_write_field_end;
-  cls->write_field_stop = thrift_protocol_write_field_stop;
-  cls->write_map_begin = thrift_protocol_write_map_begin;
-  cls->write_map_end = thrift_protocol_write_map_end;
-  cls->write_list_begin = thrift_protocol_write_list_begin;
-  cls->write_list_end = thrift_protocol_write_list_end;
-  cls->write_set_begin = thrift_protocol_write_set_begin;
-  cls->write_set_end = thrift_protocol_write_set_end;
-  cls->write_bool = thrift_protocol_write_bool;
-  cls->write_byte = thrift_protocol_write_byte;
-  cls->write_i16 = thrift_protocol_write_i16;
-  cls->write_i32 = thrift_protocol_write_i32;
-  cls->write_i64 = thrift_protocol_write_i64;
-  cls->write_double = thrift_protocol_write_double;
-  cls->write_string = thrift_protocol_write_string;
-  cls->write_binary = thrift_protocol_write_binary;
-  cls->read_message_begin = thrift_protocol_read_message_begin;
-  cls->read_message_end = thrift_protocol_read_message_end;
-  cls->read_struct_begin = thrift_protocol_read_struct_begin;
-  cls->read_struct_end = thrift_protocol_read_struct_end;
-  cls->read_field_begin = thrift_protocol_read_field_begin;
-  cls->read_field_end = thrift_protocol_read_field_end;
-  cls->read_map_begin = thrift_protocol_read_map_begin;
-  cls->read_map_end = thrift_protocol_read_map_end;
-  cls->read_list_begin = thrift_protocol_read_list_begin;
-  cls->read_set_begin = thrift_protocol_read_set_begin;
-  cls->read_set_end = thrift_protocol_read_set_end;
-  cls->read_bool = thrift_protocol_read_bool;
-  cls->read_byte = thrift_protocol_read_byte;
-  cls->read_i16 = thrift_protocol_read_i16;
-  cls->read_i32 = thrift_protocol_read_i32;
-  cls->read_i64 = thrift_protocol_read_i64;
-  cls->read_double = thrift_protocol_read_double;
-  cls->read_string = thrift_protocol_read_string;
-  cls->read_binary = thrift_protocol_read_binary;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.h
deleted file mode 100644
index 58fe5e0..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol.h
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_H
-#define _THRIFT_PROTOCOL_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_protocol.h
- *  \brief Abstract class for Thrift protocol implementations.
- */
-
-/**
- * Enumerated definition of the types that the Thrift protocol supports.
- * Take special note of the T_END type which is used specifically to mark
- * the end of a sequence of fields.
- */
-typedef enum {
-  T_STOP   = 0,
-  T_VOID   = 1,
-  T_BOOL   = 2,
-  T_BYTE   = 3,
-  T_I08    = 3,
-  T_I16    = 6,
-  T_I32    = 8,
-  T_U64    = 9,
-  T_I64    = 10,
-  T_DOUBLE = 4,
-  T_STRING = 11,
-  T_UTF7   = 11,
-  T_STRUCT = 12,
-  T_MAP    = 13,
-  T_SET    = 14,
-  T_LIST   = 15,
-  T_UTF8   = 16,
-  T_UTF16  = 17
-} ThriftType;
-
-/**
- * Enumerated definition of the message types that the Thrift protocol
- * supports.
- */
-typedef enum {
-  T_CALL      = 1,
-  T_REPLY     = 2,
-  T_EXCEPTION = 3,
-  T_ONEWAY    = 4
-} ThriftMessageType;
-
-/* type macros */
-#define THRIFT_TYPE_PROTOCOL (thrift_protocol_get_type ())
-#define THRIFT_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_PROTOCOL, ThriftProtocol))
-#define THRIFT_IS_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_PROTOCOL))
-#define THRIFT_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_PROTOCOL, ThriftProtocolClass))
-#define THRIFT_IS_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_PROTOCOL))
-#define THRIFT_PROTOCOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_PROTOCOL, ThriftProtocolClass))
-
-typedef struct _ThriftProtocol ThriftProtocol;
-
-/*!
- * Thrift Protocol object
- */
-struct _ThriftProtocol
-{
-  GObject parent;
-
-  /* protected */
-  ThriftTransport *transport;
-};
-
-typedef struct _ThriftProtocolClass ThriftProtocolClass;
-
-/*!
- * Thrift Protocol class
- */
-struct _ThriftProtocolClass
-{
-  GObjectClass parent;
-
-  gint32 (*write_message_begin) (ThriftProtocol *protocol, const gchar *name,
-                                 const ThriftMessageType message_type,
-                                 const gint32 seqid, GError **error);
-  gint32 (*write_message_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_struct_begin) (ThriftProtocol *protocol, const gchar *name,
-                                GError **error);
-  gint32 (*write_struct_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_field_begin) (ThriftProtocol *protocol, const gchar *name,
-                               const ThriftType field_type,
-                               const gint16 field_id, GError **error);
-  gint32 (*write_field_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_field_stop) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_map_begin) (ThriftProtocol *protocol,
-                             const ThriftType key_type,
-                             const ThriftType value_type,
-                             const guint32 size, GError **error);
-  gint32 (*write_map_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_list_begin) (ThriftProtocol *protocol,
-                              const ThriftType element_type,
-                              const guint32 size, GError **error);
-  gint32 (*write_list_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_set_begin) (ThriftProtocol *protocol,
-                             const ThriftType element_type,
-                             const guint32 size, GError **error);
-  gint32 (*write_set_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*write_bool) (ThriftProtocol *protocol, const gboolean value,
-                        GError **error);
-  gint32 (*write_byte) (ThriftProtocol *protocol, const gint8 value,
-                        GError **error);
-  gint32 (*write_i16) (ThriftProtocol *protocol, const gint16 value,
-                       GError **error);
-  gint32 (*write_i32) (ThriftProtocol *protocol, const gint32 value,
-                       GError **error);
-  gint32 (*write_i64) (ThriftProtocol *protocol, const gint64 value,
-                       GError **error);
-  gint32 (*write_double) (ThriftProtocol *protocol, const gdouble value,
-                          GError **error);
-  gint32 (*write_string) (ThriftProtocol *protocol, const gchar *str,
-                          GError **error);
-  gint32 (*write_binary) (ThriftProtocol *protocol, const gpointer buf,
-                          const guint32 len, GError **error);
-
-  gint32 (*read_message_begin) (ThriftProtocol *thrift_protocol, gchar **name,
-                                ThriftMessageType *message_type,
-                                gint32 *seqid, GError **error);
-  gint32 (*read_message_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_struct_begin) (ThriftProtocol *protocol, gchar **name,
-                               GError **error);
-  gint32 (*read_struct_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_field_begin) (ThriftProtocol *protocol, gchar **name,
-                              ThriftType *field_type, gint16 *field_id,
-                              GError **error);
-  gint32 (*read_field_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_map_begin) (ThriftProtocol *protocol, ThriftType *key_type,
-                            ThriftType *value_type, guint32 *size,
-                            GError **error);
-  gint32 (*read_map_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_list_begin) (ThriftProtocol *protocol, ThriftType *element_type,
-                             guint32 *size, GError **error);
-  gint32 (*read_list_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_set_begin) (ThriftProtocol *protocol, ThriftType *element_type,
-                            guint32 *size, GError **error);
-  gint32 (*read_set_end) (ThriftProtocol *protocol, GError **error);
-  gint32 (*read_bool) (ThriftProtocol *protocol, gboolean *value,
-                       GError **error);
-  gint32 (*read_byte) (ThriftProtocol *protocol, gint8 *value, GError **error);
-  gint32 (*read_i16) (ThriftProtocol *protocol, gint16 *value, GError **error);
-  gint32 (*read_i32) (ThriftProtocol *protocol, gint32 *value, GError **error);
-  gint32 (*read_i64) (ThriftProtocol *protocol, gint64 *value, GError **error);
-  gint32 (*read_double) (ThriftProtocol *protocol, gdouble *value,
-                         GError **error);
-  gint32 (*read_string) (ThriftProtocol *protocol, gchar **str, GError **error);
-  gint32 (*read_binary) (ThriftProtocol *protocol, gpointer *buf,
-                         guint32 *len, GError **error);
-};
-
-/* used by THRIFT_TYPE_PROTOCOL */
-GType thrift_protocol_get_type (void);
-
-/* virtual public methods */
-gint32 thrift_protocol_write_message_begin (ThriftProtocol *protocol,
-           const gchar *name, const ThriftMessageType message_type,
-           const gint32 seqid, GError **error);
-
-gint32 thrift_protocol_write_message_end (ThriftProtocol *protocol,
-                                          GError **error);
-
-gint32 thrift_protocol_write_struct_begin (ThriftProtocol *protocol,
-                                           const gchar *name,
-                                           GError **error);
-
-gint32 thrift_protocol_write_struct_end (ThriftProtocol *protocol,
-                                         GError **error);
-
-gint32 thrift_protocol_write_field_begin (ThriftProtocol *protocol,
-                                          const gchar *name,
-                                          const ThriftType field_type,
-                                          const gint16 field_id,
-                                          GError **error);
-
-gint32 thrift_protocol_write_field_end (ThriftProtocol *protocol,
-                                        GError **error);
-
-gint32 thrift_protocol_write_field_stop (ThriftProtocol *protocol,
-                                         GError **error);
-
-gint32 thrift_protocol_write_map_begin (ThriftProtocol *protocol,
-                                        const ThriftType key_type,
-                                        const ThriftType value_type,
-                                        const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_map_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_write_list_begin (ThriftProtocol *protocol,
-                                         const ThriftType element_type,
-                                         const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_list_end (ThriftProtocol *protocol,
-                                       GError **error);
-
-gint32 thrift_protocol_write_set_begin (ThriftProtocol *protocol,
-                                        const ThriftType element_type,
-                                        const guint32 size, GError **error);
-
-gint32 thrift_protocol_write_set_end (ThriftProtocol *protocol,
-                                      GError **error);
-
-gint32 thrift_protocol_write_bool (ThriftProtocol *protocol,
-                                   const gboolean value, GError **error);
-
-gint32 thrift_protocol_write_byte (ThriftProtocol *protocol, const gint8 value,
-                                   GError **error);
-
-gint32 thrift_protocol_write_i16 (ThriftProtocol *protocol, const gint16 value,
-                                  GError **error);
-
-gint32 thrift_protocol_write_i32 (ThriftProtocol *protocol, const gint32 value,
-                                  GError **error);
-
-gint32 thrift_protocol_write_i64 (ThriftProtocol *protocol, const gint64 value,
-                                  GError **error);
-
-gint32 thrift_protocol_write_double (ThriftProtocol *protocol,
-                                     const gdouble value, GError **error);
-
-gint32 thrift_protocol_write_string (ThriftProtocol *protocol,
-                                     const gchar *str, GError **error);
-
-gint32 thrift_protocol_write_binary (ThriftProtocol *protocol,
-                                     const gpointer buf,
-                                     const guint32 len, GError **error);
-
-gint32 thrift_protocol_read_message_begin (ThriftProtocol *thrift_protocol,
-                                           gchar **name,
-                                           ThriftMessageType *message_type,
-                                           gint32 *seqid, GError **error);
-
-gint32 thrift_protocol_read_message_end (ThriftProtocol *protocol,
-                                         GError **error);
-
-gint32 thrift_protocol_read_struct_begin (ThriftProtocol *protocol,
-                                          gchar **name,
-                                          GError **error);
-
-gint32 thrift_protocol_read_struct_end (ThriftProtocol *protocol,
-                                        GError **error);
-
-gint32 thrift_protocol_read_field_begin (ThriftProtocol *protocol,
-                                         gchar **name,
-                                         ThriftType *field_type,
-                                         gint16 *field_id,
-                                         GError **error);
-
-gint32 thrift_protocol_read_field_end (ThriftProtocol *protocol,
-                                       GError **error);
-
-gint32 thrift_protocol_read_map_begin (ThriftProtocol *protocol,
-                                       ThriftType *key_type,
-                                       ThriftType *value_type, guint32 *size,
-                                       GError **error);
-
-gint32 thrift_protocol_read_map_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_list_begin (ThriftProtocol *protocol,
-                                        ThriftType *element_type,
-                                        guint32 *size, GError **error);
-
-gint32 thrift_protocol_read_list_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_set_begin (ThriftProtocol *protocol,
-                                       ThriftType *element_type,
-                                       guint32 *size, GError **error);
-
-gint32 thrift_protocol_read_set_end (ThriftProtocol *protocol, GError **error);
-
-gint32 thrift_protocol_read_bool (ThriftProtocol *protocol, gboolean *value,
-                                  GError **error);
-
-gint32 thrift_protocol_read_byte (ThriftProtocol *protocol, gint8 *value,
-                                  GError **error);
-
-gint32 thrift_protocol_read_i16 (ThriftProtocol *protocol, gint16 *value,
-                                 GError **error);
-
-gint32 thrift_protocol_read_i32 (ThriftProtocol *protocol, gint32 *value,
-                                 GError **error);
-
-gint32 thrift_protocol_read_i64 (ThriftProtocol *protocol, gint64 *value,
-                                 GError **error);
-
-gint32 thrift_protocol_read_double (ThriftProtocol *protocol,
-                                    gdouble *value, GError **error);
-
-gint32 thrift_protocol_read_string (ThriftProtocol *protocol,
-                                    gchar **str, GError **error);
-
-gint32 thrift_protocol_read_binary (ThriftProtocol *protocol,
-                                    gpointer *buf, guint32 *len,
-                                    GError **error);
-
-gint32 thrift_protocol_skip (ThriftProtocol *protocol, ThriftType type,
-                             GError **error);
-
-/* define error types */
-typedef enum
-{
-  THRIFT_PROTOCOL_ERROR_UNKNOWN,
-  THRIFT_PROTOCOL_ERROR_INVALID_DATA,
-  THRIFT_PROTOCOL_ERROR_NEGATIVE_SIZE,
-  THRIFT_PROTOCOL_ERROR_SIZE_LIMIT,
-  THRIFT_PROTOCOL_ERROR_BAD_VERSION,
-  THRIFT_PROTOCOL_ERROR_NOT_IMPLEMENTED,
-  THRIFT_PROTOCOL_ERROR_DEPTH_LIMIT
-} ThriftProtocolError;
-
-/* define an error domain for GError to use */
-GQuark thrift_protocol_error_quark (void);
-#define THRIFT_PROTOCOL_ERROR (thrift_protocol_error_quark ())
-
-G_END_DECLS
-
-#endif /* _THRIFT_PROTOCOL_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.c
deleted file mode 100644
index bef4087..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.c
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/protocol/thrift_protocol_factory.h>
-
-G_DEFINE_ABSTRACT_TYPE(ThriftProtocolFactory, thrift_protocol_factory, G_TYPE_OBJECT)
-
-ThriftProtocol *
-thrift_protocol_factory_get_protocol(ThriftProtocolFactory *factory,
-                                     ThriftTransport *transport)
-{
-  return THRIFT_PROTOCOL_FACTORY_GET_CLASS (factory)->get_protocol (factory,
-                                                                    transport);
-}
-
-static void
-thrift_protocol_factory_init (ThriftProtocolFactory *factory)
-{
-  THRIFT_UNUSED_VAR (factory);
-}
-
-static void
-thrift_protocol_factory_class_init (ThriftProtocolFactoryClass *cls)
-{
-  cls->get_protocol = thrift_protocol_factory_get_protocol;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.h
deleted file mode 100644
index 5f146dd..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_protocol_factory.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_FACTORY_H
-#define _THRIFT_PROTOCOL_FACTORY_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_protocol_factory.h
- *  \brief Abstract class for Thrift protocol factory implementations.
- */
-
-/* type macros */
-#define THRIFT_TYPE_PROTOCOL_FACTORY (thrift_protocol_factory_get_type ())
-#define THRIFT_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactory))
-#define THRIFT_IS_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_PROTOCOL_FACTORY))
-#define THRIFT_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactoryClass))
-#define THRIFT_IS_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_PROTOCOL_FACTORY))
-#define THRIFT_PROTOCOL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_PROTOCOL_FACTORY, ThriftProtocolFactoryClass))
-
-typedef struct _ThriftProtocolFactory ThriftProtocolFactory;
-
-/*!
- * Thrift Protocol Factory object
- */
-struct _ThriftProtocolFactory
-{
-  GObject parent;
-};
-
-typedef struct _ThriftProtocolFactoryClass ThriftProtocolFactoryClass;
-
-/*!
- * Thrift Protocol Factory class
- */
-struct _ThriftProtocolFactoryClass
-{
-  GObjectClass parent;
-
-  ThriftProtocol *(*get_protocol) (ThriftProtocolFactory *factory,
-                                   ThriftTransport *transport);
-};
-
-/* used by THRIFT_TYPE_PROTOCOL_FACTORY */
-GType thrift_protocol_factory_get_type (void);
-
-/* virtual public methods */
-ThriftProtocol *thrift_protocol_factory_get_protocol(ThriftProtocolFactory *factory, ThriftTransport *transport);
-
-G_END_DECLS
-
-#endif /* _THRIFT_PROTOCOL_FACTORY_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.c
deleted file mode 100644
index e8aff45..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.c
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include "thrift_server.h"
-
-/* object properties */
-enum _ThriftServerProperties
-{
-  PROP_0,
-  PROP_THRIFT_SERVER_PROCESSOR,
-  PROP_THRIFT_SERVER_SERVER_TRANSPORT,
-  PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY,
-  PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY,
-  PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY,
-  PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY
-};
-
-G_DEFINE_ABSTRACT_TYPE(ThriftServer, thrift_server, G_TYPE_OBJECT)
-
-void
-thrift_server_get_property (GObject *object, guint property_id,
-                            GValue *value, GParamSpec *pspec)
-{
-  ThriftServer *server = THRIFT_SERVER (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SERVER_PROCESSOR:
-      g_value_set_object (value, server->processor);
-      break;
-    case PROP_THRIFT_SERVER_SERVER_TRANSPORT:
-      g_value_set_object (value, server->server_transport);
-      break;
-    case PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY:
-      g_value_set_object (value, server->input_transport_factory);
-      break;
-    case PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY:
-      g_value_set_object (value, server->output_transport_factory);
-      break;
-    case PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY:
-      g_value_set_object (value, server->input_protocol_factory);
-      break;
-    case PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY:
-      g_value_set_object (value, server->output_protocol_factory);
-      break;
-  }
-}
-
-void
-thrift_server_set_property (GObject *object, guint property_id,
-                            const GValue *value, GParamSpec *pspec)
-{
-  ThriftServer *server = THRIFT_SERVER (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SERVER_PROCESSOR:
-      server->processor = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_SERVER_SERVER_TRANSPORT:
-      server->server_transport = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY:
-      server->input_transport_factory = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY:
-      server->output_transport_factory = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY:
-      server->input_protocol_factory = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY:
-      server->output_protocol_factory = g_value_get_object (value);
-      break;
-  }
-}
-
-gboolean
-thrift_server_serve (ThriftServer *server, GError **error)
-{
-  return THRIFT_SERVER_GET_CLASS (server)->serve (server, error);
-}
-
-void
-thrift_server_stop (ThriftServer *server)
-{
-  THRIFT_SERVER_GET_CLASS (server)->stop (server);
-}
-
-/* instance initializer for Thrift Server */
-static void
-thrift_server_init (ThriftServer *server)
-{
-  server->processor = NULL;
-  server->server_transport = NULL;
-  server->input_transport_factory = NULL;
-  server->output_transport_factory = NULL;
-  server->input_protocol_factory = NULL;
-  server->output_protocol_factory = NULL;
-}
-
-/* class initializer for ThriftServer
- * TODO: implement ServerEventHandler as a GClosure
- */
-static void
-thrift_server_class_init (ThriftServerClass *cls)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-
-  gobject_class->get_property = thrift_server_get_property;
-  gobject_class->set_property = thrift_server_set_property;
-
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_PROCESSOR,
-      g_param_spec_object ("processor", "Processor", "Thrift Processor",
-                           THRIFT_TYPE_PROCESSOR,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_SERVER_TRANSPORT,
-      g_param_spec_object ("server_transport", "Server Transport",
-                           "Thrift Server Transport",
-                           THRIFT_TYPE_SERVER_TRANSPORT,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_INPUT_TRANSPORT_FACTORY,
-      g_param_spec_object ("input_transport_factory", "Input Transport Factory",
-                           "Thrift Server Input Transport Factory",
-                           THRIFT_TYPE_TRANSPORT_FACTORY,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_OUTPUT_TRANSPORT_FACTORY,
-      g_param_spec_object ("output_transport_factory",
-                           "Output Transport Factory",
-                           "Thrift Server Output Transport Factory",
-                           THRIFT_TYPE_TRANSPORT_FACTORY,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_INPUT_PROTOCOL_FACTORY,
-      g_param_spec_object ("input_protocol_factory", "Input Protocol Factory",
-                           "Thrift Server Input Protocol Factory",
-                           THRIFT_TYPE_PROTOCOL_FACTORY,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-  g_object_class_install_property (gobject_class,
-      PROP_THRIFT_SERVER_OUTPUT_PROTOCOL_FACTORY,
-      g_param_spec_object ("output_protocol_factory", "Output Protocol Factory",
-                           "Thrift Server Output Protocol Factory",
-                           THRIFT_TYPE_PROTOCOL_FACTORY,
-                           G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
-
-  /* set these as virtual methods to be implemented by a subclass */
-  cls->serve = thrift_server_serve;
-  cls->stop = thrift_server_stop;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.h
deleted file mode 100644
index 49beddc..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_server.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SERVER_H
-#define _THRIFT_SERVER_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/processor/thrift_processor.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_transport_factory.h>
-#include <thrift/c_glib/protocol/thrift_protocol_factory.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_server.h
- *  \brief Abstract class for Thrift servers.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SERVER (thrift_server_get_type ())
-#define THRIFT_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER, ThriftServer))
-#define THRIFT_IS_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER))
-#define THRIFT_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER, ThriftServerClass))
-#define THRIFT_IS_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER))
-#define THRIFT_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER, ThriftServerClass))
-
-typedef struct _ThriftServer ThriftServer;
-
-/*!
- * Thrift Server object
- */
-struct _ThriftServer
-{
-  GObject parent;
-
-  /* protected */
-  ThriftProcessor *processor;
-  ThriftServerTransport *server_transport;
-  ThriftTransportFactory *input_transport_factory;
-  ThriftTransportFactory *output_transport_factory;
-  ThriftProtocolFactory *input_protocol_factory;
-  ThriftProtocolFactory *output_protocol_factory;
-};
-
-typedef struct _ThriftServerClass ThriftServerClass;
-
-/*!
- * Thrift Server class
- */
-struct _ThriftServerClass
-{
-  GObjectClass parent;
-
-  /* vtable */
-  gboolean (*serve) (ThriftServer *server, GError **error);
-  void (*stop) (ThriftServer *server);
-};
-
-/* used by THRIFT_TYPE_SERVER */
-GType thrift_server_get_type (void);
-
-/*!
- * Processes the request.
- * \public \memberof ThriftServerClass
- */
-gboolean thrift_server_serve (ThriftServer *server, GError **error);
-
-/*!
- * Stop handling requests.
- */
-void thrift_server_stop (ThriftServer *server);
-
-G_END_DECLS
-
-#endif /* _THRIFT_SERVER_H */
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
deleted file mode 100644
index 22a96c7..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.c
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/server/thrift_simple_server.h>
-#include <thrift/c_glib/transport/thrift_transport_factory.h>
-#include <thrift/c_glib/protocol/thrift_protocol_factory.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol_factory.h>
-
-G_DEFINE_TYPE(ThriftSimpleServer, thrift_simple_server, THRIFT_TYPE_SERVER)
-
-gboolean
-thrift_simple_server_serve (ThriftServer *server, GError **error)
-{
-  ThriftTransport *t = NULL;
-  ThriftTransport *input_transport = NULL, *output_transport = NULL;
-  ThriftProtocol *input_protocol = NULL, *output_protocol = NULL;
-  ThriftSimpleServer *tss = THRIFT_SIMPLE_SERVER(server);
-  GError *process_error = NULL;
-
-  g_return_val_if_fail (THRIFT_IS_SIMPLE_SERVER (server), FALSE);
-
-  if (thrift_server_transport_listen (server->server_transport, error)) {
-    tss->running = TRUE;
-    while (tss->running == TRUE)
-    {
-      t = thrift_server_transport_accept (server->server_transport,
-                                          error);
-      if (t != NULL && tss->running) {
-        input_transport =
-          THRIFT_TRANSPORT_FACTORY_GET_CLASS (server->input_transport_factory)
-          ->get_transport (server->input_transport_factory, t);
-        output_transport =
-          THRIFT_TRANSPORT_FACTORY_GET_CLASS (server->output_transport_factory)
-          ->get_transport (server->output_transport_factory, t);
-        input_protocol =
-          THRIFT_PROTOCOL_FACTORY_GET_CLASS (server->input_protocol_factory)
-          ->get_protocol (server->input_protocol_factory, input_transport);
-        output_protocol =
-          THRIFT_PROTOCOL_FACTORY_GET_CLASS (server->output_protocol_factory)
-          ->get_protocol (server->output_protocol_factory, output_transport);
-
-        while (THRIFT_PROCESSOR_GET_CLASS (server->processor)
-               ->process (server->processor,
-                          input_protocol,
-                          output_protocol,
-                          &process_error) &&
-               thrift_transport_peek (input_transport, &process_error))
-        {
-        }
-
-        if (process_error != NULL)
-        {
-          g_message ("thrift_simple_server_serve: %s", process_error->message);
-          g_clear_error (&process_error);
-
-          /* Note we do not propagate processing errors to the caller as they
-           * normally are transient and not fatal to the server */
-        }
-
-        /* TODO: handle exceptions */
-        THRIFT_TRANSPORT_GET_CLASS (input_transport)->close (input_transport,
-                                                             NULL);
-        THRIFT_TRANSPORT_GET_CLASS (output_transport)->close (output_transport,
-                                                              NULL);
-      }
-    }
-
-    /* attempt to shutdown */
-    THRIFT_SERVER_TRANSPORT_GET_CLASS (server->server_transport)
-      ->close (server->server_transport, NULL);
-  }
-
-  /* Since this method is designed to run forever, it can only ever return on
-   * error */
-  return FALSE;
-}
-
-void
-thrift_simple_server_stop (ThriftServer *server)
-{
-  g_return_if_fail (THRIFT_IS_SIMPLE_SERVER (server));
-  (THRIFT_SIMPLE_SERVER (server))->running = FALSE;
-}
-
-static void
-thrift_simple_server_init (ThriftSimpleServer *tss)
-{
-  ThriftServer *server = THRIFT_SERVER(tss);
-
-  tss->running = FALSE;
-
-  if (server->input_transport_factory == NULL)
-  {
-    server->input_transport_factory =
-        g_object_new (THRIFT_TYPE_TRANSPORT_FACTORY, NULL);
-  }
-  if (server->output_transport_factory == NULL)
-  {
-    server->output_transport_factory =
-        g_object_new (THRIFT_TYPE_TRANSPORT_FACTORY, NULL);
-  }
-  if (server->input_protocol_factory == NULL)
-  {
-    server->input_protocol_factory =
-        g_object_new (THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, NULL);
-  }
-  if (server->output_protocol_factory == NULL)
-  {
-    server->output_protocol_factory =
-        g_object_new (THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, NULL);
-  }
-}
-
-/* initialize the class */
-static void
-thrift_simple_server_class_init (ThriftSimpleServerClass *class)
-{
-  ThriftServerClass *cls = THRIFT_SERVER_CLASS(class);
-
-  cls->serve = thrift_simple_server_serve;
-  cls->stop = thrift_simple_server_stop;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.h
deleted file mode 100644
index 86b538b..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/server/thrift_simple_server.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SIMPLE_SERVER_H
-#define _THRIFT_SIMPLE_SERVER_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/server/thrift_server.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_simple_server.h
- *  \brief A simple Thrift server, single-threaded.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SIMPLE_SERVER (thrift_simple_server_get_type ())
-#define THRIFT_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServer))
-#define THRIFT_IS_SIMPLE_SERVER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SIMPLE_SERVER))
-#define THRIFT_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c) THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass))
-#define THRIFT_IS_SIMPLE_SERVER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SIMPLE_SERVER))
-#define THRIFT_SIMPLE_SERVER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SIMPLE_SERVER, ThriftSimpleServerClass))
-
-typedef struct _ThriftSimpleServer ThriftSimpleServer;
-
-/**
- * Thrift Simple Server instance.
- */
-struct _ThriftSimpleServer
-{
-  ThriftServer parent;
-
-  /* private */
-  volatile gboolean running;
-};
-
-typedef struct _ThriftSimpleServerClass ThriftSimpleServerClass;
-
-/**
- * Thrift Simple Server class.
- */
-struct _ThriftSimpleServerClass
-{
-  ThriftServerClass parent;
-};
-
-/* used by THRIFT_TYPE_SIMPLE_SERVER */
-GType thrift_simple_server_get_type (void);
-
-G_END_DECLS
-
-#endif /* _THRIFT_SIMPLE_SERVER_H */
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.c
deleted file mode 100644
index 15f409f..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-
-/**
- * GHashTable callback to add keys to a GList.
- */
-void
-thrift_hash_table_get_keys (gpointer key, gpointer value, gpointer user_data)
-{
-  GList **list = (GList **) user_data;
-
-  THRIFT_UNUSED_VAR (value);
-
-  *list = g_list_append (*list, key);
-}
-
-void
-thrift_string_free (gpointer str)
-{
-	GByteArray* ptr = str;
-	g_byte_array_unref(ptr);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.h
deleted file mode 100644
index 858ad86..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_H
-#define _THRIFT_H
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <glib.h>
-
-/* this macro is called to satisfy -Wall hardcore compilation */
-#ifndef THRIFT_UNUSED_VAR
-# define THRIFT_UNUSED_VAR(x) ((void) x)
-#endif
-
-void thrift_hash_table_get_keys (gpointer key, gpointer value,
-                                 gpointer user_data);
-void thrift_string_free (gpointer str);
-
-#endif /* #ifndef _THRIFT_THRIFT_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.c
deleted file mode 100644
index 1234cae..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.c
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include "thrift_application_exception.h"
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-
-/* object properties */
-enum _ThriftApplicationExceptionProperties
-{
-  PROP_0,
-  PROP_THRIFT_APPLICATION_EXCEPTION_TYPE,
-  PROP_THRIFT_APPLICATION_EXCEPTION_MESSAGE
-};
-
-G_DEFINE_TYPE(ThriftApplicationException, thrift_application_exception, THRIFT_TYPE_STRUCT)
-
-gint32
-thrift_application_exception_read (ThriftStruct *object,
-                                   ThriftProtocol *protocol, GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gchar *name;
-  ThriftType ftype;
-  gint16 fid;
-  ThriftApplicationException *this = THRIFT_APPLICATION_EXCEPTION (object);
-
-  /* read the struct begin marker */
-  if ((ret = thrift_protocol_read_struct_begin (protocol, &name, error)) < 0)
-  {
-    if (name) g_free (name);
-    return -1;
-  }
-  xfer += ret;
-  if (name) g_free (name);
-
-  while (1)
-  {
-    if ((ret = thrift_protocol_read_field_begin (protocol, &name, &ftype,
-                                                 &fid, error)) < 0)
-    {
-      if (name) g_free (name);
-      return -1;
-    }
-    xfer += ret;
-    if (name) g_free (name);
-
-    /* break if we get a STOP field */
-    if (ftype == T_STOP)
-    {
-      break;
-    }
-
-    switch (fid)
-    {
-      case 1:
-        if (ftype == T_STRING)
-        {
-          if ((ret = thrift_protocol_read_string (protocol, &this->message,
-                                                  error)) < 0)
-            return -1;
-          xfer += ret;
-          this->__isset_message = TRUE;
-        } else {
-          if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
-            return -1;
-          xfer += ret;
-        }
-        break;
-      case 2:
-        if (ftype == T_I32)
-        {
-          if ((ret = thrift_protocol_read_i32 (protocol, &this->type,
-                                               error)) < 0)
-            return -1;
-          xfer += ret;
-          this->__isset_type = TRUE;
-        } else {
-          if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
-            return -1;
-          xfer += ret;
-        }
-        break;
-      default:
-        if ((ret = thrift_protocol_skip (protocol, ftype, error)) < 0)
-          return -1;
-        xfer += ret;
-        break;
-    }
-    if ((ret = thrift_protocol_read_field_end (protocol, error)) < 0)
-      return -1;
-    xfer += ret;
-  }
-
-  if ((ret = thrift_protocol_read_struct_end (protocol, error)) < 0)
-    return -1;
-  xfer += ret;
-
-  return xfer;
-}
-
-gint32
-thrift_application_exception_write (ThriftStruct *object,
-                                    ThriftProtocol *protocol, GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-
-  ThriftApplicationException *this = THRIFT_APPLICATION_EXCEPTION (object);
-
-  if ((ret = thrift_protocol_write_struct_begin (protocol,
-                                                 "TApplicationException",
-                                                 error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_field_begin (protocol, "message",
-                                                T_STRING, 1, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_string (protocol, this->message, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_field_begin (protocol, "type",
-                                                T_I32, 2, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_i32 (protocol, this->type, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_field_end (protocol, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_field_stop (protocol, error)) < 0)
-    return -1;
-  xfer += ret;
-  if ((ret = thrift_protocol_write_struct_end (protocol, error)) < 0)
-    return -1;
-  xfer += ret;
-
-  return xfer;
-}
-
-
-/* GError domain */
-#define THRIFT_APPLICATION_EXCEPTION_ERROR_DOMAIN "thrift-application-exception-error-quark"
-
-GQuark
-thrift_application_exception_error_quark (void)
-{
-  return g_quark_from_static_string (THRIFT_APPLICATION_EXCEPTION_ERROR_DOMAIN);
-}
-
-static void
-thrift_application_exception_get_property (GObject *object,
-                                           guint property_id,
-                                           GValue *value,
-                                           GParamSpec *pspec)
-{
-  ThriftApplicationException *tae = THRIFT_APPLICATION_EXCEPTION (object);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_APPLICATION_EXCEPTION_TYPE:
-      g_value_set_int (value, tae->type);
-      break;
-    case PROP_THRIFT_APPLICATION_EXCEPTION_MESSAGE:
-      g_value_set_string (value, tae->message);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-      break;
-  }
-}
-
-static void
-thrift_application_exception_set_property (GObject *object,
-                                           guint property_id,
-                                           const GValue *value,
-                                           GParamSpec *pspec)
-{
-  ThriftApplicationException *tae = THRIFT_APPLICATION_EXCEPTION (object);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_APPLICATION_EXCEPTION_TYPE:
-      tae->type = g_value_get_int (value);
-      tae->__isset_type = TRUE;
-      break;
-    case PROP_THRIFT_APPLICATION_EXCEPTION_MESSAGE:
-      if (tae->message != NULL)
-        g_free (tae->message);
-
-      tae->message = g_value_dup_string (value);
-      tae->__isset_message = TRUE;
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-      break;
-  }
-}
-
-void
-thrift_application_exception_init (ThriftApplicationException *object)
-{
-  object->type = 0;
-  object->__isset_type = FALSE;
-  object->message = NULL;
-  object->__isset_message = FALSE;
-}
-
-void
-thrift_application_exception_finalize (GObject *object)
-{
-  ThriftApplicationException *tae = THRIFT_APPLICATION_EXCEPTION (object);
-
-  if (tae->__isset_message) {
-		g_free(tae->message);
-  }
-}
-
-void
-thrift_application_exception_class_init (ThriftApplicationExceptionClass *class)
-{
-  GObjectClass *gobject_class = G_OBJECT_CLASS(class);
-  ThriftStructClass *cls = THRIFT_STRUCT_CLASS(class);
-  GParamSpec *param_spec;
-
-  cls->read = thrift_application_exception_read;
-  cls->write = thrift_application_exception_write;
-
-  gobject_class->finalize = thrift_application_exception_finalize;
-  gobject_class->get_property = thrift_application_exception_get_property;
-  gobject_class->set_property = thrift_application_exception_set_property;
-
-  param_spec = g_param_spec_int ("type",
-                                 "Exception type",
-                                 "The type of the exception, one of the "
-                                 "values defined by the "
-                                 "ThriftApplicationExceptionError "
-                                 "enumeration.",
-                                 0,
-                                 THRIFT_APPLICATION_EXCEPTION_ERROR_N - 1,
-                                 0,
-                                 G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_APPLICATION_EXCEPTION_TYPE,
-                                   param_spec);
-
-  param_spec = g_param_spec_string ("message",
-                                    "Exception message",
-                                    "A string describing the exception that "
-                                    "occurred.",
-                                    NULL,
-                                    G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_APPLICATION_EXCEPTION_MESSAGE,
-                                   param_spec);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.h
deleted file mode 100644
index 733f793..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_application_exception.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_APPLICATION_EXCEPTION_H
-#define _THRIFT_APPLICATION_EXCEPTION_H
-
-#include <glib-object.h>
-#include "thrift_struct.h"
-
-G_BEGIN_DECLS
-
-/*! \file thrift_application_exception.h
- *  \brief C Implementation of a TApplicationException.
- */
-
-/* type macros */
-#define THRIFT_TYPE_APPLICATION_EXCEPTION (thrift_application_exception_get_type ())
-#define THRIFT_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationException))
-#define THRIFT_IS_APPLICATION_EXCEPTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION))
-#define THRIFT_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass))
-#define THRIFT_IS_APPLICATION_EXCEPTION_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_APPLICATION_EXCEPTION))
-#define THRIFT_APPLICATION_EXCEPTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_APPLICATION_EXCEPTION, ThriftApplicationExceptionClass))
-
-typedef struct _ThriftApplicationException ThriftApplicationException;
-
-struct _ThriftApplicationException
-{
-  ThriftStruct parent;
-
-  /* private */
-  gint32 type;
-  gboolean __isset_type;
-  gchar *message;
-  gboolean __isset_message;
-};
-
-typedef struct _ThriftApplicationExceptionClass ThriftApplicationExceptionClass;
-
-struct _ThriftApplicationExceptionClass
-{
-  ThriftStructClass parent;
-};
-
-GType thrift_application_exception_get_type (void);
-
-/* gerror codes */
-typedef enum
-{
-  THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN_METHOD,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_BAD_SEQUENCE_ID,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_PROTOCOL_ERROR,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_TRANSFORM,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_PROTOCOL,
-  THRIFT_APPLICATION_EXCEPTION_ERROR_UNSUPPORTED_CLIENT_TYPE,
-
-  THRIFT_APPLICATION_EXCEPTION_ERROR_N
-} ThriftApplicationExceptionError;
-
-/* define error domain for GError */
-GQuark thrift_application_exception_error_quark (void);
-#define THRIFT_APPLICATION_EXCEPTION_ERROR (thrift_application_exception_error_quark ())
-
-G_END_DECLS
-
-#endif /* _THRIFT_APPLICATION_EXCEPTION_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.c
deleted file mode 100644
index f24f2a1..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include "thrift_struct.h"
-
-G_DEFINE_ABSTRACT_TYPE(ThriftStruct, thrift_struct, G_TYPE_OBJECT)
-
-gint32
-thrift_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
-                    GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_STRUCT (object), -1);
-  return THRIFT_STRUCT_GET_CLASS (object)->read (object, protocol, error);
-}
-
-gint32
-thrift_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
-                     GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_STRUCT (object), -1);
-  return THRIFT_STRUCT_GET_CLASS (object)->write (object, protocol, error);
-}
-
-static void
-thrift_struct_class_init (ThriftStructClass *cls)
-{
-  cls->read = thrift_struct_read;
-  cls->write = thrift_struct_write;
-}
-
-static void
-thrift_struct_init (ThriftStruct *structure)
-{
-  THRIFT_UNUSED_VAR (structure);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.h
deleted file mode 100644
index f4cfcb2..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/thrift_struct.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef THRIFT_STRUCT_H
-#define THRIFT_STRUCT_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-
-G_BEGIN_DECLS
-
-#define THRIFT_TYPE_STRUCT (thrift_struct_get_type ())
-#define THRIFT_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_STRUCT, ThriftStruct))
-#define THRIFT_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_STRUCT, ThriftStructClass))
-#define THRIFT_IS_STRUCT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_STRUCT))
-#define THRIFT_IS_STRUCT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_STRUCT))
-#define THRIFT_STRUCT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_STRUCT, ThriftStructClass))
-
-typedef struct _ThriftStruct ThriftStruct;
-
-/* struct */
-struct _ThriftStruct
-{
-  GObject parent;
-
-  /* private */
-};
-
-typedef struct _ThriftStructClass ThriftStructClass;
-
-struct _ThriftStructClass
-{
-  GObjectClass parent;
-
-  /* public */
-  gint32 (*read) (ThriftStruct *object, ThriftProtocol *protocol,
-                  GError **error);
-  gint32 (*write) (ThriftStruct *object, ThriftProtocol *protocol,
-                   GError **error);
-};
-
-GType thrift_struct_get_type (void);
-
-gint32 thrift_struct_read (ThriftStruct *object, ThriftProtocol *protocol,
-                           GError **error);
-
-gint32 thrift_struct_write (ThriftStruct *object, ThriftProtocol *protocol,
-                            GError **error);
-G_END_DECLS
-
-#endif


[33/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.cc
deleted file mode 100644
index 91f3d0a..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.cc
+++ /dev/null
@@ -1,1081 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <map>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_generator.h"
-#include "t_html_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::pair;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-enum input_type { INPUT_UNKNOWN, INPUT_UTF8, INPUT_PLAIN };
-
-/**
- * HTML code generator
- *
- * mostly copy/pasting/tweaking from mcslee's work.
- */
-class t_html_generator : public t_generator {
-public:
-  t_html_generator(t_program* program,
-                   const std::map<std::string, std::string>& parsed_options,
-                   const std::string& option_string)
-    : t_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-html";
-    input_type_ = INPUT_UNKNOWN;
-
-    std::map<std::string, std::string>::const_iterator iter;
-    iter = parsed_options.find("standalone");
-    standalone_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("noescape");
-    unsafe_ = (iter != parsed_options.end());
-
-    escape_.clear();
-    escape_['&'] = "&amp;";
-    escape_['<'] = "&lt;";
-    escape_['>'] = "&gt;";
-    escape_['"'] = "&quot;";
-    escape_['\''] = "&apos;";
-
-    init_allowed__markup();
-  }
-
-  void generate_program();
-  void generate_program_toc();
-  void generate_program_toc_row(t_program* tprog);
-  void generate_program_toc_rows(t_program* tprog, std::vector<t_program*>& finished);
-  void generate_index();
-  std::string escape_html(std::string const& str);
-  std::string escape_html_tags(std::string const& str);
-  void generate_css();
-  void generate_css_content(std::ofstream& f_target);
-  void generate_style_tag();
-  std::string make_file_link(std::string name);
-  bool is_utf8_sequence(std::string const& str, size_t firstpos);
-  void detect_input_encoding(std::string const& str, size_t firstpos);
-  void init_allowed__markup();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_service(t_service* tservice);
-  void generate_xception(t_struct* txception);
-
-  void print_doc(t_doc* tdoc);
-  int print_type(t_type* ttype);
-  void print_const_value(t_type* type, t_const_value* tvalue);
-  void print_fn_args_doc(t_function* tfunction);
-
-private:
-  std::ofstream f_out_;
-  std::string current_file_;
-  input_type input_type_;
-  std::map<std::string, int> allowed_markup;
-  bool standalone_;
-  bool unsafe_;
-};
-
-/**
- * Emits the Table of Contents links at the top of the module's page
- */
-void t_html_generator::generate_program_toc() {
-  f_out_ << "<table class=\"table-bordered table-striped "
-            "table-condensed\"><thead><th>Module</th><th>Services</th>"
-         << "<th>Data types</th><th>Constants</th></thead>" << endl;
-  generate_program_toc_row(program_);
-  f_out_ << "</table>" << endl;
-}
-
-/**
- * Recurses through from the provided program and generates a ToC row
- * for each discovered program exactly once by maintaining the list of
- * completed rows in 'finished'
- */
-void t_html_generator::generate_program_toc_rows(t_program* tprog,
-                                                 std::vector<t_program*>& finished) {
-  for (vector<t_program*>::iterator iter = finished.begin(); iter != finished.end(); iter++) {
-    if (tprog->get_path() == (*iter)->get_path()) {
-      return;
-    }
-  }
-  finished.push_back(tprog);
-  generate_program_toc_row(tprog);
-  vector<t_program*> includes = tprog->get_includes();
-  for (vector<t_program*>::iterator iter = includes.begin(); iter != includes.end(); iter++) {
-    generate_program_toc_rows(*iter, finished);
-  }
-}
-
-/**
- * Emits the Table of Contents links at the top of the module's page
- */
-void t_html_generator::generate_program_toc_row(t_program* tprog) {
-  string fname = tprog->get_name() + ".html";
-  f_out_ << "<tr>" << endl << "<td>" << tprog->get_name() << "</td><td>";
-  if (!tprog->get_services().empty()) {
-    vector<t_service*> services = tprog->get_services();
-    vector<t_service*>::iterator sv_iter;
-    for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-      string name = get_service_name(*sv_iter);
-      f_out_ << "<a href=\"" << make_file_link(fname) << "#Svc_" << name << "\">" << name
-             << "</a><br/>" << endl;
-      f_out_ << "<ul>" << endl;
-      map<string, string> fn_html;
-      vector<t_function*> functions = (*sv_iter)->get_functions();
-      vector<t_function*>::iterator fn_iter;
-      for (fn_iter = functions.begin(); fn_iter != functions.end(); ++fn_iter) {
-        string fn_name = (*fn_iter)->get_name();
-        string html = "<li><a href=\"" + make_file_link(fname) + "#Fn_" + name + "_" + fn_name
-                      + "\">" + fn_name + "</a></li>";
-        fn_html.insert(pair<string, string>(fn_name, html));
-      }
-      for (map<string, string>::iterator html_iter = fn_html.begin(); html_iter != fn_html.end();
-           html_iter++) {
-        f_out_ << html_iter->second << endl;
-      }
-      f_out_ << "</ul>" << endl;
-    }
-  }
-  f_out_ << "</td>" << endl << "<td>";
-  map<string, string> data_types;
-  if (!tprog->get_enums().empty()) {
-    vector<t_enum*> enums = tprog->get_enums();
-    vector<t_enum*>::iterator en_iter;
-    for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-      string name = (*en_iter)->get_name();
-      // f_out_ << "<a href=\"" << make_file_link(fname) << "#Enum_" << name << "\">" << name
-      // <<  "</a><br/>" << endl;
-      string html = "<a href=\"" + make_file_link(fname) + "#Enum_" + name + "\">" + name + "</a>";
-      data_types.insert(pair<string, string>(name, html));
-    }
-  }
-  if (!tprog->get_typedefs().empty()) {
-    vector<t_typedef*> typedefs = tprog->get_typedefs();
-    vector<t_typedef*>::iterator td_iter;
-    for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-      string name = (*td_iter)->get_symbolic();
-      // f_out_ << "<a href=\"" << make_file_link(fname) << "#Typedef_" << name << "\">" << name
-      // << "</a><br/>" << endl;
-      string html = "<a href=\"" + make_file_link(fname) + "#Typedef_" + name + "\">" + name
-                    + "</a>";
-      data_types.insert(pair<string, string>(name, html));
-    }
-  }
-  if (!tprog->get_objects().empty()) {
-    vector<t_struct*> objects = tprog->get_objects();
-    vector<t_struct*>::iterator o_iter;
-    for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-      string name = (*o_iter)->get_name();
-      // f_out_ << "<a href=\"" << make_file_link(fname) << "#Struct_" << name << "\">" << name
-      //<< "</a><br/>" << endl;
-      string html = "<a href=\"" + make_file_link(fname) + "#Struct_" + name + "\">" + name
-                    + "</a>";
-      data_types.insert(pair<string, string>(name, html));
-    }
-  }
-  for (map<string, string>::iterator dt_iter = data_types.begin(); dt_iter != data_types.end();
-       dt_iter++) {
-    f_out_ << dt_iter->second << "<br/>" << endl;
-  }
-  f_out_ << "</td>" << endl << "<td>";
-  if (!tprog->get_consts().empty()) {
-    map<string, string> const_html;
-    vector<t_const*> consts = tprog->get_consts();
-    vector<t_const*>::iterator con_iter;
-    for (con_iter = consts.begin(); con_iter != consts.end(); ++con_iter) {
-      string name = (*con_iter)->get_name();
-      string html = "<code><a href=\"" + make_file_link(fname) + "#Const_" + name + "\">" + name
-                    + "</a></code>";
-      const_html.insert(pair<string, string>(name, html));
-    }
-    for (map<string, string>::iterator con_iter = const_html.begin(); con_iter != const_html.end();
-         con_iter++) {
-      f_out_ << con_iter->second << "<br/>" << endl;
-    }
-  }
-  f_out_ << "</code></td>" << endl << "</tr>";
-}
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * stream.
- */
-void t_html_generator::generate_program() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  current_file_ = program_->get_name() + ".html";
-  string fname = get_out_dir() + current_file_;
-  f_out_.open(fname.c_str());
-  f_out_ << "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"" << endl;
-  f_out_ << "    \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">" << endl;
-  f_out_ << "<html xmlns=\"http://www.w3.org/1999/xhtml\">" << endl;
-  f_out_ << "<head>" << endl;
-  f_out_ << "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\" />" << endl;
-  generate_style_tag();
-  f_out_ << "<title>Thrift module: " << program_->get_name() << "</title></head><body>" << endl
-         << "<div class=\"container-fluid\">" << endl
-         << "<h1>Thrift module: " << program_->get_name() << "</h1>" << endl;
-
-  print_doc(program_);
-
-  generate_program_toc();
-
-  if (!program_->get_consts().empty()) {
-    f_out_ << "<hr/><h2 id=\"Constants\">Constants</h2>" << endl;
-    vector<t_const*> consts = program_->get_consts();
-    f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
-    f_out_ << "<thead><th>Constant</th><th>Type</th><th>Value</th></thead>" << endl;
-    generate_consts(consts);
-    f_out_ << "</table>";
-  }
-
-  if (!program_->get_enums().empty()) {
-    f_out_ << "<hr/><h2 id=\"Enumerations\">Enumerations</h2>" << endl;
-    // Generate enums
-    vector<t_enum*> enums = program_->get_enums();
-    vector<t_enum*>::iterator en_iter;
-    for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-      generate_enum(*en_iter);
-    }
-  }
-
-  if (!program_->get_typedefs().empty()) {
-    f_out_ << "<hr/><h2 id=\"Typedefs\">Type declarations</h2>" << endl;
-    // Generate typedefs
-    vector<t_typedef*> typedefs = program_->get_typedefs();
-    vector<t_typedef*>::iterator td_iter;
-    for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-      generate_typedef(*td_iter);
-    }
-  }
-
-  if (!program_->get_objects().empty()) {
-    f_out_ << "<hr/><h2 id=\"Structs\">Data structures</h2>" << endl;
-    // Generate structs and exceptions in declared order
-    vector<t_struct*> objects = program_->get_objects();
-    vector<t_struct*>::iterator o_iter;
-    for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-      if ((*o_iter)->is_xception()) {
-        generate_xception(*o_iter);
-      } else {
-        generate_struct(*o_iter);
-      }
-    }
-  }
-
-  if (!program_->get_services().empty()) {
-    f_out_ << "<hr/><h2 id=\"Services\">Services</h2>" << endl;
-    // Generate services
-    vector<t_service*> services = program_->get_services();
-    vector<t_service*>::iterator sv_iter;
-    for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-      service_name_ = get_service_name(*sv_iter);
-      generate_service(*sv_iter);
-    }
-  }
-
-  f_out_ << "</div></body></html>" << endl;
-  f_out_.close();
-
-  generate_index();
-  generate_css();
-}
-
-/**
- * Emits the index.html file for the recursive set of Thrift programs
- */
-void t_html_generator::generate_index() {
-  current_file_ = "index.html";
-  string index_fname = get_out_dir() + current_file_;
-  f_out_.open(index_fname.c_str());
-  f_out_ << "<html><head>" << endl;
-  generate_style_tag();
-  f_out_ << "<title>All Thrift declarations</title></head><body>" << endl
-         << "<div class=\"container-fluid\">" << endl << "<h1>All Thrift declarations</h1>" << endl;
-  f_out_ << "<table class=\"table-bordered table-striped "
-            "table-condensed\"><thead><th>Module</th><th>Services</th><th>Data types</th>"
-         << "<th>Constants</th></thead>" << endl;
-  vector<t_program*> programs;
-  generate_program_toc_rows(program_, programs);
-  f_out_ << "</table>" << endl;
-  f_out_ << "</div></body></html>" << endl;
-  f_out_.close();
-}
-
-void t_html_generator::generate_css() {
-  if (!standalone_) {
-    current_file_ = "style.css";
-    string css_fname = get_out_dir() + current_file_;
-    f_out_.open(css_fname.c_str());
-    generate_css_content(f_out_);
-    f_out_.close();
-  }
-}
-
-void t_html_generator::generate_css_content(std::ofstream& f_target) {
-  f_target << BOOTSTRAP_CSS() << endl;
-  f_target << "/* Auto-generated CSS for generated Thrift docs */" << endl;
-  f_target << "h3, h4 { margin-bottom: 6px; }" << endl;
-  f_target << "div.definition { border: 1px solid #CCC; margin-bottom: 10px; padding: 10px; }"
-           << endl;
-  f_target << "div.extends { margin: -0.5em 0 1em 5em }" << endl;
-  f_target << "td { vertical-align: top; }" << endl;
-  f_target << "table { empty-cells: show; }" << endl;
-  f_target << "code { line-height: 20px; }" << endl;
-  f_target << ".table-bordered th, .table-bordered td { border-bottom: 1px solid #DDDDDD; }"
-           << endl;
-}
-
-/**
- * Generates the CSS tag.
- * Depending on "standalone", either a CSS file link (default), or the entire CSS is embedded
- * inline.
- */
-void t_html_generator::generate_style_tag() {
-  if (!standalone_) {
-    f_out_ << "<link href=\"style.css\" rel=\"stylesheet\" type=\"text/css\"/>" << endl;
-  } else {
-    f_out_ << "<style type=\"text/css\"/><!--" << endl;
-    generate_css_content(f_out_);
-    f_out_ << "--></style>" << endl;
-  }
-}
-
-/**
- * Returns the target file for a <a href> link
- * The returned string is empty, whenever filename refers to the current file.
- */
-std::string t_html_generator::make_file_link(std::string filename) {
-  return (current_file_.compare(filename) != 0) ? filename : "";
-}
-
-/**
- * If the provided documentable object has documentation attached, this
- * will emit it to the output stream in HTML format.
- */
-void t_html_generator::print_doc(t_doc* tdoc) {
-  if (tdoc->has_doc()) {
-    if (unsafe_) {
-      f_out_ << tdoc->get_doc() << "<br/>";
-    } else {
-      f_out_ << escape_html(tdoc->get_doc()) << "<br/>";
-    }
-  }
-}
-
-bool t_html_generator::is_utf8_sequence(std::string const& str, size_t firstpos) {
-  // leading char determines the length of the sequence
-  unsigned char c = str.at(firstpos);
-  int count = 0;
-  if ((c & 0xE0) == 0xC0) {
-    count = 1;
-  } else if ((c & 0xF0) == 0xE0) {
-    count = 2;
-  } else if ((c & 0xF8) == 0xF0) {
-    count = 3;
-  } else if ((c & 0xFC) == 0xF8) {
-    count = 4;
-  } else if ((c & 0xFE) == 0xFC) {
-    count = 5;
-  } else {
-    // pdebug("UTF-8 test: char '%c' (%d) is not a valid UTF-8 leading byte", c, int(c));
-    return false; // no UTF-8
-  }
-
-  // following chars
-  size_t pos = firstpos + 1;
-  while ((pos < str.length()) && (0 < count)) {
-    c = str.at(pos);
-    if ((c & 0xC0) != 0x80) {
-      // pdebug("UTF-8 test: char '%c' (%d) is not a valid UTF-8 following byte", c, int(c));
-      return false; // no UTF-8
-    }
-    --count;
-    ++pos;
-  }
-
-  // true if the sequence is complete
-  return (0 == count);
-}
-
-void t_html_generator::detect_input_encoding(std::string const& str, size_t firstpos) {
-  if (is_utf8_sequence(str, firstpos)) {
-    pdebug("Input seems to be already UTF-8 encoded");
-    input_type_ = INPUT_UTF8;
-    return;
-  }
-
-  // fallback
-  pwarning(1, "Input is not UTF-8, treating as plain ANSI");
-  input_type_ = INPUT_PLAIN;
-}
-
-void t_html_generator::init_allowed__markup() {
-  allowed_markup.clear();
-  // standalone tags
-  allowed_markup["br"] = 1;
-  allowed_markup["br/"] = 1;
-  allowed_markup["img"] = 1;
-  // paired tags
-  allowed_markup["b"] = 1;
-  allowed_markup["/b"] = 1;
-  allowed_markup["u"] = 1;
-  allowed_markup["/u"] = 1;
-  allowed_markup["i"] = 1;
-  allowed_markup["/i"] = 1;
-  allowed_markup["s"] = 1;
-  allowed_markup["/s"] = 1;
-  allowed_markup["big"] = 1;
-  allowed_markup["/big"] = 1;
-  allowed_markup["small"] = 1;
-  allowed_markup["/small"] = 1;
-  allowed_markup["sup"] = 1;
-  allowed_markup["/sup"] = 1;
-  allowed_markup["sub"] = 1;
-  allowed_markup["/sub"] = 1;
-  allowed_markup["pre"] = 1;
-  allowed_markup["/pre"] = 1;
-  allowed_markup["tt"] = 1;
-  allowed_markup["/tt"] = 1;
-  allowed_markup["ul"] = 1;
-  allowed_markup["/ul"] = 1;
-  allowed_markup["ol"] = 1;
-  allowed_markup["/ol"] = 1;
-  allowed_markup["li"] = 1;
-  allowed_markup["/li"] = 1;
-  allowed_markup["a"] = 1;
-  allowed_markup["/a"] = 1;
-  allowed_markup["p"] = 1;
-  allowed_markup["/p"] = 1;
-  allowed_markup["code"] = 1;
-  allowed_markup["/code"] = 1;
-  allowed_markup["dl"] = 1;
-  allowed_markup["/dl"] = 1;
-  allowed_markup["dt"] = 1;
-  allowed_markup["/dt"] = 1;
-  allowed_markup["dd"] = 1;
-  allowed_markup["/dd"] = 1;
-  allowed_markup["h1"] = 1;
-  allowed_markup["/h1"] = 1;
-  allowed_markup["h2"] = 1;
-  allowed_markup["/h2"] = 1;
-  allowed_markup["h3"] = 1;
-  allowed_markup["/h3"] = 1;
-  allowed_markup["h4"] = 1;
-  allowed_markup["/h4"] = 1;
-  allowed_markup["h5"] = 1;
-  allowed_markup["/h5"] = 1;
-  allowed_markup["h6"] = 1;
-  allowed_markup["/h6"] = 1;
-}
-
-std::string t_html_generator::escape_html_tags(std::string const& str) {
-  std::ostringstream result;
-
-  unsigned char c = '?';
-  size_t lastpos;
-  size_t firstpos = 0;
-  while (firstpos < str.length()) {
-
-    // look for non-ASCII char
-    lastpos = firstpos;
-    while (lastpos < str.length()) {
-      c = str.at(lastpos);
-      if (('<' == c) || ('>' == c)) {
-        break;
-      }
-      ++lastpos;
-    }
-
-    // copy what we got so far
-    if (lastpos > firstpos) {
-      result << str.substr(firstpos, lastpos - firstpos);
-      firstpos = lastpos;
-    }
-
-    // reached the end?
-    if (firstpos >= str.length()) {
-      break;
-    }
-
-    // tag end without corresponding begin
-    ++firstpos;
-    if ('>' == c) {
-      result << "&gt;";
-      continue;
-    }
-
-    // extract the tag
-    std::ostringstream tagstream;
-    while (firstpos < str.length()) {
-      c = str.at(firstpos);
-      ++firstpos;
-      if ('<' == c) {
-        tagstream << "&lt;"; // nested begin?
-      } else if ('>' == c) {
-        break;
-      } else {
-        tagstream << c; // not very efficient, but tags should be quite short
-      }
-    }
-
-    // we allow for several markup in docstrings, all else will become escaped
-    string tag_content = tagstream.str();
-    string tag_key = tag_content;
-    size_t first_white = tag_key.find_first_of(" \t\f\v\n\r");
-    if (first_white != string::npos) {
-      tag_key.erase(first_white);
-    }
-    for (std::string::size_type i = 0; i < tag_key.length(); ++i) {
-      tag_key[i] = tolower(tag_key[i]);
-    }
-    if (allowed_markup.find(tag_key) != allowed_markup.end()) {
-      result << "<" << tag_content << ">";
-    } else {
-      result << "&lt;" << tagstream.str() << "&gt;";
-      pverbose("illegal markup <%s> in doc-comment\n", tag_key.c_str());
-    }
-  }
-
-  return result.str();
-}
-
-std::string t_html_generator::escape_html(std::string const& str) {
-  // the generated HTML header says it is UTF-8 encoded
-  // if UTF-8 input has been detected before, we don't need to change anything
-  if (input_type_ == INPUT_UTF8) {
-    return escape_html_tags(str);
-  }
-
-  // convert unsafe chars to their &#<num>; equivalent
-  std::ostringstream result;
-  unsigned char c = '?';
-  unsigned int ic = 0;
-  size_t lastpos;
-  size_t firstpos = 0;
-  while (firstpos < str.length()) {
-
-    // look for non-ASCII char
-    lastpos = firstpos;
-    while (lastpos < str.length()) {
-      c = str.at(lastpos);
-      ic = c;
-      if ((32 > ic) || (127 < ic)) {
-        break;
-      }
-      ++lastpos;
-    }
-
-    // copy what we got so far
-    if (lastpos > firstpos) {
-      result << str.substr(firstpos, lastpos - firstpos);
-      firstpos = lastpos;
-    }
-
-    // reached the end?
-    if (firstpos >= str.length()) {
-      break;
-    }
-
-    // some control code?
-    if (ic <= 31) {
-      switch (c) {
-      case '\r':
-      case '\n':
-      case '\t':
-        result << c;
-        break;
-      default: // silently consume all other ctrl chars
-        break;
-      }
-      ++firstpos;
-      continue;
-    }
-
-    // reached the end?
-    if (firstpos >= str.length()) {
-      break;
-    }
-
-    // try to detect input encoding
-    if (input_type_ == INPUT_UNKNOWN) {
-      detect_input_encoding(str, firstpos);
-      if (input_type_ == INPUT_UTF8) {
-        lastpos = str.length();
-        result << str.substr(firstpos, lastpos - firstpos);
-        break;
-      }
-    }
-
-    // convert the character to something useful based on the detected encoding
-    switch (input_type_) {
-    case INPUT_PLAIN:
-      result << "&#" << ic << ";";
-      ++firstpos;
-      break;
-    default:
-      throw "Unexpected or unrecognized input encoding";
-    }
-  }
-
-  return escape_html_tags(result.str());
-}
-
-/**
- * Prints out the provided type in HTML
- */
-int t_html_generator::print_type(t_type* ttype) {
-  std::string::size_type len = 0;
-  f_out_ << "<code>";
-  if (ttype->is_container()) {
-    if (ttype->is_list()) {
-      f_out_ << "list&lt;";
-      len = 6 + print_type(((t_list*)ttype)->get_elem_type());
-      f_out_ << "&gt;";
-    } else if (ttype->is_set()) {
-      f_out_ << "set&lt;";
-      len = 5 + print_type(((t_set*)ttype)->get_elem_type());
-      f_out_ << "&gt;";
-    } else if (ttype->is_map()) {
-      f_out_ << "map&lt;";
-      len = 5 + print_type(((t_map*)ttype)->get_key_type());
-      f_out_ << ", ";
-      len += print_type(((t_map*)ttype)->get_val_type());
-      f_out_ << "&gt;";
-    }
-  } else if (ttype->is_base_type()) {
-    f_out_ << (((t_base_type*)ttype)->is_binary() ? "binary" : ttype->get_name());
-    len = ttype->get_name().size();
-  } else {
-    string prog_name = ttype->get_program()->get_name();
-    string type_name = ttype->get_name();
-    f_out_ << "<a href=\"" << make_file_link(prog_name + ".html") << "#";
-    if (ttype->is_typedef()) {
-      f_out_ << "Typedef_";
-    } else if (ttype->is_struct() || ttype->is_xception()) {
-      f_out_ << "Struct_";
-    } else if (ttype->is_enum()) {
-      f_out_ << "Enum_";
-    } else if (ttype->is_service()) {
-      f_out_ << "Svc_";
-    }
-    f_out_ << type_name << "\">";
-    len = type_name.size();
-    if (ttype->get_program() != program_) {
-      f_out_ << prog_name << ".";
-      len += prog_name.size() + 1;
-    }
-    f_out_ << type_name << "</a>";
-  }
-  f_out_ << "</code>";
-  return (int)len;
-}
-
-/**
- * Prints out an HTML representation of the provided constant value
- */
-void t_html_generator::print_const_value(t_type* type, t_const_value* tvalue) {
-
-  // if tvalue is an identifier, the constant content is already shown elsewhere
-  if (tvalue->get_type() == t_const_value::CV_IDENTIFIER) {
-    string fname = program_->get_name() + ".html";
-    string name = escape_html(tvalue->get_identifier());
-    f_out_ << "<code><a href=\"" + make_file_link(fname) + "#Const_" + name + "\">" + name
-              + "</a></code>";
-    return;
-  }
-
-  t_type* truetype = type;
-  while (truetype->is_typedef()) {
-    truetype = ((t_typedef*)truetype)->get_type();
-  }
-
-  bool first = true;
-  if (truetype->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)truetype)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      f_out_ << '"' << escape_html(get_escaped_string(tvalue)) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      f_out_ << ((tvalue->get_integer() != 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-      f_out_ << tvalue->get_integer();
-      break;
-    case t_base_type::TYPE_I16:
-      f_out_ << tvalue->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      f_out_ << tvalue->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      f_out_ << tvalue->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (tvalue->get_type() == t_const_value::CV_INTEGER) {
-        f_out_ << tvalue->get_integer();
-      } else {
-        f_out_ << tvalue->get_double();
-      }
-      break;
-    default:
-      f_out_ << "UNKNOWN BASE TYPE";
-      break;
-    }
-  } else if (truetype->is_enum()) {
-    f_out_ << escape_html(truetype->get_name()) << "."
-           << escape_html(tvalue->get_identifier_name());
-  } else if (truetype->is_struct() || truetype->is_xception()) {
-    f_out_ << "{ ";
-    const vector<t_field*>& fields = ((t_struct*)truetype)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = tvalue->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + truetype->get_name() + " has no field "
-            + v_iter->first->get_string();
-      }
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      f_out_ << escape_html(v_iter->first->get_string()) << " = ";
-      print_const_value(field_type, v_iter->second);
-    }
-    f_out_ << " }";
-  } else if (truetype->is_map()) {
-    f_out_ << "{ ";
-    map<t_const_value*, t_const_value*> map_elems = tvalue->get_map();
-    map<t_const_value*, t_const_value*>::iterator map_iter;
-    for (map_iter = map_elems.begin(); map_iter != map_elems.end(); map_iter++) {
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      print_const_value(((t_map*)truetype)->get_key_type(), map_iter->first);
-      f_out_ << " = ";
-      print_const_value(((t_map*)truetype)->get_val_type(), map_iter->second);
-    }
-    f_out_ << " }";
-  } else if (truetype->is_list()) {
-    f_out_ << "{ ";
-    vector<t_const_value*> list_elems = tvalue->get_list();
-    ;
-    vector<t_const_value*>::iterator list_iter;
-    for (list_iter = list_elems.begin(); list_iter != list_elems.end(); list_iter++) {
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      print_const_value(((t_list*)truetype)->get_elem_type(), *list_iter);
-    }
-    f_out_ << " }";
-  } else if (truetype->is_set()) {
-    f_out_ << "{ ";
-    vector<t_const_value*> list_elems = tvalue->get_list();
-    ;
-    vector<t_const_value*>::iterator list_iter;
-    for (list_iter = list_elems.begin(); list_iter != list_elems.end(); list_iter++) {
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      print_const_value(((t_set*)truetype)->get_elem_type(), *list_iter);
-    }
-    f_out_ << " }";
-  } else {
-    f_out_ << "UNKNOWN TYPE";
-  }
-}
-
-/**
- * Prints out documentation for arguments/exceptions of a function, if any documentation has been
- * supplied.
- */
-void t_html_generator::print_fn_args_doc(t_function* tfunction) {
-  bool has_docs = false;
-  vector<t_field*> args = tfunction->get_arglist()->get_members();
-  vector<t_field*>::iterator arg_iter = args.begin();
-  if (arg_iter != args.end()) {
-    for (; arg_iter != args.end(); arg_iter++) {
-      if ((*arg_iter)->has_doc() && !(*arg_iter)->get_doc().empty())
-        has_docs = true;
-    }
-    if (has_docs) {
-      arg_iter = args.begin();
-      f_out_ << "<br/><h4 id=\"Parameters_" << service_name_ << "_" << tfunction->get_name()
-             << "\">Parameters</h4>" << endl;
-      f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
-      f_out_ << "<thead><th>Name</th><th>Description</th></thead>";
-      for (; arg_iter != args.end(); arg_iter++) {
-        f_out_ << "<tr><td>" << (*arg_iter)->get_name();
-        f_out_ << "</td><td>";
-        f_out_ << escape_html((*arg_iter)->get_doc());
-        f_out_ << "</td></tr>" << endl;
-      }
-      f_out_ << "</table>";
-    }
-  }
-
-  has_docs = false;
-  vector<t_field*> excepts = tfunction->get_xceptions()->get_members();
-  vector<t_field*>::iterator ex_iter = excepts.begin();
-  if (ex_iter != excepts.end()) {
-    for (; ex_iter != excepts.end(); ex_iter++) {
-      if ((*ex_iter)->has_doc() && !(*ex_iter)->get_doc().empty())
-        has_docs = true;
-    }
-    if (has_docs) {
-      ex_iter = excepts.begin();
-      f_out_ << "<br/><h4 id=\"Exceptions_" << service_name_ << "_" << tfunction->get_name()
-             << "\">Exceptions</h4>" << endl;
-      f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
-      f_out_ << "<thead><th>Type</th><th>Description</th></thead>";
-      for (; ex_iter != excepts.end(); ex_iter++) {
-        f_out_ << "<tr><td>" << (*ex_iter)->get_type()->get_name();
-        f_out_ << "</td><td>";
-        f_out_ << escape_html((*ex_iter)->get_doc());
-        f_out_ << "</td></tr>" << endl;
-      }
-      f_out_ << "</table>";
-    }
-  }
-}
-
-/**
- * Generates a typedef.
- *
- * @param ttypedef The type definition
- */
-void t_html_generator::generate_typedef(t_typedef* ttypedef) {
-  string name = ttypedef->get_name();
-  f_out_ << "<div class=\"definition\">";
-  f_out_ << "<h3 id=\"Typedef_" << name << "\">Typedef: " << name << "</h3>" << endl;
-  f_out_ << "<p><strong>Base type:</strong>&nbsp;";
-  print_type(ttypedef->get_type());
-  f_out_ << "</p>" << endl;
-  print_doc(ttypedef);
-  f_out_ << "</div>" << endl;
-}
-
-/**
- * Generates code for an enumerated type.
- *
- * @param tenum The enumeration
- */
-void t_html_generator::generate_enum(t_enum* tenum) {
-  string name = tenum->get_name();
-  f_out_ << "<div class=\"definition\">";
-  f_out_ << "<h3 id=\"Enum_" << name << "\">Enumeration: " << name << "</h3>" << endl;
-  print_doc(tenum);
-  vector<t_enum_value*> values = tenum->get_constants();
-  vector<t_enum_value*>::iterator val_iter;
-  f_out_ << "<br/><table class=\"table-bordered table-striped table-condensed\">" << endl;
-  for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
-    f_out_ << "<tr><td><code>";
-    f_out_ << (*val_iter)->get_name();
-    f_out_ << "</code></td><td><code>";
-    f_out_ << (*val_iter)->get_value();
-    f_out_ << "</code></td><td>" << endl;
-    print_doc((*val_iter));
-    f_out_ << "</td></tr>" << endl;
-  }
-  f_out_ << "</table></div>" << endl;
-}
-
-/**
- * Generates a constant value
- */
-void t_html_generator::generate_const(t_const* tconst) {
-  string name = tconst->get_name();
-  f_out_ << "<tr id=\"Const_" << name << "\"><td><code>" << name << "</code></td><td>";
-  print_type(tconst->get_type());
-  f_out_ << "</td><td><code>";
-  print_const_value(tconst->get_type(), tconst->get_value());
-  f_out_ << "</code></td></tr>";
-  if (tconst->has_doc()) {
-    f_out_ << "<tr><td colspan=\"3\"><blockquote>";
-    print_doc(tconst);
-    f_out_ << "</blockquote></td></tr>";
-  }
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_html_generator::generate_struct(t_struct* tstruct) {
-  string name = tstruct->get_name();
-  f_out_ << "<div class=\"definition\">";
-  f_out_ << "<h3 id=\"Struct_" << name << "\">";
-  if (tstruct->is_xception()) {
-    f_out_ << "Exception: ";
-  } else if (tstruct->is_union()) {
-    f_out_ << "Union: ";
-  } else {
-    f_out_ << "Struct: ";
-  }
-  f_out_ << name << "</h3>" << endl;
-  vector<t_field*> members = tstruct->get_members();
-  vector<t_field*>::iterator mem_iter = members.begin();
-  f_out_ << "<table class=\"table-bordered table-striped table-condensed\">";
-  f_out_ << "<thead><th>Key</th><th>Field</th><th>Type</th><th>Description</th><th>Requiredness</"
-            "th><th>Default value</th></thead>" << endl;
-  for (; mem_iter != members.end(); mem_iter++) {
-    f_out_ << "<tr><td>" << (*mem_iter)->get_key() << "</td><td>";
-    f_out_ << (*mem_iter)->get_name();
-    f_out_ << "</td><td>";
-    print_type((*mem_iter)->get_type());
-    f_out_ << "</td><td>";
-    f_out_ << escape_html((*mem_iter)->get_doc());
-    f_out_ << "</td><td>";
-    if ((*mem_iter)->get_req() == t_field::T_OPTIONAL) {
-      f_out_ << "optional";
-    } else if ((*mem_iter)->get_req() == t_field::T_REQUIRED) {
-      f_out_ << "required";
-    } else {
-      f_out_ << "default";
-    }
-    f_out_ << "</td><td>";
-    t_const_value* default_val = (*mem_iter)->get_value();
-    if (default_val != NULL) {
-      f_out_ << "<code>";
-      print_const_value((*mem_iter)->get_type(), default_val);
-      f_out_ << "</code>";
-    }
-    f_out_ << "</td></tr>" << endl;
-  }
-  f_out_ << "</table><br/>";
-  print_doc(tstruct);
-  f_out_ << "</div>";
-}
-
-/**
- * Exceptions are special structs
- *
- * @param tstruct The struct definition
- */
-void t_html_generator::generate_xception(t_struct* txception) {
-  generate_struct(txception);
-}
-
-/**
- * Generates the HTML block for a Thrift service.
- *
- * @param tservice The service definition
- */
-void t_html_generator::generate_service(t_service* tservice) {
-  f_out_ << "<h3 id=\"Svc_" << service_name_ << "\">Service: " << service_name_ << "</h3>" << endl;
-
-  if (tservice->get_extends()) {
-    f_out_ << "<div class=\"extends\"><em>extends</em> ";
-    print_type(tservice->get_extends());
-    f_out_ << "</div>\n";
-  }
-  print_doc(tservice);
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator fn_iter = functions.begin();
-  for (; fn_iter != functions.end(); fn_iter++) {
-    string fn_name = (*fn_iter)->get_name();
-    f_out_ << "<div class=\"definition\">";
-    f_out_ << "<h4 id=\"Fn_" << service_name_ << "_" << fn_name << "\">Function: " << service_name_
-           << "." << fn_name << "</h4>" << endl;
-    f_out_ << "<pre>";
-    std::string::size_type offset = print_type((*fn_iter)->get_returntype());
-    bool first = true;
-    f_out_ << " " << fn_name << "(";
-    offset += fn_name.size() + 2;
-    vector<t_field*> args = (*fn_iter)->get_arglist()->get_members();
-    vector<t_field*>::iterator arg_iter = args.begin();
-    for (; arg_iter != args.end(); arg_iter++) {
-      if (!first) {
-        f_out_ << "," << endl;
-        for (std::string::size_type i = 0; i < offset; ++i) {
-          f_out_ << " ";
-        }
-      }
-      first = false;
-      print_type((*arg_iter)->get_type());
-      f_out_ << " " << (*arg_iter)->get_name();
-      if ((*arg_iter)->get_value() != NULL) {
-        f_out_ << " = ";
-        print_const_value((*arg_iter)->get_type(), (*arg_iter)->get_value());
-      }
-    }
-    f_out_ << ")" << endl;
-    first = true;
-    vector<t_field*> excepts = (*fn_iter)->get_xceptions()->get_members();
-    vector<t_field*>::iterator ex_iter = excepts.begin();
-    if (ex_iter != excepts.end()) {
-      f_out_ << "    throws ";
-      for (; ex_iter != excepts.end(); ex_iter++) {
-        if (!first) {
-          f_out_ << ", ";
-        }
-        first = false;
-        print_type((*ex_iter)->get_type());
-      }
-      f_out_ << endl;
-    }
-    f_out_ << "</pre>";
-    print_doc(*fn_iter);
-    print_fn_args_doc(*fn_iter);
-    f_out_ << "</div>";
-  }
-}
-
-THRIFT_REGISTER_GENERATOR(
-    html,
-    "HTML",
-    "    standalone:      Self-contained mode, includes all CSS in the HTML files.\n"
-    "                     Generates no style.css file, but HTML files will be larger.\n"
-    "    noescape:        Do not escape html in doc text.\n")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.h b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.h
deleted file mode 100644
index 600b17f..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_html_generator.h
+++ /dev/null
@@ -1,240 +0,0 @@
-#define BOOTSTRAP_CSS()                                                                            \
-  "/*!\n"                                                                                          \
-  " * Bootstrap v2.0.3\n"                                                                          \
-  " *\n"                                                                                           \
-  " * Copyright 2012 Twitter, Inc\n"                                                               \
-  " * Licensed under the Apache License v2.0\n"                                                    \
-  " * http://www.apache.org/licenses/LICENSE-2.0\n"                                                \
-  " *\n"                                                                                           \
-  " * Designed and built with all the love in the world @twitter by @mdo and @fat.\n"              \
-  " */\n"                                                                                          \
-  ".clearfix{*zoom:1;}.clearfix:before,.clearfix:after{display:table;content:\"\";}\n"             \
-  ".clearfix:after{clear:both;}\n"                                                                 \
-  ".hide-text{font:0/0 "                                                                           \
-  "a;color:transparent;text-shadow:none;background-color:transparent;border:0;}\n"                 \
-  ".input-block-level{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-"    \
-  "moz-box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;}\n"                  \
-  "article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block;}\n"     \
-  "audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}\n"                            \
-  "audio:not([controls]){display:none;}\n"                                                         \
-  "html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}\n"                \
-  "a:focus{outline:thin dotted #333;outline:5px auto "                                             \
-  "-webkit-focus-ring-color;outline-offset:-2px;}\n"                                               \
-  "a:hover,a:active{outline:0;}\n"                                                                 \
-  "sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline;}\n"              \
-  "sup{top:-0.5em;}\n"                                                                             \
-  "sub{bottom:-0.25em;}\n"                                                                         \
-  "img{max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic;}\n"           \
-  "button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle;}\n"                 \
-  "button,input{*overflow:visible;line-height:normal;}\n"                                          \
-  "button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0;}\n"                        \
-  "button,input[type=\"button\"],input[type=\"reset\"],input[type=\"submit\"]{cursor:pointer;-"    \
-  "webkit-appearance:button;}\n"                                                                   \
-  "input[type=\"search\"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:"  \
-  "content-box;-webkit-appearance:textfield;}\n"                                                   \
-  "input[type=\"search\"]::-webkit-search-decoration,input[type=\"search\"]::-webkit-search-"      \
-  "cancel-button{-webkit-appearance:none;}\n"                                                      \
-  "textarea{overflow:auto;vertical-align:top;}\n"                                                  \
-  "body{margin:0;font-family:\"Helvetica "                                                         \
-  "Neue\",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;color:#333333;background-"    \
-  "color:#ffffff;}\n"                                                                              \
-  "a{color:#0088cc;text-decoration:none;}\n"                                                       \
-  "a:hover{color:#005580;text-decoration:underline;}\n"                                            \
-  ".row{margin-left:-20px;*zoom:1;}.row:before,.row:after{display:table;content:\"\";}\n"          \
-  ".row:after{clear:both;}\n"                                                                      \
-  "[class*=\"span\"]{float:left;margin-left:20px;}\n"                                              \
-  ".container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px;}\n"        \
-  ".span12{width:940px;}\n"                                                                        \
-  ".span11{width:860px;}\n"                                                                        \
-  ".span10{width:780px;}\n"                                                                        \
-  ".span9{width:700px;}\n"                                                                         \
-  ".span8{width:620px;}\n"                                                                         \
-  ".span7{width:540px;}\n"                                                                         \
-  ".span6{width:460px;}\n"                                                                         \
-  ".span5{width:380px;}\n"                                                                         \
-  ".span4{width:300px;}\n"                                                                         \
-  ".span3{width:220px;}\n"                                                                         \
-  ".span2{width:140px;}\n"                                                                         \
-  ".span1{width:60px;}\n"                                                                          \
-  ".offset12{margin-left:980px;}\n"                                                                \
-  ".offset11{margin-left:900px;}\n"                                                                \
-  ".offset10{margin-left:820px;}\n"                                                                \
-  ".offset9{margin-left:740px;}\n"                                                                 \
-  ".offset8{margin-left:660px;}\n"                                                                 \
-  ".offset7{margin-left:580px;}\n"                                                                 \
-  ".offset6{margin-left:500px;}\n"                                                                 \
-  ".offset5{margin-left:420px;}\n"                                                                 \
-  ".offset4{margin-left:340px;}\n"                                                                 \
-  ".offset3{margin-left:260px;}\n"                                                                 \
-  ".offset2{margin-left:180px;}\n"                                                                 \
-  ".offset1{margin-left:100px;}\n"                                                                 \
-  ".row-fluid{width:100%;*zoom:1;}.row-fluid:before,.row-fluid:after{display:table;content:\"\";}" \
-  "\n"                                                                                             \
-  ".row-fluid:after{clear:both;}\n"                                                                \
-  ".row-fluid "                                                                                    \
-  "[class*=\"span\"]{display:block;width:100%;min-height:28px;-webkit-box-sizing:border-box;-moz-" \
-  "box-sizing:border-box;-ms-box-sizing:border-box;box-sizing:border-box;float:left;margin-left:"  \
-  "2.127659574%;*margin-left:2.0744680846382977%;}\n"                                              \
-  ".row-fluid [class*=\"span\"]:first-child{margin-left:0;}\n"                                     \
-  ".row-fluid .span12{width:99.99999998999999%;*width:99.94680850063828%;}\n"                      \
-  ".row-fluid .span11{width:91.489361693%;*width:91.4361702036383%;}\n"                            \
-  ".row-fluid .span10{width:82.97872339599999%;*width:82.92553190663828%;}\n"                      \
-  ".row-fluid .span9{width:74.468085099%;*width:74.4148936096383%;}\n"                             \
-  ".row-fluid .span8{width:65.95744680199999%;*width:65.90425531263828%;}\n"                       \
-  ".row-fluid .span7{width:57.446808505%;*width:57.3936170156383%;}\n"                             \
-  ".row-fluid .span6{width:48.93617020799999%;*width:48.88297871863829%;}\n"                       \
-  ".row-fluid .span5{width:40.425531911%;*width:40.3723404216383%;}\n"                             \
-  ".row-fluid .span4{width:31.914893614%;*width:31.8617021246383%;}\n"                             \
-  ".row-fluid .span3{width:23.404255317%;*width:23.3510638276383%;}\n"                             \
-  ".row-fluid .span2{width:14.89361702%;*width:14.8404255306383%;}\n"                              \
-  ".row-fluid .span1{width:6.382978723%;*width:6.329787233638298%;}\n"                             \
-  ".container{margin-right:auto;margin-left:auto;*zoom:1;}.container:before,.container:after{"     \
-  "display:table;content:\"\";}\n"                                                                 \
-  ".container:after{clear:both;}\n"                                                                \
-  ".container-fluid{padding-right:20px;padding-left:20px;*zoom:1;}.container-fluid:before,."       \
-  "container-fluid:after{display:table;content:\"\";}\n"                                           \
-  ".container-fluid:after{clear:both;}\n"                                                          \
-  "p{margin:0 0 9px;font-family:\"Helvetica "                                                      \
-  "Neue\",Helvetica,Arial,sans-serif;font-size:13px;line-height:18px;}p "                          \
-  "small{font-size:11px;color:#999999;}\n"                                                         \
-  ".lead{margin-bottom:18px;font-size:20px;font-weight:200;line-height:27px;}\n"                   \
-  "h1,h2,h3,h4,h5,h6{margin:0;font-family:inherit;font-weight:bold;color:inherit;text-rendering:"  \
-  "optimizelegibility;}h1 small,h2 small,h3 small,h4 small,h5 small,h6 "                           \
-  "small{font-weight:normal;color:#999999;}\n"                                                     \
-  "h1{font-size:30px;line-height:36px;}h1 small{font-size:18px;}\n"                                \
-  "h2{font-size:24px;line-height:36px;}h2 small{font-size:18px;}\n"                                \
-  "h3{font-size:18px;line-height:27px;}h3 small{font-size:14px;}\n"                                \
-  "h4,h5,h6{line-height:18px;}\n"                                                                  \
-  "h4{font-size:14px;}h4 small{font-size:12px;}\n"                                                 \
-  "h5{font-size:12px;}\n"                                                                          \
-  "h6{font-size:11px;color:#999999;text-transform:uppercase;}\n"                                   \
-  ".page-header{padding-bottom:17px;margin:18px 0;border-bottom:1px solid #eeeeee;}\n"             \
-  ".page-header h1{line-height:1;}\n"                                                              \
-  "ul,ol{padding:0;margin:0 0 9px 25px;}\n"                                                        \
-  "ul ul,ul ol,ol ol,ol ul{margin-bottom:0;}\n"                                                    \
-  "ul{list-style:disc;}\n"                                                                         \
-  "ol{list-style:decimal;}\n"                                                                      \
-  "li{line-height:18px;}\n"                                                                        \
-  "ul.unstyled,ol.unstyled{margin-left:0;list-style:none;}\n"                                      \
-  "dl{margin-bottom:18px;}\n"                                                                      \
-  "dt,dd{line-height:18px;}\n"                                                                     \
-  "dt{font-weight:bold;line-height:17px;}\n"                                                       \
-  "dd{margin-left:9px;}\n"                                                                         \
-  ".dl-horizontal "                                                                                \
-  "dt{float:left;width:120px;clear:left;text-align:right;overflow:hidden;text-overflow:ellipsis;"  \
-  "white-space:nowrap;}\n"                                                                         \
-  ".dl-horizontal dd{margin-left:130px;}\n"                                                        \
-  "hr{margin:18px 0;border:0;border-top:1px solid #eeeeee;border-bottom:1px solid #ffffff;}\n"     \
-  "strong{font-weight:bold;}\n"                                                                    \
-  "em{font-style:italic;}\n"                                                                       \
-  ".muted{color:#999999;}\n"                                                                       \
-  "abbr[title]{cursor:help;border-bottom:1px dotted #ddd;}\n"                                      \
-  "abbr.initialism{font-size:90%;text-transform:uppercase;}\n"                                     \
-  "blockquote{padding:0 0 0 15px;margin:0 0 18px;border-left:5px solid #eeeeee;}blockquote "       \
-  "p{margin-bottom:0;font-size:16px;font-weight:300;line-height:22.5px;}\n"                        \
-  "blockquote small{display:block;line-height:18px;color:#999999;}blockquote "                     \
-  "small:before{content:'\\2014 \\00A0';}\n"                                                       \
-  "blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid "    \
-  "#eeeeee;border-left:0;}blockquote.pull-right p,blockquote.pull-right "                          \
-  "small{text-align:right;}\n"                                                                     \
-  "q:before,q:after,blockquote:before,blockquote:after{content:\"\";}\n"                           \
-  "address{display:block;margin-bottom:18px;font-style:normal;line-height:18px;}\n"                \
-  "small{font-size:100%;}\n"                                                                       \
-  "cite{font-style:normal;}\n"                                                                     \
-  "code,pre{padding:0 3px 2px;font-family:Menlo,Monaco,Consolas,\"Courier "                        \
-  "New\",monospace;font-size:12px;color:#333333;-webkit-border-radius:3px;-moz-border-radius:3px;" \
-  "border-radius:3px;}\n"                                                                          \
-  "code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8;}\n"          \
-  "pre{display:block;padding:8.5px;margin:0 0 "                                                    \
-  "9px;font-size:12.025px;line-height:18px;word-break:break-all;word-wrap:break-word;white-space:" \
-  "pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid "      \
-  "rgba(0, 0, 0, "                                                                                 \
-  "0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;}pre.prettyprint{"     \
-  "margin-bottom:18px;}\n"                                                                         \
-  "pre code{padding:0;color:inherit;background-color:transparent;border:0;}\n"                     \
-  ".pre-scrollable{max-height:340px;overflow-y:scroll;}\n"                                         \
-  ".label,.badge{font-size:10.998px;font-weight:bold;line-height:14px;color:#ffffff;vertical-"     \
-  "align:baseline;white-space:nowrap;text-shadow:0 -1px 0 rgba(0, 0, 0, "                          \
-  "0.25);background-color:#999999;}\n"                                                             \
-  ".label{padding:1px 4px "                                                                        \
-  "2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;}\n"                     \
-  ".badge{padding:1px 9px "                                                                        \
-  "2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px;}\n"                     \
-  "a.label:hover,a.badge:hover{color:#ffffff;text-decoration:none;cursor:pointer;}\n"              \
-  ".label-important,.badge-important{background-color:#b94a48;}\n"                                 \
-  ".label-important[href],.badge-important[href]{background-color:#953b39;}\n"                     \
-  ".label-warning,.badge-warning{background-color:#f89406;}\n"                                     \
-  ".label-warning[href],.badge-warning[href]{background-color:#c67605;}\n"                         \
-  ".label-success,.badge-success{background-color:#468847;}\n"                                     \
-  ".label-success[href],.badge-success[href]{background-color:#356635;}\n"                         \
-  ".label-info,.badge-info{background-color:#3a87ad;}\n"                                           \
-  ".label-info[href],.badge-info[href]{background-color:#2d6987;}\n"                               \
-  ".label-inverse,.badge-inverse{background-color:#333333;}\n"                                     \
-  ".label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a;}\n"                         \
-  "table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0;}"  \
-  "\n"                                                                                             \
-  ".table{width:100%;margin-bottom:18px;}.table th,.table "                                        \
-  "td{padding:8px;line-height:18px;text-align:left;vertical-align:top;border-top:1px solid "       \
-  "#dddddd;}\n"                                                                                    \
-  ".table th{font-weight:bold;}\n"                                                                 \
-  ".table thead th{vertical-align:bottom;}\n"                                                      \
-  ".table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table "          \
-  "colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table "               \
-  "thead:first-child tr:first-child th,.table thead:first-child tr:first-child "                   \
-  "td{border-top:0;}\n"                                                                            \
-  ".table tbody+tbody{border-top:2px solid #dddddd;}\n"                                            \
-  ".table-condensed th,.table-condensed td{padding:4px 5px;}\n"                                    \
-  ".table-bordered{border:1px solid "                                                              \
-  "#dddddd;border-collapse:separate;*border-collapse:collapsed;border-left:0;-webkit-border-"      \
-  "radius:4px;-moz-border-radius:4px;border-radius:4px;}.table-bordered th,.table-bordered "       \
-  "td{border-left:1px solid #dddddd;}\n"                                                           \
-  ".table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child "  \
-  "th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead "             \
-  "tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered "            \
-  "colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child "             \
-  "th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child "      \
-  "tr:first-child td{border-top:0;}\n"                                                             \
-  ".table-bordered thead:first-child tr:first-child th:first-child,.table-bordered "               \
-  "tbody:first-child tr:first-child "                                                              \
-  "td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-"      \
-  "radius-topleft:4px;}\n"                                                                         \
-  ".table-bordered thead:first-child tr:first-child th:last-child,.table-bordered "                \
-  "tbody:first-child tr:first-child "                                                              \
-  "td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-"     \
-  "radius-topright:4px;}\n"                                                                        \
-  ".table-bordered thead:last-child tr:last-child th:first-child,.table-bordered "                 \
-  "tbody:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 "                     \
-  "4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 "                                          \
-  "4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-"    \
-  "bottomleft:4px;}\n"                                                                             \
-  ".table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child " \
-  "tr:last-child "                                                                                 \
-  "td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-"      \
-  "border-radius-bottomright:4px;}\n"                                                              \
-  ".table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) "              \
-  "th{background-color:#f9f9f9;}\n"                                                                \
-  ".table tbody tr:hover td,.table tbody tr:hover th{background-color:#f5f5f5;}\n"                 \
-  "table .span1{float:none;width:44px;margin-left:0;}\n"                                           \
-  "table .span2{float:none;width:124px;margin-left:0;}\n"                                          \
-  "table .span3{float:none;width:204px;margin-left:0;}\n"                                          \
-  "table .span4{float:none;width:284px;margin-left:0;}\n"                                          \
-  "table .span5{float:none;width:364px;margin-left:0;}\n"                                          \
-  "table .span6{float:none;width:444px;margin-left:0;}\n"                                          \
-  "table .span7{float:none;width:524px;margin-left:0;}\n"                                          \
-  "table .span8{float:none;width:604px;margin-left:0;}\n"                                          \
-  "table .span9{float:none;width:684px;margin-left:0;}\n"                                          \
-  "table .span10{float:none;width:764px;margin-left:0;}\n"                                         \
-  "table .span11{float:none;width:844px;margin-left:0;}\n"                                         \
-  "table .span12{float:none;width:924px;margin-left:0;}\n"                                         \
-  "table .span13{float:none;width:1004px;margin-left:0;}\n"                                        \
-  "table .span14{float:none;width:1084px;margin-left:0;}\n"                                        \
-  "table .span15{float:none;width:1164px;margin-left:0;}\n"                                        \
-  "table .span16{float:none;width:1244px;margin-left:0;}\n"                                        \
-  "table .span17{float:none;width:1324px;margin-left:0;}\n"                                        \
-  "table .span18{float:none;width:1404px;margin-left:0;}\n"                                        \
-  "table .span19{float:none;width:1484px;margin-left:0;}\n"                                        \
-  "table .span20{float:none;width:1564px;margin-left:0;}\n"                                        \
-  "table .span21{float:none;width:1644px;margin-left:0;}\n"                                        \
-  "table .span22{float:none;width:1724px;margin-left:0;}\n"                                        \
-  "table .span23{float:none;width:1804px;margin-left:0;}\n"                                        \
-  "table .span24{float:none;width:1884px;margin-left:0;}"


[08/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testthrifttestclient.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testthrifttestclient.cpp b/depends/thirdparty/thrift/lib/c_glib/test/testthrifttestclient.cpp
deleted file mode 100755
index e618fe9..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testthrifttestclient.cpp
+++ /dev/null
@@ -1,627 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* test a C client with a C++ server */
-
-#include <signal.h>
-#include <sys/types.h>
-#include <sys/wait.h>
-#include <thrift/protocol/TBinaryProtocol.h>
-#include <thrift/protocol/TDebugProtocol.h>
-#include <thrift/server/TSimpleServer.h>
-#include <thrift/transport/TServerSocket.h>
-#include "ThriftTest.h"
-#include "ThriftTest_types.h"
-
-#include <iostream>
-
-using namespace std;
-using namespace boost;
-
-using namespace apache::thrift;
-using namespace apache::thrift::concurrency;
-using namespace apache::thrift::protocol;
-using namespace apache::thrift::transport;
-using namespace apache::thrift::server;
-
-using namespace thrift::test;
-
-#define TEST_PORT 9980
-
-// Extra functions required for ThriftTest_types to work
-namespace thrift { namespace test {
-
-bool Insanity::operator<(thrift::test::Insanity const& other) const {
-  using apache::thrift::ThriftDebugString;
-  return ThriftDebugString(*this) < ThriftDebugString(other);
-}
-
-}}
-
-class TestHandler : public ThriftTestIf {
-  public:
-  TestHandler() {}
-
-  void testVoid() {
-    printf("[C -> C++] testVoid()\n");
-  }
-
-  void testString(string& out, const string &thing) {
-    printf("[C -> C++] testString(\"%s\")\n", thing.c_str());
-    out = thing;
-  }
-
-  bool testBool(const bool thing) {
-    printf("[C -> C++] testBool(%s)\n", thing ? "true" : "false");
-    return thing;
-  }
-  int8_t testByte(const int8_t thing) {
-    printf("[C -> C++] testByte(%d)\n", (int)thing);
-    return thing;
-  }
-  int32_t testI32(const int32_t thing) {
-    printf("[C -> C++] testI32(%d)\n", thing);
-    return thing;
-  }
-
-  int64_t testI64(const int64_t thing) {
-    printf("[C -> C++] testI64(%ld)\n", thing);
-    return thing;
-  }
-
-  double testDouble(const double thing) {
-    printf("[C -> C++] testDouble(%lf)\n", thing);
-    return thing;
-  }
-
-  void testBinary(string& out, const string &thing) {
-    printf("[C -> C++] testBinary(\"%s\")\n", thing.c_str());
-    out = thing;
-  }
-
-  void testStruct(Xtruct& out, const Xtruct &thing) {
-    printf("[C -> C++] testStruct({\"%s\", %d, %d, %ld})\n", thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing);
-    out = thing;
-  }
-
-  void testNest(Xtruct2& out, const Xtruct2& nest) {
-    const Xtruct &thing = nest.struct_thing;
-    printf("[C -> C++] testNest({%d, {\"%s\", %d, %d, %ld}, %d})\n", (int)nest.byte_thing, thing.string_thing.c_str(), (int)thing.byte_thing, thing.i32_thing, thing.i64_thing, nest.i32_thing);
-    out = nest;
-  }
-
-  void testMap(map<int32_t, int32_t> &out, const map<int32_t, int32_t> &thing) {
-    printf("[C -> C++] testMap({");
-    map<int32_t, int32_t>::const_iterator m_iter;
-    bool first = true;
-    for (m_iter = thing.begin(); m_iter != thing.end(); ++m_iter) {
-      if (first) {
-        first = false;
-      } else {
-        printf(", ");
-      }
-      printf("%d => %d", m_iter->first, m_iter->second);
-    }
-    printf("})\n");
-    out = thing;
-  }
-
-  void testStringMap(map<std::string, std::string> &out, const map<std::string, std::string> &thing) {
-    printf("[C -> C++] testStringMap({");
-    map<std::string, std::string>::const_iterator m_iter;
-    bool first = true;
-    for (m_iter = thing.begin(); m_iter != thing.end(); ++m_iter) {
-      if (first) {
-        first = false;
-      } else {
-        printf(", ");
-      }
-      printf("\"%s\" => \"%s\"", (m_iter->first).c_str(), (m_iter->second).c_str());
-    }
-    printf("})\n");
-    out = thing;
-  }
-
-
-  void testSet(set<int32_t> &out, const set<int32_t> &thing) {
-    printf("[C -> C++] testSet({");
-    set<int32_t>::const_iterator s_iter;
-    bool first = true;
-    for (s_iter = thing.begin(); s_iter != thing.end(); ++s_iter) {
-      if (first) {
-        first = false;
-      } else {
-        printf(", ");
-      }
-      printf("%d", *s_iter);
-    }
-    printf("})\n");
-    out = thing;
-  }
-
-  void testList(vector<int32_t> &out, const vector<int32_t> &thing) {
-    printf("[C -> C++] testList({");
-    vector<int32_t>::const_iterator l_iter;
-    bool first = true;
-    for (l_iter = thing.begin(); l_iter != thing.end(); ++l_iter) {
-      if (first) {
-        first = false;
-      } else {        printf(", ");
-      }
-      printf("%d", *l_iter);
-    }
-    printf("})\n");
-    out = thing;
-  }
-
-  Numberz::type testEnum(const Numberz::type thing) {
-    printf("[C -> C++] testEnum(%d)\n", thing);
-    return thing;
-  }
-
-  UserId testTypedef(const UserId thing) {
-    printf("[C -> C++] testTypedef(%ld)\n", thing);
-    return thing;  }
-
-  void testMapMap(map<int32_t, map<int32_t,int32_t> > &mapmap, const int32_t hello) {
-    printf("[C -> C++] testMapMap(%d)\n", hello);
-
-    map<int32_t,int32_t> pos;
-    map<int32_t,int32_t> neg;
-    for (int i = 1; i < 5; i++) {
-      pos.insert(make_pair(i,i));
-      neg.insert(make_pair(-i,-i));
-    }
-
-    mapmap.insert(make_pair(4, pos));
-    mapmap.insert(make_pair(-4, neg));
-
-  }
-
-  void testInsanity(map<UserId, map<Numberz::type,Insanity> > &insane, const Insanity &argument) {
-    THRIFT_UNUSED_VARIABLE (argument);
-
-    printf("[C -> C++] testInsanity()\n");
-
-    Xtruct hello;
-    hello.string_thing = "Hello2";
-    hello.byte_thing = 2;
-    hello.i32_thing = 2;
-    hello.i64_thing = 2;
-
-    Xtruct goodbye;
-    goodbye.string_thing = "Goodbye4";
-    goodbye.byte_thing = 4;
-    goodbye.i32_thing = 4;
-    goodbye.i64_thing = 4;
-
-    Insanity crazy;
-    crazy.userMap.insert(make_pair(Numberz::EIGHT, 8));
-    crazy.xtructs.push_back(goodbye);
-
-    Insanity looney;
-    crazy.userMap.insert(make_pair(Numberz::FIVE, 5));
-    crazy.xtructs.push_back(hello);
-
-    map<Numberz::type, Insanity> first_map;
-    map<Numberz::type, Insanity> second_map;
-
-    first_map.insert(make_pair(Numberz::TWO, crazy));
-    first_map.insert(make_pair(Numberz::THREE, crazy));
-
-    second_map.insert(make_pair(Numberz::SIX, looney));
-
-    insane.insert(make_pair(1, first_map));
-    insane.insert(make_pair(2, second_map));
-
-    printf("return");
-    printf(" = {");
-    map<UserId, map<Numberz::type,Insanity> >::const_iterator i_iter;
-    for (i_iter = insane.begin(); i_iter != insane.end(); ++i_iter) {
-      printf("%ld => {", i_iter->first);
-      map<Numberz::type,Insanity>::const_iterator i2_iter;
-      for (i2_iter = i_iter->second.begin();
-           i2_iter != i_iter->second.end();
-           ++i2_iter) {
-        printf("%d => {", i2_iter->first);
-        map<Numberz::type, UserId> userMap = i2_iter->second.userMap;
-        map<Numberz::type, UserId>::const_iterator um;
-        printf("{");
-        for (um = userMap.begin(); um != userMap.end(); ++um) {
-          printf("%d => %ld, ", um->first, um->second);
-        }
-        printf("}, ");
-
-        vector<Xtruct> xtructs = i2_iter->second.xtructs;
-        vector<Xtruct>::const_iterator x;
-        printf("{");
-        for (x = xtructs.begin(); x != xtructs.end(); ++x) {
-          printf("{\"%s\", %d, %d, %ld}, ", x->string_thing.c_str(), (int)x->byte_thing, x->i32_thing, x->i64_thing);
-        }
-        printf("}");
-
-        printf("}, ");
-      }
-      printf("}, ");
-    }
-    printf("}\n");
-
-
-  }
-
-  void testMulti(Xtruct &hello, const int8_t arg0, const int32_t arg1, const int64_t arg2, const std::map<int16_t, std::string>  &arg3, const Numberz::type arg4, const UserId arg5) {
-    THRIFT_UNUSED_VARIABLE (arg3);
-    THRIFT_UNUSED_VARIABLE (arg4);
-    THRIFT_UNUSED_VARIABLE (arg5);
-
-    printf("[C -> C++] testMulti()\n");
-
-    hello.string_thing = "Hello2";
-    hello.byte_thing = arg0;
-    hello.i32_thing = arg1;
-    hello.i64_thing = (int64_t)arg2;
-  }
-
-  void testException(const std::string &arg)
-    throw(Xception, apache::thrift::TException)
-  {
-    printf("[C -> C++] testException(%s)\n", arg.c_str());
-    if (arg.compare("Xception") == 0) {
-      Xception e;
-      e.errorCode = 1001;
-      e.message = arg;
-      throw e;
-    } else if (arg.compare("ApplicationException") == 0) {
-      apache::thrift::TException e;
-      throw e;
-    } else {
-      Xtruct result;
-      result.string_thing = arg;
-      return;
-    }
-  }
-
-  void testMultiException(Xtruct &result, const std::string &arg0, const std::string &arg1) throw(Xception, Xception2) {
-
-    printf("[C -> C++] testMultiException(%s, %s)\n", arg0.c_str(), arg1.c_str());
-
-    if (arg0.compare("Xception") == 0) {
-      Xception e;
-      e.errorCode = 1001;
-      e.message = "This is an Xception";
-      throw e;
-    } else if (arg0.compare("Xception2") == 0) {
-      Xception2 e;
-      e.errorCode = 2002;
-      e.struct_thing.string_thing = "This is an Xception2";
-      throw e;
-    } else {
-      result.string_thing = arg1;
-      return;
-    }
-  }
-
-  void testOneway(int sleepFor) {
-    printf("testOneway(%d): Sleeping...\n", sleepFor);
-    sleep(sleepFor);
-    printf("testOneway(%d): done sleeping!\n", sleepFor);
-  }
-};
-
-// C CLIENT
-extern "C" {
-
-#undef THRIFT_SOCKET /* from lib/cpp */
-
-#include "t_test_thrift_test.h"
-#include "t_test_thrift_test_types.h"
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-
-static void
-test_thrift_client (void)
-{
-  ThriftSocket *tsocket = NULL;
-  ThriftBinaryProtocol *protocol = NULL;
-  TTestThriftTestClient *client = NULL;
-  TTestThriftTestIf *iface = NULL;
-  GError *error = NULL;
-  gchar *string = NULL;
-  gint8 byte = 0;
-  gint16 i16 = 0;
-  gint32 i32 = 0, another_i32 = 56789; 
-  gint64 i64 = 0;
-  double dbl = 0.0;
-  TTestXtruct *xtruct_in, *xtruct_out;
-  TTestXtruct2 *xtruct2_in, *xtruct2_out;
-  GHashTable *map_in = NULL, *map_out = NULL;
-  GHashTable *set_in = NULL, *set_out = NULL;
-  GArray *list_in = NULL, *list_out = NULL;
-  TTestNumberz enum_in, enum_out;
-  TTestUserId user_id_in, user_id_out; 
-  GHashTable *insanity_in = NULL;
-  TTestXtruct *xtruct1, *xtruct2;
-  TTestInsanity *insanity_out = NULL;
-  TTestXtruct *multi_in = NULL;
-  GHashTable *multi_map_out = NULL;
-  TTestXception *xception = NULL;
-  TTestXception2 *xception2 = NULL;
-
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  // initialize gobject
-  g_type_init ();
-#endif
-
-  // create a C client
-  tsocket = (ThriftSocket *) g_object_new (THRIFT_TYPE_SOCKET, 
-                          "hostname", "localhost",
-                          "port", TEST_PORT, NULL);
-  protocol = (ThriftBinaryProtocol *) g_object_new (THRIFT_TYPE_BINARY_PROTOCOL,
-                           "transport",
-                           tsocket, NULL);
-  client = (TTestThriftTestClient *) g_object_new (T_TEST_TYPE_THRIFT_TEST_CLIENT, "input_protocol", protocol, "output_protocol", protocol, NULL);
-  iface = T_TEST_THRIFT_TEST_IF (client);
-
-  // open and send
-  thrift_transport_open (THRIFT_TRANSPORT(tsocket), NULL);
-
-  assert (t_test_thrift_test_client_test_void (iface, &error) == TRUE);
-  assert (error == NULL);
-
-  assert (t_test_thrift_test_client_test_string (iface, &string, "test123", &error) == TRUE);
-  assert (strcmp (string, "test123") == 0);
-  g_free (string);
-  assert (error == NULL);
-
-  assert (t_test_thrift_test_client_test_byte (iface, &byte, (gint8) 5, &error) == TRUE);
-  assert (byte == 5);
-  assert (error == NULL);
-
-  assert (t_test_thrift_test_client_test_i32 (iface, &i32, 123, &error) == TRUE);
-  assert (i32 == 123);
-  assert (error == NULL);
-
-  assert (t_test_thrift_test_client_test_i64 (iface, &i64, 12345, &error) == TRUE);
-  assert (i64 == 12345);
-  assert (error == NULL);
-
-  assert (t_test_thrift_test_client_test_double (iface, &dbl, 5.6, &error) == TRUE);
-  assert (dbl == 5.6);
-  assert (error == NULL);
-
-  xtruct_out = (TTestXtruct *) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  xtruct_out->byte_thing = 1;
-  xtruct_out->__isset_byte_thing = TRUE;
-  xtruct_out->i32_thing = 15;
-  xtruct_out->__isset_i32_thing = TRUE;
-  xtruct_out->i64_thing = 151;
-  xtruct_out->__isset_i64_thing = TRUE;
-  xtruct_out->string_thing = g_strdup ("abc123");
-  xtruct_out->__isset_string_thing = TRUE;
-  xtruct_in = (TTestXtruct *) g_object_new(T_TEST_TYPE_XTRUCT, NULL);
-  assert (t_test_thrift_test_client_test_struct (iface, &xtruct_in, xtruct_out, &error) == TRUE);
-  assert (error == NULL);
-
-  xtruct2_out = (TTestXtruct2 *) g_object_new (T_TEST_TYPE_XTRUCT2, NULL);
-  xtruct2_out->byte_thing = 1;
-  xtruct2_out->__isset_byte_thing = TRUE;
-  if (xtruct2_out->struct_thing != NULL)
-    g_object_unref(xtruct2_out->struct_thing);
-  xtruct2_out->struct_thing = xtruct_out;
-  xtruct2_out->__isset_struct_thing = TRUE;
-  xtruct2_out->i32_thing = 123;
-  xtruct2_out->__isset_i32_thing = TRUE;
-  xtruct2_in = (TTestXtruct2 *) g_object_new (T_TEST_TYPE_XTRUCT2, NULL);
-  assert (t_test_thrift_test_client_test_nest (iface, &xtruct2_in, xtruct2_out, &error) == TRUE);
-  assert (error == NULL);
-
-  g_object_unref (xtruct2_out);
-  g_object_unref (xtruct2_in);
-  g_object_unref (xtruct_in);
-
-  map_out = g_hash_table_new (NULL, NULL);
-  map_in = g_hash_table_new (NULL, NULL);  g_hash_table_insert (map_out, &i32, &i32);
-  assert (t_test_thrift_test_client_test_map (iface, &map_in, map_out, &error) == TRUE);
-  assert (error == NULL);
-  g_hash_table_destroy (map_out);
-  g_hash_table_destroy (map_in);
-
-  map_out = g_hash_table_new (NULL, NULL);
-  map_in = g_hash_table_new (NULL, NULL);
-  g_hash_table_insert (map_out, g_strdup ("a"), g_strdup ("123"));
-  g_hash_table_insert (map_out, g_strdup ("a b"), g_strdup ("with spaces "));
-  g_hash_table_insert (map_out, g_strdup ("same"), g_strdup ("same"));
-  g_hash_table_insert (map_out, g_strdup ("0"), g_strdup ("numeric key"));
-  assert (t_test_thrift_test_client_test_string_map (iface, &map_in, map_out, &error) == TRUE);
-  assert (error == NULL);
-  g_hash_table_destroy (map_out);
-  g_hash_table_destroy (map_in);
-
-  set_out = g_hash_table_new (NULL, NULL);
-  set_in = g_hash_table_new (NULL, NULL);
-  g_hash_table_insert (set_out, &i32, &i32);
-  assert (t_test_thrift_test_client_test_set (iface, &set_in, set_out, &error) == TRUE);
-  assert (error == NULL);
-  g_hash_table_destroy (set_out);
-  g_hash_table_destroy (set_in);
-
-  list_out = g_array_new(TRUE, TRUE, sizeof(gint32));
-  list_in = g_array_new(TRUE, TRUE, sizeof(gint32));
-  another_i32 = 456;
-  g_array_append_val (list_out, i32);
-  g_array_append_val (list_out, another_i32);
-  assert (t_test_thrift_test_client_test_list (iface, &list_in, list_out, &error) == TRUE);
-  assert (error == NULL);
-  g_array_free (list_out, TRUE);
-  g_array_free (list_in, TRUE);
-
-  enum_out = T_TEST_NUMBERZ_ONE;
-  assert (t_test_thrift_test_client_test_enum (iface, &enum_in, enum_out, &error) == TRUE);
-  assert (enum_in == enum_out);
-  assert (error == NULL);
-
-  user_id_out = 12345;
-  assert (t_test_thrift_test_client_test_typedef (iface, &user_id_in, user_id_out, &error) == TRUE);
-  assert (user_id_in == user_id_out);
-  assert (error == NULL);
-
-  map_in = g_hash_table_new (NULL, NULL);
-  assert (t_test_thrift_test_client_test_map_map (iface, &map_in, i32, &error) == TRUE);
-  assert (error == NULL);
-  g_hash_table_destroy (map_in);
-
-  // insanity
-  insanity_out = (TTestInsanity *) g_object_new (T_TEST_TYPE_INSANITY, NULL);
-  insanity_out->userMap = g_hash_table_new (NULL, NULL);
-  g_hash_table_insert (insanity_out->userMap, GINT_TO_POINTER (enum_out), &user_id_out);
-
-  xtruct1 = (TTestXtruct *) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  xtruct1->byte_thing = 1;
-  xtruct1->__isset_byte_thing = TRUE;
-  xtruct1->i32_thing = 15;
-  xtruct1->__isset_i32_thing = TRUE;
-  xtruct1->i64_thing = 151;
-  xtruct1->__isset_i64_thing = TRUE;
-  xtruct1->string_thing = g_strdup ("abc123");
-  xtruct1->__isset_string_thing = TRUE;
-  xtruct2 = (TTestXtruct *) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  xtruct2->byte_thing = 1;
-  xtruct2->__isset_byte_thing = TRUE;
-  xtruct2->i32_thing = 15;
-  xtruct2->__isset_i32_thing = TRUE;
-  xtruct2->i64_thing = 151;
-  xtruct2->__isset_i64_thing = TRUE;
-  xtruct2->string_thing = g_strdup ("abc123");
-  xtruct2->__isset_string_thing = TRUE;
-
-  insanity_in = g_hash_table_new (NULL, NULL);
-  g_ptr_array_add (insanity_out->xtructs, xtruct1);
-  g_ptr_array_add (insanity_out->xtructs, xtruct2);
-  assert (t_test_thrift_test_client_test_insanity (iface, &insanity_in, insanity_out, &error) == TRUE);
-
-  g_hash_table_unref (insanity_in);
-  g_ptr_array_free (insanity_out->xtructs, TRUE);
-
-  multi_map_out = g_hash_table_new (NULL, NULL);
-  string = g_strdup ("abc123");
-  g_hash_table_insert (multi_map_out, &i16, string);
-  multi_in = (TTestXtruct *) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  assert (t_test_thrift_test_client_test_multi (iface, &multi_in, byte, i32, i64, multi_map_out, enum_out, user_id_out, &error) == TRUE);
-  assert (multi_in->i32_thing == i32);
-  assert (multi_in->i64_thing == i64);
-  g_object_unref (multi_in);
-  g_hash_table_unref (multi_map_out);
-  g_free (string);
-
-  assert (t_test_thrift_test_client_test_exception (iface, "Xception", &xception, &error) == FALSE);
-  assert (xception->errorCode == 1001);
-  g_error_free (error);
-  error = NULL;
-  g_object_unref (xception);
-  xception = NULL;
-
-  assert (t_test_thrift_test_client_test_exception (iface, "ApplicationException", &xception, &error) == FALSE);
-  g_error_free (error);
-  error = NULL;
-  assert (xception == NULL);
-
-  assert (t_test_thrift_test_client_test_exception (iface, "Test", &xception, &error) == TRUE);
-  assert (error == NULL);
-
-  multi_in = (TTestXtruct*) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  assert (t_test_thrift_test_client_test_multi_exception (iface, &multi_in, "Xception", NULL, &xception, &xception2, &error) == FALSE);
-  assert (xception->errorCode == 1001);
-  assert (xception2 == NULL);
-  g_error_free (error);
-  error = NULL;
-  g_object_unref (xception);
-  g_object_unref (multi_in);
-  xception = NULL;
-  multi_in = NULL;
-
-  multi_in = (TTestXtruct*) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  assert (t_test_thrift_test_client_test_multi_exception (iface, &multi_in, "Xception2", NULL, &xception, &xception2, &error) == FALSE);
-  assert (xception2->errorCode == 2002);
-  assert (xception == NULL);
-  g_error_free (error);
-  error = NULL;
-  g_object_unref (xception2);
-  g_object_unref (multi_in);
-  xception2 = NULL;
-  multi_in = NULL;
-
-  multi_in = (TTestXtruct*) g_object_new (T_TEST_TYPE_XTRUCT, NULL);
-  assert (t_test_thrift_test_client_test_multi_exception (iface, &multi_in, NULL , NULL, &xception, &xception2, &error) == TRUE);
-  assert (error == NULL);
-  g_object_unref(multi_in);
-  multi_in = NULL;
-
-  assert (t_test_thrift_test_client_test_oneway (iface, 1, &error) == TRUE);
-  assert (error == NULL);
-
-  /* sleep to let the oneway call go through */
-  sleep (5);
-
-  thrift_transport_close (THRIFT_TRANSPORT(tsocket), NULL);
-  g_object_unref (client);
-  g_object_unref (protocol);
-  g_object_unref (tsocket);
-}
-
-
-} /* extern "C" */
-
-
-static void
-bailout (int signum)
-{
-  THRIFT_UNUSED_VARIABLE (signum);
-
-  exit (1);
-}
-
-int
-main (void)
-{
-  int status;
-  int pid = fork ();
-  assert (pid >= 0);
-
-  if (pid == 0) /* child */
-  {
-    boost::shared_ptr<TProtocolFactory> protocolFactory(new TBinaryProtocolFactory());
-    boost::shared_ptr<TestHandler> testHandler(new TestHandler());
-    boost::shared_ptr<ThriftTestProcessor> testProcessor(new ThriftTestProcessor(testHandler));
-    boost::shared_ptr<TServerSocket> serverSocket(new TServerSocket(TEST_PORT));
-    boost::shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory());
-    TSimpleServer simpleServer(testProcessor, serverSocket, transportFactory, protocolFactory);
-    signal (SIGALRM, bailout);
-    alarm (60);
-    simpleServer.serve();
-  } else {
-    sleep (1);
-    test_thrift_client ();
-    kill (pid, SIGINT);
-    assert (wait (&status) == pid);
-  }
-
-  return 0;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testtransportsocket.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testtransportsocket.c b/depends/thirdparty/thrift/lib/c_glib/test/testtransportsocket.c
deleted file mode 100755
index d91507f..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testtransportsocket.c
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <sys/wait.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
-
-/* substituted functions to test failures of system and library calls */
-static int socket_error = 0;
-int
-my_socket(int domain, int type, int protocol)
-{
-  if (socket_error == 0)
-  {
-    return socket (domain, type, protocol);
-  }
-  return -1;
-}
-
-static int recv_error = 0;
-ssize_t
-my_recv(int socket, void *buffer, size_t length, int flags)
-{
-  if (recv_error == 0)
-  {
-    return recv (socket, buffer, length, flags);
-  }
-  return -1;
-}
-
-static int send_error = 0;
-ssize_t
-my_send(int socket, const void *buffer, size_t length, int flags)
-{
-  if (send_error == 0)
-  {
-    return send (socket, buffer, length, flags);
-  }
-  return -1;
-}
-
-#define socket my_socket
-#define recv my_recv
-#define send my_send
-#include "../src/thrift/c_glib/transport/thrift_socket.c"
-#undef socket
-#undef recv
-#undef send
-
-static void thrift_socket_server (const int port);
-
-/* test object creation and destruction */
-static void
-test_create_and_destroy(void)
-{
-  gchar *hostname = NULL;
-  guint port = 0;
-
-  GObject *object = NULL;
-  object = g_object_new (THRIFT_TYPE_SOCKET, NULL);
-  assert (object != NULL);
-  g_object_get (G_OBJECT(object), "hostname", &hostname, "port", &port, NULL);
-  g_free (hostname);
-
-  g_object_unref (object);
-}
-
-static void
-test_open_and_close(void)
-{
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  GError *err = NULL;
-
-  /* open a connection and close it */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                          "port", 51188, NULL); 
-  transport = THRIFT_TRANSPORT (tsocket);
-  thrift_socket_open (transport, NULL);
-  assert (thrift_socket_is_open (transport) == TRUE);
-  thrift_socket_close (transport, NULL);
-  assert (thrift_socket_is_open (transport) == FALSE);
-
-  /* test close failure */
-  tsocket->sd = -1;
-  thrift_socket_close (transport, NULL);
-  g_object_unref (tsocket);
-
-  /* try a hostname lookup failure */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost.broken",
-                          NULL);
-  transport = THRIFT_TRANSPORT (tsocket);
-  assert (thrift_socket_open (transport, &err) == FALSE);
-  g_object_unref (tsocket);
-  g_error_free (err);
-  err = NULL;
-
-  /* try an error call to socket() */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost", NULL);
-  transport = THRIFT_TRANSPORT (tsocket);
-  socket_error = 1;
-  assert (thrift_socket_open (transport, &err) == FALSE);
-  socket_error = 0;
-  g_object_unref (tsocket);
-  g_error_free (err);
-}
-
-static void
-test_read_and_write(void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  int port = 51199;
-  guchar buf[10] = TEST_DATA; /* a buffer */
-
-  pid = fork ();
-  assert ( pid >= 0 );
-
-  if ( pid == 0 )
-  {
-    /* child listens */
-    thrift_socket_server (port);
-    exit (0);
-  } else {
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = THRIFT_TRANSPORT (tsocket);
-    assert (thrift_socket_open (transport, NULL) == TRUE);
-    assert (thrift_socket_is_open (transport));
-    thrift_socket_write (transport, buf, 10, NULL);
-
-    /* write fail */
-    send_error = 1;
-    thrift_socket_write (transport, buf, 1, NULL);
-    send_error = 0;
-
-    thrift_socket_write_end (transport, NULL);
-    thrift_socket_flush (transport, NULL);
-    thrift_socket_close (transport, NULL);
-    g_object_unref (tsocket);
-
-    assert ( wait (&status) == pid );
-    assert ( status == 0 );
-  }
-}
-
-/* test ThriftSocket's peek() implementation */
-static void
-test_peek(void)
-{
-  gint status;
-  pid_t pid;
-  guint port = 51199;
-  gchar data = 'A';
-  ThriftTransport *client_transport;
-  GError *error = NULL;
-
-  client_transport = g_object_new (THRIFT_TYPE_SOCKET,
-                                   "hostname", "localhost",
-                                   "port",     port,
-                                   NULL);
-
-  /* thrift_transport_peek returns FALSE when the socket is closed */
-  g_assert (thrift_transport_is_open (client_transport) == FALSE);
-  g_assert (thrift_transport_peek (client_transport, &error) == FALSE);
-  g_assert (error == NULL);
-
-  pid = fork ();
-  g_assert (pid >= 0);
-
-  if (pid == 0)
-  {
-    ThriftServerTransport *server_transport = NULL;
-
-    g_object_unref (client_transport);
-
-    /* child listens */
-    server_transport = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                     "port", port,
-                                     NULL);
-    g_assert (server_transport != NULL);
-
-    thrift_server_transport_listen (server_transport, &error);
-    g_assert (error == NULL);
-
-    client_transport = g_object_new
-      (THRIFT_TYPE_BUFFERED_TRANSPORT,
-       "transport",  thrift_server_transport_accept (server_transport, &error),
-       "r_buf_size", 0,
-       "w_buf_size", sizeof data,
-       NULL);
-    g_assert (error == NULL);
-    g_assert (client_transport != NULL);
-
-    /* write exactly one character to the client */
-    g_assert (thrift_transport_write (client_transport,
-                                      &data,
-                                      sizeof data,
-                                      &error) == TRUE);
-
-    thrift_transport_flush (client_transport, &error);
-    thrift_transport_write_end (client_transport, &error);
-    thrift_transport_close (client_transport, &error);
-
-    g_object_unref (client_transport);
-    g_object_unref (server_transport);
-
-    exit (0);
-  }
-  else {
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    /* connect to the child */
-    thrift_transport_open (client_transport, &error);
-    g_assert (error == NULL);
-    g_assert (thrift_transport_is_open (client_transport) == TRUE);
-
-    /* thrift_transport_peek returns TRUE when the socket is open and there is
-       data available to be read */
-    g_assert (thrift_transport_peek (client_transport, &error) == TRUE);
-    g_assert (error == NULL);
-
-    /* read exactly one character from the server */
-    g_assert_cmpint (thrift_transport_read (client_transport,
-                                            &data,
-                                            sizeof data,
-                                            &error), ==, sizeof data);
-
-    /* thrift_transport_peek returns FALSE when the socket is open but there is
-       no (more) data available to be read */
-    g_assert (thrift_transport_is_open (client_transport) == TRUE);
-    g_assert (thrift_transport_peek (client_transport, &error) == FALSE);
-    g_assert (error == NULL);
-
-    thrift_transport_read_end (client_transport, &error);
-    thrift_transport_close (client_transport, &error);
-
-    g_object_unref (client_transport);
-
-    g_assert (wait (&status) == pid);
-    g_assert (status == 0);
-  }
-}
-
-static void
-thrift_socket_server (const int port)
-{
-  int bytes = 0;
-  ThriftServerTransport *transport = NULL;
-  ThriftTransport *client = NULL;
-  guchar buf[10]; /* a buffer */
-  guchar match[10] = TEST_DATA;
-
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", port, NULL);
-
-  transport = THRIFT_SERVER_TRANSPORT (tsocket);
-  thrift_server_transport_listen (transport, NULL);
-  client = thrift_server_transport_accept (transport, NULL);
-  assert (client != NULL);
-
-  /* read 10 bytes */
-  bytes = thrift_socket_read (client, buf, 10, NULL);
-  assert (bytes == 10); /* make sure we've read 10 bytes */
-  assert ( memcmp(buf, match, 10) == 0 ); /* make sure what we got matches */
-
-  /* failed read */
-  recv_error = 1;
-  thrift_socket_read (client, buf, 1, NULL);
-  recv_error = 0;
-
-  thrift_socket_read_end (client, NULL);
-  thrift_socket_close (client, NULL);
-  g_object_unref (tsocket);
-  g_object_unref (client);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testtransportsocket/CreateAndDestroy", test_create_and_destroy);
-  g_test_add_func ("/testtransportsocket/OpenAndClose", test_open_and_close);
-  g_test_add_func ("/testtransportsocket/ReadAndWrite", test_read_and_write);
-  g_test_add_func ("/testtransportsocket/Peek", test_peek);
-
-  return g_test_run ();
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/thrift_c_glib.pc.in
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/thrift_c_glib.pc.in b/depends/thirdparty/thrift/lib/c_glib/thrift_c_glib.pc.in
deleted file mode 100644
index 568c7a2..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/thrift_c_glib.pc.in
+++ /dev/null
@@ -1,30 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: Thrift
-Description: Thrift C API
-Version: @VERSION@
-Requires: glib-2.0 gobject-2.0
-Libs: -L${libdir} -lthrift_c_glib
-Cflags: -I${includedir}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/README.md b/depends/thirdparty/thrift/lib/cocoa/README.md
deleted file mode 100644
index bbe3c93..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Thrift Cocoa Software Library
-
-License
-=======
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/coding_standards.md b/depends/thirdparty/thrift/lib/cocoa/coding_standards.md
deleted file mode 100644
index fa0390b..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/coding_standards.md
+++ /dev/null
@@ -1 +0,0 @@
-Please follow [General Coding Standards](/doc/coding_standards.md)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.h b/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.h
deleted file mode 100644
index 7b027d6..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TException.h"
-#import "TProtocol.h"
-
-enum {
-  TApplicationException_UNKNOWN = 0,
-  TApplicationException_UNKNOWN_METHOD = 1,
-  TApplicationException_INVALID_MESSAGE_TYPE = 2,
-  TApplicationException_WRONG_METHOD_NAME = 3,
-  TApplicationException_BAD_SEQUENCE_ID = 4,
-  TApplicationException_MISSING_RESULT = 5,
-  TApplicationException_INTERNAL_ERROR = 6,
-  TApplicationException_PROTOCOL_ERROR = 7,
-  TApplicationException_INVALID_TRANSFORM = 8,
-  TApplicationException_INVALID_PROTOCOL = 9,
-  TApplicationException_UNSUPPORTED_CLIENT_TYPE = 10
-};
-
-// FIXME
-@interface TApplicationException : TException {
-  int mType;
-}
-
-+ (TApplicationException *) read: (id <TProtocol>) protocol;
-
-- (void) write: (id <TProtocol>) protocol;
-
-+ (TApplicationException *) exceptionWithType: (int) type
-                                       reason: (NSString *) message;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.m b/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.m
deleted file mode 100644
index 974dfc5..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TApplicationException.m
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TApplicationException.h"
-#import "TProtocolUtil.h"
-#import "TObjective-C.h"
-
-@implementation TApplicationException
-
-- (id) initWithType: (int) type
-             reason: (NSString *) reason
-{
-  mType = type;
-
-  NSString * name;
-  switch (type) {
-  case TApplicationException_UNKNOWN_METHOD:
-    name = @"Unknown method";
-    break;
-  case TApplicationException_INVALID_MESSAGE_TYPE:
-    name = @"Invalid message type";
-    break;
-  case TApplicationException_WRONG_METHOD_NAME:
-    name = @"Wrong method name";
-    break;
-  case TApplicationException_BAD_SEQUENCE_ID:
-    name = @"Bad sequence ID";
-    break;
-  case TApplicationException_MISSING_RESULT:
-    name = @"Missing result";
-    break;
-  case TApplicationException_INTERNAL_ERROR:
-    name = @"Internal error";
-    break;
-  case TApplicationException_PROTOCOL_ERROR:
-    name = @"Protocol error";
-    break;
-  case TApplicationException_INVALID_TRANSFORM:
-    name = @"Invalid transform";
-    break;
-  case TApplicationException_INVALID_PROTOCOL:
-    name = @"Invalid protocol";
-    break;
-  case TApplicationException_UNSUPPORTED_CLIENT_TYPE:
-    name = @"Unsupported client type";
-    break;
-  default:
-    name = @"Unknown";
-    break;
-  }
-
-  self = [super initWithName: name reason: reason userInfo: nil];
-  return self;
-}
-
-
-+ (TApplicationException *) read: (id <TProtocol>) protocol
-{
-  NSString * reason = nil;
-  int type = TApplicationException_UNKNOWN;
-  int fieldType;
-  int fieldID;
-
-  [protocol readStructBeginReturningName: NULL];
-
-  while (true) {
-    [protocol readFieldBeginReturningName: NULL
-              type: &fieldType
-              fieldID: &fieldID];
-    if (fieldType == TType_STOP) {
-      break;
-    }
-    switch (fieldID) {
-    case 1:
-      if (fieldType == TType_STRING) {
-        reason = [protocol readString];
-      } else {
-        [TProtocolUtil skipType: fieldType onProtocol: protocol];
-      }
-      break;
-    case 2:
-      if (fieldType == TType_I32) {
-        type = [protocol readI32];
-      } else {
-        [TProtocolUtil skipType: fieldType onProtocol: protocol];
-      }
-      break;
-    default:
-      [TProtocolUtil skipType: fieldType onProtocol: protocol];
-      break;
-    }
-    [protocol readFieldEnd];
-  }
-  [protocol readStructEnd];
-
-  return [TApplicationException exceptionWithType: type reason: reason];
-}
-
-
-- (void) write: (id <TProtocol>) protocol
-{
-  [protocol writeStructBeginWithName: @"TApplicationException"];
-
-  if ([self reason] != nil) {
-    [protocol writeFieldBeginWithName: @"message"
-                 type: TType_STRING
-                 fieldID: 1];
-    [protocol writeString: [self reason]];
-    [protocol writeFieldEnd];
-  }
-
-  [protocol writeFieldBeginWithName: @"type"
-               type: TType_I32
-               fieldID: 2];
-  [protocol writeI32: mType];
-  [protocol writeFieldEnd];
-
-  [protocol writeFieldStop];
-  [protocol writeStructEnd];
-}
-
-
-+ (TApplicationException *) exceptionWithType: (int) type
-                                      reason: (NSString *) reason
-{
-  return [[[TApplicationException alloc] initWithType: type
-                                         reason: reason] autorelease_stub];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.h b/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.h
deleted file mode 100644
index 12944b1..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocol.h"
-#import "TApplicationException.h"
-
-@interface TBaseClient : NSObject {
-    id <TProtocol> inProtocol;
-    id <TProtocol> outProtocol;
-}
-
-- (TApplicationException *)checkIncomingMessageException;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.m b/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.m
deleted file mode 100644
index d15f9d3..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TBaseClient.m
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TBaseClient.h"
-#import "TApplicationException.h"
-#import "TObjective-C.h"
-
-@implementation TBaseClient
-
-- (void) dealloc
-{
-    [inProtocol release_stub];
-    [outProtocol release_stub];
-    [super dealloc_stub];
-}
-
-- (TApplicationException *)checkIncomingMessageException
-{
-    int msgType = 0;
-    [inProtocol readMessageBeginReturningName: nil type: &msgType sequenceID: NULL];
-    if (msgType == TMessageType_EXCEPTION) {
-        TApplicationException * x = [TApplicationException read: inProtocol];
-        [inProtocol readMessageEnd];
-        return x;
-    }
-    
-    return nil;
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TException.h b/depends/thirdparty/thrift/lib/cocoa/src/TException.h
deleted file mode 100644
index e56f4fa..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TException.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-@interface TException : NSException {
-}
-
-+ (id) exceptionWithName: (NSString *) name;
-
-+ (id) exceptionWithName: (NSString *) name
-                  reason: (NSString *) reason;
-
-+ (id) exceptionWithName: (NSString *) name
-                  reason: (NSString *) reason
-                   error: (NSError *) error;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TException.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TException.m b/depends/thirdparty/thrift/lib/cocoa/src/TException.m
deleted file mode 100644
index 0160e3b..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TException.m
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TException.h"
-#import "TObjective-C.h"
-
-@implementation TException
-
-+ (id) exceptionWithName: (NSString *) name
-{
-  return [self exceptionWithName: name reason: @"unknown" error: nil];
-}
-
-
-+ (id) exceptionWithName: (NSString *) name
-                  reason: (NSString *) reason
-{
-  return [self exceptionWithName: name reason: reason error: nil];
-}
-
-
-+ (id) exceptionWithName: (NSString *) name
-                  reason: (NSString *) reason
-                   error: (NSError *) error
-{
-  NSDictionary * userInfo = nil;
-  if (error != nil) {
-    userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"];
-  }
-
-  return [super exceptionWithName: name
-                reason: reason
-                userInfo: userInfo];
-}
-
-
-- (NSString *) description
-{
-  NSMutableString * result = [NSMutableString stringWithString: [self name]];
-  [result appendFormat: @": %@", [self reason]];
-  if ([self userInfo] != nil) {
-    [result appendFormat: @"\n  userInfo = %@", [self userInfo]];
-  }
-
-  return result;
-}
-
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TObjective-C.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TObjective-C.h b/depends/thirdparty/thrift/lib/cocoa/src/TObjective-C.h
deleted file mode 100644
index 9c0831d..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TObjective-C.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
- * TObjective-C.h is for supporting coexistence of both the ARC (Automatic 
- * Reference Counting) mode and the Non-ARC mode of Objective-C 
- * in the same source code.
- *
- *                  2011/11/14  HIRANO Satoshi (AIST, Japan)
- *
- * Before:
- *
- *    var = [aObject retain];
- *    [aObject release];
- *    [aObject autorelease];
- *    [super dealloc];
- *    CFFunction(obj);
- *
- * ARC and Non-ARC compatible:
- *
- *    #import "TObjective-C.h"
- *    var = [aObject retain_stub];
- *    [aObject release_stub];
- *    [aObject autorelease_stub];
- *    [super dealloc_stub];
- *    CFFunction(bridge_stub obj);
- *
- *    Don't use retain_stub for @property(retain).
- *    Use NSAutoreleasePool like this:
- *        #if __has_feature(objc_arc)
- *          @autoreleasepool {
- *              // code 
- *          }
- *        #else
- *          NSAutoReleasePool *pool = [[NSAutoReleasePool alloc] init...
- *          // code
- *          [pool release];
- *        #endif
- */
-
-
-#if !defined(retain_stub)
-#if __has_feature(objc_arc)
-#define retain_stub self
-#define autorelease_stub self
-#define release_stub self
-#define dealloc_stub self
-#define bridge_stub __bridge
-#else
-#define retain_stub retain
-#define autorelease_stub autorelease
-#define release_stub release
-#define dealloc_stub dealloc
-#define bridge_stub
-#endif
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TProcessor.h b/depends/thirdparty/thrift/lib/cocoa/src/TProcessor.h
deleted file mode 100644
index 980be94..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TProcessor.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TProtocol.h"
-
-
-@protocol TProcessor <NSObject>
-
-- (BOOL) processOnInputProtocol: (id <TProtocol>) inProtocol
-                 outputProtocol: (id <TProtocol>) outProtocol;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TProcessorFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TProcessorFactory.h b/depends/thirdparty/thrift/lib/cocoa/src/TProcessorFactory.h
deleted file mode 100644
index 29d12b3..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TProcessorFactory.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TProcessor.h"
-
-@protocol TProcessorFactory <NSObject>
-
-- (id<TProcessor>) processorForTransport: (id<TTransport>) transport;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.h b/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.h
deleted file mode 100644
index cf4a462..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TProcessorFactory.h"
-
-@interface TSharedProcessorFactory : NSObject <TProcessorFactory> {
-  id<TProcessor> mSharedProcessor;
-}
-- (id) initWithSharedProcessor: (id<TProcessor>) sharedProcessor;
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.m b/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.m
deleted file mode 100644
index a0007c0..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/TSharedProcessorFactory.m
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-
-#import "TSharedProcessorFactory.h"
-#import "TObjective-C.h"
-
-
-@implementation TSharedProcessorFactory
-
-
-- (id) initWithSharedProcessor: (id<TProcessor>) sharedProcessor
-{
-  self = [super init];
-  if (!self) {
-    return nil;
-  }
-  
-  mSharedProcessor = [sharedProcessor retain_stub];
-  return self;
-}
-
-
-- (void) dealloc
-{
-  [mSharedProcessor release_stub];
-  [super dealloc_stub];
-}
-
-
-- (id<TProcessor>) processorForTransport: (id<TTransport>) transport
-{
-  return [[mSharedProcessor retain_stub] autorelease_stub];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/Thrift.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/Thrift.h b/depends/thirdparty/thrift/lib/cocoa/src/Thrift.h
deleted file mode 100644
index 9cedb66..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/Thrift.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#define ThriftVersion @"0.9.3"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBase.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBase.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBase.h
deleted file mode 100644
index 33037ef..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBase.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-
-#import "TProtocol.h"
-
-@protocol TBase <NSObject>
-
-/**
- * De-serialize object from the given input protocol
- *
- * @param input protocol used for reading 
- */
-- (void) read: (id <TProtocol>) inProtocol;
-
-/**
- * Serialize object to the given protocol
- *
- * @param buf output protocol used for writing
- */
-- (void) write: (id <TProtocol>) outProtocol;
-
-@end
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.h
deleted file mode 100644
index 9a73730..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocol.h"
-#import "TTransport.h"
-#import "TProtocolFactory.h"
-
-
-@interface TBinaryProtocol : NSObject <TProtocol> {
-  id <TTransport> mTransport;
-  BOOL mStrictRead;
-  BOOL mStrictWrite;
-  int32_t mMessageSizeLimit;
-}
-
-- (id) initWithTransport: (id <TTransport>) transport;
-
-- (id) initWithTransport: (id <TTransport>) transport
-              strictRead: (BOOL) strictRead
-             strictWrite: (BOOL) strictWrite;
-
-- (int32_t) messageSizeLimit;
-- (void) setMessageSizeLimit: (int32_t) sizeLimit;
-
-@end
-
-
-@interface TBinaryProtocolFactory : NSObject <TProtocolFactory> {
-}
-
-+ (TBinaryProtocolFactory *) sharedFactory;
-
-- (TBinaryProtocol *) newProtocolOnTransport: (id <TTransport>) transport;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.m b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.m
deleted file mode 100644
index 847c723..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TBinaryProtocol.m
+++ /dev/null
@@ -1,530 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TBinaryProtocol.h"
-#import "TProtocolException.h"
-#import "TObjective-C.h"
-
-/* In the modern protocol, version is stored in the high half of an int32.
- * The low half contains type info. */
-static const uint16_t VERSION_1 = 0x8001;
-
-NS_INLINE size_t
-CheckedCastInt32ToSizeT(int32_t size)
-{
-  if (size < 0) {
-    NSString *reason = [NSString stringWithFormat:
-                        @"%s: refusing to read data with negative size: %"PRId32,
-                        __func__, size];
-    @throw [TProtocolException
-            exceptionWithName: @"TProtocolException"
-            reason: reason];
-  }
-  size_t checkedSize = (size_t)size;
-  return checkedSize;
-}
-
-NS_INLINE int32_t
-CheckedCastSizeTToInt32(size_t size)
-{
-  if (size > INT32_MAX) {
-    NSString *reason = [NSString stringWithFormat:
-                        @"%s: data size exceeds values representable by a 32-bit signed integer: %zu",
-                        __func__, size];
-    @throw [TProtocolException
-            exceptionWithName: @"TProtocolException"
-            reason: reason];
-  }
-  int32_t checkedSize = (int32_t)size;
-  return checkedSize;
-}
-
-NS_INLINE uint8_t
-CheckedCastIntToUInt8(int size)
-{
-  if (size > UINT8_MAX) {
-    NSString *reason = [NSString stringWithFormat:
-                        @"%s: data size exceeds values representable by a 8-bit unsigned integer: %d",
-                        __func__, size];
-    @throw [TProtocolException
-            exceptionWithName: @"TProtocolException"
-            reason: reason];
-  }
-  uint8_t checkedSize = (uint8_t)size;
-  return checkedSize;
-}
-
-static TBinaryProtocolFactory * gSharedFactory = nil;
-
-@implementation TBinaryProtocolFactory
-
-+ (TBinaryProtocolFactory *) sharedFactory {
-  if (gSharedFactory == nil) {
-    gSharedFactory = [[TBinaryProtocolFactory alloc] init];
-  }
-
-  return gSharedFactory;
-}
-
-- (TBinaryProtocol *) newProtocolOnTransport: (id <TTransport>) transport {
-  return [[TBinaryProtocol alloc] initWithTransport: transport];
-}
-
-@end
-
-
-
-@implementation TBinaryProtocol
-
-- (id) initWithTransport: (id <TTransport>) transport
-{
-  return [self initWithTransport: transport strictRead: NO strictWrite: YES];
-}
-
-- (id) initWithTransport: (id <TTransport>) transport
-              strictRead: (BOOL) strictRead
-             strictWrite: (BOOL) strictWrite
-{
-  self = [super init];
-  mTransport = [transport retain_stub];
-  mStrictRead = strictRead;
-  mStrictWrite = strictWrite;
-  return self;
-}
-
-
-- (int32_t) messageSizeLimit
-{
-  return mMessageSizeLimit;
-}
-
-
-- (void) setMessageSizeLimit: (int32_t) sizeLimit
-{
-  mMessageSizeLimit = sizeLimit;
-}
-
-
-- (void) dealloc
-{
-  [mTransport release_stub];
-  [super dealloc_stub];
-}
-
-
-- (id <TTransport>) transport
-{
-  return mTransport;
-}
-
-
-- (NSString *) readStringBody: (int) rawSize
-{
-  size_t size = CheckedCastInt32ToSizeT(rawSize);
-  char * buffer = malloc(size+1);
-  if (!buffer) {
-    @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                          reason: [NSString stringWithFormat: @"Unable to allocate memory in %s, size: %zu",
-                                                   __PRETTY_FUNCTION__,
-                                                   size]];;
-  }
-  [mTransport readAll: (uint8_t *) buffer offset: 0 length: size];
-  buffer[size] = 0;
-  NSString * result = [NSString stringWithUTF8String: buffer];
-  free(buffer);
-  return result;
-}
-
-
-- (void) readMessageBeginReturningName: (NSString **) name
-                                  type: (int *) type
-                            sequenceID: (int *) sequenceID
-{
-  int32_t size = [self readI32];
-  if (size < 0) {
-    /* Version (unsigned) is stored in the high halfword. */
-    uint16_t version = (size >> 16) & 0xFFFF;
-    if (version != VERSION_1) {
-      NSString *reason = [NSString stringWithFormat:
-                          @"%s: Expected version %"PRIu16", instead found: %"PRIu16,
-                          __func__, VERSION_1, version];
-      @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                 reason: reason];
-    }
-    if (type != NULL) {
-      *type = size & 0x00FF;
-    }
-    NSString * messageName = [self readString];
-    if (name != NULL) {
-      *name = messageName;
-    }
-    int seqID = [self readI32];
-    if (sequenceID != NULL) {
-      *sequenceID = seqID;
-    }
-  } else {
-    if (mStrictRead) {
-      @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                 reason: @"Missing version in readMessageBegin, old client?"];
-    }
-    if ([self messageSizeLimit] > 0 && size > [self messageSizeLimit]) {
-      @throw [TProtocolException exceptionWithName: @"TProtocolException"
-                                            reason: [NSString stringWithFormat: @"Message too big.  Size limit is: %d Message size is: %d",
-                                                     mMessageSizeLimit,
-                                                     size]];
-    }
-    NSString * messageName = [self readStringBody: size];
-    if (name != NULL) {
-      *name = messageName;
-    }
-    int messageType = [self readByte];
-    if (type != NULL) {
-      *type = messageType;
-    }
-    int seqID = [self readI32];
-    if (sequenceID != NULL) {
-      *sequenceID = seqID;
-    }
-  }
-}
-
-
-- (void) readMessageEnd {}
-
-
-- (void) readStructBeginReturningName: (NSString **) name
-{
-  if (name != NULL) {
-    *name = nil;
-  }
-}
-
-
-- (void) readStructEnd {}
-
-
-- (void) readFieldBeginReturningName: (NSString **) name
-                                type: (int *) fieldType
-                             fieldID: (int *) fieldID
-{
-  if (name != NULL) {
-    *name = nil;
-  }
-  int ft = [self readByte];
-  if (fieldType != NULL) {
-    *fieldType = ft;
-  }
-  if (ft != TType_STOP) {
-    int fid = [self readI16];
-    if (fieldID != NULL) {
-      *fieldID = fid;
-    }
-  }
-}
-
-
-- (void) readFieldEnd {}
-
-
-- (int32_t) readI32
-{
-  uint8_t i32rd[4];
-  [mTransport readAll: i32rd offset: 0 length: 4];
-  return
-    ((i32rd[0] & 0xff) << 24) |
-    ((i32rd[1] & 0xff) << 16) |
-    ((i32rd[2] & 0xff) <<  8) |
-    ((i32rd[3] & 0xff));
-}
-
-
-- (NSString *) readString
-{
-  int32_t size = [self readI32];
-  return [self readStringBody: size];
-}
-
-
-- (BOOL) readBool
-{
-  return [self readByte] == 1;
-}
-
-- (uint8_t) readByte
-{
-  uint8_t myByte;
-  [mTransport readAll: &myByte offset: 0 length: 1];
-  return myByte;
-}
-
-- (short) readI16
-{
-  uint8_t buff[2];
-  [mTransport readAll: buff offset: 0 length: 2];
-  return (short)
-    (((buff[0] & 0xff) << 8) |
-     ((buff[1] & 0xff)));
-}
-
-- (int64_t) readI64
-{
-  uint8_t i64rd[8];
-  [mTransport readAll: i64rd offset: 0 length: 8];
-  return
-    ((int64_t)(i64rd[0] & 0xff) << 56) |
-    ((int64_t)(i64rd[1] & 0xff) << 48) |
-    ((int64_t)(i64rd[2] & 0xff) << 40) |
-    ((int64_t)(i64rd[3] & 0xff) << 32) |
-    ((int64_t)(i64rd[4] & 0xff) << 24) |
-    ((int64_t)(i64rd[5] & 0xff) << 16) |
-    ((int64_t)(i64rd[6] & 0xff) <<  8) |
-    ((int64_t)(i64rd[7] & 0xff));
-}
-
-- (double) readDouble
-{
-  // FIXME - will this get us into trouble on PowerPC?
-  int64_t ieee754 = [self readI64];
-  return *((double *) &ieee754);
-}
-
-
-- (NSData *) readBinary
-{
-  int32_t size = [self readI32];
-  size_t binarySize = CheckedCastInt32ToSizeT(size);
-  uint8_t * buff = malloc(binarySize);
-  if (buff == NULL) {
-    @throw [TProtocolException
-             exceptionWithName: @"TProtocolException"
-             reason: [NSString stringWithFormat: @"Out of memory.  Unable to allocate %d bytes trying to read binary data.",
-                               size]];
-  }
-  [mTransport readAll: buff offset: 0 length: binarySize];
-  return [NSData dataWithBytesNoCopy: buff length: binarySize];
-}
-
-
-- (void) readMapBeginReturningKeyType: (int *) keyType
-                            valueType: (int *) valueType
-                                 size: (int *) size
-{
-  int kt = [self readByte];
-  int vt = [self readByte];
-  int s = [self readI32];
-  if (keyType != NULL) {
-    *keyType = kt;
-  }
-  if (valueType != NULL) {
-    *valueType = vt;
-  }
-  if (size != NULL) {
-    *size = s;
-  }
-}
-
-- (void) readMapEnd {}
-
-
-- (void) readSetBeginReturningElementType: (int *) elementType
-                                     size: (int *) size
-{
-  int et = [self readByte];
-  int s = [self readI32];
-  if (elementType != NULL) {
-    *elementType = et;
-  }
-  if (size != NULL) {
-    *size = s;
-  }
-}
-
-
-- (void) readSetEnd {}
-
-
-- (void) readListBeginReturningElementType: (int *) elementType
-                                      size: (int *) size
-{
-  int et = [self readByte];
-  int s = [self readI32];
-  if (elementType != NULL) {
-    *elementType = et;
-  }
-  if (size != NULL) {
-    *size = s;
-  }
-}
-
-
-- (void) readListEnd {}
-
-
-- (void) writeByte: (uint8_t) value
-{
-  [mTransport write: &value offset: 0 length: 1];
-}
-
-
-- (void) writeMessageBeginWithName: (NSString *) name
-                              type: (int) messageType
-                        sequenceID: (int) sequenceID
-{
-  if (mStrictWrite) {
-    int version = (VERSION_1 << 16) | messageType;
-    [self writeI32: version];
-    [self writeString: name];
-    [self writeI32: sequenceID];
-  } else {
-    [self writeString: name];
-    [self writeByte: CheckedCastIntToUInt8(messageType)];
-    [self writeI32: sequenceID];
-  }
-}
-
-
-- (void) writeMessageEnd {}
-
-
-- (void) writeStructBeginWithName: (NSString *) name {}
-
-
-- (void) writeStructEnd {}
-
-
-- (void) writeFieldBeginWithName: (NSString *) name
-                            type: (int) fieldType
-                         fieldID: (int) fieldID
-{
-  [self writeByte: CheckedCastIntToUInt8(fieldType)];
-  [self writeI16: CheckedCastIntToUInt8(fieldID)];
-}
-
-
-- (void) writeI32: (int32_t) value
-{
-  uint8_t buff[4];
-  buff[0] = 0xFF & (value >> 24);
-  buff[1] = 0xFF & (value >> 16);
-  buff[2] = 0xFF & (value >> 8);
-  buff[3] = 0xFF & value;
-  [mTransport write: buff offset: 0 length: 4];
-}
-
-- (void) writeI16: (short) value
-{
-  uint8_t buff[2];
-  buff[0] = 0xff & (value >> 8);
-  buff[1] = 0xff & value;
-  [mTransport write: buff offset: 0 length: 2];
-}
-
-
-- (void) writeI64: (int64_t) value
-{
-  uint8_t buff[8];
-  buff[0] = 0xFF & (value >> 56);
-  buff[1] = 0xFF & (value >> 48);
-  buff[2] = 0xFF & (value >> 40);
-  buff[3] = 0xFF & (value >> 32);
-  buff[4] = 0xFF & (value >> 24);
-  buff[5] = 0xFF & (value >> 16);
-  buff[6] = 0xFF & (value >> 8);
-  buff[7] = 0xFF & value;
-  [mTransport write: buff offset: 0 length: 8];
-}
-
-- (void) writeDouble: (double) value
-{
-  // spit out IEEE 754 bits - FIXME - will this get us in trouble on
-  // PowerPC?
-  [self writeI64: *((int64_t *) &value)];
-}
-
-
-- (void) writeString: (NSString *) value
-{
-  if (value != nil) {
-    const char * utf8Bytes = [value UTF8String];
-    size_t length = strlen(utf8Bytes);
-    int32_t size = CheckedCastSizeTToInt32(length);
-    [self writeI32: size];
-    [mTransport write: (uint8_t *) utf8Bytes offset: 0 length: length];
-  } else {
-    // instead of crashing when we get null, let's write out a zero
-    // length string
-    [self writeI32: 0];
-  }
-}
-
-
-- (void) writeBinary: (NSData *) data
-{
-  int32_t size = CheckedCastSizeTToInt32([data length]);
-  [self writeI32: size];
-  [mTransport write: [data bytes] offset: 0 length: [data length]];
-}
-
-- (void) writeFieldStop
-{
-  [self writeByte: TType_STOP];
-}
-
-
-- (void) writeFieldEnd {}
-
-
-- (void) writeMapBeginWithKeyType: (int) keyType
-                        valueType: (int) valueType
-                             size: (int) size
-{
-  [self writeByte: CheckedCastIntToUInt8(keyType)];
-  [self writeByte: CheckedCastIntToUInt8(valueType)];
-  [self writeI32: size];
-}
-
-- (void) writeMapEnd {}
-
-
-- (void) writeSetBeginWithElementType: (int) elementType
-                                 size: (int) size
-{
-  [self writeByte: CheckedCastIntToUInt8(elementType)];
-  [self writeI32: size];
-}
-
-- (void) writeSetEnd {}
-
-
-- (void) writeListBeginWithElementType: (int) elementType
-                                  size: (int) size
-{
-  [self writeByte: CheckedCastIntToUInt8(elementType)];
-  [self writeI32: size];
-}
-
-- (void) writeListEnd {}
-
-
-- (void) writeBool: (BOOL) value
-{
-  [self writeByte: (value ? 1 : 0)];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.h b/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.h
deleted file mode 100644
index 3c9195c..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/protocol/TCompactProtocol.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TProtocol.h"
-#import "TTransport.h"
-#import "TProtocolFactory.h"
-
-@interface TCompactProtocol : NSObject <TProtocol>
-
-- (id) initWithTransport: (id <TTransport>) transport;
-
-@end
-
-@interface TCompactProtocolFactory : NSObject <TProtocolFactory>
-
-+ (TCompactProtocolFactory *) sharedFactory;
-
-- (TCompactProtocol *) newProtocolOnTransport: (id <TTransport>) transport;
-
-@end


[10/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
deleted file mode 100644
index 981577d..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SOCKET_H
-#define _THRIFT_SOCKET_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_socket.h
- *  \brief Socket implementation of a Thrift transport.  Subclasses the
- *         ThriftTransport class.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SOCKET (thrift_socket_get_type ())
-#define THRIFT_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SOCKET, ThriftSocket))
-#define THRIFT_IS_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SOCKET))
-#define THRIFT_SOCKET_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SOCKET, ThriftSocketClass))
-#define THRIFT_IS_SOCKET_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SOCKET))
-#define THRIFT_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SOCKET, ThriftSocketClass))
-
-typedef struct _ThriftSocket ThriftSocket;
-
-/*!
- * Thrift Socket instance.
- */
-struct _ThriftSocket
-{
-  ThriftTransport parent;
-
-  /* private */
-  gchar *hostname;
-  gshort port;
-  int sd;
-  guint8 *buf;
-  guint32 buf_size;
-  guint32 buf_len;
-};
-
-typedef struct _ThriftSocketClass ThriftSocketClass;
-
-/*!
- * Thrift Socket class.
- */
-struct _ThriftSocketClass
-{
-  ThriftTransportClass parent;
-};
-
-/* used by THRIFT_TYPE_SOCKET */
-GType thrift_socket_get_type (void);
-
-G_END_DECLS
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
deleted file mode 100644
index 5533437..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.c
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-/* define the GError domain string */
-#define THRIFT_TRANSPORT_ERROR_DOMAIN "thrift-transport-error-quark"
-
-G_DEFINE_ABSTRACT_TYPE(ThriftTransport, thrift_transport, G_TYPE_OBJECT)
-
-gboolean 
-thrift_transport_is_open (ThriftTransport *transport)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->is_open (transport);
-}
-
-gboolean
-thrift_transport_peek (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->peek (transport, error);
-}
-
-gboolean
-thrift_transport_open (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->open (transport, error);
-}
-
-gboolean
-thrift_transport_close (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->close (transport, error);
-}
-
-gint32
-thrift_transport_read (ThriftTransport *transport, gpointer buf,
-                       guint32 len, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->read (transport, buf,
-                                                       len, error);
-}
-
-gboolean
-thrift_transport_read_end (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->read_end (transport,
-                                                           error);
-}
-
-gboolean
-thrift_transport_write (ThriftTransport *transport, const gpointer buf,
-                        const guint32 len, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->write (transport, buf,
-                                                        len, error);
-}
-
-gboolean
-thrift_transport_write_end (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->write_end (transport,
-                                                            error);
-}
-
-gboolean
-thrift_transport_flush (ThriftTransport *transport, GError **error)
-{
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->flush (transport, error);
-}
-
-/* by default, peek returns true if and only if the transport is open */
-static gboolean
-thrift_transport_real_peek (ThriftTransport *transport, GError **error)
-{
-  THRIFT_UNUSED_VAR (error);
-
-  return THRIFT_TRANSPORT_GET_CLASS (transport)->is_open (transport);
-}
-
-/* define the GError domain for Thrift transports */
-GQuark
-thrift_transport_error_quark (void)
-{
-  return g_quark_from_static_string (THRIFT_TRANSPORT_ERROR_DOMAIN);
-}
-
-/* class initializer for ThriftTransport */
-static void
-thrift_transport_class_init (ThriftTransportClass *cls)
-{
-  /* set these as virtual methods to be implemented by a subclass */
-  cls->is_open = thrift_transport_is_open;
-  cls->open = thrift_transport_open;
-  cls->close = thrift_transport_close;
-  cls->read = thrift_transport_read;
-  cls->read_end = thrift_transport_read_end;
-  cls->write = thrift_transport_write;
-  cls->write_end = thrift_transport_write_end;
-  cls->flush = thrift_transport_flush;
-
-  /* provide a default implementation for the peek method */
-  cls->peek = thrift_transport_real_peek;
-}
-
-static void
-thrift_transport_init (ThriftTransport *transport)
-{
-  THRIFT_UNUSED_VAR (transport);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.h
deleted file mode 100644
index 5555a5e..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_H
-#define _THRIFT_TRANSPORT_H
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_transport.h
- *  \brief Abstract class for Thrift transports.
- *
- * An abstract class is used instead of an interface because:
- *  - interfaces can't seem to be used as properties.  ThriftProtocol has
- *    a ThriftTransport as an object property.
- *  - if a method needs to be added that all subclasses can use, a class
- *    is necessary.
- */
-
-/* type macros */
-#define THRIFT_TYPE_TRANSPORT (thrift_transport_get_type ())
-#define THRIFT_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_TRANSPORT, ThriftTransport))
-#define THRIFT_IS_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_TRANSPORT))
-#define THRIFT_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_TRANSPORT, ThriftTransportClass))
-#define THRIFT_IS_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_TRANSPORT))
-#define THRIFT_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_TRANSPORT, ThriftTransportClass))
-
-typedef struct _ThriftTransport ThriftTransport;
-
-/*!
- * Thrift Protocol object
- */
-struct _ThriftTransport
-{
-  GObject parent;
-};
-
-typedef struct _ThriftTransportClass ThriftTransportClass;
-
-/*!
- * Thrift Transport class
- */
-struct _ThriftTransportClass
-{
-  GObjectClass parent;
-
-  /* vtable */
-  gboolean (*is_open) (ThriftTransport *transport);
-  gboolean (*peek) (ThriftTransport *transport, GError **error);
-  gboolean (*open) (ThriftTransport *transport, GError **error);
-  gboolean (*close) (ThriftTransport *transport, GError **error);
-  gint32 (*read) (ThriftTransport *transport, gpointer buf,
-                  guint32 len, GError **error);
-  gboolean (*read_end) (ThriftTransport *transport, GError **error);
-  gboolean (*write) (ThriftTransport *transport, const gpointer buf,
-                   const guint32 len, GError **error);
-  gboolean (*write_end) (ThriftTransport *transport, GError **error);
-  gboolean (*flush) (ThriftTransport *transport, GError **error);
-};
-
-/* used by THRIFT_TYPE_TRANSPORT */
-GType thrift_transport_get_type (void);
-
-/* virtual public methods */
-
-/*!
- * Checks if this transport is opened.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_is_open (ThriftTransport *transport);
-
-/*!
- * Open the transport for reading and writing.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_open (ThriftTransport *transport, GError **error);
-
-/*!
- * Tests whether there is more data to read or if the remote side is still
- * open. By default this is true whenever the transport is open, but
- * implementations should add logic to test for this condition where possible
- * (i.e. on a socket).
- *
- * This is used by a server to check if it should listen for another request.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_peek (ThriftTransport *transport, GError **error);
-
-/*!
- * Close the transport.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_close (ThriftTransport *transport, GError **error);
-
-/*!
- * Read some data into the buffer buf.
- * \public \memberof ThriftTransportInterface
- */
-gint32 thrift_transport_read (ThriftTransport *transport, gpointer buf,
-                              guint32 len, GError **error);
-
-/*!
- * Called when read is completed.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_read_end (ThriftTransport *transport, GError **error);
-
-/*!
- * Writes data from a buffer to the transport.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_write (ThriftTransport *transport, const gpointer buf,
-                                 const guint32 len, GError **error);
-
-/*!
- * Called when write is completed.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_write_end (ThriftTransport *transport,
-                                     GError **error);
-
-/*!
- * Flushes any pending data to be written.  Typically used with buffered
- * transport mechanisms.
- * \public \memberof ThriftTransportInterface
- */
-gboolean thrift_transport_flush (ThriftTransport *transport, GError **error);
-
-/* define error/exception types */
-typedef enum
-{
-  THRIFT_TRANSPORT_ERROR_UNKNOWN,
-  THRIFT_TRANSPORT_ERROR_HOST,
-  THRIFT_TRANSPORT_ERROR_SOCKET,
-  THRIFT_TRANSPORT_ERROR_CONNECT,
-  THRIFT_TRANSPORT_ERROR_SEND,
-  THRIFT_TRANSPORT_ERROR_RECEIVE,
-  THRIFT_TRANSPORT_ERROR_CLOSE
-} ThriftTransportError;
-
-/* define an error domain for GError to use */
-GQuark thrift_transport_error_quark (void);
-#define THRIFT_TRANSPORT_ERROR (thrift_transport_error_quark ())
-
-/* define macro for invalid socket */
-#define THRIFT_INVALID_SOCKET (-1)
-
-G_END_DECLS
-
-#endif /* _THRIFT_TRANSPORT_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.c
deleted file mode 100644
index a2025cf..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport_factory.h>
-
-G_DEFINE_TYPE(ThriftTransportFactory, thrift_transport_factory, G_TYPE_OBJECT)
-
-/* builds a transport from the base transport. */
-ThriftTransport *
-thrift_transport_factory_get_transport (ThriftTransportFactory *factory,
-                                        ThriftTransport *transport)
-{
-  THRIFT_UNUSED_VAR (factory);
-  return transport;
-}
-
-static void
-thrift_transport_factory_class_init (ThriftTransportFactoryClass *cls)
-{
-  cls->get_transport = thrift_transport_factory_get_transport;
-}
-
-static void
-thrift_transport_factory_init (ThriftTransportFactory *factory)
-{
-  THRIFT_UNUSED_VAR (factory);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.h
deleted file mode 100644
index 0e3da30..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_transport_factory.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TRANSPORT_FACTORY_H
-#define _THRIFT_TRANSPORT_FACTORY_H
-
-#include <glib-object.h>
-
-#include "thrift_transport.h"
-
-G_BEGIN_DECLS
-
-/*! \file thrift_transport_factory.h
- *  \brief Base class for Thrift Transport Factories.  Used by Thrift Servers
- *         to obtain a client transport from an existing transport.  The default
- *         implementation simply clones the provided transport.
- */
-
-/* type macros */
-#define THRIFT_TYPE_TRANSPORT_FACTORY (thrift_transport_factory_get_type ())
-#define THRIFT_TRANSPORT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactory))
-#define THRIFT_IS_TRANSPORT_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_TRANSPORT_FACTORY))
-#define THRIFT_TRANSPORT_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactoryClass))
-#define THRIFT_IS_TRANSPORT_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_TRANSPORT_FACTORY))
-#define THRIFT_TRANSPORT_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_TRANSPORT_FACTORY, ThriftTransportFactoryClass))
-
-typedef struct _ThriftTransportFactory ThriftTransportFactory;
-
-/* Thrift Transport Factory instance */
-struct _ThriftTransportFactory
-{
-  GObject parent;
-};
-
-typedef struct _ThriftTransportFactoryClass ThriftTransportFactoryClass;
-
-/* Thrift Transport Factory class */
-struct _ThriftTransportFactoryClass
-{
-  GObjectClass parent;
-
-  /* vtable */
-  ThriftTransport *(*get_transport) (ThriftTransportFactory *factory,
-                                     ThriftTransport *transport);
-};
-
-/* used by THRIFT_TYPE_TRANSPORT_FACTORY */
-GType thrift_transport_factory_get_type (void);
-
-/* virtual public methods */
-ThriftTransport *thrift_transport_factory_get_transport (ThriftTransportFactory *factory, ThriftTransport *transport);
-
-G_END_DECLS
-
-#endif /* _THRIFT_TRANSPORT_FACTORY_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/CMakeLists.txt b/depends/thirdparty/thrift/lib/c_glib/test/CMakeLists.txt
deleted file mode 100644
index 31e6c6b..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/CMakeLists.txt
+++ /dev/null
@@ -1,170 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-
-#Make sure gen-cpp and gen-c_glib files can be included
-include_directories("${CMAKE_CURRENT_BINARY_DIR}")
-
-set(TEST_PREFIX "c_glib")
-
-include_directories(${Boost_INCLUDE_DIRS})
-
-# Create the thrift C test library
-set(testgenc_SOURCES
-    gen-c_glib/t_test_debug_proto_test_types.c
-    gen-c_glib/t_test_empty_service.c
-    gen-c_glib/t_test_inherited.c
-    gen-c_glib/t_test_optional_required_test_types.c
-    gen-c_glib/t_test_reverse_order_service.c
-    gen-c_glib/t_test_second_service.c
-    gen-c_glib/t_test_service_for_exception_with_a_map.c
-    gen-c_glib/t_test_srv.c
-    gen-c_glib/t_test_thrift_test.c
-    gen-c_glib/t_test_thrift_test_types.c
-    gen-c_glib/t_test_debug_proto_test_types.h
-    gen-c_glib/t_test_empty_service.h
-    gen-c_glib/t_test_inherited.h
-    gen-c_glib/t_test_optional_required_test_types.h
-    gen-c_glib/t_test_reverse_order_service.h
-    gen-c_glib/t_test_second_service.h
-    gen-c_glib/t_test_service_for_exception_with_a_map.h
-    gen-c_glib/t_test_srv.h
-    gen-c_glib/t_test_thrift_test.h
-    gen-c_glib/t_test_thrift_test_types.h
-)
-
-add_library(testgenc STATIC ${testgenc_SOURCES})
-target_link_libraries(testgenc thrift_c_glib)
-
-
-add_executable(testapplicationexception testapplicationexception.c)
-target_link_libraries(testapplicationexception thrift_c_glib)
-add_test(NAME testapplicationexception COMMAND testapplicationexception)
-
-add_executable(testtransportsocket testtransportsocket.c)
-target_link_libraries(testtransportsocket thrift_c_glib)
-add_test(NAME testtransportsocket COMMAND testtransportsocket)
-
-add_executable(testbinaryprotocol testbinaryprotocol.c)
-target_link_libraries(testbinaryprotocol thrift_c_glib)
-add_test(NAME testbinaryprotocol COMMAND testbinaryprotocol)
-
-add_executable(testbufferedtransport testbufferedtransport.c)
-target_link_libraries(testbufferedtransport thrift_c_glib)
-add_test(NAME testbufferedtransport COMMAND testbufferedtransport)
-
-add_executable(testframedtransport testframedtransport.c)
-target_link_libraries(testframedtransport thrift_c_glib)
-add_test(NAME testframedtransport COMMAND testframedtransport)
-
-add_executable(testmemorybuffer testmemorybuffer.c)
-target_link_libraries(testmemorybuffer thrift_c_glib)
-add_test(NAME testmemorybuffer COMMAND testmemorybuffer)
-
-add_executable(testsimpleserver testsimpleserver.c)
-target_link_libraries(testsimpleserver thrift_c_glib)
-add_test(NAME testsimpleserver COMMAND testsimpleserver)
-
-add_executable(testdebugproto testdebugproto.c)
-target_link_libraries(testdebugproto testgenc)
-add_test(NAME testdebugproto COMMAND testdebugproto)
-
-add_executable(testoptionalrequired testoptionalrequired.c)
-target_link_libraries(testoptionalrequired testgenc)
-add_test(NAME testoptionalrequired COMMAND testoptionalrequired)
-
-add_executable(testthrifttest testthrifttest.c)
-target_link_libraries(testthrifttest testgenc)
-add_test(NAME testthrifttest COMMAND testthrifttest)
-
-
-if(BUILD_CPP)
-
-    include_directories("${PROJECT_SOURCE_DIR}/lib/cpp/src")
-
-    # Create the thrift C++ test library
-    set(testgenc_cpp_SOURCES
-        gen-cpp/ThriftTest.cpp
-        gen-cpp/ThriftTest_constants.cpp
-        gen-cpp/ThriftTest_types.cpp
-        gen-cpp/ThriftTest.h
-        gen-cpp/ThriftTest_constants.h
-        gen-cpp/ThriftTest_types.h
-    )
-
-    add_library(testgenc_cpp STATIC ${testgenc_cpp_SOURCES})
-    target_link_libraries(testgenc_cpp thrift)
-
-    #HACK: testthrifttestclient.cpp includes ThriftTest.h without gen-*/ prefixes
-    # so we include it here
-    include_directories("${CMAKE_CURRENT_BINARY_DIR}/gen-cpp" "${CMAKE_CURRENT_BINARY_DIR}/gen-c_glib")
-
-    add_executable(testthrifttestclient testthrifttestclient.cpp)
-    target_link_libraries(testthrifttestclient testgenc testgenc_cpp)
-    add_test(NAME testthrifttestclient COMMAND testthrifttestclient)
-
-endif(BUILD_CPP)
-
-#
-# Common thrift code generation rules
-#
-
-add_custom_command(OUTPUT
-    gen-c_glib/t_test_debug_proto_test_types.c
-    gen-c_glib/t_test_debug_proto_test_types.h
-    gen-c_glib/t_test_empty_service.c
-    gen-c_glib/t_test_empty_service.h
-    gen-c_glib/t_test_inherited.c
-    gen-c_glib/t_test_inherited.h
-    gen-c_glib/t_test_reverse_order_service.c
-    gen-c_glib/t_test_reverse_order_service.h
-    gen-c_glib/t_test_service_for_exception_with_a_map.c
-    gen-c_glib/t_test_service_for_exception_with_a_map.h
-    gen-c_glib/t_test_srv.c
-    gen-c_glib/t_test_srv.h
-    COMMAND thrift-compiler --gen c_glib ${PROJECT_SOURCE_DIR}/test/DebugProtoTest.thrift
-)
-
-add_custom_command(OUTPUT
-    gen-c_glib/t_test_optional_required_test_types.c
-    gen-c_glib/t_test_optional_required_test_types.h
-    COMMAND thrift-compiler --gen c_glib ${PROJECT_SOURCE_DIR}/test/OptionalRequiredTest.thrift
-)
-
-add_custom_command(OUTPUT
-    gen-c_glib/t_test_second_service.c
-    gen-c_glib/t_test_thrift_test.c
-    gen-c_glib/t_test_thrift_test_types.c
-    gen-c_glib/t_test_second_service.h
-    gen-c_glib/t_test_thrift_test.h
-    gen-c_glib/t_test_thrift_test_types.h
-    COMMAND thrift-compiler --gen c_glib ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
-)
-
-add_custom_command(OUTPUT
-    gen-cpp/ThriftTest.cpp
-    gen-cpp/ThriftTest_constants.cpp
-    gen-cpp/ThriftTest_types.cpp
-    gen-cpp/ThriftTest.h
-    gen-cpp/ThriftTest_constants.h
-    gen-cpp/ThriftTest_types.h
-    COMMAND thrift-compiler --gen cpp ${PROJECT_SOURCE_DIR}/test/ThriftTest.thrift
-)
-
-# TODO: Add memory checks using ctest_memcheck or similar

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/ContainerTest.thrift
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/ContainerTest.thrift b/depends/thirdparty/thrift/lib/c_glib/test/ContainerTest.thrift
deleted file mode 100644
index a92a9a5..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/ContainerTest.thrift
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-namespace c_glib TTest
-
-typedef list<string> StringList
-typedef list<StringList> ListStringList
-
-struct ContainersWithDefaultValues {
-  1: list<string> StringList = [ "Apache", "Thrift" ];
-}
-
-service ContainerService {
-  void receiveStringList(1: list<string> stringList);
-  list<string> returnStringList();
-
-  list<list<string>> returnListStringList();
-  ListStringList returnTypedefdListStringList();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/Makefile.am b/depends/thirdparty/thrift/lib/c_glib/test/Makefile.am
deleted file mode 100755
index 7319743..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/Makefile.am
+++ /dev/null
@@ -1,282 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-AUTOMAKE_OPTIONS = subdir-objects serial-tests
-
-SUBDIRS =
-
-BUILT_SOURCES = \
-        gen-c_glib/t_test_container_test_types.c \
-        gen-c_glib/t_test_container_test_types.h \
-        gen-c_glib/t_test_debug_proto_test_types.h \
-        gen-c_glib/t_test_empty_service.h \
-        gen-c_glib/t_test_inherited.h \
-        gen-c_glib/t_test_optional_required_test_types.h \
-        gen-c_glib/t_test_reverse_order_service.h \
-        gen-c_glib/t_test_second_service.h \
-        gen-c_glib/t_test_service_for_exception_with_a_map.h \
-        gen-c_glib/t_test_container_service.c \
-        gen-c_glib/t_test_container_service.h \
-        gen-c_glib/t_test_srv.h \
-        gen-c_glib/t_test_thrift_test.h \
-        gen-c_glib/t_test_thrift_test_types.h
-
-AM_CPPFLAGS = -I../src
-AM_CFLAGS = -g -Wall -Wextra -pedantic $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) \
-	@GCOV_CFLAGS@
-AM_CXXFLAGS = $(AM_CFLAGS)
-AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
-
-check_PROGRAMS = \
-  testapplicationexception \
-  testcontainertest \
-  testtransportsocket \
-  testbinaryprotocol \
-  testbufferedtransport \
-  testframedtransport \
-  testmemorybuffer \
-  teststruct \
-  testsimpleserver \
-  testdebugproto \
-  testoptionalrequired \
-  testthrifttest
-
-if WITH_CPP
-  BUILT_SOURCES += gen-cpp/ThriftTest_types.cpp
-  check_PROGRAMS += testthrifttestclient
-endif
-
-testapplicationexception_SOURCES = testapplicationexception.c
-testapplicationexception_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_application_exception.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
-
-testcontainertest_SOURCES = testcontainertest.c
-testcontainertest_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o \
-	  libtestgenc.la
-
-testtransportsocket_SOURCES = testtransportsocket.c
-testtransportsocket_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_buffered_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
-
-testbinaryprotocol_SOURCES = testbinaryprotocol.c
-testbinaryprotocol_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
-
-testbufferedtransport_SOURCES = testbufferedtransport.c
-testbufferedtransport_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
-
-testframedtransport_SOURCES = testframedtransport.c
-testframedtransport_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o
-
-testmemorybuffer_SOURCES = testmemorybuffer.c
-testmemorybuffer_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
-
-teststruct_SOURCES = teststruct.c
-teststruct_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o
-
-testsimpleserver_SOURCES = testsimpleserver.c
-testsimpleserver_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o
-
-testdebugproto_SOURCES = testdebugproto.c
-testdebugproto_LDADD = libtestgenc.la
-
-testoptionalrequired_SOURCES = testoptionalrequired.c
-testoptionalrequired_LDADD = \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \
-    $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \
-    libtestgenc.la
-
-testthrifttest_SOURCES = testthrifttest.c
-testthrifttest_LDADD = libtestgenc.la
-
-testthrifttestclient_SOURCES = testthrifttestclient.cpp
-testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
-testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
-testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
-
-check_LTLIBRARIES = libtestgenc.la
-
-if WITH_CPP
-  check_LTLIBRARIES += libtestgencpp.la
-endif
-
-nodist_libtestgenc_la_SOURCES = \
-        gen-c_glib/t_test_container_test_types.c \
-        gen-c_glib/t_test_debug_proto_test_types.c \
-        gen-c_glib/t_test_empty_service.c \
-        gen-c_glib/t_test_inherited.c \
-        gen-c_glib/t_test_optional_required_test_types.c \
-        gen-c_glib/t_test_reverse_order_service.c \
-        gen-c_glib/t_test_second_service.c \
-        gen-c_glib/t_test_service_for_exception_with_a_map.c \
-        gen-c_glib/t_test_srv.c \
-        gen-c_glib/t_test_container_service.c \
-        gen-c_glib/t_test_thrift_test.c \
-        gen-c_glib/t_test_thrift_test_types.c \
-        gen-c_glib/t_test_container_test_types.h \
-        gen-c_glib/t_test_debug_proto_test_types.h \
-        gen-c_glib/t_test_empty_service.h \
-        gen-c_glib/t_test_inherited.h \
-        gen-c_glib/t_test_optional_required_test_types.h \
-        gen-c_glib/t_test_reverse_order_service.h \
-        gen-c_glib/t_test_second_service.h \
-        gen-c_glib/t_test_service_for_exception_with_a_map.h \
-        gen-c_glib/t_test_srv.h \
-        gen-c_glib/t_test_container_service.h \
-        gen-c_glib/t_test_thrift_test.h \
-        gen-c_glib/t_test_thrift_test_types.h
-libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
-libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function
-
-nodist_libtestgencpp_la_SOURCES = \
-        gen-cpp/ThriftTest.cpp \
-        gen-cpp/ThriftTest_constants.cpp \
-        gen-cpp/ThriftTest_types.cpp \
-        gen-cpp/ThriftTest.h \
-        gen-cpp/ThriftTest_constants.h \
-        gen-cpp/ThriftTest_types.h
-libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
-
-THRIFT = $(top_builddir)/compiler/cpp/thrift
-
-gen-c_glib/t_test_container_test_types.c gen-c_glib/t_test_container_test_types.h gen-c_glib/t_test_container_service.c gen-c_glib/t_test_container_service.h: ContainerTest.thrift
-	$(THRIFT) --gen c_glib $<
-
-gen-c_glib/t_test_debug_proto_test_types.c gen-c_glib/t_test_debug_proto_test_types.h gen-c_glib/t_test_empty_service.c gen-c_glib/t_test_empty_service.h gen-c_glib/t_test_inherited.c gen-c_glib/t_test_inherited.h gen-c_glib/t_test_reverse_order_service.c gen-c_glib/t_test_reverse_order_service.h gen-c_glib/t_test_service_for_exception_with_a_map.c gen-c_glib/t_test_service_for_exception_with_a_map.h gen-c_glib/t_test_srv.c gen-c_glib/t_test_srv.h: ../../../test/DebugProtoTest.thrift
-	$(THRIFT) --gen c_glib $<
-
-gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
-	$(THRIFT) --gen c_glib $<
-
-gen-c_glib/t_test_second_service.c gen-c_glib/t_test_thrift_test.c gen-c_glib/t_test_thrift_test_types.c gen-c_glib/t_test_second_service.h gen-c_glib/t_test_thrift_test.h gen-c_glib/t_test_thrift_test_types.h: ../../../test/ThriftTest.thrift
-	$(THRIFT) --gen c_glib $<
-
-gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift
-	$(THRIFT) --gen cpp $<
-
-TESTS = \
-  $(check_PROGRAMS) \
-  $(check_SCRIPTS)
-
-# globally added to all instances of valgrind calls
-# VALGRIND_OPTS = --suppressions=glib.suppress
-VALGRIND_OPTS =
-
-# globally added to all memcheck calls
-VALGRIND_MEM_OPTS = --tool=memcheck \
-                    --num-callers=10 \
-                    ${myextravalgrindmemopts}
-
-# globally added to all leakcheck calls
-VALGRIND_LEAK_OPTS = --tool=memcheck \
-                     --num-callers=10 \
-                     --leak-check=full \
-                     --leak-resolution=high \
-                     ${myextravalgrindleakopts}
-
-memcheck: $(check_PROGRAMS)
-	@for x in $(check_PROGRAMS);                                     \
-	  do                                                             \
-	    $(MAKE) memcheck-$$x;                                        \
-	  done
-
-leakcheck: $(check_PROGRAMS)
-	@for x in $(check_PROGRAMS);                                     \
-	  do                                                             \
-	    $(MAKE) leakcheck-$$x;                                       \
-	done
-
-memcheck-%: %
-	@echo "*****************************************";               \
-	echo "MEMCHECK: $<";                                             \
-	echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}";                                                                      \
-	$(LIBTOOL) --mode=execute                                        \
-	  valgrind                                                       \
-	    ${VALGRIND_OPTS}                                             \
-	    ${VALGRIND_MEM_OPTS}                                         \
-	    ${$<_VALGRIND_MEM_OPTS} ./$<
-
-leakcheck-%: %
-	@echo "*****************************************";              \
-	echo "LEAKCHECK: $<";                                           \
-	echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}";                                                                   \
-	G_SLICE=always-malloc $(LIBTOOL) --mode=execute                 \
-	  valgrind                                                      \
-	    ${VALGRIND_OPTS}                                            \
-	    ${VALGRIND_LEAK_OPTS}                                       \
-	    ${$<_VALGRIND_LEAK_OPTS}  ./$<
-
-clean-local:
-	$(RM) gen-c_glib/* gen-cpp/*
-
-CLEANFILES =                            \
-    *.bb                                \
-    *.bbg                               \
-    *.da                                \
-    *.gcno                              \
-    *.gcda                              \
-    *.gcov
-
-EXTRA_DIST = \
-             CMakeLists.txt \
-             ContainerTest.thrift
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/glib.suppress
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/glib.suppress b/depends/thirdparty/thrift/lib/c_glib/test/glib.suppress
deleted file mode 100644
index 0e0e9fe..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/glib.suppress
+++ /dev/null
@@ -1,64 +0,0 @@
-{
-   g_type_init_1
-   Memcheck:Leak
-   fun:malloc
-   ...
-   fun:g_type_init_with_debug_flags
-}
-
-{
-   g_type_init_2
-   Memcheck:Leak
-   fun:calloc
-   ...
-   fun:g_type_init_with_debug_flags
-}
-
-{
-   g_type_init_3
-   Memcheck:Leak
-   fun:realloc
-   ...
-   fun:g_type_init_with_debug_flags
-}
-
-{
-   g_type_register_static_1
-   Memcheck:Leak
-   fun:realloc
-   ...
-   fun:g_type_register_static
-}
-
-{
-   g_type_register_statuc_2
-   Memcheck:Leak
-   fun:malloc
-   fun:realloc
-   fun:g_realloc
-   ...
-   fun:g_type_register_static
-}
-
-{
-   type_class_init_Wm1
-   Memcheck:Leak
-   fun:calloc
-   fun:g_malloc0
-   fun:type_class_init_Wm
-   fun:g_type_class_ref
-   ...
-   fun:g_object_newv
-}
-
-{
-   type_class_init_Wm2
-   Memcheck:Leak
-   fun:calloc
-   fun:g_malloc0
-   fun:type_class_init_Wm
-   fun:g_type_class_ref
-   ...
-   fun:type_class_init_Wm
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testapplicationexception.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testapplicationexception.c b/depends/thirdparty/thrift/lib/c_glib/test/testapplicationexception.c
deleted file mode 100644
index 89e39e2..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testapplicationexception.c
+++ /dev/null
@@ -1,180 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <glib.h>
-#include <string.h>
-
-#include <thrift/c_glib/thrift_application_exception.h>
-
-static void
-test_create_and_destroy (void)
-{
-  GObject *object = NULL;
-
-  /* A ThriftApplicationException can be created... */
-  object = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
-
-  g_assert (object != NULL);
-  g_assert (THRIFT_IS_APPLICATION_EXCEPTION (object));
-
-  /* ...and destroyed */
-  g_object_unref (object);
-}
-
-static void
-test_initialize (void)
-{
-  ThriftApplicationException *xception = NULL;
-  gint32 type = THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR;
-  gchar *message = "Exception message";
-  gint32 retrieved_type = 0;
-  gchar *retrieved_message = NULL;
-
-  /* A ThriftApplicationException has "type" and "message" properties that can
-     be initialized at object creation */
-  xception =
-    g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION,
-                  "type",    type,
-                  "message", message,
-                  NULL);
-
-  g_assert (xception != NULL);
-
-  /* A ThriftApplicationException's properties can be retrieved */
-  g_object_get (xception,
-                "type",    &retrieved_type,
-                "message", &retrieved_message,
-                NULL);
-
-  g_assert (retrieved_type == type);
-  g_assert (retrieved_message != NULL);
-  g_assert_cmpstr (retrieved_message, ==, message);
-
-  g_free (retrieved_message);
-  g_object_unref (xception);
-}
-
-static void
-test_properties_test (void)
-{
-  ThriftApplicationException *xception = NULL;
-  gint32 retrieved_type;
-
-  xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
-
-#define TEST_TYPE_VALUE(_type)                                  \
-  retrieved_type = -1;                                          \
-  g_object_set (xception, "type", _type, NULL);                 \
-  g_object_get (xception, "type", &retrieved_type, NULL);       \
-  g_assert_cmpint (retrieved_type, ==, _type);
-
-  /* The "type" property can be set to any valid Thrift exception type */
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN_METHOD);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_BAD_SEQUENCE_ID);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_MISSING_RESULT);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_INTERNAL_ERROR);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_PROTOCOL_ERROR);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_TRANSFORM);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_PROTOCOL);
-  TEST_TYPE_VALUE (THRIFT_APPLICATION_EXCEPTION_ERROR_UNSUPPORTED_CLIENT_TYPE);
-
-/* "g_test_expect_message" is required for the property range tests below but is
-   not present in GLib before version 2.34 */
-#if (GLIB_CHECK_VERSION (2, 34, 0))
-  g_object_set (xception,
-                "type", THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN,
-                NULL);
-
-  /* The "type" property cannot be set to a value too low (less than zero) */
-  g_test_expect_message ("GLib-GObject",
-                         G_LOG_LEVEL_WARNING,
-                         "value*out of range*type*");
-  g_object_set (xception, "type", -1, NULL);
-  g_test_assert_expected_messages ();
-
-  g_object_get (xception, "type", &retrieved_type, NULL);
-  g_assert_cmpint (retrieved_type, !=, -1);
-  g_assert_cmpint (retrieved_type,
-                   ==,
-                   THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN);
-
-  /* The "type" property cannot be set to a value too high (greater than the
-     highest defined exception-type value) */
-  g_test_expect_message ("GLib-GObject",
-                         G_LOG_LEVEL_WARNING,
-                         "value*out of range*type*");
-  g_object_set (xception, "type", THRIFT_APPLICATION_EXCEPTION_ERROR_N, NULL);
-  g_test_assert_expected_messages ();
-
-  g_object_get (xception, "type", &retrieved_type, NULL);
-  g_assert_cmpint (retrieved_type, !=, THRIFT_APPLICATION_EXCEPTION_ERROR_N);
-  g_assert_cmpint (retrieved_type,
-                   ==,
-                   THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN);
-#endif
-
-  g_object_unref (xception);
-}
-
-static void
-test_properties_message (void)
-{
-  ThriftApplicationException *xception = NULL;
-  gchar *message = "Exception message";
-  gchar *retrieved_message;
-
-  xception = g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);
-
-  /* The "message" property can be set to NULL */
-  g_object_set (xception, "message", NULL, NULL);
-  g_object_get (xception, "message", &retrieved_message, NULL);
-  g_assert (retrieved_message == NULL);
-
-  /* The "message" property can be set to a valid string */
-  g_object_set (xception, "message", message, NULL);
-  g_object_get (xception, "message", &retrieved_message, NULL);
-  g_assert_cmpint (strcmp (retrieved_message, message), ==, 0);
-
-  g_free (retrieved_message);
-  g_object_unref (xception);
-}
-
-int
-main (int argc, char **argv)
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init ();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testapplicationexception/CreateAndDestroy",
-    test_create_and_destroy);
-  g_test_add_func ("/testapplicationexception/Initialize",
-    test_initialize);
-  g_test_add_func ("/testapplicationexception/Properties/test",
-    test_properties_test);
-  g_test_add_func ("/testapplicationexception/Properties/message",
-    test_properties_message);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testbinaryprotocol.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testbinaryprotocol.c b/depends/thirdparty/thrift/lib/c_glib/test/testbinaryprotocol.c
deleted file mode 100755
index cd65501..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testbinaryprotocol.c
+++ /dev/null
@@ -1,688 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/* Disable string-function optimizations when glibc is used, as these produce
-   compiler warnings about string length when a string function is used inside
-   a call to assert () */
-#if !defined(__APPLE__) && !defined(__FreeBSD__) && \
-    !defined(__OpenBSD__) && !defined(__NetBSD__)
-#include <features.h>
-#endif
-
-#ifdef __GLIBC__
-#define __NO_STRING_INLINES 1
-#endif
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <assert.h>
-#include <netdb.h>
-#include <string.h>
-#include <sys/wait.h>
-
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_BOOL TRUE
-#define TEST_BYTE 123
-#define TEST_I16 12345
-#define TEST_I32 1234567890
-#define TEST_I64 123456789012345
-#define TEST_DOUBLE 1234567890.123
-#define TEST_STRING "this is a test string 1234567890!@#$%^&*()"
-#define TEST_PORT 51199
-
-static int transport_read_count = 0;
-static int transport_read_error = 0;
-static int transport_read_error_at = -1;
-gint32
-my_thrift_transport_read (ThriftTransport *transport, gpointer buf,
-                          guint32 len, GError **error)
-{
-  if (transport_read_count != transport_read_error_at
-      && transport_read_error == 0)
-  {
-    transport_read_count++;
-    return thrift_transport_read (transport, buf, len, error);
-  }
-  return -1;
-}
-
-static int transport_write_count = 0;
-static int transport_write_error = 0;
-static int transport_write_error_at = -1;
-gboolean
-my_thrift_transport_write (ThriftTransport *transport, const gpointer buf,
-                           const guint32 len, GError **error)
-{
-  if (transport_write_count != transport_write_error_at
-      && transport_write_error == 0)
-  {
-    transport_write_count++;
-    return thrift_transport_write (transport, buf, len, error);
-  }
-  return FALSE;
-}
-
-#define thrift_transport_read my_thrift_transport_read
-#define thrift_transport_write my_thrift_transport_write
-#include "../src/thrift/c_glib/protocol/thrift_binary_protocol.c"
-#undef thrift_transport_read
-#undef thrift_transport_write
-
-static void thrift_server_primitives (const int port);
-static void thrift_server_complex_types (const int port);
-
-static void
-test_create_and_destroy(void)
-{
-  GObject *object = NULL;
-
-  /* create an object and then destroy it */
-  object = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, NULL);
-  assert (object != NULL);
-  g_object_unref (object);
-}
-
-static void
-test_initialize(void)
-{
-  ThriftSocket *tsocket = NULL;
-  ThriftBinaryProtocol *protocol = NULL;
-  ThriftSocket *temp = NULL;
-
-  /* create a ThriftTransport */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                          "port", 51188, NULL);
-  assert (tsocket != NULL);
-  /* create a ThriftBinaryProtocol using the Transport */
-  protocol = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                           tsocket, NULL);
-  assert (protocol != NULL);
-  /* fetch the properties */
-  g_object_get (G_OBJECT(protocol), "transport", &temp, NULL);
-  g_object_unref (temp);
-
-  /* clean up memory */
-  g_object_unref (protocol);
-  g_object_unref (tsocket);
-}
-
-static void
-test_read_and_write_primitives(void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  ThriftBinaryProtocol *tb = NULL;
-  ThriftProtocol *protocol = NULL;
-  gpointer binary = (gpointer *) TEST_STRING;
-  guint32 len = strlen (TEST_STRING);
-  int port = TEST_PORT;
-
-  /* fork a server from the client */
-  pid = fork ();
-  assert (pid >= 0);
-
-  if (pid == 0)
-  {
-    /* child listens */
-    thrift_server_primitives (port);
-    exit (0);
-  } else {
-    /* parent.  wait a bit for the socket to be created. */
-    sleep (1);
-
-    /* create a ThriftSocket */
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = THRIFT_TRANSPORT (tsocket);
-    thrift_transport_open (transport, NULL);
-    assert (thrift_transport_is_open (transport));
-
-    /* create a ThriftBinaryTransport */
-    tb = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                       tsocket, NULL);
-    protocol = THRIFT_PROTOCOL (tb);
-    assert (protocol != NULL);
-
-    /* write a bunch of primitives */
-    assert (thrift_binary_protocol_write_bool (protocol, TEST_BOOL, NULL) > 0);
-    assert (thrift_binary_protocol_write_byte (protocol, TEST_BYTE, NULL) > 0);
-    assert (thrift_binary_protocol_write_i16 (protocol, TEST_I16, NULL) > 0);
-    assert (thrift_binary_protocol_write_i32 (protocol, TEST_I32, NULL) > 0);
-    assert (thrift_binary_protocol_write_i64 (protocol, TEST_I64, NULL) > 0);
-    assert (thrift_binary_protocol_write_double (protocol, 
-                                                 TEST_DOUBLE, NULL) > 0);
-    assert (thrift_binary_protocol_write_string (protocol,
-                                                 TEST_STRING, NULL) > 0);
-    assert (thrift_binary_protocol_write_binary (protocol, binary, 
-                                                 len, NULL) > 0);
-    assert (thrift_binary_protocol_write_binary (protocol, NULL, 0, NULL) > 0);
-    assert (thrift_binary_protocol_write_binary (protocol, binary,
-                                                 len, NULL) > 0);
-
-    /* test write errors */
-    transport_write_error = 1;
-    assert (thrift_binary_protocol_write_byte (protocol, TEST_BYTE, 
-                                               NULL) == -1);
-    assert (thrift_binary_protocol_write_i16 (protocol, TEST_I16, NULL) == -1);
-    assert (thrift_binary_protocol_write_i32 (protocol, TEST_I32, NULL) == -1);
-    assert (thrift_binary_protocol_write_i64 (protocol, TEST_I64, NULL) == -1);
-    assert (thrift_binary_protocol_write_double (protocol, TEST_DOUBLE,
-                                                 NULL) == -1);
-    assert (thrift_binary_protocol_write_binary (protocol, binary, len,
-                                                 NULL) == -1);
-    transport_write_error = 0;
-
-    /* test binary partial failure */
-    transport_write_count = 0;
-    transport_write_error_at = 1;
-    assert (thrift_binary_protocol_write_binary (protocol, binary,
-                                                 len, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* clean up */
-    thrift_transport_close (transport, NULL);
-    g_object_unref (tsocket);
-    g_object_unref (protocol);
-    assert (wait (&status) == pid);
-    assert (status == 0);
-  }
-}
-
-static void
-test_read_and_write_complex_types (void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  ThriftBinaryProtocol *tb = NULL;
-  ThriftProtocol *protocol = NULL;
-  int port = TEST_PORT;
-
-  /* fork a server from the client */
-  pid = fork ();
-  assert (pid >= 0);
-
-  if (pid == 0)
-  {
-    /* child listens */
-    thrift_server_complex_types (port);
-    exit (0);
-  } else {
-    /* parent.  wait a bit for the socket to be created. */
-    sleep (1);
-
-    /* create a ThriftSocket */
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = THRIFT_TRANSPORT (tsocket);
-    thrift_transport_open (transport, NULL);
-    assert (thrift_transport_is_open (transport));
-
-    /* create a ThriftBinaryTransport */
-    tb = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                       tsocket, NULL);
-    protocol = THRIFT_PROTOCOL (tb);
-    assert (protocol != NULL);
-
-    /* test structures */
-    assert (thrift_binary_protocol_write_struct_begin (protocol, 
-                                                       NULL, NULL) == 0);
-    assert (thrift_binary_protocol_write_struct_end (protocol, NULL) == 0);
-
-    assert (thrift_binary_protocol_write_field_begin (protocol, "test", T_VOID,
-                                                      1, NULL) > 0);
-    assert (thrift_binary_protocol_write_field_end (protocol, NULL) == 0);
-
-    /* test write error */
-    transport_write_error = 1;
-    assert (thrift_binary_protocol_write_field_begin (protocol, "test", T_VOID, 
-                                                      1, NULL) == -1);
-    transport_write_error = 0;
-
-    /* test 2nd write error */
-    transport_write_count = 0;
-    transport_write_error_at = 1;
-    assert (thrift_binary_protocol_write_field_begin (protocol, "test", T_VOID,
-                                                      1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* test 2nd read failure on a field */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-
-    /* test write_field_stop */
-    assert (thrift_binary_protocol_write_field_stop (protocol, NULL) > 0);
-
-    /* write a map */
-    assert (thrift_binary_protocol_write_map_begin (protocol, T_VOID, T_VOID,
-                                                    1, NULL) > 0);
-    assert (thrift_binary_protocol_write_map_end (protocol, NULL) == 0);
-
-    /* test 2nd read failure on a map */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-
-    /* test 3rd read failure on a map */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-
-    /* test 1st write failure on a map */
-    transport_write_error = 1;
-    assert (thrift_binary_protocol_write_map_begin (protocol, T_VOID, T_VOID,
-                                                    1, NULL) == -1);
-    transport_write_error = 0;
-
-    /* test 2nd write failure on a map */
-    transport_write_count = 0;
-    transport_write_error_at = 1;
-    assert (thrift_binary_protocol_write_map_begin (protocol, T_VOID, T_VOID,
-                                                    1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* test 3rd write failure on a map */
-    transport_write_count = 0;
-    transport_write_error_at = 2;
-    assert (thrift_binary_protocol_write_map_begin (protocol, T_VOID, T_VOID,
-                                                    1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* test negative map size */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-    thrift_binary_protocol_write_i32 (protocol, -10, NULL);
-
-    /* test list operations */
-    assert (thrift_binary_protocol_write_list_begin (protocol, T_VOID,
-                                                     1, NULL) > 0);
-    assert (thrift_binary_protocol_write_list_end (protocol, NULL) == 0);
-
-    /* test 2nd read failure on a list */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-
-    /* test negative list size */
-    thrift_binary_protocol_write_byte (protocol, T_VOID, NULL);
-    thrift_binary_protocol_write_i32 (protocol, -10, NULL);
-
-    /* test first write error on a list */
-    transport_write_error = 1;
-    assert (thrift_binary_protocol_write_list_begin (protocol, T_VOID,
-                                                     1, NULL) == -1);
-    transport_write_error = 0;
-
-    /* test 2nd write error on a list */
-    transport_write_count = 0;
-    transport_write_error_at = 1;
-    assert (thrift_binary_protocol_write_list_begin (protocol, T_VOID,
-                                                     1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* test set operation s*/
-    assert (thrift_binary_protocol_write_set_begin (protocol, T_VOID,
-                                                    1, NULL) > 0);
-    assert (thrift_binary_protocol_write_set_end (protocol, NULL) == 0);
-
-    /* invalid version */
-    assert (thrift_binary_protocol_write_i32 (protocol, -1, NULL) > 0);
-
-    /* sz > 0 for a message */
-    assert (thrift_binary_protocol_write_i32 (protocol, 1, NULL) > 0);
-
-    /* send a valid message */
-    thrift_binary_protocol_write_i32 (protocol, 0x80010000, NULL);
-    thrift_binary_protocol_write_string (protocol, "test", NULL);
-    thrift_binary_protocol_write_i32 (protocol, 1, NULL);
-
-    /* broken 2nd read */
-    thrift_binary_protocol_write_i32 (protocol, 0x80010000, NULL);
-
-    /* send a broken 3rd read */
-    thrift_binary_protocol_write_i32 (protocol, 0x80010000, NULL);
-    thrift_binary_protocol_write_string (protocol, "test", NULL);
-
-    /* send a valid message */
-    assert (thrift_binary_protocol_write_message_begin (protocol, "test",
-                                                        T_CALL, 1, NULL) > 0);
-
-    assert (thrift_binary_protocol_write_message_end (protocol, NULL) == 0);
-
-    /* send broken writes */
-    transport_write_error = 1;
-    assert (thrift_binary_protocol_write_message_begin (protocol, "test",
-                                                        T_CALL, 1, NULL) == -1);
-    transport_write_error = 0;
-
-    transport_write_count = 0;
-    transport_write_error_at = 2;
-    assert (thrift_binary_protocol_write_message_begin (protocol, "test",
-                                                        T_CALL, 1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    transport_write_count = 0;
-    transport_write_error_at = 3;
-    assert (thrift_binary_protocol_write_message_begin (protocol, "test",
-                                                        T_CALL, 1, NULL) == -1);
-    transport_write_error_at = -1;
-
-    /* clean up */
-    thrift_transport_close (transport, NULL);
-    g_object_unref (tsocket);
-    g_object_unref (protocol);
-    assert (wait (&status) == pid);
-    assert (status == 0);
-  }
-}
-
-
-static void
-thrift_server_primitives (const int port)
-{
-  ThriftServerTransport *transport = NULL;
-  ThriftTransport *client = NULL;
-  ThriftBinaryProtocol *tbp = NULL;
-  ThriftProtocol *protocol = NULL;
-  gboolean value_boolean = FALSE;
-  gint8 value_byte = 0;
-  gint16 value_16 = 0;
-  gint32 value_32 = 0;
-  gint64 value_64 = 0;
-  gdouble value_double = 0;
-  gchar *string = NULL;
-  gpointer binary = NULL;
-  guint32 len = 0;
-  void *comparator = (void *) TEST_STRING;
-
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", port, NULL);
-  transport = THRIFT_SERVER_TRANSPORT (tsocket);
-  thrift_server_transport_listen (transport, NULL);
-  client = thrift_server_transport_accept (transport, NULL);
-  assert (client != NULL);
-
-  tbp = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                      client, NULL);
-  protocol = THRIFT_PROTOCOL (tbp);
-
-  assert (thrift_binary_protocol_read_bool (protocol,
-                                            &value_boolean, NULL) > 0);
-  assert (thrift_binary_protocol_read_byte (protocol, &value_byte, NULL) > 0);
-  assert (thrift_binary_protocol_read_i16 (protocol, &value_16, NULL) > 0);
-  assert (thrift_binary_protocol_read_i32 (protocol, &value_32, NULL) > 0);
-  assert (thrift_binary_protocol_read_i64 (protocol, &value_64, NULL) > 0);
-  assert (thrift_binary_protocol_read_double (protocol,
-                                              &value_double, NULL) > 0);
-  assert (thrift_binary_protocol_read_string (protocol, &string, NULL) > 0);
-  assert (thrift_binary_protocol_read_binary (protocol, &binary,
-                                              &len, NULL) > 0);
-
-  assert (value_boolean == TEST_BOOL);
-  assert (value_byte = TEST_BYTE);
-  assert (value_16 = TEST_I16);
-  assert (value_32 = TEST_I32);
-  assert (value_64 = TEST_I64);
-  assert (value_double = TEST_DOUBLE);
-  assert (strcmp (TEST_STRING, string) == 0);
-  assert (memcmp (comparator, binary, len) == 0);
-
-  g_free (string);
-  g_free (binary);
-
-  thrift_binary_protocol_read_binary (protocol, &binary, &len, NULL);
-  g_free (binary);
-
-  transport_read_count = 0;
-  transport_read_error_at = 0;
-  assert (thrift_binary_protocol_read_binary (protocol, &binary,
-                                              &len, NULL) == -1);
-  transport_read_error_at = -1;
-
-  transport_read_count = 0;
-  transport_read_error_at = 1;
-  assert (thrift_binary_protocol_read_binary (protocol, &binary,
-                                              &len, NULL) == -1);
-  transport_read_error_at = -1;
-
-  transport_read_error = 1;
-  assert (thrift_binary_protocol_read_bool (protocol,
-                                            &value_boolean, NULL) == -1);
-  assert (thrift_binary_protocol_read_byte (protocol,
-                                            &value_byte, NULL) == -1);
-  assert (thrift_binary_protocol_read_i16 (protocol,
-                                           &value_16, NULL) == -1);
-  assert (thrift_binary_protocol_read_i32 (protocol, &value_32, NULL) == -1);
-  assert (thrift_binary_protocol_read_i64 (protocol, &value_64, NULL) == -1);
-  assert (thrift_binary_protocol_read_double (protocol,
-                                              &value_double, NULL) == -1);
-  transport_read_error = 0;
-
-  /* test partial write failure */
-  thrift_protocol_read_i32 (protocol, &value_32, NULL);
-
-  thrift_transport_read_end (client, NULL);
-  thrift_transport_close (client, NULL);
-
-  g_object_unref (tbp);
-  g_object_unref (client);
-  g_object_unref (tsocket);
-}
-
-static void
-thrift_server_complex_types (const int port)
-{
-  ThriftServerTransport *transport = NULL;
-  ThriftTransport *client = NULL;
-  ThriftBinaryProtocol *tbp = NULL;
-  ThriftProtocol *protocol = NULL;
-  gchar *struct_name = NULL;
-  gchar *field_name = NULL;
-  gchar *message_name = NULL;
-  ThriftType element_type, key_type, value_type, field_type;
-  ThriftMessageType message_type;
-  gint8 value = 0;
-  gint16 field_id = 0;
-  guint32 size = 0;
-  gint32 seqid = 0;
-  gint32 version = 0;
-
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", port, NULL);
-  transport = THRIFT_SERVER_TRANSPORT (tsocket);
-  thrift_server_transport_listen (transport, NULL);
-  client = thrift_server_transport_accept (transport, NULL);
-  assert (client != NULL);
-
-  tbp = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL, "transport",
-                      client, NULL);
-  protocol = THRIFT_PROTOCOL (tbp);
-
-  thrift_binary_protocol_read_struct_begin (protocol, &struct_name, NULL);
-  thrift_binary_protocol_read_struct_end (protocol, NULL);
-
-  thrift_binary_protocol_read_field_begin (protocol, &field_name, &field_type,
-                                           &field_id, NULL);
-  thrift_binary_protocol_read_field_end (protocol, NULL);
-
-  /* test first read error on a field */
-  transport_read_error = 1;
-  assert (thrift_binary_protocol_read_field_begin (protocol,
-                                                   &field_name, &field_type,
-                                                   &field_id, NULL) == -1);
-  transport_read_error = 0;
-
-  /* test 2nd write failure */
-  thrift_binary_protocol_read_byte (protocol, &value, NULL);
-
-  /* test 2nd read failure on a field */
-  transport_read_count = 0;
-  transport_read_error_at = 1;
-  assert (thrift_binary_protocol_read_field_begin (protocol,
-                                                   &field_name, &field_type,
-                                                   &field_id, NULL) == -1);
-  transport_read_error_at = -1;
-
-  /* test field stop */
-  thrift_binary_protocol_read_field_begin (protocol, &field_name, &field_type,
-                                           &field_id, NULL);
-
-  thrift_binary_protocol_read_map_begin (protocol, &key_type, &value_type,
-                                         &size, NULL);
-  thrift_binary_protocol_read_map_end (protocol, NULL);
-
-  /* test read failure on a map */
-  transport_read_count = 0;
-  transport_read_error_at = 0;
-  assert (thrift_binary_protocol_read_map_begin (protocol,
-                                                 &key_type, &value_type,
-                                                 &size, NULL) == -1);
-  transport_read_error_at = -1;
-
-  /* test 2nd read failure on a map */
-  transport_read_count = 0;
-  transport_read_error_at = 1;
-  assert (thrift_binary_protocol_read_map_begin (protocol,
-                                                 &key_type, &value_type,
-                                                 &size, NULL) == -1);
-  transport_read_error_at = -1;
-
-  /* test 3rd read failure on a map */
-  transport_read_count = 0;
-  transport_read_error_at = 2;
-  assert (thrift_binary_protocol_read_map_begin (protocol,
-                                                 &key_type, &value_type,
-                                                 &size, NULL) == -1);
-  transport_read_error_at = -1;
-
-  /* test 2nd write failure */
-  thrift_binary_protocol_read_byte (protocol, &value, NULL);
-
-  /* test 3rd write failure */
-  thrift_binary_protocol_read_byte (protocol, &value, NULL);
-  thrift_binary_protocol_read_byte (protocol, &value, NULL);
-
-  /* test negative map size */
-  assert (thrift_binary_protocol_read_map_begin (protocol,
-                                                 &key_type, &value_type,
-                                                 &size, NULL) == -1);
-
-  /* test list operations */
-  thrift_binary_protocol_read_list_begin (protocol, &element_type, &size, NULL);
-  thrift_binary_protocol_read_list_end (protocol, NULL);
-
-  /* test read failure */
-  transport_read_error = 1;
-  assert (thrift_binary_protocol_read_list_begin (protocol, &element_type,
-                                                  &size, NULL) == -1);
-  transport_read_error = 0;
-
-  /* test 2nd read failure */
-  transport_read_count = 0;
-  transport_read_error_at = 1;
-  thrift_binary_protocol_read_list_begin (protocol, &element_type, &size, NULL);
-  transport_read_error_at = -1;
-
-  /* test negative list size failure */
-  thrift_binary_protocol_read_list_begin (protocol, &element_type, &size, NULL);
-
-  /* test 2nd write failure */
-  thrift_binary_protocol_read_byte (protocol, &value, NULL);
-
-  /* test set operations */
-  thrift_binary_protocol_read_set_begin (protocol, &element_type, &size, NULL);
-  thrift_binary_protocol_read_set_end (protocol, NULL);
-
-  /* broken read */
-  transport_read_error = 1;
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) == -1);
-  transport_read_error = 0;
-
-  /* invalid protocol version */
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) == -1);
-
-  /* sz > 0 */
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) > 0);
-
-  /* read a valid message */
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) > 0);
-  g_free (message_name);
-
-  /* broken 2nd read on a message */
-  transport_read_count = 0;
-  transport_read_error_at = 1;
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) == -1);
-  transport_read_error_at = -1;
-
-  /* broken 3rd read on a message */
-  transport_read_count = 0;
-  transport_read_error_at = 3; /* read_string does two reads */
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid,
-                                                     NULL) == -1);
-  g_free (message_name);
-  transport_read_error_at = -1;
-
-  /* read a valid message */
-  assert (thrift_binary_protocol_read_message_begin (protocol, &message_name,
-                                                     &message_type, &seqid, 
-                                                     NULL) > 0);
-  g_free (message_name);
-
-  assert (thrift_binary_protocol_read_message_end (protocol, NULL) == 0);
-
-  /* handle 2nd write failure on a message */
-  thrift_binary_protocol_read_i32 (protocol, &version, NULL);
-
-  /* handle 2nd write failure on a message */
-  thrift_binary_protocol_read_i32 (protocol, &version, NULL);
-  thrift_binary_protocol_read_string (protocol, &message_name, NULL);
-
-  g_object_unref (client);
-  /* TODO: investigate g_object_unref (tbp); */
-  g_object_unref (tsocket);
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testbinaryprotocol/CreateAndDestroy", test_create_and_destroy);
-  g_test_add_func ("/testbinaryprotocol/Initialize", test_initialize);
-  g_test_add_func ("/testbinaryprotocol/ReadAndWritePrimitives", test_read_and_write_primitives);
-  g_test_add_func ("/testbinaryprotocol/ReadAndWriteComplexTypes", test_read_and_write_complex_types);
-
-  return g_test_run ();
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/test/testbufferedtransport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/test/testbufferedtransport.c b/depends/thirdparty/thrift/lib/c_glib/test/testbufferedtransport.c
deleted file mode 100755
index 3203a66..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/test/testbufferedtransport.c
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <signal.h>
-#include <sys/wait.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-#define TEST_DATA { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' }
-
-#include "../src/thrift/c_glib/transport/thrift_buffered_transport.c"
-
-static void thrift_server (const int port);
-
-/* test object creation and destruction */
-static void
-test_create_and_destroy(void)
-{
-  ThriftTransport *transport = NULL;
-  guint r_buf_size = 0;
-  guint w_buf_size = 0;
-
-  GObject *object = NULL;
-  object = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT, NULL);
-  assert (object != NULL);
-  g_object_get (G_OBJECT (object), "transport", &transport,
-                "r_buf_size", &r_buf_size,
-                "w_buf_size", &w_buf_size, NULL);
-  g_object_unref (object);
-}
-
-static void
-test_open_and_close(void)
-{
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  GError *err = NULL;
-
-  /* create a ThriftSocket */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                          "port", 51188, NULL); 
-
-  /* create a BufferedTransport wrapper of the Socket */
-  transport = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                            "transport", THRIFT_TRANSPORT (tsocket), NULL);
-
-  /* this shouldn't work */
-  assert (thrift_buffered_transport_open (transport, NULL) == FALSE);
-  assert (thrift_buffered_transport_is_open (transport) == TRUE);
-  assert (thrift_buffered_transport_close (transport, NULL) == TRUE);
-  g_object_unref (transport);
-  g_object_unref (tsocket);
-
-  /* try and underlying socket failure */
-  tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost.broken",
-                          NULL);
-
-  /* create a BufferedTransport wrapper of the Socket */
-  transport = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                            "transport", THRIFT_TRANSPORT (tsocket), NULL);
-
-  assert (thrift_buffered_transport_open (transport, &err) == FALSE);
-  g_object_unref (transport);
-  g_object_unref (tsocket);
-  g_error_free (err);
-  err = NULL;
-}
-
-static void
-test_read_and_write(void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  int port = 51199;
-  guchar buf[10] = TEST_DATA; /* a buffer */
-
-  pid = fork ();
-  assert ( pid >= 0 );
-
-  if ( pid == 0 )
-  {
-    /* child listens */
-    thrift_server (port);
-    exit (0);
-  } else {
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                              "transport", THRIFT_TRANSPORT (tsocket),
-                              "w_buf_size", 4, NULL);
-
-    assert (thrift_buffered_transport_open (transport, NULL) == TRUE);
-    assert (thrift_buffered_transport_is_open (transport));
-
-    /* write 10 bytes */
-    thrift_buffered_transport_write (transport, buf, 10, NULL);
-
-    /* write 1 byte at a time */
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-
-    /* overflow the buffer */
-    thrift_buffered_transport_write (transport, buf, 2, NULL);
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-    thrift_buffered_transport_flush (transport, NULL);
-
-    /* write 1 byte and flush */
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-    thrift_buffered_transport_flush (transport, NULL);
-
-    /* write and overflow buffer with 2 system calls */
-    thrift_buffered_transport_write (transport, buf, 1, NULL);
-    thrift_buffered_transport_write (transport, buf, 3, NULL);
-
-    /* write 10 bytes */
-    thrift_buffered_transport_write (transport, buf, 10, NULL);
-
-    thrift_buffered_transport_write_end (transport, NULL);
-    thrift_buffered_transport_flush (transport, NULL);
-    thrift_buffered_transport_close (transport, NULL);
-
-    g_object_unref (transport);
-    g_object_unref (tsocket);
-
-    assert ( wait (&status) == pid );
-    assert ( status == 0 );
-  }
-}
-
-static void
-thrift_server (const int port)
-{
-  int bytes = 0;
-  ThriftServerTransport *transport = NULL;
-  ThriftTransport *client = NULL;
-  guchar buf[10]; /* a buffer */
-  guchar match[10] = TEST_DATA;
-
-  ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-                                              "port", port, NULL);
-
-  transport = THRIFT_SERVER_TRANSPORT (tsocket);
-  thrift_server_transport_listen (transport, NULL);
-
-  /* wrap the client in a BufferedTransport */
-  client = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT, "transport",
-                         thrift_server_transport_accept (transport, NULL),
-                         "r_buf_size", 5, NULL);
-  assert (client != NULL);
-
-  /* read 10 bytes */
-  bytes = thrift_buffered_transport_read (client, buf, 10, NULL);
-  assert (bytes == 10); /* make sure we've read 10 bytes */
-  assert ( memcmp (buf, match, 10) == 0 ); /* make sure what we got matches */
-
-  /* read 1 byte */
-  bytes = thrift_buffered_transport_read (client, buf, 1, NULL);
-
-  bytes = thrift_buffered_transport_read (client, buf, 6, NULL);
-  bytes = thrift_buffered_transport_read (client, buf, 2, NULL);
-  bytes = thrift_buffered_transport_read (client, buf, 1, NULL);
-
-  thrift_buffered_transport_read_end (client, NULL);
-  thrift_buffered_transport_close (client, NULL);
-  g_object_unref (client);
-  g_object_unref (tsocket);
-}
-
-static void
-test_write_fail(void)
-{
-  int status;
-  pid_t pid;
-  ThriftSocket *tsocket = NULL;
-  ThriftTransport *transport = NULL;
-  int port = 51198;
-  guchar buf[10] = TEST_DATA; /* a buffer */
-
-  /* SIGPIPE when send to disconnected socket */
-  signal(SIGPIPE, SIG_IGN);
-
-  pid = fork ();
-  assert ( pid >= 0 );
-
-  if ( pid == 0 )
-  {
-    /* child listens */
-    ThriftServerTransport *transport = NULL;
-    ThriftTransport *client = NULL;
-
-    ThriftServerSocket *tsocket = g_object_new (THRIFT_TYPE_SERVER_SOCKET,
-        "port", port, NULL);
-
-    transport = THRIFT_SERVER_TRANSPORT (tsocket);
-    thrift_server_transport_listen (transport, NULL);
-
-    /* wrap the client in a BufferedTransport */
-    client = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT, "transport",
-        thrift_server_transport_accept (transport, NULL),
-        "r_buf_size", 5, NULL);
-    assert (client != NULL);
-
-    /* just close socket */
-    thrift_buffered_transport_close (client, NULL);
-    g_object_unref (client);
-    g_object_unref (tsocket);
-    exit (0);
-  } else {
-    /* parent connects, wait a bit for the socket to be created */
-    sleep (1);
-
-    tsocket = g_object_new (THRIFT_TYPE_SOCKET, "hostname", "localhost",
-                            "port", port, NULL);
-    transport = g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                              "transport", THRIFT_TRANSPORT (tsocket),
-                              "w_buf_size", 4, NULL);
-
-
-    assert (thrift_buffered_transport_open (transport, NULL) == TRUE);
-    assert (thrift_buffered_transport_is_open (transport));
-
-    /* recognize disconnection */
-    sleep(1);
-    assert (thrift_buffered_transport_write (transport, buf, 10, NULL) == TRUE);
-    assert (thrift_buffered_transport_write (transport, buf, 10, NULL) == FALSE);
-
-    /* write and overflow buffer */
-    assert (thrift_buffered_transport_write (transport, buf, 10, NULL) == FALSE);
-
-    /* write 1 and flush */
-    assert (thrift_buffered_transport_write (transport, buf, 1, NULL) == TRUE);
-    assert (thrift_buffered_transport_flush (transport, NULL) == FALSE);
-
-    thrift_buffered_transport_close (transport, NULL);
-
-    g_object_unref (transport);
-    g_object_unref (tsocket);
-
-    assert ( wait (&status) == pid );
-    assert ( status == 0 );
-  }
-}
-
-int
-main(int argc, char *argv[])
-{
-#if (!GLIB_CHECK_VERSION (2, 36, 0))
-  g_type_init();
-#endif
-
-  g_test_init (&argc, &argv, NULL);
-
-  g_test_add_func ("/testbufferedtransport/CreateAndDestroy", test_create_and_destroy);
-  g_test_add_func ("/testbufferedtransport/OpenAndClose", test_open_and_close);
-  g_test_add_func ("/testbufferedtransport/ReadAndWrite", test_read_and_write);
-  g_test_add_func ("/testbufferedtransport/WriteFail", test_write_fail);
-
-  return g_test_run ();
-}
-



[11/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.c
deleted file mode 100644
index ede28cf..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.c
+++ /dev/null
@@ -1,391 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport.h>
-
-/* object properties */
-enum _ThriftBufferedTransportProperties
-{
-  PROP_0,
-  PROP_THRIFT_BUFFERED_TRANSPORT_TRANSPORT,
-  PROP_THRIFT_BUFFERED_TRANSPORT_READ_BUFFER_SIZE,
-  PROP_THRIFT_BUFFERED_TRANSPORT_WRITE_BUFFER_SIZE
-};
-
-G_DEFINE_TYPE(ThriftBufferedTransport, thrift_buffered_transport, THRIFT_TYPE_TRANSPORT)
-
-/* implements thrift_transport_is_open */
-gboolean
-thrift_buffered_transport_is_open (ThriftTransport *transport)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->is_open (t->transport);
-}
-
-/* overrides thrift_transport_peek */
-gboolean
-thrift_buffered_transport_peek (ThriftTransport *transport, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  return (t->r_buf->len > 0) || thrift_transport_peek (t->transport, error);
-}
-
-/* implements thrift_transport_open */
-gboolean
-thrift_buffered_transport_open (ThriftTransport *transport, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->open (t->transport, error);
-}
-
-/* implements thrift_transport_close */
-gboolean
-thrift_buffered_transport_close (ThriftTransport *transport, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->close (t->transport, error);
-}
-
-/* the actual read is "slow" because it calls the underlying transport */
-gint32
-thrift_buffered_transport_read_slow (ThriftTransport *transport, gpointer buf,
-                                     guint32 len, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  gint ret = 0;
-  guint32 want = len;
-  guint32 got = 0;
-  guchar *tmpdata = g_alloca (len);
-  guint32 have = t->r_buf->len;
-
-  /* we shouldn't hit this unless the buffer doesn't have enough to read */
-  assert (t->r_buf->len < want);
-
-  /* first copy what we have in our buffer. */
-  if (have > 0)
-  {
-    memcpy (buf, t->r_buf, t->r_buf->len);
-    want -= t->r_buf->len;
-    t->r_buf = g_byte_array_remove_range (t->r_buf, 0, t->r_buf->len);
-  }
-
-  /* if the buffer is still smaller than what we want to read, then just
-   * read it directly.  otherwise, fill the buffer and then give out
-   * enough to satisfy the read. */
-  if (t->r_buf_size < want)
-  {
-    if ((ret = THRIFT_TRANSPORT_GET_CLASS (t->transport)->read (t->transport,
-                                                                tmpdata,
-                                                                want,
-                                                                error)) < 0) {
-      return ret;
-    }
-    got += ret;
-
-    /* copy the data starting from where we left off */
-    memcpy ((guint8 *)buf + have, tmpdata, got);
-    return got + have; 
-  } else {
-    guint32 give;
-
-    if ((ret = THRIFT_TRANSPORT_GET_CLASS (t->transport)->read (t->transport,
-                                                                tmpdata,
-                                                                want,
-                                                                error)) < 0) {
-      return ret;
-    }
-    got += ret;
-    t->r_buf = g_byte_array_append (t->r_buf, tmpdata, got);
-    
-    /* hand over what we have up to what the caller wants */
-    give = want < t->r_buf->len ? want : t->r_buf->len;
-
-
-    memcpy ((guint8 *)buf + len - want, t->r_buf->data, give);
-    t->r_buf = g_byte_array_remove_range (t->r_buf, 0, give);
-    want -= give;
-
-    return (len - want);
-  }
-}
-
-/* implements thrift_transport_read */
-gint32
-thrift_buffered_transport_read (ThriftTransport *transport, gpointer buf,
-                                guint32 len, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-
-  /* if we have enough buffer data to fulfill the read, just use
-   * a memcpy */
-  if (len <= t->r_buf->len)
-  {
-    memcpy (buf, t->r_buf->data, len);
-    g_byte_array_remove_range (t->r_buf, 0, len);
-    return len;
-  }
-
-  return thrift_buffered_transport_read_slow (transport, buf, len, error);
-}
-
-/* implements thrift_transport_read_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_buffered_transport_read_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-gboolean
-thrift_buffered_transport_write_slow (ThriftTransport *transport, gpointer buf,
-                                      guint32 len, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-  guint32 have_bytes = t->w_buf->len;
-  guint32 space = t->w_buf_size - t->w_buf->len;
-
-  /* we need two syscalls because the buffered data plus the buffer itself
-   * is too big. */
-  if ((have_bytes + len >= 2*t->w_buf_size) || (have_bytes == 0))
-  {
-    if (have_bytes > 0)
-    {
-      if (!THRIFT_TRANSPORT_GET_CLASS (t->transport)->write (t->transport,
-                                                             t->w_buf->data,
-                                                             have_bytes,
-                                                             error)) {
-        return FALSE;
-      }
-      t->w_buf = g_byte_array_remove_range (t->w_buf, 0, have_bytes);
-    }
-    if (!THRIFT_TRANSPORT_GET_CLASS (t->transport)->write (t->transport,
-                                                           buf, len, error)) {
-      return FALSE;
-    }
-    return TRUE;
-  }
-
-  t->w_buf = g_byte_array_append (t->w_buf, buf, space);
-  if (!THRIFT_TRANSPORT_GET_CLASS (t->transport)->write (t->transport,
-                                                         t->w_buf->data,
-                                                         t->w_buf->len,
-                                                         error)) {
-    return FALSE;
-  }
-
-  t->w_buf = g_byte_array_remove_range (t->w_buf, 0, t->w_buf->len);
-  t->w_buf = g_byte_array_append (t->w_buf, (guint8 *)buf + space, len-space);
-
-  return TRUE;
-}
-
-/* implements thrift_transport_write */
-gboolean
-thrift_buffered_transport_write (ThriftTransport *transport,
-                                 const gpointer buf,
-                                 const guint32 len, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-
-  /* the length of the current buffer plus the length of the data being read */
-  if (t->w_buf->len + len <= t->w_buf_size)
-  {
-    t->w_buf = g_byte_array_append (t->w_buf, buf, len);
-    return len;
-  }
-
-  return thrift_buffered_transport_write_slow (transport, buf, len, error);
-}
-
-/* implements thrift_transport_write_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_buffered_transport_write_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_flush */
-gboolean
-thrift_buffered_transport_flush (ThriftTransport *transport, GError **error)
-{
-  ThriftBufferedTransport *t = THRIFT_BUFFERED_TRANSPORT (transport);
-
-  if (t->w_buf != NULL && t->w_buf->len > 0)
-  {
-    /* write the buffer and then empty it */
-    if (!THRIFT_TRANSPORT_GET_CLASS (t->transport)->write (t->transport,
-                                                           t->w_buf->data,
-                                                           t->w_buf->len,
-                                                           error)) {
-      return FALSE;
-    }
-    t->w_buf = g_byte_array_remove_range (t->w_buf, 0, t->w_buf->len);
-  }
-  THRIFT_TRANSPORT_GET_CLASS (t->transport)->flush (t->transport,
-                                                    error);
-
-  return TRUE;
-}
-
-/* initializes the instance */
-static void
-thrift_buffered_transport_init (ThriftBufferedTransport *transport)
-{
-  transport->transport = NULL;
-  transport->r_buf = g_byte_array_new ();
-  transport->w_buf = g_byte_array_new ();
-}
-
-/* destructor */
-static void
-thrift_buffered_transport_finalize (GObject *object)
-{
-  ThriftBufferedTransport *transport = THRIFT_BUFFERED_TRANSPORT (object);
-
-  if (transport->r_buf != NULL)
-  {
-    g_byte_array_free (transport->r_buf, TRUE);
-  }
-  transport->r_buf = NULL;
-
-  if (transport->w_buf != NULL)
-  {
-    g_byte_array_free (transport->w_buf, TRUE);
-  }
-  transport->w_buf = NULL;
-}
-
-/* property accessor */
-void
-thrift_buffered_transport_get_property (GObject *object, guint property_id,
-                                        GValue *value, GParamSpec *pspec)
-{
-  ThriftBufferedTransport *transport = THRIFT_BUFFERED_TRANSPORT (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_BUFFERED_TRANSPORT_TRANSPORT:
-      g_value_set_object (value, transport->transport);
-      break;
-    case PROP_THRIFT_BUFFERED_TRANSPORT_READ_BUFFER_SIZE:
-      g_value_set_uint (value, transport->r_buf_size);
-      break;
-    case PROP_THRIFT_BUFFERED_TRANSPORT_WRITE_BUFFER_SIZE:
-      g_value_set_uint (value, transport->w_buf_size);
-      break;
-  }
-}
-
-/* property mutator */
-void
-thrift_buffered_transport_set_property (GObject *object, guint property_id,
-                                        const GValue *value, GParamSpec *pspec)
-{
-  ThriftBufferedTransport *transport = THRIFT_BUFFERED_TRANSPORT (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_BUFFERED_TRANSPORT_TRANSPORT:
-      transport->transport = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_BUFFERED_TRANSPORT_READ_BUFFER_SIZE:
-      transport->r_buf_size = g_value_get_uint (value);
-      break;
-    case PROP_THRIFT_BUFFERED_TRANSPORT_WRITE_BUFFER_SIZE:
-      transport->w_buf_size = g_value_get_uint (value);
-      break;
-  }
-}
-
-/* initializes the class */
-static void
-thrift_buffered_transport_class_init (ThriftBufferedTransportClass *cls)
-{
-  ThriftTransportClass *ttc = THRIFT_TRANSPORT_CLASS (cls);
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-  GParamSpec *param_spec = NULL;
-
-  /* setup accessors and mutators */
-  gobject_class->get_property = thrift_buffered_transport_get_property;
-  gobject_class->set_property = thrift_buffered_transport_set_property;
-
-  param_spec = g_param_spec_object ("transport", "transport (construct)",
-                                    "Thrift transport",
-                                    THRIFT_TYPE_TRANSPORT,
-                                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_BUFFERED_TRANSPORT_TRANSPORT,
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("r_buf_size",
-                                  "read buffer size (construct)",
-                                  "Set the read buffer size",
-                                  0, /* min */
-                                  1048576, /* max, 1024*1024 */
-                                  512, /* default value */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_BUFFERED_TRANSPORT_READ_BUFFER_SIZE,
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("w_buf_size",
-                                  "write buffer size (construct)",
-                                  "Set the write buffer size",
-                                  0, /* min */
-                                  1048576, /* max, 1024*1024 */
-                                  512, /* default value */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_BUFFERED_TRANSPORT_WRITE_BUFFER_SIZE,
-                                   param_spec);
-
-
-  gobject_class->finalize = thrift_buffered_transport_finalize;
-  ttc->is_open = thrift_buffered_transport_is_open;
-  ttc->peek = thrift_buffered_transport_peek;
-  ttc->open = thrift_buffered_transport_open;
-  ttc->close = thrift_buffered_transport_close;
-  ttc->read = thrift_buffered_transport_read;
-  ttc->read_end = thrift_buffered_transport_read_end;
-  ttc->write = thrift_buffered_transport_write;
-  ttc->write_end = thrift_buffered_transport_write_end;
-  ttc->flush = thrift_buffered_transport_flush;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.h
deleted file mode 100644
index 837f467..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_BUFFERED_TRANSPORT_H
-#define _THRIFT_BUFFERED_TRANSPORT_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_buffered_transport.h
- *  \brief Implementation of a Thrift buffered transport.  Subclasses
- *         the ThriftTransport class.
- */
-
-/* type macros */
-#define THRIFT_TYPE_BUFFERED_TRANSPORT (thrift_buffered_transport_get_type ())
-#define THRIFT_BUFFERED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransport))
-#define THRIFT_IS_BUFFERED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT))
-#define THRIFT_BUFFERED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransportClass))
-#define THRIFT_IS_BUFFERED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_BUFFERED_TRANSPORT)
-#define THRIFT_BUFFERED_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_BUFFERED_TRANSPORT, ThriftBufferedTransportClass))
-
-typedef struct _ThriftBufferedTransport ThriftBufferedTransport;
-
-/*!
- * ThriftBufferedTransport  instance.
- */
-struct _ThriftBufferedTransport
-{
-  ThriftTransport parent;
-
-  /* protected */
-  ThriftTransport *transport;
-
-  /* private */
-  GByteArray *r_buf;
-  GByteArray *w_buf;
-  guint32 r_buf_size;
-  guint32 w_buf_size;
-};
-
-typedef struct _ThriftBufferedTransportClass ThriftBufferedTransportClass;
-
-/*!
- * ThriftBufferedTransport class.
- */
-struct _ThriftBufferedTransportClass
-{
-  ThriftTransportClass parent;
-};
-
-/* used by THRIFT_TYPE_BUFFERED_TRANSPORT */
-GType thrift_buffered_transport_get_type (void);
-
-G_END_DECLS
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.c
deleted file mode 100644
index 86050b6..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport.h>
-#include <thrift/c_glib/transport/thrift_buffered_transport_factory.h>
-
-G_DEFINE_TYPE (ThriftBufferedTransportFactory,
-               thrift_buffered_transport_factory,
-               THRIFT_TYPE_TRANSPORT_FACTORY)
-
-/* Wraps a transport with a ThriftBufferedTransport. */
-ThriftTransport *
-thrift_buffered_transport_factory_get_transport (ThriftTransportFactory *factory,
-                                                 ThriftTransport *transport)
-{
-  THRIFT_UNUSED_VAR (factory);
-
-  return THRIFT_TRANSPORT (g_object_new (THRIFT_TYPE_BUFFERED_TRANSPORT,
-                                         "transport", transport,
-                                         NULL));
-}
-
-static void
-thrift_buffered_transport_factory_init (ThriftBufferedTransportFactory *self)
-{
-  THRIFT_UNUSED_VAR (self);
-}
-
-static void
-thrift_buffered_transport_factory_class_init (ThriftBufferedTransportFactoryClass *klass)
-{
-  ThriftTransportFactoryClass *base_class =
-    THRIFT_TRANSPORT_FACTORY_CLASS (klass);
-
-  base_class->get_transport =
-    klass->get_transport =
-    thrift_buffered_transport_factory_get_transport;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.h
deleted file mode 100644
index d43f4e4..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_buffered_transport_factory.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_BUFFERED_TRANSPORT_FACTORY_H
-#define _THRIFT_BUFFERED_TRANSPORT_FACTORY_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_transport_factory.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_buffered_transport_factory.h
- *  \brief Wraps a transport with a ThriftBufferedTransport.
- */
-
-/* type macros */
-#define THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY          \
-  (thrift_buffered_transport_factory_get_type ())
-#define THRIFT_BUFFERED_TRANSPORT_FACTORY(obj)                          \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                                   \
-                               THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY,  \
-                               ThriftBufferedTransportFactory))
-#define THRIFT_IS_BUFFERED_TRANSPORT_FACTORY(obj)                       \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                                   \
-                               THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY))
-#define THRIFT_BUFFERED_TRANSPORT_FACTORY_CLASS(c)                      \
-  (G_TYPE_CHECK_CLASS_CAST ((c),                                        \
-                            THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY,     \
-                            ThriftBufferedTransportFactoryClass))
-#define THRIFT_IS_BUFFERED_TRANSPORT_FACTORY_CLASS(c)                   \
-  (G_TYPE_CHECK_CLASS_TYPE ((c),                                        \
-                            THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY))
-#define THRIFT_BUFFERED_TRANSPORT_FACTORY_GET_CLASS(obj)                \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj),                                    \
-                              THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY,   \
-                              ThriftBufferedTransportFactoryClass))
-
-typedef struct _ThriftBufferedTransportFactory ThriftBufferedTransportFactory;
-
-/* Thrift Buffered-Transport Factory instance */
-struct _ThriftBufferedTransportFactory
-{
-  ThriftTransportFactory parent;
-};
-
-typedef struct _ThriftBufferedTransportFactoryClass ThriftBufferedTransportFactoryClass;
-
-/* Thrift Buffered-Transport Factory class */
-struct _ThriftBufferedTransportFactoryClass
-{
-  ThriftTransportFactoryClass parent;
-
-  /* vtable */
-  ThriftTransport *(*get_transport) (ThriftTransportFactory *factory,
-                                     ThriftTransport *transport);
-};
-
-/* used by THRIFT_TYPE_BUFFERED_TRANSPORT_FACTORY */
-GType thrift_buffered_transport_factory_get_type (void);
-
-/* virtual public methods */
-ThriftTransport *
-thrift_buffered_transport_factory_get_transport (ThriftTransportFactory *factory,
-                                                 ThriftTransport *transport);
-
-G_END_DECLS
-
-#endif /* _THRIFT_BUFFERED_TRANSPORT_FACTORY_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.c
deleted file mode 100644
index 4c8b71f..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.c
+++ /dev/null
@@ -1,384 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_framed_transport.h>
-
-/* object properties */
-enum _ThriftFramedTransportProperties
-{
-  PROP_0,
-  PROP_THRIFT_FRAMED_TRANSPORT_TRANSPORT,
-  PROP_THRIFT_FRAMED_TRANSPORT_READ_BUFFER_SIZE,
-  PROP_THRIFT_FRAMED_TRANSPORT_WRITE_BUFFER_SIZE
-};
-
-G_DEFINE_TYPE(ThriftFramedTransport, thrift_framed_transport, THRIFT_TYPE_TRANSPORT)
-
-/* implements thrift_transport_is_open */
-gboolean
-thrift_framed_transport_is_open (ThriftTransport *transport)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->is_open (t->transport);
-}
-
-/* overrides thrift_transport_peek */
-gboolean
-thrift_framed_transport_peek (ThriftTransport *transport, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  return (t->r_buf->len > 0) || thrift_transport_peek (t->transport, error);
-}
-
-/* implements thrift_transport_open */
-gboolean
-thrift_framed_transport_open (ThriftTransport *transport, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->open (t->transport, error);
-}
-
-/* implements thrift_transport_close */
-gboolean
-thrift_framed_transport_close (ThriftTransport *transport, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  return THRIFT_TRANSPORT_GET_CLASS (t->transport)->close (t->transport, error);
-}
-
-/* reads a frame and puts it into the buffer */
-gboolean
-thrift_framed_transport_read_frame (ThriftTransport *transport,
-                                    GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  guint32 sz;
-  gint32 bytes;
-  gboolean result = FALSE;
-
-  /* read the size */
-  if (thrift_transport_read (t->transport,
-                             &sz,
-                             sizeof (sz),
-                             error) == sizeof (sz))
-  {
-    guchar *tmpdata;
-
-    sz = ntohl (sz);
-
-    /* create a buffer to hold the data and read that much data */
-    tmpdata = g_alloca (sz);
-    bytes = thrift_transport_read (t->transport, tmpdata, sz, error);
-
-    if (bytes > 0 && (error == NULL || *error == NULL))
-    {
-      /* add the data to the buffer */
-      g_byte_array_append (t->r_buf, tmpdata, bytes);
-
-      result = TRUE;
-    }
-  }
-
-  return result;
-}
-
-/* the actual read is "slow" because it calls the underlying transport */
-gint32
-thrift_framed_transport_read_slow (ThriftTransport *transport, gpointer buf,
-                                   guint32 len, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  guint32 want = len;
-  guint32 have = t->r_buf->len;
-  gint32 result = -1;
-
-  /* we shouldn't hit this unless the buffer doesn't have enough to read */
-  assert (t->r_buf->len < want);
-
-  /* first copy what we have in our buffer, if there is anything left */
-  if (have > 0)
-  {
-    memcpy (buf, t->r_buf, t->r_buf->len);
-    want -= t->r_buf->len;
-    t->r_buf = g_byte_array_remove_range (t->r_buf, 0, t->r_buf->len);
-  }
-
-  /* read a frame of input and buffer it */
-  if (thrift_framed_transport_read_frame (transport, error) == TRUE)
-  {
-    /* hand over what we have up to what the caller wants */
-    guint32 give = want < t->r_buf->len ? want : t->r_buf->len;
-
-    /* copy the data into the buffer */
-    memcpy ((guint8 *)buf + len - want, t->r_buf->data, give);
-    t->r_buf = g_byte_array_remove_range (t->r_buf, 0, give);
-    want -= give;
-
-    result = len - want;
-  }
-
-  return result;
-}
-
-/* implements thrift_transport_read */
-gint32
-thrift_framed_transport_read (ThriftTransport *transport, gpointer buf,
-                              guint32 len, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-
-  /* if we have enough buffer data to fulfill the read, just use
-   * a memcpy from the buffer */
-  if (len <= t->r_buf->len)
-  {
-    memcpy (buf, t->r_buf->data, len);
-    g_byte_array_remove_range (t->r_buf, 0, len);
-    return len;
-  }
-
-  return thrift_framed_transport_read_slow (transport, buf, len, error);
-}
-
-/* implements thrift_transport_read_end
- * called when read is complete.  nothing to do on our end. */
-gboolean
-thrift_framed_transport_read_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-gboolean
-thrift_framed_transport_write_slow (ThriftTransport *transport, gpointer buf,
-                                    guint32 len, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-
-  THRIFT_UNUSED_VAR (error);
-
-  /* append the data to the buffer and we're done */
-  g_byte_array_append (t->w_buf, buf, len);
-
-  return TRUE;
-}
-
-/* implements thrift_transport_write */
-gboolean
-thrift_framed_transport_write (ThriftTransport *transport,
-                               const gpointer buf,     
-                               const guint32 len, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-
-  /* the length of the current buffer plus the length of the data being read */
-  if (t->w_buf->len + len <= t->w_buf_size)
-  {
-    t->w_buf = g_byte_array_append (t->w_buf, buf, len);
-    return TRUE;
-  }
-
-  return thrift_framed_transport_write_slow (transport, buf, len, error);
-}
-
-/* implements thrift_transport_write_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_framed_transport_write_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_flush */
-gboolean
-thrift_framed_transport_flush (ThriftTransport *transport, GError **error)
-{
-  ThriftFramedTransport *t = THRIFT_FRAMED_TRANSPORT (transport);
-  gint32 sz_hbo, sz_nbo;
-  guchar *tmpdata;
-
-  /* get the size of the frame in host and network byte order */
-  sz_hbo = t->w_buf->len + sizeof(sz_nbo);
-  sz_nbo = (gint32) htonl ((guint32) t->w_buf->len);
-
-  /* copy the size of the frame and then the frame itself */
-  tmpdata = g_alloca (sz_hbo);
-  memcpy (tmpdata, (guint8 *) &sz_nbo, sizeof (sz_nbo));
-
-  if (t->w_buf->len > 0)
-  {
-    memcpy (tmpdata + sizeof (sz_nbo), t->w_buf->data, t->w_buf->len);
-    t->w_buf = g_byte_array_remove_range (t->w_buf, 0, t->w_buf->len);
-  }
-    
-  /* write the buffer and then empty it */
-  THRIFT_TRANSPORT_GET_CLASS (t->transport)->write (t->transport,
-                                                    tmpdata, sz_hbo,
-                                                    error);
-
-  THRIFT_TRANSPORT_GET_CLASS (t->transport)->flush (t->transport,
-                                                    error);
-
-  return TRUE;
-}
-
-/* initializes the instance */
-static void
-thrift_framed_transport_init (ThriftFramedTransport *transport)
-{
-  transport->transport = NULL;
-  transport->r_buf = g_byte_array_new ();
-  transport->w_buf = g_byte_array_new ();
-}
-
-/* destructor */
-static void
-thrift_framed_transport_finalize (GObject *object)
-{
-  ThriftFramedTransport *transport = THRIFT_FRAMED_TRANSPORT (object);
-
-  if (transport->r_buf != NULL)
-  {
-    g_byte_array_free (transport->r_buf, TRUE);
-  }
-  transport->r_buf = NULL;
-
-  if (transport->w_buf != NULL)
-  {
-    g_byte_array_free (transport->w_buf, TRUE);
-  }
-  transport->w_buf = NULL;
-}
-
-/* property accessor */
-void
-thrift_framed_transport_get_property (GObject *object, guint property_id,
-                                      GValue *value, GParamSpec *pspec)
-{
-  ThriftFramedTransport *transport = THRIFT_FRAMED_TRANSPORT (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_FRAMED_TRANSPORT_TRANSPORT:
-      g_value_set_object (value, transport->transport);
-      break;
-    case PROP_THRIFT_FRAMED_TRANSPORT_READ_BUFFER_SIZE:
-      g_value_set_uint (value, transport->r_buf_size);
-      break;
-    case PROP_THRIFT_FRAMED_TRANSPORT_WRITE_BUFFER_SIZE:
-      g_value_set_uint (value, transport->w_buf_size);
-      break;
-  }
-}
-
-/* property mutator */
-void
-thrift_framed_transport_set_property (GObject *object, guint property_id,
-                                      const GValue *value, GParamSpec *pspec)
-{
-  ThriftFramedTransport *transport = THRIFT_FRAMED_TRANSPORT (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_FRAMED_TRANSPORT_TRANSPORT:
-      transport->transport = g_value_get_object (value);
-      break;
-    case PROP_THRIFT_FRAMED_TRANSPORT_READ_BUFFER_SIZE:
-      transport->r_buf_size = g_value_get_uint (value);
-      break;
-    case PROP_THRIFT_FRAMED_TRANSPORT_WRITE_BUFFER_SIZE:
-      transport->w_buf_size = g_value_get_uint (value);
-      break;
-  }
-}
-
-/* initializes the class */
-static void
-thrift_framed_transport_class_init (ThriftFramedTransportClass *cls)
-{
-  ThriftTransportClass *ttc = THRIFT_TRANSPORT_CLASS (cls);
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-  GParamSpec *param_spec = NULL;
-
-  /* setup accessors and mutators */
-  gobject_class->get_property = thrift_framed_transport_get_property;
-  gobject_class->set_property = thrift_framed_transport_set_property;
-
-  param_spec = g_param_spec_object ("transport", "transport (construct)",
-                                    "Thrift transport",
-                                    THRIFT_TYPE_TRANSPORT,
-                                    G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_FRAMED_TRANSPORT_TRANSPORT,
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("r_buf_size",
-                                  "read buffer size (construct)",
-                                  "Set the read buffer size",
-                                  0, /* min */
-                                  1048576, /* max, 1024*1024 */
-                                  512, /* default value */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_FRAMED_TRANSPORT_READ_BUFFER_SIZE,
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("w_buf_size",
-                                  "write buffer size (construct)",
-                                  "Set the write buffer size",
-                                  0, /* min */
-                                  1048576, /* max, 1024*1024 */
-                                  512, /* default value */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_FRAMED_TRANSPORT_WRITE_BUFFER_SIZE,
-                                   param_spec);
-
-  gobject_class->finalize = thrift_framed_transport_finalize;
-  ttc->is_open = thrift_framed_transport_is_open;
-  ttc->peek = thrift_framed_transport_peek;
-  ttc->open = thrift_framed_transport_open;
-  ttc->close = thrift_framed_transport_close;
-  ttc->read = thrift_framed_transport_read;
-  ttc->read_end = thrift_framed_transport_read_end;
-  ttc->write = thrift_framed_transport_write;
-  ttc->write_end = thrift_framed_transport_write_end;
-  ttc->flush = thrift_framed_transport_flush;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.h
deleted file mode 100644
index 95c0123..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_FRAMED_TRANSPORT_H
-#define _THRIFT_FRAMED_TRANSPORT_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_framed_transport.h
- *  \brief Implementation of a Thrift framed transport.  Subclasses
- *         the ThriftTransport class.
- */
-
-/* type macros */
-#define THRIFT_TYPE_FRAMED_TRANSPORT (thrift_framed_transport_get_type ())
-#define THRIFT_FRAMED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransport))
-#define THRIFT_IS_FRAMED_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_FRAMED_TRANSPORT))
-#define THRIFT_FRAMED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransportClass))
-#define THRIFT_IS_FRAMED_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_FRAMED_TRANSPORT)
-#define THRIFT_FRAMED_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_FRAMED_TRANSPORT, ThriftFramedTransportClass))
-
-typedef struct _ThriftFramedTransport ThriftFramedTransport;
-
-/*!
- * ThriftFramedTransport instance.
- */
-struct _ThriftFramedTransport
-{
-  ThriftTransport parent;
-
-  /* protected */
-  ThriftTransport *transport;
-
-  /* private */
-  GByteArray *r_buf;
-  GByteArray *w_buf;
-  guint32 r_buf_size;
-  guint32 w_buf_size;
-};
-
-typedef struct _ThriftFramedTransportClass ThriftFramedTransportClass;
-
-/*!
- * ThriftFramedTransport class.
- */
-struct _ThriftFramedTransportClass
-{
-  ThriftTransportClass parent;
-};
-
-/* used by THRIFT_TYPE_FRAMED_TRANSPORT */
-GType thrift_framed_transport_get_type (void);
-
-G_END_DECLS
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.c
deleted file mode 100644
index e68fe0a..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.c
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_framed_transport.h>
-#include <thrift/c_glib/transport/thrift_framed_transport_factory.h>
-
-G_DEFINE_TYPE (ThriftFramedTransportFactory,
-               thrift_framed_transport_factory,
-               THRIFT_TYPE_TRANSPORT_FACTORY)
-
-/* Wraps a transport with a ThriftFramedTransport. */
-ThriftTransport *
-thrift_framed_transport_factory_get_transport (ThriftTransportFactory *factory,
-                                               ThriftTransport *transport)
-{
-  THRIFT_UNUSED_VAR (factory);
-
-  return THRIFT_TRANSPORT (g_object_new (THRIFT_TYPE_FRAMED_TRANSPORT,
-                                         "transport", transport,
-                                         NULL));
-}
-
-static void
-thrift_framed_transport_factory_init (ThriftFramedTransportFactory *self)
-{
-  THRIFT_UNUSED_VAR (self);
-}
-
-static void
-thrift_framed_transport_factory_class_init (ThriftFramedTransportFactoryClass *klass)
-{
-  ThriftTransportFactoryClass *base_class =
-    THRIFT_TRANSPORT_FACTORY_CLASS (klass);
-
-  base_class->get_transport =
-    klass->get_transport =
-    thrift_framed_transport_factory_get_transport;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.h
deleted file mode 100644
index c3e9496..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_framed_transport_factory.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_FRAMED_TRANSPORT_FACTORY_H
-#define _THRIFT_FRAMED_TRANSPORT_FACTORY_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_transport_factory.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_framed_transport_factory.h
- *  \brief Wraps a transport with a ThriftFramedTransport.
- */
-
-/* type macros */
-#define THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY    \
-  (thrift_framed_transport_factory_get_type ())
-#define THRIFT_FRAMED_TRANSPORT_FACTORY(obj)                            \
-  (G_TYPE_CHECK_INSTANCE_CAST ((obj),                                   \
-                               THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY,    \
-                               ThriftFramedTransportFactory))
-#define THRIFT_IS_FRAMED_TRANSPORT_FACTORY(obj)                         \
-  (G_TYPE_CHECK_INSTANCE_TYPE ((obj),                                   \
-                               THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY))
-#define THRIFT_FRAMED_TRANSPORT_FACTORY_CLASS(c)                        \
-  (G_TYPE_CHECK_CLASS_CAST ((c),                                        \
-                            THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY,       \
-                            ThriftFramedTransportFactoryClass))
-#define THRIFT_IS_FRAMED_TRANSPORT_FACTORY_CLASS(c)                     \
-  (G_TYPE_CHECK_CLASS_TYPE ((c),                                        \
-                            THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY))
-#define THRIFT_FRAMED_TRANSPORT_FACTORY_GET_CLASS(obj)                  \
-  (G_TYPE_INSTANCE_GET_CLASS ((obj),                                    \
-                              THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY,     \
-                              ThriftFramedTransportFactoryClass))
-
-typedef struct _ThriftFramedTransportFactory ThriftFramedTransportFactory;
-
-/* Thrift Framed-Transport Factory instance */
-struct _ThriftFramedTransportFactory
-{
-  ThriftTransportFactory parent;
-};
-
-typedef struct _ThriftFramedTransportFactoryClass ThriftFramedTransportFactoryClass;
-
-/* Thrift Framed-Transport Factory class */
-struct _ThriftFramedTransportFactoryClass
-{
-  ThriftTransportFactoryClass parent;
-
-  /* vtable */
-  ThriftTransport *(*get_transport) (ThriftTransportFactory *factory,
-                                     ThriftTransport *transport);
-};
-
-/* used by THRIFT_TYPE_FRAMED_TRANSPORT_FACTORY */
-GType thrift_framed_transport_factory_get_type (void);
-
-/* virtual public methods */
-ThriftTransport *
-thrift_framed_transport_factory_get_transport (ThriftTransportFactory *factory,
-                                               ThriftTransport *transport);
-
-G_END_DECLS
-
-#endif /* _THRIFT_FRAMED_TRANSPORT_FACTORY_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.c
deleted file mode 100644
index 8d66c3d..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.c
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <assert.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_memory_buffer.h>
-
-/* object properties */
-enum _ThriftMemoryBufferProperties
-{
-  PROP_0,
-  PROP_THRIFT_MEMORY_BUFFER_BUFFER_SIZE
-};
-
-G_DEFINE_TYPE(ThriftMemoryBuffer, thrift_memory_buffer, THRIFT_TYPE_TRANSPORT)
-
-/* implements thrift_transport_is_open */
-gboolean
-thrift_memory_buffer_is_open (ThriftTransport *transport)
-{
-  THRIFT_UNUSED_VAR (transport);
-  return TRUE;
-}
-
-/* implements thrift_transport_open */
-gboolean
-thrift_memory_buffer_open (ThriftTransport *transport, GError **error)
-{
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_close */
-gboolean
-thrift_memory_buffer_close (ThriftTransport *transport, GError **error)
-{
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_read */
-gint32
-thrift_memory_buffer_read (ThriftTransport *transport, gpointer buf,
-                           guint32 len, GError **error)
-{
-  ThriftMemoryBuffer *t = THRIFT_MEMORY_BUFFER (transport);
-  guint32 give = len; 
-
-  THRIFT_UNUSED_VAR (error);
-
-  /* if the requested bytes are more than what we have available,
-   * just give all that we have the buffer */
-  if (t->buf->len < len)
-  {
-    give = t->buf->len;
-  }
-
-  memcpy (buf, t->buf->data, give);
-  g_byte_array_remove_range (t->buf, 0, give);
-
-  return give;
-}
-
-/* implements thrift_transport_read_end
- * called when read is complete.  nothing to do on our end. */
-gboolean
-thrift_memory_buffer_read_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_write */
-gboolean
-thrift_memory_buffer_write (ThriftTransport *transport,
-                            const gpointer buf,     
-                            const guint32 len, GError **error)
-{
-  ThriftMemoryBuffer *t = THRIFT_MEMORY_BUFFER (transport);
-
-  THRIFT_UNUSED_VAR (error);
-
-  /* return an exception if the buffer doesn't have enough space. */
-  if (len > t->buf_size - t->buf->len)
-  {
-    g_set_error (error, THRIFT_TRANSPORT_ERROR, THRIFT_TRANSPORT_ERROR_SEND,
-                 "unable to write %d bytes to buffer of length %d",
-                 len, t->buf_size);
-    return FALSE;
-  } else {
-    t->buf = g_byte_array_append (t->buf, buf, len);
-    return TRUE;
-  }
-}
-
-/* implements thrift_transport_write_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_memory_buffer_write_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_flush */
-gboolean
-thrift_memory_buffer_flush (ThriftTransport *transport, GError **error)
-{
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-
-  return TRUE;
-}
-
-/* initializes the instance */
-static void
-thrift_memory_buffer_init (ThriftMemoryBuffer *transport)
-{
-  transport->buf = g_byte_array_new ();
-}
-
-/* destructor */
-static void
-thrift_memory_buffer_finalize (GObject *object)
-{
-  ThriftMemoryBuffer *transport = THRIFT_MEMORY_BUFFER (object);
-
-  if (transport->buf != NULL)
-  {
-    g_byte_array_free (transport->buf, TRUE);
-  }
-  transport->buf = NULL;
-}
-
-/* property accessor */
-void
-thrift_memory_buffer_get_property (GObject *object, guint property_id,
-                                   GValue *value, GParamSpec *pspec)
-{
-  ThriftMemoryBuffer *transport = THRIFT_MEMORY_BUFFER (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_MEMORY_BUFFER_BUFFER_SIZE:
-      g_value_set_uint (value, transport->buf_size);
-      break;
-  }
-}
-
-/* property mutator */
-void
-thrift_memory_buffer_set_property (GObject *object, guint property_id,
-                                   const GValue *value, GParamSpec *pspec)
-{
-  ThriftMemoryBuffer *transport = THRIFT_MEMORY_BUFFER (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_MEMORY_BUFFER_BUFFER_SIZE:
-      transport->buf_size = g_value_get_uint (value);
-      break;
-  }
-}
-
-/* initializes the class */
-static void
-thrift_memory_buffer_class_init (ThriftMemoryBufferClass *cls)
-{
-  ThriftTransportClass *ttc = THRIFT_TRANSPORT_CLASS (cls);
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-  GParamSpec *param_spec = NULL;
-
-  /* setup accessors and mutators */
-  gobject_class->get_property = thrift_memory_buffer_get_property;
-  gobject_class->set_property = thrift_memory_buffer_set_property;
-
-  param_spec = g_param_spec_uint ("buf_size",
-                                  "buffer size (construct)",
-                                  "Set the read buffer size",
-                                  0, /* min */
-                                  1048576, /* max, 1024*1024 */
-                                  512, /* default value */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_MEMORY_BUFFER_BUFFER_SIZE,
-                                   param_spec);
-
-  gobject_class->finalize = thrift_memory_buffer_finalize;
-  ttc->is_open = thrift_memory_buffer_is_open;
-  ttc->open = thrift_memory_buffer_open;
-  ttc->close = thrift_memory_buffer_close;
-  ttc->read = thrift_memory_buffer_read;
-  ttc->read_end = thrift_memory_buffer_read_end;
-  ttc->write = thrift_memory_buffer_write;
-  ttc->write_end = thrift_memory_buffer_write_end;
-  ttc->flush = thrift_memory_buffer_flush;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.h
deleted file mode 100644
index 4ebe98f..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_memory_buffer.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_MEMORY_BUFFER_H
-#define _THRIFT_MEMORY_BUFFER_H
-
-#include <glib.h>
-#include <glib-object.h>
-
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_memory_buffer.h
- *  \brief Implementation of a Thrift memory buffer transport.
- */
-
-/* type macros */
-#define THRIFT_TYPE_MEMORY_BUFFER (thrift_memory_buffer_get_type ())
-#define THRIFT_MEMORY_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_MEMORY_BUFFER, ThriftMemoryBuffer))
-#define THRIFT_IS_MEMORY_BUFFER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_MEMORY_BUFFER))
-#define THRIFT_MEMORY_BUFFER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_MEMORY_BUFFER, ThriftMemoryBufferClass))
-#define THRIFT_IS_MEMORY_BUFFER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_MEMORY_BUFFER)
-#define THRIFT_MEMORY_BUFFER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_MEMORY_BUFFER, ThriftMemoryBufferClass))
-
-typedef struct _ThriftMemoryBuffer ThriftMemoryBuffer;
-
-/*!
- * ThriftMemoryBuffer instance.
- */
-struct _ThriftMemoryBuffer
-{
-  ThriftTransport parent;
-
-  /* private */
-  GByteArray *buf;
-  guint32 buf_size;
-};
-
-typedef struct _ThriftMemoryBufferClass ThriftMemoryBufferClass;
-
-/*!
- * ThriftMemoryBuffer class.
- */
-struct _ThriftMemoryBufferClass
-{
-  ThriftTransportClass parent;
-};
-
-/* used by THRIFT_TYPE_MEMORY_BUFFER */
-GType thrift_memory_buffer_get_type (void);
-
-G_END_DECLS
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.c
deleted file mode 100644
index 97a0ec2..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.c
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <errno.h>
-#include <netdb.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-#include <thrift/c_glib/transport/thrift_server_socket.h>
-
-/* object properties */
-enum _ThriftServerSocketProperties
-{
-  PROP_0,
-  PROP_THRIFT_SERVER_SOCKET_PORT,
-  PROP_THRIFT_SERVER_SOCKET_BACKLOG
-};
-
-/* define the GError domain string */
-#define THRIFT_SERVER_SOCKET_ERROR_DOMAIN "thrift-server-socket-error-quark"
-
-/* for errors coming from socket() and connect() */
-extern int errno;
-
-G_DEFINE_TYPE(ThriftServerSocket, thrift_server_socket, THRIFT_TYPE_SERVER_TRANSPORT)
-
-gboolean
-thrift_server_socket_listen (ThriftServerTransport *transport, GError **error)
-{
-  int enabled = 1; /* for setsockopt() */
-  struct sockaddr_in pin;
-  ThriftServerSocket *tsocket = THRIFT_SERVER_SOCKET (transport);
-
-  /* create a address structure */
-  memset (&pin, 0, sizeof(pin));
-  pin.sin_family = AF_INET;
-  pin.sin_addr.s_addr = INADDR_ANY;
-  pin.sin_port = htons(tsocket->port);
-
-  /* create a socket */
-  if ((tsocket->sd = socket (AF_INET, SOCK_STREAM, 0)) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_SOCKET,
-                 "failed to create socket - %s", strerror (errno));
-    return FALSE;
-  }
-
-  if (setsockopt(tsocket->sd, SOL_SOCKET, SO_REUSEADDR, &enabled,
-                 sizeof(enabled)) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_SETSOCKOPT,
-                 "unable to set SO_REUSEADDR - %s", strerror(errno));
-    return FALSE;
-  }
-
-  /* bind to the socket */
-  if (bind(tsocket->sd, (struct sockaddr *) &pin, sizeof(pin)) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_BIND,
-                 "failed to bind to port %d - %s",
-                 tsocket->port, strerror(errno));
-    return FALSE;
-  }
-
-  if (listen(tsocket->sd, tsocket->backlog) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_LISTEN,
-                 "failed to listen to port %d - %s",
-                 tsocket->port, strerror(errno));
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-ThriftTransport *
-thrift_server_socket_accept (ThriftServerTransport *transport, GError **error)
-{
-  int sd = THRIFT_INVALID_SOCKET;
-  guint addrlen = 0;
-  struct sockaddr_in address;
-  ThriftSocket *socket = NULL;
-
-  ThriftServerSocket *tsocket = THRIFT_SERVER_SOCKET (transport);
-
-  if ((sd = accept(tsocket->sd, (struct sockaddr *) &address, &addrlen)) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_ACCEPT,
-                 "failed to accept connection - %s",
-                 strerror(errno));
-    return FALSE;
-  }
-
-  socket = g_object_new (THRIFT_TYPE_SOCKET, NULL);
-  socket->sd = sd;
-
-  return THRIFT_TRANSPORT(socket);
-}
-
-gboolean
-thrift_server_socket_close (ThriftServerTransport *transport, GError **error)
-{
-  ThriftServerSocket *tsocket = THRIFT_SERVER_SOCKET (transport);
-
-  if (close (tsocket->sd) == -1)
-  {
-    g_set_error (error, THRIFT_SERVER_SOCKET_ERROR,
-                 THRIFT_SERVER_SOCKET_ERROR_CLOSE,
-                 "unable to close socket - %s", strerror(errno));
-    return FALSE;
-  }
-  tsocket->sd = THRIFT_INVALID_SOCKET;
-
-  return TRUE;
-}
-
-/* define the GError domain for this implementation */
-GQuark
-thrift_server_socket_error_quark (void)
-{
-  return g_quark_from_static_string(THRIFT_SERVER_SOCKET_ERROR_DOMAIN);
-}
-
-/* initializes the instance */
-static void
-thrift_server_socket_init (ThriftServerSocket *socket)
-{
-  socket->sd = THRIFT_INVALID_SOCKET;
-}
-
-/* destructor */
-static void
-thrift_server_socket_finalize (GObject *object)
-{
-  ThriftServerSocket *socket = THRIFT_SERVER_SOCKET (object);
-
-  if (socket->sd != THRIFT_INVALID_SOCKET)
-  {
-    close (socket->sd);
-  }
-  socket->sd = THRIFT_INVALID_SOCKET;
-}
-
-/* property accessor */
-void
-thrift_server_socket_get_property (GObject *object, guint property_id,
-                                   GValue *value, GParamSpec *pspec)
-{
-  ThriftServerSocket *socket = THRIFT_SERVER_SOCKET (object);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SERVER_SOCKET_PORT:
-      g_value_set_uint (value, socket->port);
-      break;
-    case PROP_THRIFT_SERVER_SOCKET_BACKLOG:
-      g_value_set_uint (value, socket->backlog);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-      break;
-  }
-}
-
-/* property mutator */
-void
-thrift_server_socket_set_property (GObject *object, guint property_id,
-                                   const GValue *value, GParamSpec *pspec)
-{
-  ThriftServerSocket *socket = THRIFT_SERVER_SOCKET (object);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SERVER_SOCKET_PORT:
-      socket->port = g_value_get_uint (value);
-      break;
-    case PROP_THRIFT_SERVER_SOCKET_BACKLOG:
-      socket->backlog = g_value_get_uint (value);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
-      break;
-  }
-}
-
-/* initializes the class */
-static void
-thrift_server_socket_class_init (ThriftServerSocketClass *cls)
-{
-  ThriftServerTransportClass *tstc = THRIFT_SERVER_TRANSPORT_CLASS (cls);
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-  GParamSpec *param_spec = NULL;
-
-  /* setup accessors and mutators */
-  gobject_class->get_property = thrift_server_socket_get_property;
-  gobject_class->set_property = thrift_server_socket_set_property;
-
-  param_spec = g_param_spec_uint ("port",
-                                  "port (construct)",
-                                  "Set the port to listen to",
-                                  0, /* min */
-                                  65534, /* max */
-                                  9090, /* default by convention */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_SERVER_SOCKET_PORT, 
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("backlog",
-                                  "backlog (construct)",
-                                  "Set the accept backlog",
-                                  0, /* max */
-                                  65534, /* max */
-                                  1024, /* default */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class,
-                                   PROP_THRIFT_SERVER_SOCKET_BACKLOG,
-                                   param_spec);
-
-  gobject_class->finalize = thrift_server_socket_finalize;
-
-  tstc->listen = thrift_server_socket_listen;
-  tstc->accept = thrift_server_socket_accept;
-  tstc->close = thrift_server_socket_close;
-}
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.h
deleted file mode 100644
index f072cb0..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_socket.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SERVER_SOCKET_H
-#define _THRIFT_SERVER_SOCKET_H
-
-#include <glib-object.h>
-
-#include "thrift_server_transport.h"
-
-G_BEGIN_DECLS
-
-/*! \file thrift_server_socket.h
- *  \brief Socket implementation of a Thrift server transport.  Implements the
- *         ThriftServerTransport class.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SERVER_SOCKET (thrift_server_socket_get_type ())
-#define THRIFT_SERVER_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER_SOCKET, ThriftServerSocket))
-#define THRIFT_IS_SERVER_SOCKET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER_SOCKET))
-#define THRIFT_SERVER_SOCKET_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER_SOCKET, ThriftServerSocketClass))
-#define THRIFT_IS_SERVER_SOCKET_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER_SOCKET))
-#define THRIFT_SERVER_SOCKET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER_SOCKET, ThriftServerSocketClass))
-
-typedef struct _ThriftServerSocket ThriftServerSocket;
-
-/*!
- * Thrift ServerSocket instance.
- */
-struct _ThriftServerSocket
-{
-  ThriftServerTransport parent;
-
-  /* private */
-  gshort port;
-  gshort backlog;
-  int sd;
-  guint8 *buf;
-  guint32 buf_size;
-  guint32 buf_len;
-};
-
-typedef struct _ThriftServerSocketClass ThriftServerSocketClass;
-
-/*!
- * Thrift ServerSocket class.
- */
-struct _ThriftServerSocketClass
-{
-  ThriftServerTransportClass parent;
-};
-
-/* used by THRIFT_TYPE_SERVER_SOCKET */
-GType thrift_server_socket_get_type (void);
-
-/* define error/exception types */
-typedef enum
-{
-  THRIFT_SERVER_SOCKET_ERROR_SOCKET,
-  THRIFT_SERVER_SOCKET_ERROR_SETSOCKOPT,
-  THRIFT_SERVER_SOCKET_ERROR_BIND,
-  THRIFT_SERVER_SOCKET_ERROR_LISTEN,
-  THRIFT_SERVER_SOCKET_ERROR_ACCEPT,
-  THRIFT_SERVER_SOCKET_ERROR_CLOSE
-} ThriftServerSocketError;
-
-/* define a error domain for GError to use */
-GQuark thrift_server_socket_error_quark (void);
-#define THRIFT_SERVER_SOCKET_ERROR (thrift_server_socket_error_quark ())
-
-G_END_DECLS
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
deleted file mode 100644
index c25d138..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.c
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_server_transport.h>
-
-G_DEFINE_ABSTRACT_TYPE(ThriftServerTransport, thrift_server_transport, G_TYPE_OBJECT)
-
-/* base initializer for the server transport interface */
-static void
-thrift_server_transport_class_init (ThriftServerTransportClass *c)
-{
-  c->listen = thrift_server_transport_listen;
-  c->accept = thrift_server_transport_accept;
-  c->close = thrift_server_transport_close;
-}
-
-static void
-thrift_server_transport_init (ThriftServerTransport *transport)
-{
-  THRIFT_UNUSED_VAR (transport);
-}
-
-gboolean
-thrift_server_transport_listen (ThriftServerTransport *transport,
-                                GError **error)
-{
-  return THRIFT_SERVER_TRANSPORT_GET_CLASS (transport)->listen (transport,
-                                                                error);
-}
-
-ThriftTransport *
-thrift_server_transport_accept (ThriftServerTransport *transport,
-                                GError **error)
-{
-  return THRIFT_SERVER_TRANSPORT_GET_CLASS (transport)->accept (transport,
-                                                                error);
-}
-
-gboolean
-thrift_server_transport_close (ThriftServerTransport *transport, GError **error)
-{
-  return THRIFT_SERVER_TRANSPORT_GET_CLASS (transport)->close (transport,
-                                                               error);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
deleted file mode 100644
index 98a9191..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_server_transport.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_SERVER_TRANSPORT_H
-#define _THRIFT_SERVER_TRANSPORT_H
-
-#include <glib-object.h>
-
-#include "thrift_transport.h"
-
-G_BEGIN_DECLS
-
-/*! \file thrift_server_transport.h
- *  \brief Abstract class for Thrift server transports.
- */
-
-/* type macros */
-#define THRIFT_TYPE_SERVER_TRANSPORT (thrift_server_transport_get_type ())
-#define THRIFT_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransport))
-#define THRIFT_IS_SERVER_TRANSPORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_SERVER_TRANSPORT))
-#define THRIFT_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
-#define THRIFT_IS_SERVER_TRANSPORT_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_SERVER_TRANSPORT))
-#define THRIFT_SERVER_TRANSPORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_SERVER_TRANSPORT, ThriftServerTransportClass))
-
-typedef struct _ThriftServerTransport ThriftServerTransport;
-
-struct _ThriftServerTransport
-{
-  GObject parent;
-};
-
-typedef struct _ThriftServerTransportClass ThriftServerTransportClass;
-
-/*!
- * Thrift Transport class
- */
-struct _ThriftServerTransportClass
-{
-  GObjectClass parent;
-
-  /* vtable */
-  gboolean (*listen) (ThriftServerTransport *transport, GError **error);
-  ThriftTransport *(*accept) (ThriftServerTransport *transport, GError **error);
-  gboolean (*close) (ThriftServerTransport *transport, GError **error);
-};
-
-/* used by THRIFT_TYPE_SERVER_TRANSPORT */
-GType thrift_server_transport_get_type (void);
-
-/*!
- * Listen for new connections.
- * \public \memberof ThriftServerTransportClass
- */
-gboolean thrift_server_transport_listen (ThriftServerTransport *transport,
-                                         GError **error);
-
-/*!
- * Accept a connection.
- * \public \memberof ThriftServerTransportClass
- */
-ThriftTransport *thrift_server_transport_accept
-    (ThriftServerTransport *transport, GError **error);
-
-/*!
- * Close the transport.
- * \public \memberof ThriftServerTransportClass
- */
-gboolean thrift_server_transport_close (ThriftServerTransport *transport,
-                                        GError **error);
-
-G_END_DECLS
-
-#endif /* _THRIFT_SERVER_TRANSPORT_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.c
deleted file mode 100644
index 1c147ec..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/transport/thrift_socket.c
+++ /dev/null
@@ -1,371 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <errno.h>
-#include <netdb.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-#include <thrift/c_glib/transport/thrift_socket.h>
-
-/* object properties */
-enum _ThriftSocketProperties
-{
-  PROP_0,
-  PROP_THRIFT_SOCKET_HOSTNAME,
-  PROP_THRIFT_SOCKET_PORT
-};
-
-/* for errors coming from socket() and connect() */
-extern int errno;
-
-G_DEFINE_TYPE(ThriftSocket, thrift_socket, THRIFT_TYPE_TRANSPORT)
-
-/* implements thrift_transport_is_open */
-gboolean
-thrift_socket_is_open (ThriftTransport *transport)
-{
-  ThriftSocket *socket = THRIFT_SOCKET (transport);
-  return socket->sd != THRIFT_INVALID_SOCKET;
-}
-
-/* overrides thrift_transport_peek */
-gboolean
-thrift_socket_peek (ThriftTransport *transport, GError **error)
-{
-  gboolean result = FALSE;
-  guint8 buf;
-  int r;
-  int errno_copy;
-
-  ThriftSocket *socket = THRIFT_SOCKET (transport);
-
-  if (thrift_socket_is_open (transport))
-  {
-    r = recv (socket->sd, &buf, 1, MSG_PEEK);
-    if (r == -1)
-    {
-      errno_copy = errno;
-
-      #if defined __FreeBSD__ || defined __MACH__
-      /* FreeBSD returns -1 and ECONNRESET if the socket was closed by the other
-         side */
-      if (errno_copy == ECONNRESET)
-      {
-        thrift_socket_close (transport, error);
-      }
-      else
-      {
-      #endif
-
-      g_set_error (error,
-                   THRIFT_TRANSPORT_ERROR,
-                   THRIFT_TRANSPORT_ERROR_SOCKET,
-                   "failed to peek at socket - %s",
-                   strerror (errno_copy));
-
-      #if defined __FreeBSD__ || defined __MACH__
-      }
-      #endif
-    }
-    else if (r > 0)
-    {
-      result = TRUE;
-    }
-  }
-
-  return result;
-}
-
-/* implements thrift_transport_open */
-gboolean
-thrift_socket_open (ThriftTransport *transport, GError **error)
-{
-  struct hostent *hp = NULL;
-  struct sockaddr_in pin;
-  int err;
-#if defined(HAVE_GETHOSTBYNAME_R)
-  struct hostent he;
-  char buf[1024];
-#endif
-
-  ThriftSocket *tsocket = THRIFT_SOCKET (transport);
-  g_return_val_if_fail (tsocket->sd == THRIFT_INVALID_SOCKET, FALSE);
-
-  /* lookup the destination host */
-#if defined(HAVE_GETHOSTBYNAME_R)
-  if (gethostbyname_r (tsocket->hostname, &he, buf, 1024, &hp, &err) != 0 || hp == NULL)
-#else
-  if ((hp = gethostbyname (tsocket->hostname)) == NULL && (err = h_errno))
-#endif
-  {
-    /* host lookup failed, bail out with an error */
-    g_set_error (error, THRIFT_TRANSPORT_ERROR, THRIFT_TRANSPORT_ERROR_HOST,
-                 "host lookup failed for %s:%d - %s",
-                 tsocket->hostname, tsocket->port,
-                 hstrerror (err));
-    return FALSE;
-  }
-
-  /* create a socket structure */
-  memset (&pin, 0, sizeof(pin));
-  pin.sin_family = AF_INET;
-  pin.sin_addr.s_addr = ((struct in_addr *) (hp->h_addr))->s_addr;
-  pin.sin_port = htons (tsocket->port); 
-
-  /* create the socket */
-  if ((tsocket->sd = socket (AF_INET, SOCK_STREAM, 0)) == -1)
-  {
-    g_set_error (error, THRIFT_TRANSPORT_ERROR, THRIFT_TRANSPORT_ERROR_SOCKET,
-                 "failed to create socket for host %s:%d - %s",
-                 tsocket->hostname, tsocket->port,
-                 strerror(errno));
-    return FALSE;
-  }
-
-  /* open a connection */
-  if (connect (tsocket->sd, (struct sockaddr *) &pin, sizeof(pin)) == -1)
-  {
-    g_set_error (error, THRIFT_TRANSPORT_ERROR, THRIFT_TRANSPORT_ERROR_CONNECT,
-                 "failed to connect to host %s:%d - %s",
-                 tsocket->hostname, tsocket->port, strerror(errno));
-    return FALSE;
-  }
-
-  return TRUE;
-}
-
-/* implements thrift_transport_close */
-gboolean
-thrift_socket_close (ThriftTransport *transport, GError **error)
-{
-  ThriftSocket *socket = THRIFT_SOCKET (transport);
-
-  if (close (socket->sd) == -1)
-  {
-    g_set_error (error, THRIFT_TRANSPORT_ERROR, THRIFT_TRANSPORT_ERROR_CLOSE,
-                 "unable to close socket - %s",
-                 strerror(errno));
-    return FALSE;
-  }
-
-  socket->sd = THRIFT_INVALID_SOCKET;
-  return TRUE;
-}
-
-/* implements thrift_transport_read */
-gint32
-thrift_socket_read (ThriftTransport *transport, gpointer buf,
-                    guint32 len, GError **error)
-{
-  gint ret = 0;
-  guint got = 0;
-
-  ThriftSocket *socket = THRIFT_SOCKET (transport);
-
-  while (got < len)
-  {
-    ret = recv (socket->sd, (guint8 *)buf + got, len-got, 0);
-    if (ret <= 0)
-    {
-      g_set_error (error, THRIFT_TRANSPORT_ERROR,
-                   THRIFT_TRANSPORT_ERROR_RECEIVE,
-                   "failed to read %d bytes - %s", len, strerror(errno));
-      return -1;
-    }
-    got += ret;
-  }
-
-  return got;
-}
-
-/* implements thrift_transport_read_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_socket_read_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_write */
-gboolean
-thrift_socket_write (ThriftTransport *transport, const gpointer buf,     
-                     const guint32 len, GError **error)
-{
-  gint ret = 0;
-  guint sent = 0;
-
-  ThriftSocket *socket = THRIFT_SOCKET (transport);
-  g_return_val_if_fail (socket->sd != THRIFT_INVALID_SOCKET, FALSE);
-
-  while (sent < len)
-  {
-    ret = send (socket->sd, (guint8 *)buf + sent, len - sent, 0);
-    if (ret < 0)
-    {
-      g_set_error (error, THRIFT_TRANSPORT_ERROR,
-                   THRIFT_TRANSPORT_ERROR_SEND,
-                   "failed to send %d bytes - %s", len, strerror(errno));
-      return FALSE;
-    }
-    sent += ret;
-  }
-
-  return TRUE;
-}
-
-/* implements thrift_transport_write_end
- * called when write is complete.  nothing to do on our end. */
-gboolean
-thrift_socket_write_end (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* implements thrift_transport_flush
- * flush pending data.  since we are not buffered, this is a no-op */
-gboolean
-thrift_socket_flush (ThriftTransport *transport, GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (transport);
-  THRIFT_UNUSED_VAR (error);
-  return TRUE;
-}
-
-/* initializes the instance */
-static void
-thrift_socket_init (ThriftSocket *socket)
-{
-  socket->sd = THRIFT_INVALID_SOCKET;
-}
-
-/* destructor */
-static void
-thrift_socket_finalize (GObject *object)
-{
-  ThriftSocket *socket = THRIFT_SOCKET (object);
-
-  if (socket->hostname != NULL)
-  {
-    g_free (socket->hostname);
-  }
-  socket->hostname = NULL;
-
-  if (socket->sd != THRIFT_INVALID_SOCKET)
-  {
-    close (socket->sd);
-  }
-  socket->sd = THRIFT_INVALID_SOCKET;
-}
-
-/* property accessor */
-void
-thrift_socket_get_property (GObject *object, guint property_id,
-                            GValue *value, GParamSpec *pspec)
-{
-  ThriftSocket *socket = THRIFT_SOCKET (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SOCKET_HOSTNAME:
-      g_value_set_string (value, socket->hostname);
-      break;
-    case PROP_THRIFT_SOCKET_PORT:
-      g_value_set_uint (value, socket->port);
-      break;
-  }
-}
-
-/* property mutator */
-void
-thrift_socket_set_property (GObject *object, guint property_id,
-                            const GValue *value, GParamSpec *pspec)
-{
-  ThriftSocket *socket = THRIFT_SOCKET (object);
-
-  THRIFT_UNUSED_VAR (pspec);
-
-  switch (property_id)
-  {
-    case PROP_THRIFT_SOCKET_HOSTNAME:
-      socket->hostname = g_strdup (g_value_get_string (value));
-      break;
-    case PROP_THRIFT_SOCKET_PORT:
-      socket->port = g_value_get_uint (value);
-      break;
-  }
-}
-
-/* initializes the class */
-static void
-thrift_socket_class_init (ThriftSocketClass *cls)
-{
-  ThriftTransportClass *ttc = THRIFT_TRANSPORT_CLASS (cls);
-  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);
-  GParamSpec *param_spec = NULL;
-
-  /* setup accessors and mutators */
-  gobject_class->get_property = thrift_socket_get_property;
-  gobject_class->set_property = thrift_socket_set_property;
-
-  param_spec = g_param_spec_string ("hostname",
-                                    "hostname (construct)",
-                                    "Set the hostname of the remote host",
-                                    "localhost", /* default value */
-                                    G_PARAM_CONSTRUCT_ONLY |
-                                    G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class, PROP_THRIFT_SOCKET_HOSTNAME,
-                                   param_spec);
-
-  param_spec = g_param_spec_uint ("port",
-                                  "port (construct)",
-                                  "Set the port of the remote host",
-                                  0, /* min */
-                                  65534, /* max */
-                                  9090, /* default by convention */
-                                  G_PARAM_CONSTRUCT_ONLY |
-                                  G_PARAM_READWRITE);
-  g_object_class_install_property (gobject_class, PROP_THRIFT_SOCKET_PORT,
-                                   param_spec);
-
-  gobject_class->finalize = thrift_socket_finalize;
-  ttc->is_open = thrift_socket_is_open;
-  ttc->peek = thrift_socket_peek;
-  ttc->open = thrift_socket_open;
-  ttc->close = thrift_socket_close;
-  ttc->read = thrift_socket_read;
-  ttc->read_end = thrift_socket_read_end;
-  ttc->write = thrift_socket_write;
-  ttc->write_end = thrift_socket_write_end;
-  ttc->flush = thrift_socket_flush;
-}



[02/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.h
deleted file mode 100644
index 3946827..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/TimerManager.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_TIMERMANAGER_H_
-#define _THRIFT_CONCURRENCY_TIMERMANAGER_H_ 1
-
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Monitor.h>
-#include <thrift/concurrency/Thread.h>
-
-#include <boost/shared_ptr.hpp>
-#include <map>
-#include <time.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Timer Manager
- *
- * This class dispatches timer tasks when they fall due.
- *
- * @version $Id:$
- */
-class TimerManager {
-
-public:
-  TimerManager();
-
-  virtual ~TimerManager();
-
-  virtual boost::shared_ptr<const ThreadFactory> threadFactory() const;
-
-  virtual void threadFactory(boost::shared_ptr<const ThreadFactory> value);
-
-  /**
-   * Starts the timer manager service
-   *
-   * @throws IllegalArgumentException Missing thread factory attribute
-   */
-  virtual void start();
-
-  /**
-   * Stops the timer manager service
-   */
-  virtual void stop();
-
-  virtual size_t taskCount() const;
-
-  /**
-   * Adds a task to be executed at some time in the future by a worker thread.
-   *
-   * @param task The task to execute
-   * @param timeout Time in milliseconds to delay before executing task
-   */
-  virtual void add(boost::shared_ptr<Runnable> task, int64_t timeout);
-
-  /**
-   * Adds a task to be executed at some time in the future by a worker thread.
-   *
-   * @param task The task to execute
-   * @param timeout Absolute time in the future to execute task.
-   */
-  virtual void add(boost::shared_ptr<Runnable> task, const struct THRIFT_TIMESPEC& timeout);
-
-  /**
-   * Adds a task to be executed at some time in the future by a worker thread.
-   *
-   * @param task The task to execute
-   * @param timeout Absolute time in the future to execute task.
-   */
-  virtual void add(boost::shared_ptr<Runnable> task, const struct timeval& timeout);
-
-  /**
-   * Removes a pending task
-   *
-   * @throws NoSuchTaskException Specified task doesn't exist. It was either
-   *                             processed already or this call was made for a
-   *                             task that was never added to this timer
-   *
-   * @throws UncancellableTaskException Specified task is already being
-   *                                    executed or has completed execution.
-   */
-  virtual void remove(boost::shared_ptr<Runnable> task);
-
-  enum STATE { UNINITIALIZED, STARTING, STARTED, STOPPING, STOPPED };
-
-  virtual STATE state() const;
-
-private:
-  boost::shared_ptr<const ThreadFactory> threadFactory_;
-  class Task;
-  friend class Task;
-  std::multimap<int64_t, boost::shared_ptr<Task> > taskMap_;
-  size_t taskCount_;
-  Monitor monitor_;
-  STATE state_;
-  class Dispatcher;
-  friend class Dispatcher;
-  boost::shared_ptr<Dispatcher> dispatcher_;
-  boost::shared_ptr<Thread> dispatcherThread_;
-  typedef std::multimap<int64_t, boost::shared_ptr<TimerManager::Task> >::iterator task_iterator;
-  typedef std::pair<task_iterator, task_iterator> task_range;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_TIMERMANAGER_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.cpp
deleted file mode 100644
index dd6d19f..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.cpp
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/Thrift.h>
-#include <thrift/concurrency/Util.h>
-
-#if defined(HAVE_SYS_TIME_H)
-#include <sys/time.h>
-#endif
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-int64_t Util::currentTimeTicks(int64_t ticksPerSec) {
-  int64_t result;
-  struct timeval now;
-  int ret = THRIFT_GETTIMEOFDAY(&now, NULL);
-  assert(ret == 0);
-  THRIFT_UNUSED_VARIABLE(ret); // squelching "unused variable" warning
-  toTicks(result, now, ticksPerSec);
-  return result;
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.h
deleted file mode 100644
index ba070b6..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Util.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_UTIL_H_
-#define _THRIFT_CONCURRENCY_UTIL_H_ 1
-
-#include <assert.h>
-#include <stddef.h>
-#include <stdint.h>
-#include <time.h>
-
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-
-#include <thrift/transport/PlatformSocket.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Utility methods
- *
- * This class contains basic utility methods for converting time formats,
- * and other common platform-dependent concurrency operations.
- * It should not be included in API headers for other concurrency library
- * headers, since it will, by definition, pull in all sorts of horrid
- * platform dependent stuff.  Rather it should be inluded directly in
- * concurrency library implementation source.
- *
- * @version $Id:$
- */
-class Util {
-
-  static const int64_t NS_PER_S = 1000000000LL;
-  static const int64_t US_PER_S = 1000000LL;
-  static const int64_t MS_PER_S = 1000LL;
-
-  static const int64_t NS_PER_MS = NS_PER_S / MS_PER_S;
-  static const int64_t NS_PER_US = NS_PER_S / US_PER_S;
-  static const int64_t US_PER_MS = US_PER_S / MS_PER_S;
-
-public:
-  /**
-   * Converts millisecond timestamp into a THRIFT_TIMESPEC struct
-   *
-   * @param struct THRIFT_TIMESPEC& result
-   * @param time or duration in milliseconds
-   */
-  static void toTimespec(struct THRIFT_TIMESPEC& result, int64_t value) {
-    result.tv_sec = value / MS_PER_S;                // ms to s
-    result.tv_nsec = (value % MS_PER_S) * NS_PER_MS; // ms to ns
-  }
-
-  static void toTimeval(struct timeval& result, int64_t value) {
-    result.tv_sec = static_cast<uint32_t>(value / MS_PER_S);                // ms to s
-    result.tv_usec = static_cast<uint32_t>((value % MS_PER_S) * US_PER_MS); // ms to us
-  }
-
-  static void toTicks(int64_t& result,
-                      int64_t secs,
-                      int64_t oldTicks,
-                      int64_t oldTicksPerSec,
-                      int64_t newTicksPerSec) {
-    result = secs * newTicksPerSec;
-    result += oldTicks * newTicksPerSec / oldTicksPerSec;
-
-    int64_t oldPerNew = oldTicksPerSec / newTicksPerSec;
-    if (oldPerNew && ((oldTicks % oldPerNew) >= (oldPerNew / 2))) {
-      ++result;
-    }
-  }
-  /**
-   * Converts struct THRIFT_TIMESPEC to arbitrary-sized ticks since epoch
-   */
-  static void toTicks(int64_t& result, const struct THRIFT_TIMESPEC& value, int64_t ticksPerSec) {
-    return toTicks(result, value.tv_sec, value.tv_nsec, NS_PER_S, ticksPerSec);
-  }
-
-  /**
-   * Converts struct timeval to arbitrary-sized ticks since epoch
-   */
-  static void toTicks(int64_t& result, const struct timeval& value, int64_t ticksPerSec) {
-    return toTicks(result, value.tv_sec, value.tv_usec, US_PER_S, ticksPerSec);
-  }
-
-  /**
-   * Converts struct THRIFT_TIMESPEC to milliseconds
-   */
-  static void toMilliseconds(int64_t& result, const struct THRIFT_TIMESPEC& value) {
-    return toTicks(result, value, MS_PER_S);
-  }
-
-  /**
-   * Converts struct timeval to milliseconds
-   */
-  static void toMilliseconds(int64_t& result, const struct timeval& value) {
-    return toTicks(result, value, MS_PER_S);
-  }
-
-  /**
-   * Converts struct THRIFT_TIMESPEC to microseconds
-   */
-  static void toUsec(int64_t& result, const struct THRIFT_TIMESPEC& value) {
-    return toTicks(result, value, US_PER_S);
-  }
-
-  /**
-   * Converts struct timeval to microseconds
-   */
-  static void toUsec(int64_t& result, const struct timeval& value) {
-    return toTicks(result, value, US_PER_S);
-  }
-
-  /**
-   * Get current time as a number of arbitrary-size ticks from epoch
-   */
-  static int64_t currentTimeTicks(int64_t ticksPerSec);
-
-  /**
-   * Get current time as milliseconds from epoch
-   */
-  static int64_t currentTime() { return currentTimeTicks(MS_PER_S); }
-
-  /**
-   * Get current time as micros from epoch
-   */
-  static int64_t currentTimeUsec() { return currentTimeTicks(US_PER_S); }
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_UTIL_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/cxxfunctional.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/cxxfunctional.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/cxxfunctional.h
deleted file mode 100644
index dadaac3..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/cxxfunctional.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CXXFUNCTIONAL_H_
-#define _THRIFT_CXXFUNCTIONAL_H_ 1
-
-// clang-format off
-
-/**
- * Loads <functional> from the 'right' location, depending
- * on compiler and whether or not it's using C++03 with TR1
- * or C++11.
- */
-
-/*
- * MSVC 10 and 11 have the <functional> stuff at <functional>.
- * In MSVC 10 all of the implementations live in std::tr1.
- * In MSVC 11 all of the implementations live in std, with aliases
- *  in std::tr1 to point to the ones in std.
- */
-#ifdef _WIN32
-  #define _THRIFT_USING_MICROSOFT_STDLIB 1
-#endif
-
-#ifdef __clang__
-  /* Clang has two options, depending on standard library:
-   * - no -stdlib or -stdlib=libstdc++ set; uses GNU libstdc++.
-   *    <tr1/functional>
-   * - -stdlib=libc++; uses LLVM libc++.
-   *    <functional>, no 'std::tr1'.
-   *
-   * The compiler itself doesn't define anything differently
-   * depending on the value of -stdlib, but the library headers
-   * will set different preprocessor options. In order to check,
-   * though, we have to pull in some library header.
-   */
-  #include <utility>
-
-  /* With LLVM libc++, utility pulls in __config, which sets
-     _LIBCPP_VERSION. */
-  #if defined(_LIBCPP_VERSION)
-    #define _THRIFT_USING_CLANG_LIBCXX 1
-
-  /* With GNU libstdc++, utility pulls in bits/c++config.h,
-     which sets __GLIBCXX__. */
-  #elif defined(__GLIBCXX__)
-    #define _THRIFT_USING_GNU_LIBSTDCXX 1
-
-  /* No idea. */
-  #else
-    #error Unable to detect which C++ standard library is in use.
-  #endif
-#elif __GNUC__
-  #define _THRIFT_USING_GNU_LIBSTDCXX 1
-#endif
-
-#if _THRIFT_USING_MICROSOFT_STDLIB
-  #include <functional>
-
-  namespace apache { namespace thrift { namespace stdcxx {
-    using ::std::tr1::function;
-    using ::std::tr1::bind;
-
-    namespace placeholders {
-      using ::std::tr1::placeholders::_1;
-      using ::std::tr1::placeholders::_2;
-      using ::std::tr1::placeholders::_3;
-      using ::std::tr1::placeholders::_4;
-      using ::std::tr1::placeholders::_5;
-      using ::std::tr1::placeholders::_6;
-    } // apache::thrift::stdcxx::placeholders
-  }}} // apache::thrift::stdcxx
-
-#elif _THRIFT_USING_CLANG_LIBCXX
-  #include <functional>
-
-  namespace apache { namespace thrift { namespace stdcxx {
-    using ::std::function;
-    using ::std::bind;
-
-    namespace placeholders {
-      using ::std::placeholders::_1;
-      using ::std::placeholders::_2;
-      using ::std::placeholders::_3;
-      using ::std::placeholders::_4;
-      using ::std::placeholders::_5;
-      using ::std::placeholders::_6;
-    } // apache::thrift::stdcxx::placeholders
-  }}} // apache::thrift::stdcxx
-
-#elif _THRIFT_USING_GNU_LIBSTDCXX
-  #include <tr1/functional>
-
-  namespace apache { namespace thrift { namespace stdcxx {
-    using ::std::tr1::function;
-    using ::std::tr1::bind;
-
-    namespace placeholders {
-      using ::std::tr1::placeholders::_1;
-      using ::std::tr1::placeholders::_2;
-      using ::std::tr1::placeholders::_3;
-      using ::std::tr1::placeholders::_4;
-      using ::std::tr1::placeholders::_5;
-      using ::std::tr1::placeholders::_6;
-    } // apache::thrift::stdcxx::placeholders
-  }}} // apache::thrift::stdcxx
-#endif
-
-  // Alias for thrift c++ compatibility namespace
-  namespace tcxx = apache::thrift::stdcxx;
-
-#endif // #ifndef _THRIFT_CXXFUNCTIONAL_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.cpp
deleted file mode 100644
index 8c9a463..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/processor/PeekProcessor.h>
-
-using namespace apache::thrift::transport;
-using namespace apache::thrift::protocol;
-using namespace apache::thrift;
-
-namespace apache {
-namespace thrift {
-namespace processor {
-
-PeekProcessor::PeekProcessor() {
-  memoryBuffer_.reset(new TMemoryBuffer());
-  targetTransport_ = memoryBuffer_;
-}
-PeekProcessor::~PeekProcessor() {
-}
-
-void PeekProcessor::initialize(boost::shared_ptr<TProcessor> actualProcessor,
-                               boost::shared_ptr<TProtocolFactory> protocolFactory,
-                               boost::shared_ptr<TPipedTransportFactory> transportFactory) {
-  actualProcessor_ = actualProcessor;
-  pipedProtocol_ = protocolFactory->getProtocol(targetTransport_);
-  transportFactory_ = transportFactory;
-  transportFactory_->initializeTargetTransport(targetTransport_);
-}
-
-boost::shared_ptr<TTransport> PeekProcessor::getPipedTransport(boost::shared_ptr<TTransport> in) {
-  return transportFactory_->getTransport(in);
-}
-
-void PeekProcessor::setTargetTransport(boost::shared_ptr<TTransport> targetTransport) {
-  targetTransport_ = targetTransport;
-  if (boost::dynamic_pointer_cast<TMemoryBuffer>(targetTransport_)) {
-    memoryBuffer_ = boost::dynamic_pointer_cast<TMemoryBuffer>(targetTransport);
-  } else if (boost::dynamic_pointer_cast<TPipedTransport>(targetTransport_)) {
-    memoryBuffer_ = boost::dynamic_pointer_cast<TMemoryBuffer>(
-        boost::dynamic_pointer_cast<TPipedTransport>(targetTransport_)->getTargetTransport());
-  }
-
-  if (!memoryBuffer_) {
-    throw TException(
-        "Target transport must be a TMemoryBuffer or a TPipedTransport with TMemoryBuffer");
-  }
-}
-
-bool PeekProcessor::process(boost::shared_ptr<TProtocol> in,
-                            boost::shared_ptr<TProtocol> out,
-                            void* connectionContext) {
-
-  std::string fname;
-  TMessageType mtype;
-  int32_t seqid;
-  in->readMessageBegin(fname, mtype, seqid);
-
-  if (mtype != T_CALL && mtype != T_ONEWAY) {
-    throw TException("Unexpected message type");
-  }
-
-  // Peek at the name
-  peekName(fname);
-
-  TType ftype;
-  int16_t fid;
-  while (true) {
-    in->readFieldBegin(fname, ftype, fid);
-    if (ftype == T_STOP) {
-      break;
-    }
-
-    // Peek at the variable
-    peek(in, ftype, fid);
-    in->readFieldEnd();
-  }
-  in->readMessageEnd();
-  in->getTransport()->readEnd();
-
-  //
-  // All the data is now in memoryBuffer_ and ready to be processed
-  //
-
-  // Let's first take a peek at the full data in memory
-  uint8_t* buffer;
-  uint32_t size;
-  memoryBuffer_->getBuffer(&buffer, &size);
-  peekBuffer(buffer, size);
-
-  // Done peeking at variables
-  peekEnd();
-
-  bool ret = actualProcessor_->process(pipedProtocol_, out, connectionContext);
-  memoryBuffer_->resetBuffer();
-  return ret;
-}
-
-void PeekProcessor::peekName(const std::string& fname) {
-  (void)fname;
-}
-
-void PeekProcessor::peekBuffer(uint8_t* buffer, uint32_t size) {
-  (void)buffer;
-  (void)size;
-}
-
-void PeekProcessor::peek(boost::shared_ptr<TProtocol> in, TType ftype, int16_t fid) {
-  (void)fid;
-  in->skip(ftype);
-}
-
-void PeekProcessor::peekEnd() {
-}
-}
-}
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.h
deleted file mode 100644
index 21c5999..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/PeekProcessor.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef PEEKPROCESSOR_H
-#define PEEKPROCESSOR_H
-
-#include <string>
-#include <thrift/TProcessor.h>
-#include <thrift/transport/TTransport.h>
-#include <thrift/transport/TTransportUtils.h>
-#include <thrift/transport/TBufferTransports.h>
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace processor {
-
-/*
- * Class for peeking at the raw data that is being processed by another processor
- * and gives the derived class a chance to change behavior accordingly
- *
- */
-class PeekProcessor : public apache::thrift::TProcessor {
-
-public:
-  PeekProcessor();
-  virtual ~PeekProcessor();
-
-  // Input here: actualProcessor  - the underlying processor
-  //             protocolFactory  - the protocol factory used to wrap the memory buffer
-  //             transportFactory - this TPipedTransportFactory is used to wrap the source transport
-  //                                via a call to getPipedTransport
-  void initialize(
-      boost::shared_ptr<apache::thrift::TProcessor> actualProcessor,
-      boost::shared_ptr<apache::thrift::protocol::TProtocolFactory> protocolFactory,
-      boost::shared_ptr<apache::thrift::transport::TPipedTransportFactory> transportFactory);
-
-  boost::shared_ptr<apache::thrift::transport::TTransport> getPipedTransport(
-      boost::shared_ptr<apache::thrift::transport::TTransport> in);
-
-  void setTargetTransport(boost::shared_ptr<apache::thrift::transport::TTransport> targetTransport);
-
-  virtual bool process(boost::shared_ptr<apache::thrift::protocol::TProtocol> in,
-                       boost::shared_ptr<apache::thrift::protocol::TProtocol> out,
-                       void* connectionContext);
-
-  // The following three functions can be overloaded by child classes to
-  // achieve desired peeking behavior
-  virtual void peekName(const std::string& fname);
-  virtual void peekBuffer(uint8_t* buffer, uint32_t size);
-  virtual void peek(boost::shared_ptr<apache::thrift::protocol::TProtocol> in,
-                    apache::thrift::protocol::TType ftype,
-                    int16_t fid);
-  virtual void peekEnd();
-
-private:
-  boost::shared_ptr<apache::thrift::TProcessor> actualProcessor_;
-  boost::shared_ptr<apache::thrift::protocol::TProtocol> pipedProtocol_;
-  boost::shared_ptr<apache::thrift::transport::TPipedTransportFactory> transportFactory_;
-  boost::shared_ptr<apache::thrift::transport::TMemoryBuffer> memoryBuffer_;
-  boost::shared_ptr<apache::thrift::transport::TTransport> targetTransport_;
-};
-}
-}
-} // apache::thrift::processor
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/StatsProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/StatsProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/StatsProcessor.h
deleted file mode 100644
index e8ca067..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/StatsProcessor.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef STATSPROCESSOR_H
-#define STATSPROCESSOR_H
-
-#include <boost/shared_ptr.hpp>
-#include <thrift/transport/TTransport.h>
-#include <thrift/protocol/TProtocol.h>
-#include <TProcessor.h>
-
-namespace apache {
-namespace thrift {
-namespace processor {
-
-/*
- * Class for keeping track of function call statistics and printing them if desired
- *
- */
-class StatsProcessor : public apache::thrift::TProcessor {
-public:
-  StatsProcessor(bool print, bool frequency) : print_(print), frequency_(frequency) {}
-  virtual ~StatsProcessor(){};
-
-  virtual bool process(boost::shared_ptr<apache::thrift::protocol::TProtocol> piprot,
-                       boost::shared_ptr<apache::thrift::protocol::TProtocol> poprot,
-                       void* serverContext) {
-
-    piprot_ = piprot;
-
-    std::string fname;
-    apache::thrift::protocol::TMessageType mtype;
-    int32_t seqid;
-
-    piprot_->readMessageBegin(fname, mtype, seqid);
-    if (mtype != apache::thrift::protocol::T_CALL && mtype != apache::thrift::protocol::T_ONEWAY) {
-      if (print_) {
-        printf("Unknown message type\n");
-      }
-      throw apache::thrift::TException("Unexpected message type");
-    }
-    if (print_) {
-      printf("%s (", fname.c_str());
-    }
-    if (frequency_) {
-      if (frequency_map_.find(fname) != frequency_map_.end()) {
-        frequency_map_[fname]++;
-      } else {
-        frequency_map_[fname] = 1;
-      }
-    }
-
-    apache::thrift::protocol::TType ftype;
-    int16_t fid;
-
-    while (true) {
-      piprot_->readFieldBegin(fname, ftype, fid);
-      if (ftype == apache::thrift::protocol::T_STOP) {
-        break;
-      }
-
-      printAndPassToBuffer(ftype);
-      if (print_) {
-        printf(", ");
-      }
-    }
-
-    if (print_) {
-      printf("\b\b)\n");
-    }
-    return true;
-  }
-
-  const std::map<std::string, int64_t>& get_frequency_map() { return frequency_map_; }
-
-protected:
-  void printAndPassToBuffer(apache::thrift::protocol::TType ftype) {
-    switch (ftype) {
-    case apache::thrift::protocol::T_BOOL: {
-      bool boolv;
-      piprot_->readBool(boolv);
-      if (print_) {
-        printf("%d", boolv);
-      }
-    } break;
-    case apache::thrift::protocol::T_BYTE: {
-      int8_t bytev;
-      piprot_->readByte(bytev);
-      if (print_) {
-        printf("%d", bytev);
-      }
-    } break;
-    case apache::thrift::protocol::T_I16: {
-      int16_t i16;
-      piprot_->readI16(i16);
-      if (print_) {
-        printf("%d", i16);
-      }
-    } break;
-    case apache::thrift::protocol::T_I32: {
-      int32_t i32;
-      piprot_->readI32(i32);
-      if (print_) {
-        printf("%d", i32);
-      }
-    } break;
-    case apache::thrift::protocol::T_I64: {
-      int64_t i64;
-      piprot_->readI64(i64);
-      if (print_) {
-        printf("%ld", i64);
-      }
-    } break;
-    case apache::thrift::protocol::T_DOUBLE: {
-      double dub;
-      piprot_->readDouble(dub);
-      if (print_) {
-        printf("%f", dub);
-      }
-    } break;
-    case apache::thrift::protocol::T_STRING: {
-      std::string str;
-      piprot_->readString(str);
-      if (print_) {
-        printf("%s", str.c_str());
-      }
-    } break;
-    case apache::thrift::protocol::T_STRUCT: {
-      std::string name;
-      int16_t fid;
-      apache::thrift::protocol::TType ftype;
-      piprot_->readStructBegin(name);
-      if (print_) {
-        printf("<");
-      }
-      while (true) {
-        piprot_->readFieldBegin(name, ftype, fid);
-        if (ftype == apache::thrift::protocol::T_STOP) {
-          break;
-        }
-        printAndPassToBuffer(ftype);
-        if (print_) {
-          printf(",");
-        }
-        piprot_->readFieldEnd();
-      }
-      piprot_->readStructEnd();
-      if (print_) {
-        printf("\b>");
-      }
-    } break;
-    case apache::thrift::protocol::T_MAP: {
-      apache::thrift::protocol::TType keyType;
-      apache::thrift::protocol::TType valType;
-      uint32_t i, size;
-      piprot_->readMapBegin(keyType, valType, size);
-      if (print_) {
-        printf("{");
-      }
-      for (i = 0; i < size; i++) {
-        printAndPassToBuffer(keyType);
-        if (print_) {
-          printf("=>");
-        }
-        printAndPassToBuffer(valType);
-        if (print_) {
-          printf(",");
-        }
-      }
-      piprot_->readMapEnd();
-      if (print_) {
-        printf("\b}");
-      }
-    } break;
-    case apache::thrift::protocol::T_SET: {
-      apache::thrift::protocol::TType elemType;
-      uint32_t i, size;
-      piprot_->readSetBegin(elemType, size);
-      if (print_) {
-        printf("{");
-      }
-      for (i = 0; i < size; i++) {
-        printAndPassToBuffer(elemType);
-        if (print_) {
-          printf(",");
-        }
-      }
-      piprot_->readSetEnd();
-      if (print_) {
-        printf("\b}");
-      }
-    } break;
-    case apache::thrift::protocol::T_LIST: {
-      apache::thrift::protocol::TType elemType;
-      uint32_t i, size;
-      piprot_->readListBegin(elemType, size);
-      if (print_) {
-        printf("[");
-      }
-      for (i = 0; i < size; i++) {
-        printAndPassToBuffer(elemType);
-        if (print_) {
-          printf(",");
-        }
-      }
-      piprot_->readListEnd();
-      if (print_) {
-        printf("\b]");
-      }
-    } break;
-    default:
-      break;
-    }
-  }
-
-  boost::shared_ptr<apache::thrift::protocol::TProtocol> piprot_;
-  std::map<std::string, int64_t> frequency_map_;
-
-  bool print_;
-  bool frequency_;
-};
-}
-}
-} // apache::thrift::processor
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
deleted file mode 100644
index 0ef7261..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/processor/TMultiplexedProcessor.h
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef THRIFT_TMULTIPLEXEDPROCESSOR_H_
-#define THRIFT_TMULTIPLEXEDPROCESSOR_H_ 1
-
-#include <thrift/protocol/TProtocolDecorator.h>
-#include <thrift/TApplicationException.h>
-#include <thrift/TProcessor.h>
-#include <boost/tokenizer.hpp>
-
-namespace apache {
-namespace thrift {
-using boost::shared_ptr;
-
-namespace protocol {
-
-/**
- *  To be able to work with any protocol, we needed
- *  to allow them to call readMessageBegin() and get a TMessage in exactly
- *  the standard format, without the service name prepended to TMessage.name.
- */
-class StoredMessageProtocol : public TProtocolDecorator {
-public:
-  StoredMessageProtocol(shared_ptr<protocol::TProtocol> _protocol,
-                        const std::string& _name,
-                        const TMessageType _type,
-                        const int32_t _seqid)
-    : TProtocolDecorator(_protocol), name(_name), type(_type), seqid(_seqid) {}
-
-  uint32_t readMessageBegin_virt(std::string& _name, TMessageType& _type, int32_t& _seqid) {
-
-    _name = name;
-    _type = type;
-    _seqid = seqid;
-
-    return 0; // (Normal TProtocol read functions return number of bytes read)
-  }
-
-  std::string name;
-  TMessageType type;
-  int32_t seqid;
-};
-} // namespace protocol
-
-/**
- * <code>TMultiplexedProcessor</code> is a <code>TProcessor</code> allowing
- * a single <code>TServer</code> to provide multiple services.
- *
- * <p>To do so, you instantiate the processor and then register additional
- * processors with it, as shown in the following example:</p>
- *
- * <blockquote><code>
- *     shared_ptr<TMultiplexedProcessor> processor(new TMultiplexedProcessor());
- *
- *     processor->registerProcessor(
- *         "Calculator",
- *         shared_ptr<TProcessor>( new CalculatorProcessor(
- *             shared_ptr<CalculatorHandler>( new CalculatorHandler()))));
- *
- *     processor->registerProcessor(
- *         "WeatherReport",
- *         shared_ptr<TProcessor>( new WeatherReportProcessor(
- *             shared_ptr<WeatherReportHandler>( new WeatherReportHandler()))));
- *
- *     shared_ptr<TServerTransport> transport(new TServerSocket(9090));
- *     TSimpleServer server(processor, transport);
- *
- *     server.serve();
- * </code></blockquote>
- */
-class TMultiplexedProcessor : public TProcessor {
-public:
-  typedef std::map<std::string, shared_ptr<TProcessor> > services_t;
-
-  /**
-    * 'Register' a service with this <code>TMultiplexedProcessor</code>.  This
-    * allows us to broker requests to individual services by using the service
-    * name to select them at request time.
-    *
-    * \param [in] serviceName Name of a service, has to be identical to the name
-    *                         declared in the Thrift IDL, e.g. "WeatherReport".
-    * \param [in] processor   Implementation of a service, usually referred to
-    *                         as "handlers", e.g. WeatherReportHandler,
-    *                         implementing WeatherReportIf interface.
-    */
-  void registerProcessor(const std::string& serviceName, shared_ptr<TProcessor> processor) {
-    services[serviceName] = processor;
-  }
-
-  /**
-   * This implementation of <code>process</code> performs the following steps:
-   *
-   * <ol>
-   *     <li>Read the beginning of the message.</li>
-   *     <li>Extract the service name from the message.</li>
-   *     <li>Using the service name to locate the appropriate processor.</li>
-   *     <li>Dispatch to the processor, with a decorated instance of TProtocol
-   *         that allows readMessageBegin() to return the original TMessage.</li>
-   * </ol>
-   *
-   * \throws TException If the message type is not T_CALL or T_ONEWAY, if
-   * the service name was not found in the message, or if the service
-   * name was not found in the service map.
-   */
-  bool process(shared_ptr<protocol::TProtocol> in,
-               shared_ptr<protocol::TProtocol> out,
-               void* connectionContext) {
-    std::string name;
-    protocol::TMessageType type;
-    int32_t seqid;
-
-    // Use the actual underlying protocol (e.g. TBinaryProtocol) to read the
-    // message header.  This pulls the message "off the wire", which we'll
-    // deal with at the end of this method.
-    in->readMessageBegin(name, type, seqid);
-
-    if (type != protocol::T_CALL && type != protocol::T_ONEWAY) {
-      // Unexpected message type.
-      in->skip(::apache::thrift::protocol::T_STRUCT);
-      in->readMessageEnd();
-      in->getTransport()->readEnd();
-      const std::string msg("TMultiplexedProcessor: Unexpected message type");
-      ::apache::thrift::TApplicationException
-          x(::apache::thrift::TApplicationException::PROTOCOL_ERROR, msg);
-      out->writeMessageBegin(name, ::apache::thrift::protocol::T_EXCEPTION, seqid);
-      x.write(out.get());
-      out->writeMessageEnd();
-      out->getTransport()->writeEnd();
-      out->getTransport()->flush();
-      throw TException(msg);
-    }
-
-    // Extract the service name
-
-    boost::tokenizer<boost::char_separator<char> > tok(name, boost::char_separator<char>(":"));
-
-    std::vector<std::string> tokens;
-    std::copy(tok.begin(), tok.end(), std::back_inserter(tokens));
-
-    // A valid message should consist of two tokens: the service
-    // name and the name of the method to call.
-    if (tokens.size() == 2) {
-      // Search for a processor associated with this service name.
-      services_t::iterator it = services.find(tokens[0]);
-
-      if (it != services.end()) {
-        shared_ptr<TProcessor> processor = it->second;
-        // Let the processor registered for this service name
-        // process the message.
-        return processor
-            ->process(shared_ptr<protocol::TProtocol>(
-                          new protocol::StoredMessageProtocol(in, tokens[1], type, seqid)),
-                      out,
-                      connectionContext);
-      } else {
-        // Unknown service.
-        in->skip(::apache::thrift::protocol::T_STRUCT);
-        in->readMessageEnd();
-        in->getTransport()->readEnd();
-
-        std::string msg("TMultiplexedProcessor: Unknown service: ");
-        msg += tokens[0];
-        ::apache::thrift::TApplicationException
-            x(::apache::thrift::TApplicationException::PROTOCOL_ERROR, msg);
-        out->writeMessageBegin(name, ::apache::thrift::protocol::T_EXCEPTION, seqid);
-        x.write(out.get());
-        out->writeMessageEnd();
-        out->getTransport()->writeEnd();
-        out->getTransport()->flush();
-        msg += ". Did you forget to call registerProcessor()?";
-        throw TException(msg);
-      }
-    }
-    return false;
-  }
-
-private:
-  /** Map of service processor objects, indexed by service names. */
-  services_t services;
-};
-}
-}
-
-#endif // THRIFT_TMULTIPLEXEDPROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.cpp
deleted file mode 100644
index beb76eb..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/protocol/TBase64Utils.h>
-
-#include <boost/static_assert.hpp>
-
-using std::string;
-
-namespace apache {
-namespace thrift {
-namespace protocol {
-
-static const uint8_t* kBase64EncodeTable
-    = (const uint8_t*)"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-void base64_encode(const uint8_t* in, uint32_t len, uint8_t* buf) {
-  buf[0] = kBase64EncodeTable[(in[0] >> 2) & 0x3f];
-  if (len == 3) {
-    buf[1] = kBase64EncodeTable[((in[0] << 4) & 0x30) | ((in[1] >> 4) & 0x0f)];
-    buf[2] = kBase64EncodeTable[((in[1] << 2) & 0x3c) | ((in[2] >> 6) & 0x03)];
-    buf[3] = kBase64EncodeTable[in[2] & 0x3f];
-  } else if (len == 2) {
-    buf[1] = kBase64EncodeTable[((in[0] << 4) & 0x30) | ((in[1] >> 4) & 0x0f)];
-    buf[2] = kBase64EncodeTable[(in[1] << 2) & 0x3c];
-  } else { // len == 1
-    buf[1] = kBase64EncodeTable[(in[0] << 4) & 0x30];
-  }
-}
-
-static const uint8_t kBase64DecodeTable[256] = {
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0x3e,
-    0xff,
-    0xff,
-    0xff,
-    0x3f,
-    0x34,
-    0x35,
-    0x36,
-    0x37,
-    0x38,
-    0x39,
-    0x3a,
-    0x3b,
-    0x3c,
-    0x3d,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0x00,
-    0x01,
-    0x02,
-    0x03,
-    0x04,
-    0x05,
-    0x06,
-    0x07,
-    0x08,
-    0x09,
-    0x0a,
-    0x0b,
-    0x0c,
-    0x0d,
-    0x0e,
-    0x0f,
-    0x10,
-    0x11,
-    0x12,
-    0x13,
-    0x14,
-    0x15,
-    0x16,
-    0x17,
-    0x18,
-    0x19,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0x1a,
-    0x1b,
-    0x1c,
-    0x1d,
-    0x1e,
-    0x1f,
-    0x20,
-    0x21,
-    0x22,
-    0x23,
-    0x24,
-    0x25,
-    0x26,
-    0x27,
-    0x28,
-    0x29,
-    0x2a,
-    0x2b,
-    0x2c,
-    0x2d,
-    0x2e,
-    0x2f,
-    0x30,
-    0x31,
-    0x32,
-    0x33,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-    0xff,
-};
-
-void base64_decode(uint8_t* buf, uint32_t len) {
-  buf[0] = (kBase64DecodeTable[buf[0]] << 2) | (kBase64DecodeTable[buf[1]] >> 4);
-  if (len > 2) {
-    buf[1] = ((kBase64DecodeTable[buf[1]] << 4) & 0xf0) | (kBase64DecodeTable[buf[2]] >> 2);
-    if (len > 3) {
-      buf[2] = ((kBase64DecodeTable[buf[2]] << 6) & 0xc0) | (kBase64DecodeTable[buf[3]]);
-    }
-  }
-}
-}
-}
-} // apache::thrift::protocol

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.h
deleted file mode 100644
index 1ea6744..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBase64Utils.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_TBASE64UTILS_H_
-#define _THRIFT_PROTOCOL_TBASE64UTILS_H_
-
-#include <stdint.h>
-#include <string>
-
-namespace apache {
-namespace thrift {
-namespace protocol {
-
-// in must be at least len bytes
-// len must be 1, 2, or 3
-// buf must be a buffer of at least 4 bytes and may not overlap in
-// the data is not padded with '='; the caller can do this if desired
-void base64_encode(const uint8_t* in, uint32_t len, uint8_t* buf);
-
-// buf must be a buffer of at least 4 bytes and contain base64 encoded values
-// buf will be changed to contain output bytes
-// len is number of bytes to consume from input (must be 2, 3, or 4)
-// no '=' padding should be included in the input
-void base64_decode(uint8_t* buf, uint32_t len);
-}
-}
-} // apache::thrift::protocol
-
-#endif // #define _THRIFT_PROTOCOL_TBASE64UTILS_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.h
deleted file mode 100644
index e0650cf..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.h
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_
-#define _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_ 1
-
-#include <thrift/protocol/TProtocol.h>
-#include <thrift/protocol/TVirtualProtocol.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace protocol {
-
-/**
- * The default binary protocol for thrift. Writes all data in a very basic
- * binary format, essentially just spitting out the raw bytes.
- *
- */
-template <class Transport_, class ByteOrder_ = TNetworkBigEndian>
-class TBinaryProtocolT : public TVirtualProtocol<TBinaryProtocolT<Transport_, ByteOrder_> > {
-protected:
-  static const int32_t VERSION_MASK = ((int32_t)0xffff0000);
-  static const int32_t VERSION_1 = ((int32_t)0x80010000);
-  // VERSION_2 (0x80020000) was taken by TDenseProtocol (which has since been removed)
-
-public:
-  TBinaryProtocolT(boost::shared_ptr<Transport_> trans)
-    : TVirtualProtocol<TBinaryProtocolT<Transport_, ByteOrder_> >(trans),
-      trans_(trans.get()),
-      string_limit_(0),
-      container_limit_(0),
-      strict_read_(false),
-      strict_write_(true) {}
-
-  TBinaryProtocolT(boost::shared_ptr<Transport_> trans,
-                   int32_t string_limit,
-                   int32_t container_limit,
-                   bool strict_read,
-                   bool strict_write)
-    : TVirtualProtocol<TBinaryProtocolT<Transport_, ByteOrder_> >(trans),
-      trans_(trans.get()),
-      string_limit_(string_limit),
-      container_limit_(container_limit),
-      strict_read_(strict_read),
-      strict_write_(strict_write) {}
-
-  void setStringSizeLimit(int32_t string_limit) { string_limit_ = string_limit; }
-
-  void setContainerSizeLimit(int32_t container_limit) { container_limit_ = container_limit; }
-
-  void setStrict(bool strict_read, bool strict_write) {
-    strict_read_ = strict_read;
-    strict_write_ = strict_write;
-  }
-
-  /**
-   * Writing functions.
-   */
-
-  /*ol*/ uint32_t writeMessageBegin(const std::string& name,
-                                    const TMessageType messageType,
-                                    const int32_t seqid);
-
-  /*ol*/ uint32_t writeMessageEnd();
-
-  inline uint32_t writeStructBegin(const char* name);
-
-  inline uint32_t writeStructEnd();
-
-  inline uint32_t writeFieldBegin(const char* name, const TType fieldType, const int16_t fieldId);
-
-  inline uint32_t writeFieldEnd();
-
-  inline uint32_t writeFieldStop();
-
-  inline uint32_t writeMapBegin(const TType keyType, const TType valType, const uint32_t size);
-
-  inline uint32_t writeMapEnd();
-
-  inline uint32_t writeListBegin(const TType elemType, const uint32_t size);
-
-  inline uint32_t writeListEnd();
-
-  inline uint32_t writeSetBegin(const TType elemType, const uint32_t size);
-
-  inline uint32_t writeSetEnd();
-
-  inline uint32_t writeBool(const bool value);
-
-  inline uint32_t writeByte(const int8_t byte);
-
-  inline uint32_t writeI16(const int16_t i16);
-
-  inline uint32_t writeI32(const int32_t i32);
-
-  inline uint32_t writeI64(const int64_t i64);
-
-  inline uint32_t writeDouble(const double dub);
-
-  template <typename StrType>
-  inline uint32_t writeString(const StrType& str);
-
-  inline uint32_t writeBinary(const std::string& str);
-
-  /**
-   * Reading functions
-   */
-
-  /*ol*/ uint32_t readMessageBegin(std::string& name, TMessageType& messageType, int32_t& seqid);
-
-  /*ol*/ uint32_t readMessageEnd();
-
-  inline uint32_t readStructBegin(std::string& name);
-
-  inline uint32_t readStructEnd();
-
-  inline uint32_t readFieldBegin(std::string& name, TType& fieldType, int16_t& fieldId);
-
-  inline uint32_t readFieldEnd();
-
-  inline uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size);
-
-  inline uint32_t readMapEnd();
-
-  inline uint32_t readListBegin(TType& elemType, uint32_t& size);
-
-  inline uint32_t readListEnd();
-
-  inline uint32_t readSetBegin(TType& elemType, uint32_t& size);
-
-  inline uint32_t readSetEnd();
-
-  inline uint32_t readBool(bool& value);
-  // Provide the default readBool() implementation for std::vector<bool>
-  using TVirtualProtocol<TBinaryProtocolT<Transport_, ByteOrder_> >::readBool;
-
-  inline uint32_t readByte(int8_t& byte);
-
-  inline uint32_t readI16(int16_t& i16);
-
-  inline uint32_t readI32(int32_t& i32);
-
-  inline uint32_t readI64(int64_t& i64);
-
-  inline uint32_t readDouble(double& dub);
-
-  template <typename StrType>
-  inline uint32_t readString(StrType& str);
-
-  inline uint32_t readBinary(std::string& str);
-
-protected:
-  template <typename StrType>
-  uint32_t readStringBody(StrType& str, int32_t sz);
-
-  Transport_* trans_;
-
-  int32_t string_limit_;
-  int32_t container_limit_;
-
-  // Enforce presence of version identifier
-  bool strict_read_;
-  bool strict_write_;
-};
-
-typedef TBinaryProtocolT<TTransport> TBinaryProtocol;
-typedef TBinaryProtocolT<TTransport, TNetworkLittleEndian> TLEBinaryProtocol;
-
-/**
- * Constructs binary protocol handlers
- */
-template <class Transport_, class ByteOrder_ = TNetworkBigEndian>
-class TBinaryProtocolFactoryT : public TProtocolFactory {
-public:
-  TBinaryProtocolFactoryT()
-    : string_limit_(0), container_limit_(0), strict_read_(false), strict_write_(true) {}
-
-  TBinaryProtocolFactoryT(int32_t string_limit,
-                          int32_t container_limit,
-                          bool strict_read,
-                          bool strict_write)
-    : string_limit_(string_limit),
-      container_limit_(container_limit),
-      strict_read_(strict_read),
-      strict_write_(strict_write) {}
-
-  virtual ~TBinaryProtocolFactoryT() {}
-
-  void setStringSizeLimit(int32_t string_limit) { string_limit_ = string_limit; }
-
-  void setContainerSizeLimit(int32_t container_limit) { container_limit_ = container_limit; }
-
-  void setStrict(bool strict_read, bool strict_write) {
-    strict_read_ = strict_read;
-    strict_write_ = strict_write;
-  }
-
-  boost::shared_ptr<TProtocol> getProtocol(boost::shared_ptr<TTransport> trans) {
-    boost::shared_ptr<Transport_> specific_trans = boost::dynamic_pointer_cast<Transport_>(trans);
-    TProtocol* prot;
-    if (specific_trans) {
-      prot = new TBinaryProtocolT<Transport_, ByteOrder_>(
-        specific_trans,
-        string_limit_,
-        container_limit_,
-        strict_read_,
-        strict_write_);
-    } else {
-      prot = new TBinaryProtocolT<TTransport, ByteOrder_>(
-        trans,
-        string_limit_,
-        container_limit_,
-        strict_read_,
-        strict_write_);
-    }
-
-    return boost::shared_ptr<TProtocol>(prot);
-  }
-
-private:
-  int32_t string_limit_;
-  int32_t container_limit_;
-  bool strict_read_;
-  bool strict_write_;
-};
-
-typedef TBinaryProtocolFactoryT<TTransport> TBinaryProtocolFactory;
-typedef TBinaryProtocolFactoryT<TTransport, TNetworkLittleEndian> TLEBinaryProtocolFactory;
-}
-}
-} // apache::thrift::protocol
-
-#include <thrift/protocol/TBinaryProtocol.tcc>
-
-#endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
deleted file mode 100644
index ae350df..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TBinaryProtocol.tcc
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_TCC_
-#define _THRIFT_PROTOCOL_TBINARYPROTOCOL_TCC_ 1
-
-#include <thrift/protocol/TBinaryProtocol.h>
-
-#include <limits>
-
-namespace apache {
-namespace thrift {
-namespace protocol {
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMessageBegin(const std::string& name,
-                                                         const TMessageType messageType,
-                                                         const int32_t seqid) {
-  if (this->strict_write_) {
-    int32_t version = (VERSION_1) | ((int32_t)messageType);
-    uint32_t wsize = 0;
-    wsize += writeI32(version);
-    wsize += writeString(name);
-    wsize += writeI32(seqid);
-    return wsize;
-  } else {
-    uint32_t wsize = 0;
-    wsize += writeString(name);
-    wsize += writeByte((int8_t)messageType);
-    wsize += writeI32(seqid);
-    return wsize;
-  }
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMessageEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeStructBegin(const char* name) {
-  (void)name;
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeStructEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeFieldBegin(const char* name,
-                                                       const TType fieldType,
-                                                       const int16_t fieldId) {
-  (void)name;
-  uint32_t wsize = 0;
-  wsize += writeByte((int8_t)fieldType);
-  wsize += writeI16(fieldId);
-  return wsize;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeFieldEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeFieldStop() {
-  return writeByte((int8_t)T_STOP);
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMapBegin(const TType keyType,
-                                                     const TType valType,
-                                                     const uint32_t size) {
-  uint32_t wsize = 0;
-  wsize += writeByte((int8_t)keyType);
-  wsize += writeByte((int8_t)valType);
-  wsize += writeI32((int32_t)size);
-  return wsize;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeMapEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeListBegin(const TType elemType, const uint32_t size) {
-  uint32_t wsize = 0;
-  wsize += writeByte((int8_t)elemType);
-  wsize += writeI32((int32_t)size);
-  return wsize;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeListEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeSetBegin(const TType elemType, const uint32_t size) {
-  uint32_t wsize = 0;
-  wsize += writeByte((int8_t)elemType);
-  wsize += writeI32((int32_t)size);
-  return wsize;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeSetEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeBool(const bool value) {
-  uint8_t tmp = value ? 1 : 0;
-  this->trans_->write(&tmp, 1);
-  return 1;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeByte(const int8_t byte) {
-  this->trans_->write((uint8_t*)&byte, 1);
-  return 1;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeI16(const int16_t i16) {
-  int16_t net = (int16_t)ByteOrder_::toWire16(i16);
-  this->trans_->write((uint8_t*)&net, 2);
-  return 2;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeI32(const int32_t i32) {
-  int32_t net = (int32_t)ByteOrder_::toWire32(i32);
-  this->trans_->write((uint8_t*)&net, 4);
-  return 4;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeI64(const int64_t i64) {
-  int64_t net = (int64_t)ByteOrder_::toWire64(i64);
-  this->trans_->write((uint8_t*)&net, 8);
-  return 8;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeDouble(const double dub) {
-  BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
-  BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
-
-  uint64_t bits = bitwise_cast<uint64_t>(dub);
-  bits = ByteOrder_::toWire64(bits);
-  this->trans_->write((uint8_t*)&bits, 8);
-  return 8;
-}
-
-template <class Transport_, class ByteOrder_>
-template <typename StrType>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeString(const StrType& str) {
-  if (str.size() > static_cast<size_t>((std::numeric_limits<int32_t>::max)()))
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  uint32_t size = static_cast<uint32_t>(str.size());
-  uint32_t result = writeI32((int32_t)size);
-  if (size > 0) {
-    this->trans_->write((uint8_t*)str.data(), size);
-  }
-  return result + size;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::writeBinary(const std::string& str) {
-  return TBinaryProtocolT<Transport_, ByteOrder_>::writeString(str);
-}
-
-/**
- * Reading functions
- */
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMessageBegin(std::string& name,
-                                                        TMessageType& messageType,
-                                                        int32_t& seqid) {
-  uint32_t result = 0;
-  int32_t sz;
-  result += readI32(sz);
-
-  if (sz < 0) {
-    // Check for correct version number
-    int32_t version = sz & VERSION_MASK;
-    if (version != VERSION_1) {
-      throw TProtocolException(TProtocolException::BAD_VERSION, "Bad version identifier");
-    }
-    messageType = (TMessageType)(sz & 0x000000ff);
-    result += readString(name);
-    result += readI32(seqid);
-  } else {
-    if (this->strict_read_) {
-      throw TProtocolException(TProtocolException::BAD_VERSION,
-                               "No version identifier... old protocol client in strict mode?");
-    } else {
-      // Handle pre-versioned input
-      int8_t type;
-      result += readStringBody(name, sz);
-      result += readByte(type);
-      messageType = (TMessageType)type;
-      result += readI32(seqid);
-    }
-  }
-  return result;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMessageEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readStructBegin(std::string& name) {
-  name = "";
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readStructEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readFieldBegin(std::string& name,
-                                                      TType& fieldType,
-                                                      int16_t& fieldId) {
-  (void)name;
-  uint32_t result = 0;
-  int8_t type;
-  result += readByte(type);
-  fieldType = (TType)type;
-  if (fieldType == T_STOP) {
-    fieldId = 0;
-    return result;
-  }
-  result += readI16(fieldId);
-  return result;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readFieldEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMapBegin(TType& keyType,
-                                                    TType& valType,
-                                                    uint32_t& size) {
-  int8_t k, v;
-  uint32_t result = 0;
-  int32_t sizei;
-  result += readByte(k);
-  keyType = (TType)k;
-  result += readByte(v);
-  valType = (TType)v;
-  result += readI32(sizei);
-  if (sizei < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  } else if (this->container_limit_ && sizei > this->container_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-  size = (uint32_t)sizei;
-  return result;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readMapEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readListBegin(TType& elemType, uint32_t& size) {
-  int8_t e;
-  uint32_t result = 0;
-  int32_t sizei;
-  result += readByte(e);
-  elemType = (TType)e;
-  result += readI32(sizei);
-  if (sizei < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  } else if (this->container_limit_ && sizei > this->container_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-  size = (uint32_t)sizei;
-  return result;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readListEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readSetBegin(TType& elemType, uint32_t& size) {
-  int8_t e;
-  uint32_t result = 0;
-  int32_t sizei;
-  result += readByte(e);
-  elemType = (TType)e;
-  result += readI32(sizei);
-  if (sizei < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  } else if (this->container_limit_ && sizei > this->container_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-  size = (uint32_t)sizei;
-  return result;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readSetEnd() {
-  return 0;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readBool(bool& value) {
-  uint8_t b[1];
-  this->trans_->readAll(b, 1);
-  value = *(int8_t*)b != 0;
-  return 1;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readByte(int8_t& byte) {
-  uint8_t b[1];
-  this->trans_->readAll(b, 1);
-  byte = *(int8_t*)b;
-  return 1;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readI16(int16_t& i16) {
-  union bytes {
-    uint8_t b[2];
-    int16_t all;
-  } theBytes;
-  this->trans_->readAll(theBytes.b, 2);
-  i16 = (int16_t)ByteOrder_::fromWire16(theBytes.all);
-  return 2;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readI32(int32_t& i32) {
-  union bytes {
-    uint8_t b[4];
-    int32_t all;
-  } theBytes;
-  this->trans_->readAll(theBytes.b, 4);
-  i32 = (int32_t)ByteOrder_::fromWire32(theBytes.all);
-  return 4;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readI64(int64_t& i64) {
-  union bytes {
-    uint8_t b[8];
-    int64_t all;
-  } theBytes;
-  this->trans_->readAll(theBytes.b, 8);
-  i64 = (int64_t)ByteOrder_::fromWire64(theBytes.all);
-  return 8;
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readDouble(double& dub) {
-  BOOST_STATIC_ASSERT(sizeof(double) == sizeof(uint64_t));
-  BOOST_STATIC_ASSERT(std::numeric_limits<double>::is_iec559);
-
-  union bytes {
-    uint8_t b[8];
-    uint64_t all;
-  } theBytes;
-  this->trans_->readAll(theBytes.b, 8);
-  theBytes.all = ByteOrder_::fromWire64(theBytes.all);
-  dub = bitwise_cast<double>(theBytes.all);
-  return 8;
-}
-
-template <class Transport_, class ByteOrder_>
-template <typename StrType>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readString(StrType& str) {
-  uint32_t result;
-  int32_t size;
-  result = readI32(size);
-  return result + readStringBody(str, size);
-}
-
-template <class Transport_, class ByteOrder_>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readBinary(std::string& str) {
-  return TBinaryProtocolT<Transport_, ByteOrder_>::readString(str);
-}
-
-template <class Transport_, class ByteOrder_>
-template <typename StrType>
-uint32_t TBinaryProtocolT<Transport_, ByteOrder_>::readStringBody(StrType& str, int32_t size) {
-  uint32_t result = 0;
-
-  // Catch error cases
-  if (size < 0) {
-    throw TProtocolException(TProtocolException::NEGATIVE_SIZE);
-  }
-  if (this->string_limit_ > 0 && size > this->string_limit_) {
-    throw TProtocolException(TProtocolException::SIZE_LIMIT);
-  }
-
-  // Catch empty string case
-  if (size == 0) {
-    str.clear();
-    return result;
-  }
-
-  // Try to borrow first
-  const uint8_t* borrow_buf;
-  uint32_t got = size;
-  if ((borrow_buf = this->trans_->borrow(NULL, &got))) {
-    str.assign((const char*)borrow_buf, size);
-    this->trans_->consume(size);
-    return size;
-  }
-
-  str.resize(size);
-  this->trans_->readAll(reinterpret_cast<uint8_t*>(&str[0]), size);
-  return (uint32_t)size;
-}
-}
-}
-} // apache::thrift::protocol
-
-#endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_TCC_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.h
deleted file mode 100644
index 5b7ade2..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/protocol/TCompactProtocol.h
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROTOCOL_TCOMPACTPROTOCOL_H_
-#define _THRIFT_PROTOCOL_TCOMPACTPROTOCOL_H_ 1
-
-#include <thrift/protocol/TVirtualProtocol.h>
-
-#include <stack>
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace protocol {
-
-/**
- * C++ Implementation of the Compact Protocol as described in THRIFT-110
- */
-template <class Transport_>
-class TCompactProtocolT : public TVirtualProtocol<TCompactProtocolT<Transport_> > {
-
-protected:
-  static const int8_t PROTOCOL_ID = (int8_t)0x82u;
-  static const int8_t VERSION_N = 1;
-  static const int8_t VERSION_MASK = 0x1f;       // 0001 1111
-  static const int8_t TYPE_MASK = (int8_t)0xE0u; // 1110 0000
-  static const int8_t TYPE_BITS = 0x07;          // 0000 0111
-  static const int32_t TYPE_SHIFT_AMOUNT = 5;
-
-  Transport_* trans_;
-
-  /**
-   * (Writing) If we encounter a boolean field begin, save the TField here
-   * so it can have the value incorporated.
-   */
-  struct {
-    const char* name;
-    TType fieldType;
-    int16_t fieldId;
-  } booleanField_;
-
-  /**
-   * (Reading) If we read a field header, and it's a boolean field, save
-   * the boolean value here so that readBool can use it.
-   */
-  struct {
-    bool hasBoolValue;
-    bool boolValue;
-  } boolValue_;
-
-  /**
-   * Used to keep track of the last field for the current and previous structs,
-   * so we can do the delta stuff.
-   */
-
-  std::stack<int16_t> lastField_;
-  int16_t lastFieldId_;
-
-public:
-  TCompactProtocolT(boost::shared_ptr<Transport_> trans)
-    : TVirtualProtocol<TCompactProtocolT<Transport_> >(trans),
-      trans_(trans.get()),
-      lastFieldId_(0),
-      string_limit_(0),
-      string_buf_(NULL),
-      string_buf_size_(0),
-      container_limit_(0) {
-    booleanField_.name = NULL;
-    boolValue_.hasBoolValue = false;
-  }
-
-  TCompactProtocolT(boost::shared_ptr<Transport_> trans,
-                    int32_t string_limit,
-                    int32_t container_limit)
-    : TVirtualProtocol<TCompactProtocolT<Transport_> >(trans),
-      trans_(trans.get()),
-      lastFieldId_(0),
-      string_limit_(string_limit),
-      string_buf_(NULL),
-      string_buf_size_(0),
-      container_limit_(container_limit) {
-    booleanField_.name = NULL;
-    boolValue_.hasBoolValue = false;
-  }
-
-  ~TCompactProtocolT() { free(string_buf_); }
-
-  /**
-   * Writing functions
-   */
-
-  virtual uint32_t writeMessageBegin(const std::string& name,
-                                     const TMessageType messageType,
-                                     const int32_t seqid);
-
-  uint32_t writeStructBegin(const char* name);
-
-  uint32_t writeStructEnd();
-
-  uint32_t writeFieldBegin(const char* name, const TType fieldType, const int16_t fieldId);
-
-  uint32_t writeFieldStop();
-
-  uint32_t writeListBegin(const TType elemType, const uint32_t size);
-
-  uint32_t writeSetBegin(const TType elemType, const uint32_t size);
-
-  virtual uint32_t writeMapBegin(const TType keyType, const TType valType, const uint32_t size);
-
-  uint32_t writeBool(const bool value);
-
-  uint32_t writeByte(const int8_t byte);
-
-  uint32_t writeI16(const int16_t i16);
-
-  uint32_t writeI32(const int32_t i32);
-
-  uint32_t writeI64(const int64_t i64);
-
-  uint32_t writeDouble(const double dub);
-
-  uint32_t writeString(const std::string& str);
-
-  uint32_t writeBinary(const std::string& str);
-
-  /**
-  * These methods are called by structs, but don't actually have any wired
-  * output or purpose
-  */
-  virtual uint32_t writeMessageEnd() { return 0; }
-  uint32_t writeMapEnd() { return 0; }
-  uint32_t writeListEnd() { return 0; }
-  uint32_t writeSetEnd() { return 0; }
-  uint32_t writeFieldEnd() { return 0; }
-
-protected:
-  int32_t writeFieldBeginInternal(const char* name,
-                                  const TType fieldType,
-                                  const int16_t fieldId,
-                                  int8_t typeOverride);
-  uint32_t writeCollectionBegin(const TType elemType, int32_t size);
-  uint32_t writeVarint32(uint32_t n);
-  uint32_t writeVarint64(uint64_t n);
-  uint64_t i64ToZigzag(const int64_t l);
-  uint32_t i32ToZigzag(const int32_t n);
-  inline int8_t getCompactType(const TType ttype);
-
-public:
-  uint32_t readMessageBegin(std::string& name, TMessageType& messageType, int32_t& seqid);
-
-  uint32_t readStructBegin(std::string& name);
-
-  uint32_t readStructEnd();
-
-  uint32_t readFieldBegin(std::string& name, TType& fieldType, int16_t& fieldId);
-
-  uint32_t readMapBegin(TType& keyType, TType& valType, uint32_t& size);
-
-  uint32_t readListBegin(TType& elemType, uint32_t& size);
-
-  uint32_t readSetBegin(TType& elemType, uint32_t& size);
-
-  uint32_t readBool(bool& value);
-  // Provide the default readBool() implementation for std::vector<bool>
-  using TVirtualProtocol<TCompactProtocolT<Transport_> >::readBool;
-
-  uint32_t readByte(int8_t& byte);
-
-  uint32_t readI16(int16_t& i16);
-
-  uint32_t readI32(int32_t& i32);
-
-  uint32_t readI64(int64_t& i64);
-
-  uint32_t readDouble(double& dub);
-
-  uint32_t readString(std::string& str);
-
-  uint32_t readBinary(std::string& str);
-
-  /*
-   *These methods are here for the struct to call, but don't have any wire
-   * encoding.
-   */
-  uint32_t readMessageEnd() { return 0; }
-  uint32_t readFieldEnd() { return 0; }
-  uint32_t readMapEnd() { return 0; }
-  uint32_t readListEnd() { return 0; }
-  uint32_t readSetEnd() { return 0; }
-
-protected:
-  uint32_t readVarint32(int32_t& i32);
-  uint32_t readVarint64(int64_t& i64);
-  int32_t zigzagToI32(uint32_t n);
-  int64_t zigzagToI64(uint64_t n);
-  TType getTType(int8_t type);
-
-  // Buffer for reading strings, save for the lifetime of the protocol to
-  // avoid memory churn allocating memory on every string read
-  int32_t string_limit_;
-  uint8_t* string_buf_;
-  int32_t string_buf_size_;
-  int32_t container_limit_;
-};
-
-typedef TCompactProtocolT<TTransport> TCompactProtocol;
-
-/**
- * Constructs compact protocol handlers
- */
-template <class Transport_>
-class TCompactProtocolFactoryT : public TProtocolFactory {
-public:
-  TCompactProtocolFactoryT() : string_limit_(0), container_limit_(0) {}
-
-  TCompactProtocolFactoryT(int32_t string_limit, int32_t container_limit)
-    : string_limit_(string_limit), container_limit_(container_limit) {}
-
-  virtual ~TCompactProtocolFactoryT() {}
-
-  void setStringSizeLimit(int32_t string_limit) { string_limit_ = string_limit; }
-
-  void setContainerSizeLimit(int32_t container_limit) { container_limit_ = container_limit; }
-
-  boost::shared_ptr<TProtocol> getProtocol(boost::shared_ptr<TTransport> trans) {
-    boost::shared_ptr<Transport_> specific_trans = boost::dynamic_pointer_cast<Transport_>(trans);
-    TProtocol* prot;
-    if (specific_trans) {
-      prot = new TCompactProtocolT<Transport_>(specific_trans, string_limit_, container_limit_);
-    } else {
-      prot = new TCompactProtocol(trans, string_limit_, container_limit_);
-    }
-
-    return boost::shared_ptr<TProtocol>(prot);
-  }
-
-private:
-  int32_t string_limit_;
-  int32_t container_limit_;
-};
-
-typedef TCompactProtocolFactoryT<TTransport> TCompactProtocolFactory;
-}
-}
-} // apache::thrift::protocol
-
-#include <thrift/protocol/TCompactProtocol.tcc>
-
-#endif


[36/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_gv_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_gv_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_gv_generator.cc
deleted file mode 100644
index b70f2ca..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_gv_generator.cc
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <map>
-#include <list>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::pair;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Graphviz code generator
- */
-class t_gv_generator : public t_generator {
-public:
-  t_gv_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-gv";
-
-    std::map<std::string, std::string>::const_iterator iter;
-    iter = parsed_options.find("exceptions");
-    exception_arrows = (iter != parsed_options.end());
-  }
-
-  /**
-   * Init and end of generator
-   */
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_service(t_service* tservice);
-
-protected:
-  /**
-   * Helpers
-   */
-  void print_type(t_type* ttype, string struct_field_ref);
-  void print_const_value(t_type* type, t_const_value* tvalue);
-
-private:
-  std::ofstream f_out_;
-  std::list<string> edges;
-  bool exception_arrows;
-};
-
-/**
- * Init generator:
- * - Adds some escaping for the Graphviz domain.
- * - Create output directory and open file for writting.
- * - Write the file header.
- */
-void t_gv_generator::init_generator() {
-  escape_['{'] = "\\{";
-  escape_['}'] = "\\}";
-
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  string fname = get_out_dir() + program_->get_name() + ".gv";
-  f_out_.open(fname.c_str());
-  f_out_ << "digraph \"" << escape_string(program_name_) << "\" {" << endl;
-  f_out_ << "node [style=filled, shape=record];" << endl;
-  f_out_ << "edge [arrowsize=0.5];" << endl;
-  f_out_ << "rankdir=LR" << endl;
-}
-
-/**
- * Closes generator:
- * - Print accumulated nodes connections.
- * - Print footnote.
- * - Closes file.
- */
-void t_gv_generator::close_generator() {
-  // Print edges
-  std::list<string>::iterator iter = edges.begin();
-  for (; iter != edges.end(); iter++) {
-    f_out_ << (*iter) << endl;
-  }
-
-  // Print graph end } and close file
-  f_out_ << "}" << endl;
-  f_out_.close();
-}
-
-void t_gv_generator::generate_typedef(t_typedef* ttypedef) {
-  string name = ttypedef->get_name();
-  f_out_ << "node [fillcolor=azure];" << endl;
-  f_out_ << name << " [label=\"";
-
-  f_out_ << escape_string(name);
-  f_out_ << " :: ";
-  print_type(ttypedef->get_type(), name);
-
-  f_out_ << "\"];" << endl;
-}
-
-void t_gv_generator::generate_enum(t_enum* tenum) {
-  string name = tenum->get_name();
-  f_out_ << "node [fillcolor=white];" << endl;
-  f_out_ << name << " [label=\"enum " << escape_string(name);
-
-  vector<t_enum_value*> values = tenum->get_constants();
-  vector<t_enum_value*>::iterator val_iter;
-  for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
-    f_out_ << '|' << (*val_iter)->get_name();
-    f_out_ << " = ";
-    f_out_ << (*val_iter)->get_value();
-  }
-
-  f_out_ << "\"];" << endl;
-}
-
-void t_gv_generator::generate_const(t_const* tconst) {
-  string name = tconst->get_name();
-
-  f_out_ << "node [fillcolor=aliceblue];" << endl;
-  f_out_ << "const_" << name << " [label=\"";
-
-  f_out_ << escape_string(name);
-  f_out_ << " = ";
-  print_const_value(tconst->get_type(), tconst->get_value());
-  f_out_ << " :: ";
-  print_type(tconst->get_type(), "const_" + name);
-
-  f_out_ << "\"];" << endl;
-}
-
-void t_gv_generator::generate_struct(t_struct* tstruct) {
-  string name = tstruct->get_name();
-
-  if (tstruct->is_xception()) {
-    f_out_ << "node [fillcolor=lightpink];" << endl;
-    f_out_ << name << " [label=\"";
-    f_out_ << "exception " << escape_string(name);
-  } else if (tstruct->is_union()) {
-    f_out_ << "node [fillcolor=lightcyan];" << endl;
-    f_out_ << name << " [label=\"";
-    f_out_ << "union " << escape_string(name);
-  } else {
-    f_out_ << "node [fillcolor=beige];" << endl;
-    f_out_ << name << " [label=\"";
-    f_out_ << "struct " << escape_string(name);
-  }
-
-  vector<t_field*> members = tstruct->get_members();
-  vector<t_field*>::iterator mem_iter = members.begin();
-  for (; mem_iter != members.end(); mem_iter++) {
-    string field_name = (*mem_iter)->get_name();
-
-    // print port (anchor reference)
-    f_out_ << "|<field_" << field_name << '>';
-
-    // field name :: field type
-    f_out_ << (*mem_iter)->get_name();
-    f_out_ << " :: ";
-    print_type((*mem_iter)->get_type(), name + ":field_" + field_name);
-  }
-
-  f_out_ << "\"];" << endl;
-}
-
-void t_gv_generator::print_type(t_type* ttype, string struct_field_ref) {
-  if (ttype->is_container()) {
-    if (ttype->is_list()) {
-      f_out_ << "list\\<";
-      print_type(((t_list*)ttype)->get_elem_type(), struct_field_ref);
-      f_out_ << "\\>";
-    } else if (ttype->is_set()) {
-      f_out_ << "set\\<";
-      print_type(((t_set*)ttype)->get_elem_type(), struct_field_ref);
-      f_out_ << "\\>";
-    } else if (ttype->is_map()) {
-      f_out_ << "map\\<";
-      print_type(((t_map*)ttype)->get_key_type(), struct_field_ref);
-      f_out_ << ", ";
-      print_type(((t_map*)ttype)->get_val_type(), struct_field_ref);
-      f_out_ << "\\>";
-    }
-  } else if (ttype->is_base_type()) {
-    f_out_ << (((t_base_type*)ttype)->is_binary() ? "binary" : ttype->get_name());
-  } else {
-    f_out_ << ttype->get_name();
-    edges.push_back(struct_field_ref + " -> " + ttype->get_name());
-  }
-}
-
-/**
- * Prints out an string representation of the provided constant value
- */
-void t_gv_generator::print_const_value(t_type* type, t_const_value* tvalue) {
-  bool first = true;
-  switch (tvalue->get_type()) {
-  case t_const_value::CV_INTEGER:
-    f_out_ << tvalue->get_integer();
-    break;
-  case t_const_value::CV_DOUBLE:
-    f_out_ << tvalue->get_double();
-    break;
-  case t_const_value::CV_STRING:
-    f_out_ << "\\\"" << get_escaped_string(tvalue) << "\\\"";
-    break;
-  case t_const_value::CV_MAP: {
-    f_out_ << "\\{ ";
-    map<t_const_value*, t_const_value*> map_elems = tvalue->get_map();
-    map<t_const_value*, t_const_value*>::iterator map_iter;
-    for (map_iter = map_elems.begin(); map_iter != map_elems.end(); map_iter++) {
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      print_const_value(((t_map*)type)->get_key_type(), map_iter->first);
-      f_out_ << " = ";
-      print_const_value(((t_map*)type)->get_val_type(), map_iter->second);
-    }
-    f_out_ << " \\}";
-  } break;
-  case t_const_value::CV_LIST: {
-    f_out_ << "\\{ ";
-    vector<t_const_value*> list_elems = tvalue->get_list();
-    ;
-    vector<t_const_value*>::iterator list_iter;
-    for (list_iter = list_elems.begin(); list_iter != list_elems.end(); list_iter++) {
-      if (!first) {
-        f_out_ << ", ";
-      }
-      first = false;
-      if (type->is_list()) {
-        print_const_value(((t_list*)type)->get_elem_type(), *list_iter);
-      } else {
-        print_const_value(((t_set*)type)->get_elem_type(), *list_iter);
-      }
-    }
-    f_out_ << " \\}";
-  } break;
-  case t_const_value::CV_IDENTIFIER:
-    f_out_ << escape_string(type->get_name()) << "."
-           << escape_string(tvalue->get_identifier_name());
-    break;
-  default:
-    f_out_ << "UNKNOWN";
-    break;
-  }
-}
-
-void t_gv_generator::generate_service(t_service* tservice) {
-  string service_name = get_service_name(tservice);
-  f_out_ << "subgraph cluster_" << service_name << " {" << endl;
-  f_out_ << "node [fillcolor=bisque];" << endl;
-  f_out_ << "style=dashed;" << endl;
-  f_out_ << "label = \"" << escape_string(service_name) << " service\";" << endl;
-
-  // TODO: service extends
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator fn_iter = functions.begin();
-  for (; fn_iter != functions.end(); fn_iter++) {
-    string fn_name = (*fn_iter)->get_name();
-
-    f_out_ << "function_" << service_name << fn_name;
-    f_out_ << "[label=\"<return_type>function " << escape_string(fn_name);
-    f_out_ << " :: ";
-    print_type((*fn_iter)->get_returntype(), "function_" + service_name + fn_name + ":return_type");
-
-    vector<t_field*> args = (*fn_iter)->get_arglist()->get_members();
-    vector<t_field*>::iterator arg_iter = args.begin();
-    for (; arg_iter != args.end(); arg_iter++) {
-      f_out_ << "|<param_" << (*arg_iter)->get_name() << ">";
-      f_out_ << (*arg_iter)->get_name();
-      if ((*arg_iter)->get_value() != NULL) {
-        f_out_ << " = ";
-        print_const_value((*arg_iter)->get_type(), (*arg_iter)->get_value());
-      }
-      f_out_ << " :: ";
-      print_type((*arg_iter)->get_type(),
-                 "function_" + service_name + fn_name + ":param_" + (*arg_iter)->get_name());
-    }
-    // end of node
-    f_out_ << "\"];" << endl;
-
-    // Exception edges
-    if (exception_arrows) {
-      vector<t_field*> excepts = (*fn_iter)->get_xceptions()->get_members();
-      vector<t_field*>::iterator ex_iter = excepts.begin();
-      for (; ex_iter != excepts.end(); ex_iter++) {
-        edges.push_back("function_" + service_name + fn_name + " -> "
-                        + (*ex_iter)->get_type()->get_name() + " [color=red]");
-      }
-    }
-  }
-
-  f_out_ << " }" << endl;
-}
-
-THRIFT_REGISTER_GENERATOR(
-    gv,
-    "Graphviz",
-    "    exceptions:      Whether to draw arrows from functions to exception.\n")


[32/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_java_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_java_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_java_generator.cc
deleted file mode 100644
index c4cbc45..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_java_generator.cc
+++ /dev/null
@@ -1,5146 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <cassert>
-#include <ctime>
-
-#include <sstream>
-#include <string>
-#include <fstream>
-#include <iomanip>
-#include <iostream>
-#include <vector>
-#include <cctype>
-
-#include <sys/stat.h>
-#include <stdexcept>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::setfill;
-using std::setw;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Java code generator.
- *
- */
-class t_java_generator : public t_oop_generator {
-public:
-  t_java_generator(t_program* program,
-                   const std::map<std::string, std::string>& parsed_options,
-                   const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("beans");
-    bean_style_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("android");
-    android_style_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("private-members");
-    private_members_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("nocamel");
-    nocamel_style_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("fullcamel");
-    fullcamel_style_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("android_legacy");
-    android_legacy_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("sorted_containers");
-    sorted_containers_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("java5");
-    java5_ = (iter != parsed_options.end());
-    if (java5_) {
-      android_legacy_ = true;
-    }
-
-    iter = parsed_options.find("reuse-objects");
-    reuse_objects_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("option_type");
-    use_option_type_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("generated_annotations");
-    if (iter != parsed_options.end()) {
-      undated_generated_annotations_  = (iter->second.compare("undated") == 0);
-      suppress_generated_annotations_ = (iter->second.compare("suppress") == 0);
-    } else {
-      undated_generated_annotations_  = false;
-      suppress_generated_annotations_ = false;
-    }
-
-    out_dir_base_ = (bean_style_ ? "gen-javabean" : "gen-java");
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_struct(t_struct* tstruct);
-  void generate_union(t_struct* tunion);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  void print_const_value(std::ofstream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value,
-                         bool in_static,
-                         bool defval = false);
-  std::string render_const_value(std::ofstream& out, t_type* type, t_const_value* value);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_java_struct(t_struct* tstruct, bool is_exception);
-
-  void generate_java_struct_definition(std::ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_xception = false,
-                                       bool in_class = false,
-                                       bool is_result = false);
-  void generate_java_struct_parcelable(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_equality(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_compare_to(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_java_validator(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_result_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_writer(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_tostring(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_clear(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_write_object(std::ofstream& out, t_struct* tstruct);
-  void generate_java_struct_read_object(std::ofstream& out, t_struct* tstruct);
-  void generate_java_meta_data_map(std::ofstream& out, t_struct* tstruct);
-  void generate_field_value_meta_data(std::ofstream& out, t_type* type);
-  std::string get_java_type_string(t_type* type);
-  void generate_java_struct_field_by_id(ofstream& out, t_struct* tstruct);
-  void generate_reflection_setters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_reflection_getters(std::ostringstream& out,
-                                   t_type* type,
-                                   std::string field_name,
-                                   std::string cap_name);
-  void generate_generic_field_getters_setters(std::ofstream& out, t_struct* tstruct);
-  void generate_generic_isset_method(std::ofstream& out, t_struct* tstruct);
-  void generate_java_bean_boilerplate(std::ofstream& out, t_struct* tstruct);
-
-  void generate_function_helpers(t_function* tfunction);
-  std::string as_camel_case(std::string name, bool ucfirst = true);
-  std::string get_rpc_method_name(std::string name);
-  std::string get_cap_name(std::string name);
-  std::string generate_isset_check(t_field* field);
-  std::string generate_isset_check(std::string field);
-  void generate_isset_set(ofstream& out, t_field* field, std::string prefix);
-  std::string isset_field_id(t_field* field);
-
-  void generate_service_interface(t_service* tservice);
-  void generate_service_async_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_async_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_service_async_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-  void generate_process_async_function(t_service* tservice, t_function* tfunction);
-
-  void generate_java_union(t_struct* tstruct);
-  void generate_union_constructor(ofstream& out, t_struct* tstruct);
-  void generate_union_getters_and_setters(ofstream& out, t_struct* tstruct);
-  void generate_union_is_set_methods(ofstream& out, t_struct* tstruct);
-  void generate_union_abstract_methods(ofstream& out, t_struct* tstruct);
-  void generate_check_type(ofstream& out, t_struct* tstruct);
-  void generate_standard_scheme_read_value(ofstream& out, t_struct* tstruct);
-  void generate_standard_scheme_write_value(ofstream& out, t_struct* tstruct);
-  void generate_tuple_scheme_read_value(ofstream& out, t_struct* tstruct);
-  void generate_tuple_scheme_write_value(ofstream& out, t_struct* tstruct);
-  void generate_get_field_desc(ofstream& out, t_struct* tstruct);
-  void generate_get_struct_desc(ofstream& out, t_struct* tstruct);
-  void generate_get_field_name(ofstream& out, t_struct* tstruct);
-
-  void generate_union_comparisons(ofstream& out, t_struct* tstruct);
-  void generate_union_hashcode(ofstream& out, t_struct* tstruct);
-
-  void generate_scheme_map(ofstream& out, t_struct* tstruct);
-  void generate_standard_writer(ofstream& out, t_struct* tstruct, bool is_result);
-  void generate_standard_reader(ofstream& out, t_struct* tstruct);
-  void generate_java_struct_standard_scheme(ofstream& out, t_struct* tstruct, bool is_result);
-
-  void generate_java_struct_tuple_scheme(ofstream& out, t_struct* tstruct);
-  void generate_java_struct_tuple_reader(ofstream& out, t_struct* tstruct);
-  void generate_java_struct_tuple_writer(ofstream& out, t_struct* tstruct);
-
-  void generate_javax_generated_annotation(ofstream& out);
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool has_metadata = true);
-
-  void generate_deserialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out,
-                                      t_type* ttype,
-                                      std::string prefix = "",
-                                      bool has_metadata = true);
-
-  void generate_deserialize_set_element(std::ofstream& out,
-                                        t_set* tset,
-                                        std::string prefix = "",
-                                        std::string obj = "",
-                                        bool has_metadata = true);
-
-  void generate_deserialize_map_element(std::ofstream& out,
-                                        t_map* tmap,
-                                        std::string prefix = "",
-                                        std::string obj = "",
-                                        bool has_metadata = true);
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "",
-                                         std::string obj = "",
-                                         bool has_metadata = true);
-
-  void generate_serialize_field(std::ofstream& out,
-                                t_field* tfield,
-                                std::string prefix = "",
-                                bool has_metadata = true);
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out,
-                                    t_type* ttype,
-                                    std::string prefix = "",
-                                    bool has_metadata = true);
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map,
-                                      bool has_metadata = true);
-
-  void generate_serialize_set_element(std::ofstream& out,
-                                      t_set* tmap,
-                                      std::string iter,
-                                      bool has_metadata = true);
-
-  void generate_serialize_list_element(std::ofstream& out,
-                                       t_list* tlist,
-                                       std::string iter,
-                                       bool has_metadata = true);
-
-  void generate_deep_copy_container(std::ofstream& out,
-                                    std::string source_name_p1,
-                                    std::string source_name_p2,
-                                    std::string result_name,
-                                    t_type* type);
-  void generate_deep_copy_non_container(std::ofstream& out,
-                                        std::string source_name,
-                                        std::string dest_name,
-                                        t_type* type);
-
-  enum isset_type { ISSET_NONE, ISSET_PRIMITIVE, ISSET_BITSET };
-  isset_type needs_isset(t_struct* tstruct, std::string* outPrimitiveType = NULL);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string java_package();
-  std::string java_type_imports();
-  std::string java_suppressions();
-  std::string type_name(t_type* ttype,
-                        bool in_container = false,
-                        bool in_init = false,
-                        bool skip_generic = false,
-                        bool force_namespace = false);
-  std::string base_type_name(t_base_type* tbase, bool in_container = false);
-  std::string declare_field(t_field* tfield, bool init = false, bool comment = false);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string function_signature_async(t_function* tfunction,
-                                       bool use_base_method = false,
-                                       std::string prefix = "");
-  std::string argument_list(t_struct* tstruct, bool include_types = true);
-  std::string async_function_call_arglist(t_function* tfunc,
-                                          bool use_base_method = true,
-                                          bool include_types = true);
-  std::string async_argument_list(t_function* tfunct,
-                                  t_struct* tstruct,
-                                  t_type* ttype,
-                                  bool include_types = false);
-  std::string type_to_enum(t_type* ttype);
-  void generate_struct_desc(ofstream& out, t_struct* tstruct);
-  void generate_field_descs(ofstream& out, t_struct* tstruct);
-  void generate_field_name_constants(ofstream& out, t_struct* tstruct);
-
-  std::string make_valid_java_filename(std::string const& fromName);
-  std::string make_valid_java_identifier(std::string const& fromName);
-
-  bool type_can_be_null(t_type* ttype) {
-    ttype = get_true_type(ttype);
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception() || ttype->is_string()
-           || ttype->is_enum();
-  }
-
-  std::string constant_name(std::string name);
-
-private:
-  /**
-   * File streams
-   */
-
-  std::string package_name_;
-  std::ofstream f_service_;
-  std::string package_dir_;
-
-  bool bean_style_;
-  bool android_style_;
-  bool private_members_;
-  bool nocamel_style_;
-  bool fullcamel_style_;
-  bool android_legacy_;
-  bool java5_;
-  bool sorted_containers_;
-  bool reuse_objects_;
-  bool use_option_type_;
-  bool undated_generated_annotations_;
-  bool suppress_generated_annotations_;
-  
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_java_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-  package_name_ = program_->get_namespace("java");
-
-  string dir = package_name_;
-  string subdir = get_out_dir();
-  string::size_type loc;
-  while ((loc = dir.find(".")) != string::npos) {
-    subdir = subdir + "/" + dir.substr(0, loc);
-    MKDIR(subdir.c_str());
-    dir = dir.substr(loc + 1);
-  }
-  if (dir.size() > 0) {
-    subdir = subdir + "/" + dir;
-    MKDIR(subdir.c_str());
-  }
-
-  package_dir_ = subdir;
-}
-
-/**
- * Packages the generated file
- *
- * @return String of the package, i.e. "package org.apache.thriftdemo;"
- */
-string t_java_generator::java_package() {
-  if (!package_name_.empty()) {
-    return string("package ") + package_name_ + ";\n\n";
-  }
-  return "";
-}
-
-/**
- * Prints standard java imports
- *
- * @return List of imports for Java types that are used in here
- */
-string t_java_generator::java_type_imports() {
-  string hash_builder;
-  string tree_set_and_map;
-  string annotation_generated;
-
-  string option;
-  if (sorted_containers_) {
-    tree_set_and_map = string() + "import java.util.TreeSet;\n" + "import java.util.TreeMap;\n";
-  }
-
-  if (use_option_type_) {
-    option = string() + "import org.apache.thrift.Option;\n";
-  }
-
-  // android does not support @Generated Annotation
-  if (!suppress_generated_annotations_) {
-    annotation_generated = string() + "import javax.annotation.Generated;\n";
-  }
-
-  return string() + hash_builder + "import org.apache.thrift.scheme.IScheme;\n"
-         + "import org.apache.thrift.scheme.SchemeFactory;\n"
-         + "import org.apache.thrift.scheme.StandardScheme;\n\n"
-         + "import org.apache.thrift.scheme.TupleScheme;\n"
-         + "import org.apache.thrift.protocol.TTupleProtocol;\n"
-         + "import org.apache.thrift.protocol.TProtocolException;\n"
-         + "import org.apache.thrift.EncodingUtils;\n"
-         + option
-         + "import org.apache.thrift.TException;\n"
-         + "import org.apache.thrift.async.AsyncMethodCallback;\n"
-         + "import org.apache.thrift.server.AbstractNonblockingServer.*;\n"
-         + "import java.util.List;\n" + "import java.util.ArrayList;\n" + "import java.util.Map;\n"
-         + "import java.util.HashMap;\n" + "import java.util.EnumMap;\n" + "import java.util.Set;\n"
-         + "import java.util.HashSet;\n" + "import java.util.EnumSet;\n" + tree_set_and_map
-         + "import java.util.Collections;\n" + "import java.util.BitSet;\n"
-         + "import java.nio.ByteBuffer;\n"
-         + "import java.util.Arrays;\n" + annotation_generated
-         + "import org.slf4j.Logger;\n" + "import org.slf4j.LoggerFactory;\n\n";
-}
-
-string t_java_generator::java_suppressions() {
-  return "@SuppressWarnings({\"cast\", \"rawtypes\", \"serial\", \"unchecked\"})\n";
-}
-
-/**
- * Nothing in Java
- */
-void t_java_generator::close_generator() {
-}
-
-/**
- * Generates a typedef. This is not done in Java, since it does
- * not support arbitrary name replacements, and it'd be a wacky waste
- * of overhead to make wrapper classes.
- *
- * @param ttypedef The type definition
- */
-void t_java_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Enums are a class with a set of static constants.
- *
- * @param tenum The enumeration
- */
-void t_java_generator::generate_enum(t_enum* tenum) {
-  // Make output file
-  string f_enum_name = package_dir_ + "/" + make_valid_java_filename(tenum->get_name()) + ".java";
-  ofstream f_enum;
-  f_enum.open(f_enum_name.c_str());
-
-  // Comment and package it
-  f_enum << autogen_comment() << java_package() << endl;
-
-  // Add java imports
-  f_enum << string() + "import java.util.Map;\n" + "import java.util.HashMap;\n"
-            + "import org.apache.thrift.TEnum;" << endl << endl;
-
-  generate_java_doc(f_enum, tenum);
-  indent(f_enum) << "public enum " << tenum->get_name() << " implements org.apache.thrift.TEnum ";
-  scope_up(f_enum);
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  bool first = true;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-
-    if (first) {
-      first = false;
-    } else {
-      f_enum << "," << endl;
-    }
-
-    generate_java_doc(f_enum, *c_iter);
-    indent(f_enum) << (*c_iter)->get_name() << "(" << value << ")";
-  }
-  f_enum << ";" << endl << endl;
-
-  // Field for thriftCode
-  indent(f_enum) << "private final int value;" << endl << endl;
-
-  indent(f_enum) << "private " << tenum->get_name() << "(int value) {" << endl;
-  indent(f_enum) << "  this.value = value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
-
-  indent(f_enum) << "/**" << endl;
-  indent(f_enum) << " * Get the integer value of this enum value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public int getValue() {" << endl;
-  indent(f_enum) << "  return value;" << endl;
-  indent(f_enum) << "}" << endl << endl;
-
-  indent(f_enum) << "/**" << endl;
-  indent(f_enum) << " * Find a the enum type by its integer value, as defined in the Thrift IDL."
-                 << endl;
-  indent(f_enum) << " * @return null if the value is not found." << endl;
-  indent(f_enum) << " */" << endl;
-  indent(f_enum) << "public static " + tenum->get_name() + " findByValue(int value) { " << endl;
-
-  indent_up();
-
-  indent(f_enum) << "switch (value) {" << endl;
-  indent_up();
-
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    indent(f_enum) << "case " << value << ":" << endl;
-    indent(f_enum) << "  return " << (*c_iter)->get_name() << ";" << endl;
-  }
-
-  indent(f_enum) << "default:" << endl;
-  indent(f_enum) << "  return null;" << endl;
-
-  indent_down();
-
-  indent(f_enum) << "}" << endl;
-
-  indent_down();
-
-  indent(f_enum) << "}" << endl;
-
-  scope_down(f_enum);
-
-  f_enum.close();
-}
-
-/**
- * Generates a class that holds all the constants.
- */
-void t_java_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-
-  string f_consts_name = package_dir_ + '/' + make_valid_java_filename(program_name_)
-                         + "Constants.java";
-  ofstream f_consts;
-  f_consts.open(f_consts_name.c_str());
-
-  // Print header
-  f_consts << autogen_comment() << java_package() << java_type_imports() << java_suppressions();
-
-  f_consts << "public class " << make_valid_java_identifier(program_name_) << "Constants {" << endl
-           << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    generate_java_doc(f_consts, (*c_iter));
-    print_const_value(f_consts,
-                      (*c_iter)->get_name(),
-                      (*c_iter)->get_type(),
-                      (*c_iter)->get_value(),
-                      false);
-  }
-  indent_down();
-  indent(f_consts) << "}" << endl;
-  f_consts.close();
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-void t_java_generator::print_const_value(std::ofstream& out,
-                                         string name,
-                                         t_type* type,
-                                         t_const_value* value,
-                                         bool in_static,
-                                         bool defval) {
-  type = get_true_type(type);
-
-  indent(out);
-  if (!defval) {
-    out << (in_static ? "" : "public static final ") << type_name(type) << " ";
-  }
-  if (type->is_base_type()) {
-    string v2 = render_const_value(out, type, value);
-    out << name << " = " << v2 << ";" << endl << endl;
-  } else if (type->is_enum()) {
-    out << name << " = " << render_const_value(out, type, value) << ";" << endl << endl;
-  } else if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(out, field_type, v_iter->second);
-      indent(out) << name << ".";
-      std::string cap_name = get_cap_name(v_iter->first->get_string());
-      out << "set" << cap_name << "(" << val << ");" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_map()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(out, ktype, v_iter->first);
-      string val = render_const_value(out, vtype, v_iter->second);
-      indent(out) << name << ".put(" << key << ", " << val << ");" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else if (type->is_list() || type->is_set()) {
-    out << name << " = new " << type_name(type, false, true) << "();" << endl;
-    if (!in_static) {
-      indent(out) << "static {" << endl;
-      indent_up();
-    }
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(out, etype, *v_iter);
-      indent(out) << name << ".add(" << val << ");" << endl;
-    }
-    if (!in_static) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-    out << endl;
-  } else {
-    throw "compiler error: no const of type " + type->get_name();
-  }
-}
-
-string t_java_generator::render_const_value(ofstream& out, t_type* type, t_const_value* value) {
-  type = get_true_type(type);
-  std::ostringstream render;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-      render << "(byte)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I16:
-      render << "(short)" << value->get_integer();
-      break;
-    case t_base_type::TYPE_I32:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      render << value->get_integer() << "L";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << "(double)" << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    std::string namespace_prefix = type->get_program()->get_namespace("java");
-    if (namespace_prefix.length() > 0) {
-      namespace_prefix += ".";
-    }
-    render << namespace_prefix << value->get_identifier_with_parent();
-  } else {
-    string t = tmp("tmp");
-    print_const_value(out, t, type, value, true);
-    render << t;
-  }
-
-  return render.str();
-}
-
-/**
- * Generates a struct definition for a thrift data type. This will be a org.apache.thrift.TBase
- * implementor.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_struct(t_struct* tstruct) {
-  if (tstruct->is_union()) {
-    generate_java_union(tstruct);
-  } else {
-    generate_java_struct(tstruct, false);
-  }
-}
-
-/**
- * Exceptions are structs, but they inherit from Exception
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_xception(t_struct* txception) {
-  generate_java_struct(txception, true);
-}
-
-/**
- * Java struct definition.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_struct(t_struct* tstruct, bool is_exception) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name())
-                         + ".java";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << java_package() << java_type_imports() << java_suppressions();
-
-  generate_java_struct_definition(f_struct, tstruct, is_exception);
-  f_struct.close();
-}
-
-/**
- * Java union definition.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_union(t_struct* tstruct) {
-  // Make output file
-  string f_struct_name = package_dir_ + "/" + make_valid_java_filename(tstruct->get_name())
-                         + ".java";
-  ofstream f_struct;
-  f_struct.open(f_struct_name.c_str());
-
-  f_struct << autogen_comment() << java_package() << java_type_imports() << java_suppressions();
-
-  generate_java_doc(f_struct, tstruct);
-
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  indent(f_struct) << "public " << (is_final ? "final " : "") << "class " << tstruct->get_name()
-                   << " extends org.apache.thrift.TUnion<" << tstruct->get_name() << ", "
-                   << tstruct->get_name() << "._Fields> ";
-
-  scope_up(f_struct);
-
-  generate_struct_desc(f_struct, tstruct);
-  generate_field_descs(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_field_name_constants(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_java_meta_data_map(f_struct, tstruct);
-
-  generate_union_constructor(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_abstract_methods(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_java_struct_field_by_id(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_getters_and_setters(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_is_set_methods(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_comparisons(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_union_hashcode(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_java_struct_write_object(f_struct, tstruct);
-
-  f_struct << endl;
-
-  generate_java_struct_read_object(f_struct, tstruct);
-
-  f_struct << endl;
-
-  scope_down(f_struct);
-
-  f_struct.close();
-}
-
-void t_java_generator::generate_union_constructor(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  indent(out) << "public " << type_name(tstruct) << "() {" << endl;
-  indent_up();
-  bool default_value = false;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* type = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL) {
-      indent(out) << "super(_Fields." << constant_name((*m_iter)->get_name()) << ", "
-                  << render_const_value(out, type, (*m_iter)->get_value()) << ");" << endl;
-      default_value = true;
-      break;
-    }
-  }
-  if (default_value == false) {
-    indent(out) << "super();" << endl;
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "public " << type_name(tstruct) << "(_Fields setField, Object value) {" << endl;
-  indent(out) << "  super(setField, value);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "public " << type_name(tstruct) << "(" << type_name(tstruct) << " other) {"
-              << endl;
-  indent(out) << "  super(other);" << endl;
-  indent(out) << "}" << endl;
-
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  // generate "constructors" for each field
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* type = (*m_iter)->get_type();
-    indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name() << "("
-                << type_name(type) << " value) {" << endl;
-    indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();" << endl;
-    indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name()) << "(value);" << endl;
-    indent(out) << "  return x;" << endl;
-    indent(out) << "}" << endl << endl;
-
-    if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-      indent(out) << "public static " << type_name(tstruct) << " " << (*m_iter)->get_name()
-                  << "(byte[] value) {" << endl;
-      indent(out) << "  " << type_name(tstruct) << " x = new " << type_name(tstruct) << "();"
-                  << endl;
-      indent(out) << "  x.set" << get_cap_name((*m_iter)->get_name())
-                  << "(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));" << endl;
-      indent(out) << "  return x;" << endl;
-      indent(out) << "}" << endl << endl;
-    }
-  }
-}
-
-void t_java_generator::generate_union_getters_and_setters(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  bool first = true;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (first) {
-      first = false;
-    } else {
-      out << endl;
-    }
-
-    t_field* field = (*m_iter);
-    t_type* type = field->get_type();
-    std::string cap_name = get_cap_name(field->get_name());
-
-    generate_java_doc(out, field);
-    if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-      indent(out) << "public byte[] get" << cap_name << "() {" << endl;
-      indent(out) << "  set" << cap_name << "(org.apache.thrift.TBaseHelper.rightSize(buffer"
-                  << get_cap_name("for") << cap_name << "()));" << endl;
-      indent(out) << "  ByteBuffer b = buffer" << get_cap_name("for") << cap_name << "();" << endl;
-      indent(out) << "  return b == null ? null : b.array();" << endl;
-      indent(out) << "}" << endl;
-
-      out << endl;
-
-      indent(out) << "public ByteBuffer buffer" << get_cap_name("for")
-                  << get_cap_name(field->get_name()) << "() {" << endl;
-      indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                  << endl;
-      indent(out)
-          << "    return org.apache.thrift.TBaseHelper.copyBinary((ByteBuffer)getFieldValue());"
-          << endl;
-      indent(out) << "  } else {" << endl;
-      indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
-                  << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                  << endl;
-      indent(out) << "  }" << endl;
-      indent(out) << "}" << endl;
-    } else {
-      indent(out) << "public " << type_name(field->get_type()) << " get"
-                  << get_cap_name(field->get_name()) << "() {" << endl;
-      indent(out) << "  if (getSetField() == _Fields." << constant_name(field->get_name()) << ") {"
-                  << endl;
-      indent(out) << "    return (" << type_name(field->get_type(), true) << ")getFieldValue();"
-                  << endl;
-      indent(out) << "  } else {" << endl;
-      indent(out) << "    throw new RuntimeException(\"Cannot get field '" << field->get_name()
-                  << "' because union is currently set to \" + getFieldDesc(getSetField()).name);"
-                  << endl;
-      indent(out) << "  }" << endl;
-      indent(out) << "}" << endl;
-    }
-
-    out << endl;
-
-    generate_java_doc(out, field);
-    if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-      indent(out) << "public void set" << get_cap_name(field->get_name()) << "(byte[] value) {"
-                  << endl;
-      indent(out) << "  set" << get_cap_name(field->get_name())
-                  << "(ByteBuffer.wrap(Arrays.copyOf(value, value.length)));" << endl;
-      indent(out) << "}" << endl;
-
-      out << endl;
-    }
-    indent(out) << "public void set" << get_cap_name(field->get_name()) << "("
-                << type_name(field->get_type()) << " value) {" << endl;
-    if (type_can_be_null(field->get_type())) {
-      indent(out) << "  if (value == null) throw new NullPointerException();" << endl;
-    }
-    indent(out) << "  setField_ = _Fields." << constant_name(field->get_name()) << ";" << endl;
-    indent(out) << "  value_ = value;" << endl;
-    indent(out) << "}" << endl;
-  }
-}
-
-void t_java_generator::generate_union_is_set_methods(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  bool first = true;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (first) {
-      first = false;
-    } else {
-      out << endl;
-    }
-
-    std::string field_name = (*m_iter)->get_name();
-
-    indent(out) << "public boolean is" << get_cap_name("set") << get_cap_name(field_name) << "() {"
-                << endl;
-    indent_up();
-    indent(out) << "return setField_ == _Fields." << constant_name(field_name) << ";" << endl;
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-}
-
-void t_java_generator::generate_union_abstract_methods(ofstream& out, t_struct* tstruct) {
-  generate_check_type(out, tstruct);
-  out << endl;
-  generate_standard_scheme_read_value(out, tstruct);
-  out << endl;
-  generate_standard_scheme_write_value(out, tstruct);
-  out << endl;
-  generate_tuple_scheme_read_value(out, tstruct);
-  out << endl;
-  generate_tuple_scheme_write_value(out, tstruct);
-  out << endl;
-  generate_get_field_desc(out, tstruct);
-  out << endl;
-  generate_get_struct_desc(out, tstruct);
-  out << endl;
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected _Fields enumForId(short id) {" << endl;
-  indent(out) << "  return _Fields.findByThriftIdOrThrow(id);" << endl;
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_check_type(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out)
-      << "protected void checkType(_Fields setField, Object value) throws ClassCastException {"
-      << endl;
-  indent_up();
-
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  if (value instanceof " << type_name(field->get_type(), true, false, true)
-                << ") {" << endl;
-    indent(out) << "    break;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "  throw new ClassCastException(\"Was expecting value of type "
-                << type_name(field->get_type(), true, false) << " for field '" << field->get_name()
-                << "', but got \" + value.getClass().getSimpleName());" << endl;
-    // do the real check here
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_standard_scheme_read_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected Object standardSchemeReadValue(org.apache.thrift.protocol.TProtocol "
-                 "iprot, org.apache.thrift.protocol.TField field) throws "
-                 "org.apache.thrift.TException {" << endl;
-
-  indent_up();
-
-  indent(out) << "_Fields setField = _Fields.findByThriftId(field.id);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
-  indent_up();
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << "if (field.type == " << constant_name(field->get_name()) << "_FIELD_DESC.type) {"
-                << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
-    generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
-    indent_down();
-    indent(out) << "} else {" << endl;
-    indent(out) << "  org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << endl;
-    indent(out) << "  return null;" << endl;
-    indent(out) << "}" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "} else {" << endl;
-  indent_up();
-  indent(out) << "org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type);" << endl;
-  indent(out) << "return null;" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_standard_scheme_write_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected void standardSchemeWriteValue(org.apache.thrift.protocol.TProtocol "
-                 "oprot) throws org.apache.thrift.TException {" << endl;
-
-  indent_up();
-
-  indent(out) << "switch (setField_) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
-    generate_serialize_field(out, field, "");
-    indent(out) << "return;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_tuple_scheme_read_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected Object tupleSchemeReadValue(org.apache.thrift.protocol.TProtocol "
-                 "iprot, short fieldID) throws org.apache.thrift.TException {" << endl;
-
-  indent_up();
-
-  indent(out) << "_Fields setField = _Fields.findByThriftId(fieldID);" << endl;
-  indent(out) << "if (setField != null) {" << endl;
-  indent_up();
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << ";"
-                << endl;
-    generate_deserialize_field(out, field, "");
-    indent(out) << "return " << field->get_name() << ";" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"setField wasn't null, but didn't match any "
-                 "of the case statements!\");" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "} else {" << endl;
-  indent_up();
-  indent(out) << "throw new TProtocolException(\"Couldn't find a field with field id \" + fieldID);"
-              << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_tuple_scheme_write_value(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected void tupleSchemeWriteValue(org.apache.thrift.protocol.TProtocol oprot) "
-                 "throws org.apache.thrift.TException {" << endl;
-
-  indent_up();
-
-  indent(out) << "switch (setField_) {" << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << type_name(field->get_type(), true, false) << " " << field->get_name() << " = ("
-                << type_name(field->get_type(), true, false) << ")value_;" << endl;
-    generate_serialize_field(out, field, "");
-    indent(out) << "return;" << endl;
-    indent_down();
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalStateException(\"Cannot write union with unknown field \" + "
-                 "setField_);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_get_field_desc(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected org.apache.thrift.protocol.TField getFieldDesc(_Fields setField) {"
-              << endl;
-  indent_up();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  indent(out) << "switch (setField) {" << endl;
-  indent_up();
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent(out) << "  return " << constant_name(field->get_name()) << "_FIELD_DESC;" << endl;
-  }
-
-  indent(out) << "default:" << endl;
-  indent(out) << "  throw new IllegalArgumentException(\"Unknown field id \" + setField);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_get_struct_desc(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "@Override" << endl;
-  indent(out) << "protected org.apache.thrift.protocol.TStruct getStructDesc() {" << endl;
-  indent(out) << "  return STRUCT_DESC;" << endl;
-  indent(out) << "}" << endl;
-}
-
-void t_java_generator::generate_union_comparisons(ofstream& out, t_struct* tstruct) {
-  // equality
-  indent(out) << "public boolean equals(Object other) {" << endl;
-  indent(out) << "  if (other instanceof " << tstruct->get_name() << ") {" << endl;
-  indent(out) << "    return equals((" << tstruct->get_name() << ")other);" << endl;
-  indent(out) << "  } else {" << endl;
-  indent(out) << "    return false;" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl;
-
-  out << endl;
-
-  indent(out) << "public boolean equals(" << tstruct->get_name() << " other) {" << endl;
-  indent(out) << "  return other != null && getSetField() == other.getSetField() && "
-                 "getFieldValue().equals(other.getFieldValue());" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-
-  indent(out) << "@Override" << endl;
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
-  indent(out) << "  int lastComparison = org.apache.thrift.TBaseHelper.compareTo(getSetField(), "
-                 "other.getSetField());" << endl;
-  indent(out) << "  if (lastComparison == 0) {" << endl;
-  indent(out) << "    return org.apache.thrift.TBaseHelper.compareTo(getFieldValue(), "
-                 "other.getFieldValue());" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return lastComparison;" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-}
-
-void t_java_generator::generate_union_hashcode(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "@Override" << endl;
-  indent(out) << "public int hashCode() {" << endl;
-  indent(out) << "  List<Object> list = new ArrayList<Object>();" << endl;
-  indent(out) << "  list.add(this.getClass().getName());" << endl;
-  indent(out) << "  org.apache.thrift.TFieldIdEnum setField = getSetField();" << endl;
-  indent(out) << "  if (setField != null) {" << endl;
-  indent(out) << "    list.add(setField.getThriftFieldId());" << endl;
-  indent(out) << "    Object value = getFieldValue();" << endl;
-  indent(out) << "    if (value instanceof org.apache.thrift.TEnum) {" << endl;
-  indent(out) << "      list.add(((org.apache.thrift.TEnum)getFieldValue()).getValue());" << endl;
-  indent(out) << "    } else {" << endl;
-  indent(out) << "      list.add(value);" << endl;
-  indent(out) << "    }" << endl;
-  indent(out) << "  }" << endl;
-  indent(out) << "  return list.hashCode();" << endl;
-  indent(out) << "}";
-}
-
-/**
- * Java struct definition. This has various parameters, as it could be
- * generated standalone or inside another class as a helper. If it
- * is a helper than it is a static class.
- *
- * @param tstruct      The struct definition
- * @param is_exception Is this an exception?
- * @param in_class     If inside a class, needs to be static class
- * @param is_result    If this is a result it needs a different writer
- */
-void t_java_generator::generate_java_struct_definition(ofstream& out,
-                                                       t_struct* tstruct,
-                                                       bool is_exception,
-                                                       bool in_class,
-                                                       bool is_result) {
-  generate_java_doc(out, tstruct);
-
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-
-  if (!in_class && !suppress_generated_annotations_) {
-    generate_javax_generated_annotation(out);
-  }
-
-  indent(out) << "public " << (is_final ? "final " : "") << (in_class ? "static " : "") << "class "
-              << tstruct->get_name() << " ";
-
-  if (is_exception) {
-    out << "extends TException ";
-  }
-  out << "implements org.apache.thrift.TBase<" << tstruct->get_name() << ", " << tstruct->get_name()
-      << "._Fields>, java.io.Serializable, Cloneable, Comparable<" << tstruct->get_name() << ">";
-
-  if (android_style_) {
-    out << ", android.os.Parcelable";
-  }
-
-  out << " ";
-
-  scope_up(out);
-
-  generate_struct_desc(out, tstruct);
-
-  // Members are public for -java, private for -javabean
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  out << endl;
-
-  generate_field_descs(out, tstruct);
-
-  out << endl;
-
-  generate_scheme_map(out, tstruct);
-
-  out << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    if (bean_style_ || private_members_) {
-      indent(out) << "private ";
-    } else {
-      generate_java_doc(out, *m_iter);
-      indent(out) << "public ";
-    }
-    out << declare_field(*m_iter, false, true) << endl;
-  }
-
-  out << endl;
-
-  if (android_style_) {
-    generate_java_struct_parcelable(out, tstruct);
-  }
-
-  generate_field_name_constants(out, tstruct);
-
-  // isset data
-  if (members.size() > 0) {
-    out << endl;
-
-    indent(out) << "// isset id assignments" << endl;
-
-    int i = 0;
-    int optionals = 0;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() == t_field::T_OPTIONAL) {
-        optionals++;
-      }
-      if (!type_can_be_null((*m_iter)->get_type())) {
-        indent(out) << "private static final int " << isset_field_id(*m_iter) << " = " << i << ";"
-                    << endl;
-        i++;
-      }
-    }
-
-    std::string primitiveType;
-    switch (needs_isset(tstruct, &primitiveType)) {
-    case ISSET_NONE:
-      break;
-    case ISSET_PRIMITIVE:
-      indent(out) << "private " << primitiveType << " __isset_bitfield = 0;" << endl;
-      break;
-    case ISSET_BITSET:
-      indent(out) << "private BitSet __isset_bit_vector = new BitSet(" << i << ");" << endl;
-      break;
-    }
-
-    if (optionals > 0) {
-      std::string output_string = "private static final _Fields optionals[] = {";
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        if ((*m_iter)->get_req() == t_field::T_OPTIONAL) {
-          output_string = output_string + "_Fields." + constant_name((*m_iter)->get_name()) + ",";
-        }
-      }
-      indent(out) << output_string.substr(0, output_string.length() - 1) << "};" << endl;
-    }
-  }
-
-  generate_java_meta_data_map(out, tstruct);
-
-  bool all_optional_members = true;
-
-  // Default constructor
-  indent(out) << "public " << tstruct->get_name() << "() {" << endl;
-  indent_up();
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    if ((*m_iter)->get_value() != NULL) {
-      print_const_value(out,
-                        "this." + (*m_iter)->get_name(),
-                        t,
-                        (*m_iter)->get_value(),
-                        true,
-                        true);
-    }
-    if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-      all_optional_members = false;
-    }
-  }
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  if (!members.empty() && !all_optional_members) {
-    // Full constructor for all fields
-    indent(out) << "public " << tstruct->get_name() << "(" << endl;
-    indent_up();
-    bool first = true;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-        if (!first) {
-          out << "," << endl;
-        }
-        first = false;
-        indent(out) << type_name((*m_iter)->get_type()) << " " << (*m_iter)->get_name();
-      }
-    }
-    out << ")" << endl;
-    indent_down();
-    indent(out) << "{" << endl;
-    indent_up();
-    indent(out) << "this();" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_OPTIONAL) {
-        t_type* type = get_true_type((*m_iter)->get_type());
-        if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-          indent(out) << "this." << (*m_iter)->get_name()
-                      << " = org.apache.thrift.TBaseHelper.copyBinary(" << (*m_iter)->get_name()
-                      << ");" << endl;
-        } else {
-          indent(out) << "this." << (*m_iter)->get_name() << " = " << (*m_iter)->get_name() << ";"
-                      << endl;
-        }
-        generate_isset_set(out, (*m_iter), "");
-      }
-    }
-
-    indent_down();
-    indent(out) << "}" << endl << endl;
-  }
-
-  // copy constructor
-  indent(out) << "/**" << endl;
-  indent(out) << " * Performs a deep copy on <i>other</i>." << endl;
-  indent(out) << " */" << endl;
-  indent(out) << "public " << tstruct->get_name() << "(" << tstruct->get_name() << " other) {"
-              << endl;
-  indent_up();
-
-  switch (needs_isset(tstruct)) {
-  case ISSET_NONE:
-    break;
-  case ISSET_PRIMITIVE:
-    indent(out) << "__isset_bitfield = other.__isset_bitfield;" << endl;
-    break;
-  case ISSET_BITSET:
-    indent(out) << "__isset_bit_vector.clear();" << endl;
-    indent(out) << "__isset_bit_vector.or(other.__isset_bit_vector);" << endl;
-    break;
-  }
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = (*m_iter);
-    std::string field_name = field->get_name();
-    t_type* type = field->get_type();
-    bool can_be_null = type_can_be_null(type);
-
-    if (can_be_null) {
-      indent(out) << "if (other." << generate_isset_check(field) << ") {" << endl;
-      indent_up();
-    }
-
-    if (type->is_container()) {
-      generate_deep_copy_container(out, "other", field_name, "__this__" + field_name, type);
-      indent(out) << "this." << field_name << " = __this__" << field_name << ";" << endl;
-    } else {
-      indent(out) << "this." << field_name << " = ";
-      generate_deep_copy_non_container(out, "other." + field_name, field_name, type);
-      out << ";" << endl;
-    }
-
-    if (can_be_null) {
-      indent_down();
-      indent(out) << "}" << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-
-  // clone method, so that you can deep copy an object when you don't know its class.
-  indent(out) << "public " << tstruct->get_name() << " deepCopy() {" << endl;
-  indent(out) << "  return new " << tstruct->get_name() << "(this);" << endl;
-  indent(out) << "}" << endl << endl;
-
-  generate_java_struct_clear(out, tstruct);
-
-  generate_java_bean_boilerplate(out, tstruct);
-  generate_generic_field_getters_setters(out, tstruct);
-  generate_generic_isset_method(out, tstruct);
-
-  generate_java_struct_equality(out, tstruct);
-  generate_java_struct_compare_to(out, tstruct);
-  generate_java_struct_field_by_id(out, tstruct);
-
-  generate_java_struct_reader(out, tstruct);
-  if (is_result) {
-    generate_java_struct_result_writer(out, tstruct);
-  } else {
-    generate_java_struct_writer(out, tstruct);
-  }
-  generate_java_struct_tostring(out, tstruct);
-  generate_java_validator(out, tstruct);
-
-  generate_java_struct_write_object(out, tstruct);
-  generate_java_struct_read_object(out, tstruct);
-
-  generate_java_struct_standard_scheme(out, tstruct, is_result);
-  generate_java_struct_tuple_scheme(out, tstruct);
-
-  scope_down(out);
-  out << endl;
-}
-
-/**
- * generates parcelable interface implementation
- */
-void t_java_generator::generate_java_struct_parcelable(ofstream& out, t_struct* tstruct) {
-  string tname = tstruct->get_name();
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  out << indent() << "@Override" << endl << indent()
-      << "public void writeToParcel(android.os.Parcel out, int flags) {" << endl;
-  indent_up();
-  string bitsetPrimitiveType = "";
-  switch (needs_isset(tstruct, &bitsetPrimitiveType)) {
-  case ISSET_NONE:
-    break;
-  case ISSET_PRIMITIVE:
-    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << endl;
-    if (bitsetPrimitiveType == "byte") {
-      indent(out) << "out.writeByte(__isset_bitfield);" << endl;
-    } else if (bitsetPrimitiveType == "short") {
-      indent(out) << "out.writeInt(new Short(__isset_bitfield).intValue());" << endl;
-    } else if (bitsetPrimitiveType == "int") {
-      indent(out) << "out.writeInt(__isset_bitfield);" << endl;
-    } else if (bitsetPrimitiveType == "long") {
-      indent(out) << "out.writeLong(__isset_bitfield);" << endl;
-    }
-    out << endl;
-    break;
-  case ISSET_BITSET:
-    indent(out) << "//BitSet" << endl;
-    indent(out) << "out.writeSerializable(__isset_bit_vector);" << endl;
-    out << endl;
-    break;
-  }
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    string name = (*m_iter)->get_name();
-
-    if (t->is_struct()) {
-      indent(out) << "out.writeParcelable(" << name << ", flags);" << endl;
-    } else if (type_name(t) == "float") {
-      indent(out) << "out.writeFloat(" << name << ");" << endl;
-    } else if (t->is_enum()) {
-      indent(out) << "out.writeInt(" << name << ".getValue());" << endl;
-    } else if (t->is_list()) {
-      if (((t_list*)t)->get_elem_type()->get_true_type()->is_struct()) {
-        indent(out) << "out.writeTypedList(" << name << ");" << endl;
-      } else {
-        indent(out) << "out.writeList(" << name << ");" << endl;
-      }
-    } else if (t->is_map()) {
-      indent(out) << "out.writeMap(" << name << ");" << endl;
-    } else if (t->is_base_type()) {
-      if (((t_base_type*)t)->is_binary()) {
-        indent(out) << "out.writeInt(" << name << "!=null ? 1 : 0);" << endl;
-        indent(out) << "if(" << name << " != null) { " << endl;
-        indent_up();
-        indent(out) << "out.writeByteArray(" << name << ".array(), " << name << ".position() + "
-                    << name << ".arrayOffset(), " << name << ".limit() - " << name
-                    << ".position() );" << endl;
-        scope_down(out);
-      } else {
-        switch (((t_base_type*)t)->get_base()) {
-        case t_base_type::TYPE_I16:
-          indent(out) << "out.writeInt(new Short(" << name << ").intValue());" << endl;
-          break;
-        case t_base_type::TYPE_I32:
-          indent(out) << "out.writeInt(" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_I64:
-          indent(out) << "out.writeLong(" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_BOOL:
-          indent(out) << "out.writeInt(" << name << " ? 1 : 0);" << endl;
-          break;
-        case t_base_type::TYPE_BYTE:
-          indent(out) << "out.writeByte(" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_DOUBLE:
-          indent(out) << "out.writeDouble(" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_STRING:
-          indent(out) << "out.writeString(" << name << ");" << endl;
-          break;
-        case t_base_type::TYPE_VOID:
-          break;
-        }
-      }
-    }
-  }
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "@Override" << endl << indent() << "public int describeContents() {" << endl;
-  indent_up();
-  out << indent() << "return 0;" << endl;
-  scope_down(out);
-  out << endl;
-
-  indent(out) << "public " << tname << "(android.os.Parcel in) {" << endl;
-  indent_up();
-  // read in the required bitfield
-  switch (needs_isset(tstruct, &bitsetPrimitiveType)) {
-  case ISSET_NONE:
-    break;
-  case ISSET_PRIMITIVE:
-    indent(out) << "//primitive bitfield of type: " << bitsetPrimitiveType << endl;
-    if (bitsetPrimitiveType == "byte") {
-      indent(out) << "__isset_bitfield = in.readByte();" << endl;
-    } else if (bitsetPrimitiveType == "short") {
-      indent(out) << "__isset_bitfield = (short) in.readInt();" << endl;
-    } else if (bitsetPrimitiveType == "int") {
-      indent(out) << "__isset_bitfield = in.readInt();" << endl;
-    } else if (bitsetPrimitiveType == "long") {
-      indent(out) << "__isset_bitfield = in.readLong();" << endl;
-    }
-    out << endl;
-    break;
-  case ISSET_BITSET:
-    indent(out) << "//BitSet" << endl;
-    indent(out) << "__isset_bit_vector = (BitSet) in.readSerializable();" << endl;
-    out << endl;
-    break;
-  }
-  // read all the fields
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = get_true_type((*m_iter)->get_type());
-    string name = (*m_iter)->get_name();
-    string prefix = "this." + name;
-
-    if (t->is_struct()) {
-      indent(out) << prefix << "= in.readParcelable(" << tname << ".class.getClassLoader());"
-                  << endl;
-    } else if (t->is_enum()) {
-      indent(out) << prefix << " = " << type_name(t) << ".findByValue(in.readInt());" << endl;
-    } else if (t->is_list()) {
-      t_list* list = (t_list*)t;
-      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << endl;
-      if (list->get_elem_type()->get_true_type()->is_struct()) {
-        indent(out) << "in.readTypedList(" << prefix << ", " << type_name(list->get_elem_type())
-                    << ".CREATOR);" << endl;
-      } else {
-        indent(out) << "in.readList(" << prefix << ", " << tname << ".class.getClassLoader());"
-                    << endl;
-      }
-    } else if (t->is_map()) {
-      indent(out) << prefix << " = new " << type_name(t, false, true) << "();" << endl;
-      indent(out) << " in.readMap(" << prefix << ", " << tname << ".class.getClassLoader());"
-                  << endl;
-    } else if (type_name(t) == "float") {
-      indent(out) << prefix << " = in.readFloat();" << endl;
-    } else if (t->is_base_type()) {
-      t_base_type* bt = (t_base_type*)t;
-      if (bt->is_binary()) {
-        indent(out) << "if(in.readInt()==1) {" << endl;
-        indent_up();
-        indent(out) << prefix << " = ByteBuffer.wrap(in.createByteArray());" << endl;
-        scope_down(out);
-      } else {
-        switch (bt->get_base()) {
-        case t_base_type::TYPE_I16:
-          indent(out) << prefix << " = (short) in.readInt();" << endl;
-          break;
-        case t_base_type::TYPE_I32:
-          indent(out) << prefix << " = in.readInt();" << endl;
-          break;
-        case t_base_type::TYPE_I64:
-          indent(out) << prefix << " = in.readLong();" << endl;
-          break;
-        case t_base_type::TYPE_BOOL:
-          indent(out) << prefix << " = (in.readInt()==1);" << endl;
-          break;
-        case t_base_type::TYPE_BYTE:
-          indent(out) << prefix << " = in.readByte();" << endl;
-          break;
-        case t_base_type::TYPE_DOUBLE:
-          indent(out) << prefix << " = in.readDouble();" << endl;
-          break;
-        case t_base_type::TYPE_STRING:
-          indent(out) << prefix << "= in.readString();" << endl;
-          break;
-        case t_base_type::TYPE_VOID:
-          break;
-        }
-      }
-    }
-  }
-
-  scope_down(out);
-  out << endl;
-
-  indent(out) << "public static final android.os.Parcelable.Creator<" << tname
-              << "> CREATOR = new android.os.Parcelable.Creator<" << tname << ">() {" << endl;
-  indent_up();
-
-  indent(out) << "@Override" << endl << indent() << "public " << tname << "[] newArray(int size) {"
-              << endl;
-  indent_up();
-  indent(out) << "return new " << tname << "[size];" << endl;
-  scope_down(out);
-  out << endl;
-
-  indent(out) << "@Override" << endl << indent() << "public " << tname
-              << " createFromParcel(android.os.Parcel in) {" << endl;
-  indent_up();
-  indent(out) << "return new " << tname << "(in);" << endl;
-  scope_down(out);
-
-  indent_down();
-  indent(out) << "};" << endl;
-  out << endl;
-}
-
-/**
- * Generates equals methods and a hashCode method for a structure.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_struct_equality(ofstream& out, t_struct* tstruct) {
-  out << indent() << "@Override" << endl << indent() << "public boolean equals(Object that) {"
-      << endl;
-  indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl
-      << indent() << "if (that instanceof " << tstruct->get_name() << ")" << endl << indent()
-      << "  return this.equals((" << tstruct->get_name() << ")that);" << endl << indent()
-      << "return false;" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "public boolean equals(" << tstruct->get_name() << " that) {" << endl;
-  indent_up();
-  out << indent() << "if (that == null)" << endl << indent() << "  return false;" << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
-
-    t_type* t = get_true_type((*m_iter)->get_type());
-    // Most existing Thrift code does not use isset or optional/required,
-    // so we treat "default" fields as required.
-    bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
-    bool can_be_null = type_can_be_null(t);
-    string name = (*m_iter)->get_name();
-
-    string this_present = "true";
-    string that_present = "true";
-    string unequal;
-
-    if (is_optional || can_be_null) {
-      this_present += " && this." + generate_isset_check(*m_iter);
-      that_present += " && that." + generate_isset_check(*m_iter);
-    }
-
-    out << indent() << "boolean this_present_" << name << " = " << this_present << ";" << endl
-        << indent() << "boolean that_present_" << name << " = " << that_present << ";" << endl
-        << indent() << "if ("
-        << "this_present_" << name << " || that_present_" << name << ") {" << endl;
-    indent_up();
-    out << indent() << "if (!("
-        << "this_present_" << name << " && that_present_" << name << "))" << endl << indent()
-        << "  return false;" << endl;
-
-    if (t->is_base_type() && ((t_base_type*)t)->is_binary()) {
-      unequal = "!this." + name + ".equals(that." + name + ")";
-    } else if (can_be_null) {
-      unequal = "!this." + name + ".equals(that." + name + ")";
-    } else {
-      unequal = "this." + name + " != that." + name;
-    }
-
-    out << indent() << "if (" << unequal << ")" << endl << indent() << "  return false;" << endl;
-
-    scope_down(out);
-  }
-  out << endl;
-  indent(out) << "return true;" << endl;
-  scope_down(out);
-  out << endl;
-
-  out << indent() << "@Override" << endl << indent() << "public int hashCode() {" << endl;
-  indent_up();
-  indent(out) << "List<Object> list = new ArrayList<Object>();" << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    out << endl;
-
-    t_type* t = get_true_type((*m_iter)->get_type());
-    bool is_optional = (*m_iter)->get_req() == t_field::T_OPTIONAL;
-    bool can_be_null = type_can_be_null(t);
-    string name = (*m_iter)->get_name();
-
-    string present = "true";
-
-    if (is_optional || can_be_null) {
-      present += " && (" + generate_isset_check(*m_iter) + ")";
-    }
-
-    indent(out) << "boolean present_" << name << " = " << present << ";" << endl;
-    indent(out) << "list.add(present_" << name << ");" << endl;
-    indent(out) << "if (present_" << name << ")" << endl;
-    if (t->is_enum()) {
-      indent(out) << "  list.add(" << name << ".getValue());" << endl;
-    } else {
-      indent(out) << "  list.add(" << name << ");" << endl;
-    }
-  }
-
-  out << endl;
-  indent(out) << "return list.hashCode();" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-void t_java_generator::generate_java_struct_compare_to(ofstream& out, t_struct* tstruct) {
-  indent(out) << "@Override" << endl;
-  indent(out) << "public int compareTo(" << type_name(tstruct) << " other) {" << endl;
-  indent_up();
-
-  indent(out) << "if (!getClass().equals(other.getClass())) {" << endl;
-  indent(out) << "  return getClass().getName().compareTo(other.getClass().getName());" << endl;
-  indent(out) << "}" << endl;
-  out << endl;
-
-  indent(out) << "int lastComparison = 0;" << endl;
-  out << endl;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_field* field = *m_iter;
-    indent(out) << "lastComparison = Boolean.valueOf(" << generate_isset_check(field)
-                << ").compareTo(other." << generate_isset_check(field) << ");" << endl;
-    indent(out) << "if (lastComparison != 0) {" << endl;
-    indent(out) << "  return lastComparison;" << endl;
-    indent(out) << "}" << endl;
-
-    indent(out) << "if (" << generate_isset_check(field) << ") {" << endl;
-    indent(out) << "  lastComparison = org.apache.thrift.TBaseHelper.compareTo(this."
-                << field->get_name() << ", other." << field->get_name() << ");" << endl;
-    indent(out) << "  if (lastComparison != 0) {" << endl;
-    indent(out) << "    return lastComparison;" << endl;
-    indent(out) << "  }" << endl;
-    indent(out) << "}" << endl;
-  }
-
-  indent(out) << "return 0;" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to read all the fields of the struct.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_struct_reader(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "public void read(org.apache.thrift.protocol.TProtocol iprot) throws "
-                 "org.apache.thrift.TException {" << endl;
-  indent_up();
-  indent(out) << "schemes.get(iprot.getScheme()).getScheme().read(iprot, this);" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-// generates java method to perform various checks
-// (e.g. check that all required fields are set)
-void t_java_generator::generate_java_validator(ofstream& out, t_struct* tstruct) {
-  indent(out) << "public void validate() throws org.apache.thrift.TException {" << endl;
-  indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << indent() << "// check for required fields" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      if (bean_style_) {
-        out << indent() << "if (!" << generate_isset_check(*f_iter) << ") {" << endl << indent()
-            << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
-            << (*f_iter)->get_name() << "' is unset! Struct:\" + toString());" << endl << indent()
-            << "}" << endl << endl;
-      } else {
-        if (type_can_be_null((*f_iter)->get_type())) {
-          indent(out) << "if (" << (*f_iter)->get_name() << " == null) {" << endl;
-          indent(out)
-              << "  throw new org.apache.thrift.protocol.TProtocolException(\"Required field '"
-              << (*f_iter)->get_name() << "' was not present! Struct: \" + toString());" << endl;
-          indent(out) << "}" << endl;
-        } else {
-          indent(out) << "// alas, we cannot check '" << (*f_iter)->get_name()
-                      << "' because it's a primitive and you chose the non-beans generator."
-                      << endl;
-        }
-      }
-    }
-  }
-
-  out << indent() << "// check for sub-struct validity" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_type* type = (*f_iter)->get_type();
-    if (type->is_struct() && !((t_struct*)type)->is_union()) {
-      out << indent() << "if (" << (*f_iter)->get_name() << " != null) {" << endl;
-      out << indent() << "  " << (*f_iter)->get_name() << ".validate();" << endl;
-      out << indent() << "}" << endl;
-    }
-  }
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_struct_writer(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
-                 "org.apache.thrift.TException {" << endl;
-  indent_up();
-  indent(out) << "schemes.get(oprot.getScheme()).getScheme().write(oprot, this);" << endl;
-
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a function to write all the fields of the struct,
- * which is a function result. These fields are only written
- * if they are set in the Isset array, and only one of them
- * can be set at a time.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_struct_result_writer(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "public void write(org.apache.thrift.protocol.TProtocol oprot) throws "
-                 "org.apache.thrift.TException {" << endl;
-  indent_up();
-  indent(out) << "schemes.get(oprot.getScheme()).getScheme().write(oprot, this);" << endl;
-
-  indent_down();
-  indent(out) << "  }" << endl << endl;
-}
-
-void t_java_generator::generate_java_struct_field_by_id(ofstream& out, t_struct* tstruct) {
-  (void)tstruct;
-  indent(out) << "public _Fields fieldForId(int fieldId) {" << endl;
-  indent(out) << "  return _Fields.findByThriftId(fieldId);" << endl;
-  indent(out) << "}" << endl << endl;
-}
-
-void t_java_generator::generate_reflection_getters(ostringstream& out,
-                                                   t_type* type,
-                                                   string field_name,
-                                                   string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
-  indent_up();
-  indent(out) << "return " << (type->is_bool() ? "is" : "get") << cap_name << "();" << endl << endl;
-  indent_down();
-}
-
-void t_java_generator::generate_reflection_setters(ostringstream& out,
-                                                   t_type* type,
-                                                   string field_name,
-                                                   string cap_name) {
-  indent(out) << "case " << constant_name(field_name) << ":" << endl;
-  indent_up();
-  indent(out) << "if (value == null) {" << endl;
-  indent(out) << "  unset" << get_cap_name(field_name) << "();" << endl;
-  indent(out) << "} else {" << endl;
-  indent(out) << "  set" << cap_name << "((" << type_name(type, true, false) << ")value);" << endl;
-  indent(out) << "}" << endl;
-  indent(out) << "break;" << endl << endl;
-
-  indent_down();
-}
-
-void t_java_generator::generate_generic_field_getters_setters(std::ofstream& out,
-                                                              t_struct* tstruct) {
-  std::ostringstream getter_stream;
-  std::ostringstream setter_stream;
-
-  // build up the bodies of both the getter and setter at once
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-
-    indent_up();
-    generate_reflection_setters(setter_stream, type, field_name, cap_name);
-    generate_reflection_getters(getter_stream, type, field_name, cap_name);
-    indent_down();
-  }
-
-  // create the setter
-
-  indent(out) << "public void setFieldValue(_Fields field, Object value) {" << endl;
-  indent(out) << "  switch (field) {" << endl;
-  out << setter_stream.str();
-  indent(out) << "  }" << endl;
-  indent(out) << "}" << endl << endl;
-
-  // create the getter
-  indent(out) << "public Object getFieldValue(_Fields field) {" << endl;
-  indent_up();
-  indent(out) << "switch (field) {" << endl;
-  out << getter_stream.str();
-  indent(out) << "}" << endl;
-  indent(out) << "throw new IllegalStateException();" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-// Creates a generic isSet method that takes the field number as argument
-void t_java_generator::generate_generic_isset_method(std::ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // create the isSet method
-  indent(out) << "/** Returns true if field corresponding to fieldID is set (has been assigned a "
-                 "value) and false otherwise */" << endl;
-  indent(out) << "public boolean isSet(_Fields field) {" << endl;
-  indent_up();
-  indent(out) << "if (field == null) {" << endl;
-  indent(out) << "  throw new IllegalArgumentException();" << endl;
-  indent(out) << "}" << endl << endl;
-
-  indent(out) << "switch (field) {" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    indent(out) << "case " << constant_name(field->get_name()) << ":" << endl;
-    indent_up();
-    indent(out) << "return " << generate_isset_check(field) << ";" << endl;
-    indent_down();
-  }
-
-  indent(out) << "}" << endl;
-  indent(out) << "throw new IllegalStateException();" << endl;
-  indent_down();
-  indent(out) << "}" << endl << endl;
-}
-
-/**
- * Generates a set of Java Bean boilerplate functions (setters, getters, etc.)
- * for the given struct.
- *
- * @param tstruct The struct definition
- */
-void t_java_generator::generate_java_bean_boilerplate(ofstream& out, t_struct* tstruct) {
-  isset_type issetType = needs_isset(tstruct);
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = *f_iter;
-    t_type* type = get_true_type(field->get_type());
-    std::string field_name = field->get_name();
-    std::string cap_name = get_cap_name(field_name);
-    bool optional = use_option_type_ && field->get_req() == t_field::T_OPTIONAL;
-
-    if (type->is_container()) {
-      // Method to return the size of the collection
-      if (optional) {
-        indent(out) << "public Option<Integer> get" << cap_name;
-        out << get_cap_name("size() {") << endl;
-
-        indent_up();
-        indent(out) << "if (this." << field_name << " == null) {" << endl;
-        indent_up();
-        indent(out) << "return Option.none();" << endl;
-        indent_down();
-        indent(out) << "} else {" << endl;
-        indent_up();
-        indent(out) << "return Option.some(this." << field_name << ".size());" << endl;
-        indent_down();
-        indent(out) << "}" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      } else {
-        indent(out) << "public int get" << cap_name;
-        out << get_cap_name("size() {") << endl;
-
-        indent_up();
-        indent(out) << "return (this." << field_name << " == null) ? 0 : "
-                    << "this." << field_name << ".size();" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      }
-    }
-
-    if (type->is_set() || type->is_list()) {
-      t_type* element_type;
-      if (type->is_set()) {
-        element_type = ((t_set*)type)->get_elem_type();
-      } else {
-        element_type = ((t_list*)type)->get_elem_type();
-      }
-
-      // Iterator getter for sets and lists
-      if (optional) {
-        indent(out) << "public Option<java.util.Iterator<" << type_name(element_type, true, false)
-                    << ">> get" << cap_name;
-        out << get_cap_name("iterator() {") << endl;
-
-        indent_up();
-        indent(out) << "if (this." << field_name << " == null) {" << endl;
-        indent_up();
-        indent(out) << "return Option.none();" << endl;
-        indent_down();
-        indent(out) << "} else {" << endl;
-        indent_up();
-        indent(out) << "return Option.some(this." << field_name << ".iterator());" << endl;
-        indent_down();
-        indent(out) << "}" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      } else {
-        indent(out) << "public java.util.Iterator<" << type_name(element_type, true, false)
-                    << "> get" << cap_name;
-        out << get_cap_name("iterator() {") << endl;
-
-        indent_up();
-        indent(out) << "return (this." << field_name << " == null) ? null : "
-                    << "this." << field_name << ".iterator();" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      }
-
-      // Add to set or list, create if the set/list is null
-      indent(out);
-      out << "public void add" << get_cap_name("to");
-      out << cap_name << "(" << type_name(element_type) << " elem) {" << endl;
-
-      indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
-      indent_up();
-      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".add(elem);" << endl;
-      indent_down();
-      indent(out) << "}" << endl << endl;
-    } else if (type->is_map()) {
-      // Put to map
-      t_type* key_type = ((t_map*)type)->get_key_type();
-      t_type* val_type = ((t_map*)type)->get_val_type();
-
-      indent(out);
-      out << "public void put" << get_cap_name("to");
-      out << cap_name << "(" << type_name(key_type) << " key, " << type_name(val_type) << " val) {"
-          << endl;
-
-      indent_up();
-      indent(out) << "if (this." << field_name << " == null) {" << endl;
-      indent_up();
-      indent(out) << "this." << field_name << " = new " << type_name(type, false, true) << "();"
-                  << endl;
-      indent_down();
-      indent(out) << "}" << endl;
-      indent(out) << "this." << field_name << ".put(key, val);" << endl;
-      indent_down();
-      indent(out) << "}" << endl << endl;
-    }
-
-    // Simple getter
-    generate_java_doc(out, field);
-    if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-      indent(out) << "public byte[] get" << cap_name << "() {" << endl;
-      indent(out) << "  set" << cap_name << "(org.apache.thrift.TBaseHelper.rightSize("
-                  << field_name << "));" << endl;
-      indent(out) << "  return " << field_name << " == null ? null : " << field_name << ".array();"
-                  << endl;
-      indent(out) << "}" << endl << endl;
-
-      indent(out) << "public ByteBuffer buffer" << get_cap_name("for") << cap_name << "() {"
-                  << endl;
-      indent(out) << "  return org.apache.thrift.TBaseHelper.copyBinary(" << field_name << ");"
-                  << endl;
-      indent(out) << "}" << endl << endl;
-    } else {
-      if (optional) {
-        indent(out) << "public Option<" << type_name(type, true) << ">";
-        if (type->is_base_type() && ((t_base_type*)type)->get_base() == t_base_type::TYPE_BOOL) {
-          out << " is";
-        } else {
-          out << " get";
-        }
-        out << cap_name << "() {" << endl;
-        indent_up();
-
-        indent(out) << "if (this.isSet" << cap_name << "()) {" << endl;
-        indent_up();
-        indent(out) << "return Option.some(this." << field_name << ");" << endl;
-        indent_down();
-        indent(out) << "} else {" << endl;
-        indent_up();
-        indent(out) << "return Option.none();" << endl;
-        indent_down();
-        indent(out) << "}" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      } else {
-        indent(out) << "public " << type_name(type);
-        if (type->is_base_type() && ((t_base_type*)type)->get_base() == t_base_type::TYPE_BOOL) {
-          out << " is";
-        } else {
-          out << " get";
-        }
-        out << cap_name << "() {" << endl;
-        indent_up();
-        indent(out) << "return this." << field_name << ";" << endl;
-        indent_down();
-        indent(out) << "}" << endl << endl;
-      }
-    }
-
-    // Simple setter
-    generate_java_doc(out, field);
-    if (type->is_base_type() && ((t_base_type*)type)->is_binary()) {
-      indent(out) << "public ";
-      if (bean_style_) {
-        out << "void";
-      } else {
-        out << type_name(tstruct);
-      }
-      out << " set" << cap_name << "(byte[] " << field_name << ") {" << endl;
-      indent(out) << "  this." << field_name << " = " << field_name << " == null ? (ByteBuffer)null"
-                  << " : ByteBuffer.wrap(Arrays.copyOf(" << field_name << ", " << field_name
-                  << ".length));" << endl;
-      if (!bean_style_) {
-        indent(out) << "  return this;" << endl;
-      }
-      indent(out) << "}" << endl << endl;
-    }
-    indent(out) << "public ";
-    if (bean_style_) {
-      out << "vo

<TRUNCATED>


[22/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_field.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_field.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_field.h
deleted file mode 100644
index eece7bb..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_field.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_FIELD_H
-#define T_FIELD_H
-
-#include <string>
-#include <sstream>
-
-#include "t_doc.h"
-
-// Forward declare for xsd_attrs
-class t_struct;
-
-/**
- * Class to represent a field in a thrift structure. A field has a data type,
- * a symbolic name, and a numeric identifier.
- *
- */
-class t_field : public t_doc {
-public:
-  t_field(t_type* type, std::string name)
-    : type_(type),
-      name_(name),
-      key_(0),
-      value_(NULL),
-      xsd_optional_(false),
-      xsd_nillable_(false),
-      xsd_attrs_(NULL),
-      reference_(false) {}
-
-  t_field(t_type* type, std::string name, int32_t key)
-    : type_(type),
-      name_(name),
-      key_(key),
-      req_(T_OPT_IN_REQ_OUT),
-      value_(NULL),
-      xsd_optional_(false),
-      xsd_nillable_(false),
-      xsd_attrs_(NULL),
-      reference_(false) {}
-
-  ~t_field() {}
-
-  t_type* get_type() const { return type_; }
-
-  const std::string& get_name() const { return name_; }
-
-  int32_t get_key() const { return key_; }
-
-  enum e_req { T_REQUIRED, T_OPTIONAL, T_OPT_IN_REQ_OUT };
-
-  void set_req(e_req req) { req_ = req; }
-
-  e_req get_req() const { return req_; }
-
-  void set_value(t_const_value* value) { value_ = value; }
-
-  t_const_value* get_value() { return value_; }
-
-  void set_xsd_optional(bool xsd_optional) { xsd_optional_ = xsd_optional; }
-
-  bool get_xsd_optional() const { return xsd_optional_; }
-
-  void set_xsd_nillable(bool xsd_nillable) { xsd_nillable_ = xsd_nillable; }
-
-  bool get_xsd_nillable() const { return xsd_nillable_; }
-
-  void set_xsd_attrs(t_struct* xsd_attrs) { xsd_attrs_ = xsd_attrs; }
-
-  t_struct* get_xsd_attrs() { return xsd_attrs_; }
-
-  /**
-   * Comparator to sort fields in ascending order by key.
-   * Make this a functor instead of a function to help GCC inline it.
-   * The arguments are (const) references to const pointers to const t_fields.
-   */
-  struct key_compare {
-    bool operator()(t_field const* const& a, t_field const* const& b) {
-      return a->get_key() < b->get_key();
-    }
-  };
-
-  std::map<std::string, std::string> annotations_;
-
-  bool get_reference() { return reference_; }
-
-  void set_reference(bool reference) { reference_ = reference; }
-
-private:
-  t_type* type_;
-  std::string name_;
-  int32_t key_;
-  e_req req_;
-  t_const_value* value_;
-
-  bool xsd_optional_;
-  bool xsd_nillable_;
-  t_struct* xsd_attrs_;
-  bool reference_;
-};
-
-/**
- * A simple struct for the parser to use to store a field ID, and whether or
- * not it was specified by the user or automatically chosen.
- */
-struct t_field_id {
-  int32_t value;
-  bool auto_assigned;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_function.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_function.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_function.h
deleted file mode 100644
index 96886f3..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_function.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_FUNCTION_H
-#define T_FUNCTION_H
-
-#include <string>
-#include "t_type.h"
-#include "t_struct.h"
-#include "t_doc.h"
-
-/**
- * Representation of a function. Key parts are return type, function name,
- * optional modifiers, and an argument list, which is implemented as a thrift
- * struct.
- *
- */
-class t_function : public t_doc {
-public:
-  t_function(t_type* returntype, std::string name, t_struct* arglist, bool oneway = false)
-    : returntype_(returntype), name_(name), arglist_(arglist), oneway_(oneway) {
-    xceptions_ = new t_struct(NULL);
-    if (oneway_ && (!returntype_->is_void())) {
-      pwarning(1, "Oneway methods should return void.\n");
-    }
-  }
-
-  t_function(t_type* returntype,
-             std::string name,
-             t_struct* arglist,
-             t_struct* xceptions,
-             bool oneway = false)
-    : returntype_(returntype),
-      name_(name),
-      arglist_(arglist),
-      xceptions_(xceptions),
-      oneway_(oneway) {
-    if (oneway_ && !xceptions_->get_members().empty()) {
-      throw std::string("Oneway methods can't throw exceptions.");
-    }
-    if (oneway_ && (!returntype_->is_void())) {
-      pwarning(1, "Oneway methods should return void.\n");
-    }
-  }
-
-  ~t_function() {}
-
-  t_type* get_returntype() const { return returntype_; }
-
-  const std::string& get_name() const { return name_; }
-
-  t_struct* get_arglist() const { return arglist_; }
-
-  t_struct* get_xceptions() const { return xceptions_; }
-
-  bool is_oneway() const { return oneway_; }
-
-  std::map<std::string, std::string> annotations_;
-
-private:
-  t_type* returntype_;
-  std::string name_;
-  t_struct* arglist_;
-  t_struct* xceptions_;
-  bool oneway_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_list.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_list.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_list.h
deleted file mode 100644
index ac0d981..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_list.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_LIST_H
-#define T_LIST_H
-
-#include "t_container.h"
-
-/**
- * A list is a lightweight container type that just wraps another data type.
- *
- */
-class t_list : public t_container {
-public:
-  t_list(t_type* elem_type) : elem_type_(elem_type) {}
-
-  t_type* get_elem_type() const { return elem_type_; }
-
-  bool is_list() const { return true; }
-
-private:
-  t_type* elem_type_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_map.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_map.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_map.h
deleted file mode 100644
index 269aeab..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_map.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_MAP_H
-#define T_MAP_H
-
-#include "t_container.h"
-
-/**
- * A map is a lightweight container type that just wraps another two data
- * types.
- *
- */
-class t_map : public t_container {
-public:
-  t_map(t_type* key_type, t_type* val_type) : key_type_(key_type), val_type_(val_type) {}
-
-  t_type* get_key_type() const { return key_type_; }
-
-  t_type* get_val_type() const { return val_type_; }
-
-  bool is_map() const { return true; }
-
-private:
-  t_type* key_type_;
-  t_type* val_type_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_program.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_program.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_program.h
deleted file mode 100644
index 556ee6c..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_program.h
+++ /dev/null
@@ -1,381 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_PROGRAM_H
-#define T_PROGRAM_H
-
-#include <map>
-#include <string>
-#include <vector>
-
-// For program_name()
-#include "main.h"
-
-#include "t_doc.h"
-#include "t_scope.h"
-#include "t_base_type.h"
-#include "t_typedef.h"
-#include "t_enum.h"
-#include "t_const.h"
-#include "t_struct.h"
-#include "t_service.h"
-#include "t_list.h"
-#include "t_map.h"
-#include "t_set.h"
-#include "generate/t_generator_registry.h"
-//#include "t_doc.h"
-
-/**
- * Top level class representing an entire thrift program. A program consists
- * fundamentally of the following:
- *
- *   Typedefs
- *   Enumerations
- *   Constants
- *   Structs
- *   Exceptions
- *   Services
- *
- * The program module also contains the definitions of the base types.
- *
- */
-class t_program : public t_doc {
-public:
-  t_program(std::string path, std::string name)
-    : path_(path), name_(name), out_path_("./"), out_path_is_absolute_(false) {
-    scope_ = new t_scope();
-  }
-
-  t_program(std::string path) : path_(path), out_path_("./"), out_path_is_absolute_(false) {
-    name_ = program_name(path);
-    scope_ = new t_scope();
-  }
-
-  ~t_program() {
-    if (scope_) {
-      delete scope_;
-      scope_ = NULL;
-    }
-  }
-
-  // Path accessor
-  const std::string& get_path() const { return path_; }
-
-  // Output path accessor
-  const std::string& get_out_path() const { return out_path_; }
-
-  // Create gen-* dir accessor
-  bool is_out_path_absolute() const { return out_path_is_absolute_; }
-
-  // Name accessor
-  const std::string& get_name() const { return name_; }
-
-  // Namespace
-  const std::string& get_namespace() const { return namespace_; }
-
-  // Include prefix accessor
-  const std::string& get_include_prefix() const { return include_prefix_; }
-
-  // Accessors for program elements
-  const std::vector<t_typedef*>& get_typedefs() const { return typedefs_; }
-  const std::vector<t_enum*>& get_enums() const { return enums_; }
-  const std::vector<t_const*>& get_consts() const { return consts_; }
-  const std::vector<t_struct*>& get_structs() const { return structs_; }
-  const std::vector<t_struct*>& get_xceptions() const { return xceptions_; }
-  const std::vector<t_struct*>& get_objects() const { return objects_; }
-  const std::vector<t_service*>& get_services() const { return services_; }
-  const std::map<std::string, std::string>& get_namespaces() const { return namespaces_; }
-
-  // Program elements
-  void add_typedef(t_typedef* td) { typedefs_.push_back(td); }
-  void add_enum(t_enum* te) { enums_.push_back(te); }
-  void add_const(t_const* tc) { consts_.push_back(tc); }
-  void add_struct(t_struct* ts) {
-    objects_.push_back(ts);
-    structs_.push_back(ts);
-  }
-  void add_xception(t_struct* tx) {
-    objects_.push_back(tx);
-    xceptions_.push_back(tx);
-  }
-  void add_service(t_service* ts) { services_.push_back(ts); }
-
-  // Programs to include
-  const std::vector<t_program*>& get_includes() const { return includes_; }
-
-  void set_out_path(std::string out_path, bool out_path_is_absolute) {
-    out_path_ = out_path;
-    out_path_is_absolute_ = out_path_is_absolute;
-    // Ensure that it ends with a trailing '/' (or '\' for windows machines)
-    char c = out_path_.at(out_path_.size() - 1);
-    if (!(c == '/' || c == '\\')) {
-      out_path_.push_back('/');
-    }
-  }
-
-  // Typename collision detection
-  /**
-   * Search for typename collisions
-   * @param t    the type to test for collisions
-   * @return     true if a certain collision was found, otherwise false
-   */
-  bool is_unique_typename(t_type* t) {
-    int occurrences = program_typename_count(this, t);
-    for (std::vector<t_program*>::iterator it = includes_.begin(); it != includes_.end(); ++it) {
-      occurrences += program_typename_count(*it, t);
-    }
-    return 0 == occurrences;
-  }
-
-  /**
-   * Search all type collections for duplicate typenames
-   * @param prog the program to search
-   * @param t    the type to test for collisions
-   * @return     the number of certain typename collisions
-   */
-  int program_typename_count(t_program* prog, t_type* t) {
-    int occurrences = 0;
-    occurrences += collection_typename_count(prog, prog->typedefs_, t);
-    occurrences += collection_typename_count(prog, prog->enums_, t);
-    occurrences += collection_typename_count(prog, prog->objects_, t);
-    occurrences += collection_typename_count(prog, prog->services_, t);
-    return occurrences;
-  }
-
-  /**
-   * Search a type collection for duplicate typenames
-   * @param prog            the program to search
-   * @param type_collection the type collection to search
-   * @param t               the type to test for collisions
-   * @return                the number of certain typename collisions
-   */
-  template <class T>
-  int collection_typename_count(t_program* prog, T type_collection, t_type* t) {
-    int occurrences = 0;
-    for (typename T::iterator it = type_collection.begin(); it != type_collection.end(); ++it)
-      if (t != *it && 0 == t->get_name().compare((*it)->get_name()) && is_common_namespace(prog, t))
-        ++occurrences;
-    return occurrences;
-  }
-
-  /**
-   * Determine whether identical typenames will collide based on namespaces.
-   *
-   * Because we do not know which languages the user will generate code for,
-   * collisions within programs (IDL files) having namespace declarations can be
-   * difficult to determine. Only guaranteed collisions return true (cause an error).
-   * Possible collisions involving explicit namespace declarations produce a warning.
-   * Other possible collisions go unreported.
-   * @param prog the program containing the preexisting typename
-   * @param t    the type containing the typename match
-   * @return     true if a collision within namespaces is found, otherwise false
-   */
-  bool is_common_namespace(t_program* prog, t_type* t) {
-    // Case 1: Typenames are in the same program [collision]
-    if (prog == t->get_program()) {
-      pwarning(1,
-               "Duplicate typename %s found in %s",
-               t->get_name().c_str(),
-               t->get_program()->get_name().c_str());
-      return true;
-    }
-
-    // Case 2: Both programs have identical namespace scope/name declarations [collision]
-    bool match = true;
-    for (std::map<std::string, std::string>::iterator it = prog->namespaces_.begin();
-         it != prog->namespaces_.end();
-         ++it) {
-      if (0 == it->second.compare(t->get_program()->get_namespace(it->first))) {
-        pwarning(1,
-                 "Duplicate typename %s found in %s,%s,%s and %s,%s,%s [file,scope,ns]",
-                 t->get_name().c_str(),
-                 t->get_program()->get_name().c_str(),
-                 it->first.c_str(),
-                 it->second.c_str(),
-                 prog->get_name().c_str(),
-                 it->first.c_str(),
-                 it->second.c_str());
-      } else {
-        match = false;
-      }
-    }
-    for (std::map<std::string, std::string>::iterator it = t->get_program()->namespaces_.begin();
-         it != t->get_program()->namespaces_.end();
-         ++it) {
-      if (0 == it->second.compare(prog->get_namespace(it->first))) {
-        pwarning(1,
-                 "Duplicate typename %s found in %s,%s,%s and %s,%s,%s [file,scope,ns]",
-                 t->get_name().c_str(),
-                 t->get_program()->get_name().c_str(),
-                 it->first.c_str(),
-                 it->second.c_str(),
-                 prog->get_name().c_str(),
-                 it->first.c_str(),
-                 it->second.c_str());
-      } else {
-        match = false;
-      }
-    }
-    if (0 == prog->namespaces_.size() && 0 == t->get_program()->namespaces_.size()) {
-      pwarning(1,
-               "Duplicate typename %s found in %s and %s",
-               t->get_name().c_str(),
-               t->get_program()->get_name().c_str(),
-               prog->get_name().c_str());
-    }
-    return match;
-  }
-
-  // Scoping and namespacing
-  void set_namespace(std::string name) { namespace_ = name; }
-
-  // Scope accessor
-  t_scope* scope() const { return scope_; }
-
-  // Includes
-
-  void add_include(std::string path, std::string include_site) {
-    t_program* program = new t_program(path);
-
-    // include prefix for this program is the site at which it was included
-    // (minus the filename)
-    std::string include_prefix;
-    std::string::size_type last_slash = std::string::npos;
-    if ((last_slash = include_site.rfind("/")) != std::string::npos) {
-      include_prefix = include_site.substr(0, last_slash);
-    }
-
-    program->set_include_prefix(include_prefix);
-    includes_.push_back(program);
-  }
-
-  std::vector<t_program*>& get_includes() { return includes_; }
-
-  void set_include_prefix(std::string include_prefix) {
-    include_prefix_ = include_prefix;
-
-    // this is intended to be a directory; add a trailing slash if necessary
-    std::string::size_type len = include_prefix_.size();
-    if (len > 0 && include_prefix_[len - 1] != '/') {
-      include_prefix_ += '/';
-    }
-  }
-
-  // Language neutral namespace / packaging
-  void set_namespace(std::string language, std::string name_space) {
-    if (language != "*") {
-      size_t sub_index = language.find('.');
-      std::string base_language = language.substr(0, sub_index);
-      std::string sub_namespace;
-
-      if (base_language == "smalltalk") {
-        pwarning(1, "Namespace 'smalltalk' is deprecated. Use 'st' instead");
-        base_language = "st";
-      }
-
-      t_generator_registry::gen_map_t my_copy = t_generator_registry::get_generator_map();
-
-      t_generator_registry::gen_map_t::iterator it;
-      it = my_copy.find(base_language);
-
-      if (it == my_copy.end()) {
-        std::string warning = "No generator named '" + base_language + "' could be found!";
-        pwarning(1, warning.c_str());
-      } else {
-        if (sub_index != std::string::npos) {
-          std::string sub_namespace = language.substr(sub_index + 1);
-          if (!it->second->is_valid_namespace(sub_namespace)) {
-            std::string warning = base_language + " generator does not accept '" + sub_namespace
-                                  + "' as sub-namespace!";
-            pwarning(1, warning.c_str());
-          }
-        }
-      }
-    }
-
-    namespaces_[language] = name_space;
-  }
-
-  std::string get_namespace(std::string language) const {
-    std::map<std::string, std::string>::const_iterator iter;
-    if ((iter = namespaces_.find(language)) != namespaces_.end()
-        || (iter = namespaces_.find("*")) != namespaces_.end()) {
-      return iter->second;
-    }
-    return std::string();
-  }
-
-  const std::map<std::string, std::string>& get_all_namespaces(){
-     return namespaces_;
-  }
-  // Language specific namespace / packaging
-
-  void add_cpp_include(std::string path) { cpp_includes_.push_back(path); }
-
-  const std::vector<std::string>& get_cpp_includes() { return cpp_includes_; }
-
-  void add_c_include(std::string path) { c_includes_.push_back(path); }
-
-  const std::vector<std::string>& get_c_includes() { return c_includes_; }
-
-private:
-  // File path
-  std::string path_;
-
-  // Name
-  std::string name_;
-
-  // Output directory
-  std::string out_path_;
-
-  // Output directory is absolute location for generated source (no gen-*)
-  bool out_path_is_absolute_;
-
-  // Namespace
-  std::string namespace_;
-
-  // Included programs
-  std::vector<t_program*> includes_;
-
-  // Include prefix for this program, if any
-  std::string include_prefix_;
-
-  // Identifier lookup scope
-  t_scope* scope_;
-
-  // Components to generate code for
-  std::vector<t_typedef*> typedefs_;
-  std::vector<t_enum*> enums_;
-  std::vector<t_const*> consts_;
-  std::vector<t_struct*> objects_;
-  std::vector<t_struct*> structs_;
-  std::vector<t_struct*> xceptions_;
-  std::vector<t_service*> services_;
-
-  // Dynamic namespaces
-  std::map<std::string, std::string> namespaces_;
-
-  // C++ extra includes
-  std::vector<std::string> cpp_includes_;
-
-  // C extra includes
-  std::vector<std::string> c_includes_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_scope.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_scope.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_scope.h
deleted file mode 100644
index c108fdd..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_scope.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_SCOPE_H
-#define T_SCOPE_H
-
-#include <map>
-#include <string>
-#include <sstream>
-
-#include "t_type.h"
-#include "t_service.h"
-#include "t_const.h"
-#include "t_const_value.h"
-#include "t_base_type.h"
-#include "t_map.h"
-#include "t_list.h"
-
-/**
- * This represents a variable scope used for looking up predefined types and
- * services. Typically, a scope is associated with a t_program. Scopes are not
- * used to determine code generation, but rather to resolve identifiers at
- * parse time.
- *
- */
-class t_scope {
-public:
-  t_scope() {}
-
-  void add_type(std::string name, t_type* type) { types_[name] = type; }
-
-  t_type* get_type(std::string name) { return types_[name]; }
-
-  void add_service(std::string name, t_service* service) { services_[name] = service; }
-
-  t_service* get_service(std::string name) { return services_[name]; }
-
-  void add_constant(std::string name, t_const* constant) {
-    if (constants_.find(name) != constants_.end()) {
-      throw "Enum " + name + " is already defined!";
-    } else {
-      constants_[name] = constant;
-    }
-  }
-
-  t_const* get_constant(std::string name) { return constants_[name]; }
-
-  void print() {
-    std::map<std::string, t_type*>::iterator iter;
-    for (iter = types_.begin(); iter != types_.end(); ++iter) {
-      printf("%s => %s\n", iter->first.c_str(), iter->second->get_name().c_str());
-    }
-  }
-
-  void resolve_const_value(t_const_value* const_val, t_type* ttype) {
-    if (ttype->is_map()) {
-      const std::map<t_const_value*, t_const_value*>& map = const_val->get_map();
-      std::map<t_const_value*, t_const_value*>::const_iterator v_iter;
-      for (v_iter = map.begin(); v_iter != map.end(); ++v_iter) {
-        resolve_const_value(v_iter->first, ((t_map*)ttype)->get_key_type());
-        resolve_const_value(v_iter->second, ((t_map*)ttype)->get_val_type());
-      }
-    } else if (ttype->is_list() || ttype->is_set()) {
-      const std::vector<t_const_value*>& val = const_val->get_list();
-      std::vector<t_const_value*>::const_iterator v_iter;
-      for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-        resolve_const_value((*v_iter), ((t_list*)ttype)->get_elem_type());
-      }
-    } else if (ttype->is_struct()) {
-      t_struct* tstruct = (t_struct*)ttype;
-      const std::map<t_const_value*, t_const_value*>& map = const_val->get_map();
-      std::map<t_const_value*, t_const_value*>::const_iterator v_iter;
-      for (v_iter = map.begin(); v_iter != map.end(); ++v_iter) {
-        t_field* field = tstruct->get_field_by_name(v_iter->first->get_string());
-        if (field == NULL) {
-          throw "No field named \"" + v_iter->first->get_string()
-              + "\" was found in struct of type \"" + tstruct->get_name() + "\"";
-        }
-        resolve_const_value(v_iter->second, field->get_type());
-      }
-    } else if (const_val->get_type() == t_const_value::CV_IDENTIFIER) {
-      if (ttype->is_enum()) {
-        const_val->set_enum((t_enum*)ttype);
-      } else {
-        t_const* constant = get_constant(const_val->get_identifier());
-        if (constant == NULL) {
-          throw "No enum value or constant found named \"" + const_val->get_identifier() + "\"!";
-        }
-
-        // Resolve typedefs to the underlying type
-        t_type* const_type = constant->get_type()->get_true_type();
-
-        if (const_type->is_base_type()) {
-          switch (((t_base_type*)const_type)->get_base()) {
-          case t_base_type::TYPE_I16:
-          case t_base_type::TYPE_I32:
-          case t_base_type::TYPE_I64:
-          case t_base_type::TYPE_BOOL:
-          case t_base_type::TYPE_BYTE:
-            const_val->set_integer(constant->get_value()->get_integer());
-            break;
-          case t_base_type::TYPE_STRING:
-            const_val->set_string(constant->get_value()->get_string());
-            break;
-          case t_base_type::TYPE_DOUBLE:
-            const_val->set_double(constant->get_value()->get_double());
-            break;
-          case t_base_type::TYPE_VOID:
-            throw "Constants cannot be of type VOID";
-          }
-        } else if (const_type->is_map()) {
-          const std::map<t_const_value*, t_const_value*>& map = constant->get_value()->get_map();
-          std::map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-          const_val->set_map();
-          for (v_iter = map.begin(); v_iter != map.end(); ++v_iter) {
-            const_val->add_map(v_iter->first, v_iter->second);
-          }
-        } else if (const_type->is_list()) {
-          const std::vector<t_const_value*>& val = constant->get_value()->get_list();
-          std::vector<t_const_value*>::const_iterator v_iter;
-
-          const_val->set_list();
-          for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-            const_val->add_list(*v_iter);
-          }
-        }
-      }
-    } else if (ttype->is_enum()) {
-      // enum constant with non-identifier value. set the enum and find the
-      // value's name.
-      t_enum* tenum = (t_enum*)ttype;
-      t_enum_value* enum_value = tenum->get_constant_by_value(const_val->get_integer());
-      if (enum_value == NULL) {
-        std::ostringstream valstm;
-        valstm << const_val->get_integer();
-        throw "Couldn't find a named value in enum " + tenum->get_name() + " for value "
-            + valstm.str();
-      }
-      const_val->set_identifier(tenum->get_name() + "." + enum_value->get_name());
-      const_val->set_enum(tenum);
-    }
-  }
-
-private:
-  // Map of names to types
-  std::map<std::string, t_type*> types_;
-
-  // Map of names to constants
-  std::map<std::string, t_const*> constants_;
-
-  // Map of names to services
-  std::map<std::string, t_service*> services_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_service.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_service.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_service.h
deleted file mode 100644
index 2b01f9c..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_service.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_SERVICE_H
-#define T_SERVICE_H
-
-#include "t_function.h"
-#include <vector>
-
-class t_program;
-
-/**
- * A service consists of a set of functions.
- *
- */
-class t_service : public t_type {
-public:
-  t_service(t_program* program) : t_type(program), extends_(NULL) {}
-
-  bool is_service() const { return true; }
-
-  void set_extends(t_service* extends) { extends_ = extends; }
-
-  void add_function(t_function* func) {
-    std::vector<t_function*>::const_iterator iter;
-    for (iter = functions_.begin(); iter != functions_.end(); ++iter) {
-      if (func->get_name() == (*iter)->get_name()) {
-        throw "Function " + func->get_name() + " is already defined";
-      }
-    }
-    functions_.push_back(func);
-  }
-
-  const std::vector<t_function*>& get_functions() const { return functions_; }
-
-  t_service* get_extends() { return extends_; }
-
-private:
-  std::vector<t_function*> functions_;
-  t_service* extends_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_set.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_set.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_set.h
deleted file mode 100644
index 8a46480..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_set.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_SET_H
-#define T_SET_H
-
-#include "t_container.h"
-
-/**
- * A set is a lightweight container type that just wraps another data type.
- *
- */
-class t_set : public t_container {
-public:
-  t_set(t_type* elem_type) : elem_type_(elem_type) {}
-
-  t_type* get_elem_type() const { return elem_type_; }
-
-  bool is_set() const { return true; }
-
-private:
-  t_type* elem_type_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_struct.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_struct.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_struct.h
deleted file mode 100644
index 93cb089..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_struct.h
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_STRUCT_H
-#define T_STRUCT_H
-
-#include <algorithm>
-#include <vector>
-#include <utility>
-#include <string>
-
-#include "t_type.h"
-#include "t_field.h"
-
-// Forward declare that puppy
-class t_program;
-
-/**
- * A struct is a container for a set of member fields that has a name. Structs
- * are also used to implement exception types.
- *
- */
-class t_struct : public t_type {
-public:
-  typedef std::vector<t_field*> members_type;
-
-  t_struct(t_program* program)
-    : t_type(program),
-      is_xception_(false),
-      is_union_(false),
-      members_validated(false),
-      members_with_value(0),
-      xsd_all_(false) {}
-
-  t_struct(t_program* program, const std::string& name)
-    : t_type(program, name),
-      is_xception_(false),
-      is_union_(false),
-      members_validated(false),
-      members_with_value(0),
-      xsd_all_(false) {}
-
-  void set_name(const std::string& name) {
-    name_ = name;
-    validate_union_members();
-  }
-
-  void set_xception(bool is_xception) { is_xception_ = is_xception; }
-
-  void validate_union_member(t_field* field) {
-    if (is_union_ && (!name_.empty())) {
-
-      // unions can't have required fields
-      if (field->get_req() == t_field::T_REQUIRED) {
-        pwarning(1,
-                 "Required field %s of union %s set to optional.\n",
-                 field->get_name().c_str(),
-                 name_.c_str());
-        field->set_req(t_field::T_OPTIONAL);
-      }
-
-      // unions may have up to one member defaulted, but not more
-      if (field->get_value() != NULL) {
-        if (1 < ++members_with_value) {
-          throw "Error: Field " + field->get_name() + " provides another default value for union "
-              + name_;
-        }
-      }
-    }
-  }
-
-  void validate_union_members() {
-    if (is_union_ && (!name_.empty()) && (!members_validated)) {
-      members_type::const_iterator m_iter;
-      for (m_iter = members_in_id_order_.begin(); m_iter != members_in_id_order_.end(); ++m_iter) {
-        validate_union_member(*m_iter);
-      }
-      members_validated = true;
-    }
-  }
-
-  void set_union(bool is_union) {
-    is_union_ = is_union;
-    validate_union_members();
-  }
-
-  void set_xsd_all(bool xsd_all) { xsd_all_ = xsd_all; }
-
-  bool get_xsd_all() const { return xsd_all_; }
-
-  bool append(t_field* elem) {
-    typedef members_type::iterator iter_type;
-    std::pair<iter_type, iter_type> bounds = std::equal_range(members_in_id_order_.begin(),
-                                                              members_in_id_order_.end(),
-                                                              elem,
-                                                              t_field::key_compare());
-    if (bounds.first != bounds.second) {
-      return false;
-    }
-    // returns false when there is a conflict of field names
-    if (get_field_by_name(elem->get_name()) != NULL) {
-      return false;
-    }
-    members_.push_back(elem);
-    members_in_id_order_.insert(bounds.second, elem);
-    validate_union_member(elem);
-    return true;
-  }
-
-  const members_type& get_members() { return members_; }
-
-  const members_type& get_sorted_members() { return members_in_id_order_; }
-
-  bool is_struct() const { return !is_xception_; }
-
-  bool is_xception() const { return is_xception_; }
-
-  bool is_union() const { return is_union_; }
-
-  t_field* get_field_by_name(std::string field_name) {
-    members_type::const_iterator m_iter;
-    for (m_iter = members_in_id_order_.begin(); m_iter != members_in_id_order_.end(); ++m_iter) {
-      if ((*m_iter)->get_name() == field_name) {
-        return *m_iter;
-      }
-    }
-    return NULL;
-  }
-
-private:
-  members_type members_;
-  members_type members_in_id_order_;
-  bool is_xception_;
-  bool is_union_;
-  bool members_validated;
-  int members_with_value;
-
-  bool xsd_all_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_type.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_type.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_type.h
deleted file mode 100644
index 416cc6f..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_type.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_TYPE_H
-#define T_TYPE_H
-
-#include <string>
-#include <map>
-#include <cstring>
-#include <stdint.h>
-#include "t_doc.h"
-
-class t_program;
-
-/**
- * Generic representation of a thrift type. These objects are used by the
- * parser module to build up a tree of object that are all explicitly typed.
- * The generic t_type class exports a variety of useful methods that are
- * used by the code generator to branch based upon different handling for the
- * various types.
- *
- */
-class t_type : public t_doc {
-public:
-  virtual ~t_type() {}
-
-  virtual void set_name(const std::string& name) { name_ = name; }
-
-  virtual const std::string& get_name() const { return name_; }
-
-  virtual bool is_void() const { return false; }
-  virtual bool is_base_type() const { return false; }
-  virtual bool is_string() const { return false; }
-  virtual bool is_bool() const { return false; }
-  virtual bool is_typedef() const { return false; }
-  virtual bool is_enum() const { return false; }
-  virtual bool is_struct() const { return false; }
-  virtual bool is_xception() const { return false; }
-  virtual bool is_container() const { return false; }
-  virtual bool is_list() const { return false; }
-  virtual bool is_set() const { return false; }
-  virtual bool is_map() const { return false; }
-  virtual bool is_service() const { return false; }
-
-  t_program* get_program() { return program_; }
-
-  const t_program* get_program() const { return program_; }
-
-  t_type* get_true_type();
-
-  // This function will break (maybe badly) unless 0 <= num <= 16.
-  static char nybble_to_xdigit(int num) {
-    if (num < 10) {
-      return '0' + num;
-    } else {
-      return 'A' + num - 10;
-    }
-  }
-
-  static std::string byte_to_hex(uint8_t byte) {
-    std::string rv;
-    rv += nybble_to_xdigit(byte >> 4);
-    rv += nybble_to_xdigit(byte & 0x0f);
-    return rv;
-  }
-
-  std::map<std::string, std::string> annotations_;
-
-protected:
-  t_type() : program_(NULL) { ; }
-
-  t_type(t_program* program) : program_(program) { ; }
-
-  t_type(t_program* program, std::string name) : program_(program), name_(name) { ; }
-
-  t_type(std::string name) : program_(NULL), name_(name) { ; }
-
-  t_program* program_;
-  std::string name_;
-};
-
-/**
- * Placeholder struct for returning the key and value of an annotation
- * during parsing.
- */
-struct t_annotation {
-  std::string key;
-  std::string val;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.cc b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.cc
deleted file mode 100644
index ddbe749..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#include <cstdio>
-
-#include "t_typedef.h"
-#include "t_program.h"
-
-t_type* t_typedef::get_type() const {
-  if (type_ == NULL) {
-    t_type* type = get_program()->scope()->get_type(symbolic_);
-    if (type == NULL) {
-      printf("Type \"%s\" not defined\n", symbolic_.c_str());
-      exit(1);
-    }
-    return type;
-  }
-  return type_;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.h b/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.h
deleted file mode 100644
index a39a246..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/parse/t_typedef.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef T_TYPEDEF_H
-#define T_TYPEDEF_H
-
-#include <string>
-#include "t_type.h"
-
-/**
- * A typedef is a mapping from a symbolic name to another type. In dymanically
- * typed languages (i.e. php/python) the code generator can actually usually
- * ignore typedefs and just use the underlying type directly, though in C++
- * the symbolic naming can be quite useful for code clarity.
- *
- */
-class t_typedef : public t_type {
-public:
-  t_typedef(t_program* program, t_type* type, const std::string& symbolic)
-    : t_type(program, symbolic), type_(type), symbolic_(symbolic), forward_(false), seen_(false) {}
-
-  /**
-   * This constructor is used to refer to a type that is lazily
-   * resolved at a later time, like for forward declarations or
-   * recursive types.
-   */
-  t_typedef(t_program* program, const std::string& symbolic, bool forward)
-    : t_type(program, symbolic),
-      type_(NULL),
-      symbolic_(symbolic),
-      forward_(forward),
-      seen_(false) {}
-
-  ~t_typedef() {}
-
-  t_type* get_type() const;
-
-  const std::string& get_symbolic() const { return symbolic_; }
-
-  bool is_forward_typedef() const { return forward_; }
-
-  bool is_typedef() const { return true; }
-
-private:
-  t_type* type_;
-  std::string symbolic_;
-  bool forward_;
-  mutable bool seen_;
-};
-
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/platform.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/platform.h b/depends/thirdparty/thrift/compiler/cpp/src/platform.h
deleted file mode 100644
index 8cbe9db..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/platform.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * define for mkdir,since the method signature
- * is different for the non-POSIX MinGW
- */
-
-#ifdef _MSC_VER
-#include "windows/config.h"
-#endif
-
-#ifdef _WIN32
-#include <direct.h>
-#include <io.h>
-#else
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-
-#ifdef _WIN32
-#define MKDIR(x) mkdir(x)
-#else
-#define MKDIR(x) mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO)
-#endif
-
-#ifdef PATH_MAX
-#define THRIFT_PATH_MAX PATH_MAX
-#else
-#define THRIFT_PATH_MAX MAX_PATH
-#endif

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/thriftl.ll
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/thriftl.ll b/depends/thirdparty/thrift/compiler/cpp/src/thriftl.ll
deleted file mode 100644
index a771269..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/thriftl.ll
+++ /dev/null
@@ -1,423 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Thrift scanner.
- *
- * Tokenizes a thrift definition file.
- */
-
-%{
-
-/* This is redundant with some of the flags in Makefile.am, but it works
- * when people override CXXFLAGS without being careful. The pragmas are
- * the 'right' way to do it, but don't work on old-enough GCC (in particular
- * the GCC that ship on Mac OS X 10.6.5, *counter* to what the GNU docs say)
- *
- * We should revert the Makefile.am changes once Apple ships a reasonable
- * GCC.
- */
-#ifdef __GNUC__
-#pragma GCC diagnostic ignored "-Wunused-function"
-#pragma GCC diagnostic ignored "-Wunused-label"
-#endif
-
-#ifdef _MSC_VER
-//warning C4102: 'find_rule' : unreferenced label
-#pragma warning(disable:4102)
-//avoid isatty redefinition
-#define YY_NEVER_INTERACTIVE 1
-
-#define YY_NO_UNISTD_H 1
-#endif
-
-#include <cassert>
-#include <string>
-#include <errno.h>
-#include <stdlib.h>
-
-#ifdef _MSC_VER
-#include "windows/config.h"
-#endif
-#include "main.h"
-#include "globals.h"
-#include "parse/t_program.h"
-
-/**
- * Must be included AFTER parse/t_program.h, but I can't remember why anymore
- * because I wrote this a while ago.
- */
-#if defined(BISON_USE_PARSER_H_EXTENSION)
-#include "thrifty.h"
-#else
-#include "thrifty.hh"
-#endif
-
-void thrift_reserved_keyword(char* keyword) {
-  yyerror("Cannot use reserved language keyword: \"%s\"\n", keyword);
-  exit(1);
-}
-
-void integer_overflow(char* text) {
-  yyerror("This integer is too big: \"%s\"\n", text);
-  exit(1);
-}
-
-void unexpected_token(char* text) {
-  yyerror("Unexpected token in input: \"%s\"\n", text);
-  exit(1);
-}
-
-%}
-
-/**
- * Provides the yylineno global, useful for debugging output
- */
-%option lex-compat
-
-/**
- * Our inputs are all single files, so no need for yywrap
- */
-%option noyywrap
-
-/**
- * We don't use it, and it fires up warnings at -Wall
- */
-%option nounput
-
-/**
- * Helper definitions, comments, constants, and whatnot
- */
-
-intconstant   ([+-]?[0-9]+)
-hexconstant   ([+-]?"0x"[0-9A-Fa-f]+)
-dubconstant   ([+-]?[0-9]*(\.[0-9]+)?([eE][+-]?[0-9]+)?)
-identifier    ([a-zA-Z_](\.[a-zA-Z_0-9]|[a-zA-Z_0-9])*)
-whitespace    ([ \t\r\n]*)
-sillycomm     ("/*""*"*"*/")
-multicomm     ("/*"[^*]"/"*([^*/]|[^*]"/"|"*"[^/])*"*"*"*/")
-doctext       ("/**"([^*/]|[^*]"/"|"*"[^/])*"*"*"*/")
-comment       ("//"[^\n]*)
-unixcomment   ("#"[^\n]*)
-symbol        ([:;\,\{\}\(\)\=<>\[\]])
-st_identifier ([a-zA-Z-](\.[a-zA-Z_0-9-]|[a-zA-Z_0-9-])*)
-literal_begin (['\"])
-
-%%
-
-{whitespace}         { /* do nothing */                 }
-{sillycomm}          { /* do nothing */                 }
-{multicomm}          { /* do nothing */                 }
-{comment}            { /* do nothing */                 }
-{unixcomment}        { /* do nothing */                 }
-
-{symbol}             { return yytext[0];                }
-"*"                  { return yytext[0];                }
-
-"false"              { yylval.iconst=0; return tok_int_constant; }
-"true"               { yylval.iconst=1; return tok_int_constant; }
-
-"namespace"          { return tok_namespace;            }
-"cpp_namespace"      { return tok_cpp_namespace;        }
-"cpp_include"        { return tok_cpp_include;          }
-"cpp_type"           { return tok_cpp_type;             }
-"java_package"       { return tok_java_package;         }
-"cocoa_prefix"       { return tok_cocoa_prefix;         }
-"csharp_namespace"   { return tok_csharp_namespace;     }
-"delphi_namespace"   { return tok_delphi_namespace;     }
-"php_namespace"      { return tok_php_namespace;        }
-"py_module"          { return tok_py_module;            }
-"perl_package"       { return tok_perl_package;         }
-"ruby_namespace"     { return tok_ruby_namespace;       }
-"smalltalk_category" { return tok_smalltalk_category;   }
-"smalltalk_prefix"   { return tok_smalltalk_prefix;     }
-"xsd_all"            { return tok_xsd_all;              }
-"xsd_optional"       { return tok_xsd_optional;         }
-"xsd_nillable"       { return tok_xsd_nillable;         }
-"xsd_namespace"      { return tok_xsd_namespace;        }
-"xsd_attrs"          { return tok_xsd_attrs;            }
-"include"            { return tok_include;              }
-"void"               { return tok_void;                 }
-"bool"               { return tok_bool;                 }
-"byte"               { return tok_byte;                 }
-"i16"                { return tok_i16;                  }
-"i32"                { return tok_i32;                  }
-"i64"                { return tok_i64;                  }
-"double"             { return tok_double;               }
-"string"             { return tok_string;               }
-"binary"             { return tok_binary;               }
-"slist" {
-  pwarning(0, "\"slist\" is deprecated and will be removed in a future compiler version.  This type should be replaced with \"string\".\n");
-  return tok_slist;
-}
-"senum" {
-  pwarning(0, "\"senum\" is deprecated and will be removed in a future compiler version.  This type should be replaced with \"string\".\n");
-  return tok_senum;
-}
-"map"                { return tok_map;                  }
-"list"               { return tok_list;                 }
-"set"                { return tok_set;                  }
-"oneway"             { return tok_oneway;               }
-"typedef"            { return tok_typedef;              }
-"struct"             { return tok_struct;               }
-"union"              { return tok_union;                }
-"exception"          { return tok_xception;             }
-"extends"            { return tok_extends;              }
-"throws"             { return tok_throws;               }
-"service"            { return tok_service;              }
-"enum"               { return tok_enum;                 }
-"const"              { return tok_const;                }
-"required"           { return tok_required;             }
-"optional"           { return tok_optional;             }
-"async" {
-  pwarning(0, "\"async\" is deprecated.  It is called \"oneway\" now.\n");
-  return tok_oneway;
-}
-"&"                  { return tok_reference;            }
-
-
-"BEGIN"              { thrift_reserved_keyword(yytext); }
-"END"                { thrift_reserved_keyword(yytext); }
-"__CLASS__"          { thrift_reserved_keyword(yytext); }
-"__DIR__"            { thrift_reserved_keyword(yytext); }
-"__FILE__"           { thrift_reserved_keyword(yytext); }
-"__FUNCTION__"       { thrift_reserved_keyword(yytext); }
-"__LINE__"           { thrift_reserved_keyword(yytext); }
-"__METHOD__"         { thrift_reserved_keyword(yytext); }
-"__NAMESPACE__"      { thrift_reserved_keyword(yytext); }
-"abstract"           { thrift_reserved_keyword(yytext); }
-"alias"              { thrift_reserved_keyword(yytext); }
-"and"                { thrift_reserved_keyword(yytext); }
-"args"               { thrift_reserved_keyword(yytext); }
-"as"                 { thrift_reserved_keyword(yytext); }
-"assert"             { thrift_reserved_keyword(yytext); }
-"begin"              { thrift_reserved_keyword(yytext); }
-"break"              { thrift_reserved_keyword(yytext); }
-"case"               { thrift_reserved_keyword(yytext); }
-"catch"              { thrift_reserved_keyword(yytext); }
-"class"              { thrift_reserved_keyword(yytext); }
-"clone"              { thrift_reserved_keyword(yytext); }
-"continue"           { thrift_reserved_keyword(yytext); }
-"declare"            { thrift_reserved_keyword(yytext); }
-"def"                { thrift_reserved_keyword(yytext); }
-"default"            { thrift_reserved_keyword(yytext); }
-"del"                { thrift_reserved_keyword(yytext); }
-"delete"             { thrift_reserved_keyword(yytext); }
-"do"                 { thrift_reserved_keyword(yytext); }
-"dynamic"            { thrift_reserved_keyword(yytext); }
-"elif"               { thrift_reserved_keyword(yytext); }
-"else"               { thrift_reserved_keyword(yytext); }
-"elseif"             { thrift_reserved_keyword(yytext); }
-"elsif"              { thrift_reserved_keyword(yytext); }
-"end"                { thrift_reserved_keyword(yytext); }
-"enddeclare"         { thrift_reserved_keyword(yytext); }
-"endfor"             { thrift_reserved_keyword(yytext); }
-"endforeach"         { thrift_reserved_keyword(yytext); }
-"endif"              { thrift_reserved_keyword(yytext); }
-"endswitch"          { thrift_reserved_keyword(yytext); }
-"endwhile"           { thrift_reserved_keyword(yytext); }
-"ensure"             { thrift_reserved_keyword(yytext); }
-"except"             { thrift_reserved_keyword(yytext); }
-"exec"               { thrift_reserved_keyword(yytext); }
-"finally"            { thrift_reserved_keyword(yytext); }
-"float"              { thrift_reserved_keyword(yytext); }
-"for"                { thrift_reserved_keyword(yytext); }
-"foreach"            { thrift_reserved_keyword(yytext); }
-"from"               { thrift_reserved_keyword(yytext); }
-"function"           { thrift_reserved_keyword(yytext); }
-"global"             { thrift_reserved_keyword(yytext); }
-"goto"               { thrift_reserved_keyword(yytext); }
-"if"                 { thrift_reserved_keyword(yytext); }
-"implements"         { thrift_reserved_keyword(yytext); }
-"import"             { thrift_reserved_keyword(yytext); }
-"in"                 { thrift_reserved_keyword(yytext); }
-"inline"             { thrift_reserved_keyword(yytext); }
-"instanceof"         { thrift_reserved_keyword(yytext); }
-"interface"          { thrift_reserved_keyword(yytext); }
-"is"                 { thrift_reserved_keyword(yytext); }
-"lambda"             { thrift_reserved_keyword(yytext); }
-"module"             { thrift_reserved_keyword(yytext); }
-"native"             { thrift_reserved_keyword(yytext); }
-"new"                { thrift_reserved_keyword(yytext); }
-"next"               { thrift_reserved_keyword(yytext); }
-"nil"                { thrift_reserved_keyword(yytext); }
-"not"                { thrift_reserved_keyword(yytext); }
-"or"                 { thrift_reserved_keyword(yytext); }
-"package"            { thrift_reserved_keyword(yytext); }
-"pass"               { thrift_reserved_keyword(yytext); }
-"public"             { thrift_reserved_keyword(yytext); }
-"print"              { thrift_reserved_keyword(yytext); }
-"private"            { thrift_reserved_keyword(yytext); }
-"protected"          { thrift_reserved_keyword(yytext); }
-"public"             { thrift_reserved_keyword(yytext); }
-"raise"              { thrift_reserved_keyword(yytext); }
-"redo"               { thrift_reserved_keyword(yytext); }
-"rescue"             { thrift_reserved_keyword(yytext); }
-"retry"              { thrift_reserved_keyword(yytext); }
-"register"           { thrift_reserved_keyword(yytext); }
-"return"             { thrift_reserved_keyword(yytext); }
-"self"               { thrift_reserved_keyword(yytext); }
-"sizeof"             { thrift_reserved_keyword(yytext); }
-"static"             { thrift_reserved_keyword(yytext); }
-"super"              { thrift_reserved_keyword(yytext); }
-"switch"             { thrift_reserved_keyword(yytext); }
-"synchronized"       { thrift_reserved_keyword(yytext); }
-"then"               { thrift_reserved_keyword(yytext); }
-"this"               { thrift_reserved_keyword(yytext); }
-"throw"              { thrift_reserved_keyword(yytext); }
-"transient"          { thrift_reserved_keyword(yytext); }
-"try"                { thrift_reserved_keyword(yytext); }
-"undef"              { thrift_reserved_keyword(yytext); }
-"union"              { thrift_reserved_keyword(yytext); }
-"unless"             { thrift_reserved_keyword(yytext); }
-"unsigned"           { thrift_reserved_keyword(yytext); }
-"until"              { thrift_reserved_keyword(yytext); }
-"use"                { thrift_reserved_keyword(yytext); }
-"var"                { thrift_reserved_keyword(yytext); }
-"virtual"            { thrift_reserved_keyword(yytext); }
-"volatile"           { thrift_reserved_keyword(yytext); }
-"when"               { thrift_reserved_keyword(yytext); }
-"while"              { thrift_reserved_keyword(yytext); }
-"with"               { thrift_reserved_keyword(yytext); }
-"xor"                { thrift_reserved_keyword(yytext); }
-"yield"              { thrift_reserved_keyword(yytext); }
-
-{intconstant} {
-  errno = 0;
-  yylval.iconst = strtoll(yytext, NULL, 10);
-  if (errno == ERANGE) {
-    integer_overflow(yytext);
-  }
-  return tok_int_constant;
-}
-
-{hexconstant} {
-  errno = 0;
-  char sign = yytext[0];
-  int shift = sign == '0' ? 2 : 3;
-  yylval.iconst = strtoll(yytext+shift, NULL, 16);
-  if (sign == '-') {
-    yylval.iconst = -yylval.iconst;
-  }
-  if (errno == ERANGE) {
-    integer_overflow(yytext);
-  }
-  return tok_int_constant;
-}
-
-{dubconstant} {
-  yylval.dconst = atof(yytext);
-  return tok_dub_constant;
-}
-
-{identifier} {
-  yylval.id = strdup(yytext);
-  return tok_identifier;
-}
-
-{st_identifier} {
-  yylval.id = strdup(yytext);
-  return tok_st_identifier;
-}
-
-{literal_begin} {
-  char mark = yytext[0];
-  std::string result;
-  for(;;)
-  {
-    int ch = yyinput();
-    switch (ch) {
-      case EOF:
-        yyerror("End of file while read string at %d\n", yylineno);
-        exit(1);
-      case '\n':
-        yyerror("End of line while read string at %d\n", yylineno - 1);
-        exit(1);
-      case '\\':
-        ch = yyinput();
-        switch (ch) {
-          case 'r':
-            result.push_back('\r');
-            continue;
-          case 'n':
-            result.push_back('\n');
-            continue;
-          case 't':
-            result.push_back('\t');
-            continue;
-          case '"':
-            result.push_back('"');
-            continue;
-          case '\'':
-            result.push_back('\'');
-            continue;
-          case '\\':
-            result.push_back('\\');
-            continue;
-          default:
-            yyerror("Bad escape character\n");
-            return -1;
-        }
-        break;
-      default:
-        if (ch == mark) {
-          yylval.id = strdup(result.c_str());
-          return tok_literal;
-        } else {
-          result.push_back(ch);
-        }
-    }
-  }
-}
-
-
-{doctext} {
- /* This does not show up in the parse tree. */
- /* Rather, the parser will grab it out of the global. */
-  if (g_parse_mode == PROGRAM) {
-    clear_doctext();
-    g_doctext = strdup(yytext + 3);
-    assert(strlen(g_doctext) >= 2);
-    g_doctext[strlen(g_doctext) - 2] = ' ';
-    g_doctext[strlen(g_doctext) - 1] = '\0';
-    g_doctext = clean_up_doctext(g_doctext);
-    g_doctext_lineno = yylineno;
-    if( (g_program_doctext_candidate == NULL) && (g_program_doctext_status == INVALID)){
-      g_program_doctext_candidate = strdup(g_doctext);
-      g_program_doctext_lineno = g_doctext_lineno;
-      g_program_doctext_status = STILL_CANDIDATE;
-      pdebug("%s","program doctext set to STILL_CANDIDATE");
-    }
-  }
-}
-
-. {
-  unexpected_token(yytext);
-}
-
-
-. {
-  /* Catch-all to let us catch "*" in the parser. */
-  return (int) yytext[0];
-}
-
-%%
-
-/* vim: filetype=lex
-*/


[21/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/thrifty.yy
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/thrifty.yy b/depends/thirdparty/thrift/compiler/cpp/src/thrifty.yy
deleted file mode 100644
index 61d4231..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/thrifty.yy
+++ /dev/null
@@ -1,1312 +0,0 @@
-%{
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * Thrift parser.
- *
- * This parser is used on a thrift definition file.
- *
- */
-
-#define __STDC_LIMIT_MACROS
-#define __STDC_FORMAT_MACROS
-#include <stdio.h>
-#ifndef _MSC_VER
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
-#include <limits.h>
-#ifdef _MSC_VER
-#include "windows/config.h"
-#endif
-#include "main.h"
-#include "globals.h"
-#include "parse/t_program.h"
-#include "parse/t_scope.h"
-
-#ifdef _MSC_VER
-//warning C4065: switch statement contains 'default' but no 'case' labels
-#pragma warning(disable:4065)
-#endif
-
-/**
- * This global variable is used for automatic numbering of field indices etc.
- * when parsing the members of a struct. Field values are automatically
- * assigned starting from -1 and working their way down.
- */
-int y_field_val = -1;
-/**
- * This global variable is used for automatic numbering of enum values.
- * y_enum_val is the last value assigned; the next auto-assigned value will be
- * y_enum_val+1, and then it continues working upwards.  Explicitly specified
- * enum values reset y_enum_val to that value.
- */
-int32_t y_enum_val = -1;
-int g_arglist = 0;
-const int struct_is_struct = 0;
-const int struct_is_union = 1;
-
-%}
-
-/**
- * This structure is used by the parser to hold the data types associated with
- * various parse nodes.
- */
-%union {
-  char*          id;
-  int64_t        iconst;
-  double         dconst;
-  bool           tbool;
-  t_doc*         tdoc;
-  t_type*        ttype;
-  t_base_type*   tbase;
-  t_typedef*     ttypedef;
-  t_enum*        tenum;
-  t_enum_value*  tenumv;
-  t_const*       tconst;
-  t_const_value* tconstv;
-  t_struct*      tstruct;
-  t_service*     tservice;
-  t_function*    tfunction;
-  t_field*       tfield;
-  char*          dtext;
-  t_field::e_req ereq;
-  t_annotation*  tannot;
-  t_field_id     tfieldid;
-}
-
-/**
- * Strings identifier
- */
-%token<id>     tok_identifier
-%token<id>     tok_literal
-%token<dtext>  tok_doctext
-%token<id>     tok_st_identifier
-
-/**
- * Constant values
- */
-%token<iconst> tok_int_constant
-%token<dconst> tok_dub_constant
-
-/**
- * Header keywords
- */
-%token tok_include
-%token tok_namespace
-%token tok_cpp_namespace
-%token tok_cpp_include
-%token tok_cpp_type
-%token tok_php_namespace
-%token tok_py_module
-%token tok_perl_package
-%token tok_java_package
-%token tok_xsd_all
-%token tok_xsd_optional
-%token tok_xsd_nillable
-%token tok_xsd_namespace
-%token tok_xsd_attrs
-%token tok_ruby_namespace
-%token tok_smalltalk_category
-%token tok_smalltalk_prefix
-%token tok_cocoa_prefix
-%token tok_csharp_namespace
-%token tok_delphi_namespace
-
-/**
- * Base datatype keywords
- */
-%token tok_void
-%token tok_bool
-%token tok_byte
-%token tok_string
-%token tok_binary
-%token tok_slist
-%token tok_senum
-%token tok_i16
-%token tok_i32
-%token tok_i64
-%token tok_double
-
-/**
- * Complex type keywords
- */
-%token tok_map
-%token tok_list
-%token tok_set
-
-/**
- * Function modifiers
- */
-%token tok_oneway
-
-/**
- * Thrift language keywords
- */
-%token tok_typedef
-%token tok_struct
-%token tok_xception
-%token tok_throws
-%token tok_extends
-%token tok_service
-%token tok_enum
-%token tok_const
-%token tok_required
-%token tok_optional
-%token tok_union
-%token tok_reference
-
-/**
- * Grammar nodes
- */
-
-%type<ttype>     BaseType
-%type<ttype>     SimpleBaseType
-%type<ttype>     ContainerType
-%type<ttype>     SimpleContainerType
-%type<ttype>     MapType
-%type<ttype>     SetType
-%type<ttype>     ListType
-
-%type<tdoc>      Definition
-%type<ttype>     TypeDefinition
-
-%type<ttypedef>  Typedef
-
-%type<ttype>     TypeAnnotations
-%type<ttype>     TypeAnnotationList
-%type<tannot>    TypeAnnotation
-%type<id>        TypeAnnotationValue
-
-%type<tfield>    Field
-%type<tfieldid>  FieldIdentifier
-%type<ereq>      FieldRequiredness
-%type<ttype>     FieldType
-%type<tconstv>   FieldValue
-%type<tstruct>   FieldList
-%type<tbool>     FieldReference
-
-%type<tenum>     Enum
-%type<tenum>     EnumDefList
-%type<tenumv>    EnumDef
-%type<tenumv>    EnumValue
-
-%type<ttypedef>  Senum
-%type<tbase>     SenumDefList
-%type<id>        SenumDef
-
-%type<tconst>    Const
-%type<tconstv>   ConstValue
-%type<tconstv>   ConstList
-%type<tconstv>   ConstListContents
-%type<tconstv>   ConstMap
-%type<tconstv>   ConstMapContents
-
-%type<iconst>    StructHead
-%type<tstruct>   Struct
-%type<tstruct>   Xception
-%type<tservice>  Service
-
-%type<tfunction> Function
-%type<ttype>     FunctionType
-%type<tservice>  FunctionList
-
-%type<tstruct>   Throws
-%type<tservice>  Extends
-%type<tbool>     Oneway
-%type<tbool>     XsdAll
-%type<tbool>     XsdOptional
-%type<tbool>     XsdNillable
-%type<tstruct>   XsdAttributes
-%type<id>        CppType
-
-%type<dtext>     CaptureDocText
-
-%%
-
-/**
- * Thrift Grammar Implementation.
- *
- * For the most part this source file works its way top down from what you
- * might expect to find in a typical .thrift file, i.e. type definitions and
- * namespaces up top followed by service definitions using those types.
- */
-
-Program:
-  HeaderList DefinitionList
-    {
-      pdebug("Program -> Headers DefinitionList");
-      if((g_program_doctext_candidate != NULL) && (g_program_doctext_status != ALREADY_PROCESSED))
-      {
-        g_program->set_doc(g_program_doctext_candidate);
-        g_program_doctext_status = ALREADY_PROCESSED;
-      }
-      clear_doctext();
-    }
-
-CaptureDocText:
-    {
-      if (g_parse_mode == PROGRAM) {
-        $$ = g_doctext;
-        g_doctext = NULL;
-      } else {
-        $$ = NULL;
-      }
-    }
-
-/* TODO(dreiss): Try to DestroyDocText in all sorts or random places. */
-DestroyDocText:
-    {
-      if (g_parse_mode == PROGRAM) {
-        clear_doctext();
-      }
-    }
-
-/* We have to DestroyDocText here, otherwise it catches the doctext
-   on the first real element. */
-HeaderList:
-  HeaderList DestroyDocText Header
-    {
-      pdebug("HeaderList -> HeaderList Header");
-    }
-|
-    {
-      pdebug("HeaderList -> ");
-    }
-
-Header:
-  Include
-    {
-      pdebug("Header -> Include");
-    }
-| tok_namespace tok_identifier tok_identifier
-    {
-      pdebug("Header -> tok_namespace tok_identifier tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace($2, $3);
-      }
-    }
-| tok_namespace '*' tok_identifier
-    {
-      pdebug("Header -> tok_namespace * tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("*", $3);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_cpp_namespace tok_identifier
-    {
-      pwarning(1, "'cpp_namespace' is deprecated. Use 'namespace cpp' instead");
-      pdebug("Header -> tok_cpp_namespace tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("cpp", $2);
-      }
-    }
-| tok_cpp_include tok_literal
-    {
-      pdebug("Header -> tok_cpp_include tok_literal");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_cpp_include($2);
-      }
-    }
-| tok_php_namespace tok_identifier
-    {
-      pwarning(1, "'php_namespace' is deprecated. Use 'namespace php' instead");
-      pdebug("Header -> tok_php_namespace tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("php", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_py_module tok_identifier
-    {
-      pwarning(1, "'py_module' is deprecated. Use 'namespace py' instead");
-      pdebug("Header -> tok_py_module tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("py", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_perl_package tok_identifier
-    {
-      pwarning(1, "'perl_package' is deprecated. Use 'namespace perl' instead");
-      pdebug("Header -> tok_perl_namespace tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("perl", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_ruby_namespace tok_identifier
-    {
-      pwarning(1, "'ruby_namespace' is deprecated. Use 'namespace rb' instead");
-      pdebug("Header -> tok_ruby_namespace tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("rb", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_smalltalk_category tok_st_identifier
-    {
-      pwarning(1, "'smalltalk_category' is deprecated. Use 'namespace smalltalk.category' instead");
-      pdebug("Header -> tok_smalltalk_category tok_st_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("smalltalk.category", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_smalltalk_prefix tok_identifier
-    {
-      pwarning(1, "'smalltalk_prefix' is deprecated. Use 'namespace smalltalk.prefix' instead");
-      pdebug("Header -> tok_smalltalk_prefix tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("smalltalk.prefix", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_java_package tok_identifier
-    {
-      pwarning(1, "'java_package' is deprecated. Use 'namespace java' instead");
-      pdebug("Header -> tok_java_package tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("java", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_cocoa_prefix tok_identifier
-    {
-      pwarning(1, "'cocoa_prefix' is deprecated. Use 'namespace cocoa' instead");
-      pdebug("Header -> tok_cocoa_prefix tok_identifier");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("cocoa", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_xsd_namespace tok_literal
-    {
-      pwarning(1, "'xsd_namespace' is deprecated. Use 'namespace xsd' instead");
-      pdebug("Header -> tok_xsd_namespace tok_literal");
-      declare_valid_program_doctext();
-      if (g_parse_mode == PROGRAM) {
-        g_program->set_namespace("cocoa", $2);
-      }
-    }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_csharp_namespace tok_identifier
-   {
-     pwarning(1, "'csharp_namespace' is deprecated. Use 'namespace csharp' instead");
-     pdebug("Header -> tok_csharp_namespace tok_identifier");
-     declare_valid_program_doctext();
-     if (g_parse_mode == PROGRAM) {
-       g_program->set_namespace("csharp", $2);
-     }
-   }
-/* TODO(dreiss): Get rid of this once everyone is using the new hotness. */
-| tok_delphi_namespace tok_identifier
-   {
-     pwarning(1, "'delphi_namespace' is deprecated. Use 'namespace delphi' instead");
-     pdebug("Header -> tok_delphi_namespace tok_identifier");
-     declare_valid_program_doctext();
-     if (g_parse_mode == PROGRAM) {
-       g_program->set_namespace("delphi", $2);
-     }
-   }
-
-Include:
-  tok_include tok_literal
-    {
-      pdebug("Include -> tok_include tok_literal");
-      declare_valid_program_doctext();
-      if (g_parse_mode == INCLUDES) {
-        std::string path = include_file(std::string($2));
-        if (!path.empty()) {
-          g_program->add_include(path, std::string($2));
-        }
-      }
-    }
-
-DefinitionList:
-  DefinitionList CaptureDocText Definition
-    {
-      pdebug("DefinitionList -> DefinitionList Definition");
-      if ($2 != NULL && $3 != NULL) {
-        $3->set_doc($2);
-      }
-    }
-|
-    {
-      pdebug("DefinitionList -> ");
-    }
-
-Definition:
-  Const
-    {
-      pdebug("Definition -> Const");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_const($1);
-      }
-      $$ = $1;
-    }
-| TypeDefinition
-    {
-      pdebug("Definition -> TypeDefinition");
-      if (g_parse_mode == PROGRAM) {
-        g_scope->add_type($1->get_name(), $1);
-        if (g_parent_scope != NULL) {
-          g_parent_scope->add_type(g_parent_prefix + $1->get_name(), $1);
-        }
-        if (! g_program->is_unique_typename($1)) {
-          yyerror("Type \"%s\" is already defined.", $1->get_name().c_str());
-          exit(1);
-        }
-      }
-      $$ = $1;
-    }
-| Service
-    {
-      pdebug("Definition -> Service");
-      if (g_parse_mode == PROGRAM) {
-        g_scope->add_service($1->get_name(), $1);
-        if (g_parent_scope != NULL) {
-          g_parent_scope->add_service(g_parent_prefix + $1->get_name(), $1);
-        }
-        g_program->add_service($1);
-        if (! g_program->is_unique_typename($1)) {
-          yyerror("Type \"%s\" is already defined.", $1->get_name().c_str());
-          exit(1);
-        }
-      }
-      $$ = $1;
-    }
-
-TypeDefinition:
-  Typedef
-    {
-      pdebug("TypeDefinition -> Typedef");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_typedef($1);
-      }
-    }
-| Enum
-    {
-      pdebug("TypeDefinition -> Enum");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_enum($1);
-      }
-    }
-| Senum
-    {
-      pdebug("TypeDefinition -> Senum");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_typedef($1);
-      }
-    }
-| Struct
-    {
-      pdebug("TypeDefinition -> Struct");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_struct($1);
-      }
-    }
-| Xception
-    {
-      pdebug("TypeDefinition -> Xception");
-      if (g_parse_mode == PROGRAM) {
-        g_program->add_xception($1);
-      }
-    }
-
-CommaOrSemicolonOptional:
-  ','
-    {}
-| ';'
-    {}
-|
-    {}
-
-Typedef:
-  tok_typedef FieldType tok_identifier TypeAnnotations CommaOrSemicolonOptional
-    {
-      pdebug("TypeDef -> tok_typedef FieldType tok_identifier");
-      validate_simple_identifier( $3);
-      t_typedef *td = new t_typedef(g_program, $2, $3);
-      $$ = td;
-      if ($4 != NULL) {
-        $$->annotations_ = $4->annotations_;
-        delete $4;
-      }
-    }
-
-Enum:
-  tok_enum tok_identifier '{' EnumDefList '}' TypeAnnotations
-    {
-      pdebug("Enum -> tok_enum tok_identifier { EnumDefList }");
-      $$ = $4;
-      validate_simple_identifier( $2);
-      $$->set_name($2);
-      if ($6 != NULL) {
-        $$->annotations_ = $6->annotations_;
-        delete $6;
-      }
-
-      // make constants for all the enum values
-      if (g_parse_mode == PROGRAM) {
-        const std::vector<t_enum_value*>& enum_values = $$->get_constants();
-        std::vector<t_enum_value*>::const_iterator c_iter;
-        for (c_iter = enum_values.begin(); c_iter != enum_values.end(); ++c_iter) {
-          std::string const_name = $$->get_name() + "." + (*c_iter)->get_name();
-          t_const_value* const_val = new t_const_value((*c_iter)->get_value());
-          const_val->set_enum($$);
-          g_scope->add_constant(const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val));
-          if (g_parent_scope != NULL) {
-            g_parent_scope->add_constant(g_parent_prefix + const_name, new t_const(g_type_i32, (*c_iter)->get_name(), const_val));
-          }
-        }
-      }
-    }
-
-EnumDefList:
-  EnumDefList EnumDef
-    {
-      pdebug("EnumDefList -> EnumDefList EnumDef");
-      $$ = $1;
-      $$->append($2);
-    }
-|
-    {
-      pdebug("EnumDefList -> ");
-      $$ = new t_enum(g_program);
-      y_enum_val = -1;
-    }
-
-EnumDef:
-  CaptureDocText EnumValue TypeAnnotations CommaOrSemicolonOptional
-    {
-      pdebug("EnumDef -> EnumValue");
-      $$ = $2;
-      if ($1 != NULL) {
-        $$->set_doc($1);
-      }
-	  if ($3 != NULL) {
-        $$->annotations_ = $3->annotations_;
-        delete $3;
-      }
-    }
-
-EnumValue:
-  tok_identifier '=' tok_int_constant
-    {
-      pdebug("EnumValue -> tok_identifier = tok_int_constant");
-      if ($3 < INT32_MIN || $3 > INT32_MAX) {
-        // Note: this used to be just a warning.  However, since thrift always
-        // treats enums as i32 values, I'm changing it to a fatal error.
-        // I doubt this will affect many people, but users who run into this
-        // will have to update their thrift files to manually specify the
-        // truncated i32 value that thrift has always been using anyway.
-        failure("64-bit value supplied for enum %s will be truncated.", $1);
-      }
-      y_enum_val = static_cast<int32_t>($3);
-      $$ = new t_enum_value($1, y_enum_val);
-    }
- |
-  tok_identifier
-    {
-      pdebug("EnumValue -> tok_identifier");
-      validate_simple_identifier( $1);
-      if (y_enum_val == INT32_MAX) {
-        failure("enum value overflow at enum %s", $1);
-      }
-      ++y_enum_val;
-      $$ = new t_enum_value($1, y_enum_val);
-    }
-
-Senum:
-  tok_senum tok_identifier '{' SenumDefList '}' TypeAnnotations
-    {
-      pdebug("Senum -> tok_senum tok_identifier { SenumDefList }");
-      validate_simple_identifier( $2);
-      $$ = new t_typedef(g_program, $4, $2);
-      if ($6 != NULL) {
-        $$->annotations_ = $6->annotations_;
-        delete $6;
-      }
-    }
-
-SenumDefList:
-  SenumDefList SenumDef
-    {
-      pdebug("SenumDefList -> SenumDefList SenumDef");
-      $$ = $1;
-      $$->add_string_enum_val($2);
-    }
-|
-    {
-      pdebug("SenumDefList -> ");
-      $$ = new t_base_type("string", t_base_type::TYPE_STRING);
-      $$->set_string_enum(true);
-    }
-
-SenumDef:
-  tok_literal CommaOrSemicolonOptional
-    {
-      pdebug("SenumDef -> tok_literal");
-      $$ = $1;
-    }
-
-Const:
-  tok_const FieldType tok_identifier '=' ConstValue CommaOrSemicolonOptional
-    {
-      pdebug("Const -> tok_const FieldType tok_identifier = ConstValue");
-      if (g_parse_mode == PROGRAM) {
-        validate_simple_identifier( $3);
-        g_scope->resolve_const_value($5, $2);
-        $$ = new t_const($2, $3, $5);
-        validate_const_type($$);
-
-        g_scope->add_constant($3, $$);
-        if (g_parent_scope != NULL) {
-          g_parent_scope->add_constant(g_parent_prefix + $3, $$);
-        }
-      } else {
-        $$ = NULL;
-      }
-    }
-
-ConstValue:
-  tok_int_constant
-    {
-      pdebug("ConstValue => tok_int_constant");
-      $$ = new t_const_value();
-      $$->set_integer($1);
-      if (!g_allow_64bit_consts && ($1 < INT32_MIN || $1 > INT32_MAX)) {
-        pwarning(1, "64-bit constant \"%" PRIi64"\" may not work in all languages.\n", $1);
-      }
-    }
-| tok_dub_constant
-    {
-      pdebug("ConstValue => tok_dub_constant");
-      $$ = new t_const_value();
-      $$->set_double($1);
-    }
-| tok_literal
-    {
-      pdebug("ConstValue => tok_literal");
-      $$ = new t_const_value($1);
-    }
-| tok_identifier
-    {
-      pdebug("ConstValue => tok_identifier");
-      $$ = new t_const_value();
-      $$->set_identifier($1);
-    }
-| ConstList
-    {
-      pdebug("ConstValue => ConstList");
-      $$ = $1;
-    }
-| ConstMap
-    {
-      pdebug("ConstValue => ConstMap");
-      $$ = $1;
-    }
-
-ConstList:
-  '[' ConstListContents ']'
-    {
-      pdebug("ConstList => [ ConstListContents ]");
-      $$ = $2;
-    }
-
-ConstListContents:
-  ConstListContents ConstValue CommaOrSemicolonOptional
-    {
-      pdebug("ConstListContents => ConstListContents ConstValue CommaOrSemicolonOptional");
-      $$ = $1;
-      $$->add_list($2);
-    }
-|
-    {
-      pdebug("ConstListContents =>");
-      $$ = new t_const_value();
-      $$->set_list();
-    }
-
-ConstMap:
-  '{' ConstMapContents '}'
-    {
-      pdebug("ConstMap => { ConstMapContents }");
-      $$ = $2;
-    }
-
-ConstMapContents:
-  ConstMapContents ConstValue ':' ConstValue CommaOrSemicolonOptional
-    {
-      pdebug("ConstMapContents => ConstMapContents ConstValue CommaOrSemicolonOptional");
-      $$ = $1;
-      $$->add_map($2, $4);
-    }
-|
-    {
-      pdebug("ConstMapContents =>");
-      $$ = new t_const_value();
-      $$->set_map();
-    }
-
-StructHead:
-  tok_struct
-    {
-      $$ = struct_is_struct;
-    }
-| tok_union
-    {
-      $$ = struct_is_union;
-    }
-
-Struct:
-  StructHead tok_identifier XsdAll '{' FieldList '}' TypeAnnotations
-    {
-      pdebug("Struct -> tok_struct tok_identifier { FieldList }");
-      validate_simple_identifier( $2);
-      $5->set_xsd_all($3);
-      $5->set_union($1 == struct_is_union);
-      $$ = $5;
-      $$->set_name($2);
-      if ($7 != NULL) {
-        $$->annotations_ = $7->annotations_;
-        delete $7;
-      }
-    }
-
-XsdAll:
-  tok_xsd_all
-    {
-      $$ = true;
-    }
-|
-    {
-      $$ = false;
-    }
-
-XsdOptional:
-  tok_xsd_optional
-    {
-      $$ = true;
-    }
-|
-    {
-      $$ = false;
-    }
-
-XsdNillable:
-  tok_xsd_nillable
-    {
-      $$ = true;
-    }
-|
-    {
-      $$ = false;
-    }
-
-XsdAttributes:
-  tok_xsd_attrs '{' FieldList '}'
-    {
-      $$ = $3;
-    }
-|
-    {
-      $$ = NULL;
-    }
-
-Xception:
-  tok_xception tok_identifier '{' FieldList '}' TypeAnnotations
-    {
-      pdebug("Xception -> tok_xception tok_identifier { FieldList }");
-      validate_simple_identifier( $2);
-      $4->set_name($2);
-      $4->set_xception(true);
-      $$ = $4;
-      if ($6 != NULL) {
-        $$->annotations_ = $6->annotations_;
-        delete $6;
-      }
-    }
-
-Service:
-  tok_service tok_identifier Extends '{' FlagArgs FunctionList UnflagArgs '}' TypeAnnotations
-    {
-      pdebug("Service -> tok_service tok_identifier { FunctionList }");
-      validate_simple_identifier( $2);
-      $$ = $6;
-      $$->set_name($2);
-      $$->set_extends($3);
-      if ($9 != NULL) {
-        $$->annotations_ = $9->annotations_;
-        delete $9;
-      }
-    }
-
-FlagArgs:
-    {
-       g_arglist = 1;
-    }
-
-UnflagArgs:
-    {
-       g_arglist = 0;
-    }
-
-Extends:
-  tok_extends tok_identifier
-    {
-      pdebug("Extends -> tok_extends tok_identifier");
-      $$ = NULL;
-      if (g_parse_mode == PROGRAM) {
-        $$ = g_scope->get_service($2);
-        if ($$ == NULL) {
-          yyerror("Service \"%s\" has not been defined.", $2);
-          exit(1);
-        }
-      }
-    }
-|
-    {
-      $$ = NULL;
-    }
-
-FunctionList:
-  FunctionList Function
-    {
-      pdebug("FunctionList -> FunctionList Function");
-      $$ = $1;
-      $1->add_function($2);
-    }
-|
-    {
-      pdebug("FunctionList -> ");
-      $$ = new t_service(g_program);
-    }
-
-Function:
-  CaptureDocText Oneway FunctionType tok_identifier '(' FieldList ')' Throws TypeAnnotations CommaOrSemicolonOptional
-    {
-      validate_simple_identifier( $4);
-      $6->set_name(std::string($4) + "_args");
-      $$ = new t_function($3, $4, $6, $8, $2);
-      if ($1 != NULL) {
-        $$->set_doc($1);
-      }
-      if ($9 != NULL) {
-        $$->annotations_ = $9->annotations_;
-        delete $9;
-      }
-    }
-
-Oneway:
-  tok_oneway
-    {
-      $$ = true;
-    }
-|
-    {
-      $$ = false;
-    }
-
-Throws:
-  tok_throws '(' FieldList ')'
-    {
-      pdebug("Throws -> tok_throws ( FieldList )");
-      $$ = $3;
-      if (g_parse_mode == PROGRAM && !validate_throws($$)) {
-        yyerror("Throws clause may not contain non-exception types");
-        exit(1);
-      }
-    }
-|
-    {
-      $$ = new t_struct(g_program);
-    }
-
-FieldList:
-  FieldList Field
-    {
-      pdebug("FieldList -> FieldList , Field");
-      $$ = $1;
-      if (!($$->append($2))) {
-        yyerror("\"%d: %s\" - field identifier/name has already been used", $2->get_key(), $2->get_name().c_str());
-        exit(1);
-      }
-    }
-|
-    {
-      pdebug("FieldList -> ");
-      y_field_val = -1;
-      $$ = new t_struct(g_program);
-    }
-
-Field:
-  CaptureDocText FieldIdentifier FieldRequiredness FieldType FieldReference tok_identifier FieldValue XsdOptional XsdNillable XsdAttributes TypeAnnotations CommaOrSemicolonOptional
-    {
-      pdebug("tok_int_constant : Field -> FieldType tok_identifier");
-      if ($2.auto_assigned) {
-        pwarning(1, "No field key specified for %s, resulting protocol may have conflicts or not be backwards compatible!\n", $6);
-        if (g_strict >= 192) {
-          yyerror("Implicit field keys are deprecated and not allowed with -strict");
-          exit(1);
-        }
-      }
-      validate_simple_identifier($6);
-      $$ = new t_field($4, $6, $2.value);
-      $$->set_reference($5);
-      $$->set_req($3);
-      if ($7 != NULL) {
-        g_scope->resolve_const_value($7, $4);
-        validate_field_value($$, $7);
-        $$->set_value($7);
-      }
-      $$->set_xsd_optional($8);
-      $$->set_xsd_nillable($9);
-      if ($1 != NULL) {
-        $$->set_doc($1);
-      }
-      if ($10 != NULL) {
-        $$->set_xsd_attrs($10);
-      }
-      if ($11 != NULL) {
-        $$->annotations_ = $11->annotations_;
-        delete $11;
-      }
-    }
-
-FieldIdentifier:
-  tok_int_constant ':'
-    {
-      if ($1 <= 0) {
-        if (g_allow_neg_field_keys) {
-          /*
-           * g_allow_neg_field_keys exists to allow users to add explicitly
-           * specified key values to old .thrift files without breaking
-           * protocol compatibility.
-           */
-          if ($1 != y_field_val) {
-            /*
-             * warn if the user-specified negative value isn't what
-             * thrift would have auto-assigned.
-             */
-            pwarning(1, "Nonpositive field key (%" PRIi64") differs from what would be "
-                     "auto-assigned by thrift (%d).\n", $1, y_field_val);
-          }
-          /*
-           * Leave $1 as-is, and update y_field_val to be one less than $1.
-           * The FieldList parsing will catch any duplicate key values.
-           */
-          y_field_val = static_cast<int32_t>($1 - 1);
-          $$.value = static_cast<int32_t>($1);
-          $$.auto_assigned = false;
-        } else {
-          pwarning(1, "Nonpositive value (%d) not allowed as a field key.\n",
-                   $1);
-          $$.value = y_field_val--;
-          $$.auto_assigned = true;
-        }
-      } else {
-        $$.value = static_cast<int32_t>($1);
-        $$.auto_assigned = false;
-      }
-    }
-|
-    {
-      $$.value = y_field_val--;
-      $$.auto_assigned = true;
-    }
-
-FieldReference:
-  tok_reference
-    {
-      $$ = true;
-    }
-|
-   {
-     $$ = false;
-   }
-
-FieldRequiredness:
-  tok_required
-    {
-      $$ = t_field::T_REQUIRED;
-    }
-| tok_optional
-    {
-      if (g_arglist) {
-        if (g_parse_mode == PROGRAM) {
-          pwarning(1, "optional keyword is ignored in argument lists.\n");
-        }
-        $$ = t_field::T_OPT_IN_REQ_OUT;
-      } else {
-        $$ = t_field::T_OPTIONAL;
-      }
-    }
-|
-    {
-      $$ = t_field::T_OPT_IN_REQ_OUT;
-    }
-
-FieldValue:
-  '=' ConstValue
-    {
-      if (g_parse_mode == PROGRAM) {
-        $$ = $2;
-      } else {
-        $$ = NULL;
-      }
-    }
-|
-    {
-      $$ = NULL;
-    }
-
-FunctionType:
-  FieldType
-    {
-      pdebug("FunctionType -> FieldType");
-      $$ = $1;
-    }
-| tok_void
-    {
-      pdebug("FunctionType -> tok_void");
-      $$ = g_type_void;
-    }
-
-FieldType:
-  tok_identifier
-    {
-      pdebug("FieldType -> tok_identifier");
-      if (g_parse_mode == INCLUDES) {
-        // Ignore identifiers in include mode
-        $$ = NULL;
-      } else {
-        // Lookup the identifier in the current scope
-        $$ = g_scope->get_type($1);
-        if ($$ == NULL) {
-          /*
-           * Either this type isn't yet declared, or it's never
-             declared.  Either way allow it and we'll figure it out
-             during generation.
-           */
-          $$ = new t_typedef(g_program, $1, true);
-        }
-      }
-    }
-| BaseType
-    {
-      pdebug("FieldType -> BaseType");
-      $$ = $1;
-    }
-| ContainerType
-    {
-      pdebug("FieldType -> ContainerType");
-      $$ = $1;
-    }
-
-BaseType: SimpleBaseType TypeAnnotations
-    {
-      pdebug("BaseType -> SimpleBaseType TypeAnnotations");
-      if ($2 != NULL) {
-        $$ = new t_base_type(*static_cast<t_base_type*>($1));
-        $$->annotations_ = $2->annotations_;
-        delete $2;
-      } else {
-        $$ = $1;
-      }
-    }
-
-SimpleBaseType:
-  tok_string
-    {
-      pdebug("BaseType -> tok_string");
-      $$ = g_type_string;
-    }
-| tok_binary
-    {
-      pdebug("BaseType -> tok_binary");
-      $$ = g_type_binary;
-    }
-| tok_slist
-    {
-      pdebug("BaseType -> tok_slist");
-      $$ = g_type_slist;
-    }
-| tok_bool
-    {
-      pdebug("BaseType -> tok_bool");
-      $$ = g_type_bool;
-    }
-| tok_byte
-    {
-      pdebug("BaseType -> tok_byte");
-      $$ = g_type_byte;
-    }
-| tok_i16
-    {
-      pdebug("BaseType -> tok_i16");
-      $$ = g_type_i16;
-    }
-| tok_i32
-    {
-      pdebug("BaseType -> tok_i32");
-      $$ = g_type_i32;
-    }
-| tok_i64
-    {
-      pdebug("BaseType -> tok_i64");
-      $$ = g_type_i64;
-    }
-| tok_double
-    {
-      pdebug("BaseType -> tok_double");
-      $$ = g_type_double;
-    }
-
-ContainerType: SimpleContainerType TypeAnnotations
-    {
-      pdebug("ContainerType -> SimpleContainerType TypeAnnotations");
-      $$ = $1;
-      if ($2 != NULL) {
-        $$->annotations_ = $2->annotations_;
-        delete $2;
-      }
-    }
-
-SimpleContainerType:
-  MapType
-    {
-      pdebug("SimpleContainerType -> MapType");
-      $$ = $1;
-    }
-| SetType
-    {
-      pdebug("SimpleContainerType -> SetType");
-      $$ = $1;
-    }
-| ListType
-    {
-      pdebug("SimpleContainerType -> ListType");
-      $$ = $1;
-    }
-
-MapType:
-  tok_map CppType '<' FieldType ',' FieldType '>'
-    {
-      pdebug("MapType -> tok_map <FieldType, FieldType>");
-      $$ = new t_map($4, $6);
-      if ($2 != NULL) {
-        ((t_container*)$$)->set_cpp_name(std::string($2));
-      }
-    }
-
-SetType:
-  tok_set CppType '<' FieldType '>'
-    {
-      pdebug("SetType -> tok_set<FieldType>");
-      $$ = new t_set($4);
-      if ($2 != NULL) {
-        ((t_container*)$$)->set_cpp_name(std::string($2));
-      }
-    }
-
-ListType:
-  tok_list '<' FieldType '>' CppType
-    {
-      pdebug("ListType -> tok_list<FieldType>");
-      check_for_list_of_bytes($3);
-      $$ = new t_list($3);
-      if ($5 != NULL) {
-        ((t_container*)$$)->set_cpp_name(std::string($5));
-      }
-    }
-
-CppType:
-  tok_cpp_type tok_literal
-    {
-      $$ = $2;
-    }
-|
-    {
-      $$ = NULL;
-    }
-
-TypeAnnotations:
-  '(' TypeAnnotationList ')'
-    {
-      pdebug("TypeAnnotations -> ( TypeAnnotationList )");
-      $$ = $2;
-    }
-|
-    {
-      $$ = NULL;
-    }
-
-TypeAnnotationList:
-  TypeAnnotationList TypeAnnotation
-    {
-      pdebug("TypeAnnotationList -> TypeAnnotationList , TypeAnnotation");
-      $$ = $1;
-      $$->annotations_[$2->key] = $2->val;
-      delete $2;
-    }
-|
-    {
-      /* Just use a dummy structure to hold the annotations. */
-      $$ = new t_struct(g_program);
-    }
-
-TypeAnnotation:
-  tok_identifier TypeAnnotationValue CommaOrSemicolonOptional
-    {
-      pdebug("TypeAnnotation -> TypeAnnotationValue");
-      $$ = new t_annotation;
-      $$->key = $1;
-      $$->val = $2;
-    }
-
-TypeAnnotationValue:
-  '=' tok_literal
-    {
-      pdebug("TypeAnnotationValue -> = tok_literal");
-      $$ = $2;
-    }
-|
-    {
-      pdebug("TypeAnnotationValue ->");
-      $$ = strdup("1");
-    }
-
-%%

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/windows/config.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/windows/config.h b/depends/thirdparty/thrift/compiler/cpp/src/windows/config.h
deleted file mode 100644
index a600080..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/windows/config.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_CONFIG_H_
-#define _THRIFT_WINDOWS_CONFIG_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error "This is a Windows header only"
-#endif
-
-#include <io.h>
-#include <stdlib.h>
-#include <direct.h>
-
-#define strtoll(begin_ptr, end_ptr, length) _strtoi64(begin_ptr, end_ptr, length)
-
-#define PRIu64 "I64d"
-#define PRIi64 "I64d"
-
-// squelch deprecation warnings
-#pragma warning(disable : 4996)
-// squelch bool conversion performance warning
-#pragma warning(disable : 4800)
-
-#endif // _THRIFT_WINDOWS_CONFIG_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/windows/version.h.in
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/windows/version.h.in b/depends/thirdparty/thrift/compiler/cpp/src/windows/version.h.in
deleted file mode 100644
index 00ebca6..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/windows/version.h.in
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_WINDOWS_VERSION_H_
-#define _THRIFT_WINDOWS_VERSION_H_ 1
-
-#if defined(_MSC_VER) && (_MSC_VER > 1200)
-#pragma once
-#endif // _MSC_VER
-
-#ifndef _WIN32
-#error "This is a Windows header only"
-#endif
-
-#define THRIFT_VERSION "@PACKAGE_VERSION@"
-
-#endif // _THRIFT_WINDOWS_VERSION_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/version.h.in
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/version.h.in b/depends/thirdparty/thrift/compiler/cpp/version.h.in
deleted file mode 100644
index 5770ec9..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/version.h.in
+++ /dev/null
@@ -1 +0,0 @@
-#define THRIFT_VERSION "@PACKAGE_VERSION@"

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/composer.json
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/composer.json b/depends/thirdparty/thrift/composer.json
deleted file mode 100644
index 0f22b76..0000000
--- a/depends/thirdparty/thrift/composer.json
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-    "name": "apache/thrift",
-    "description": "Apache Thrift RPC system",
-    "homepage": "http://thrift.apache.org/",
-    "type": "library",
-    "license": "Apache-2.0",
-    "authors": [
-        {
-            "name": "Apache Thrift Developers",
-            "email": "dev@thrift.apache.org",
-            "homepage": "http://thrift.apache.org"
-        }
-    ],
-    "support": {
-        "email": "dev@thrift.apache.org",
-        "issues": "https://issues.apache.org/jira/browse/THRIFT"
-    },
-    "require": {
-        "php": ">=5.3.0"
-    },
-    "autoload": {
-        "psr-0": {"Thrift": "lib/php/lib/"}
-    },
-    "minimum-stability": "dev",
-    "extra": {
-        "branch-alias": {
-            "dev-master": "1.0.x-dev"
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/configure.ac
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/configure.ac b/depends/thirdparty/thrift/configure.ac
deleted file mode 100755
index 18e3233..0000000
--- a/depends/thirdparty/thrift/configure.ac
+++ /dev/null
@@ -1,891 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-AC_PREREQ(2.65)
-AC_CONFIG_MACRO_DIR([./aclocal])
-
-AC_INIT([thrift], [0.9.3])
-
-AC_CONFIG_AUX_DIR([.])
-
-AM_INIT_AUTOMAKE([1.13 subdir-objects tar-ustar])
-PKG_PROG_PKG_CONFIG
-
-AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
-                         (Normal --prefix is ignored for Python because
-                         Python has different conventions.)
-                         Default = "/usr"])
-AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
-
-AC_ARG_VAR([JAVA_PREFIX], [Prefix for installing the Java lib jar.
-                           (Normal --prefix is ignored for Java because
-                           Java has different conventions.)
-                           Default = "/usr/local/lib"])
-AS_IF([test "x$JAVA_PREFIX" = x], [JAVA_PREFIX="/usr/local/lib"])
-
-AC_ARG_VAR([RUBY_PREFIX], [Prefix for installing Ruby modules.
-                           (Normal --prefix is ignored for Ruby because
-                           Ruby has different conventions.)
-                           Default = none, let ruby setup decide])
-
-AC_ARG_VAR([PHP_PREFIX], [Prefix for installing PHP modules.
-                         (Normal --prefix is ignored for PHP because
-                         PHP has different conventions.)
-                         Default = "/usr/lib/php"])
-AS_IF([test "x$PHP_PREFIX" = x], [PHP_PREFIX="/usr/lib/php"])
-
-AC_ARG_VAR([PHP_CONFIG_PREFIX],
-           [Prefix for installing PHP extension module .ini file.
-            (Normal --prefix is ignored for PHP because PHP has
-             different conventions.)
-           Default = "/etc/php.d"])
-AS_IF([test "x$PHP_CONFIG_PREFIX" = x], [PHP_CONFIG_PREFIX="/etc/php.d"])
-
-AC_ARG_VAR([INSTALLDIRS], [When installing Perl modules, specifies which
-                           of the sets of installation directories
-                           to choose: perl, site or vendor.
-                           Default = "vendor"])
-AS_IF([test "x$INSTALLDIRS" = x], [INSTALLDIRS="vendor"])
-
-AC_ARG_VAR([PERL_PREFIX], [Prefix for installing Perl modules.
-                           (Normal --prefix is ignored for Perl because
-                           Perl has different conventions.)
-                           Ignored, when INSTALLDIRS set to site or vendor.
-                           Default = "/usr/local/lib"])
-AS_IF([test "x$PERL_PREFIX" = x], [PERL_PREFIX="/usr/local"])
-
-AC_ARG_VAR([CABAL_CONFIGURE_FLAGS],
-           [Extra flags to pass to cabal: "cabal Setup.lhs configure $CABAL_CONFIGURE_FLAGS".
-            (Typically used to set --user or force --global.)])
-
-AC_SUBST(CABAL_CONFIGURE_FLAGS)
-
-AC_ARG_VAR([D_IMPORT_PREFIX], [Prefix for installing D modules.
-                           [INCLUDEDIR/d2]])
-AS_IF([test "x$D_IMPORT_PREFIX" = x], [D_IMPORT_PREFIX="${includedir}/d2"])
-
-AC_ARG_VAR([DMD_LIBEVENT_FLAGS], [DMD flags for linking libevent (auto-detected if not set).])
-AC_ARG_VAR([DMD_OPENSSL_FLAGS], [DMD flags for linking OpenSSL (auto-detected if not set).])
-
-AC_PROG_CC
-AC_PROG_CPP
-AC_PROG_CXX
-AC_PROG_INSTALL
-AC_PROG_LIBTOOL
-AC_PROG_MAKE_SET
-AC_PROG_BISON(2.5)
-AC_PROG_YACC
-AC_PROG_LEX
-AM_PROG_LEX
-AC_PROG_LN_S
-AC_PROG_MKDIR_P
-AC_PROG_AWK
-AC_PROG_RANLIB
-
-AC_LANG([C++])
-AX_CXX_COMPILE_STDCXX_11([noext], [optional])
-
-AM_EXTRA_RECURSIVE_TARGETS([style])
-AC_SUBST(CPPSTYLE_CMD, 'find . -type f \( -iname "*.h" -or -iname "*.cpp" -or -iname "*.cc" -or -iname "*.tcc" \) -printf "Reformatting: %h/%f\n" -exec clang-format -i {} \;')
-
-AC_ARG_ENABLE([libs],
-  AS_HELP_STRING([--enable-libs], [build the Apache Thrift libraries [default=yes]]),
-  [], enable_libs=yes
-)
-have_libs=yes
-if test "$enable_libs" = "no"; then
-  have_libs="no"
-  with_cpp="no"
-  with_c_glib="no"
-  with_java="no"
-  with_csharp="no"
-  with_python="no"
-  with_ruby="no"
-  with_haskell="no"
-  with_haxe="no"
-  with_perl="no"
-  with_php="no"
-  with_php_extension="no"
-  with_erlang="no"
-  with_go="no"
-  with_d="no"
-  with_nodejs="no"
-  with_lua="no"
-fi
-
-
-AX_THRIFT_LIB(cpp, [C++], yes)
-have_cpp=no
-if test "$with_cpp" = "yes";  then
-  AX_BOOST_BASE([1.53.0])
-  if test "x$succeeded" = "xyes" ; then
-    AC_SUBST([BOOST_LIB_DIR], [$(echo "$BOOST_LDFLAGS" | sed -e 's/^\-L//')])
-    AC_SUBST([BOOST_CHRONO_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_chrono.a")])
-    AC_SUBST([BOOST_FILESYSTEM_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_filesystem.a")])
-    AC_SUBST([BOOST_SYSTEM_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_system.a")])
-    AC_SUBST([BOOST_TEST_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_unit_test_framework.a")])
-    AC_SUBST([BOOST_THREAD_LDADD], [$(echo "$BOOST_LIB_DIR/libboost_thread.a")])
-    have_cpp="yes"
-  fi
-
-  AX_CHECK_OPENSSL()
-
-  AX_LIB_EVENT([1.0])
-  have_libevent=$success
-
-  AX_LIB_ZLIB([1.2.3])
-  have_zlib=$success
-
-  AX_THRIFT_LIB(qt4, [Qt], yes)
-  have_qt=no
-  if test "$with_qt4" = "yes";  then
-    PKG_CHECK_MODULES([QT], [QtCore >= 4.3, QtNetwork >= 4.3], have_qt=yes, have_qt=no)
-  fi
-  if test "$have_qt" = "yes"; then
-    AC_PATH_PROGS([QT_MOC], [moc-qt4 moc], "fail")
-    if test "$QT_MOC" = "fail"; then
-      have_qt=no
-    fi
-  fi
-
-  AX_THRIFT_LIB(qt5, [Qt5], yes)
-  have_qt5=no
-  qt_reduce_reloc=""
-  if test "$with_qt5" = "yes";  then
-    PKG_CHECK_MODULES([QT5], [Qt5Core >= 5.0, Qt5Network >= 5.0],
-                      [have_qt5=yes;qt_reduce_reloc=`$PKG_CONFIG --variable=qt_config Qt5Core | grep "reduce_relocations"`],
-                      [have_qt5=no])
-  fi
-  if test "$have_qt5" = "yes"; then
-    AC_PATH_PROGS([QT5_MOC], [moc-qt5 moc], "fail")
-    if test "$QT5_MOC" = "fail"; then
-      have_qt5=no
-    fi
-  fi
-fi
-AM_CONDITIONAL([WITH_CPP], [test "$have_cpp" = "yes"])
-AM_CONDITIONAL([AMX_HAVE_LIBEVENT], [test "$have_libevent" = "yes"])
-AM_CONDITIONAL([AMX_HAVE_ZLIB], [test "$have_zlib" = "yes"])
-AM_CONDITIONAL([AMX_HAVE_QT], [test "$have_qt" = "yes"])
-AM_CONDITIONAL([AMX_HAVE_QT5], [test "$have_qt5" = "yes"])
-AM_CONDITIONAL([QT5_REDUCE_RELOCATIONS], [test "x$qt_reduce_reloc" != "x"])
-
-AX_THRIFT_LIB(c_glib, [C (GLib)], yes)
-if test "$with_c_glib" = "yes"; then
-  PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.0], have_glib2=yes, have_glib2=no)
-  PKG_CHECK_MODULES([GOBJECT], [gobject-2.0 >= 2.0], have_gobject2=yes, have_gobject2=no)
-  if test "$have_glib2" = "yes" -a "$have_gobject2" = "yes" ; then
-    have_c_glib="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_C_GLIB, [test "$have_glib2" = "yes" -a "$have_gobject2" = "yes"])
-
-AX_THRIFT_LIB(csharp, [C#], yes)
-if test "$with_csharp" = "yes";  then
-  PKG_CHECK_MODULES(MONO, mono >= 2.11.0, mono_2_11=yes, mono_2_11=no)
-  if test "$mono_2_11" == "yes"; then
-    AC_PATH_PROG([MCS], [mcs])
-    if test "x$MCS" != "x"; then
-      mono_mcs="yes"
-    fi
-  fi
-  PKG_CHECK_MODULES(MONO, mono >= 2.0.0, net_3_5=yes, net_3_5=no)
-  PKG_CHECK_MODULES(MONO, mono >= 1.2.4, have_mono=yes, have_mono=no)
-  if test "$have_mono" = "yes" ; then
-    have_csharp="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_MONO, [test "$have_csharp" = "yes"])
-AM_CONDITIONAL(NET_2_0, [test "$net_3_5" = "no"])
-AM_CONDITIONAL(MONO_MCS, [test "$mono_mcs" = "yes"])
-
-AX_THRIFT_LIB(java, [Java], yes)
-if test "$with_java" = "yes";  then
-  AX_JAVAC_AND_JAVA
-  AC_PATH_PROG([ANT], [ant])
-  AX_CHECK_ANT_VERSION($ANT, 1.7)
-  AC_SUBST(CLASSPATH)
-  AC_SUBST(ANT_FLAGS)
-  if test "x$JAVA" != "x" && test "x$JAVAC" != "x" && test "x$ANT" != "x" ; then
-    have_java="yes"
-  fi
-fi
-AM_CONDITIONAL([WITH_JAVA], [test "$have_java" = "yes"])
-
-AX_THRIFT_LIB(erlang, [Erlang], yes)
-if test "$with_erlang" = "yes";  then
-  AC_ERLANG_PATH_ERL
-  AC_ERLANG_PATH_ERLC
-  if test -n "$ERLC" ; then
-    AC_ERLANG_SUBST_LIB_DIR
-    # Install into the detected Erlang directory instead of $libdir/erlang/lib
-    ERLANG_INSTALL_LIB_DIR="$ERLANG_LIB_DIR"
-    AC_ERLANG_SUBST_INSTALL_LIB_SUBDIR(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
-  fi
-  if test -n "$ERL" -a -n "$ERLC" ; then
-    have_erlang="yes"
-
-    # otp_release is simply a number (like "17") for OTP17+ while "R16..." for OTP16 or less.
-    # OTP version is currently only used for running tests.
-    if $ERL -eval 'erlang:display(erlang:system_info(otp_release)),halt().' -noshell | grep "^\"R" >/dev/null; then
-      erlang_otp16_or_less="yes"
-    fi
-  fi
-fi
-AM_CONDITIONAL(WITH_ERLANG, [test "$have_erlang" = "yes"])
-AM_CONDITIONAL(ERLANG_OTP16, [test "$erlang_otp16_or_less" = "yes"])
-
-AX_THRIFT_LIB(nodejs, [Nodejs], yes)
-have_nodejs=no
-if test "$with_nodejs" = "yes"; then
-  AC_PATH_PROGS([NODEJS], [nodejs node])
-  AC_PATH_PROG([NPM], [npm])
-  if test "x$NODEJS" != "x" -a "x$NPM" != "x"; then
-    have_nodejs="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_NODEJS, [test "$have_nodejs" = "yes"])
-AM_CONDITIONAL(HAVE_NPM, [test "x$NPM" != "x"])
-
-AX_THRIFT_LIB(lua, [Lua], yes)
-have_lua=no
-if test "$with_lua" = "yes"; then
-  AX_PROG_LUA(5.2,, have_lua="yes", have_lua="no")
-  if test "$have_lua" = "yes"; then
-    AX_LUA_HEADERS(, have_lua="no")
-    AX_LUA_LIBS(, have_lua="no")
-  fi
-fi
-AM_CONDITIONAL(WITH_LUA, [test "$have_lua" = "yes"])
-
-AX_THRIFT_LIB(python, [Python], yes)
-if test "$with_python" = "yes";  then
-  AC_PATH_PROG([TRIAL], [trial])
-  AM_PATH_PYTHON(2.4,, :)
-  if test -n "$TRIAL" && test "x$PYTHON" != "x" && test "x$PYTHON" != "x:" ; then
-    have_python="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"])
-
-AX_THRIFT_LIB(perl, [Perl], yes)
-if test "$with_perl" = "yes"; then
-  AC_PATH_PROG([PERL], [perl])
-  if test -n "$PERL" ; then
-    AC_PROG_PERL_MODULES([Bit::Vector], success="yes", success="no")
-    have_perl_bit_vector="$success"
-    AC_PROG_PERL_MODULES([Class::Accessor], success="yes", success="no")
-    have_perl_class_accessor="$success"
-  fi
-  if test -n "$PERL" -a "$have_perl_bit_vector" = "yes" ; then
-    if test -n "$PERL" -a "$have_perl_class_accessor" = "yes" ; then
-      have_perl="yes"
-    fi
-  fi
-fi
-AM_CONDITIONAL(WITH_PERL, [test "$have_perl" = "yes"])
-
-AX_THRIFT_LIB(php, [PHP], yes)
-if test "$with_php" = "yes"; then
-  AC_PATH_PROG([PHP], [php])
-  if test -n "$PHP" ; then
-    have_php="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_PHP, [test "$have_php" = "yes"])
-
-AX_THRIFT_LIB(php_extension, [PHP_EXTENSION], yes)
-if test "$with_php_extension" = "yes"; then
-  if test -f "lib/php/src/ext/thrift_protocol/configure"; then
-    AC_PATH_PROG([PHP_CONFIG], [php-config])
-    if test -n "$PHP_CONFIG" ; then
-      AC_CONFIG_SUBDIRS([lib/php/src/ext/thrift_protocol])
-      have_php_extension="yes"
-    fi
-  fi
-fi
-AM_CONDITIONAL(WITH_PHP_EXTENSION, [test "$have_php_extension" = "yes"])
-
-AC_PATH_PROG([PHPUNIT], [phpunit])
-AM_CONDITIONAL(HAVE_PHPUNIT, [test "x$PHPUNIT" != "x"])
-
-AX_THRIFT_LIB(ruby, [Ruby], yes)
-have_ruby=no
-if test "$with_ruby" = "yes"; then
-  AC_PATH_PROG([RUBY], [ruby])
-  AC_PATH_PROG([BUNDLER], [bundle])
-  if test "x$RUBY" != "x" -a "x$BUNDLER" != "x"; then
-    have_ruby="yes"
-  fi
-fi
-AM_CONDITIONAL(WITH_RUBY, [test "$have_ruby" = "yes"])
-AM_CONDITIONAL(HAVE_BUNDLER, [test "x$BUNDLER" != "x"])
-
-AX_THRIFT_LIB(haskell, [Haskell], yes)
-have_haskell=no
-RUNHASKELL=true
-CABAL=true
-if test "$with_haskell" = "yes"; then
-  AC_PATH_PROG([CABAL], [cabal])
-  AC_PATH_PROG([RUNHASKELL], [runhaskell])
-  if test "x$CABAL" != "x" -a "x$RUNHASKELL" != "x"; then
-    have_haskell="yes"
-  else
-    RUNHASKELL=true
-    CABAL=true
-  fi
-fi
-AC_SUBST(CABAL)
-AC_SUBST(RUNHASKELL)
-AM_CONDITIONAL(WITH_HASKELL, [test "$have_haskell" = "yes"])
-
-AX_THRIFT_LIB(go, [Go], yes)
-if test "$with_go" = "yes";  then
-  AC_PATH_PROG([GO], [go])
-  if [[ -x "$GO" ]] ; then
-    AS_IF([test -n "$GO"],[
-      ax_go_version="1.4"
-
-      AC_MSG_CHECKING([for Go version])
-      golang_version=`$GO version 2>&1 | $SED -e 's/\(go \)\(version \)\(go\)\(@<:@0-9@:>@.@<:@0-9@:>@.@<:@0-9@:>@\)\(@<:@\*@:>@*\).*/\4/'`
-      AC_MSG_RESULT($golang_version)
-      AC_SUBST([golang_version],[$golang_version])
-      AX_COMPARE_VERSION([$ax_go_version],[le],[$golang_version],[
-      :
-        have_go="yes"
-      ],[
-      :
-        have_go="no"
-      ])
-    ],[
-      AC_MSG_WARN([could not find Go ])
-      have_go="no"
-    ])
-  fi
-fi
-AM_CONDITIONAL(WITH_GO, [test "$have_go" = "yes"])
-
-
-AX_THRIFT_LIB(haxe, [Haxe], yes)
-if test "$with_haxe" = "yes";  then
-  AC_PATH_PROG([HAXE], [haxe])
-  if [[ -x "$HAXE" ]] ; then
-    AX_PROG_HAXE_VERSION( [3.1.3], have_haxe="yes", have_haxe="no")
-  fi
-fi
-AM_CONDITIONAL(WITH_HAXE, [test "$have_haxe" = "yes"])
-
-
-AX_THRIFT_LIB(d, [D], yes)
-if test "$with_d" = "yes";  then
-  AX_DMD
-  AC_SUBST(DMD)
-  if test "x$DMD" != "x"; then
-    have_d="yes"
-  fi
-fi
-
-# Determine actual name of the generated D library for use in the command line
-# when compiling tests. This is needed because the -l<lib> syntax doesn't work
-# with OPTLINK (Windows).
-lib_prefix=lib
-lib_suffix=a
-case "$host_os" in
-  cygwin* | mingw* | pw32* | cegcc*)
-    lib_prefix=""
-    lib_suffix=lib
-    ;;
-esac
-D_LIB_NAME="${lib_prefix}thriftd.${lib_suffix}"
-AC_SUBST(D_LIB_NAME)
-D_EVENT_LIB_NAME="${lib_prefix}thriftd-event.${lib_suffix}"
-AC_SUBST(D_EVENT_LIB_NAME)
-D_SSL_LIB_NAME="${lib_prefix}thriftd-ssl.${lib_suffix}"
-AC_SUBST(D_SSL_LIB_NAME)
-
-if test "$have_d" = "yes"; then
-  AX_CHECK_D_MODULE(deimos.event2.event)
-  have_deimos_event2=$success
-
-  with_d_event_tests="no"
-  if test "$have_deimos_event2" = "yes"; then
-    if test "x$DMD_LIBEVENT_FLAGS" = "x"; then
-      if test "$dmd_optlink" = "yes"; then
-        AC_MSG_WARN([D libevent interface found, but cannot auto-detect \
-linker flags for OPTLINK. Please set DMD_LIBEVENT_FLAGS manually.])
-      else
-        AX_LIB_EVENT([2.0])
-        if test "$success" = "yes"; then
-          DMD_LIBEVENT_FLAGS=$(echo "$LIBEVENT_LDFLAGS $LIBEVENT_LIBS" | \
-            sed -e 's/^ *//g;s/ *$//g;s/^\(.\)/-L\1/g;s/  */ -L/g')
-          with_d_event_tests="yes"
-        else
-          AC_MSG_WARN([D libevent interface present, but libevent library not found.])
-        fi
-      fi
-    else
-      with_d_event_tests="yes"
-    fi
-  fi
-
-  AX_CHECK_D_MODULE(deimos.openssl.ssl)
-  have_deimos_openssl=$success
-
-  with_d_ssl_tests="no"
-  if test "$have_deimos_openssl" = "yes"; then
-    if test "x$DMD_OPENSSL_FLAGS" = "x"; then
-      if test "$dmd_optlink" = "yes"; then
-        AC_MSG_WARN([D OpenSSL interface found, but cannot auto-detect \
-linker flags for OPTLINK. Please set DMD_OPENSSL_FLAGS manually.])
-      else
-        AX_CHECK_OPENSSL([with_d_ssl_tests="yes"])
-        if test "$with_d_ssl_tests" = "yes"; then
-          DMD_OPENSSL_FLAGS=$(echo "$OPENSSL_LDFLAGS $OPENSSL_LIBS" | \
-            sed -e 's/^ *//g;s/ *$//g;s/^\(.\)/-L\1/g;s/  */ -L/g')
-        else
-          AC_MSG_WARN([D OpenSSL interface present, but OpenSSL library not found.])
-        fi
-      fi
-    else
-      with_d_ssl_tests="yes"
-    fi
-  fi
-fi
-
-AM_CONDITIONAL(WITH_D, [test "$have_d" = "yes"])
-AM_CONDITIONAL(DMD_OPTLINK, [test "$dmd_optlink" = "yes"])
-AC_SUBST(DMD_OF_DIRSEP, "$dmd_of_dirsep")
-AM_CONDITIONAL(HAVE_DEIMOS_EVENT2, [test "$have_deimos_event2" = "yes"])
-AM_CONDITIONAL(WITH_D_EVENT_TESTS, [test "$with_d_event_tests" = "yes"])
-AC_SUBST(DMD_LIBEVENT_FLAGS)
-AM_CONDITIONAL(HAVE_DEIMOS_OPENSSL, [test "$have_deimos_openssl" = "yes"])
-AM_CONDITIONAL(WITH_D_SSL_TESTS, [test "$with_d_ssl_tests" = "yes"])
-AC_SUBST(DMD_OPENSSL_FLAGS)
-
-AC_ARG_ENABLE([tests],
-  AS_HELP_STRING([--enable-tests], [build tests [default=yes]]),
-  [], enable_tests=yes
-)
-have_tests=yes
-if test "$enable_tests" = "no"; then
-  have_tests="no"
-fi
-AM_CONDITIONAL(WITH_TESTS, [test "$have_tests" = "yes"])
-
-AC_ARG_ENABLE([tutorial],
-  AS_HELP_STRING([--enable-tutorial], [build tutorial [default=yes]]),
-  [], enable_tutorial=yes
-)
-have_tutorial=yes
-if test "$enable_tutorial" = "no"; then
-  have_tutorial="no"
-fi
-AM_CONDITIONAL(WITH_TUTORIAL, [test "$have_tutorial" = "yes"])
-
-AM_CONDITIONAL(MINGW, false)
-case "${host_os}" in
-*mingw*)
-  mingw32_support="yes"
-  AC_CHECK_HEADER(windows.h)
-  AM_CONDITIONAL(MINGW, true)
-  ;;
-*)
-  AC_ISC_POSIX
-  ;;
-esac
-
-AC_C_CONST
-AC_C_INLINE
-AC_C_VOLATILE
-
-AC_HEADER_STDBOOL
-AC_HEADER_STDC
-AC_HEADER_TIME
-AC_HEADER_SYS_WAIT
-AC_TYPE_SIGNAL
-AC_CHECK_HEADERS([arpa/inet.h])
-AC_CHECK_HEADERS([sys/param.h])
-AC_CHECK_HEADERS([fcntl.h])
-AC_CHECK_HEADERS([inttypes.h])
-AC_CHECK_HEADERS([limits.h])
-AC_CHECK_HEADERS([netdb.h])
-AC_CHECK_HEADERS([netinet/in.h])
-AC_CHECK_HEADERS([pthread.h])
-AC_CHECK_HEADERS([stddef.h])
-AC_CHECK_HEADERS([stdlib.h])
-AC_CHECK_HEADERS([sys/socket.h])
-AC_CHECK_HEADERS([sys/time.h])
-AC_CHECK_HEADERS([sys/un.h])
-AC_CHECK_HEADERS([sys/poll.h])
-AC_CHECK_HEADERS([sys/resource.h])
-AC_CHECK_HEADERS([unistd.h])
-AC_CHECK_HEADERS([libintl.h])
-AC_CHECK_HEADERS([malloc.h])
-AC_CHECK_HEADERS([openssl/ssl.h])
-AC_CHECK_HEADERS([openssl/rand.h])
-AC_CHECK_HEADERS([openssl/x509v3.h])
-AC_CHECK_HEADERS([sched.h])
-AC_CHECK_HEADERS([wchar.h])
-
-AC_CHECK_LIB(pthread, pthread_create)
-dnl NOTE(dreiss): I haven't been able to find any really solid docs
-dnl on what librt is and how it fits into various Unix systems.
-dnl My best guess is that it is where glibc stashes its implementation
-dnl of the POSIX Real-Time Extensions.  This seems necessary on Linux,
-dnl and we haven't yet found a system where this is a problem.
-AC_CHECK_LIB(rt, clock_gettime)
-AC_CHECK_LIB(socket, setsockopt)
-
-if test "$have_cpp" = "yes" ; then
-# mingw toolchain used to build "Thrift Compiler for Windows"
-# does not support libcrypto, so we just check if we building the cpp library
-AC_CHECK_LIB(crypto,
-    BN_init,
-    [AC_CHECK_LIB(ssl,
-        SSL_ctrl,
-        [LIBS="-lssl -lcrypto $LIBS"],
-        [AC_MSG_ERROR(["Error: libssl required"])],
-        -lcrypto
-    )],
-    [AC_MSG_ERROR(["Error: libcrypto required."])]
-)
-fi
-
-AC_TYPE_INT16_T
-AC_TYPE_INT32_T
-AC_TYPE_INT64_T
-AC_TYPE_INT8_T
-AC_TYPE_MODE_T
-AC_TYPE_OFF_T
-AC_TYPE_SIZE_T
-AC_TYPE_SSIZE_T
-AC_TYPE_UINT16_T
-AC_TYPE_UINT32_T
-AC_TYPE_UINT64_T
-AC_TYPE_UINT8_T
-AC_CHECK_TYPES([ptrdiff_t], [], [exit 1])
-
-AC_STRUCT_TM
-
-dnl NOTE(dreiss): AI_ADDRCONFIG is not defined on OpenBSD.
-AC_CHECK_DECL([AI_ADDRCONFIG], [],
-              [AC_DEFINE([AI_ADDRCONFIG], 0,
-                         [Define if the AI_ADDRCONFIG symbol is unavailable])],
-              [
-  #include <sys/types.h>
-  #include <sys/socket.h>
-  #include <netdb.h>
-])
-
-AC_FUNC_ALLOCA
-AC_FUNC_FORK
-AC_FUNC_MALLOC
-AC_FUNC_MEMCMP
-AC_FUNC_REALLOC
-AC_FUNC_SELECT_ARGTYPES
-AC_FUNC_STAT
-AC_FUNC_STRERROR_R
-AC_FUNC_STRFTIME
-AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([strtoul])
-AC_CHECK_FUNCS([bzero])
-AC_CHECK_FUNCS([ftruncate])
-AC_CHECK_FUNCS([gethostbyname])
-AC_CHECK_FUNCS([gethostbyname_r])
-AC_CHECK_FUNCS([gettimeofday])
-AC_CHECK_FUNCS([memmove])
-AC_CHECK_FUNCS([memset])
-AC_CHECK_FUNCS([mkdir])
-AC_CHECK_FUNCS([realpath])
-AC_CHECK_FUNCS([select])
-AC_CHECK_FUNCS([setlocale])
-AC_CHECK_FUNCS([socket])
-AC_CHECK_FUNCS([strchr])
-AC_CHECK_FUNCS([strdup])
-AC_CHECK_FUNCS([strerror])
-AC_CHECK_FUNCS([strstr])
-AC_CHECK_FUNCS([strtol])
-AC_CHECK_FUNCS([sqrt])
-dnl The following functions are optional.
-AC_CHECK_FUNCS([alarm])
-AC_CHECK_FUNCS([clock_gettime])
-AC_CHECK_FUNCS([sched_get_priority_min])
-AC_CHECK_FUNCS([sched_get_priority_max])
-AC_CHECK_FUNCS([inet_ntoa])
-AC_CHECK_FUNCS([pow])
-
-if test "$cross_compiling" = "no" ; then
-  AX_SIGNED_RIGHT_SHIFT
-fi
-
-dnl autoscan thinks we need this macro because we have a member function
-dnl called "error".  Invoke the macro but don't run the check so autoscan
-dnl thinks we are in the clear.  It's highly unlikely that we will ever
-dnl actually use the function that this checks for.
-if false ; then
-  AC_FUNC_ERROR_AT_LINE
-fi
-
-# --- Coverage hooks ---
-
-AC_ARG_ENABLE(coverage,
-              [  --enable-coverage      turn on -fprofile-arcs -ftest-coverage],
-              [case "${enableval}" in
-                yes) ENABLE_COVERAGE=1 ;;
-                no) ENABLE_COVERAGE=0 ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --enable-cov) ;;
-              esac],
-              [ENABLE_COVERAGE=2])
-
-if test "x[$]ENABLE_COVERAGE" = "x1"; then
-  AC_MSG_WARN(enable coverage)
-  GCOV_CFLAGS="`echo \"[$]CFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage"
-  GCOV_CXXFLAGS="`echo \"[$]CXXFLAGS\" | perl -pe 's/-O\d+//g;'` -fprofile-arcs -ftest-coverage"
-  GCOV_LDFLAGS="-XCClinker -fprofile-arcs -XCClinker -ftest-coverage"
-fi
-
-AC_SUBST(ENABLE_COVERAGE)
-AC_SUBST(GCOV_CFLAGS)
-AC_SUBST(GCOV_CXXFLAGS)
-AC_SUBST(GCOV_LDFLAGS)
-
-AC_ARG_ENABLE(boostthreads,
-              [  --enable-boostthreads      use boost threads, instead of POSIX pthread (experimental) ],
-              [case "${enableval}" in
-                yes) ENABLE_BOOSTTHREADS=1 ;;
-                no) ENABLE_BOOSTTHREADS=0 ;;
-                *) AC_MSG_ERROR(bad value ${enableval} for --enable-cov) ;;
-              esac],
-              [ENABLE_BOOSTTHREADS=2])
-
-
-if test "x[$]ENABLE_BOOSTTHREADS" = "x1"; then
-  AC_MSG_WARN(enable boostthreads)
-  AC_DEFINE([USE_BOOST_THREAD], [1], [experimental --enable-boostthreads that replaces POSIX pthread by boost::thread])
-  LIBS="-lboost_thread $LIBS"
-fi
-
-AM_CONDITIONAL([WITH_BOOSTTHREADS], [test "x[$]ENABLE_BOOSTTHREADS" = "x1"])
-
-AC_CONFIG_HEADERS(config.h:config.hin)
-AC_CONFIG_HEADERS(lib/cpp/src/thrift/config.h:config.hin)
-# gruard against pre defined config.h
-AH_TOP([
-#ifndef CONFIG_H
-#define CONFIG_H
-])
-AH_BOTTOM([
-#endif
-])
-
-
-AC_CONFIG_FILES([
-  Makefile
-  compiler/cpp/Makefile
-  compiler/cpp/version.h
-  compiler/cpp/src/windows/version.h
-  lib/Makefile
-  lib/cpp/Makefile
-  lib/cpp/test/Makefile
-  lib/cpp/thrift-nb.pc
-  lib/cpp/thrift-z.pc
-  lib/cpp/thrift-qt.pc
-  lib/cpp/thrift-qt5.pc
-  lib/cpp/thrift.pc
-  lib/c_glib/Makefile
-  lib/c_glib/thrift_c_glib.pc
-  lib/c_glib/test/Makefile
-  lib/csharp/Makefile
-  lib/csharp/test/ThriftTest/Makefile
-  lib/d/Makefile
-  lib/d/test/Makefile
-  lib/erl/Makefile
-  lib/go/Makefile
-  lib/go/test/Makefile
-  lib/haxe/test/Makefile
-  lib/hs/Makefile
-  lib/java/Makefile
-  lib/js/test/Makefile
-  lib/nodejs/Makefile
-  lib/perl/Makefile
-  lib/perl/test/Makefile
-  lib/php/Makefile
-  lib/php/test/Makefile
-  lib/py/Makefile
-  lib/rb/Makefile
-  lib/lua/Makefile
-  test/Makefile
-  test/c_glib/Makefile
-  test/cpp/Makefile
-  test/erl/Makefile
-  test/go/Makefile
-  test/haxe/Makefile
-  test/hs/Makefile
-  test/php/Makefile
-  test/perl/Makefile
-  test/py/Makefile
-  test/py.twisted/Makefile
-  test/py.tornado/Makefile
-  test/rb/Makefile
-  tutorial/Makefile
-  tutorial/c_glib/Makefile
-  tutorial/cpp/Makefile
-  tutorial/go/Makefile
-  tutorial/haxe/Makefile
-  tutorial/hs/Makefile
-  tutorial/java/Makefile
-  tutorial/js/Makefile
-  tutorial/nodejs/Makefile
-  tutorial/py/Makefile
-  tutorial/py.twisted/Makefile
-  tutorial/py.tornado/Makefile
-  tutorial/rb/Makefile
-])
-
-if test "$have_cpp" = "yes" ; then MAYBE_CPP="cpp" ; else MAYBE_CPP="" ; fi
-AC_SUBST([MAYBE_CPP])
-if test "$have_c_glib" = "yes" ; then MAYBE_C_GLIB="c_glib" ; else MAYBE_C_GLIB="" ; fi
-AC_SUBST([MAYBE_C_GLIB])
-if test "$have_java" = "yes" ; then MAYBE_JAVA="java" ; else MAYBE_JAVA="" ; fi
-AC_SUBST([MAYBE_JAVA])
-if test "$have_csharp" = "yes" ; then MAYBE_CSHARP="csharp" ; else MAYBE_CSHARP="" ; fi
-AC_SUBST([MAYBE_CSHARP])
-if test "$have_python" = "yes" ; then MAYBE_PYTHON="python" ; else MAYBE_PYTHON="" ; fi
-AC_SUBST([MAYBE_PYTHON])
-if test "$have_ruby" = "yes" ; then MAYBE_RUBY="rb" ; else MAYBE_RUBY="" ; fi
-AC_SUBST([MAYBE_RUBY])
-if test "$have_haskell" = "yes" ; then MAYBE_HASKELL="haskell" ; else MAYBE_HASKELL="" ; fi
-AC_SUBST([MAYBE_HASKELL])
-if test "$have_perl" = "yes" ; then MAYBE_PERL="perl" ; else MAYBE_PERL="" ; fi
-AC_SUBST([MAYBE_PERL])
-if test "$have_php" = "yes" ; then MAYBE_PHP="php" ; else MAYBE_PHP="" ; fi
-AC_SUBST([MAYBE_PHP])
-if test "$have_go" = "yes" ; then MAYBE_GO="go" ; else MAYBE_GO="" ; fi
-AC_SUBST([MAYBE_GO])
-if test "$have_nodejs" = "yes" ; then MAYBE_NODEJS="nodejs" ; else MAYBE_NODEJS="" ; fi
-AC_SUBST([MAYBE_NODEJS])
-
-AC_OUTPUT
-
-
-echo
-echo "$PACKAGE $VERSION"
-echo
-echo "Building C++ Library ......... : $have_cpp"
-echo "Building C (GLib) Library .... : $have_c_glib"
-echo "Building Java Library ........ : $have_java"
-echo "Building C# Library .......... : $have_csharp"
-echo "Building Python Library ...... : $have_python"
-echo "Building Ruby Library ........ : $have_ruby"
-echo "Building Haxe Library ........ : $have_haxe"
-echo "Building Haskell Library ..... : $have_haskell"
-echo "Building Perl Library ........ : $have_perl"
-echo "Building PHP Library ......... : $have_php"
-echo "Building Erlang Library ...... : $have_erlang"
-echo "Building Go Library .......... : $have_go"
-echo "Building D Library ........... : $have_d"
-echo "Building NodeJS Library ...... : $have_nodejs"
-echo "Building Lua Library ......... : $have_lua"
-
-if test "$have_cpp" = "yes" ; then
-  echo
-  echo "C++ Library:"
-  echo "   Build TZlibTransport ...... : $have_zlib"
-  echo "   Build TNonblockingServer .. : $have_libevent"
-  echo "   Build TQTcpServer (Qt4) .... : $have_qt"
-  echo "   Build TQTcpServer (Qt5) .... : $have_qt5"
-fi
-if test "$have_java" = "yes" ; then
-  echo
-  echo "Java Library:"
-  echo "   Using javac ............... : $JAVAC"
-  echo "   Using java ................ : $JAVA"
-  echo "   Using ant ................. : $ANT"
-fi
-if test "$have_csharp" = "yes" ; then
-  echo
-  echo "C# Library:"
-  echo "   Using .NET 3.5 ............ : $net_3_5"
-fi
-if test "$have_python" = "yes" ; then
-  echo
-  echo "Python Library:"
-  echo "   Using Python .............. : $PYTHON"
-  echo "   Using Trial ............... : $TRIAL"
-fi
-if test "$have_php" = "yes" ; then
-  echo
-  echo "PHP Library:"
-  echo "   Using php-config .......... : $PHP_CONFIG"
-fi
-if test "$have_ruby" = "yes" ; then
-  echo
-  echo "Ruby Library:"
-  echo "   Using Ruby ................ : $RUBY"
-fi
-if test "$have_haskell" = "yes" ; then
-  echo
-  echo "Haskell Library:"
-  echo "   Using Haskell ............. : $RUNHASKELL"
-  echo "   Using Cabal ............... : $CABAL"
-fi
-if test "$have_haxe" = "yes" ; then
-  echo
-  echo "Haxe Library:"
-  echo "   Using Haxe ................ : $HAXE"
-  echo "   Using Haxe version ........ : $HAXE_VERSION"
-fi
-if test "$have_perl" = "yes" ; then
-  echo
-  echo "Perl Library:"
-  echo "   Using Perl ................ : $PERL"
-fi
-if test "$have_erlang" = "yes" ; then
-  echo
-  echo "Erlang Library:"
-  echo "   Using erlc ................ : $ERLC"
-fi
-if test "$have_go" = "yes" ; then
-  echo
-  echo "Go Library:"
-  echo "   Using Go................... : $GO"
-  echo "   Using Go version........... : $($GO version)"
-fi
-if test "$have_d" = "yes" ; then
-  echo
-  echo "D Library:"
-  echo "   Using D Compiler .......... : $DMD"
-  echo "   Building D libevent tests . : $with_d_event_tests"
-  echo "   Building D SSL tests ...... : $with_d_ssl_tests"
-fi
-if test "$have_nodejs" = "yes" ; then
-  echo
-  echo "NodeJS Library:"
-  echo "   Using NodeJS .............. : $NODEJS"
-  echo "   Using NodeJS version....... : $($NODEJS --version)"
-fi
-if test "$have_lua" = "yes" ; then
-  echo
-  echo "Lua Library:"
-  echo "   Using Lua .............. : $LUA"
-fi
-echo
-echo "If something is missing that you think should be present,"
-echo "please skim the output of configure to find the missing"
-echo "component.  Details are present in config.log."

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/App.config
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/App.config b/depends/thirdparty/thrift/contrib/Rebus/App.config
deleted file mode 100644
index 4208af6..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/App.config
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<configuration>
-  
-  <configSections>
-    <section name="rebus" type="Rebus.Configuration.RebusConfigurationSection, Rebus"/>
-  </configSections>
-
-  <rebus inputQueue="MyResponses" errorQueue="MyErrors" workers="1">
-    <endpoints>
-      <add messages="RebusSample.MathRequestCall, RebusSample" endpoint="MathRequests"/>
-      <add messages="RebusSample.MathResponseCall, RebusSample" endpoint="MathResponses"/>
-    </endpoints>
-  </rebus>
-
-  <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/Program.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/Program.cs b/depends/thirdparty/thrift/contrib/Rebus/Program.cs
deleted file mode 100644
index 563c62a..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/Program.cs
+++ /dev/null
@@ -1,81 +0,0 @@
-\ufeff/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using Rebus.Configuration;
-using Rebus.RabbitMQ;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using RebusSample.Client;
-using RebusSample.Server;
-
-namespace RebusSample
-{
-    class Program
-    {
-        static BuiltinContainerAdapter StartRequestServer(string server)
-        {
-            // client Rebus configuration
-            var adapter = new BuiltinContainerAdapter();
-            Configure.With(adapter)
-                .Transport(t => t.UseRabbitMq("amqp://" + server, "MathRequests", "MathRequestErrors"))
-                .MessageOwnership(o => o.FromRebusConfigurationSection())
-                .CreateBus().Start();
-
-            // register all relevant message handlers 
-            adapter.Register(typeof(MathRequestCallHandler));
-            return adapter;
-        }
-
-
-        static BuiltinContainerAdapter StartResponseServer(string server)
-        {
-            // client Rebus configuration
-            var adapter = new BuiltinContainerAdapter();
-            Configure.With(adapter)
-                .Transport(t => t.UseRabbitMq("amqp://" + server, "MathResponses", "MathResponseErrors"))
-                .MessageOwnership(o => o.FromRebusConfigurationSection())
-                .CreateBus().Start();
-
-            // register all relevant message handlers 
-            adapter.Register(typeof(MathResponseCallHandler));
-            return adapter;
-        }
-
-        static void Main(string[] args)
-        {
-            string server = "localhost";
-
-            // start all servers
-            var req = StartRequestServer(server);
-            var rsp = StartResponseServer(server);
-
-            // send the first message
-            var random = new Random();
-            var client = new MathRequestClient(server);
-            client.DoTheMath(random.Next(), random.Next());
-
-            // now what?
-            Console.Write("Hit <ENTER> to stop ... ");
-            Console.ReadLine();
-        }
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/Properties/AssemblyInfo.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/Properties/AssemblyInfo.cs b/depends/thirdparty/thrift/contrib/Rebus/Properties/AssemblyInfo.cs
deleted file mode 100644
index 5de6a14..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-\ufeff/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-
-[assembly: AssemblyTitle("RebusSample")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("RebusSample")]
-[assembly: AssemblyCopyright("Copyright �  2015")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-[assembly: ComVisible(false)]
-
-[assembly: Guid("0af10984-40d3-453d-b1e5-421529e8c7e2")]
-
-[assembly: AssemblyVersion("0.9.3.0")]
-[assembly: AssemblyFileVersion("0.9.3.0")]

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/README.md b/depends/thirdparty/thrift/contrib/Rebus/README.md
deleted file mode 100644
index bbb9c49..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/README.md
+++ /dev/null
@@ -1,21 +0,0 @@
-Sample code for the combination of Thrift with Rebus.
-
-Rebus is a .NET service bus, similar to NServiceBus, but more lightweight. 
-It ihas been mainly written by Mogens Heller Grabe and is currently hosted 
-on GitHub (https://github.com/rebus-org/Rebus)
-
-As with all ServiceBus or MQ scenarios, due to the highly asynchronous 
-operations it is recommended to do all calls as "oneway void" calls.
-
-The configuration can be done via App.Config, via code or even mixed from 
-both locations. Refer to the Rebus documentation for further details. For 
-this example, since we are effectively implementing two queue listeners in 
-only one single process, we do configuration of incoming and error queues 
-in the code.
-
-If you want to communicate with non-NET languages, you may need a customized 
-serializer as well, in order to override Rebus' default wire format. Please 
-refer to the Rebus docs on how to do that (it's not that hard, really).
-
-Additional requirements:
-- RabbitMQ .NET client (see nuget)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/RebusSample.csproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/RebusSample.csproj b/depends/thirdparty/thrift/contrib/Rebus/RebusSample.csproj
deleted file mode 100644
index 4058a6d..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/RebusSample.csproj
+++ /dev/null
@@ -1,102 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements. See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership. The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License. You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied. See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
-  <PropertyGroup>
-    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
-    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{264E2126-EDE0-4B47-89C1-B397B25BB13D}</ProjectGuid>
-    <OutputType>Exe</OutputType>
-    <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>RebusSample</RootNamespace>
-    <AssemblyName>RebusSample</AssemblyName>
-    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
-    <FileAlignment>512</FileAlignment>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugSymbols>true</DebugSymbols>
-    <DebugType>full</DebugType>
-    <Optimize>false</Optimize>
-    <OutputPath>bin\Debug\</OutputPath>
-    <DefineConstants>DEBUG;TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
-    <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
-    <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
-    <DefineConstants>TRACE</DefineConstants>
-    <ErrorReport>prompt</ErrorReport>
-    <WarningLevel>4</WarningLevel>
-  </PropertyGroup>
-  <ItemGroup>
-    <Reference Include="RabbitMQ.Client">
-      <HintPath>..\..\..\..\..\Toolbox\ServiceBus\3rdparty\rabbitmq-dotnet-client-3.2.1-dotnet-3.0\bin\RabbitMQ.Client.dll</HintPath>
-    </Reference>
-    <Reference Include="Rebus">
-      <HintPath>..\..\..\..\..\Toolbox\ServiceBus\3rdparty\Rebus-master\deploy\NET40\Rebus.dll</HintPath>
-    </Reference>
-    <Reference Include="Rebus.RabbitMQ">
-      <HintPath>..\..\..\..\..\Toolbox\ServiceBus\3rdparty\Rebus-master\deploy\NET40\Rebus.RabbitMQ.dll</HintPath>
-    </Reference>
-    <Reference Include="System" />
-    <Reference Include="System.Core" />
-    <Reference Include="System.Xml.Linq" />
-    <Reference Include="System.Data.DataSetExtensions" />
-    <Reference Include="Microsoft.CSharp" />
-    <Reference Include="System.Data" />
-    <Reference Include="System.Xml" />
-  </ItemGroup>
-  <ItemGroup>
-    <Compile Include="gen-csharp\BasicMathClient.cs" />
-    <Compile Include="gen-csharp\BasicMathServer.cs" />
-    <Compile Include="ServiceImpl\Both.cs" />
-    <Compile Include="ServiceImpl\Client.cs" />
-    <Compile Include="Program.cs" />
-    <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="ServiceImpl\Server.cs" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="App.config" />
-  </ItemGroup>
-  <ItemGroup />
-  <ItemGroup>
-    <ProjectReference Include="..\..\lib\csharp\src\Thrift.csproj">
-      <Project>{499eb63c-d74c-47e8-ae48-a2fc94538e9d}</Project>
-      <Name>Thrift</Name>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
-  <PropertyGroup>
-    <PreBuildEvent>cd $(ProjectDir)
-if not exist gen-csharp\*.cs   thrift  -gen csharp sample.thrift
-</PreBuildEvent>
-  </PropertyGroup>
-  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
-       Other similar extension points exist, see Microsoft.Common.targets.
-  <Target Name="BeforeBuild">
-  </Target>
-  <Target Name="AfterBuild">
-  </Target>
-  -->
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/RebusSample.sln
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/RebusSample.sln b/depends/thirdparty/thrift/contrib/Rebus/RebusSample.sln
deleted file mode 100644
index 284ef36..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/RebusSample.sln
+++ /dev/null
@@ -1,28 +0,0 @@
-\ufeff
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.30110.0
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RebusSample", "RebusSample.csproj", "{264E2126-EDE0-4B47-89C1-B397B25BB13D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Thrift", "..\..\lib\csharp\src\Thrift.csproj", "{499EB63C-D74C-47E8-AE48-A2FC94538E9D}"
-EndProject
-Global
-	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Release|Any CPU = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{264E2126-EDE0-4B47-89C1-B397B25BB13D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{264E2126-EDE0-4B47-89C1-B397B25BB13D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{264E2126-EDE0-4B47-89C1-B397B25BB13D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{264E2126-EDE0-4B47-89C1-B397B25BB13D}.Release|Any CPU.Build.0 = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{499EB63C-D74C-47E8-AE48-A2FC94538E9D}.Release|Any CPU.Build.0 = Release|Any CPU
-	EndGlobalSection
-	GlobalSection(SolutionProperties) = preSolution
-		HideSolutionNode = FALSE
-	EndGlobalSection
-EndGlobal

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Both.cs
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Both.cs b/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Both.cs
deleted file mode 100644
index fba67ec..0000000
--- a/depends/thirdparty/thrift/contrib/Rebus/ServiceImpl/Both.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-using System;
-
-
-namespace RebusSample
-{
-    // generic data container for serialized Thrift calls
-    public class GenericThriftServiceCall
-    {
-        public byte[] rawBytes;
-    }
-
-    // specific containers (one per Thrift service) to leverage Rebus' handler routing
-    public class MathRequestCall : GenericThriftServiceCall { }
-    public class MathResponseCall : GenericThriftServiceCall { }
-
-}
\ No newline at end of file


[37/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_go_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_go_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_go_generator.cc
deleted file mode 100644
index f04bc48..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_go_generator.cc
+++ /dev/null
@@ -1,3582 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/*
- * This file is programmatically sanitized for style:
- * astyle --style=1tbs -f -p -H -j -U t_go_generator.cc
- *
- * The output of astyle should not be taken unquestioningly, but it is a good
- * guide for ensuring uniformity and readability.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-#include <algorithm>
-#include <clocale>
-#include "t_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * A helper for automatically formatting the emitted Go code from the Thrift
- * IDL per the Go style guide.
- *
- * Returns:
- *  - true, if the formatting process succeeded.
- *  - false, if the formatting process failed, which means the basic output was
- *           still generated.
- */
-bool format_go_output(const string& file_path);
-
-const string default_thrift_import = "git.apache.org/thrift.git/lib/go/thrift";
-static std::string package_flag;
-
-/**
- * Go code generator.
- */
-class t_go_generator : public t_generator {
-public:
-  t_go_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-    out_dir_base_ = "gen-go";
-    gen_thrift_import_ = default_thrift_import;
-
-    iter = parsed_options.find("package_prefix");
-
-    if (iter != parsed_options.end()) {
-      gen_package_prefix_ = (iter->second);
-    }
-
-    iter = parsed_options.find("thrift_import");
-
-    if (iter != parsed_options.end()) {
-      gen_thrift_import_ = (iter->second);
-    }
-
-    iter = parsed_options.find("package");
-
-    if (iter != parsed_options.end()) {
-      package_flag = (iter->second);
-    }
-
-    iter = parsed_options.find("read_write_private");
-    read_write_private_ = (iter != parsed_options.end());
-
-    iter = parsed_options.find("ignore_initialisms");
-    ignore_initialisms_ = (iter != parsed_options.end());
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value, const string& name);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_go_struct(t_struct* tstruct, bool is_exception);
-  void generate_go_struct_definition(std::ofstream& out,
-                                     t_struct* tstruct,
-                                     bool is_xception = false,
-                                     bool is_result = false,
-                                     bool is_args = false);
-  void generate_go_struct_initializer(std::ofstream& out,
-                                      t_struct* tstruct,
-                                      bool is_args_or_result = false);
-  void generate_isset_helpers(std::ofstream& out,
-                              t_struct* tstruct,
-                              const string& tstruct_name,
-                              bool is_result = false);
-  void generate_countsetfields_helper(std::ofstream& out,
-                                      t_struct* tstruct,
-                                      const string& tstruct_name,
-                                      bool is_result = false);
-  void generate_go_struct_reader(std::ofstream& out,
-                                 t_struct* tstruct,
-                                 const string& tstruct_name,
-                                 bool is_result = false);
-  void generate_go_struct_writer(std::ofstream& out,
-                                 t_struct* tstruct,
-                                 const string& tstruct_name,
-                                 bool is_result = false,
-                                 bool uses_countsetfields = false);
-  void generate_go_function_helpers(t_function* tfunction);
-  void get_publicized_name_and_def_value(t_field* tfield,
-                                         string* OUT_pub_name,
-                                         t_const_value** OUT_def_value) const;
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_remote(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  bool declare,
-                                  std::string prefix = "",
-                                  bool inclass = false,
-                                  bool coerceData = false,
-                                  bool inkey = false,
-                                  bool in_container = false,
-                                  bool use_true_type = false);
-
-  void generate_deserialize_struct(std::ofstream& out,
-                                   t_struct* tstruct,
-                                   bool is_pointer_field,
-                                   bool declare,
-                                   std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out,
-                                      t_type* ttype,
-                                      bool pointer_field,
-                                      bool declare,
-                                      std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out,
-                                        t_set* tset,
-                                        bool declare,
-                                        std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out,
-                                        t_map* tmap,
-                                        bool declare,
-                                        std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         bool declare,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(std::ofstream& out,
-                                t_field* tfield,
-                                std::string prefix = "",
-                                bool inkey = false);
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out,
-                                    t_type* ttype,
-                                    bool pointer_field,
-                                    std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_go_docstring(std::ofstream& out, t_struct* tstruct);
-
-  void generate_go_docstring(std::ofstream& out, t_function* tfunction);
-
-  void generate_go_docstring(std::ofstream& out,
-                             t_doc* tdoc,
-                             t_struct* tstruct,
-                             const char* subheader);
-
-  void generate_go_docstring(std::ofstream& out, t_doc* tdoc);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string go_autogen_comment();
-  std::string go_package();
-  std::string go_imports_begin();
-  std::string go_imports_end();
-  std::string render_includes();
-  std::string render_import_protection();
-  std::string render_fastbinary_includes();
-  std::string declare_argument(t_field* tfield);
-  std::string render_field_initial_value(t_field* tfield, const string& name, bool optional_field);
-  std::string type_name(t_type* ttype);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string function_signature_if(t_function* tfunction,
-                                    std::string prefix = "",
-                                    bool addError = false);
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string type_to_go_type(t_type* ttype, bool is_container_value = false);
-  std::string type_to_go_type_with_opt(t_type* ttype,
-                                       bool optional_field,
-                                       bool is_container_value = false);
-  std::string type_to_go_key_type(t_type* ttype);
-  std::string type_to_spec_args(t_type* ttype);
-
-  static std::string get_real_go_module(const t_program* program) {
-
-    if (!package_flag.empty()) {
-      return package_flag;
-    }
-    std::string real_module = program->get_namespace("go");
-    if (!real_module.empty()) {
-      return real_module;
-    }
-
-    return lowercase(program->get_name());
-  }
-
-private:
-  std::string gen_package_prefix_;
-  std::string gen_thrift_import_;
-  bool read_write_private_;
-  bool ignore_initialisms_;
-
-  /**
-   * File streams
-   */
-
-  std::ofstream f_types_;
-  std::string f_types_name_;
-  std::ofstream f_consts_;
-  std::string f_consts_name_;
-  std::stringstream f_const_values_;
-  std::ofstream f_service_;
-
-  std::string package_name_;
-  std::string package_dir_;
-  std::string read_method_name_;
-  std::string write_method_name_;
-
-  std::set<std::string> commonInitialisms;
-
-  std::string camelcase(const std::string& value) const;
-  void fix_common_initialism(std::string& value, int i) const;
-  std::string publicize(const std::string& value, bool is_args_or_result = false) const;
-  std::string privatize(const std::string& value) const;
-  std::string new_prefix(const std::string& value) const;
-  static std::string variable_name_to_go_name(const std::string& value);
-  static bool is_pointer_field(t_field* tfield, bool in_container = false);
-  static bool omit_initialization(t_field* tfield);
-};
-
-// returns true if field initialization can be omitted since it has corresponding go type zero value
-// or default value is not set
-bool t_go_generator::omit_initialization(t_field* tfield) {
-  t_const_value* value = tfield->get_value();
-  if (!value) {
-    return true;
-  }
-  t_type* type = tfield->get_type()->get_true_type();
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "";
-
-    case t_base_type::TYPE_STRING:
-      if (((t_base_type*)type)->is_binary()) {
-        //[]byte are always inline
-        return false;
-      }
-      // strings are pointers if has no default
-      return value->get_string().empty();
-
-    case t_base_type::TYPE_BOOL:
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      return value->get_integer() == 0;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        return value->get_integer() == 0;
-      } else {
-        return value->get_double() == 0.;
-      }
-    }
-  }
-  return false;
-}
-
-// Returns true if the type need a reference if used as optional without default
-static bool type_need_reference(t_type* type) {
-  type = type->get_true_type();
-  if (type->is_map() || type->is_set() || type->is_list() || type->is_struct()
-      || type->is_xception() || (type->is_string() && ((t_base_type*)type)->is_binary())) {
-    return false;
-  }
-  return true;
-}
-
-// returns false if field could not use comparison to default value as !IsSet*
-bool t_go_generator::is_pointer_field(t_field* tfield, bool in_container_value) {
-  (void)in_container_value;
-  if (tfield->annotations_.count("cpp.ref") != 0) {
-    return true;
-  }
-  t_type* type = tfield->get_type()->get_true_type();
-  // Structs in containers are pointers
-  if (type->is_struct() || type->is_xception()) {
-    return true;
-  }
-  if (!(tfield->get_req() == t_field::T_OPTIONAL)) {
-    return false;
-  }
-
-  bool has_default = tfield->get_value();
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "";
-
-    case t_base_type::TYPE_STRING:
-      if (((t_base_type*)type)->is_binary()) {
-        //[]byte are always inline
-        return false;
-      }
-      // strings are pointers if has no default
-      return !has_default;
-
-    case t_base_type::TYPE_BOOL:
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-    case t_base_type::TYPE_DOUBLE:
-      return !has_default;
-    }
-  } else if (type->is_enum()) {
-    return !has_default;
-  } else if (type->is_struct() || type->is_xception()) {
-    return true;
-  } else if (type->is_map()) {
-    return has_default;
-  } else if (type->is_set()) {
-    return has_default;
-  } else if (type->is_list()) {
-    return has_default;
-  } else if (type->is_typedef()) {
-    return has_default;
-  }
-
-  throw "INVALID TYPE IN type_to_go_type: " + type->get_name();
-}
-
-std::string t_go_generator::camelcase(const std::string& value) const {
-  std::string value2(value);
-  std::setlocale(LC_ALL, "C"); // set locale to classic
-
-  // Fix common initialism in first word
-  fix_common_initialism(value2, 0);
-
-  // as long as we are changing things, let's change _ followed by lowercase to
-  // capital and fix common initialisms
-  for (std::string::size_type i = 1; i < value2.size() - 1; ++i) {
-    if (value2[i] == '_') {
-      if (islower(value2[i + 1])) {
-        value2.replace(i, 2, 1, toupper(value2[i + 1]));
-      }
-      fix_common_initialism(value2, i);
-    }
-  }
-
-  return value2;
-}
-
-// Checks to see if the word starting at i in value contains a common initialism
-// and if so replaces it with the upper case version of the word.
-void t_go_generator::fix_common_initialism(std::string& value, int i) const {
-  if (!ignore_initialisms_) {
-    size_t wordLen = value.find('_', i);
-    if (wordLen != std::string::npos) {
-      wordLen -= i;
-    }
-    std::string word = value.substr(i, wordLen);
-    std::transform(word.begin(), word.end(), word.begin(), ::toupper);
-    if (commonInitialisms.find(word) != commonInitialisms.end()) {
-      value.replace(i, word.length(), word);
-    }
-  }
-}
-
-std::string t_go_generator::publicize(const std::string& value, bool is_args_or_result) const {
-  if (value.size() <= 0) {
-    return value;
-  }
-
-  std::string value2(value), prefix;
-
-  string::size_type dot_pos = value.rfind('.');
-  if (dot_pos != string::npos) {
-    prefix = value.substr(0, dot_pos + 1) + prefix;
-    value2 = value.substr(dot_pos + 1);
-  }
-
-  if (!isupper(value2[0])) {
-    value2[0] = toupper(value2[0]);
-  }
-
-  value2 = camelcase(value2);
-
-  // final length before further checks, the string may become longer
-  size_t len_before = value2.length();
-
-  // IDL identifiers may start with "New" which interferes with the CTOR pattern
-  // Adding an extra underscore to all those identifiers solves this
-  if ((len_before >= 3) && (value2.substr(0, 3) == "New")) {
-    value2 += '_';
-  }
-
-  // IDL identifiers may end with "Args"/"Result" which interferes with the implicit service
-  // function structs
-  // Adding another extra underscore to all those identifiers solves this
-  // Suppress this check for the actual helper struct names
-  if (!is_args_or_result) {
-    bool ends_with_args = (len_before >= 4) && (value2.substr(len_before - 4, 4) == "Args");
-    bool ends_with_rslt = (len_before >= 6) && (value2.substr(len_before - 6, 6) == "Result");
-    if (ends_with_args || ends_with_rslt) {
-      value2 += '_';
-    }
-  }
-
-  // Avoid naming collisions with other services
-  if (is_args_or_result) {
-    prefix += publicize(service_name_);
-  }
-
-  return prefix + value2;
-}
-
-std::string t_go_generator::new_prefix(const std::string& value) const {
-  if (value.size() <= 0) {
-    return value;
-  }
-
-  string::size_type dot_pos = value.rfind('.');
-  if (dot_pos != string::npos) {
-    return value.substr(0, dot_pos + 1) + "New" + publicize(value.substr(dot_pos + 1));
-  }
-  return "New" + publicize(value);
-}
-
-std::string t_go_generator::privatize(const std::string& value) const {
-  if (value.size() <= 0) {
-    return value;
-  }
-
-  std::string value2(value);
-
-  if (!islower(value2[0])) {
-    value2[0] = tolower(value2[0]);
-  }
-
-  value2 = camelcase(value2);
-
-  return value2;
-}
-
-std::string t_go_generator::variable_name_to_go_name(const std::string& value) {
-  if (value.size() <= 0) {
-    return value;
-  }
-
-  std::string value2(value);
-  std::transform(value2.begin(), value2.end(), value2.begin(), ::tolower);
-
-  switch (value[0]) {
-  case 'b':
-  case 'B':
-    if (value2 != "break") {
-      return value;
-    }
-
-    break;
-
-  case 'c':
-  case 'C':
-    if (value2 != "case" && value2 != "chan" && value2 != "const" && value2 != "continue") {
-      return value;
-    }
-
-    break;
-
-  case 'd':
-  case 'D':
-    if (value2 != "default" && value2 != "defer") {
-      return value;
-    }
-
-    break;
-
-  case 'e':
-  case 'E':
-    if (value2 != "else" && value2 != "error") {
-      return value;
-    }
-
-    break;
-
-  case 'f':
-  case 'F':
-    if (value2 != "fallthrough" && value2 != "for" && value2 != "func") {
-      return value;
-    }
-
-    break;
-
-  case 'g':
-  case 'G':
-    if (value2 != "go" && value2 != "goto") {
-      return value;
-    }
-
-    break;
-
-  case 'i':
-  case 'I':
-    if (value2 != "if" && value2 != "import" && value2 != "interface") {
-      return value;
-    }
-
-    break;
-
-  case 'm':
-  case 'M':
-    if (value2 != "map") {
-      return value;
-    }
-
-    break;
-
-  case 'p':
-  case 'P':
-    if (value2 != "package") {
-      return value;
-    }
-
-    break;
-
-  case 'r':
-  case 'R':
-    if (value2 != "range" && value2 != "return") {
-      return value;
-    }
-
-    break;
-
-  case 's':
-  case 'S':
-    if (value2 != "select" && value2 != "struct" && value2 != "switch") {
-      return value;
-    }
-
-    break;
-
-  case 't':
-  case 'T':
-    if (value2 != "type") {
-      return value;
-    }
-
-    break;
-
-  case 'v':
-  case 'V':
-    if (value2 != "var") {
-      return value;
-    }
-
-    break;
-
-  default:
-    return value;
-  }
-
-  return value2 + "_a1";
-}
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_go_generator::init_generator() {
-  // Make output directory
-  string module = get_real_go_module(program_);
-  string target = module;
-  package_dir_ = get_out_dir();
-
-  // This set is taken from https://github.com/golang/lint/blob/master/lint.go#L692
-  commonInitialisms.insert("API");
-  commonInitialisms.insert("ASCII");
-  commonInitialisms.insert("CPU");
-  commonInitialisms.insert("CSS");
-  commonInitialisms.insert("DNS");
-  commonInitialisms.insert("EOF");
-  commonInitialisms.insert("GUID");
-  commonInitialisms.insert("HTML");
-  commonInitialisms.insert("HTTP");
-  commonInitialisms.insert("HTTPS");
-  commonInitialisms.insert("ID");
-  commonInitialisms.insert("IP");
-  commonInitialisms.insert("JSON");
-  commonInitialisms.insert("LHS");
-  commonInitialisms.insert("QPS");
-  commonInitialisms.insert("RAM");
-  commonInitialisms.insert("RHS");
-  commonInitialisms.insert("RPC");
-  commonInitialisms.insert("SLA");
-  commonInitialisms.insert("SMTP");
-  commonInitialisms.insert("SSH");
-  commonInitialisms.insert("TCP");
-  commonInitialisms.insert("TLS");
-  commonInitialisms.insert("TTL");
-  commonInitialisms.insert("UDP");
-  commonInitialisms.insert("UI");
-  commonInitialisms.insert("UID");
-  commonInitialisms.insert("UUID");
-  commonInitialisms.insert("URI");
-  commonInitialisms.insert("URL");
-  commonInitialisms.insert("UTF8");
-  commonInitialisms.insert("VM");
-  commonInitialisms.insert("XML");
-  commonInitialisms.insert("XSRF");
-  commonInitialisms.insert("XSS");
-
-  // names of read and write methods
-  if (read_write_private_) {
-    read_method_name_ = "read";
-    write_method_name_ = "write";
-  } else {
-    read_method_name_ = "Read";
-    write_method_name_ = "Write";
-  }
-
-  while (true) {
-    // TODO: Do better error checking here.
-    MKDIR(package_dir_.c_str());
-
-    if (module.empty()) {
-      break;
-    }
-
-    string::size_type pos = module.find('.');
-
-    if (pos == string::npos) {
-      package_dir_ += "/";
-      package_dir_ += module;
-      package_name_ = module;
-      module.clear();
-    } else {
-      package_dir_ += "/";
-      package_dir_ += module.substr(0, pos);
-      module.erase(0, pos + 1);
-    }
-  }
-
-  string::size_type loc;
-
-  while ((loc = target.find(".")) != string::npos) {
-    target.replace(loc, 1, 1, '/');
-  }
-
-  // Make output files
-  f_types_name_ = package_dir_ + "/" + "ttypes.go";
-  f_types_.open(f_types_name_.c_str());
-
-  f_consts_name_ = package_dir_ + "/" + "constants.go";
-  f_consts_.open(f_consts_name_.c_str());
-
-  vector<t_service*> services = program_->get_services();
-  vector<t_service*>::iterator sv_iter;
-
-  for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-    string service_dir = package_dir_ + "/" + underscore((*sv_iter)->get_name()) + "-remote";
-    MKDIR(service_dir.c_str());
-  }
-
-  // Print header
-  f_types_ << go_autogen_comment() << go_package() << render_includes()
-           << render_import_protection();
-
-  f_consts_ << go_autogen_comment() << go_package() << render_includes();
-
-  f_const_values_ << endl << "func init() {" << endl;
-}
-
-/**
- * Renders all the imports necessary for including another Thrift program
- */
-string t_go_generator::render_includes() {
-  const vector<t_program*>& includes = program_->get_includes();
-  string result = "";
-  string unused_prot = "";
-
-  for (size_t i = 0; i < includes.size(); ++i) {
-    string go_module = get_real_go_module(includes[i]);
-    size_t found = 0;
-    for (size_t j = 0; j < go_module.size(); j++) {
-      // Import statement uses slashes ('/') in namespace
-      if (go_module[j] == '.') {
-        go_module[j] = '/';
-        found = j + 1;
-      }
-    }
-
-    result += "\t\"" + gen_package_prefix_ + go_module + "\"\n";
-    unused_prot += "var _ = " + go_module.substr(found) + ".GoUnusedProtection__\n";
-  }
-
-  if (includes.size() > 0) {
-    result += "\n";
-  }
-
-  return go_imports_begin() + result + go_imports_end() + unused_prot;
-}
-
-string t_go_generator::render_import_protection() {
-  return string("var GoUnusedProtection__ int;\n\n");
-}
-
-/**
- * Renders all the imports necessary to use the accelerated TBinaryProtocol
- */
-string t_go_generator::render_fastbinary_includes() {
-  return "";
-}
-
-/**
- * Autogen'd comment
- */
-string t_go_generator::go_autogen_comment() {
-  return
-        std::string() +
-        "// Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-        "// DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n\n";
-}
-
-/**
- * Prints standard thrift package
- */
-string t_go_generator::go_package() {
-  return string("package ") + package_name_ + "\n\n";
-}
-
-/**
- * Render the beginning of the import statement
- */
-string t_go_generator::go_imports_begin() {
-  return string(
-      "import (\n"
-      "\t\"bytes\"\n"
-      "\t\"fmt\"\n"
-      "\t\"" + gen_thrift_import_ + "\"\n");
-}
-
-/**
- * End the import statement, include undscore-assignments
- *
- * These "_ =" prevent the go compiler complaining about used imports.
- * This will have to do in lieu of more intelligent import statement construction
- */
-string t_go_generator::go_imports_end() {
-  return string(
-      ")\n\n"
-      "// (needed to ensure safety because of naive import list construction.)\n"
-      "var _ = thrift.ZERO\n"
-      "var _ = fmt.Printf\n"
-      "var _ = bytes.Equal\n\n");
-}
-
-/**
- * Closes the type files
- */
-void t_go_generator::close_generator() {
-  f_const_values_ << "}" << endl << endl;
-  f_consts_ << f_const_values_.str();
-
-  // Close types and constants files
-  f_consts_.close();
-  f_types_.close();
-  format_go_output(f_types_name_);
-  format_go_output(f_consts_name_);
-}
-
-/**
- * Generates a typedef.
- *
- * @param ttypedef The type definition
- */
-void t_go_generator::generate_typedef(t_typedef* ttypedef) {
-  generate_go_docstring(f_types_, ttypedef);
-  string new_type_name(publicize(ttypedef->get_symbolic()));
-  string base_type(type_to_go_type(ttypedef->get_type()));
-
-  if (base_type == new_type_name) {
-    return;
-  }
-
-  f_types_ << "type " << new_type_name << " " << base_type << endl << endl;
-  // Generate a convenience function that converts an instance of a type
-  // (which may be a constant) into a pointer to an instance of a type.
-  f_types_ << "func " << new_type_name << "Ptr(v " << new_type_name << ") *" << new_type_name
-           << " { return &v }" << endl << endl;
-}
-
-/**
- * Generates code for an enumerated type. Done using a class to scope
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_go_generator::generate_enum(t_enum* tenum) {
-  std::ostringstream to_string_mapping, from_string_mapping;
-  std::string tenum_name(publicize(tenum->get_name()));
-  generate_go_docstring(f_types_, tenum);
-  f_types_ << "type " << tenum_name << " int64" << endl << "const (" << endl;
-
-  to_string_mapping << indent() << "func (p " << tenum_name << ") String() string {" << endl;
-  to_string_mapping << indent() << "  switch p {" << endl;
-
-  from_string_mapping << indent() << "func " << tenum_name << "FromString(s string) (" << tenum_name
-                      << ", error) {" << endl;
-  from_string_mapping << indent() << "  switch s {" << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  int value = -1;
-
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    value = (*c_iter)->get_value();
-
-    string iter_std_name(escape_string((*c_iter)->get_name()));
-    string iter_name((*c_iter)->get_name());
-    f_types_ << indent() << "  " << tenum_name << "_" << iter_name << ' ' << tenum_name << " = "
-             << value << endl;
-    // Dictionaries to/from string names of enums
-    to_string_mapping << indent() << "  case " << tenum_name << "_" << iter_name << ": return \""
-                      << iter_std_name << "\"" << endl;
-
-    if (iter_std_name != escape_string(iter_name)) {
-      from_string_mapping << indent() << "  case \"" << iter_std_name << "\", \""
-                          << escape_string(iter_name) << "\": return " << tenum_name << "_"
-                          << iter_name << ", nil " << endl;
-    } else {
-      from_string_mapping << indent() << "  case \"" << iter_std_name << "\": return " << tenum_name
-                          << "_" << iter_name << ", nil " << endl;
-    }
-  }
-
-  to_string_mapping << indent() << "  }" << endl;
-  to_string_mapping << indent() << "  return \"<UNSET>\"" << endl;
-  to_string_mapping << indent() << "}" << endl;
-  from_string_mapping << indent() << "  }" << endl;
-  from_string_mapping << indent() << "  return " << tenum_name << "(0),"
-                      << " fmt.Errorf(\"not a valid " << tenum_name << " string\")" << endl;
-  from_string_mapping << indent() << "}" << endl;
-
-  f_types_ << ")" << endl << endl << to_string_mapping.str() << endl << from_string_mapping.str()
-           << endl << endl;
-
-  // Generate a convenience function that converts an instance of an enum
-  // (which may be a constant) into a pointer to an instance of that enum
-  // type.
-  f_types_ << "func " << tenum_name << "Ptr(v " << tenum_name << ") *" << tenum_name
-           << " { return &v }" << endl << endl;
-
-  // Generate MarshalText
-  f_types_ << "func (p " << tenum_name << ") MarshalText() ([]byte, error) {" << endl;
-  f_types_ << "return []byte(p.String()), nil" << endl;
-  f_types_ << "}" << endl << endl;
-
-  // Generate UnmarshalText
-  f_types_ << "func (p *" << tenum_name << ") UnmarshalText(text []byte) error {" << endl;
-  f_types_ << "q, err := " << tenum_name << "FromString(string(text))" << endl;
-  f_types_ << "if (err != nil) {" << endl << "return err" << endl << "}" << endl;
-  f_types_ << "*p = q" << endl;
-  f_types_ << "return nil" << endl;
-  f_types_ << "}" << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_go_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = publicize(tconst->get_name());
-  t_const_value* value = tconst->get_value();
-
-  if (type->is_base_type() || type->is_enum()) {
-    indent(f_consts_) << "const " << name << " = " << render_const_value(type, value, name) << endl;
-  } else {
-    f_const_values_ << indent() << name << " = " << render_const_value(type, value, name) << endl
-                    << endl;
-
-    f_consts_ << indent() << "var " << name << " " << type_to_go_type(type) << endl;
-  }
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_go_generator::render_const_value(t_type* type, t_const_value* value, const string& name) {
-  type = get_true_type(type);
-  std::ostringstream out;
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      if (((t_base_type*)type)->is_binary()) {
-        out << "[]byte(\"" << get_escaped_string(value) << "\")";
-      } else {
-        out << '"' << get_escaped_string(value) << '"';
-      }
-
-      break;
-
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-
-      break;
-
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "&" << publicize(type_name(type)) << "{";
-    indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-
-      out << endl << indent() << publicize(v_iter->first->get_string()) << ": "
-          << render_const_value(field_type, v_iter->second, name) << "," << endl;
-    }
-
-    indent_down();
-    out << "}";
-
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    out << "map[" << type_to_go_type(ktype) << "]" << type_to_go_type(vtype, true) << "{" << endl;
-    indent_up();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << render_const_value(ktype, v_iter->first, name) << ": "
-          << render_const_value(vtype, v_iter->second, name) << "," << endl;
-    }
-
-    indent_down();
-    out << indent() << "}";
-  } else if (type->is_list()) {
-    t_type* etype = ((t_list*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    out << "[]" << type_to_go_type(etype) << "{" << endl;
-    indent_up();
-    vector<t_const_value*>::const_iterator v_iter;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << render_const_value(etype, *v_iter, name) << ", ";
-    }
-
-    indent_down();
-    out << indent() << "}";
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    out << "map[" << type_to_go_key_type(etype) << "]bool{" << endl;
-    indent_up();
-    vector<t_const_value*>::const_iterator v_iter;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << render_const_value(etype, *v_iter, name) << ": true," << endl;
-    }
-
-    indent_down();
-    out << indent() << "}";
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-
-  return out.str();
-}
-
-/**
- * Generates a go struct
- */
-void t_go_generator::generate_struct(t_struct* tstruct) {
-  generate_go_struct(tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_go_generator::generate_xception(t_struct* txception) {
-  generate_go_struct(txception, true);
-}
-
-/**
- * Generates a go struct
- */
-void t_go_generator::generate_go_struct(t_struct* tstruct, bool is_exception) {
-  generate_go_struct_definition(f_types_, tstruct, is_exception);
-}
-
-void t_go_generator::get_publicized_name_and_def_value(t_field* tfield,
-                                                       string* OUT_pub_name,
-                                                       t_const_value** OUT_def_value) const {
-  const string base_field_name = tfield->get_name();
-  const string escaped_field_name = escape_string(base_field_name);
-  *OUT_pub_name = publicize(escaped_field_name);
-  *OUT_def_value = tfield->get_value();
-}
-
-void t_go_generator::generate_go_struct_initializer(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    bool is_args_or_result) {
-  out << publicize(type_name(tstruct), is_args_or_result) << "{";
-  const vector<t_field*>& members = tstruct->get_members();
-  for (vector<t_field*>::const_iterator m_iter = members.begin(); m_iter != members.end();
-       ++m_iter) {
-    bool pointer_field = is_pointer_field(*m_iter);
-    string publicized_name;
-    t_const_value* def_value;
-    get_publicized_name_and_def_value(*m_iter, &publicized_name, &def_value);
-    if (!pointer_field && def_value != NULL && !omit_initialization(*m_iter)) {
-      out << endl << indent() << publicized_name << ": "
-          << render_field_initial_value(*m_iter, (*m_iter)->get_name(), pointer_field) << ","
-          << endl;
-    }
-  }
-
-  out << "}" << endl;
-}
-
-/**
- * Generates a struct definition for a thrift data type.
- *
- * @param tstruct The struct definition
- */
-void t_go_generator::generate_go_struct_definition(ofstream& out,
-                                                   t_struct* tstruct,
-                                                   bool is_exception,
-                                                   bool is_result,
-                                                   bool is_args) {
-  const vector<t_field*>& members = tstruct->get_members();
-  const vector<t_field*>& sorted_members = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  std::string tstruct_name(publicize(tstruct->get_name(), is_args || is_result));
-  generate_go_docstring(out, tstruct);
-  out << indent() << "type " << tstruct_name << " struct {" << endl;
-  /*
-     Here we generate the structure specification for the fastbinary codec.
-     These specifications have the following structure:
-     thrift_spec -> tuple of item_spec
-     item_spec -> nil | (tag, type_enum, name, spec_args, default)
-     tag -> integer
-     type_enum -> TType.I32 | TType.STRING | TType.STRUCT | ...
-     name -> string_literal
-     default -> nil  # Handled by __init__
-     spec_args -> nil  # For simple types
-                | (type_enum, spec_args)  # Value type for list/set
-                | (type_enum, spec_args, type_enum, spec_args)
-                  # Key and value for map
-                | (class_name, spec_args_ptr) # For struct/exception
-     class_name -> identifier  # Basically a pointer to the class
-     spec_args_ptr -> expression  # just class_name.spec_args
-
-     TODO(dreiss): Consider making this work for structs with negative tags.
-  */
-  // TODO(dreiss): Look into generating an empty tuple instead of nil
-  // for structures with no members.
-  // TODO(dreiss): Test encoding of structs where some inner structs
-  // don't have thrift_spec.
-  indent_up();
-
-  int num_setable = 0;
-  if (sorted_members.empty() || (sorted_members[0]->get_key() >= 0)) {
-    int sorted_keys_pos = 0;
-
-    for (m_iter = sorted_members.begin(); m_iter != sorted_members.end(); ++m_iter) {
-      // Set field to optional if field is union, this is so we can get a
-      // pointer to the field.
-      if (tstruct->is_union())
-        (*m_iter)->set_req(t_field::T_OPTIONAL);
-      if (sorted_keys_pos != (*m_iter)->get_key()) {
-        int first_unused = std::max(1, sorted_keys_pos++);
-        while (sorted_keys_pos != (*m_iter)->get_key()) {
-          ++sorted_keys_pos;
-        }
-        int last_unused = sorted_keys_pos - 1;
-        if (first_unused < last_unused) {
-          indent(out) << "// unused fields # " << first_unused << " to " << last_unused << endl;
-        } else if (first_unused == last_unused) {
-          indent(out) << "// unused field # " << first_unused << endl;
-        }
-      }
-
-      t_type* fieldType = (*m_iter)->get_type();
-      string goType = type_to_go_type_with_opt(fieldType, is_pointer_field(*m_iter));
-      string gotag;
-      if ((*m_iter)->get_req() == t_field::T_OPTIONAL) {
-        gotag = "json:\"" + escape_string((*m_iter)->get_name()) + ",omitempty\"";
-      } else {
-        gotag = "json:\"" + escape_string((*m_iter)->get_name()) + "\"";
-      }
-      std::map<string, string>::iterator it = (*m_iter)->annotations_.find("go.tag");
-      if (it != (*m_iter)->annotations_.end()) {
-        gotag = it->second;
-      }
-      indent(out) << publicize((*m_iter)->get_name()) << " " << goType << " `thrift:\""
-                  << escape_string((*m_iter)->get_name()) << "," << sorted_keys_pos;
-
-      if ((*m_iter)->get_req() == t_field::T_REQUIRED) {
-        out << ",required";
-      }
-
-      out << "\" " << gotag << "`" << endl;
-      sorted_keys_pos++;
-    }
-  } else {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      // This fills in default values, as opposed to nulls
-      out << indent() << publicize((*m_iter)->get_name()) << " "
-          << type_to_go_type((*m_iter)->get_type()) << endl;
-    }
-  }
-
-  indent_down();
-  out << indent() << "}" << endl << endl;
-  out << indent() << "func New" << tstruct_name << "() *" << tstruct_name << " {" << endl;
-  out << indent() << "  return &";
-  generate_go_struct_initializer(out, tstruct, is_result || is_args);
-  out << indent() << "}" << endl << endl;
-  // Default values for optional fields
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    string publicized_name;
-    t_const_value* def_value;
-    get_publicized_name_and_def_value(*m_iter, &publicized_name, &def_value);
-    t_type* fieldType = (*m_iter)->get_type();
-    string goType = type_to_go_type_with_opt(fieldType, false);
-    string def_var_name = tstruct_name + "_" + publicized_name + "_DEFAULT";
-    if ((*m_iter)->get_req() == t_field::T_OPTIONAL || is_pointer_field(*m_iter)) {
-      out << indent() << "var " << def_var_name << " " << goType;
-      if (def_value != NULL) {
-        out << " = " << render_const_value(fieldType, def_value, (*m_iter)->get_name());
-      }
-      out << endl;
-    }
-    if (is_pointer_field(*m_iter)) {
-      string goOptType = type_to_go_type_with_opt(fieldType, true);
-      string maybepointer = goOptType != goType ? "*" : "";
-      out << indent() << "func (p *" << tstruct_name << ") Get" << publicized_name << "() "
-          << goType << " {" << endl;
-      out << indent() << "  if !p.IsSet" << publicized_name << "() {" << endl;
-      out << indent() << "    return " << def_var_name << endl;
-      out << indent() << "  }" << endl;
-      out << indent() << "return " << maybepointer << "p." << publicized_name << endl;
-      out << indent() << "}" << endl;
-      num_setable += 1;
-    } else {
-      out << endl;
-      out << indent() << "func (p *" << tstruct_name << ") Get" << publicized_name << "() "
-          << goType << " {" << endl;
-      out << indent() << "  return p." << publicized_name << endl;
-      out << indent() << "}" << endl;
-    }
-  }
-
-  if (tstruct->is_union() && num_setable > 0) {
-    generate_countsetfields_helper(out, tstruct, tstruct_name, is_result);
-  }
-
-  generate_isset_helpers(out, tstruct, tstruct_name, is_result);
-  generate_go_struct_reader(out, tstruct, tstruct_name, is_result);
-  generate_go_struct_writer(out, tstruct, tstruct_name, is_result, num_setable > 0);
-
-  out << indent() << "func (p *" << tstruct_name << ") String() string {" << endl;
-  out << indent() << "  if p == nil {" << endl;
-  out << indent() << "    return \"<nil>\"" << endl;
-  out << indent() << "  }" << endl;
-  out << indent() << "  return fmt.Sprintf(\"" << escape_string(tstruct_name) << "(%+v)\", *p)"
-      << endl;
-  out << indent() << "}" << endl << endl;
-
-  if (is_exception) {
-    out << indent() << "func (p *" << tstruct_name << ") Error() string {" << endl;
-    out << indent() << "  return p.String()" << endl;
-    out << indent() << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates the IsSet helper methods for a struct
- */
-void t_go_generator::generate_isset_helpers(ofstream& out,
-                                            t_struct* tstruct,
-                                            const string& tstruct_name,
-                                            bool is_result) {
-  (void)is_result;
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  const string escaped_tstruct_name(escape_string(tstruct->get_name()));
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    const string field_name(publicize(escape_string((*f_iter)->get_name())));
-    if ((*f_iter)->get_req() == t_field::T_OPTIONAL || is_pointer_field(*f_iter)) {
-      out << indent() << "func (p *" << tstruct_name << ") IsSet" << field_name << "() bool {"
-          << endl;
-      indent_up();
-      t_type* ttype = (*f_iter)->get_type()->get_true_type();
-      bool is_byteslice = ttype->is_base_type() && ((t_base_type*)ttype)->is_binary();
-      bool compare_to_nil_only = ttype->is_set() || ttype->is_list() || ttype->is_map()
-                                 || (is_byteslice && !(*f_iter)->get_value());
-      if (is_pointer_field(*f_iter) || compare_to_nil_only) {
-        out << indent() << "return p." << field_name << " != nil" << endl;
-      } else {
-        string def_var_name = tstruct_name + "_" + field_name + "_DEFAULT";
-        if (is_byteslice) {
-          out << indent() << "return !bytes.Equal(p." << field_name << ", " << def_var_name << ")"
-              << endl;
-        } else {
-          out << indent() << "return p." << field_name << " != " << def_var_name << endl;
-        }
-      }
-      indent_down();
-      out << indent() << "}" << endl << endl;
-    }
-  }
-}
-
-/**
- * Generates the CountSetFields helper method for a struct
- */
-void t_go_generator::generate_countsetfields_helper(ofstream& out,
-                                                    t_struct* tstruct,
-                                                    const string& tstruct_name,
-                                                    bool is_result) {
-  (void)is_result;
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  const string escaped_tstruct_name(escape_string(tstruct->get_name()));
-
-  out << indent() << "func (p *" << tstruct_name << ") CountSetFields" << tstruct_name << "() int {"
-      << endl;
-  indent_up();
-  out << indent() << "count := 0" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED)
-      continue;
-
-    if (!is_pointer_field(*f_iter))
-      continue;
-
-    const string field_name(publicize(escape_string((*f_iter)->get_name())));
-
-    out << indent() << "if (p.IsSet" << field_name << "()) {" << endl;
-    indent_up();
-    out << indent() << "count++" << endl;
-    indent_down();
-    out << indent() << "}" << endl;
-  }
-
-  out << indent() << "return count" << endl << endl;
-  indent_down();
-  out << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates the read method for a struct
- */
-void t_go_generator::generate_go_struct_reader(ofstream& out,
-                                               t_struct* tstruct,
-                                               const string& tstruct_name,
-                                               bool is_result) {
-  (void)is_result;
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  string escaped_tstruct_name(escape_string(tstruct->get_name()));
-  out << indent() << "func (p *" << tstruct_name << ") " << read_method_name_ << "(iprot thrift.TProtocol) error {"
-      << endl;
-  indent_up();
-  out << indent() << "if _, err := iprot.ReadStructBegin(); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T read error: \", p), err)"
-      << endl;
-  out << indent() << "}" << endl << endl;
-
-  // Required variables does not have IsSet functions, so we need tmp vars to check them.
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      indent(out) << "var isset" << field_name << " bool = false;" << endl;
-    }
-  }
-  out << endl;
-
-  // Loop over reading in fields
-  indent(out) << "for {" << endl;
-  indent_up();
-  // Read beginning field marker
-  out << indent() << "_, fieldTypeId, fieldId, err := iprot.ReadFieldBegin()" << endl;
-  out << indent() << "if err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T field %d read error: \", p, fieldId), err)" << endl;
-  out << indent() << "}" << endl;
-  // Check for field STOP marker and break
-  out << indent() << "if fieldTypeId == thrift.STOP { break; }" << endl;
-
-  string thriftFieldTypeId;
-  // Generate deserialization code for known cases
-  int32_t field_id = -1;
-
-  // Switch statement on the field we are reading, false if no fields present
-  bool have_switch = !fields.empty();
-  if (have_switch) {
-    indent(out) << "switch fieldId {" << endl;
-  }
-
-  // All the fields we know
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    field_id = (*f_iter)->get_key();
-
-    // if negative id, ensure we generate a valid method name
-    string field_method_prefix("readField");
-
-    if (field_id < 0) {
-      field_method_prefix += "_";
-      field_id *= -1;
-    }
-
-    out << indent() << "case " << field_id << ":" << endl;
-    indent_up();
-    thriftFieldTypeId = type_to_enum((*f_iter)->get_type());
-
-    if (thriftFieldTypeId == "thrift.BINARY") {
-      thriftFieldTypeId = "thrift.STRING";
-    }
-
-    out << indent() << "if err := p." << field_method_prefix << field_id << "(iprot); err != nil {"
-        << endl;
-    out << indent() << "  return err" << endl;
-    out << indent() << "}" << endl;
-
-    // Mark required field as read
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      out << indent() << "isset" << field_name << " = true" << endl;
-    }
-
-    indent_down();
-  }
-
-  // Begin switch default case
-  if (have_switch) {
-    out << indent() << "default:" << endl;
-    indent_up();
-  }
-
-  // Skip unknown fields in either case
-  out << indent() << "if err := iprot.Skip(fieldTypeId); err != nil {" << endl;
-  out << indent() << "  return err" << endl;
-  out << indent() << "}" << endl;
-
-  // End switch default case
-  if (have_switch) {
-    indent_down();
-    out << indent() << "}" << endl;
-  }
-
-  // Read field end marker
-  out << indent() << "if err := iprot.ReadFieldEnd(); err != nil {" << endl;
-  out << indent() << "  return err" << endl;
-  out << indent() << "}" << endl;
-  indent_down();
-  out << indent() << "}" << endl;
-  out << indent() << "if err := iprot.ReadStructEnd(); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T read struct end error: \", p), err)" << endl;
-  out << indent() << "}" << endl;
-
-  // Return error if any required fields are missing.
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if ((*f_iter)->get_req() == t_field::T_REQUIRED) {
-      const string field_name(publicize(escape_string((*f_iter)->get_name())));
-      out << indent() << "if !isset" << field_name << "{" << endl;
-      out << indent() << "  return thrift.NewTProtocolExceptionWithType(thrift.INVALID_DATA, "
-                         "fmt.Errorf(\"Required field " << field_name << " is not set\"));" << endl;
-      out << indent() << "}" << endl;
-    }
-  }
-
-  out << indent() << "return nil" << endl;
-  indent_down();
-  out << indent() << "}" << endl << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    string field_type_name(publicize((*f_iter)->get_type()->get_name()));
-    string field_name(publicize((*f_iter)->get_name()));
-    string field_method_prefix("readField");
-    int32_t field_id = (*f_iter)->get_key();
-
-    if (field_id < 0) {
-      field_method_prefix += "_";
-      field_id *= -1;
-    }
-
-    out << indent() << "func (p *" << tstruct_name << ")  " << field_method_prefix << field_id
-        << "(iprot thrift.TProtocol) error {" << endl;
-    indent_up();
-    generate_deserialize_field(out, *f_iter, false, "p.");
-    indent_down();
-    out << indent() << "  return nil" << endl;
-    out << indent() << "}" << endl << endl;
-  }
-}
-
-void t_go_generator::generate_go_struct_writer(ofstream& out,
-                                               t_struct* tstruct,
-                                               const string& tstruct_name,
-                                               bool is_result,
-                                               bool uses_countsetfields) {
-  (void)is_result;
-  string name(tstruct->get_name());
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator f_iter;
-  indent(out) << "func (p *" << tstruct_name << ") " << write_method_name_ << "(oprot thrift.TProtocol) error {" << endl;
-  indent_up();
-  if (tstruct->is_union() && uses_countsetfields) {
-    std::string tstruct_name(publicize(tstruct->get_name()));
-    out << indent() << "if c := p.CountSetFields" << tstruct_name << "(); c != 1 {" << endl
-        << indent()
-        << "  return fmt.Errorf(\"%T write union: exactly one field must be set (%d set).\", p, c)"
-        << endl << indent() << "}" << endl;
-  }
-  out << indent() << "if err := oprot.WriteStructBegin(\"" << name << "\"); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(fmt.Sprintf("
-                     "\"%T write struct begin error: \", p), err) }" << endl;
-
-  string field_name;
-  string escape_field_name;
-  // t_const_value* field_default_value;
-  t_field::e_req field_required;
-  int32_t field_id = -1;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    string field_method_prefix("writeField");
-    field_name = (*f_iter)->get_name();
-    escape_field_name = escape_string(field_name);
-    field_id = (*f_iter)->get_key();
-
-    if (field_id < 0) {
-      field_method_prefix += "_";
-      field_id *= -1;
-    }
-
-    out << indent() << "if err := p." << field_method_prefix << field_id
-        << "(oprot); err != nil { return err }" << endl;
-  }
-
-  // Write the struct map
-  out << indent() << "if err := oprot.WriteFieldStop(); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(\"write field stop error: \", err) }" << endl;
-  out << indent() << "if err := oprot.WriteStructEnd(); err != nil {" << endl;
-  out << indent() << "  return thrift.PrependError(\"write struct stop error: \", err) }" << endl;
-  out << indent() << "return nil" << endl;
-  indent_down();
-  out << indent() << "}" << endl << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    string field_method_prefix("writeField");
-    field_id = (*f_iter)->get_key();
-    field_name = (*f_iter)->get_name();
-    escape_field_name = escape_string(field_name);
-    // field_default_value = (*f_iter)->get_value();
-    field_required = (*f_iter)->get_req();
-
-    if (field_id < 0) {
-      field_method_prefix += "_";
-      field_id *= -1;
-    }
-
-    out << indent() << "func (p *" << tstruct_name << ") " << field_method_prefix << field_id
-        << "(oprot thrift.TProtocol) (err error) {" << endl;
-    indent_up();
-
-    if (field_required == t_field::T_OPTIONAL) {
-      out << indent() << "if p.IsSet" << publicize(field_name) << "() {" << endl;
-      indent_up();
-    }
-
-    out << indent() << "if err := oprot.WriteFieldBegin(\"" << escape_field_name << "\", "
-        << type_to_enum((*f_iter)->get_type()) << ", " << field_id << "); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T write field begin error "
-        << field_id << ":" << escape_field_name << ": \", p), err) }" << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "p.");
-
-    // Write field closer
-    out << indent() << "if err := oprot.WriteFieldEnd(); err != nil {" << endl;
-    out << indent() << "  return thrift.PrependError(fmt.Sprintf(\"%T write field end error "
-        << field_id << ":" << escape_field_name << ": \", p), err) }" << endl;
-
-    if (field_required == t_field::T_OPTIONAL) {
-      indent_down();
-      out << indent() << "}" << endl;
-    }
-
-    indent_down();
-    out << indent() << "  return err" << endl;
-    out << indent() << "}" << endl << endl;
-  }
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_go_generator::generate_service(t_service* tservice) {
-  string test_suffix("_test");
-  string filename = lowercase(service_name_);
-  string f_service_name;
-
-  size_t fname_len = filename.length();
-  size_t suffix_len = test_suffix.length();
-
-  if ((fname_len >= suffix_len)
-      && (filename.compare(fname_len - suffix_len, suffix_len, test_suffix) == 0)) {
-    f_service_name = package_dir_ + "/" + filename + "_.go";
-  } else {
-    f_service_name = package_dir_ + "/" + filename + ".go";
-  }
-  f_service_.open(f_service_name.c_str());
-  f_service_ << go_autogen_comment() << go_package() << render_includes();
-
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-  generate_service_remote(tservice);
-  // Close service file
-  f_service_ << endl;
-  f_service_.close();
-  format_go_output(f_service_name);
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_go_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  f_service_ << "// HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_go_struct_definition(f_service_, ts, false, false, true);
-    generate_go_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_go_generator::generate_go_function_helpers(t_function* tfunction) {
-  if (!tfunction->is_oneway()) {
-    t_struct result(program_, tfunction->get_name() + "_result");
-    t_field success(tfunction->get_returntype(), "success", 0);
-    success.set_req(t_field::T_OPTIONAL);
-
-    if (!tfunction->get_returntype()->is_void()) {
-      result.append(&success);
-    }
-
-    t_struct* xs = tfunction->get_xceptions();
-    const vector<t_field*>& fields = xs->get_members();
-    vector<t_field*>::const_iterator f_iter;
-
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      t_field* f = *f_iter;
-      f->set_req(t_field::T_OPTIONAL);
-      result.append(f);
-    }
-
-    generate_go_struct_definition(f_service_, &result, false, true);
-  }
-}
-
-/**
- * Generates a service interface definition.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_go_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_if = "";
-  string serviceName(publicize(tservice->get_name()));
-  string interfaceName = serviceName;
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    size_t index = extends.rfind(".");
-
-    if (index != string::npos) {
-      extends_if = "\n" + indent() + "  " + extends.substr(0, index + 1)
-                   + publicize(extends.substr(index + 1)) + "\n";
-    } else {
-      extends_if = "\n" + indent() + publicize(extends) + "\n";
-    }
-  }
-
-  f_service_ << indent() << "type " << interfaceName << " interface {" << extends_if;
-  indent_up();
-  generate_go_docstring(f_service_, tservice);
-  vector<t_function*> functions = tservice->get_functions();
-
-  if (!functions.empty()) {
-    f_service_ << endl;
-    vector<t_function*>::iterator f_iter;
-
-    for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      generate_go_docstring(f_service_, (*f_iter));
-      f_service_ << indent() << function_signature_if(*f_iter, "", true) << endl;
-    }
-  }
-
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_go_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_field = "";
-  string extends_client = "";
-  string extends_client_new = "";
-  string serviceName(publicize(tservice->get_name()));
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    size_t index = extends.rfind(".");
-
-    if (index != string::npos) {
-      extends_client = extends.substr(0, index + 1) + publicize(extends.substr(index + 1))
-                       + "Client";
-      extends_client_new = extends.substr(0, index + 1) + "New"
-                           + publicize(extends.substr(index + 1)) + "Client";
-    } else {
-      extends_client = publicize(extends) + "Client";
-      extends_client_new = "New" + extends_client;
-    }
-  }
-
-  extends_field = extends_client.substr(extends_client.find(".") + 1);
-
-  generate_go_docstring(f_service_, tservice);
-  f_service_ << indent() << "type " << serviceName << "Client struct {" << endl;
-  indent_up();
-
-  if (!extends_client.empty()) {
-    f_service_ << indent() << "*" << extends_client << endl;
-  } else {
-    f_service_ << indent() << "Transport thrift.TTransport" << endl;
-    f_service_ << indent() << "ProtocolFactory thrift.TProtocolFactory" << endl;
-    f_service_ << indent() << "InputProtocol thrift.TProtocol" << endl;
-    f_service_ << indent() << "OutputProtocol thrift.TProtocol" << endl;
-    f_service_ << indent() << "SeqId int32" << endl;
-    /*f_service_ << indent() << "reqs map[int32]Deferred" << endl*/;
-  }
-
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-  // Constructor function
-  f_service_ << indent() << "func New" << serviceName
-             << "ClientFactory(t thrift.TTransport, f thrift.TProtocolFactory) *" << serviceName
-             << "Client {" << endl;
-  indent_up();
-  f_service_ << indent() << "return &" << serviceName << "Client";
-
-  if (!extends.empty()) {
-    f_service_ << "{" << extends_field << ": " << extends_client_new << "Factory(t, f)}";
-  } else {
-    indent_up();
-    f_service_ << "{Transport: t," << endl;
-    f_service_ << indent() << "ProtocolFactory: f," << endl;
-    f_service_ << indent() << "InputProtocol: f.GetProtocol(t)," << endl;
-    f_service_ << indent() << "OutputProtocol: f.GetProtocol(t)," << endl;
-    f_service_ << indent() << "SeqId: 0," << endl;
-    /*f_service_ << indent() << "Reqs: make(map[int32]Deferred)" << endl*/;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  }
-
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-  // Constructor function
-  f_service_
-      << indent() << "func New" << serviceName
-      << "ClientProtocol(t thrift.TTransport, iprot thrift.TProtocol, oprot thrift.TProtocol) *"
-      << serviceName << "Client {" << endl;
-  indent_up();
-  f_service_ << indent() << "return &" << serviceName << "Client";
-
-  if (!extends.empty()) {
-    f_service_ << "{" << extends_field << ": " << extends_client_new << "Protocol(t, iprot, oprot)}"
-               << endl;
-  } else {
-    indent_up();
-    f_service_ << "{Transport: t," << endl;
-    f_service_ << indent() << "ProtocolFactory: nil," << endl;
-    f_service_ << indent() << "InputProtocol: iprot," << endl;
-    f_service_ << indent() << "OutputProtocol: oprot," << endl;
-    f_service_ << indent() << "SeqId: 0," << endl;
-    /*f_service_ << indent() << "Reqs: make(map[int32]interface{})" << endl*/;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-  }
-
-  indent_down();
-  f_service_ << indent() << "}" << endl << endl;
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = publicize((*f_iter)->get_name());
-    // Open function
-    generate_go_docstring(f_service_, (*f_iter));
-    f_service_ << indent() << "func (p *" << serviceName << "Client) "
-               << function_signature_if(*f_iter, "", true) << " {" << endl;
-    indent_up();
-    /*
-    f_service_ <<
-      indent() << "p.SeqId += 1" << endl;
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ <<
-        indent() << "d := defer.Deferred()" << endl <<
-        indent() << "p.Reqs[p.SeqId] = d" << endl;
-    }
-    */
-    f_service_ << indent() << "if err = p.send" << funname << "(";
-    bool first = true;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-
-      f_service_ << variable_name_to_go_name((*fld_iter)->get_name());
-    }
-
-    f_service_ << "); err != nil { return }" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_ << indent() << "return p.recv" << funname << "()" << endl;
-    } else {
-      f_service_ << indent() << "return" << endl;
-    }
-
-    indent_down();
-    f_service_ << indent() << "}" << endl << endl;
-    f_service_ << indent() << "func (p *" << serviceName << "Client) send"
-               << function_signature(*f_iter) << "(err error) {" << endl;
-    indent_up();
-    std::string argsname = publicize((*f_iter)->get_name() + "_args", true);
-    // Serialize the request header
-    f_service_ << indent() << "oprot := p.OutputProtocol" << endl;
-    f_service_ << indent() << "if oprot == nil {" << endl;
-    f_service_ << indent() << "  oprot = p.ProtocolFactory.GetProtocol(p.Transport)" << endl;
-    f_service_ << indent() << "  p.OutputProtocol = oprot" << endl;
-    f_service_ << indent() << "}" << endl;
-    f_service_ << indent() << "p.SeqId++" << endl;
-    f_service_ << indent() << "if err = oprot.WriteMessageBegin(\"" << (*f_iter)->get_name()
-               << "\", " << ((*f_iter)->is_oneway() ? "thrift.ONEWAY" : "thrift.CALL")
-               << ", p.SeqId); err != nil {" << endl;
-    indent_up();
-    f_service_ << indent() << "  return" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-    f_service_ << indent() << "args := " << argsname << "{" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << indent() << publicize((*fld_iter)->get_name()) << " : "
-                 << variable_name_to_go_name((*fld_iter)->get_name()) << "," << endl;
-    }
-    f_service_ << indent() << "}" << endl;
-
-    // Write to the stream
-    f_service_ << indent() << "if err = args." << write_method_name_ << "(oprot); err != nil {" << endl;
-    indent_up();
-    f_service_ << indent() << "  return" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-    f_service_ << indent() << "if err = oprot.WriteMessageEnd(); err != nil {" << endl;
-    indent_up();
-    f_service_ << indent() << "  return" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl;
-    f_service_ << indent() << "return oprot.Flush()" << endl;
-    indent_down();
-    f_service_ << indent() << "}" << endl << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = publicize((*f_iter)->get_name() + "_result", true);
-      // Open function
-      f_service_ << endl << indent() << "func (p *" << serviceName << "Client) recv"
-                 << publicize((*f_iter)->get_name()) << "() (";
-
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "value " << type_to_go_type((*f_iter)->get_returntype()) << ", ";
-      }
-
-      f_service_ << "err error) {" << endl;
-      indent_up();
-      // TODO(mcslee): Validate message reply here, seq ids etc.
-      string error(tmp("error"));
-      string error2(tmp("error"));
-      f_service_ << indent() << "iprot := p.InputProtocol" << endl;
-      f_service_ << indent() << "if iprot == nil {" << endl;
-      f_service_ << indent() << "  iprot = p.ProtocolFactory.GetProtocol(p.Transport)" << endl;
-      f_service_ << indent() << "  p.InputProtocol = iprot" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "method, mTypeId, seqId, err := iprot.ReadMessageBegin()" << endl;
-      f_service_ << indent() << "if err != nil {" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "if method != \"" << (*f_iter)->get_name() << "\" {" << endl;
-      f_service_ << indent() << "  err = thrift.NewTApplicationException("
-                 << "thrift.WRONG_METHOD_NAME, \"" << (*f_iter)->get_name()
-                 << " failed: wrong method name\")" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "if p.SeqId != seqId {" << endl;
-      f_service_ << indent() << "  err = thrift.NewTApplicationException("
-                 << "thrift.BAD_SEQUENCE_ID, \"" << (*f_iter)->get_name()
-                 << " failed: out of sequence response\")" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "if mTypeId == thrift.EXCEPTION {" << endl;
-      f_service_ << indent() << "  " << error
-                 << " := thrift.NewTApplicationException(thrift.UNKNOWN_APPLICATION_EXCEPTION, "
-                    "\"Unknown Exception\")" << endl;
-      f_service_ << indent() << "  var " << error2 << " error" << endl;
-      f_service_ << indent() << "  " << error2 << ", err = " << error << "." << read_method_name_ << "(iprot)" << endl;
-      f_service_ << indent() << "  if err != nil {" << endl;
-      f_service_ << indent() << "    return" << endl;
-      f_service_ << indent() << "  }" << endl;
-      f_service_ << indent() << "  if err = iprot.ReadMessageEnd(); err != nil {" << endl;
-      f_service_ << indent() << "    return" << endl;
-      f_service_ << indent() << "  }" << endl;
-      f_service_ << indent() << "  err = " << error2 << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "if mTypeId != thrift.REPLY {" << endl;
-      f_service_ << indent() << "  err = thrift.NewTApplicationException("
-                 << "thrift.INVALID_MESSAGE_TYPE_EXCEPTION, \"" << (*f_iter)->get_name()
-                 << " failed: invalid message type\")" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "result := " << resultname << "{}" << endl;
-      f_service_ << indent() << "if err = result." << read_method_name_ << "(iprot); err != nil {" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-      f_service_ << indent() << "if err = iprot.ReadMessageEnd(); err != nil {" << endl;
-      f_service_ << indent() << "  return" << endl;
-      f_service_ << indent() << "}" << endl;
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        const std::string pubname = publicize((*x_iter)->get_name());
-
-        f_service_ << indent() << "if result." << pubname << " != nil {" << endl;
-        f_service_ << indent() << "  err = result." << pubname << endl;
-        f_service_ << indent() << "  return " << endl;
-        f_service_ << indent() << "}";
-
-        if ((x_iter + 1) != xceptions.end()) {
-          f_service_ << " else ";
-        } else {
-          f_service_ << endl;
-        }
-      }
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << indent() << "value = result.GetSuccess()" << endl;
-      }
-
-      f_service_ << indent() << "return" << endl;
-      // Close function
-      indent_down();
-      f_service_ << indent() << "}" << endl << endl;
-    }
-  }
-
-  // indent_down();
-  f_service_ << endl;
-}
-
-/**
- * Generates a command line tool for making remote requests
- *
- * @param tservice The service to generate a remote for.
- */
-void t_go_generator::generate_service_remote(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  t_service* parent = tservice->get_extends();
-
-  // collect inherited functions
-  while (parent != NULL) {
-    vector<t_function*> p_functions = parent->get_functions();
-    functions.insert(functions.end(), p_functions.begin(), p_functions.end());
-    parent = parent->get_extends();
-  }
-
-  vector<t_function*>::iterator f_iter;
-  string f_remote_name = package_dir_ + "/" + underscore(service_name_) + "-remote/"
-                         + underscore(service_name_) + "-remote.go";
-  ofstream f_remote;
-  f_remote.open(f_remote_name.c_str());
-  string service_module = get_real_go_module(program_);
-  string::size_type loc;
-
-  while ((loc = service_module.find(".")) != string::npos) {
-    service_module.replace(loc, 1, 1, '/');
-  }
-  if (!gen_package_prefix_.empty()) {
-    service_module = gen_package_prefix_ + service_module;
-  }
-
-  f_remote << go_autogen_comment();
-  f_remote << indent() << "package main" << endl << endl;
-  f_remote << indent() << "import (" << endl;
-  f_remote << indent() << "        \"flag\"" << endl;
-  f_remote << indent() << "        \"fmt\"" << endl;
-  f_remote << indent() << "        \"math\"" << endl;
-  f_remote << indent() << "        \"net\"" << endl;
-  f_remote << indent() << "        \"net/url\"" << endl;
-  f_remote << indent() << "        \"os\"" << endl;
-  f_remote << indent() << "        \"strconv\"" << endl;
-  f_remote << indent() << "        \"strings\"" << endl;
-  f_remote << indent() << "        \"" + gen_thrift_import_ + "\"" << endl;
-  f_remote << indent() << "        \"" << service_module << "\"" << endl;
-  f_remote << indent() << ")" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "func Usage() {" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Usage of \", os.Args[0], \" "
-                          "[-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]:\")"
-           << endl;
-  f_remote << indent() << "  flag.PrintDefaults()" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"\\nFunctions:\")" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    f_remote << "  fmt.Fprintln(os.Stderr, \"  " << (*f_iter)->get_returntype()->get_name() << " "
-             << (*f_iter)->get_name() << "(";
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const std::vector<t_field*>& args = arg_struct->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    std::vector<t_field*>::size_type num_args = args.size();
-    bool first = true;
-
-    for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) {
-      if (first) {
-        first = false;
-      } else {
-        f_remote << ", ";
-      }
-
-      f_remote << args[i]->get_type()->get_name() << " " << args[i]->get_name();
-    }
-
-    f_remote << ")\")" << endl;
-  }
-
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr)" << endl;
-  f_remote << indent() << "  os.Exit(0)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "func main() {" << endl;
-  indent_up();
-  f_remote << indent() << "flag.Usage = Usage" << endl;
-  f_remote << indent() << "var host string" << endl;
-  f_remote << indent() << "var port int" << endl;
-  f_remote << indent() << "var protocol string" << endl;
-  f_remote << indent() << "var urlString string" << endl;
-  f_remote << indent() << "var framed bool" << endl;
-  f_remote << indent() << "var useHttp bool" << endl;
-  f_remote << indent() << "var parsedUrl url.URL" << endl;
-  f_remote << indent() << "var trans thrift.TTransport" << endl;
-  f_remote << indent() << "_ = strconv.Atoi" << endl;
-  f_remote << indent() << "_ = math.Abs" << endl;
-  f_remote << indent() << "flag.Usage = Usage" << endl;
-  f_remote << indent() << "flag.StringVar(&host, \"h\", \"localhost\", \"Specify host and port\")"
-           << endl;
-  f_remote << indent() << "flag.IntVar(&port, \"p\", 9090, \"Specify port\")" << endl;
-  f_remote << indent() << "flag.StringVar(&protocol, \"P\", \"binary\", \""
-                          "Specify the protocol (binary, compact, simplejson, json)\")" << endl;
-  f_remote << indent() << "flag.StringVar(&urlString, \"u\", \"\", \"Specify the url\")" << endl;
-  f_remote << indent() << "flag.BoolVar(&framed, \"framed\", false, \"Use framed transport\")"
-           << endl;
-  f_remote << indent() << "flag.BoolVar(&useHttp, \"http\", false, \"Use http\")" << endl;
-  f_remote << indent() << "flag.Parse()" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "if len(urlString) > 0 {" << endl;
-  f_remote << indent() << "  parsedUrl, err := url.Parse(urlString)" << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << endl;
-  f_remote << indent() << "    flag.Usage()" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  host = parsedUrl.Host" << endl;
-  f_remote << indent() << "  useHttp = len(parsedUrl.Scheme) <= 0 || parsedUrl.Scheme == \"http\""
-           << endl;
-  f_remote << indent() << "} else if useHttp {" << endl;
-  f_remote << indent() << "  _, err := url.Parse(fmt.Sprint(\"http://\", host, \":\", port))"
-           << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"Error parsing URL: \", err)" << endl;
-  f_remote << indent() << "    flag.Usage()" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "cmd := flag.Arg(0)" << endl;
-  f_remote << indent() << "var err error" << endl;
-  f_remote << indent() << "if useHttp {" << endl;
-  f_remote << indent() << "  trans, err = thrift.NewTHttpClient(parsedUrl.String())" << endl;
-  f_remote << indent() << "} else {" << endl;
-  f_remote << indent() << "  portStr := fmt.Sprint(port)" << endl;
-  f_remote << indent() << "  if strings.Contains(host, \":\") {" << endl;
-  f_remote << indent() << "         host, portStr, err = net.SplitHostPort(host)" << endl;
-  f_remote << indent() << "         if err != nil {" << endl;
-  f_remote << indent() << "                 fmt.Fprintln(os.Stderr, \"error with host:\", err)"
-           << endl;
-  f_remote << indent() << "                 os.Exit(1)" << endl;
-  f_remote << indent() << "         }" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  trans, err = thrift.NewTSocket(net.JoinHostPort(host, portStr))"
-           << endl;
-  f_remote << indent() << "  if err != nil {" << endl;
-  f_remote << indent() << "    fmt.Fprintln(os.Stderr, \"error resolving address:\", err)" << endl;
-  f_remote << indent() << "    os.Exit(1)" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "  if framed {" << endl;
-  f_remote << indent() << "    trans = thrift.NewTFramedTransport(trans)" << endl;
-  f_remote << indent() << "  }" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "if err != nil {" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Error creating transport\", err)" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "defer trans.Close()" << endl;
-  f_remote << indent() << "var protocolFactory thrift.TProtocolFactory" << endl;
-  f_remote << indent() << "switch protocol {" << endl;
-  f_remote << indent() << "case \"compact\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTCompactProtocolFactory()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"simplejson\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTSimpleJSONProtocolFactory()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"json\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTJSONProtocolFactory()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "case \"binary\", \"\":" << endl;
-  f_remote << indent() << "  protocolFactory = thrift.NewTBinaryProtocolFactoryDefault()" << endl;
-  f_remote << indent() << "  break" << endl;
-  f_remote << indent() << "default:" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Invalid protocol specified: \", protocol)"
-           << endl;
-  f_remote << indent() << "  Usage()" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << "client := " << package_name_ << ".New" << publicize(service_name_)
-           << "ClientFactory(trans, protocolFactory)" << endl;
-  f_remote << indent() << "if err := trans.Open(); err != nil {" << endl;
-  f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"Error opening socket to \", "
-                          "host, \":\", port, \" \", err)" << endl;
-  f_remote << indent() << "  os.Exit(1)" << endl;
-  f_remote << indent() << "}" << endl;
-  f_remote << indent() << endl;
-  f_remote << indent() << "switch cmd {" << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const std::vector<t_field*>& args = arg_struct->get_members();
-    vector<t_field*>::const_iterator a_iter;
-    std::vector<t_field*>::size_type num_args = args.size();
-    string funcName((*f_iter)->get_name());
-    string pubName(publicize(funcName));
-    string argumentsName(publicize(funcName + "_args", true));
-    f_remote << indent() << "case \"" << escape_string(funcName) << "\":" << endl;
-    indent_up();
-    f_remote << indent() << "if flag.NArg() - 1 != " << num_args << " {" << endl;
-    f_remote << indent() << "  fmt.Fprintln(os.Stderr, \"" << escape_string(pubName) << " requires "
-             << num_args << " args\")" << endl;
-    f_remote << indent() << "  flag.Usage()" << endl;
-    f_remote << indent() << "}" << endl;
-
-    for (std::vector<t_field*>::size_type i = 0; i < num_args; ++i) {
-      int flagArg = i + 1;
-      t_type* the_type(args[i]->get_type());
-      t_type* the_type2(get_true_type(the_type));
-
-      if (the_type2->is_enum()) {
-        f_remote << indent() << "tmp" << i << ", err := (strconv.Atoi(flag.Arg(" << flagArg << ")))"
-                 << endl;
-        f_remote << indent() << "if err != nil {" << endl;
-        f_remote << indent() << "  Usage()" << endl;
-        f_remote << indent() << " return" << endl;
-        f_remote << indent() << "}" << endl;
-        f_remote << indent() << "argvalue" << i << " := " << package_name_ << "."
-                 << publicize(the_type->get_name()) << "(tmp" << i << ")" << endl;
-      } else if (the_type2->is_base_type()) {
-        t_base_type::t_base e = ((t_base_type*)the_type2)->get_base();
-        string err(tmp("err"));
-
-        switch (e) {
-        case t_base_type::TYPE_VOID:
-          break;
-
-        case t_base_type::TYPE_STRING:
-          if (((t_base_type*)the_type2)->is_binary()) {
-            f_remote << indent() << "argvalue" << i << " := []byte(flag.Arg(" << flagArg << "))"
-                     << endl;
-          } else {
-            f_remote << indent() << "argvalue" << i << " := flag.Arg(" << flagArg << ")" << endl;
-          }
-          break;
-
-        case t_base_type::TYPE_BOOL:
-          f_remote << indent() << "argvalue" << i << " := flag.Arg(" << flagArg << ") == \"true\""
-                   << endl;
-          break;
-
-        case t_base_type::TYPE_BYTE:
-          f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := byte(tmp" << i << ")" << endl;
-          break;
-
-        case t_base_type::TYPE_I16:
-          f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := byte(tmp" << i << ")" << endl;
-          break;
-
-        case t_base_type::TYPE_I32:
-          f_remote << indent() << "tmp" << i << ", " << err << " := (strconv.Atoi(flag.Arg("
-                   << flagArg << ")))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          f_remote << indent() << "argvalue" << i << " := int32(tmp" << i << ")" << endl;
-          break;
-
-        case t_base_type::TYPE_I64:
-          f_remote << indent() << "argvalue" << i << ", " << err
-                   << " := (strconv.ParseInt(flag.Arg(" << flagArg << "), 10, 64))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          break;
-
-        case t_base_type::TYPE_DOUBLE:
-          f_remote << indent() << "argvalue" << i << ", " << err
-                   << " := (strconv.ParseFloat(flag.Arg(" << flagArg << "), 64))" << endl;
-          f_remote << indent() << "if " << err << " != nil {" << endl;
-          f_remote << indent() << "  Usage()" << endl;
-          f_remote << indent() << "  return" << endl;
-          f_remote << indent() << "}" << endl;
-          break;
-
-        default:
-          throw("Invalid base type in generate_service_remote");
-        }
-
-        // f_remote << publicize(args[i]->get_name()) << "(strconv.Atoi(flag.Arg(" << flagArg <<
-        // ")))";
-      } else if (the_type2->is_struct()) {
-        string arg(tmp("arg"));
-        string mbTrans(tmp("mbTrans"));
-        string err1(tmp("err"));
-        string factory(tmp("factory"));
-        string jsProt(tmp("jsProt"));
-        string err2(tmp("err"));
-        std::string tstruct_name(publicize(the_type->get_name()));
-        f_remote << indent() << arg << " := flag.Arg(" << flagArg << ")" << endl;
-        f_remote << indent() << mbTrans << " := thrift.NewTMemoryBufferLen(len(" << arg << "))"
-                 << endl;
-        f_remote << indent() <

<TRUNCATED>


[14/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/build.xml
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/build.xml b/depends/thirdparty/thrift/lib/as3/build.xml
deleted file mode 100755
index 604da42..0000000
--- a/depends/thirdparty/thrift/lib/as3/build.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements. See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership. The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License. You may obtain a copy of the License at
- 
- http://www.apache.org/licenses/LICENSE-2.0
- 
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied. See the License for the
- specific language governing permissions and limitations
- under the License.
- -->
-<project name="libthrift-as3" default="compile" basedir="."
-  xmlns:artifact="antlib:org.apache.maven.artifact.ant">
-	
-  <property name="as3.artifactid" value="${ant.project.name}"/>
-	
-  <property name="thrift.root" location="${basedir}/../../"/>
-  <property name="thrift.java.dir" location="${thrift.root}/lib/java"/>
-  <property name="build.tools.dir" location="${thrift.java.dir}/build/tools/"/>
-  <property name="thrift_compiler" value="${thrift.root}/compiler/cpp/thrift"/> 
-
-  <!-- inherit from the java build file for version and other properties -->
-  <property file="${thrift.java.dir}/build.properties" />
-
-  <property environment="env"/>
-
-  <condition property="version" value="${thrift.version}">
-    <isset property="release"/>
-  </condition>
-  <property name="version" value="${thrift.version}-snapshot"/>
-
-  <property name="as3.final.name" value="${as3.artifactid}-${version}"/>
-
-  <property name="src" value="${basedir}/src"/>
-  <property name="build.dir" value="${basedir}/build"/>
-
-  <property name="as3.swc.file" location="${build.dir}/${as3.final.name}.swc"/>
-  <property name="as3.pom.xml" location="${build.dir}/${as3.final.name}.pom"/>
-
-  <target name="init" depends="setup.init,flex.init" unless="init.finished">
-    <property name="init.finished" value="true"/>
-  </target>
-
-  <target name="setup.init">
-    <tstamp/>
-    <mkdir dir="${build.dir}"/>
-  </target>
-
-  <target name="flex.check" unless="FLEX_HOME">
-    <fail message='You must set the FLEX_HOME property pointing to your flex SDK, eg. ant -DFLEX_HOME="/Applications/Adobe Flex Builder 3/sdks/3.2.0"'/>
-  </target>
-	
-  <target name="flex.init" depends="flex.check" unless="flex.finished">
-    <taskdef resource="flexTasks.tasks" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
-    <property name="flex.finished" value="true"/>
-  </target>
-
-  <target name="compile" depends="init">
-    <path id="as.src.files">
-      <fileset dir="${src}/">
-        <include name="**/*.as"/>
-      </fileset>
-    </path>
-    <pathconvert 
-      property="as.src.classes" 
-      pathsep=" " 
-      dirsep="." 
-      refid="as.src.files"
-    >
-      <map from="${src}/" to=""/>
-      <mapper type="glob" from="*.as" to="*"/>
-    </pathconvert>
-
-    <compc output="${as3.swc.file}" include-classes="${as.src.classes}">
-      <source-path path-element="${src}"/>
-    </compc>
-  </target>
-
-  <target name="clean">
-    <delete dir="${build.dir}" />
-  </target>
-
-  <target name="mvn.ant.tasks.download" depends="setup.init,mvn.ant.tasks.check" unless="mvn.ant.tasks.found">
-    <get src="${mvn.ant.task.url}/${mvn.ant.task.jar}" dest="${build.tools.dir}/${mvn.ant.task.jar}" usetimestamp="true"/>
-  </target>
-
-  <target name="mvn.ant.tasks.check">
-    <condition property="mvn.ant.tasks.found">
-      <typefound uri="antlib:org.apache.maven.artifact.ant" name="artifact"/>
-    </condition>
-  </target>
-
-  <target name="mvn.init" depends="mvn.ant.tasks.download" unless="mvn.finished">
-    <echo message="${mvn.ant.task.jar}"/>
-    <!-- Download mvn ant tasks, download dependencies, and setup pom file -->
-    <typedef uri="antlib:org.apache.maven.artifact.ant" classpath="${build.tools.dir}/${mvn.ant.task.jar}"/>
-
-    <!-- remote repositories used to download dependencies from -->
-    <artifact:remoteRepository id="central" url="${mvn.repo}"/>
-    <artifact:remoteRepository id="apache" url="${apache.repo}"/>
-
-    <!-- Pom file information -->
-    <artifact:pom id="pom" 
-      groupId="${thrift.groupid}" 
-      artifactId="${as3.artifactid}"
-      version="${version}" 
-      url="http://thrift.apache.org"
-      name="Apache Thrift"
-      description="Thrift is a software framework for scalable cross-language services development."
-      packaging="pom"
-    >
-      <remoteRepository refid="central"/>
-      <remoteRepository refid="apache"/>
-      <license name="The Apache Software License, Version 2.0" url="${license}"/>
-      <scm connection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git" 
-      developerConnection="scm:git:https://git-wip-us.apache.org/repos/asf/thrift.git"
-      url="https://git-wip-us.apache.org/repos/asf?p=thrift.git"
-      />
-      <!-- Thrift Developers -->
-      <developer id="mcslee" name="Mark Slee"/>
-      <developer id="dreiss" name="David Reiss"/>
-      <developer id="aditya" name="Aditya Agarwal"/>
-      <developer id="marck" name="Marc Kwiatkowski"/>
-      <developer id="jwang" name="James Wang"/>
-      <developer id="cpiro" name="Chris Piro"/>
-      <developer id="bmaurer" name="Ben Maurer"/>
-      <developer id="kclark" name="Kevin Clark"/>
-      <developer id="jake" name="Jake Luciani"/>
-      <developer id="bryanduxbury" name="Bryan Duxbury"/>
-      <developer id="esteve" name="Esteve Fernandez"/>
-      <developer id="todd" name="Todd Lipcon"/>
-      <developer id="geechorama" name="Andrew McGeachie"/>
-      <developer id="molinaro" name="Anthony Molinaro"/>
-      <developer id="roger" name="Roger Meier"/>
-      <developer id="jfarrell" name="Jake Farrell"/>
-      <developer id="jensg" name="Jens Geyer"/>
-      <developer id="carl" name="Carl Yeksigian"/>
-    </artifact:pom>
-
-    <!-- Generate the pom file -->
-    <artifact:writepom pomRefId="pom" file="${as3.pom.xml}"/>
-
-    <property name="mvn.finished" value="true"/>
-  </target>
-
-  <macrodef name="signAndDeploy">
-    <!-- Sign and deploy jars to apache repo -->
-    <attribute name="file"/>
-    <attribute name="classifier" default=""/>
-    <attribute name="packaging" default="jar"/>
-    <attribute name="pom" default=""/>
-    <sequential>
-      <artifact:mvn fork="true">
-        <arg value="org.apache.maven.plugins:maven-gpg-plugin:1.1:sign-and-deploy-file"/>
-        <arg value="-DrepositoryId=${maven-repository-id}"/>
-        <arg value="-Durl=${maven-repository-url}"/>
-        <arg value="-DpomFile=@{pom}"/>
-        <arg value="-Dfile=@{file}"/>
-        <arg value="-Dclassifier=@{classifier}"/>
-        <arg value="-Dpackaging=@{packaging}"/>
-        <arg value="-Pgpg"/>
-      </artifact:mvn>
-    </sequential>
-  </macrodef>
-
-  <target name="publish" depends="clean,compile,mvn.init">
-    <!-- Compile, packages and then send release to apache maven repo -->
-    <!-- run with: ant -Drelease=true publish -->
-    <signAndDeploy file="${as3.pom.xml}" packaging="pom" classifier="" pom="${as3.pom.xml}"/>
-    <signAndDeploy file="${as3.swc.file}" packaging="swc" classifier="" pom="${as3.pom.xml}"/>
-  </target>	
-</project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/coding_standards.md b/depends/thirdparty/thrift/lib/as3/coding_standards.md
deleted file mode 100644
index fa0390b..0000000
--- a/depends/thirdparty/thrift/lib/as3/coding_standards.md
+++ /dev/null
@@ -1 +0,0 @@
-Please follow [General Coding Standards](/doc/coding_standards.md)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/AbstractMethodError.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/AbstractMethodError.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/AbstractMethodError.as
deleted file mode 100644
index a2082b8..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/AbstractMethodError.as
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift {
-
-  import flash.errors.IllegalOperationError;
-
-  public class AbstractMethodError extends IllegalOperationError {
-    
-    public function AbstractMethodError(message:String="") {
-      super("Attempt to call an abstract method");
-    }
-    
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/Set.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/Set.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/Set.as
deleted file mode 100644
index ae5f428..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/Set.as
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift {
-  import flash.utils.Dictionary;
-  
-  
-  public class Set {
-    
-    private var _elements:Dictionary = new Dictionary();
-    private var _size:int = 0;
-    
-    public function Set(... values) {
-      for each (var value:* in values) {
-        add(value);
-      }
-    }
-
-    public function add(o:*):Boolean {
-      var alreadyPresent:Boolean = _elements.hasOwnProperty(o);
-      if (! alreadyPresent) {
-        _size++;
-        _elements[o] = true;
-      }
-     
-      return ! alreadyPresent;
-    }
-
-    public function clear():void {
-      for (var value:* in _elements) {
-        remove(value);
-      }
-    }
-    
-    public function contains(o:Object):Boolean {
-      return _elements.hasOwnProperty(o);
-    }
-    
-    public function isEmpty():Boolean {
-      return _size == 0;
-    }
-    
-    public function remove(o:*):Boolean {
-      if (contains(o)) {
-        delete _elements[o];
-        _size--;
-        return true;
-      }
-      else {
-        return false;
-      }
-    }
-    
-    public function toArray():Array {
-      var ret:Array = new Array();
-      for (var key:* in _elements) {
-        ret.push(key);
-      }
-      return ret;
-    }
-    
-    public function get size():int {
-      return _size;
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TApplicationError.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TApplicationError.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TApplicationError.as
deleted file mode 100644
index 3448fce..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TApplicationError.as
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift {
-
-  import org.apache.thrift.protocol.TField;
-  import org.apache.thrift.protocol.TProtocol;
-  import org.apache.thrift.protocol.TProtocolUtil;
-  import org.apache.thrift.protocol.TStruct;
-  import org.apache.thrift.protocol.TType;
-
-  /**
-   * Application level exception
-   */
-  public class TApplicationError extends TError {
-
-    private static const TAPPLICATION_EXCEPTION_STRUCT:TStruct = new TStruct("TApplicationException");
-    private static const MESSAGE_FIELD:TField = new TField("message", TType.STRING, 1);
-    private static const TYPE_FIELD:TField = new TField("type", TType.I32, 2);
-
-    public static const UNKNOWN:int = 0;
-    public static const UNKNOWN_METHOD:int = 1;
-    public static const INVALID_MESSAGE_TYPE:int = 2;
-    public static const WRONG_METHOD_NAME:int = 3;
-    public static const BAD_SEQUENCE_ID:int = 4;
-    public static const MISSING_RESULT:int = 5;
-    public static const INTERNAL_ERROR:int = 6;
-    public static const PROTOCOL_ERROR:int = 7;
-    public static const INVALID_TRANSFORM:int = 8;
-    public static const INVALID_PROTOCOL:int = 9;
-    public static const UNSUPPORTED_CLIENT_TYPE:int = 10;
-
-    public function TApplicationError(type:int = UNKNOWN, message:String = "") {
-      super(message, type);
-    }
-
-    public static function read(iprot:TProtocol):TApplicationError {
-      var field:TField;
-      iprot.readStructBegin();
-
-      var message:String = null;
-      var type:int = UNKNOWN;
-
-      while (true) {
-        field = iprot.readFieldBegin();
-        if (field.type == TType.STOP) {
-          break;
-        }
-        switch (field.id) {
-          case 1:
-            if (field.type == TType.STRING) {
-              message = iprot.readString();
-            }
-            else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          case 2:
-            if (field.type == TType.I32) {
-              type = iprot.readI32();
-            }
-            else {
-              TProtocolUtil.skip(iprot, field.type);
-            }
-            break;
-          default:
-            TProtocolUtil.skip(iprot, field.type);
-            break;
-        }
-        iprot.readFieldEnd();
-      }
-      iprot.readStructEnd();
-      return new TApplicationError(type, message);
-    }
-
-    public function write(oprot:TProtocol):void {
-        oprot.writeStructBegin(TAPPLICATION_EXCEPTION_STRUCT);
-        if (message != null) {
-          oprot.writeFieldBegin(MESSAGE_FIELD);
-          oprot.writeString(message);
-          oprot.writeFieldEnd();
-        }
-        oprot.writeFieldBegin(TYPE_FIELD);
-        oprot.writeI32(errorID);
-        oprot.writeFieldEnd();
-        oprot.writeFieldStop();
-        oprot.writeStructEnd();
-      }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TBase.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TBase.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TBase.as
deleted file mode 100644
index 615db1d..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TBase.as
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift {
-
-  import org.apache.thrift.protocol.TProtocol;
-
-  /**
-   * Generic base interface for generated Thrift objects.
-   *
-   */
-  public interface TBase {
-  
-    /**
-     * Reads the TObject from the given input protocol.
-     *
-     * @param iprot Input protocol
-     */
-    function read(iprot:TProtocol):void;
-  
-    /**
-     * Writes the objects out to the protocol
-     *
-     * @param oprot Output protocol
-     */
-    function write(oprot:TProtocol):void;
-  
-    /**
-     * Check if a field is currently set or unset.
-     *
-     * @param fieldId The field's id tag as found in the IDL.
-     */
-    function isSet(fieldId:int):Boolean;
-  
-    /**
-     * Get a field's value by id. Primitive types will be wrapped in the 
-     * appropriate "boxed" types.
-     *
-     * @param fieldId The field's id tag as found in the IDL.
-     */
-    function getFieldValue(fieldId:int):*;
-  
-    /**
-     * Set a field's value by id. Primitive types must be "boxed" in the 
-     * appropriate object wrapper type.
-     *
-     * @param fieldId The field's id tag as found in the IDL.
-     */
-    function setFieldValue(fieldId:int, value:*):void;
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TError.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TError.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TError.as
deleted file mode 100644
index ccc13b5..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TError.as
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift {
-  
-  public class TError extends Error {
-    
-    public function TError(message:String = "", errorCode:int = 0) {
-      super(message, errorCode);
-    }
-    
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TFieldRequirementType.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TFieldRequirementType.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TFieldRequirementType.as
deleted file mode 100644
index 6fb4e58..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TFieldRequirementType.as
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift {
-
-  /**
-   * Requirement type constants.
-   *
-   */
-  public class TFieldRequirementType {
-    public static const REQUIRED:int  = 1;
-    public static const OPTIONAL:int = 2;
-    public static const DEFAULT:int = 3;
-  }
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TProcessor.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TProcessor.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TProcessor.as
deleted file mode 100644
index 850acc9..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TProcessor.as
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
- package org.apache.thrift {
-
-import org.apache.thrift.protocol.TProtocol;
-
-    /**
-     * A processor is a generic object which operates upon an input stream and
-     * writes to some output stream.
-     *
-     */
-    public interface TProcessor {
-      function process(input:TProtocol, output:TProtocol):Boolean;
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as
deleted file mode 100644
index cb18a14..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-
-  import flash.utils.Dictionary;
-
-  /**
-   * This class is used to store meta data about thrift fields. Every field in a
-   * a struct should have a corresponding instance of this class describing it.
-   *
-   */
-  public class FieldMetaData {
-  
-    public var fieldName:String;
-    public var requirementType:int;
-    public var valueMetaData:FieldValueMetaData;
-  
-    private static var structMap:Dictionary = new Dictionary();
-  
-    public function FieldMetaData(name:String, req:int, vMetaData:FieldValueMetaData) {
-      this.fieldName = name;
-      this.requirementType = req;
-      this.valueMetaData = vMetaData;
-    }
-  
-    public static function addStructMetaDataMap(sClass:Class, map:Dictionary):void{
-      structMap[sClass] = map;
-    }
-
-    /**
-     * Returns a map with metadata (i.e. instances of FieldMetaData) that
-     * describe the fields of the given class.
-     *
-     * @param sClass The TBase class for which the metadata map is requested
-     */
-    public static function getStructMetaDataMap(sClass:Class):Dictionary {
-      return structMap[sClass];
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldValueMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldValueMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldValueMetaData.as
deleted file mode 100644
index 07fe1be..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldValueMetaData.as
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-
-  import org.apache.thrift.protocol.TType;
-
-  /**
-   * FieldValueMetaData and collection of subclasses to store metadata about
-   * the value(s) of a field
-   */
-  public class FieldValueMetaData {
-  
-    public var type:int;  
- 
-    public function FieldValueMetaData(type:int) {
-      this.type = type;
-    }
-  
-    public function isStruct():Boolean {
-      return type == TType.STRUCT; 
-    }
-  
-    public function isContainer():Boolean {
-      return type == TType.LIST || type == TType.MAP || type == TType.SET;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/ListMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/ListMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/ListMetaData.as
deleted file mode 100644
index a2cc732..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/ListMetaData.as
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-  
-  public class ListMetaData extends FieldValueMetaData {
-    
-    public var elemMetaData:FieldValueMetaData;
-  
-    public function ListMetaData(type:int, eMetaData:FieldValueMetaData) {
-      super(type);
-      this.elemMetaData = eMetaData;
-    }    
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/MapMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/MapMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/MapMetaData.as
deleted file mode 100644
index e7f1f9f..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/MapMetaData.as
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-
-  public class MapMetaData extends FieldValueMetaData {
-  
-    public var keyMetaData:FieldValueMetaData;
-    public var valueMetaData:FieldValueMetaData;
-  
-    public function MapMetaData(type:int, kMetaData:FieldValueMetaData, vMetaData:FieldValueMetaData) {
-      super(type);
-      this.keyMetaData = kMetaData;
-      this.valueMetaData = vMetaData;
-    }
-  }    
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/SetMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/SetMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/SetMetaData.as
deleted file mode 100644
index 390f034..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/SetMetaData.as
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-
-  public class SetMetaData extends FieldValueMetaData {
-  
-    public var elemMetaData:FieldValueMetaData;
-  
-    public function SetMetaData(type:int, eMetaData:FieldValueMetaData) {
-      super(type);
-      this.elemMetaData = eMetaData; 
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/StructMetaData.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/StructMetaData.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/StructMetaData.as
deleted file mode 100644
index fc9b0be..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/StructMetaData.as
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.meta_data {
-
-  public class StructMetaData extends FieldValueMetaData {
-    
-    public var structClass:Class;
-  
-    public function StructMetaData(type:int, sClass:Class) {
-      super(type);
-      this.structClass = sClass;
-    }
-  }    
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TBinaryProtocol.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TBinaryProtocol.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TBinaryProtocol.as
deleted file mode 100644
index b2ff9d8..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TBinaryProtocol.as
+++ /dev/null
@@ -1,316 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-
-  import flash.utils.ByteArray;
-  
-  import org.apache.thrift.TError;
-  import org.apache.thrift.transport.THttpClient;
-  import org.apache.thrift.transport.TTransport;
-    
-  /**
-   * Binary protocol implementation for thrift.
-   */
-  public class TBinaryProtocol implements TProtocol {
-
-    private static var ANONYMOUS_STRUCT:TStruct = new TStruct();
-
-    protected static const VERSION_MASK:int = int(0xffff0000);
-    protected static const VERSION_1:int = int(0x80010000);
-
-    protected var strictRead_:Boolean = false;
-    protected var strictWrite_:Boolean = true;
-    
-  /**
-   * Factory
-   */
-   /*
-  public static class Factory implements TProtocolFactory {
-    protected boolean strictRead_ = false;
-    protected boolean strictWrite_ = true;
-
-    public Factory() {
-      this(false, true);
-    }
-
-    public Factory(boolean strictRead, boolean strictWrite) {
-      strictRead_ = strictRead;
-      strictWrite_ = strictWrite;
-    }
-
-    public TProtocol getProtocol(TTransport trans) {
-      return new TBinaryProtocol(trans, strictRead_, strictWrite_);
-    }
-  }
-  */
-  
-    private var trans_:TTransport;
-    
-    /**
-     * Constructor
-     */
-    public function TBinaryProtocol(trans:TTransport, strictRead:Boolean=false, strictWrite:Boolean=true) {
-      trans_ = trans;
-      strictRead_ = strictRead;
-      strictWrite_ = strictWrite;
-    }
-  
-    public function getTransport():TTransport {
-      return trans_;
-    }
-    
-    public function writeMessageBegin(message:TMessage):void {
-        if (strictWrite_) {
-          var version:int = VERSION_1 | message.type;
-          writeI32(version);
-          writeString(message.name);
-          writeI32(message.seqid);
-        } else {
-          writeString(message.name);
-          writeByte(message.type);
-          writeI32(message.seqid);
-        }
-    }
-    
-      public function writeMessageEnd():void {}
-  
-    public function writeStructBegin(struct:TStruct):void {}
-  
-    public function writeStructEnd():void {}
-  
-    public function writeFieldBegin(field:TField):void {
-      writeByte(field.type);
-      writeI16(field.id);
-    }
-    
-    public function writeFieldEnd():void {}
-    
-    public function writeFieldStop():void {
-      writeByte(TType.STOP);
-    }
-    
-    public function writeMapBegin(map:TMap):void {
-      writeByte(map.keyType);
-      writeByte(map.valueType);
-      writeI32(map.size);
-    }
-    
-    public function writeMapEnd():void {}
-    
-    public function writeListBegin(list:TList):void {
-        writeByte(list.elemType);
-        writeI32(list.size);
-    }
-    
-    public function writeListEnd():void {}
-    
-    public function writeSetBegin(set:TSet):void {
-        writeByte(set.elemType);
-        writeI32(set.size);
-      }
-      
-      public function writeSetEnd():void {}
-      
-      public function writeBool(b:Boolean):void {
-        writeByte(b ? 1 : 0);
-      }
-      
-      private var out:ByteArray = new ByteArray();
-      public function writeByte(b:int):void {
-        reset(out);
-        out.writeByte(b);
-        trans_.write(out, 0, 1);
-      }
-      
-      public function writeI16(i16:int):void {
-        reset(out);
-        out.writeShort(i16);
-        trans_.write(out, 0, 2);
-      }
-      
-      public function writeI32(i32:int):void {
-        reset(out);
-        out.writeInt(i32);
-        trans_.write(out, 0, 4);
-      }
-      
-      //private byte[] i64out = new byte[8];
-      //public function writeI64(i64:Number):void {
-        //i64out[0] = (byte)(0xff & (i64 >> 56));
-        //i64out[1] = (byte)(0xff & (i64 >> 48));
-        //i64out[2] = (byte)(0xff & (i64 >> 40));
-        //i64out[3] = (byte)(0xff & (i64 >> 32));
-        //i64out[4] = (byte)(0xff & (i64 >> 24));
-        //i64out[5] = (byte)(0xff & (i64 >> 16));
-        //i64out[6] = (byte)(0xff & (i64 >> 8));
-        //i64out[7] = (byte)(0xff & (i64));
-        //trans_.write(i64out, 0, 8);
-      //}
-      
-      public function writeDouble(dub:Number):void {
-        reset(out);
-        out.writeDouble(dub);
-        trans_.write(out, 0, 8);
-      }
-      
-      private var stringOut:ByteArray = new ByteArray();
-      
-      public function writeString(str:String):void {
-        reset(stringOut);
-        stringOut.writeUTFBytes(str);
-        
-        writeI32(stringOut.length);
-        trans_.write(stringOut, 0, stringOut.length);
-      }
-  
-    public function writeBinary(bin:ByteArray):void {
-      writeI32(bin.length);
-      trans_.write(bin, 0, bin.length);
-    }
-  
-    /**
-     * Reading methods.
-     */
-  
-    public function readMessageBegin():TMessage {
-      var size:int = readI32();
-      if (size < 0) {
-        var version:int = size & VERSION_MASK;
-        if (version != VERSION_1) {
-          throw new TProtocolError(TProtocolError.BAD_VERSION, "Bad version in readMessageBegin");
-        }
-        return new TMessage(readString(), size & 0x000000ff, readI32());
-      }
-      else {
-        if (strictRead_) {
-          throw new TProtocolError(TProtocolError.BAD_VERSION, "Missing version in readMessageBegin, old client?");
-        }
-            return new TMessage(readStringBody(size), readByte(), readI32());
-          }
-    }
-  
-    public function readMessageEnd():void {}
-  
-    public function readStructBegin():TStruct {
-        return ANONYMOUS_STRUCT;
-      }
-  
-    public function readStructEnd():void {}
-  
-    public function readFieldBegin():TField {
-        var type:int = readByte();
-        var id:int = type == TType.STOP ? 0 : readI16();
-        return new TField("", type, id);
-    }
-  
-    public function readFieldEnd():void {}
-  
-    public function readMapBegin():TMap {
-        return new TMap(readByte(), readByte(), readI32());
-    }
-  
-    public function readMapEnd():void {}
-  
-    public function readListBegin():TList {
-        return new TList(readByte(), readI32());
-    }
-  
-    public function readListEnd():void {}
-  
-    public function readSetBegin():TSet {
-      return new TSet(readByte(), readI32());
-    }
-  
-    public function readSetEnd():void {}
-  
-    public function readBool():Boolean {
-        return (readByte() == 1);
-    }
-  
-    private var bytes:ByteArray = new ByteArray();
-    
-    public function readByte():int {
-      readAll(1);
-        return bytes.readByte();
-      }
-  
-    public function readI16():int {
-        readAll(2);
-        return bytes.readShort();
-    }
-  
-    public function readI32():int {
-      readAll(4);
-      return bytes.readInt();
-    }
-  
-    //private byte[] i64rd = new byte[8];
-    /*
-    public function readI64() throws TException {
-      readAll(i64rd, 0, 8);
-      return
-        ((long)(i64rd[0] & 0xff) << 56) |
-        ((long)(i64rd[1] & 0xff) << 48) |
-        ((long)(i64rd[2] & 0xff) << 40) |
-        ((long)(i64rd[3] & 0xff) << 32) |
-        ((long)(i64rd[4] & 0xff) << 24) |
-        ((long)(i64rd[5] & 0xff) << 16) |
-        ((long)(i64rd[6] & 0xff) <<  8) |
-        ((long)(i64rd[7] & 0xff));
-    }
-    */
-  
-    public function readDouble():Number {
-      readAll(8);
-      return bytes.readDouble();
-    }
-  
-    public function readString():String {
-      var size:int = readI32();
-        readAll(size);
-        return bytes.readUTFBytes(size);
-      }
-  
-    public function readStringBody(size:int):String {
-        readAll(size);
-        return bytes.readUTFBytes(size);
-      }
-  
-    public function readBinary():ByteArray {
-        var size:int = readI32();
-        var buf:ByteArray = new ByteArray();
-        trans_.readAll(buf, 0, size);
-        return buf;
-    }
-  
-    private function readAll(len:int):void {
-      reset(bytes);
-      
-        trans_.readAll(bytes, 0, len);
-        
-        bytes.position = 0;
-      }
-    
-    private static function reset(arr:ByteArray):void {
-      arr.length = 0;
-      arr.position = 0;
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TField.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TField.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TField.as
deleted file mode 100644
index 1277f3a..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TField.as
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.protocol {
-    
-  public class TField {
-    
-    public var name:String;
-    public var type:int;
-    public var id:int;
-      
-    public function TField(n:String = "", t:int = 0, i:int = 0) {
-      name = n;
-      type = t;
-      id = i;
-    }
-    
-    public function toString():String {
-      return "<TField name:'" + name + "' type:" + type + " field-id:" + id + ">";
-    }
-    
-    public function equals(otherField:TField):Boolean {
-      return type == otherField.type && id == otherField.id;
-    }
-        
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TList.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TList.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TList.as
deleted file mode 100644
index f0bdbad..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TList.as
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.protocol {
-  
-  public class TList {
-
-    public var elemType:int;
-    public var size:int;
-  
-      public function TList(t:int = 0, s:int = 0) {
-        elemType = t;
-        size = s;
-      }
-      
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMap.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMap.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMap.as
deleted file mode 100644
index 2298804..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMap.as
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.protocol {
-  public class TMap {
-    
-    public var keyType:int;
-    public var valueType:int;
-    public var size:int;
-  
-    public function TMap(k:int = 0, v:int = 0, s:int = 0) {
-      keyType = k;
-      valueType = v;
-      size = s;
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessage.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessage.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessage.as
deleted file mode 100644
index 9817235..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessage.as
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.protocol {
-  
-  public class TMessage {
-    
-    public var name:String;
-    public var type:int;
-    public var seqid:int;
-  
-    public function TMessage(n:String = "", t:int = 0, s:int = 0) {
-      name = n;
-      type = t;
-      seqid = s;
-    }
-    
-    public function toString():String {
-      return "<TMessage name:'" + name + "' type: " + type + " seqid:" + seqid + ">";
-    }
-    
-    public function equals(other:TMessage):Boolean {
-      return name == other.name && type == other.type && seqid == other.seqid;
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessageType.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessageType.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessageType.as
deleted file mode 100644
index 56a9ba5..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessageType.as
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.protocol {
-  
-  public class TMessageType {
-    public static const CALL:int  = 1;
-    public static const REPLY:int = 2;
-    public static const EXCEPTION:int = 3;
-    public static const ONEWAY:int = 4;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocol.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocol.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocol.as
deleted file mode 100644
index bb9d744..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocol.as
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-
-  import org.apache.thrift.TError;
-  import org.apache.thrift.transport.TTransport;
-
-  import flash.utils.ByteArray;
-  
-  /**
-   * Protocol interface definition
-   */
-  public interface TProtocol {
-  
-    function TProtocol(trans:TTransport);
-
-    function getTransport():TTransport;
-
-    /**
-     * Writing methods.
-     */
-    function writeMessageBegin(message:TMessage):void;
-  
-    function writeMessageEnd():void;
-    
-    function writeStructBegin(struct:TStruct):void;
-    
-    function writeStructEnd():void;
-    
-    function writeFieldBegin(field:TField):void;
-    
-    function writeFieldEnd():void;
-    
-    function writeFieldStop():void;
-    
-    function writeMapBegin(map:TMap):void;
-    
-    function writeMapEnd():void;
-    
-    function writeListBegin(list:TList):void;
-    
-    function writeListEnd():void;
-    
-    function writeSetBegin(set:TSet):void;
-    
-    function writeSetEnd():void;
-    
-    function writeBool(b:Boolean):void;
-    
-    function writeByte(b:int):void;
-    
-    function writeI16(i16:int):void;
-    
-    function writeI32(i32:int):void;
-    
-    //function writeI64(i64:Number):void;
-    
-    function writeDouble(dub:Number):void;
-    
-    function writeString(str:String):void;
-    
-    function writeBinary(bin:ByteArray):void;
-    
-    /**
-     * Reading methods.
-     */
-    function readMessageBegin():TMessage;
-    
-    function readMessageEnd():void;
-    
-    function readStructBegin():TStruct;
-    
-    function readStructEnd():void;
-    
-    function readFieldBegin():TField;
-    
-    function readFieldEnd():void;
-    
-    function readMapBegin():TMap;
-    
-    function readMapEnd():void;
-    
-    function readListBegin():TList;
-    
-    function readListEnd():void;
-    
-    function readSetBegin():TSet;
-    
-    function readSetEnd():void;
-    
-    function readBool():Boolean;
-    
-    function readByte():int;
-    
-    function readI16():int;
-    
-    function readI32():int;
-    
-    //function readI64():Number;
-    
-    function readDouble():Number;
-    
-    function readString():String;
-    
-    function readBinary():ByteArray;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolError.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolError.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolError.as
deleted file mode 100644
index 9fff730..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolError.as
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-  
-  import org.apache.thrift.TError;
-
-  public class TProtocolError extends TError {
-    
-    public static const UNKNOWN:int = 0;
-    public static const INVALID_DATA:int = 1;
-    public static const NEGATIVE_SIZE:int = 2;
-    public static const SIZE_LIMIT:int = 3;
-    public static const BAD_VERSION:int = 4;
-    public static const NOT_IMPLEMENTED:int = 5;
-    public static const DEPTH_LIMIT:int = 6;
-  
-    public function TProtocolError(error:int = UNKNOWN, message:String = "") {
-      super(message, error);
-    }
-    
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolFactory.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolFactory.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolFactory.as
deleted file mode 100644
index c7f5e29..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolFactory.as
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-
-  import org.apache.thrift.transport.TTransport;
-  
-  public interface TProtocolFactory {
-     function getProtocol(trans:TTransport):TProtocol;
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolUtil.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolUtil.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolUtil.as
deleted file mode 100644
index 513df95..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolUtil.as
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-
-  import org.apache.thrift.TError;
-
-  /**
-   * Utility class with static methods for interacting with protocol data
-   * streams.
-   *
-   */
-  public class TProtocolUtil {
-
-    /**
-     * The maximum recursive depth the skip() function will traverse before
-     * throwing a TException.
-     */
-    private static var maxSkipDepth:int = int.MAX_VALUE;
-
-    /**
-     * Specifies the maximum recursive depth that the skip function will
-     * traverse before throwing a TException.  This is a global setting, so
-     * any call to skip in this JVM will enforce this value.
-     *
-     * @param depth  the maximum recursive depth.  A value of 2 would allow
-     *    the skip function to skip a structure or collection with basic children,
-     *    but it would not permit skipping a struct that had a field containing
-     *    a child struct.  A value of 1 would only allow skipping of simple
-     *    types and empty structs/collections.
-     */
-    public function setMaxSkipDepth(depth:int):void {
-      maxSkipDepth = depth;
-    }
-
-    /**
-     * Skips over the next data element from the provided input TProtocol object.
-     *
-     * @param prot  the protocol object to read from
-     * @param type  the next value will be intepreted as this TType value.
-     */
-    public static function skip(prot:TProtocol, type:int):void {
-      skipMaxDepth(prot, type, maxSkipDepth);
-    }
-
-     /**
-     * Skips over the next data element from the provided input TProtocol object.
-     *
-     * @param prot  the protocol object to read from
-     * @param type  the next value will be intepreted as this TType value.
-     * @param maxDepth  this function will only skip complex objects to this
-     *   recursive depth, to prevent Java stack overflow.
-     */
-    public static function skipMaxDepth(prot:TProtocol, type:int, maxDepth:int):void {
-      if (maxDepth <= 0) {
-        throw new TError("Maximum skip depth exceeded");
-      }
-      switch (type) {
-        case TType.BOOL: {
-          prot.readBool();
-          break;
-        }
-        case TType.BYTE: {
-          prot.readByte();
-          break;
-        }
-        case TType.I16: {
-          prot.readI16();
-          break;
-        }
-        case TType.I32: {
-          prot.readI32();
-          break;
-        }
-        /*
-        case TType.I64: {
-          prot.readI64();
-          break;
-        }
-        */
-        case TType.DOUBLE: {
-          prot.readDouble();
-          break;
-        }
-        case TType.STRING: {
-          prot.readBinary();
-          break;
-        }
-        case TType.STRUCT: {
-          prot.readStructBegin();
-          while (true) {
-            var field:TField = prot.readFieldBegin();
-            if (field.type == TType.STOP) {
-              break;
-            }
-            skipMaxDepth(prot, field.type, maxDepth - 1);
-            prot.readFieldEnd();
-          }
-          prot.readStructEnd();
-          break;
-        }
-        case TType.MAP: {
-          var map:TMap = prot.readMapBegin();
-          for (var i:int = 0; i < map.size; i++) {
-            skipMaxDepth(prot, map.keyType, maxDepth - 1);
-            skipMaxDepth(prot, map.valueType, maxDepth - 1);
-          }
-          prot.readMapEnd();
-          break;
-        }
-        case TType.SET: {
-          var set:TSet = prot.readSetBegin();
-          for (var j:int = 0; j < set.size; j++) {
-            skipMaxDepth(prot, set.elemType, maxDepth - 1);
-          }
-          prot.readSetEnd();
-          break;
-        }
-        case TType.LIST: {
-          var list:TList = prot.readListBegin();
-          for (var k:int = 0; k < list.size; k++) {
-            skipMaxDepth(prot, list.elemType, maxDepth - 1);
-          }
-          prot.readListEnd();
-          break;
-        }
-        default:
-          break;
-      }
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TSet.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TSet.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TSet.as
deleted file mode 100644
index 3f0e1a6..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TSet.as
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-  
-  public class TSet {
-
-    public var elemType:int;
-    public var size:int;
-  
-      public function TSet(t:int = 0, s:int = 0) {
-        elemType = t;
-        size = s;
-      }
-      
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TStruct.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TStruct.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TStruct.as
deleted file mode 100644
index dffad79..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TStruct.as
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-  
-  public class TStruct {
-    
-    public var name:String;
-    
-    public function TStruct(n:String = "") {
-      name = n;
-    }
-    
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TType.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TType.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TType.as
deleted file mode 100644
index 69af208..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TType.as
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.protocol {
-  
-  public class TType {
-    
-    public static const STOP:int   = 0;
-    public static const VOID:int   = 1;
-    public static const BOOL:int   = 2;
-    public static const BYTE:int   = 3;
-    public static const DOUBLE:int = 4;
-    public static const I16:int    = 6;
-    public static const I32:int    = 8;
-    public static const I64:int    = 10;
-    public static const STRING:int = 11;
-    public static const STRUCT:int = 12;
-    public static const MAP:int    = 13;
-    public static const SET:int    = 14;
-    public static const LIST:int   = 15;
-
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
deleted file mode 100644
index 863c59b..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.transport
-{
-
-    import flash.errors.EOFError;
-    import flash.events.Event;
-    import flash.events.IOErrorEvent;
-    import flash.events.ProgressEvent;
-    import flash.events.SecurityErrorEvent;
-    import flash.net.URLLoader;
-    import flash.net.URLLoaderDataFormat;
-    import flash.net.URLRequest;
-    import flash.net.URLRequestMethod;
-    import flash.utils.IDataInput;
-    import flash.utils.IDataOutput;
-    import flash.utils.ByteArray;
-    import flash.net.Socket;
-    import flash.events.EventDispatcher;
-
-
-    /**
-     * HTTP implementation of the TTransport interface. Used for working with a
-     * Thrift web services implementation.
-     * Unlike Http Client, it uses a single POST, and chunk-encoding to transfer all messages.
-     */
-
-    public class TFullDuplexHttpClient extends TTransport
-    {
-        private var socket:Socket = null;
-
-        private var host:String;
-
-        private var port:int;
-
-        private var resource:String;
-
-        private var stripped:Boolean = false;
-
-        private var obuffer:ByteArray = new ByteArray();
-
-        private var input:IDataInput;
-
-        private var output:IDataOutput;
-
-        private var bytesInChunk:int = 0;
-
-        private var CRLF:ByteArray = new ByteArray();
-
-        private var ioCallback:Function = null;
-
-        private var eventDispatcher:EventDispatcher = new EventDispatcher();
-
-        public function TFullDuplexHttpClient(host:String, port:int, resource:String):void
-        {
-            CRLF.writeByte(13);
-            CRLF.writeByte(10);
-            this.host = host;
-            this.port = port;
-            this.resource = resource;
-        }
-
-        public override function close():void
-        {
-            this.input = null;
-            this.output = null;
-            this.stripped = false;
-            socket.close()
-        }
-
-    	public override function peek():Boolean
-    	{
-			if(socket.connected)
-			{
-				trace("Bytes remained:" + socket.bytesAvailable);
-				return socket.bytesAvailable>0;
-			}
-			return false;
-		}
-
-        public override function read(buf:ByteArray, off:int, len:int):int
-        {
-            var n1:int = 0, n2:int = 0, n3:int = 0, n4:int = 0, cidx:int = 2;
-            var chunkSize:ByteArray = new ByteArray();
-
-            try
-            {
-                while (!stripped)
-                {
-                    n1 = n2;
-                    n2 = n3;
-                    n3 = n4;
-                    n4 = input.readByte();
-                    if ((n1 == 13) && (n2 == 10) && (n3 == 13) && (n4 == 10))
-                    {
-                        stripped = true;
-                    }
-                }
-
-                // read chunk size
-                if (bytesInChunk == 0)
-                {
-                    n1 = input.readByte();
-                    n2 = input.readByte();
-
-                    chunkSize.writeByte(n1);
-                    chunkSize.writeByte(n2);
-
-                    while (!((n1 == 13) && (n2 == 10)))
-                    {
-                        n1 = n2;
-                        n2 = input.readByte();
-                        chunkSize.writeByte(n2);
-                    }
-
-                    bytesInChunk = parseInt(chunkSize.toString(), 16);
-                }
-
-                input.readBytes(buf, off, len);
-                debugBuffer(buf);
-                bytesInChunk -= len;
-
-                if (bytesInChunk == 0)
-                {
-                    // advance the : "\r\n"
-                    input.readUTFBytes(2);
-                }
-                return len;
-            }
-            catch (e:EOFError)
-            {
-                trace(e);
-                throw new TTransportError(TTransportError.UNKNOWN, "No more data available.");
-            }
-            catch (e:Error)
-            {
-                trace(e);
-                // WTF??
-                throw new TTransportError(TTransportError.UNKNOWN, "Bad IO error:" + e);
-            }
-            return 0;
-        }
-
-        public function debugBuffer(buf:ByteArray):void
-        {
-            var debug:String = "BUFFER >>";
-            var i:int;
-            for (i = 0; i < buf.length; i++)
-            {
-                debug += buf[i] as int;
-                debug += " ";
-            }
-
-            trace(debug + "<<");
-        }
-
-        public override function write(buf:ByteArray, off:int, len:int):void
-        {
-            obuffer.writeBytes(buf, off, len);
-        }
-
-        public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
-        {
-            this.eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
-        }
-
-        public override function open():void
-        {
-            this.socket = new Socket();
-            this.socket.addEventListener(Event.CONNECT, socketConnected);
-            this.socket.addEventListener(IOErrorEvent.IO_ERROR, socketError);
-            this.socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, socketSecurityError);
-            this.socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
-            this.socket.connect(host, port);
-        }
-
-        public function socketConnected(event:Event):void
-        {
-            this.output = this.socket;
-            this.input = this.socket;
-            this.output.writeUTF("CONNECT " + resource + " HTTP/1.1\n" + "Host: " + host + ":" + port + "\r\n" + "User-Agent: Thrift/AS3\r\n" + "Transfer-Encoding: chunked\r\n" + "content-type: application/x-thrift\r\n" + "Accept: */*\r\n\r\n");
-            this.eventDispatcher.dispatchEvent(event);
-        }
-
-        public function socketError(event:IOErrorEvent):void
-        {
-            trace("Error Connecting:" + event);
-            this.close();
-            if (ioCallback == null)
-            {
-                return;
-            }
-            ioCallback(new TTransportError(TTransportError.UNKNOWN, "IOError: " + event.text));
-            this.eventDispatcher.dispatchEvent(event);
-        }
-
-        public function socketSecurityError(event:SecurityErrorEvent):void
-        {
-            trace("Security Error Connecting:" + event);
-            this.close();
-            this.eventDispatcher.dispatchEvent(event);
-        }
-
-        public function socketDataHandler(event:ProgressEvent):void
-        {
-        	trace("Got Data call:" +ioCallback);
-            if (ioCallback != null)
-            {
-                ioCallback(null);
-            };
-            this.eventDispatcher.dispatchEvent(event);
-        }
-
-        public override function flush(callback:Function = null):void
-        {
-            trace("set callback:" + callback);
-            this.ioCallback = callback;
-            this.output.writeUTF(this.obuffer.length.toString(16));
-            this.output.writeBytes(CRLF);
-            this.output.writeBytes(this.obuffer);
-            this.output.writeBytes(CRLF);
-            this.socket.flush();
-            // waiting for  new Flex sdk 3.5
-            //this.obuffer.clear();
-            this.obuffer = new ByteArray();
-        }
-
-        public override function isOpen():Boolean
-        {
-            return (this.socket == null ? false : this.socket.connected);
-        }
-
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/THttpClient.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/THttpClient.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/THttpClient.as
deleted file mode 100644
index 435f911..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/THttpClient.as
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.transport {
-
-  import flash.errors.EOFError;
-  import flash.events.Event;
-  import flash.events.IOErrorEvent;
-  import flash.events.SecurityErrorEvent;
-  import flash.net.URLLoader;
-  import flash.net.URLLoaderDataFormat;
-  import flash.net.URLRequest;
-  import flash.net.URLRequestMethod;
-  import flash.system.Capabilities;
-  import flash.utils.ByteArray;
-  
-  /**
-   * HTTP implementation of the TTransport interface. Used for working with a
-   * Thrift web services implementation.
-   */
-  public class THttpClient extends TTransport {
-
-    private var request_:URLRequest = null;
-    private var requestBuffer_:ByteArray = new ByteArray();
-    private var responseBuffer_:ByteArray = null;
-    private var traceBuffers_:Boolean = Capabilities.isDebugger;
-
-    
-    public function getBuffer():ByteArray {
-      return requestBuffer_;
-    }
-    
-    public function THttpClient(request:URLRequest, traceBuffers:Boolean=true):void {
-      request.contentType = "application/x-thrift";
-      request_ = request;
-      if(traceBuffers == false) {
-        traceBuffers_ = traceBuffers;
-      }
-    }
-    
-    public override function open():void {
-    }
-
-    public override function close():void {
-    }
- 
-    public override function isOpen():Boolean {
-      return true;
-    }
-    
-    public override function read(buf:ByteArray, off:int, len:int):int {
-      if (responseBuffer_ == null) {
-        throw new TTransportError(TTransportError.UNKNOWN, "Response buffer is empty, no request.");
-      }
-        try {
-            responseBuffer_.readBytes(buf, off, len);
-            if (traceBuffers_) {
-              dumpBuffer(buf, "READ");
-            }
-            return len;
-          }
-          catch (e:EOFError) {
-            if (traceBuffers_) {
-              dumpBuffer(requestBuffer_, "FAILED-RESPONSE-REQUEST");
-              dumpBuffer(responseBuffer_, "FAILED-RESPONSE");
-            }
-            throw new TTransportError(TTransportError.UNKNOWN, "No more data available.");
-        }
-        return 0;
-    }
-
-    public override function write(buf:ByteArray, off:int, len:int):void {
-      requestBuffer_.writeBytes(buf, off, len);
-    }
-
-    public override function flush(callback:Function=null):void {
-      var loader:URLLoader = new URLLoader();
-      if (callback != null) {
-        loader.addEventListener(Event.COMPLETE, function(event:Event):void {
-         responseBuffer_ = URLLoader(event.target).data;
-         if (traceBuffers_) {
-           dumpBuffer(responseBuffer_, "RESPONSE_BUFFER");
-         }
-         callback(null);
-         responseBuffer_ = null;
-        });
-        loader.addEventListener(IOErrorEvent.IO_ERROR, function(event:IOErrorEvent):void {
-          callback(new TTransportError(TTransportError.UNKNOWN, "IOError: " + event.text));
-          responseBuffer_ = null;
-        });
-        loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, function(event:SecurityErrorEvent):void {
-          callback(new TTransportError(TTransportError.UNKNOWN, "SecurityError: " + event.text));
-          responseBuffer_ = null;
-        });
-      }
-      request_.method = URLRequestMethod.POST;
-      loader.dataFormat = URLLoaderDataFormat.BINARY;
-      requestBuffer_.position = 0;
-      request_.data = requestBuffer_;
-      loader.load(request_);
-    }
-
-    private function dumpBuffer(buf:ByteArray, prefix:String):String {
-      var debugString : String = prefix + " BUFFER ";
-      if (buf != null) {
-        debugString += "length: " + buf.length + ", ";
-        for (var i : int = 0; i < buf.length; i++) {
-          debugString += "[" + buf[i].toString(16) + "]";
-        }
-      } else {
-        debugString = "null";
-      }
-      trace(debugString);
-      return debugString;
-    }
-
-  }
-}


[06/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.m
deleted file mode 100644
index d8c55d6..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketClient.m
+++ /dev/null
@@ -1,261 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#import <Foundation/Foundation.h>
-#import <CoreFoundation/CoreFoundation.h>
-#import "TSSLSocketClient.h"
-#import "TSSLSocketException.h"
-#import "TObjective-C.h"
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-
-#if !TARGET_OS_IPHONE
-#import <CoreServices/CoreServices.h>
-#else
-#import <CFNetwork/CFNetwork.h>
-#endif
-
-@implementation TSSLSocketClient
-
-- (id) initWithHostname: (NSString *) hostname
-                   port: (int) port
-{
-    sslHostname = hostname;
-	CFReadStreamRef readStream = NULL;
-	CFWriteStreamRef writeStream = NULL;
-    
-    
-    /* create a socket structure */
-    struct sockaddr_in pin;
-    struct hostent *hp = NULL;
-    for(int i = 0; i < 10; i++) {
-        
-
-        
-        if ((hp = gethostbyname([hostname UTF8String])) == NULL) { 
-            NSLog(@"failed to resolve hostname %@", hostname);
-            herror("resolv");
-            if(i == 9) {
-                @throw [TSSLSocketException exceptionWithReason: @"failed to resolve hostname"];
-            }
-            [NSThread sleepForTimeInterval:0.2];
-        } else {
-            break;
-        }
-    }
-
-    memset (&pin, 0, sizeof(pin));
-    pin.sin_family = AF_INET;
-    memcpy(&pin.sin_addr, hp->h_addr, sizeof(struct in_addr));
-    pin.sin_port = htons (port);
-    
-    /* create the socket */
-    if ((sd = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) == -1)
-    {
-        NSLog(@"failed to create socket for host %@:%d", hostname, port);
-        @throw [TSSLSocketException exceptionWithReason: @"failed to create socket"];
-    }
-    
-    /* open a connection */
-    if (connect (sd, (struct sockaddr *) &pin, sizeof(pin)) == -1)
-    {
-        NSLog(@"failed to create conenct to host %@:%d", hostname, port);
-        @throw [TSSLSocketException exceptionWithReason: @"failed to connect"];
-    }
-    CFStreamCreatePairWithSocket(kCFAllocatorDefault, sd, &readStream, &writeStream);
-    
-    CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-    CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-    
-	if (readStream && writeStream) {
-        CFReadStreamSetProperty(readStream,
-                                kCFStreamPropertySocketSecurityLevel,
-                                kCFStreamSocketSecurityLevelTLSv1);
-        
-        NSDictionary *settings =
-        [NSDictionary dictionaryWithObjectsAndKeys:
-         (id)kCFBooleanTrue, (id)kCFStreamSSLValidatesCertificateChain,
-         nil];
-        
-        CFReadStreamSetProperty((CFReadStreamRef)readStream,
-                                kCFStreamPropertySSLSettings,
-                                (CFTypeRef)settings);
-        CFWriteStreamSetProperty((CFWriteStreamRef)writeStream,
-                                 kCFStreamPropertySSLSettings,
-                                 (CFTypeRef)settings);
-        
-		inputStream = (bridge_stub NSInputStream *)readStream;
-		[inputStream retain_stub];
-		[inputStream setDelegate:self];
-   		[inputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
-		[inputStream open];
-		
-		outputStream = (bridge_stub NSOutputStream *)writeStream;
-		[outputStream retain_stub];
-		[outputStream setDelegate:self];
-        [outputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
-		[outputStream open];
-        
-        
-        CFRelease(readStream);
-        CFRelease(writeStream);
-	}
-    
-    
-	
-	self = [super initWithInputStream: inputStream outputStream: outputStream];
-    
-	return self;
-}
-
-#pragma mark -
-#pragma mark NSStreamDelegate
-- (void)stream:(NSStream *)aStream
-    handleEvent:(NSStreamEvent)eventCode {
-    switch (eventCode) {
-        case NSStreamEventNone:
-            break;
-        case NSStreamEventHasBytesAvailable:
-            break;
-        case NSStreamEventOpenCompleted:
-            break;
-        case NSStreamEventHasSpaceAvailable:
-        {
-            SecPolicyRef policy = SecPolicyCreateSSL(NO, (__bridge CFStringRef)(sslHostname));
-            SecTrustRef trust = NULL;
-            CFArrayRef streamCertificatesRef =
-            CFBridgingRetain((__bridge id)((__bridge CFArrayRef)([aStream propertyForKey:(NSString *) kCFStreamPropertySSLPeerCertificates])));
-            SecTrustCreateWithCertificates(CFBridgingRetain((__bridge id)(streamCertificatesRef)),
-                                           policy,
-                                           &trust);
-            
-            SecTrustResultType trustResultType = kSecTrustResultInvalid;
-            SecTrustEvaluate(trust, &trustResultType);
-            
-            BOOL proceed = NO;
-            switch (trustResultType) {
-                case kSecTrustResultProceed:
-                    proceed = YES;
-                    break;
-                case kSecTrustResultUnspecified:
-                    NSLog(@"Trusted by OS");
-                    proceed = YES;
-                    break;
-                case kSecTrustResultRecoverableTrustFailure:
-                    proceed = recoverFromTrustFailure(trust);
-                    break;
-                case kSecTrustResultDeny:
-                    NSLog(@"Deny");
-                    break;
-                case kSecTrustResultFatalTrustFailure:
-                    NSLog(@"FatalTrustFailure");
-                    break;
-                case kSecTrustResultOtherError:
-                    NSLog(@"OtherError");
-                    break;
-                case kSecTrustResultInvalid:
-                    NSLog(@"Invalid");
-                    break;
-                default:
-                    NSLog(@"Default");
-                    break;
-            }
-            
-            if (trust) {
-                CFRelease(trust);
-            }
-            if (policy) {
-                CFRelease(policy);
-            }
-            if (!proceed) {
-                NSLog(@"Cannot trust certificate. TrustResultType: %u", trustResultType);
-                [aStream close];
-                @throw [TSSLSocketException exceptionWithReason: @"Cannot trust certificate"];
-            }
-        }
-            break;
-        case NSStreamEventErrorOccurred:
-        {
-            NSError *theError = [aStream streamError];
-            NSLog(@"Error occurred opening stream: %@", theError);
-//            @throw [TSSLSocketException exceptionWithReason: @"Error occurred opening stream" error: theError];
-            break;
-        }
-        case NSStreamEventEndEncountered:
-            break;
-    }
-}
-
-bool recoverFromTrustFailure(SecTrustRef myTrust)
-{
-    
-    SecTrustResultType trustResult;
-    OSStatus status = SecTrustEvaluate(myTrust, &trustResult);
-    
-    CFAbsoluteTime trustTime,currentTime,timeIncrement,newTime;
-    CFDateRef newDate;
-    if (trustResult == kSecTrustResultRecoverableTrustFailure) {
-        trustTime = SecTrustGetVerifyTime(myTrust);
-        timeIncrement = 31536000;
-        currentTime = CFAbsoluteTimeGetCurrent();
-        newTime = currentTime - timeIncrement;
-        if (trustTime - newTime){
-            newDate = CFDateCreate(NULL, newTime);
-            SecTrustSetVerifyDate(myTrust, newDate);
-            status = SecTrustEvaluate(myTrust, &trustResult);
-        }
-    }
-    if (trustResult != kSecTrustResultProceed) {
-        NSLog(@"Certificate trust failure");
-        return false;
-    }
-    return true;
-}
-
-- (void)close
-{
-    if(self.mInput) {
-        //Close and reset inputstream
-        CFReadStreamSetProperty((__bridge CFReadStreamRef)(self.mInput), kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        [self.mInput setDelegate:nil];
-        [self.mInput close];
-        [self.mInput removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        self.mInput = nil;
-    }
-    
-    if(self.mOutput) {
-        //Close and reset outputstream
-        CFReadStreamSetProperty((__bridge CFReadStreamRef)(self.mOutput), kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-        [self.mOutput setDelegate:nil];
-        [self.mOutput close];
-        [self.mOutput removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-        self.mOutput = nil;
-    }
-}
-
-- (BOOL) isOpen
-{
-    if(sd > 0)
-        return TRUE;
-    else
-        return FALSE;
-}
-
-@end
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.h
deleted file mode 100644
index c290b05..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.h
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TTransportException.h"
-
-@interface TSSLSocketException : TTransportException
-
-+ (id) exceptionWithReason: (NSString *) reason
-                     error: (NSError *) error;
-
-+ (id) exceptionWithReason: (NSString *) reason;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.m
deleted file mode 100644
index 99eadf5..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSSLSocketException.m
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TSSLSocketException.h"
-
-@implementation TSSLSocketException
-
-+ (id) exceptionWithReason: (NSString *) reason
-                     error: (NSError *) error
-{
-    NSDictionary * userInfo = nil;
-    if (error != nil) {
-        userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"];
-    }
-    
-    return [super exceptionWithName: @"TSSLSocketException"
-                             reason: reason
-                           userInfo: userInfo];
-}
-
-+ (id) exceptionWithReason: (NSString *) reason
-{
-    return [self exceptionWithReason: reason error: nil];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.h
deleted file mode 100644
index 81a0247..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import <Foundation/Foundation.h>
-#import "TNSStreamTransport.h"
-
-@interface TSocketClient : TNSStreamTransport 
-#if TARGET_OS_IPHONE || (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6)
-<NSStreamDelegate>
-#endif
-{
-}
-
-- (id) initWithHostname: (NSString *) hostname
-                   port: (UInt32) port;
-
-@end
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.m
deleted file mode 100644
index b0bac74..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TSocketClient.m
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#import "TSocketClient.h"
-#import "TObjective-C.h"
-
-#if !TARGET_OS_IPHONE
-#import <CoreServices/CoreServices.h>
-#else
-#import <CFNetwork/CFNetwork.h>
-#endif
-
-@interface TSocketClient ()
-{
-    NSInputStream * inputStream;
-	NSOutputStream * outputStream;
-}
-@end
-
-@implementation TSocketClient
-
-- (id) initWithHostname: (NSString *) hostname
-                   port: (UInt32) port
-{
-	inputStream = NULL;
-	outputStream = NULL;
-	CFReadStreamRef readStream = NULL;
-	CFWriteStreamRef writeStream = NULL;
-	CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault, (bridge_stub CFStringRef)hostname, port, &readStream, &writeStream);
-	if (readStream && writeStream) {
-		CFReadStreamSetProperty(readStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-		CFWriteStreamSetProperty(writeStream, kCFStreamPropertyShouldCloseNativeSocket, kCFBooleanTrue);
-		
-		inputStream = (bridge_stub NSInputStream *)readStream;
-		[inputStream retain_stub];
-		[inputStream setDelegate:self];
-		[inputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-		[inputStream open];
-		
-		outputStream = (bridge_stub NSOutputStream *)writeStream;
-		[outputStream retain_stub];
-		[outputStream setDelegate:self];
-		[outputStream scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-		[outputStream open];
-        CFRelease(readStream);
-        CFRelease(writeStream);
-	}
-	
-	self = [super initWithInputStream: inputStream outputStream: outputStream];
-	
-	return self;
-}
-
--(void)dealloc
-{
-    [inputStream close];
-    [inputStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-    [inputStream setDelegate:nil];
-    [inputStream release_stub];
-    
-    [outputStream close];
-    [outputStream removeFromRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
-    [outputStream setDelegate:nil];
-    [outputStream release_stub];
-    [super dealloc_stub];
-}
-
-
-@end
-
-
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransport.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransport.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransport.h
deleted file mode 100644
index 83aad9e..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransport.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-@protocol TTransport <NSObject>
-
-  /**
-   * Guarantees that all of len bytes are read
-   *
-   * @param buf Buffer to read into
-   * @param offset Index in buffer to start storing bytes at
-   * @param length Maximum number of bytes to read
-   * @return The number of bytes actually read, which must be equal to len
-   * @throws TTransportException if there was an error reading data
-   */
-- (size_t) readAll: (uint8_t *) buf offset: (size_t) offset length: (size_t) length;
-
-- (void) write: (const uint8_t *) data offset: (size_t) offset length: (size_t) length;
-
-- (void) flush;
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.h b/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.h
deleted file mode 100644
index 6749fe2..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TException.h"
-
-@interface TTransportException : TException {
-}
-
-+ (id) exceptionWithReason: (NSString *) reason
-                     error: (NSError *) error;
-
-+ (id) exceptionWithReason: (NSString *) reason;
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.m
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.m b/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.m
deleted file mode 100644
index 43cdfbd..0000000
--- a/depends/thirdparty/thrift/lib/cocoa/src/transport/TTransportException.m
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#import "TTransportException.h"
-#import "TObjective-C.h"
-
-@implementation TTransportException
-
-+ (id) exceptionWithReason: (NSString *) reason
-                     error: (NSError *) error
-{
-  NSDictionary * userInfo = nil;
-  if (error != nil) {
-    userInfo = [NSDictionary dictionaryWithObject: error forKey: @"error"];
-  }
-
-  return [super exceptionWithName: @"TTransportException"
-                           reason: reason
-                         userInfo: userInfo];
-}
-
-
-+ (id) exceptionWithReason: (NSString *) reason
-{
-  return [self exceptionWithReason: reason error: nil];
-}
-
-@end

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/3rdparty.props
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/3rdparty.props b/depends/thirdparty/thrift/lib/cpp/3rdparty.props
deleted file mode 100644
index 528d40a..0000000
--- a/depends/thirdparty/thrift/lib/cpp/3rdparty.props
+++ /dev/null
@@ -1,25 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ImportGroup Label="PropertySheets" />
-  <PropertyGroup Label="UserMacros">
-    <BOOST_ROOT>$(THIRD_PARTY)\boost\boost_1_47_0</BOOST_ROOT>
-    <OPENSSL_ROOT_DIR>$(THIRD_PARTY)\openssl\OpenSSL-Win32</OPENSSL_ROOT_DIR>
-    <LIBEVENT_ROOT>$(THIRD_PARTY)\libevent-2.0.21-stable</LIBEVENT_ROOT>
-  </PropertyGroup>
-  <PropertyGroup />
-  <ItemDefinitionGroup />
-  <ItemGroup>
-    <BuildMacro Include="BOOST_ROOT">
-      <Value>$(BOOST_ROOT)</Value>
-      <EnvironmentVariable>true</EnvironmentVariable>
-    </BuildMacro>
-    <BuildMacro Include="OPENSSL_ROOT_DIR">
-      <Value>$(OPENSSL_ROOT_DIR)</Value>
-      <EnvironmentVariable>true</EnvironmentVariable>
-    </BuildMacro>
-    <BuildMacro Include="LIBEVENT_ROOT">
-      <Value>$(LIBEVENT_ROOT)</Value>
-      <EnvironmentVariable>true</EnvironmentVariable>
-    </BuildMacro>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/CMakeLists.txt b/depends/thirdparty/thrift/lib/cpp/CMakeLists.txt
deleted file mode 100755
index 4c7caeb..0000000
--- a/depends/thirdparty/thrift/lib/cpp/CMakeLists.txt
+++ /dev/null
@@ -1,209 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Find required packages
-if(WITH_BOOSTTHREADS)
-  find_package(Boost 1.53.0 REQUIRED COMPONENTS system thread)
-else()
-  find_package(Boost 1.53.0 REQUIRED)
-endif()
-
-include_directories(SYSTEM "${Boost_INCLUDE_DIRS}")
-include_directories(src)
-
-# SYSLIBS contains libraries that need to be linked to all lib targets
-set(SYSLIBS "")
-
-# Create the thrift C++ library
-set( thriftcpp_SOURCES
-   src/thrift/TApplicationException.cpp
-   src/thrift/TOutput.cpp
-   src/thrift/async/TAsyncChannel.cpp
-   src/thrift/async/TConcurrentClientSyncInfo.h
-   src/thrift/async/TConcurrentClientSyncInfo.cpp
-   src/thrift/concurrency/ThreadManager.cpp
-   src/thrift/concurrency/TimerManager.cpp
-   src/thrift/concurrency/Util.cpp
-   src/thrift/processor/PeekProcessor.cpp
-   src/thrift/protocol/TBase64Utils.cpp
-   src/thrift/protocol/TDebugProtocol.cpp
-   src/thrift/protocol/TJSONProtocol.cpp
-   src/thrift/protocol/TMultiplexedProtocol.cpp
-   src/thrift/protocol/TProtocol.cpp
-   src/thrift/transport/TTransportException.cpp
-   src/thrift/transport/TFDTransport.cpp
-   src/thrift/transport/TSimpleFileTransport.cpp
-   src/thrift/transport/THttpTransport.cpp
-   src/thrift/transport/THttpClient.cpp
-   src/thrift/transport/THttpServer.cpp
-   src/thrift/transport/TSocket.cpp
-   src/thrift/transport/TSocketPool.cpp
-   src/thrift/transport/TServerSocket.cpp
-   src/thrift/transport/TTransportUtils.cpp
-   src/thrift/transport/TBufferTransports.cpp
-   src/thrift/server/TConnectedClient.cpp
-   src/thrift/server/TServerFramework.cpp
-   src/thrift/server/TSimpleServer.cpp
-   src/thrift/server/TThreadPoolServer.cpp
-   src/thrift/server/TThreadedServer.cpp
-)
-
-# This files don't work on Windows CE as there is no pipe support
-# TODO: These files won't work with UNICODE support on windows. If fixed this can be re-added.
-if (NOT WINCE)
-    list(APPEND thriftcpp_SOURCES
-       src/thrift/transport/TPipe.cpp
-       src/thrift/transport/TPipeServer.cpp
-       src/thrift/transport/TFileTransport.cpp
-    )
-endif()
-
-
-if (WIN32)
-    list(APPEND thriftcpp_SOURCES
-        src/thrift/windows/TWinsockSingleton.cpp
-        src/thrift/windows/SocketPair.cpp
-        src/thrift/windows/GetTimeOfDay.cpp
-        src/thrift/windows/WinFcntl.cpp
-    )
-    if(NOT WINCE)
-        # This file uses pipes so it currently won't work on Windows CE
-        list(APPEND thriftcpp_SOURCES
-            src/thrift/windows/OverlappedSubmissionThread.cpp
-        )
-    endif()
-else()
-    # These files evaluate to nothing on Windows, so omit them from the
-    # Windows build
-    list(APPEND thriftcpp_SOURCES
-        src/thrift/VirtualProfiling.cpp
-        src/thrift/server/TServer.cpp
-    )
-endif()
-
-# If OpenSSL is not found just ignore the OpenSSL stuff
-find_package(OpenSSL)
-if(OPENSSL_FOUND AND WITH_OPENSSL)
-    list( APPEND thriftcpp_SOURCES
-       src/thrift/transport/TSSLSocket.cpp
-       src/thrift/transport/TSSLServerSocket.cpp
-    )
-    include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}")
-    list(APPEND SYSLIBS "${OPENSSL_LIBRARIES}")
-endif()
-
-# WITH_*THREADS selects which threading library to use
-if(WITH_BOOSTTHREADS)
-    set( thriftcpp_threads_SOURCES
-        src/thrift/concurrency/BoostThreadFactory.cpp
-        src/thrift/concurrency/BoostMonitor.cpp
-        src/thrift/concurrency/BoostMutex.cpp
-    )
-    list(APPEND SYSLIBS "${Boost_LIBRARIES}")
-elseif(UNIX AND NOT WITH_STDTHREADS)
-    list(APPEND SYSLIBS pthread)
-    set( thriftcpp_threads_SOURCES
-        src/thrift/concurrency/PosixThreadFactory.cpp
-        src/thrift/concurrency/Mutex.cpp
-        src/thrift/concurrency/Monitor.cpp
-    )
-else()
-    if(UNIX)
-        # need pthread for multi-thread support
-        list(APPEND SYSLIBS pthread)
-    endif()
-    set( thriftcpp_threads_SOURCES
-        src/thrift/concurrency/StdThreadFactory.cpp
-        src/thrift/concurrency/StdMutex.cpp
-        src/thrift/concurrency/StdMonitor.cpp
-    )
-endif()
-
-# Thrift non blocking server
-set( thriftcppnb_SOURCES
-    src/thrift/server/TNonblockingServer.cpp
-    src/thrift/async/TAsyncProtocolProcessor.cpp
-    src/thrift/async/TEvhttpServer.cpp
-    src/thrift/async/TEvhttpClientChannel.cpp
-)
-
-# Thrift zlib server
-set( thriftcppz_SOURCES
-    src/thrift/transport/TZlibTransport.cpp
-)
-
-# Thrift Qt4 server
-set( thriftcppqt_SOURCES
-    src/thrift/qt/TQIODeviceTransport.cpp
-    src/thrift/qt/TQTcpServer.cpp
-)
-
-# Contains the thrift specific ADD_LIBRARY_THRIFT and TARGET_LINK_LIBRARIES_THRIFT
-include(ThriftMacros)
-
-ADD_LIBRARY_THRIFT(thrift ${thriftcpp_SOURCES} ${thriftcpp_threads_SOURCES})
-TARGET_LINK_LIBRARIES_THRIFT(thrift ${SYSLIBS})
-
-if(WITH_LIBEVENT)
-    find_package(Libevent REQUIRED)  # Libevent comes with CMake support form upstream
-    include_directories(SYSTEM ${LIBEVENT_INCLUDE_DIRS})
-
-    ADD_LIBRARY_THRIFT(thriftnb ${thriftcppnb_SOURCES})
-    TARGET_LINK_LIBRARIES_THRIFT(thriftnb ${SYSLIBS} ${LIBEVENT_LIBRARIES})
-    TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftnb thrift)
-endif()
-
-if(WITH_ZLIB)
-    find_package(ZLIB REQUIRED)
-    include_directories(SYSTEM ${ZLIB_INCLUDE_DIRS})
-
-    ADD_LIBRARY_THRIFT(thriftz ${thriftcppz_SOURCES})
-    TARGET_LINK_LIBRARIES_THRIFT(thriftz ${SYSLIBS} ${ZLIB_LIBRARIES})
-    TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftz thrift)
-endif()
-
-if(WITH_QT4)
-    set(CMAKE_AUTOMOC ON)
-    find_package(Qt4 REQUIRED COMPONENTS QtCore QtNetwork)
-    ADD_LIBRARY_THRIFT(thriftqt ${thriftcppqt_SOURCES})
-    TARGET_LINK_LIBRARIES_THRIFT(thriftqt ${SYSLIBS} Qt4::QtCore Qt4::QtNetwork)
-    TARGET_LINK_LIBRARIES_THRIFT_AGAINST_THRIFT_LIBRARY(thriftqt thrift)
-endif()
-
-if(WITH_QT5)
-    # Qt5 has its own directory to avoid conflict with Qt4 caused by CMAKE_AUTOMOC
-    add_subdirectory(src/thrift/qt)
-endif()
-
-if(MSVC)
-    add_definitions("-DUNICODE -D_UNICODE")
-endif()
-
-add_definitions("-D__STDC_LIMIT_MACROS")
-
-# Install the headers
-install(DIRECTORY "src/thrift" DESTINATION "${INCLUDE_INSTALL_DIR}"
-    FILES_MATCHING PATTERN "*.h" PATTERN "*.tcc")
-# Copy config.h file
-install(DIRECTORY "${CMAKE_BINARY_DIR}/thrift" DESTINATION "${INCLUDE_INSTALL_DIR}"
-    FILES_MATCHING PATTERN "*.h")
-
-if(BUILD_TESTING)
-    add_subdirectory(test)
-endif()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/Makefile.am b/depends/thirdparty/thrift/lib/cpp/Makefile.am
deleted file mode 100755
index 4742ee0..0000000
--- a/depends/thirdparty/thrift/lib/cpp/Makefile.am
+++ /dev/null
@@ -1,276 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-AUTOMAKE_OPTIONS = subdir-objects
-
-moc_%.cpp: %.h
-	$(QT_MOC) $(QT_CFLAGS) $< -o $@
-
-moc__%.cpp: %.h
-	$(QT5_MOC) $(QT5_CFLAGS) $< -o $@
-
-SUBDIRS = .
-
-if WITH_TESTS
-SUBDIRS += test
-endif
-
-pkgconfigdir = $(libdir)/pkgconfig
-
-lib_LTLIBRARIES = libthrift.la
-pkgconfig_DATA = thrift.pc
-libthrift_la_LDFLAGS = -release $(VERSION) $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS)
-
-## We only build the extra libraries if we have the dependencies,
-## but we install all of the headers unconditionally.
-if AMX_HAVE_LIBEVENT
-lib_LTLIBRARIES += libthriftnb.la
-pkgconfig_DATA += thrift-nb.pc
-endif
-if AMX_HAVE_ZLIB
-lib_LTLIBRARIES += libthriftz.la
-pkgconfig_DATA += thrift-z.pc
-endif
-if AMX_HAVE_QT
-lib_LTLIBRARIES += libthriftqt.la
-pkgconfig_DATA += thrift-qt.pc
-endif
-if AMX_HAVE_QT5
-lib_LTLIBRARIES += libthriftqt5.la
-pkgconfig_DATA += thrift-qt5.pc
-endif
-
-AM_CXXFLAGS = -Wall -Wextra -pedantic
-AM_CPPFLAGS = $(BOOST_CPPFLAGS) $(OPENSSL_INCLUDES) -I$(srcdir)/src -D__STDC_LIMIT_MACROS
-AM_LDFLAGS = $(BOOST_LDFLAGS) $(OPENSSL_LDFLAGS)
-
-# Define the source files for the module
-
-libthrift_la_SOURCES = src/thrift/TApplicationException.cpp \
-                       src/thrift/TOutput.cpp \
-                       src/thrift/VirtualProfiling.cpp \
-                       src/thrift/async/TAsyncChannel.cpp \
-                       src/thrift/async/TConcurrentClientSyncInfo.cpp \
-                       src/thrift/concurrency/ThreadManager.cpp \
-                       src/thrift/concurrency/TimerManager.cpp \
-                       src/thrift/concurrency/Util.cpp \
-                       src/thrift/processor/PeekProcessor.cpp \
-                       src/thrift/protocol/TDebugProtocol.cpp \
-                       src/thrift/protocol/TJSONProtocol.cpp \
-                       src/thrift/protocol/TBase64Utils.cpp \
-                       src/thrift/protocol/TMultiplexedProtocol.cpp \
-                       src/thrift/protocol/TProtocol.cpp \
-                       src/thrift/transport/TTransportException.cpp \
-                       src/thrift/transport/TFDTransport.cpp \
-                       src/thrift/transport/TFileTransport.cpp \
-                       src/thrift/transport/TSimpleFileTransport.cpp \
-                       src/thrift/transport/THttpTransport.cpp \
-                       src/thrift/transport/THttpClient.cpp \
-                       src/thrift/transport/THttpServer.cpp \
-                       src/thrift/transport/TSocket.cpp \
-                       src/thrift/transport/TPipe.cpp \
-                       src/thrift/transport/TPipeServer.cpp \
-                       src/thrift/transport/TSSLSocket.cpp \
-                       src/thrift/transport/TSocketPool.cpp \
-                       src/thrift/transport/TServerSocket.cpp \
-                       src/thrift/transport/TSSLServerSocket.cpp \
-                       src/thrift/transport/TTransportUtils.cpp \
-                       src/thrift/transport/TBufferTransports.cpp \
-                       src/thrift/server/TConnectedClient.cpp \
-                       src/thrift/server/TServer.cpp \
-                       src/thrift/server/TServerFramework.cpp \
-                       src/thrift/server/TSimpleServer.cpp \
-                       src/thrift/server/TThreadPoolServer.cpp \
-                       src/thrift/server/TThreadedServer.cpp
-
-if WITH_BOOSTTHREADS
-libthrift_la_SOURCES += src/thrift/concurrency/BoostThreadFactory.cpp \
-                        src/thrift/concurrency/BoostMonitor.cpp \
-                        src/thrift/concurrency/BoostMutex.cpp
-else
-libthrift_la_SOURCES += src/thrift/concurrency/Mutex.cpp \
-                        src/thrift/concurrency/Monitor.cpp \
-                        src/thrift/concurrency/PosixThreadFactory.cpp
-endif
-
-libthriftnb_la_SOURCES = src/thrift/server/TNonblockingServer.cpp \
-                         src/thrift/async/TAsyncProtocolProcessor.cpp \
-                         src/thrift/async/TEvhttpServer.cpp \
-                         src/thrift/async/TEvhttpClientChannel.cpp
-
-libthriftz_la_SOURCES = src/thrift/transport/TZlibTransport.cpp
-
-libthriftqt_la_MOC = src/thrift/qt/moc_TQTcpServer.cpp
-nodist_libthriftqt_la_SOURCES = $(libthriftqt_la_MOC)
-libthriftqt_la_SOURCES = src/thrift/qt/TQIODeviceTransport.cpp \
-                         src/thrift/qt/TQTcpServer.cpp
-CLEANFILES = $(libthriftqt_la_MOC)
-
-libthriftqt5_la_MOC = src/thrift/qt/moc__TQTcpServer.cpp
-nodist_libthriftqt5_la_SOURCES = $(libthriftqt5_la_MOC)
-libthriftqt5_la_SOURCES = src/thrift/qt/TQIODeviceTransport.cpp \
-                          src/thrift/qt/TQTcpServer.cpp
-CLEANFILES += $(libthriftqt5_la_MOC)
-
-# Flags for the various libraries
-libthriftnb_la_CPPFLAGS = $(AM_CPPFLAGS) $(LIBEVENT_CPPFLAGS)
-libthriftz_la_CPPFLAGS  = $(AM_CPPFLAGS) $(ZLIB_CPPFLAGS)
-libthriftqt_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT_CFLAGS)
-libthriftqt5_la_CPPFLAGS = $(AM_CPPFLAGS) $(QT5_CFLAGS)
-if QT5_REDUCE_RELOCATIONS
-libthriftqt5_la_CPPFLAGS += -fPIC
-endif
-libthriftnb_la_CXXFLAGS = $(AM_CXXFLAGS)
-libthriftz_la_CXXFLAGS  = $(AM_CXXFLAGS)
-libthriftqt_la_CXXFLAGS  = $(AM_CXXFLAGS)
-libthriftqt5_la_CXXFLAGS  = $(AM_CXXFLAGS)
-libthriftnb_la_LDFLAGS  = -release $(VERSION) $(BOOST_LDFLAGS)
-libthriftz_la_LDFLAGS   = -release $(VERSION) $(BOOST_LDFLAGS)
-libthriftqt_la_LDFLAGS   = -release $(VERSION) $(BOOST_LDFLAGS) $(QT_LIBS)
-libthriftqt5_la_LDFLAGS   = -release $(VERSION) $(BOOST_LDFLAGS) $(QT5_LIBS)
-
-include_thriftdir = $(includedir)/thrift
-include_thrift_HEADERS = \
-                         $(top_builddir)/config.h \
-                         src/thrift/thrift-config.h \
-                         src/thrift/TDispatchProcessor.h \
-                         src/thrift/Thrift.h \
-                         src/thrift/TOutput.h \
-                         src/thrift/TProcessor.h \
-                         src/thrift/TApplicationException.h \
-                         src/thrift/TLogging.h \
-                         src/thrift/cxxfunctional.h \
-                         src/thrift/TToString.h
-
-include_concurrencydir = $(include_thriftdir)/concurrency
-include_concurrency_HEADERS = \
-                         src/thrift/concurrency/BoostThreadFactory.h \
-                         src/thrift/concurrency/Exception.h \
-                         src/thrift/concurrency/Mutex.h \
-                         src/thrift/concurrency/Monitor.h \
-                         src/thrift/concurrency/PlatformThreadFactory.h \
-                         src/thrift/concurrency/PosixThreadFactory.h \
-                         src/thrift/concurrency/StdMonitor.cpp \
-                         src/thrift/concurrency/StdMutex.cpp \
-                         src/thrift/concurrency/StdThreadFactory.cpp \
-                         src/thrift/concurrency/StdThreadFactory.h \
-                         src/thrift/concurrency/Thread.h \
-                         src/thrift/concurrency/ThreadManager.h \
-                         src/thrift/concurrency/TimerManager.h \
-                         src/thrift/concurrency/FunctionRunner.h \
-                         src/thrift/concurrency/Util.h
-
-include_protocoldir = $(include_thriftdir)/protocol
-include_protocol_HEADERS = \
-                         src/thrift/protocol/TBinaryProtocol.h \
-                         src/thrift/protocol/TBinaryProtocol.tcc \
-                         src/thrift/protocol/TCompactProtocol.h \
-                         src/thrift/protocol/TCompactProtocol.tcc \
-                         src/thrift/protocol/TDebugProtocol.h \
-                         src/thrift/protocol/TBase64Utils.h \
-                         src/thrift/protocol/TJSONProtocol.h \
-                         src/thrift/protocol/TMultiplexedProtocol.h \
-                         src/thrift/protocol/TProtocolDecorator.h \
-                         src/thrift/protocol/TProtocolTap.h \
-                         src/thrift/protocol/TProtocolException.h \
-                         src/thrift/protocol/TVirtualProtocol.h \
-                         src/thrift/protocol/TProtocol.h
-
-include_transportdir = $(include_thriftdir)/transport
-include_transport_HEADERS = \
-                         src/thrift/transport/PlatformSocket.h \
-                         src/thrift/transport/TFDTransport.h \
-                         src/thrift/transport/TFileTransport.h \
-                         src/thrift/transport/TSimpleFileTransport.h \
-                         src/thrift/transport/TServerSocket.h \
-                         src/thrift/transport/TSSLServerSocket.h \
-                         src/thrift/transport/TServerTransport.h \
-                         src/thrift/transport/THttpTransport.h \
-                         src/thrift/transport/THttpClient.h \
-                         src/thrift/transport/THttpServer.h \
-                         src/thrift/transport/TSocket.h \
-                         src/thrift/transport/TPipe.h \
-                         src/thrift/transport/TPipeServer.h \
-                         src/thrift/transport/TSSLSocket.h \
-                         src/thrift/transport/TSocketPool.h \
-                         src/thrift/transport/TVirtualTransport.h \
-                         src/thrift/transport/TTransport.h \
-                         src/thrift/transport/TTransportException.h \
-                         src/thrift/transport/TTransportUtils.h \
-                         src/thrift/transport/TBufferTransports.h \
-                         src/thrift/transport/TShortReadTransport.h \
-                         src/thrift/transport/TZlibTransport.h
-
-include_serverdir = $(include_thriftdir)/server
-include_server_HEADERS = \
-                         src/thrift/server/TConnectedClient.h \
-                         src/thrift/server/TServer.h \
-                         src/thrift/server/TServerFramework.h \
-                         src/thrift/server/TSimpleServer.h \
-                         src/thrift/server/TThreadPoolServer.h \
-                         src/thrift/server/TThreadedServer.h \
-                         src/thrift/server/TNonblockingServer.h
-
-include_processordir = $(include_thriftdir)/processor
-include_processor_HEADERS = \
-                         src/thrift/processor/PeekProcessor.h \
-                         src/thrift/processor/StatsProcessor.h \
-                         src/thrift/processor/TMultiplexedProcessor.h
-
-include_asyncdir = $(include_thriftdir)/async
-include_async_HEADERS = \
-                     src/thrift/async/TAsyncChannel.h \
-                     src/thrift/async/TAsyncDispatchProcessor.h \
-                     src/thrift/async/TAsyncProcessor.h \
-                     src/thrift/async/TAsyncBufferProcessor.h \
-                     src/thrift/async/TAsyncProtocolProcessor.h \
-                     src/thrift/async/TConcurrentClientSyncInfo.h \
-                     src/thrift/async/TEvhttpClientChannel.h \
-                     src/thrift/async/TEvhttpServer.h
-
-include_qtdir = $(include_thriftdir)/qt
-include_qt_HEADERS = \
-                  src/thrift/qt/TQIODeviceTransport.h \
-                  src/thrift/qt/TQTcpServer.h
-
-THRIFT = $(top_builddir)/compiler/cpp/thrift
-
-WINDOWS_DIST = \
-             src/thrift/windows \
-             thrift.sln \
-             libthrift.vcxproj \
-             libthrift.vcxproj.filters \
-             libthriftnb.vcxproj \
-             libthriftnb.vcxproj.filters \
-             3rdparty.props
-
-EXTRA_DIST = \
-             CMakeLists.txt \
-             coding_standards.md \
-             README.md \
-             thrift-nb.pc.in \
-             thrift.pc.in \
-             thrift-z.pc.in \
-             thrift-qt.pc.in \
-             thrift-qt5.pc.in \
-             src/thrift/qt/CMakeLists.txt \
-             $(WINDOWS_DIST)
-
-style-local:
-	$(CPPSTYLE_CMD)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/README.md b/depends/thirdparty/thrift/lib/cpp/README.md
deleted file mode 100755
index 2bee2ec..0000000
--- a/depends/thirdparty/thrift/lib/cpp/README.md
+++ /dev/null
@@ -1,274 +0,0 @@
-Thrift C++ Software Library
-
-# License
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-
-
-# Using Thrift with C++
-
-The Thrift C++ libraries are built using the GNU tools. Follow the instructions
-in the top-level README.md
-
-In case you do not want to open another README.md file, do this thrift src:
-
-    ./bootstrap.sh
-    ./configure (--with-boost=/usr/local)
-    make
-    sudo make install
-
-Thrift is divided into two libraries.
-
-* libthrift - The core Thrift library contains all the core Thrift code. It requires
-  boost shared pointers, pthreads, and librt.
-
-* libthriftnb - This library contains the Thrift nonblocking server, which uses libevent.
-  To link this library you will also need to link libevent.
-
-## Linking Against Thrift
-
-After you build and install Thrift the libraries are installed to
-/usr/local/lib by default. Make sure this is in your LDPATH.
-
-On Linux, the best way to do this is to ensure that /usr/local/lib is in
-your /etc/ld.so.conf and then run /sbin/ldconfig.
-
-Depending upon whether you are linking dynamically or statically and how
-your build environment it set up, you may need to include additional
-libraries when linking against thrift, such as librt and/or libpthread. If
-you are using libthriftnb you will also need libevent.
-
-## Dependencies
-
-boost shared pointers
-http://www.boost.org/libs/smart_ptr/smart_ptr.htm
-
-libevent (for libthriftnb only)
-http://monkey.org/~provos/libevent/
-
-# Using Thrift with C++ on Windows
-
-You need to define an environment variables for 3rd party components separately:
-
-BOOST_ROOT : For boost, e.g. D:\boost_1_55_0
-OPENSSL_ROOT_DIR : For OpenSSL, e.g. D:\OpenSSL-Win32
-
-only required by libthriftnb:
-
-LIBEVENT_ROOT_DIR : For Libevent e.g. D:\libevent-2.0.21-stable
-
-See /3rdparty.user for more details.
-
-Thrift is divided into two libraries.
-
-* libthrift - The core Thrift library contains all the core Thrift code. It requires
-  boost shared pointers, pthreads, and librt.
-
-* libthriftnb - This library contains the Thrift nonblocking server, which uses libevent.
-  To link this library you will also need to link libevent.
-
-## Linking Against Thrift
-
-You need to link your project that uses thrift against all the thrift
-dependencies; in the case of libthrift, boost and for
-libthriftnb, libevent.
-
-In the project properties you must also set HAVE_CONFIG_H as force include
-the config header: "windows/confg.h"
-
-## Dependencies
-
-boost shared pointers
-http://www.boost.org/libs/smart_ptr/smart_ptr.htm
-
-boost thread
-http://www.boost.org/doc/libs/release/doc/html/thread.html
-
-libevent (for libthriftnb only)
-http://monkey.org/~provos/libevent/
-
-## Notes on boost thread (static vs shared):
-
-By default lib/cpp/windows/force_inc.h defines:
-
-    #define BOOST_ALL_NO_LIB 1
-    #define BOOST_THREAD_NO_LIB 1
-
-This has for effect to have the host application linking against Thrift
-to have to link with boost thread as a static library.
-
-If you wanted instead to link with boost thread as a shared library,
-you'll need to uncomment those two lines, and recompile.
-
-## Windows version compatibility
-
-The Thrift library targets Windows XP for broadest compatbility. A notable
-difference is in the Windows-specific implementation of the socket poll
-function. To target Vista, Win7 or other versions, comment out the line
-
-    #define TARGET_WIN_XP.
-
-## Named Pipes
-
-Named Pipe transport has been added in the TPipe and TPipeServer classes. This
-is currently Windows-only. Named pipe transport for *NIX has not been
-implemented. Domain sockets are a better choice for local IPC under non-Windows
-OS's. *NIX named pipes only support 1:1 client-server connection.
-
-# Thrift/SSL
-
-## Scope
-
-This SSL only supports blocking mode socket I/O. It can only be used with
-TSimpleServer, TThreadedServer, and TThreadPoolServer.
-
-## Implementation
-
-There're two main classes TSSLSocketFactory and TSSLSocket. Instances of
-TSSLSocket are always created from TSSLSocketFactory.
-
-PosixSSLThreadFactory creates PosixSSLThread. The only difference from the
-PthreadThread type is that it cleanups OpenSSL error queue upon exiting
-the thread. Ideally, OpenSSL APIs should only be called from PosixSSLThread.
-
-## How to use SSL APIs
-
-This is for demo. In real code, typically only one TSSLSocketFactory
-instance is needed.
-
-    shared_ptr<TSSLSocketFactory> getSSLSocketFactory() {
-      shared_ptr<TSSLSocketFactory> factory(new TSSLSocketFactory());
-      // client: load trusted certificates
-      factory->loadTrustedCertificates("my-trusted-ca-certificates.pem");
-      // client: optionally set your own access manager, otherwise,
-      //         the default client access manager will be loaded.
-
-      factory->loadCertificate("my-certificate-signed-by-ca.pem");
-      factory->loadPrivateKey("my-private-key.pem");
-      // server: optionally setup access manager
-      // shared_ptr<AccessManager> accessManager(new MyAccessManager);
-      // factory->access(accessManager);
-      ...
-    }
-
-
-client code sample
-
-    shared_ptr<TSSLSocketFactory> factory = getSSLSocketFactory();
-    shared_ptr<TSocket> socket = factory.createSocket(host, port);
-    shared_ptr<TBufferedTransport> transport(new TBufferedTransport(socket));
-    ...
-
-
-server code sample
-
-    shared_ptr<TSSLSocketFactory> factory = getSSLSocketFactory();
-    shared_ptr<TSSLServerSocket> socket(new TSSLServerSocket(port, factory));
-    shared_ptr<TTransportFactory> transportFactory(new TBufferedTransportFactory));
-    ...
-
-## AccessManager
-
-AccessManager defines a callback interface. It has three callback methods:
-
-(a) Decision verify(const sockaddr_storage& sa);
-
-(b) Decision verify(const string& host, const char* name, int size);
-
-(c) Decision verify(const sockaddr_storage& sa, const char* data, int size);
-
-After SSL handshake completes, additional checks are conducted. Application
-is given the chance to decide whether or not to continue the conversation
-with the remote. Application is queried through the above three "verify"
-method. They are called at different points of the verification process.
-
-Decisions can be one of ALLOW, DENY, and SKIP. ALLOW and DENY means the
-conversation should be continued or disconnected, respectively. ALLOW and
-DENY decision stops the verification process. SKIP means there's no decision
-based on the given input, continue the verification process.
-
-First, (a) is called with the remote IP. It is called once at the beginning.
-"sa" is the IP address of the remote peer.
-
-Then, the certificate of remote peer is loaded. SubjectAltName extensions
-are extracted and sent to application for verification. When a DNS
-subjectAltName field is extracted, (b) is called. When an IP subjectAltName
-field is extracted, (c) is called.
-
-The "host" in (b) is the value from TSocket::getHost() if this is a client
-side socket, or TSocket::getPeerHost() if this is a server side socket. The
-reason is client side socket initiates the connection. TSocket::getHost()
-is the remote host name. On server side, the remote host name is unknown
-unless it's retrieved through TSocket::getPeerHost(). Either way, "host"
-should be the remote host name. Keep in mind, if TSocket::getPeerHost()
-failed, it would return the remote host name in numeric format.
-
-If all subjectAltName extensions were "skipped", the common name field would
-be checked. It is sent to application through (c), where "sa" is the remote
-IP address. "data" is the IP address extracted from subjectAltName IP
-extension, and "size" is the length of the extension data.
-
-If any of the above "verify" methods returned a decision ALLOW or DENY, the
-verification process would be stopped.
-
-If any of the above "verify" methods returned SKIP, that decision would be
-ignored and the verification process would move on till the last item is
-examined. At that point, if there's still no decision, the connection is
-terminated.
-
-Thread safety, an access manager should not store state information if it's
-to be used by many SSL sockets.
-
-## SIGPIPE signal
-
-Applications running OpenSSL over network connections may crash if SIGPIPE
-is not ignored. This happens when they receive a connection reset by remote
-peer exception, which somehow triggers a SIGPIPE signal. If not handled,
-this signal would kill the application.
-
-## How to run test client/server in SSL mode
-
-The server and client expects the followings from the directory /test/
-
-- keys/server.crt
-- keys/server.key
-- keys/CA.pem
-
-The file names are hard coded in the source code. You need to create these
-certificates before you can run the test code in SSL mode. Make sure at least
-one of the followings is included in "keys/server.crt",
-
-- subjectAltName, DNS localhost
-- subjectAltName, IP  127.0.0.1
-- common name,    localhost
-
-Run within /test/ folder,
-
-         ./cpp/TestServer --ssl &
-         ./cpp/TestClient --ssl
-
-If "-h <host>" is used to run client, the above "localhost" in the above
-keys/server.crt has to be replaced with that host name.
-
-## TSSLSocketFactory::randomize()
-
-The default implementation of OpenSSLSocketFactory::randomize() simply calls
-OpenSSL's RAND_poll() when OpenSSL library is first initialized.
-
-The PRNG seed is key to the application security. This method should be
-overridden if it's not strong enough for you.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/coding_standards.md b/depends/thirdparty/thrift/lib/cpp/coding_standards.md
deleted file mode 100644
index 8018c77..0000000
--- a/depends/thirdparty/thrift/lib/cpp/coding_standards.md
+++ /dev/null
@@ -1,4 +0,0 @@
-Please follow [General Coding Standards](/doc/coding_standards.md)
-
- * see .clang-format in root dir for settings of accepted format
- * clang-format (3.5 or newer) can be used to automaticaly reformat code ('make style' command)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj b/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj
deleted file mode 100644
index b4f1c50..0000000
--- a/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj
+++ /dev/null
@@ -1,359 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug-mt|Win32">
-      <Configuration>Debug-mt</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug-mt|x64">
-      <Configuration>Debug-mt</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release-mt|Win32">
-      <Configuration>Release-mt</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release-mt|x64">
-      <Configuration>Release-mt</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\thrift\async\TAsyncChannel.cpp"/>
-    <ClCompile Include="src\thrift\concurrency\BoostMonitor.cpp" />
-    <ClCompile Include="src\thrift\concurrency\BoostMutex.cpp" />
-    <ClCompile Include="src\thrift\concurrency\BoostThreadFactory.cpp" />
-    <ClCompile Include="src\thrift\concurrency\StdThreadFactory.cpp" />
-    <ClCompile Include="src\thrift\concurrency\ThreadManager.cpp"/>
-    <ClCompile Include="src\thrift\concurrency\TimerManager.cpp"/>
-    <ClCompile Include="src\thrift\concurrency\Util.cpp"/>
-    <ClCompile Include="src\thrift\processor\PeekProcessor.cpp"/>
-    <ClCompile Include="src\thrift\protocol\TBase64Utils.cpp" />
-    <ClCompile Include="src\thrift\protocol\TDebugProtocol.cpp"/>
-    <ClCompile Include="src\thrift\protocol\TJSONProtocol.cpp"/>
-    <ClCompile Include="src\thrift\protocol\TMultiplexedProtocol.cpp"/>
-    <ClCompile Include="src\thrift\server\TSimpleServer.cpp"/>
-    <ClCompile Include="src\thrift\server\TThreadPoolServer.cpp"/>
-    <ClCompile Include="src\thrift\server\TThreadedServer.cpp"/>
-    <ClCompile Include="src\thrift\TApplicationException.cpp"/>
-    <ClCompile Include="src\thrift\Thrift.cpp"/>
-    <ClCompile Include="src\thrift\transport\TBufferTransports.cpp"/>
-    <ClCompile Include="src\thrift\transport\TFDTransport.cpp" />
-    <ClCompile Include="src\thrift\transport\THttpClient.cpp" />
-    <ClCompile Include="src\thrift\transport\THttpServer.cpp" />
-    <ClCompile Include="src\thrift\transport\THttpTransport.cpp"/>
-    <ClCompile Include="src\thrift\transport\TPipe.cpp" />
-    <ClCompile Include="src\thrift\transport\TPipeServer.cpp" />
-    <ClCompile Include="src\thrift\transport\TServerSocket.cpp"/>
-    <ClCompile Include="src\thrift\transport\TSimpleFileTransport.cpp" />
-    <ClCompile Include="src\thrift\transport\TFileTransport.cpp" />
-    <ClCompile Include="src\thrift\transport\TSocket.cpp"/>
-    <ClCompile Include="src\thrift\transport\TSSLSocket.cpp"/>
-    <ClCompile Include="src\thrift\transport\TTransportException.cpp"/>
-    <ClCompile Include="src\thrift\transport\TTransportUtils.cpp"/>
-    <ClCompile Include="src\thrift\windows\GetTimeOfDay.cpp" />
-    <ClCompile Include="src\thrift\windows\OverlappedSubmissionThread.cpp" />
-    <ClCompile Include="src\thrift\windows\SocketPair.cpp" />
-    <ClCompile Include="src\thrift\windows\TWinsockSingleton.cpp" />
-    <ClCompile Include="src\thrift\windows\WinFcntl.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\thrift\async\TAsyncChannel.h" />
-    <ClInclude Include="src\thrift\concurrency\BoostThreadFactory.h" />
-    <ClInclude Include="src\thrift\concurrency\StdThreadFactory.h" />
-    <ClInclude Include="src\thrift\concurrency\Exception.h" />
-    <ClInclude Include="src\thrift\concurrency\PlatformThreadFactory.h" />
-    <ClInclude Include="src\thrift\processor\PeekProcessor.h" />
-    <ClInclude Include="src\thrift\processor\TMultiplexedProcessor.h" />
-    <ClInclude Include="src\thrift\protocol\TBinaryProtocol.h" />
-    <ClInclude Include="src\thrift\protocol\TDebugProtocol.h" />
-    <ClInclude Include="src\thrift\protocol\TJSONProtocol.h" />
-    <ClInclude Include="src\thrift\protocol\TMultiplexedProtocol.h" />
-    <ClInclude Include="src\thrift\protocol\TProtocol.h" />
-    <ClInclude Include="src\thrift\protocol\TVirtualProtocol.h" />
-    <ClInclude Include="src\thrift\server\TServer.h" />
-    <ClInclude Include="src\thrift\server\TSimpleServer.h" />
-    <ClInclude Include="src\thrift\server\TThreadPoolServer.h" />
-    <ClInclude Include="src\thrift\server\TThreadedServer.h" />
-    <ClInclude Include="src\thrift\TApplicationException.h" />
-    <ClInclude Include="src\thrift\Thrift.h" />
-    <ClInclude Include="src\thrift\TProcessor.h" />
-    <ClInclude Include="src\thrift\transport\TBufferTransports.h" />
-    <ClInclude Include="src\thrift\transport\TFDTransport.h" />
-    <ClInclude Include="src\thrift\transport\TFileTransport.h" />
-    <ClInclude Include="src\thrift\transport\THttpClient.h" />
-    <ClInclude Include="src\thrift\transport\THttpServer.h" />
-    <ClInclude Include="src\thrift\transport\TPipe.h" />
-    <ClInclude Include="src\thrift\transport\TPipeServer.h" />
-    <ClInclude Include="src\thrift\transport\TServerSocket.h" />
-    <ClInclude Include="src\thrift\transport\TServerTransport.h" />
-    <ClInclude Include="src\thrift\transport\TSimpleFileTransport.h" />
-    <ClInclude Include="src\thrift\transport\TSocket.h" />
-    <ClInclude Include="src\thrift\transport\TSSLSocket.h" />
-    <ClInclude Include="src\thrift\transport\TTransport.h" />
-    <ClInclude Include="src\thrift\transport\TTransportException.h" />
-    <ClInclude Include="src\thrift\transport\TTransportUtils.h" />
-    <ClInclude Include="src\thrift\transport\TVirtualTransport.h" />
-    <ClInclude Include="src\thrift\windows\config.h" />
-    <ClInclude Include="src\thrift\windows\GetTimeOfDay.h" />
-    <ClInclude Include="src\thrift\windows\Operators.h" />
-    <ClInclude Include="src\thrift\windows\OverlappedSubmissionThread.h" />
-    <ClInclude Include="src\thrift\windows\SocketPair.h" />
-    <ClInclude Include="src\thrift\windows\TWinsockSingleton.h" />
-    <ClInclude Include="src\thrift\windows\WinFcntl.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\thrift\protocol\TBinaryProtocol.tcc" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{DD26F57E-60F2-4F37-A616-D219A9BF338F}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>thrift</RootNamespace>
-    <ProjectName>libthrift</ProjectName>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(OPENSSL_ROOT_DIR)\include\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthrift.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthrift.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'">
-    <ClCompile>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthrift.pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthrift.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>NotUsing</PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj.filters
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj.filters b/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj.filters
deleted file mode 100644
index ec21886..0000000
--- a/depends/thirdparty/thrift/lib/cpp/libthrift.vcxproj.filters
+++ /dev/null
@@ -1,277 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <ClCompile Include="src\thrift\transport\TBufferTransports.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\Thrift.cpp" />
-    <ClCompile Include="src\thrift\TApplicationException.cpp" />
-    <ClCompile Include="src\thrift\windows\StdAfx.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TTransportException.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\windows\GetTimeOfDay.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\ThreadManager.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\TimerManager.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\Util.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\protocol\TDebugProtocol.cpp">
-      <Filter>protocol</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\protocol\TBase64Utils.cpp">
-      <Filter>protocol</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\protocol\TJSONProtocol.cpp">
-      <Filter>protocol</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\protocol\TMultiplexedProtocol.cpp">
-      <Filter>protocol</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TFDTransport.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TFileTransport.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TSimpleFileTransport.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\THttpTransport.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\THttpClient.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\THttpServer.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TSSLSocket.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TTransportUtils.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\server\TSimpleServer.cpp">
-      <Filter>server</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\server\TThreadPoolServer.cpp">
-      <Filter>server</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\server\TThreadedServer.cpp">
-      <Filter>server</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\async\TAsyncChannel.cpp">
-      <Filter>async</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\processor\PeekProcessor.cpp">
-      <Filter>processor</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TServerSocket.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TSocket.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\windows\TWinsockSingleton.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\windows\SocketPair.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\BoostMonitor.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\BoostMutex.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\BoostThreadFactory.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\concurrency\StdThreadFactory.cpp">
-      <Filter>concurrency</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\windows\WinFcntl.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TPipe.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\transport\TPipeServer.cpp">
-      <Filter>transport</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\thrift\transport\TBufferTransports.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TSocket.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TBinaryProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\Thrift.h" />
-    <ClInclude Include="src\thrift\TProcessor.h" />
-    <ClInclude Include="src\thrift\TApplicationException.h" />
-    <ClInclude Include="src\thrift\windows\StdAfx.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\TargetVersion.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\concurrency\Exception.h">
-      <Filter>concurrency</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TVirtualTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TTransportException.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\GetTimeOfDay.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TServerTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\config.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TVirtualProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\server\TServer.h">
-      <Filter>server</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\server\TSimpleServer.h">
-      <Filter>server</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\server\TThreadPoolServer.h">
-      <Filter>server</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\server\TThreadedServer.h">
-      <Filter>server</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\async\TAsyncChannel.h">
-      <Filter>async</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\processor\PeekProcessor.h">
-      <Filter>processor</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\processor\TMultiplexedProcessor.h">
-      <Filter>processor</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TFDTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TFileTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\THttpClient.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\THttpServer.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TSSLSocket.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TTransportUtils.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TSimpleFileTransport.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TJSONProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TMultiplexedProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\protocol\TDebugProtocol.h">
-      <Filter>protocol</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TServerSocket.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\Operators.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\TWinsockSingleton.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\SocketPair.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\force_inc.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\concurrency\BoostThreadFactory.h">
-      <Filter>concurrency</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\concurrency\StdThreadFactory.h">
-      <Filter>concurrency</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\concurrency\PlatformThreadFactory.h">
-      <Filter>concurrency</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\WinFcntl.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TPipe.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\transport\TPipeServer.h">
-      <Filter>transport</Filter>
-    </ClInclude>
-  </ItemGroup>
-  <ItemGroup>
-    <Filter Include="protocol">
-      <UniqueIdentifier>{07ced19b-b72a-4105-9ffb-6d2bcf64497e}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="transport">
-      <UniqueIdentifier>{e9f61404-1148-4103-bd6f-e5869d37fa79}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="windows">
-      <UniqueIdentifier>{2814002a-3c68-427e-b0eb-33acd2f406ae}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="concurrency">
-      <UniqueIdentifier>{addd4707-dbaa-4d0c-bef6-fff8be7b495a}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="server">
-      <UniqueIdentifier>{f55a8e9b-6959-487f-a396-c31b4d6c61d6}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="async">
-      <UniqueIdentifier>{d526885b-1b3e-4ee3-8027-e694fe98ad63}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="processor">
-      <UniqueIdentifier>{8f428da8-5a83-44fb-9578-de935fb415e1}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="windows\tr1">
-      <UniqueIdentifier>{eea10406-3380-4f2d-9365-c26fa2875dae}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="src\thrift\protocol\TBinaryProtocol.tcc">
-      <Filter>protocol</Filter>
-    </None>
-    <None Include="src\thrift\windows\tr1\functional">
-      <Filter>windows\tr1</Filter>
-    </None>
-  </ItemGroup>
-</Project>



[51/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
HAWQ-959. revert thrift build commands.

Remove Thrift from source tree
* We will need to update documentation to provide guidance on building
  supporte Thrift version (0.9.3).

* Manually revert relavant portions of c0d7c4fdbebbf6f48be92974a8f055a02ea4c3f2


Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/928eade3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/928eade3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/928eade3

Branch: refs/heads/2.0.0.0-incubating
Commit: 928eade37f42295402986a7fa7759e45ae6278e6
Parents: 9bc040d
Author: Ed Espino <ee...@pivotal.io>
Authored: Mon Aug 29 15:15:00 2016 -0700
Committer: EC2 Default User <ec...@ip-172-31-38-49.us-west-2.compute.internal>
Committed: Thu Sep 8 05:17:04 2016 +0000

----------------------------------------------------------------------
 GNUmakefile.in                                  |    4 -
 configure                                       |   55 +-
 configure.in                                    |   11 +-
 depends/thirdparty/README                       |    3 -
 depends/thirdparty/thrift/.clang-format         |   56 -
 depends/thirdparty/thrift/.editorconfig         |  112 -
 depends/thirdparty/thrift/.gitattributes        |    1 -
 depends/thirdparty/thrift/.gitignore            |  280 -
 depends/thirdparty/thrift/.travis.yml           |  188 -
 depends/thirdparty/thrift/CHANGES               | 1779 ------
 depends/thirdparty/thrift/CMakeLists.txt        |  103 -
 depends/thirdparty/thrift/CONTRIBUTING.md       |   49 -
 depends/thirdparty/thrift/LICENSE               |  253 -
 depends/thirdparty/thrift/Makefile.am           |  110 -
 depends/thirdparty/thrift/NOTICE                |    5 -
 depends/thirdparty/thrift/README.md             |  164 -
 .../thirdparty/thrift/aclocal/ac_prog_bison.m4  |   54 -
 .../thirdparty/thrift/aclocal/ax_boost_base.m4  |  272 -
 .../thrift/aclocal/ax_check_openssl.m4          |  124 -
 .../thrift/aclocal/ax_cxx_compile_stdcxx_11.m4  |  165 -
 depends/thirdparty/thrift/aclocal/ax_dmd.m4     |  107 -
 .../thrift/aclocal/ax_javac_and_java.m4         |  129 -
 .../thirdparty/thrift/aclocal/ax_lib_event.m4   |  194 -
 .../thirdparty/thrift/aclocal/ax_lib_zlib.m4    |  173 -
 depends/thirdparty/thrift/aclocal/ax_lua.m4     |  663 ---
 .../thrift/aclocal/ax_prog_haxe_version.m4      |   60 -
 .../thrift/aclocal/ax_prog_perl_modules.m4      |   77 -
 .../thrift/aclocal/ax_signed_right_shift.m4     |  127 -
 .../thrift/aclocal/ax_thrift_internal.m4        |   28 -
 .../thrift/aclocal/m4_ax_compare_version.m4     |  177 -
 depends/thirdparty/thrift/appveyor.yml          |   53 -
 depends/thirdparty/thrift/bootstrap.sh          |   54 -
 depends/thirdparty/thrift/bower.json            |   16 -
 .../thrift/build/cmake/CPackConfig.cmake        |   68 -
 .../thrift/build/cmake/ConfigureChecks.cmake    |   76 -
 .../build/cmake/DefineCMakeDefaults.cmake       |   70 -
 .../build/cmake/DefineInstallationPaths.cmake   |   26 -
 .../thrift/build/cmake/DefineOptions.cmake      |  143 -
 .../build/cmake/DefinePlatformSpecifc.cmake     |   94 -
 .../thirdparty/thrift/build/cmake/FindAnt.cmake |   30 -
 .../thrift/build/cmake/FindGLIB.cmake           |  122 -
 .../thrift/build/cmake/FindLibevent.cmake       |   39 -
 depends/thirdparty/thrift/build/cmake/README.md |   60 -
 .../thrift/build/cmake/ThriftMacros.cmake       |   94 -
 .../thirdparty/thrift/build/cmake/config.h.in   |  157 -
 .../thrift/build/cmake/mingw32-toolchain.cmake  |   24 -
 .../thirdparty/thrift/build/docker/README.md    |   27 -
 .../thirdparty/thrift/build/docker/Vagrantfile  |   59 -
 .../thrift/build/docker/centos/Dockerfile       |   96 -
 .../thrift/build/docker/ubuntu/Dockerfile       |  111 -
 .../build/travis/installCXXDependencies.sh      |   29 -
 .../thrift/build/travis/installDependencies.sh  |   69 -
 depends/thirdparty/thrift/cleanup.sh            |   89 -
 .../thrift/compiler/cpp/CMakeLists.txt          |  133 -
 .../thirdparty/thrift/compiler/cpp/Makefile.am  |  125 -
 .../thirdparty/thrift/compiler/cpp/README.md    |   84 -
 .../thrift/compiler/cpp/coding_standards.md     |    4 -
 .../thirdparty/thrift/compiler/cpp/compiler.sln |   20 -
 .../thrift/compiler/cpp/compiler.vcxproj        |  247 -
 .../compiler/cpp/compiler.vcxproj.filters       |  189 -
 .../thrift/compiler/cpp/src/audit/t_audit.cpp   |  466 --
 .../thrift/compiler/cpp/src/audit/t_audit.h     |   11 -
 .../cpp/src/generate/t_as3_generator.cc         | 2579 ---------
 .../cpp/src/generate/t_c_glib_generator.cc      | 4565 ----------------
 .../cpp/src/generate/t_cocoa_generator.cc       | 2856 ----------
 .../cpp/src/generate/t_cpp_generator.cc         | 4367 ---------------
 .../cpp/src/generate/t_csharp_generator.cc      | 2867 ----------
 .../compiler/cpp/src/generate/t_d_generator.cc  |  722 ---
 .../cpp/src/generate/t_delphi_generator.cc      | 3900 -------------
 .../cpp/src/generate/t_erl_generator.cc         | 1044 ----
 .../compiler/cpp/src/generate/t_generator.cc    |  177 -
 .../compiler/cpp/src/generate/t_generator.h     |  285 -
 .../cpp/src/generate/t_generator_registry.h     |  102 -
 .../compiler/cpp/src/generate/t_go_generator.cc | 3582 ------------
 .../compiler/cpp/src/generate/t_gv_generator.cc |  339 --
 .../cpp/src/generate/t_haxe_generator.cc        | 2966 ----------
 .../compiler/cpp/src/generate/t_hs_generator.cc | 1723 ------
 .../cpp/src/generate/t_html_generator.cc        | 1081 ----
 .../cpp/src/generate/t_html_generator.h         |  240 -
 .../cpp/src/generate/t_java_generator.cc        | 5146 ------------------
 .../cpp/src/generate/t_javame_generator.cc      | 3289 -----------
 .../compiler/cpp/src/generate/t_js_generator.cc | 2179 --------
 .../cpp/src/generate/t_json_generator.cc        |  717 ---
 .../cpp/src/generate/t_lua_generator.cc         | 1127 ----
 .../cpp/src/generate/t_ocaml_generator.cc       | 1756 ------
 .../compiler/cpp/src/generate/t_oop_generator.h |  129 -
 .../cpp/src/generate/t_perl_generator.cc        | 1642 ------
 .../cpp/src/generate/t_php_generator.cc         | 2526 ---------
 .../compiler/cpp/src/generate/t_py_generator.cc | 2461 ---------
 .../compiler/cpp/src/generate/t_rb_generator.cc | 1252 -----
 .../compiler/cpp/src/generate/t_st_generator.cc | 1049 ----
 .../cpp/src/generate/t_xsd_generator.cc         |  355 --
 .../thrift/compiler/cpp/src/globals.h           |  156 -
 .../thrift/compiler/cpp/src/logging.h           |   45 -
 .../thirdparty/thrift/compiler/cpp/src/main.cc  | 1290 -----
 .../thirdparty/thrift/compiler/cpp/src/main.h   |  107 -
 .../thirdparty/thrift/compiler/cpp/src/md5.c    |  381 --
 .../thirdparty/thrift/compiler/cpp/src/md5.h    |   90 -
 .../thrift/compiler/cpp/src/parse/parse.cc      |   31 -
 .../thrift/compiler/cpp/src/parse/t_base_type.h |  117 -
 .../thrift/compiler/cpp/src/parse/t_const.h     |   50 -
 .../compiler/cpp/src/parse/t_const_value.h      |  146 -
 .../thrift/compiler/cpp/src/parse/t_container.h |   47 -
 .../thrift/compiler/cpp/src/parse/t_doc.h       |   54 -
 .../thrift/compiler/cpp/src/parse/t_enum.h      |  110 -
 .../compiler/cpp/src/parse/t_enum_value.h       |   49 -
 .../thrift/compiler/cpp/src/parse/t_field.h     |  128 -
 .../thrift/compiler/cpp/src/parse/t_function.h  |   84 -
 .../thrift/compiler/cpp/src/parse/t_list.h      |   41 -
 .../thrift/compiler/cpp/src/parse/t_map.h       |   45 -
 .../thrift/compiler/cpp/src/parse/t_program.h   |  381 --
 .../thrift/compiler/cpp/src/parse/t_scope.h     |  172 -
 .../thrift/compiler/cpp/src/parse/t_service.h   |   59 -
 .../thrift/compiler/cpp/src/parse/t_set.h       |   41 -
 .../thrift/compiler/cpp/src/parse/t_struct.h    |  157 -
 .../thrift/compiler/cpp/src/parse/t_type.h      |  107 -
 .../thrift/compiler/cpp/src/parse/t_typedef.cc  |   34 -
 .../thrift/compiler/cpp/src/parse/t_typedef.h   |   67 -
 .../thrift/compiler/cpp/src/platform.h          |   47 -
 .../thrift/compiler/cpp/src/thriftl.ll          |  423 --
 .../thrift/compiler/cpp/src/thrifty.yy          | 1312 -----
 .../thrift/compiler/cpp/src/windows/config.h    |   45 -
 .../compiler/cpp/src/windows/version.h.in       |   33 -
 .../thirdparty/thrift/compiler/cpp/version.h.in |    1 -
 depends/thirdparty/thrift/composer.json         |   30 -
 depends/thirdparty/thrift/configure.ac          |  891 ---
 .../thirdparty/thrift/contrib/Rebus/App.config  |   33 -
 .../thirdparty/thrift/contrib/Rebus/Program.cs  |   81 -
 .../contrib/Rebus/Properties/AssemblyInfo.cs    |   38 -
 .../thirdparty/thrift/contrib/Rebus/README.md   |   21 -
 .../thrift/contrib/Rebus/RebusSample.csproj     |  102 -
 .../thrift/contrib/Rebus/RebusSample.sln        |   28 -
 .../thrift/contrib/Rebus/ServiceImpl/Both.cs    |   35 -
 .../thrift/contrib/Rebus/ServiceImpl/Client.cs  |  157 -
 .../thrift/contrib/Rebus/ServiceImpl/Server.cs  |  143 -
 .../thrift/contrib/Rebus/sample.thrift          |   30 -
 .../thirdparty/thrift/contrib/Stomp/README.md   |   18 -
 .../contrib/Stomp/Thrift.Transport.STOMP.pas    |  200 -
 depends/thirdparty/thrift/contrib/Vagrantfile   |  133 -
 .../thrift/contrib/async-test/aggr.thrift       |    8 -
 .../thrift/contrib/async-test/test-leaf.py      |   23 -
 .../thrift/contrib/async-test/test-server.cpp   |   97 -
 depends/thirdparty/thrift/contrib/fb303/LICENSE |   16 -
 .../thirdparty/thrift/contrib/fb303/Makefile.am |   46 -
 .../thirdparty/thrift/contrib/fb303/README.md   |   37 -
 .../thrift/contrib/fb303/TClientInfo.cpp        |  178 -
 .../thrift/contrib/fb303/TClientInfo.h          |  320 --
 .../contrib/fb303/aclocal/ax_boost_base.m4      |  198 -
 .../fb303/aclocal/ax_cxx_compile_stdcxx_11.m4   |  134 -
 .../contrib/fb303/aclocal/ax_javac_and_java.m4  |  121 -
 .../contrib/fb303/aclocal/ax_thrift_internal.m4 |   28 -
 .../thrift/contrib/fb303/bootstrap.sh           |   26 -
 .../thrift/contrib/fb303/configure.ac           |  164 -
 .../thrift/contrib/fb303/cpp/FacebookBase.cpp   |  124 -
 .../thrift/contrib/fb303/cpp/FacebookBase.h     |  103 -
 .../thrift/contrib/fb303/cpp/Makefile.am        |   84 -
 .../thrift/contrib/fb303/cpp/ServiceTracker.cpp |  481 --
 .../thrift/contrib/fb303/cpp/ServiceTracker.h   |  215 -
 .../thrift/contrib/fb303/global_footer.mk       |   21 -
 .../thrift/contrib/fb303/global_header.mk       |   38 -
 .../thrift/contrib/fb303/if/fb303.thrift        |  112 -
 .../thrift/contrib/fb303/java/build.xml         |  195 -
 .../contrib/fb303/java/src/FacebookBase.java    |  114 -
 .../thrift/contrib/fb303/php/FacebookBase.php   |   89 -
 .../thrift/contrib/fb303/py/Makefile.am         |   44 -
 .../contrib/fb303/py/fb303/FacebookBase.py      |   82 -
 .../contrib/fb303/py/fb303_scripts/__init__.py  |   20 -
 .../fb303/py/fb303_scripts/fb303_simple_mgmt.py |  195 -
 .../thirdparty/thrift/contrib/fb303/py/setup.py |   49 -
 .../thrift/contrib/mingw-cross-compile.sh       |   19 -
 .../thrift/contrib/parse_profiling.py           |  310 --
 .../thrift/contrib/thrift-maven-plugin/pom.xml  |   86 -
 .../apache/thrift/maven/AbstractThriftMojo.java |  377 --
 .../java/org/apache/thrift/maven/Thrift.java    |  262 -
 .../apache/thrift/maven/ThriftCompileMojo.java  |   78 -
 .../thrift/maven/ThriftTestCompileMojo.java     |   74 -
 .../org/apache/thrift/maven/TestThrift.java     |  163 -
 .../src/test/resources/idl/shared.thrift        |   36 -
 .../src/test/resources/idl/tutorial.thrift      |  152 -
 depends/thirdparty/thrift/contrib/thrift.el     |  140 -
 depends/thirdparty/thrift/contrib/thrift.spec   |  238 -
 depends/thirdparty/thrift/contrib/thrift.vim    |   91 -
 .../thirdparty/thrift/contrib/thrift_dump.cpp   |   91 -
 .../thrift/contrib/transport-sample/README.md   |   61 -
 .../contrib/transport-sample/Sample.thrift      |   39 -
 .../contrib/transport-sample/ThriftCommon.cpp   |   37 -
 .../contrib/transport-sample/ThriftCommon.h     |  207 -
 .../contrib/transport-sample/client/ReadMe.txt  |   40 -
 .../contrib/transport-sample/client/client.cpp  |  195 -
 .../transport-sample/client/client.vcxproj      |  105 -
 .../client/client.vcxproj.filters               |   66 -
 .../contrib/transport-sample/client/stdafx.cpp  |    8 -
 .../contrib/transport-sample/client/stdafx.h    |   15 -
 .../contrib/transport-sample/client/targetver.h |    8 -
 .../thrift/contrib/transport-sample/config.h    |   24 -
 .../contrib/transport-sample/server/ReadMe.txt  |   40 -
 .../contrib/transport-sample/server/server.cpp  |  168 -
 .../transport-sample/server/server.vcxproj      |  106 -
 .../server/server.vcxproj.filters               |   66 -
 .../contrib/transport-sample/server/stdafx.cpp  |    8 -
 .../contrib/transport-sample/server/stdafx.h    |   15 -
 .../contrib/transport-sample/server/targetver.h |    8 -
 .../contrib/transport-sample/thriftme.bat       |    1 -
 .../thrift/contrib/transport-sample/thriftme.sh |   24 -
 .../transport-sample/transport-sample.sln       |   26 -
 .../thrift/contrib/vagrant/centos-6.5/README.md |   61 -
 .../contrib/vagrant/centos-6.5/Vagrantfile      |  274 -
 .../thirdparty/thrift/contrib/zeromq/README.md  |   30 -
 .../thrift/contrib/zeromq/TZmqClient.cpp        |   48 -
 .../thrift/contrib/zeromq/TZmqClient.h          |   65 -
 .../thrift/contrib/zeromq/TZmqClient.py         |   63 -
 .../thrift/contrib/zeromq/TZmqServer.cpp        |   96 -
 .../thrift/contrib/zeromq/TZmqServer.h          |   83 -
 .../thrift/contrib/zeromq/TZmqServer.py         |   78 -
 .../contrib/zeromq/csharp/AssemblyInfo.cs       |   46 -
 .../thrift/contrib/zeromq/csharp/Main.cs        |   60 -
 .../thrift/contrib/zeromq/csharp/TZmqClient.cs  |   78 -
 .../thrift/contrib/zeromq/csharp/TZmqServer.cs  |   56 -
 .../contrib/zeromq/csharp/ThriftZMQ.csproj      |   91 -
 .../thrift/contrib/zeromq/csharp/ThriftZMQ.sln  |   42 -
 .../thrift/contrib/zeromq/storage.thrift        |    4 -
 .../thrift/contrib/zeromq/test-client.cpp       |   40 -
 .../thrift/contrib/zeromq/test-client.py        |   36 -
 .../thrift/contrib/zeromq/test-receiver.cpp     |   40 -
 .../thrift/contrib/zeromq/test-sender.cpp       |   32 -
 .../thrift/contrib/zeromq/test-server.cpp       |   43 -
 .../thrift/contrib/zeromq/test-server.py        |   33 -
 depends/thirdparty/thrift/debian/README.md      |   19 -
 depends/thirdparty/thrift/debian/changelog      |   73 -
 depends/thirdparty/thrift/debian/compat         |    1 -
 depends/thirdparty/thrift/debian/control        |  153 -
 depends/thirdparty/thrift/debian/copyright      |  129 -
 depends/thirdparty/thrift/debian/dirs           |    2 -
 depends/thirdparty/thrift/debian/docs           |    1 -
 .../thrift/debian/libthrift-dev.install         |    4 -
 .../thirdparty/thrift/debian/libthrift0.install |    5 -
 .../thirdparty/thrift/debian/php5-thrift.dirs   |    1 -
 depends/thirdparty/thrift/debian/rules          |  206 -
 depends/thirdparty/thrift/debian/substvars      |    1 -
 .../thirdparty/thrift/debian/thrift-doc.docs    |    2 -
 .../thirdparty/thrift/debian/thrift-doc.install |    2 -
 depends/thirdparty/thrift/doap.rdf              |  127 -
 .../thirdparty/thrift/doc/coding_standards.md   |   48 -
 depends/thirdparty/thrift/doc/committers.md     |   54 -
 depends/thirdparty/thrift/doc/install/README.md |   43 -
 depends/thirdparty/thrift/doc/install/centos.md |   75 -
 depends/thirdparty/thrift/doc/install/debian.md |   41 -
 depends/thirdparty/thrift/doc/install/os_x.md   |   27 -
 .../thirdparty/thrift/doc/install/windows.md    |  186 -
 .../thirdparty/thrift/doc/licenses/lgpl-2.1.txt |  504 --
 .../thrift/doc/licenses/otp-base-license.txt    |   20 -
 depends/thirdparty/thrift/doc/specs/idl.md      |  236 -
 .../thrift/doc/specs/thrift-protocol-spec.md    |   99 -
 .../thrift/doc/specs/thrift-sasl-spec.txt       |  108 -
 depends/thirdparty/thrift/doc/specs/thrift.tex  | 1057 ----
 depends/thirdparty/thrift/hawqbuild/Makefile    |   37 -
 .../thrift/hawqbuild/Makefile.global.in         |   17 -
 depends/thirdparty/thrift/json-schema.json      |  310 --
 depends/thirdparty/thrift/lib/Makefile.am       |  101 -
 depends/thirdparty/thrift/lib/as3/build.xml     |  180 -
 .../thrift/lib/as3/coding_standards.md          |    1 -
 .../org/apache/thrift/AbstractMethodError.as    |   31 -
 .../thrift/lib/as3/src/org/apache/thrift/Set.as |   82 -
 .../src/org/apache/thrift/TApplicationError.as  |  106 -
 .../lib/as3/src/org/apache/thrift/TBase.as      |   67 -
 .../lib/as3/src/org/apache/thrift/TError.as     |   29 -
 .../org/apache/thrift/TFieldRequirementType.as  |   32 -
 .../lib/as3/src/org/apache/thrift/TProcessor.as |   32 -
 .../apache/thrift/meta_data/FieldMetaData.as    |   57 -
 .../thrift/meta_data/FieldValueMetaData.as      |   44 -
 .../org/apache/thrift/meta_data/ListMetaData.as |   31 -
 .../org/apache/thrift/meta_data/MapMetaData.as  |   33 -
 .../org/apache/thrift/meta_data/SetMetaData.as  |   31 -
 .../apache/thrift/meta_data/StructMetaData.as   |   31 -
 .../apache/thrift/protocol/TBinaryProtocol.as   |  316 --
 .../src/org/apache/thrift/protocol/TField.as    |   43 -
 .../as3/src/org/apache/thrift/protocol/TList.as |   33 -
 .../as3/src/org/apache/thrift/protocol/TMap.as  |   33 -
 .../src/org/apache/thrift/protocol/TMessage.as  |   42 -
 .../org/apache/thrift/protocol/TMessageType.as  |   28 -
 .../src/org/apache/thrift/protocol/TProtocol.as |  124 -
 .../apache/thrift/protocol/TProtocolError.as    |   39 -
 .../apache/thrift/protocol/TProtocolFactory.as  |   27 -
 .../org/apache/thrift/protocol/TProtocolUtil.as |  148 -
 .../as3/src/org/apache/thrift/protocol/TSet.as  |   33 -
 .../src/org/apache/thrift/protocol/TStruct.as   |   31 -
 .../as3/src/org/apache/thrift/protocol/TType.as |   39 -
 .../thrift/transport/TFullDuplexHttpClient.as   |  251 -
 .../org/apache/thrift/transport/THttpClient.as  |  134 -
 .../src/org/apache/thrift/transport/TSocket.as  |  189 -
 .../org/apache/thrift/transport/TTransport.as   |  127 -
 .../apache/thrift/transport/TTransportError.as  |   37 -
 .../thirdparty/thrift/lib/c_glib/CMakeLists.txt |   66 -
 .../thirdparty/thrift/lib/c_glib/Makefile.am    |   99 -
 depends/thirdparty/thrift/lib/c_glib/README.md  |   34 -
 .../thrift/lib/c_glib/coding_standards.md       |    5 -
 .../processor/thrift_dispatch_processor.c       |  142 -
 .../processor/thrift_dispatch_processor.h       |   95 -
 .../thrift/c_glib/processor/thrift_processor.c  |   45 -
 .../thrift/c_glib/processor/thrift_processor.h  |   76 -
 .../c_glib/protocol/thrift_binary_protocol.c    |  904 ---
 .../c_glib/protocol/thrift_binary_protocol.h    |   72 -
 .../protocol/thrift_binary_protocol_factory.c   |   50 -
 .../protocol/thrift_binary_protocol_factory.h   |   56 -
 .../thrift/c_glib/protocol/thrift_protocol.c    |  589 --
 .../thrift/c_glib/protocol/thrift_protocol.h    |  341 --
 .../c_glib/protocol/thrift_protocol_factory.c   |   43 -
 .../c_glib/protocol/thrift_protocol_factory.h   |   73 -
 .../src/thrift/c_glib/server/thrift_server.c    |  174 -
 .../src/thrift/c_glib/server/thrift_server.h    |   93 -
 .../thrift/c_glib/server/thrift_simple_server.c |  138 -
 .../thrift/c_glib/server/thrift_simple_server.h |   70 -
 .../lib/c_glib/src/thrift/c_glib/thrift.c       |   40 -
 .../lib/c_glib/src/thrift/c_glib/thrift.h       |   38 -
 .../c_glib/thrift_application_exception.c       |  277 -
 .../c_glib/thrift_application_exception.h       |   86 -
 .../c_glib/src/thrift/c_glib/thrift_struct.c    |   52 -
 .../c_glib/src/thrift/c_glib/thrift_struct.h    |   68 -
 .../transport/thrift_buffered_transport.c       |  391 --
 .../transport/thrift_buffered_transport.h       |   77 -
 .../thrift_buffered_transport_factory.c         |   55 -
 .../thrift_buffered_transport_factory.h         |   86 -
 .../c_glib/transport/thrift_framed_transport.c  |  384 --
 .../c_glib/transport/thrift_framed_transport.h  |   77 -
 .../transport/thrift_framed_transport_factory.c |   55 -
 .../transport/thrift_framed_transport_factory.h |   86 -
 .../c_glib/transport/thrift_memory_buffer.c     |  231 -
 .../c_glib/transport/thrift_memory_buffer.h     |   71 -
 .../c_glib/transport/thrift_server_socket.c     |  256 -
 .../c_glib/transport/thrift_server_socket.h     |   90 -
 .../c_glib/transport/thrift_server_transport.c  |   62 -
 .../c_glib/transport/thrift_server_transport.h  |   89 -
 .../src/thrift/c_glib/transport/thrift_socket.c |  371 --
 .../src/thrift/c_glib/transport/thrift_socket.h |   75 -
 .../thrift/c_glib/transport/thrift_transport.c  |  126 -
 .../thrift/c_glib/transport/thrift_transport.h  |  167 -
 .../c_glib/transport/thrift_transport_factory.c |   44 -
 .../c_glib/transport/thrift_transport_factory.h |   71 -
 .../thrift/lib/c_glib/test/CMakeLists.txt       |  170 -
 .../thrift/lib/c_glib/test/ContainerTest.thrift |   35 -
 .../thrift/lib/c_glib/test/Makefile.am          |  282 -
 .../thrift/lib/c_glib/test/glib.suppress        |   64 -
 .../lib/c_glib/test/testapplicationexception.c  |  180 -
 .../thrift/lib/c_glib/test/testbinaryprotocol.c |  688 ---
 .../lib/c_glib/test/testbufferedtransport.c     |  287 -
 .../thrift/lib/c_glib/test/testcontainertest.c  |  530 --
 .../thrift/lib/c_glib/test/testdebugproto.c     |  938 ----
 .../lib/c_glib/test/testframedtransport.c       |  284 -
 .../thrift/lib/c_glib/test/testmemorybuffer.c   |   98 -
 .../lib/c_glib/test/testoptionalrequired.c      |  207 -
 .../thrift/lib/c_glib/test/testsimpleserver.c   |  123 -
 .../thrift/lib/c_glib/test/teststruct.c         |  112 -
 .../thrift/lib/c_glib/test/testthrifttest.c     |   31 -
 .../lib/c_glib/test/testthrifttestclient.cpp    |  627 ---
 .../lib/c_glib/test/testtransportsocket.c       |  323 --
 .../thrift/lib/c_glib/thrift_c_glib.pc.in       |   30 -
 depends/thirdparty/thrift/lib/cocoa/README.md   |   21 -
 .../thrift/lib/cocoa/coding_standards.md        |    1 -
 .../lib/cocoa/src/TApplicationException.h       |   49 -
 .../lib/cocoa/src/TApplicationException.m       |  146 -
 .../thrift/lib/cocoa/src/TBaseClient.h          |   30 -
 .../thrift/lib/cocoa/src/TBaseClient.m          |   46 -
 .../thrift/lib/cocoa/src/TException.h           |   34 -
 .../thrift/lib/cocoa/src/TException.m           |   65 -
 .../thrift/lib/cocoa/src/TObjective-C.h         |   72 -
 .../thrift/lib/cocoa/src/TProcessor.h           |   29 -
 .../thrift/lib/cocoa/src/TProcessorFactory.h    |   27 -
 .../lib/cocoa/src/TSharedProcessorFactory.h     |   27 -
 .../lib/cocoa/src/TSharedProcessorFactory.m     |   52 -
 .../thirdparty/thrift/lib/cocoa/src/Thrift.h    |   20 -
 .../thrift/lib/cocoa/src/protocol/TBase.h       |   41 -
 .../lib/cocoa/src/protocol/TBinaryProtocol.h    |   51 -
 .../lib/cocoa/src/protocol/TBinaryProtocol.m    |  530 --
 .../lib/cocoa/src/protocol/TCompactProtocol.h   |   36 -
 .../lib/cocoa/src/protocol/TCompactProtocol.m   |  687 ---
 .../cocoa/src/protocol/TMultiplexedProtocol.h   |   33 -
 .../cocoa/src/protocol/TMultiplexedProtocol.m   |   67 -
 .../thrift/lib/cocoa/src/protocol/TProtocol.h   |  148 -
 .../lib/cocoa/src/protocol/TProtocolDecorator.h |   30 -
 .../lib/cocoa/src/protocol/TProtocolDecorator.m |  274 -
 .../lib/cocoa/src/protocol/TProtocolException.h |   25 -
 .../lib/cocoa/src/protocol/TProtocolException.m |   23 -
 .../lib/cocoa/src/protocol/TProtocolFactory.h   |   29 -
 .../lib/cocoa/src/protocol/TProtocolUtil.h      |   29 -
 .../lib/cocoa/src/protocol/TProtocolUtil.m      |  104 -
 .../thrift/lib/cocoa/src/server/TSocketServer.h |   49 -
 .../thrift/lib/cocoa/src/server/TSocketServer.m |  197 -
 .../lib/cocoa/src/transport/TAsyncTransport.h   |   29 -
 .../lib/cocoa/src/transport/TFramedTransport.h  |   29 -
 .../lib/cocoa/src/transport/TFramedTransport.m  |  143 -
 .../lib/cocoa/src/transport/THTTPClient.h       |   42 -
 .../lib/cocoa/src/transport/THTTPClient.m       |  161 -
 .../lib/cocoa/src/transport/TMemoryBuffer.h     |   29 -
 .../lib/cocoa/src/transport/TMemoryBuffer.m     |   74 -
 .../src/transport/TNSFileHandleTransport.h      |   35 -
 .../src/transport/TNSFileHandleTransport.m      |   93 -
 .../cocoa/src/transport/TNSStreamTransport.h    |   40 -
 .../cocoa/src/transport/TNSStreamTransport.m    |   96 -
 .../lib/cocoa/src/transport/TSSLSocketClient.h  |   40 -
 .../lib/cocoa/src/transport/TSSLSocketClient.m  |  261 -
 .../cocoa/src/transport/TSSLSocketException.h   |   29 -
 .../cocoa/src/transport/TSSLSocketException.m   |   42 -
 .../lib/cocoa/src/transport/TSocketClient.h     |   36 -
 .../lib/cocoa/src/transport/TSocketClient.m     |   87 -
 .../thrift/lib/cocoa/src/transport/TTransport.h |   36 -
 .../cocoa/src/transport/TTransportException.h   |   30 -
 .../cocoa/src/transport/TTransportException.m   |   44 -
 .../thirdparty/thrift/lib/cpp/3rdparty.props    |   25 -
 .../thirdparty/thrift/lib/cpp/CMakeLists.txt    |  209 -
 depends/thirdparty/thrift/lib/cpp/Makefile.am   |  276 -
 depends/thirdparty/thrift/lib/cpp/README.md     |  274 -
 .../thrift/lib/cpp/coding_standards.md          |    4 -
 .../thirdparty/thrift/lib/cpp/libthrift.vcxproj |  359 --
 .../thrift/lib/cpp/libthrift.vcxproj.filters    |  277 -
 .../thrift/lib/cpp/libthriftnb.vcxproj          |  293 -
 .../thrift/lib/cpp/libthriftnb.vcxproj.filters  |   57 -
 .../cpp/src/thrift/TApplicationException.cpp    |   81 -
 .../lib/cpp/src/thrift/TApplicationException.h  |  115 -
 .../lib/cpp/src/thrift/TDispatchProcessor.h     |  141 -
 .../thrift/lib/cpp/src/thrift/TLogging.h        |  195 -
 .../thrift/lib/cpp/src/thrift/TOutput.cpp       |  126 -
 .../thrift/lib/cpp/src/thrift/TOutput.h         |   58 -
 .../thrift/lib/cpp/src/thrift/TProcessor.h      |  230 -
 .../thrift/lib/cpp/src/thrift/TToString.h       |   89 -
 .../thrift/lib/cpp/src/thrift/Thrift.h          |  136 -
 .../lib/cpp/src/thrift/VirtualProfiling.cpp     |  425 --
 .../src/thrift/async/TAsyncBufferProcessor.h    |   48 -
 .../lib/cpp/src/thrift/async/TAsyncChannel.cpp  |   37 -
 .../lib/cpp/src/thrift/async/TAsyncChannel.h    |   73 -
 .../src/thrift/async/TAsyncDispatchProcessor.h  |  151 -
 .../lib/cpp/src/thrift/async/TAsyncProcessor.h  |   95 -
 .../thrift/async/TAsyncProtocolProcessor.cpp    |   53 -
 .../src/thrift/async/TAsyncProtocolProcessor.h  |   55 -
 .../thrift/async/TConcurrentClientSyncInfo.cpp  |  242 -
 .../thrift/async/TConcurrentClientSyncInfo.h    |  127 -
 .../src/thrift/async/TEvhttpClientChannel.cpp   |  153 -
 .../cpp/src/thrift/async/TEvhttpClientChannel.h |   83 -
 .../lib/cpp/src/thrift/async/TEvhttpServer.cpp  |  159 -
 .../lib/cpp/src/thrift/async/TEvhttpServer.h    |   74 -
 .../cpp/src/thrift/concurrency/BoostMonitor.cpp |  214 -
 .../cpp/src/thrift/concurrency/BoostMutex.cpp   |   71 -
 .../thrift/concurrency/BoostThreadFactory.cpp   |  182 -
 .../src/thrift/concurrency/BoostThreadFactory.h |   77 -
 .../lib/cpp/src/thrift/concurrency/Exception.h  |   64 -
 .../cpp/src/thrift/concurrency/FunctionRunner.h |  118 -
 .../lib/cpp/src/thrift/concurrency/Monitor.cpp  |  222 -
 .../lib/cpp/src/thrift/concurrency/Monitor.h    |  129 -
 .../lib/cpp/src/thrift/concurrency/Mutex.cpp    |  374 --
 .../lib/cpp/src/thrift/concurrency/Mutex.h      |  180 -
 .../thrift/concurrency/PlatformThreadFactory.h  |   52 -
 .../thrift/concurrency/PosixThreadFactory.cpp   |  360 --
 .../src/thrift/concurrency/PosixThreadFactory.h |  131 -
 .../cpp/src/thrift/concurrency/StdMonitor.cpp   |  213 -
 .../lib/cpp/src/thrift/concurrency/StdMutex.cpp |   67 -
 .../src/thrift/concurrency/StdThreadFactory.cpp |  171 -
 .../src/thrift/concurrency/StdThreadFactory.h   |   74 -
 .../lib/cpp/src/thrift/concurrency/Thread.h     |  154 -
 .../src/thrift/concurrency/ThreadManager.cpp    |  561 --
 .../cpp/src/thrift/concurrency/ThreadManager.h  |  198 -
 .../cpp/src/thrift/concurrency/TimerManager.cpp |  306 --
 .../cpp/src/thrift/concurrency/TimerManager.h   |  126 -
 .../lib/cpp/src/thrift/concurrency/Util.cpp     |   44 -
 .../lib/cpp/src/thrift/concurrency/Util.h       |  151 -
 .../thrift/lib/cpp/src/thrift/cxxfunctional.h   |  128 -
 .../cpp/src/thrift/processor/PeekProcessor.cpp  |  132 -
 .../cpp/src/thrift/processor/PeekProcessor.h    |   83 -
 .../cpp/src/thrift/processor/StatsProcessor.h   |  242 -
 .../thrift/processor/TMultiplexedProcessor.h    |  201 -
 .../cpp/src/thrift/protocol/TBase64Utils.cpp    |  317 --
 .../lib/cpp/src/thrift/protocol/TBase64Utils.h  |   45 -
 .../cpp/src/thrift/protocol/TBinaryProtocol.h   |  253 -
 .../cpp/src/thrift/protocol/TBinaryProtocol.tcc |  452 --
 .../cpp/src/thrift/protocol/TCompactProtocol.h  |  265 -
 .../src/thrift/protocol/TCompactProtocol.tcc    |  824 ---
 .../cpp/src/thrift/protocol/TDebugProtocol.cpp  |  392 --
 .../cpp/src/thrift/protocol/TDebugProtocol.h    |  204 -
 .../cpp/src/thrift/protocol/TJSONProtocol.cpp   | 1048 ----
 .../lib/cpp/src/thrift/protocol/TJSONProtocol.h |  320 --
 .../thrift/protocol/TMultiplexedProtocol.cpp    |   40 -
 .../src/thrift/protocol/TMultiplexedProtocol.h  |   95 -
 .../lib/cpp/src/thrift/protocol/TProtocol.cpp   |   33 -
 .../lib/cpp/src/thrift/protocol/TProtocol.h     |  752 ---
 .../src/thrift/protocol/TProtocolDecorator.h    |  151 -
 .../src/thrift/protocol/TProtocolException.h    |  105 -
 .../lib/cpp/src/thrift/protocol/TProtocolTap.h  |  177 -
 .../cpp/src/thrift/protocol/TVirtualProtocol.h  |  513 --
 .../thrift/lib/cpp/src/thrift/qt/CMakeLists.txt |   27 -
 .../cpp/src/thrift/qt/TQIODeviceTransport.cpp   |  167 -
 .../lib/cpp/src/thrift/qt/TQIODeviceTransport.h |   68 -
 .../lib/cpp/src/thrift/qt/TQTcpServer.cpp       |  144 -
 .../thrift/lib/cpp/src/thrift/qt/TQTcpServer.h  |   79 -
 .../cpp/src/thrift/server/TConnectedClient.cpp  |  124 -
 .../cpp/src/thrift/server/TConnectedClient.h    |  110 -
 .../src/thrift/server/TNonblockingServer.cpp    | 1587 ------
 .../cpp/src/thrift/server/TNonblockingServer.h  |  872 ---
 .../lib/cpp/src/thrift/server/TServer.cpp       |   52 -
 .../thrift/lib/cpp/src/thrift/server/TServer.h  |  273 -
 .../cpp/src/thrift/server/TServerFramework.cpp  |  238 -
 .../cpp/src/thrift/server/TServerFramework.h    |  183 -
 .../lib/cpp/src/thrift/server/TSimpleServer.cpp |  107 -
 .../lib/cpp/src/thrift/server/TSimpleServer.h   |   77 -
 .../cpp/src/thrift/server/TThreadPoolServer.cpp |  133 -
 .../cpp/src/thrift/server/TThreadPoolServer.h   |  103 -
 .../cpp/src/thrift/server/TThreadedServer.cpp   |  120 -
 .../lib/cpp/src/thrift/server/TThreadedServer.h |   96 -
 .../thrift/lib/cpp/src/thrift/thrift-config.h   |   24 -
 .../cpp/src/thrift/transport/PlatformSocket.h   |  122 -
 .../src/thrift/transport/TBufferTransports.cpp  |  411 --
 .../src/thrift/transport/TBufferTransports.h    |  708 ---
 .../cpp/src/thrift/transport/TFDTransport.cpp   |   93 -
 .../lib/cpp/src/thrift/transport/TFDTransport.h |   77 -
 .../cpp/src/thrift/transport/TFileTransport.cpp | 1069 ----
 .../cpp/src/thrift/transport/TFileTransport.h   |  440 --
 .../cpp/src/thrift/transport/THttpClient.cpp    |  122 -
 .../lib/cpp/src/thrift/transport/THttpClient.h  |   50 -
 .../cpp/src/thrift/transport/THttpServer.cpp    |  164 -
 .../lib/cpp/src/thrift/transport/THttpServer.h  |   64 -
 .../cpp/src/thrift/transport/THttpTransport.cpp |  267 -
 .../cpp/src/thrift/transport/THttpTransport.h   |  104 -
 .../lib/cpp/src/thrift/transport/TPipe.cpp      |  399 --
 .../thrift/lib/cpp/src/thrift/transport/TPipe.h |  113 -
 .../cpp/src/thrift/transport/TPipeServer.cpp    |  452 --
 .../lib/cpp/src/thrift/transport/TPipeServer.h  |  103 -
 .../src/thrift/transport/TSSLServerSocket.cpp   |   55 -
 .../cpp/src/thrift/transport/TSSLServerSocket.h |   77 -
 .../lib/cpp/src/thrift/transport/TSSLSocket.cpp |  688 ---
 .../lib/cpp/src/thrift/transport/TSSLSocket.h   |  350 --
 .../cpp/src/thrift/transport/TServerSocket.cpp  |  654 ---
 .../cpp/src/thrift/transport/TServerSocket.h    |  158 -
 .../cpp/src/thrift/transport/TServerTransport.h |  105 -
 .../src/thrift/transport/TShortReadTransport.h  |   82 -
 .../thrift/transport/TSimpleFileTransport.cpp   |   67 -
 .../src/thrift/transport/TSimpleFileTransport.h |   42 -
 .../lib/cpp/src/thrift/transport/TSocket.cpp    |  920 ----
 .../lib/cpp/src/thrift/transport/TSocket.h      |  340 --
 .../cpp/src/thrift/transport/TSocketPool.cpp    |  254 -
 .../lib/cpp/src/thrift/transport/TSocketPool.h  |  195 -
 .../lib/cpp/src/thrift/transport/TTransport.h   |  271 -
 .../thrift/transport/TTransportException.cpp    |   61 -
 .../src/thrift/transport/TTransportException.h  |   90 -
 .../src/thrift/transport/TTransportUtils.cpp    |  181 -
 .../cpp/src/thrift/transport/TTransportUtils.h  |  310 --
 .../src/thrift/transport/TVirtualTransport.h    |  140 -
 .../cpp/src/thrift/transport/TZlibTransport.cpp |  393 --
 .../cpp/src/thrift/transport/TZlibTransport.h   |  240 -
 .../lib/cpp/src/thrift/windows/GetTimeOfDay.cpp |   96 -
 .../lib/cpp/src/thrift/windows/GetTimeOfDay.h   |   43 -
 .../lib/cpp/src/thrift/windows/Operators.h      |   40 -
 .../windows/OverlappedSubmissionThread.cpp      |  151 -
 .../thrift/windows/OverlappedSubmissionThread.h |  133 -
 .../lib/cpp/src/thrift/windows/SocketPair.cpp   |  100 -
 .../lib/cpp/src/thrift/windows/SocketPair.h     |   37 -
 .../thrift/lib/cpp/src/thrift/windows/Sync.h    |  104 -
 .../src/thrift/windows/TWinsockSingleton.cpp    |   71 -
 .../cpp/src/thrift/windows/TWinsockSingleton.h  |   84 -
 .../lib/cpp/src/thrift/windows/WinFcntl.cpp     |  100 -
 .../lib/cpp/src/thrift/windows/WinFcntl.h       |   56 -
 .../thrift/lib/cpp/src/thrift/windows/config.h  |   99 -
 .../thrift/lib/cpp/test/AllProtocolTests.cpp    |   47 -
 .../thrift/lib/cpp/test/AllProtocolTests.tcc    |  225 -
 .../thrift/lib/cpp/test/Base64Test.cpp          |   70 -
 .../thrift/lib/cpp/test/Benchmark.cpp           |  243 -
 .../thrift/lib/cpp/test/CMakeLists.txt          |  358 --
 .../thrift/lib/cpp/test/DebugProtoTest.cpp      |  309 --
 .../lib/cpp/test/DebugProtoTest_extras.cpp      |   35 -
 .../thirdparty/thrift/lib/cpp/test/EnumTest.cpp |   59 -
 .../thrift/lib/cpp/test/GenericHelpers.h        |  110 -
 .../thrift/lib/cpp/test/JSONProtoTest.cpp       |  271 -
 .../thirdparty/thrift/lib/cpp/test/Makefile.am  |  371 --
 .../lib/cpp/test/OpenSSLManualInitTest.cpp      |   79 -
 .../lib/cpp/test/OptionalRequiredTest.cpp       |  386 --
 .../thrift/lib/cpp/test/RWMutexStarveTest.cpp   |  159 -
 .../thrift/lib/cpp/test/RecursiveTest.cpp       |   91 -
 .../thrift/lib/cpp/test/SecurityTest.cpp        |  267 -
 .../thrift/lib/cpp/test/SpecializationTest.cpp  |  103 -
 .../thrift/lib/cpp/test/TBufferBaseTest.cpp     |  645 ---
 .../thrift/lib/cpp/test/TFDTransportTest.cpp    |   50 -
 .../thrift/lib/cpp/test/TFileTransportTest.cpp  |  376 --
 .../thrift/lib/cpp/test/TMemoryBufferTest.cpp   |  119 -
 .../lib/cpp/test/TNonblockingServerTest.cpp     |  173 -
 .../thrift/lib/cpp/test/TPipeInterruptTest.cpp  |   89 -
 .../thrift/lib/cpp/test/TPipedTransportTest.cpp |   51 -
 .../lib/cpp/test/TServerIntegrationTest.cpp     |  433 --
 .../thrift/lib/cpp/test/TServerSocketTest.cpp   |   67 -
 .../lib/cpp/test/TServerTransportTest.cpp       |   57 -
 .../lib/cpp/test/TSocketInterruptTest.cpp       |  142 -
 .../thrift/lib/cpp/test/TTransportCheckThrow.h  |   44 -
 .../thrift/lib/cpp/test/TestPortFixture.h       |   33 -
 .../thrift/lib/cpp/test/ThriftTest_extras.cpp   |   33 -
 .../thrift/lib/cpp/test/ToStringTest.cpp        |  137 -
 .../thrift/lib/cpp/test/TransportTest.cpp       | 1041 ----
 .../thrift/lib/cpp/test/TypedefTest.cpp         |   28 -
 .../thrift/lib/cpp/test/UnitTestMain.cpp        |   21 -
 .../thirdparty/thrift/lib/cpp/test/ZlibTest.cpp |  435 --
 .../thrift/lib/cpp/test/concurrency/Tests.cpp   |  156 -
 .../cpp/test/concurrency/ThreadFactoryTests.h   |  348 --
 .../cpp/test/concurrency/ThreadManagerTests.h   |  392 --
 .../cpp/test/concurrency/TimerManagerTests.h    |  153 -
 .../thrift/lib/cpp/test/link/LinkTest.cpp       |   22 -
 .../lib/cpp/test/link/TemplatedService1.cpp     |   26 -
 .../lib/cpp/test/link/TemplatedService2.cpp     |   26 -
 .../thrift/lib/cpp/test/processor/EventLog.cpp  |  132 -
 .../thrift/lib/cpp/test/processor/EventLog.h    |   95 -
 .../thrift/lib/cpp/test/processor/Handlers.h    |  338 --
 .../lib/cpp/test/processor/ProcessorTest.cpp    |  916 ----
 .../lib/cpp/test/processor/ServerThread.cpp     |  150 -
 .../lib/cpp/test/processor/ServerThread.h       |  136 -
 .../thrift/lib/cpp/test/processor/proc.thrift   |   22 -
 .../thrift/lib/cpp/test/qt/CMakeLists.txt       |   32 -
 .../thrift/lib/cpp/test/qt/TQTcpServerTest.cpp  |   89 -
 .../thirdparty/thrift/lib/cpp/thrift-nb.pc.in   |   30 -
 .../thirdparty/thrift/lib/cpp/thrift-qt.pc.in   |   30 -
 .../thirdparty/thrift/lib/cpp/thrift-qt5.pc.in  |   30 -
 .../thirdparty/thrift/lib/cpp/thrift-z.pc.in    |   30 -
 depends/thirdparty/thrift/lib/cpp/thrift.pc.in  |   29 -
 depends/thirdparty/thrift/lib/cpp/thrift.sln    |   61 -
 .../thirdparty/thrift/lib/csharp/Makefile.am    |  108 -
 depends/thirdparty/thrift/lib/csharp/README.md  |   26 -
 .../Properties/AssemblyInfo.cs                  |   60 -
 .../lib/csharp/ThriftMSBuildTask/ThriftBuild.cs |  246 -
 .../ThriftMSBuildTask/ThriftMSBuildTask.csproj  |  118 -
 .../thrift/lib/csharp/coding_standards.md       |    6 -
 .../lib/csharp/src/Collections/TCollections.cs  |   94 -
 .../lib/csharp/src/Collections/THashSet.cs      |  160 -
 .../csharp/src/Properties/AssemblyInfo.WP7.cs   |   55 -
 .../lib/csharp/src/Properties/AssemblyInfo.cs   |   55 -
 .../lib/csharp/src/Protocol/TAbstractBase.cs    |   29 -
 .../thrift/lib/csharp/src/Protocol/TBase.cs     |   29 -
 .../lib/csharp/src/Protocol/TBase64Utils.cs     |  100 -
 .../lib/csharp/src/Protocol/TBinaryProtocol.cs  |  395 --
 .../lib/csharp/src/Protocol/TCompactProtocol.cs |  851 ---
 .../thrift/lib/csharp/src/Protocol/TField.cs    |   62 -
 .../lib/csharp/src/Protocol/TJSONProtocol.cs    | 1090 ----
 .../thrift/lib/csharp/src/Protocol/TList.cs     |   54 -
 .../thrift/lib/csharp/src/Protocol/TMap.cs      |   62 -
 .../thrift/lib/csharp/src/Protocol/TMessage.cs  |   62 -
 .../lib/csharp/src/Protocol/TMessageType.cs     |   31 -
 .../src/Protocol/TMultiplexedProcessor.cs       |  180 -
 .../csharp/src/Protocol/TMultiplexedProtocol.cs |  105 -
 .../thrift/lib/csharp/src/Protocol/TProtocol.cs |  140 -
 .../csharp/src/Protocol/TProtocolDecorator.cs   |  262 -
 .../csharp/src/Protocol/TProtocolException.cs   |   67 -
 .../lib/csharp/src/Protocol/TProtocolFactory.cs |   33 -
 .../lib/csharp/src/Protocol/TProtocolUtil.cs    |  107 -
 .../thrift/lib/csharp/src/Protocol/TSet.cs      |   59 -
 .../thrift/lib/csharp/src/Protocol/TStruct.cs   |   46 -
 .../thrift/lib/csharp/src/Protocol/TType.cs     |   44 -
 .../thrift/lib/csharp/src/Server/TServer.cs     |  127 -
 .../csharp/src/Server/TServerEventHandler.cs    |   50 -
 .../lib/csharp/src/Server/TSimpleServer.cs      |  164 -
 .../lib/csharp/src/Server/TThreadPoolServer.cs  |  212 -
 .../lib/csharp/src/Server/TThreadedServer.cs    |  257 -
 .../lib/csharp/src/TApplicationException.cs     |  141 -
 .../thrift/lib/csharp/src/TException.cs         |   40 -
 .../thrift/lib/csharp/src/TProcessor.cs         |   33 -
 .../thrift/lib/csharp/src/Thrift.WP7.csproj     |  118 -
 .../thrift/lib/csharp/src/Thrift.csproj         |  150 -
 .../thirdparty/thrift/lib/csharp/src/Thrift.sln |   38 -
 .../csharp/src/Transport/TBufferedTransport.cs  |  126 -
 .../csharp/src/Transport/TFramedTransport.cs    |  166 -
 .../lib/csharp/src/Transport/THttpClient.cs     |  430 --
 .../lib/csharp/src/Transport/THttpHandler.cs    |  102 -
 .../lib/csharp/src/Transport/TMemoryBuffer.cs   |   99 -
 .../src/Transport/TNamedPipeClientTransport.cs  |   95 -
 .../src/Transport/TNamedPipeServerTransport.cs  |  276 -
 .../lib/csharp/src/Transport/TServerSocket.cs   |  176 -
 .../csharp/src/Transport/TServerTransport.cs    |   43 -
 .../csharp/src/Transport/TSilverlightSocket.cs  |  393 --
 .../thrift/lib/csharp/src/Transport/TSocket.cs  |  241 -
 .../csharp/src/Transport/TStreamTransport.cs    |  128 -
 .../csharp/src/Transport/TTLSServerSocket.cs    |  212 -
 .../lib/csharp/src/Transport/TTLSSocket.cs      |  350 --
 .../lib/csharp/src/Transport/TTransport.cs      |  133 -
 .../csharp/src/Transport/TTransportException.cs |   69 -
 .../csharp/src/Transport/TTransportFactory.cs   |   42 -
 .../thrift/lib/csharp/test/JSON/JSONTest.csproj |   85 -
 .../thrift/lib/csharp/test/JSON/Program.cs      |   82 -
 .../csharp/test/JSON/Properties/AssemblyInfo.cs |   55 -
 .../thrift/lib/csharp/test/JSON/app.config      |   21 -
 .../Multiplex/Client/Multiplex.Test.Client.cs   |   87 -
 .../Multiplex/Client/MultiplexClient.csproj     |  148 -
 .../Multiplex/Client/Properties/AssemblyInfo.cs |   55 -
 .../test/Multiplex/Multiplex.Test.Common.cs     |   40 -
 .../Multiplex/Server/Multiplex.Test.Server.cs   |  131 -
 .../Multiplex/Server/MultiplexServer.csproj     |  148 -
 .../Multiplex/Server/Properties/AssemblyInfo.cs |   55 -
 .../lib/csharp/test/Multiplex/maketest.sh       |   34 -
 .../lib/csharp/test/ThriftTest/Makefile.am      |   36 -
 .../lib/csharp/test/ThriftTest/Program.cs       |   62 -
 .../test/ThriftTest/Properties/AssemblyInfo.cs  |   55 -
 .../lib/csharp/test/ThriftTest/TestClient.cs    |  557 --
 .../lib/csharp/test/ThriftTest/TestServer.cs    |  481 --
 .../csharp/test/ThriftTest/ThriftTest.csproj    |  141 -
 .../lib/csharp/test/ThriftTest/maketest.sh      |   30 -
 depends/thirdparty/thrift/lib/d/Makefile.am     |  192 -
 depends/thirdparty/thrift/lib/d/README.md       |   58 -
 .../thirdparty/thrift/lib/d/coding_standards.md |    1 -
 .../thrift/lib/d/src/thrift/async/base.d        |  228 -
 .../thrift/lib/d/src/thrift/async/libevent.d    |  461 --
 .../thrift/lib/d/src/thrift/async/socket.d      |  357 --
 .../thrift/lib/d/src/thrift/async/ssl.d         |  292 -
 .../thirdparty/thrift/lib/d/src/thrift/base.d   |  123 -
 .../lib/d/src/thrift/codegen/async_client.d     |  255 -
 .../d/src/thrift/codegen/async_client_pool.d    |  906 ---
 .../thrift/lib/d/src/thrift/codegen/base.d      | 1020 ----
 .../thrift/lib/d/src/thrift/codegen/client.d    |  486 --
 .../lib/d/src/thrift/codegen/client_pool.d      |  262 -
 .../thrift/lib/d/src/thrift/codegen/idlgen.d    |  767 ---
 .../thrift/lib/d/src/thrift/codegen/processor.d |  497 --
 .../thirdparty/thrift/lib/d/src/thrift/index.d  |   33 -
 .../lib/d/src/thrift/internal/algorithm.d       |   55 -
 .../thrift/lib/d/src/thrift/internal/codegen.d  |  451 --
 .../thrift/lib/d/src/thrift/internal/ctfe.d     |   98 -
 .../thrift/lib/d/src/thrift/internal/endian.d   |   75 -
 .../lib/d/src/thrift/internal/resource_pool.d   |  431 --
 .../thrift/lib/d/src/thrift/internal/socket.d   |   96 -
 .../thrift/lib/d/src/thrift/internal/ssl.d      |  240 -
 .../thrift/lib/d/src/thrift/internal/ssl_bio.d  |  190 -
 .../lib/d/src/thrift/internal/test/protocol.d   |  183 -
 .../lib/d/src/thrift/internal/test/server.d     |  110 -
 .../thrift/lib/d/src/thrift/internal/traits.d   |   33 -
 .../thrift/lib/d/src/thrift/protocol/base.d     |  449 --
 .../thrift/lib/d/src/thrift/protocol/binary.d   |  414 --
 .../thrift/lib/d/src/thrift/protocol/compact.d  |  698 ---
 .../thrift/lib/d/src/thrift/protocol/json.d     |  982 ----
 .../lib/d/src/thrift/protocol/processor.d       |  145 -
 .../thrift/lib/d/src/thrift/server/base.d       |  147 -
 .../lib/d/src/thrift/server/nonblocking.d       | 1397 -----
 .../thrift/lib/d/src/thrift/server/simple.d     |  181 -
 .../thrift/lib/d/src/thrift/server/taskpool.d   |  302 -
 .../thrift/lib/d/src/thrift/server/threaded.d   |  215 -
 .../lib/d/src/thrift/server/transport/base.d    |  133 -
 .../lib/d/src/thrift/server/transport/socket.d  |  380 --
 .../lib/d/src/thrift/server/transport/ssl.d     |   88 -
 .../thrift/lib/d/src/thrift/transport/base.d    |  370 --
 .../lib/d/src/thrift/transport/buffered.d       |  215 -
 .../thrift/lib/d/src/thrift/transport/file.d    | 1100 ----
 .../thrift/lib/d/src/thrift/transport/framed.d  |  334 --
 .../thrift/lib/d/src/thrift/transport/http.d    |  459 --
 .../thrift/lib/d/src/thrift/transport/memory.d  |  233 -
 .../thrift/lib/d/src/thrift/transport/piped.d   |  219 -
 .../thrift/lib/d/src/thrift/transport/range.d   |  147 -
 .../thrift/lib/d/src/thrift/transport/socket.d  |  453 --
 .../thrift/lib/d/src/thrift/transport/ssl.d     |  680 ---
 .../thrift/lib/d/src/thrift/transport/zlib.d    |  497 --
 .../thrift/lib/d/src/thrift/util/awaitable.d    |  212 -
 .../thrift/lib/d/src/thrift/util/cancellation.d |  105 -
 .../thrift/lib/d/src/thrift/util/future.d       |  549 --
 .../thrift/lib/d/src/thrift/util/hashset.d      |  146 -
 .../thirdparty/thrift/lib/d/test/Makefile.am    |  124 -
 .../thirdparty/thrift/lib/d/test/async_test.d   |  396 --
 .../thrift/lib/d/test/async_test_runner.sh      |    6 -
 .../thrift/lib/d/test/client_pool_test.d        |  416 --
 .../thrift/lib/d/test/openssl.test.cnf          |   14 -
 .../thrift/lib/d/test/serialization_benchmark.d |   70 -
 .../thrift/lib/d/test/stress_test_server.d      |   81 -
 .../thirdparty/thrift/lib/d/test/test_utils.d   |   96 -
 .../thrift/lib/d/test/thrift_test_client.d      |  374 --
 .../thrift/lib/d/test/thrift_test_common.d      |   92 -
 .../thrift/lib/d/test/thrift_test_runner.sh     |   65 -
 .../thrift/lib/d/test/thrift_test_server.d      |  269 -
 .../thrift/lib/d/test/transport_test.d          |  803 ---
 depends/thirdparty/thrift/lib/delphi/README.md  |   30 -
 .../thrift/lib/delphi/coding_standards.md       |    1 -
 .../lib/delphi/src/Thrift.Collections.pas       |  619 ---
 .../thrift/lib/delphi/src/Thrift.Console.pas    |  133 -
 .../delphi/src/Thrift.Processor.Multiplex.pas   |  216 -
 .../lib/delphi/src/Thrift.Protocol.Compact.pas  | 1105 ----
 .../lib/delphi/src/Thrift.Protocol.JSON.pas     | 1217 -----
 .../delphi/src/Thrift.Protocol.Multiplex.pas    |  107 -
 .../thrift/lib/delphi/src/Thrift.Protocol.pas   | 1683 ------
 .../thrift/lib/delphi/src/Thrift.Serializer.pas |  224 -
 .../thrift/lib/delphi/src/Thrift.Server.pas     |  418 --
 .../thrift/lib/delphi/src/Thrift.Stream.pas     |  300 -
 .../lib/delphi/src/Thrift.Transport.Pipes.pas   |  977 ----
 .../thrift/lib/delphi/src/Thrift.Transport.pas  | 1397 -----
 .../lib/delphi/src/Thrift.TypeRegistry.pas      |   95 -
 .../thrift/lib/delphi/src/Thrift.Utils.pas      |  189 -
 .../thirdparty/thrift/lib/delphi/src/Thrift.pas |  183 -
 .../thrift/lib/delphi/test/TestClient.pas       | 1310 -----
 .../thrift/lib/delphi/test/TestConstants.pas    |  162 -
 .../thrift/lib/delphi/test/TestServer.pas       |  755 ---
 .../thrift/lib/delphi/test/TestServerEvents.pas |  174 -
 .../thrift/lib/delphi/test/client.dpr           |   70 -
 .../thrift/lib/delphi/test/codegen/README.md    |   28 -
 .../delphi/test/codegen/ReservedKeywords.thrift |   55 -
 .../codegen/run-Pascal-Codegen-Tests.bat.tmpl   |  173 -
 .../thrift/lib/delphi/test/maketest.sh          |   23 -
 .../test/multiplexed/Multiplex.Client.Main.pas  |  131 -
 .../test/multiplexed/Multiplex.Server.Main.pas  |  201 -
 .../test/multiplexed/Multiplex.Test.Client.dpr  |   66 -
 .../test/multiplexed/Multiplex.Test.Common.pas  |   35 -
 .../test/multiplexed/Multiplex.Test.Server.dpr  |   66 -
 .../test/serializer/TestSerializer.Data.pas     |  349 --
 .../delphi/test/serializer/TestSerializer.dpr   |  229 -
 .../thrift/lib/delphi/test/server.dpr           |   70 -
 .../thrift/lib/delphi/test/skip/README.md       |   11 -
 .../test/skip/idl/skiptest_version_1.thrift     |   45 -
 .../test/skip/idl/skiptest_version_2.thrift     |   69 -
 .../lib/delphi/test/skip/skiptest_version1.dpr  |  200 -
 .../lib/delphi/test/skip/skiptest_version2.dpr  |  227 -
 .../test/typeregistry/TestTypeRegistry.dpr      |   89 -
 depends/thirdparty/thrift/lib/erl/Makefile.am   |   74 -
 depends/thirdparty/thrift/lib/erl/README.md     |   51 -
 .../thrift/lib/erl/coding_standards.md          |    1 -
 .../thrift/lib/erl/include/thrift_constants.hrl |   58 -
 .../thrift/lib/erl/include/thrift_protocol.hrl  |   66 -
 .../erl/include/thrift_protocol_behaviour.hrl   |   37 -
 .../erl/include/thrift_transport_behaviour.hrl  |   31 -
 depends/thirdparty/thrift/lib/erl/rebar         |  Bin 101083 -> 0 bytes
 depends/thirdparty/thrift/lib/erl/rebar.config  |    1 -
 .../thrift/lib/erl/src/thrift.app.src           |   73 -
 .../lib/erl/src/thrift_base64_transport.erl     |   69 -
 .../lib/erl/src/thrift_binary_protocol.erl      |  347 --
 .../lib/erl/src/thrift_buffered_transport.erl   |   77 -
 .../thrift/lib/erl/src/thrift_client.erl        |  150 -
 .../thrift/lib/erl/src/thrift_client_util.erl   |   65 -
 .../lib/erl/src/thrift_disk_log_transport.erl   |  123 -
 .../lib/erl/src/thrift_file_transport.erl       |   89 -
 .../lib/erl/src/thrift_framed_transport.erl     |  103 -
 .../lib/erl/src/thrift_http_transport.erl       |  116 -
 .../thrift/lib/erl/src/thrift_json_parser.erl   |  419 --
 .../thrift/lib/erl/src/thrift_json_protocol.erl |  566 --
 .../thrift/lib/erl/src/thrift_memory_buffer.erl |   62 -
 .../thrift/lib/erl/src/thrift_processor.erl     |  207 -
 .../thrift/lib/erl/src/thrift_protocol.erl      |  407 --
 .../lib/erl/src/thrift_reconnecting_client.erl  |  243 -
 .../thrift/lib/erl/src/thrift_server.erl        |  183 -
 .../thrift/lib/erl/src/thrift_service.erl       |   25 -
 .../thrift/lib/erl/src/thrift_socket_server.erl |  255 -
 .../lib/erl/src/thrift_socket_transport.erl     |  124 -
 .../thrift/lib/erl/src/thrift_transport.erl     |   78 -
 .../lib/erl/src/thrift_transport_state_test.erl |  117 -
 .../thrift/lib/erl/test/Thrift1151.thrift       |    3 -
 .../thrift/lib/erl/test/Thrift1475.thrift       |   34 -
 .../thrift/lib/erl/test/Thrift3214.thrift       |   23 -
 .../thrift/lib/erl/test/stress_server.erl       |   64 -
 .../thrift/lib/erl/test/test_client.erl         |  133 -
 .../thrift/lib/erl/test/test_disklog.erl        |   99 -
 .../thrift/lib/erl/test/test_membuffer.erl      |  115 -
 .../thrift/lib/erl/test/test_thrift_1151.erl    |   34 -
 .../thrift/lib/erl/test/test_thrift_3214.erl    |   60 -
 .../thrift/lib/erl/test/test_thrift_server.erl  |  208 -
 depends/thirdparty/thrift/lib/go/Makefile.am    |   42 -
 depends/thirdparty/thrift/lib/go/README.md      |   66 -
 .../thrift/lib/go/coding_standards.md           |    1 -
 .../thrift/lib/go/test/BinaryKeyTest.thrift     |   24 -
 .../thrift/lib/go/test/DontExportRWTest.thrift  |   27 -
 .../thrift/lib/go/test/ErrorTest.thrift         |   35 -
 .../thrift/lib/go/test/GoTagTest.thrift         |   24 -
 .../lib/go/test/IgnoreInitialismsTest.thrift    |   26 -
 .../thrift/lib/go/test/IncludesTest.thrift      |   67 -
 .../thrift/lib/go/test/InitialismsTest.thrift   |   24 -
 .../thirdparty/thrift/lib/go/test/Makefile.am   |  103 -
 .../lib/go/test/MultiplexedProtocolTest.thrift  |   27 -
 .../thrift/lib/go/test/NamesTest.thrift         |   32 -
 .../thrift/lib/go/test/NamespacedTest.thrift    |   40 -
 .../thrift/lib/go/test/OnewayTest.thrift        |   24 -
 .../lib/go/test/OptionalFieldsTest.thrift       |   50 -
 .../lib/go/test/RefAnnotationFieldsTest.thrift  |   58 -
 .../thrift/lib/go/test/ServicesTest.thrift      |  111 -
 .../thrift/lib/go/test/TypedefFieldTest.thrift  |   39 -
 .../lib/go/test/UnionDefaultValueTest.thrift    |   34 -
 .../go/test/dontexportrwtest/compile_test.go    |   38 -
 .../thrift/lib/go/test/tests/binary_key_test.go |   31 -
 .../lib/go/test/tests/client_error_test.go      |  680 ---
 .../lib/go/test/tests/encoding_json_test.go     |   79 -
 .../thrift/lib/go/test/tests/gotag_test.go      |   53 -
 .../lib/go/test/tests/ignoreinitialisms_test.go |   51 -
 .../lib/go/test/tests/initialisms_test.go       |   43 -
 .../go/test/tests/multiplexed_protocol_test.go  |  157 -
 .../thrift/lib/go/test/tests/names_test.go      |   35 -
 .../thrift/lib/go/test/tests/one_way_test.go    |   89 -
 .../lib/go/test/tests/optional_fields_test.go   |  280 -
 .../thrift/lib/go/test/tests/protocol_mock.go   |  511 --
 .../thrift/lib/go/test/tests/protocols_test.go  |   94 -
 .../lib/go/test/tests/required_fields_test.go   |   95 -
 .../lib/go/test/tests/struct_args_rets_test.go  |   36 -
 .../lib/go/test/tests/thrifttest_driver.go      |  236 -
 .../lib/go/test/tests/thrifttest_handler.go     |  209 -
 .../go/test/tests/union_default_value_test.go   |   33 -
 .../lib/go/thrift/application_exception.go      |  142 -
 .../lib/go/thrift/application_exception_test.go |   41 -
 .../thrift/lib/go/thrift/binary_protocol.go     |  491 --
 .../lib/go/thrift/binary_protocol_test.go       |   28 -
 .../thrift/lib/go/thrift/buffered_transport.go  |   75 -
 .../lib/go/thrift/buffered_transport_test.go    |   29 -
 .../thrift/lib/go/thrift/compact_protocol.go    |  815 ---
 .../lib/go/thrift/compact_protocol_test.go      |   53 -
 .../thrift/lib/go/thrift/debug_protocol.go      |  269 -
 .../thrift/lib/go/thrift/deserializer.go        |   58 -
 .../thrift/lib/go/thrift/exception.go           |   44 -
 .../thrift/lib/go/thrift/exception_test.go      |   69 -
 .../thirdparty/thrift/lib/go/thrift/field.go    |   79 -
 .../thrift/lib/go/thrift/framed_transport.go    |  167 -
 .../lib/go/thrift/framed_transport_test.go      |   29 -
 .../thrift/lib/go/thrift/http_client.go         |  212 -
 .../thrift/lib/go/thrift/http_client_test.go    |   50 -
 .../thrift/lib/go/thrift/iostream_transport.go  |  214 -
 .../lib/go/thrift/iostream_transport_test.go    |   52 -
 .../thrift/lib/go/thrift/json_protocol.go       |  580 --
 .../thrift/lib/go/thrift/json_protocol_test.go  |  649 ---
 .../lib/go/thrift/lowlevel_benchmarks_test.go   |  396 --
 .../thrift/lib/go/thrift/memory_buffer.go       |   79 -
 .../thrift/lib/go/thrift/memory_buffer_test.go  |   29 -
 .../thrift/lib/go/thrift/messagetype.go         |   31 -
 .../lib/go/thrift/multiplexed_protocol.go       |  169 -
 .../thirdparty/thrift/lib/go/thrift/numeric.go  |  164 -
 .../thrift/lib/go/thrift/pointerize.go          |   50 -
 .../thrift/lib/go/thrift/processor.go           |   30 -
 .../thrift/lib/go/thrift/processor_factory.go   |   58 -
 .../thirdparty/thrift/lib/go/thrift/protocol.go |  175 -
 .../thrift/lib/go/thrift/protocol_exception.go  |   78 -
 .../thrift/lib/go/thrift/protocol_factory.go    |   25 -
 .../thrift/lib/go/thrift/protocol_test.go       |  479 --
 .../thrift/lib/go/thrift/rich_transport.go      |   69 -
 .../thrift/lib/go/thrift/rich_transport_test.go |   85 -
 .../thrift/lib/go/thrift/serializer.go          |   75 -
 .../thrift/lib/go/thrift/serializer_test.go     |  169 -
 .../lib/go/thrift/serializer_types_test.go      |  633 ---
 .../thirdparty/thrift/lib/go/thrift/server.go   |   35 -
 .../thrift/lib/go/thrift/server_socket.go       |  121 -
 .../thrift/lib/go/thrift/server_test.go         |   28 -
 .../thrift/lib/go/thrift/server_transport.go    |   34 -
 .../lib/go/thrift/simple_json_protocol.go       | 1320 -----
 .../lib/go/thrift/simple_json_protocol_test.go  |  715 ---
 .../thrift/lib/go/thrift/simple_server.go       |  187 -
 .../thirdparty/thrift/lib/go/thrift/socket.go   |  166 -
 .../thrift/lib/go/thrift/ssl_server_socket.go   |  109 -
 .../thrift/lib/go/thrift/ssl_socket.go          |  171 -
 .../thrift/lib/go/thrift/transport.go           |   68 -
 .../thrift/lib/go/thrift/transport_exception.go |   90 -
 .../lib/go/thrift/transport_exception_test.go   |   60 -
 .../thrift/lib/go/thrift/transport_factory.go   |   39 -
 .../thrift/lib/go/thrift/transport_test.go      |  176 -
 depends/thirdparty/thrift/lib/go/thrift/type.go |   68 -
 .../thrift/lib/go/thrift/zlib_transport.go      |  117 -
 .../thrift/lib/go/thrift/zlib_transport_test.go |   33 -
 depends/thirdparty/thrift/lib/haxe/README.md    |  118 -
 .../thrift/lib/haxe/coding_standards.md         |    1 -
 depends/thirdparty/thrift/lib/haxe/haxelib.json |   11 -
 .../org/apache/thrift/AbstractMethodError.hx    |   40 -
 .../haxe/src/org/apache/thrift/ArgumentError.hx |   29 -
 .../lib/haxe/src/org/apache/thrift/Limits.hx    |   44 -
 .../org/apache/thrift/TApplicationException.hx  |  104 -
 .../lib/haxe/src/org/apache/thrift/TBase.hx     |   73 -
 .../haxe/src/org/apache/thrift/TException.hx    |   36 -
 .../org/apache/thrift/TFieldRequirementType.hx  |   31 -
 .../haxe/src/org/apache/thrift/TProcessor.hx    |   30 -
 .../org/apache/thrift/helper/BitConverter.hx    |  170 -
 .../src/org/apache/thrift/helper/Int64Map.hx    |  295 -
 .../haxe/src/org/apache/thrift/helper/IntSet.hx |   96 -
 .../src/org/apache/thrift/helper/ObjectSet.hx   |   96 -
 .../src/org/apache/thrift/helper/StringSet.hx   |   96 -
 .../haxe/src/org/apache/thrift/helper/ZigZag.hx |  128 -
 .../apache/thrift/meta_data/FieldMetaData.hx    |   56 -
 .../thrift/meta_data/FieldValueMetaData.hx      |   43 -
 .../org/apache/thrift/meta_data/ListMetaData.hx |   31 -
 .../org/apache/thrift/meta_data/MapMetaData.hx  |   33 -
 .../org/apache/thrift/meta_data/SetMetaData.hx  |   30 -
 .../apache/thrift/meta_data/StructMetaData.hx   |   30 -
 .../apache/thrift/protocol/TBinaryProtocol.hx   |  301 -
 .../thrift/protocol/TBinaryProtocolFactory.hx   |   45 -
 .../apache/thrift/protocol/TCompactProtocol.hx  |  718 ---
 .../thrift/protocol/TCompactProtocolFactory.hx  |   40 -
 .../org/apache/thrift/protocol/TCompactTypes.hx |   41 -
 .../src/org/apache/thrift/protocol/TField.hx    |   43 -
 .../org/apache/thrift/protocol/TJSONProtocol.hx | 1073 ----
 .../thrift/protocol/TJSONProtocolFactory.hx     |   40 -
 .../src/org/apache/thrift/protocol/TList.hx     |   32 -
 .../haxe/src/org/apache/thrift/protocol/TMap.hx |   34 -
 .../src/org/apache/thrift/protocol/TMessage.hx  |   41 -
 .../org/apache/thrift/protocol/TMessageType.hx  |   28 -
 .../thrift/protocol/TMultiplexedProcessor.hx    |  177 -
 .../thrift/protocol/TMultiplexedProtocol.hx     |   97 -
 .../src/org/apache/thrift/protocol/TProtocol.hx |   85 -
 .../thrift/protocol/TProtocolDecorator.hx       |  218 -
 .../thrift/protocol/TProtocolException.hx       |   41 -
 .../apache/thrift/protocol/TProtocolFactory.hx  |   26 -
 .../org/apache/thrift/protocol/TProtocolUtil.hx |  110 -
 .../apache/thrift/protocol/TRecursionTracker.hx |   48 -
 .../haxe/src/org/apache/thrift/protocol/TSet.hx |   32 -
 .../src/org/apache/thrift/protocol/TStruct.hx   |   30 -
 .../src/org/apache/thrift/protocol/TType.hx     |   37 -
 .../src/org/apache/thrift/server/TServer.hx     |  111 -
 .../apache/thrift/server/TServerEventHandler.hx |   41 -
 .../org/apache/thrift/server/TSimpleServer.hx   |  127 -
 .../thrift/transport/TBufferedTransport.hx      |  155 -
 .../transport/TBufferedTransportFactory.hx      |   37 -
 .../org/apache/thrift/transport/TFileStream.hx  |  101 -
 .../apache/thrift/transport/TFramedTransport.hx |  158 -
 .../thrift/transport/TFramedTransportFactory.hx |   37 -
 .../thrift/transport/TFullDuplexHttpClient.hx   |  253 -
 .../org/apache/thrift/transport/THttpClient.hx  |  103 -
 .../apache/thrift/transport/TServerSocket.hx    |  132 -
 .../apache/thrift/transport/TServerTransport.hx |   43 -
 .../src/org/apache/thrift/transport/TSocket.hx  |  304 --
 .../src/org/apache/thrift/transport/TStream.hx  |   32 -
 .../apache/thrift/transport/TStreamTransport.hx |  103 -
 .../org/apache/thrift/transport/TTransport.hx   |  133 -
 .../thrift/transport/TTransportException.hx     |   39 -
 .../thrift/transport/TTransportFactory.hx       |   44 -
 .../thrift/lib/haxe/test/HaxeTests.hxproj       |   69 -
 .../thirdparty/thrift/lib/haxe/test/Makefile.am |   77 -
 .../thirdparty/thrift/lib/haxe/test/cpp.hxml    |   41 -
 .../thirdparty/thrift/lib/haxe/test/csharp.hxml |   38 -
 .../thirdparty/thrift/lib/haxe/test/flash.hxml  |   38 -
 .../thirdparty/thrift/lib/haxe/test/java.hxml   |   38 -
 .../thrift/lib/haxe/test/javascript.hxml        |   44 -
 .../thrift/lib/haxe/test/make_all.bat           |   70 -
 .../thirdparty/thrift/lib/haxe/test/make_all.sh |   43 -
 .../thirdparty/thrift/lib/haxe/test/neko.hxml   |   38 -
 .../thirdparty/thrift/lib/haxe/test/php.hxml    |   38 -
 .../thrift/lib/haxe/test/project.hide           |   67 -
 .../thirdparty/thrift/lib/haxe/test/python.hxml |   38 -
 .../thirdparty/thrift/lib/haxe/test/src/Main.hx |   93 -
 .../thrift/lib/haxe/test/src/MultiplexTest.hx   |  224 -
 .../thrift/lib/haxe/test/src/StreamTest.hx      |   95 -
 .../thrift/lib/haxe/test/src/TestBase.hx        |   46 -
 depends/thirdparty/thrift/lib/hs/LICENSE        |  202 -
 depends/thirdparty/thrift/lib/hs/Makefile.am    |   44 -
 depends/thirdparty/thrift/lib/hs/README.md      |   99 -
 depends/thirdparty/thrift/lib/hs/Setup.lhs      |   21 -
 depends/thirdparty/thrift/lib/hs/TODO           |    2 -
 depends/thirdparty/thrift/lib/hs/Thrift.cabal   |   72 -
 .../thrift/lib/hs/coding_standards.md           |    1 -
 depends/thirdparty/thrift/lib/hs/src/Thrift.hs  |  114 -
 .../thrift/lib/hs/src/Thrift/Arbitraries.hs     |   61 -
 .../thrift/lib/hs/src/Thrift/Protocol.hs        |  144 -
 .../thrift/lib/hs/src/Thrift/Protocol/Binary.hs |  185 -
 .../lib/hs/src/Thrift/Protocol/Compact.hs       |  293 -
 .../thrift/lib/hs/src/Thrift/Protocol/JSON.hs   |  325 --
 .../thrift/lib/hs/src/Thrift/Server.hs          |   66 -
 .../thrift/lib/hs/src/Thrift/Transport.hs       |   65 -
 .../thrift/lib/hs/src/Thrift/Transport/Empty.hs |   36 -
 .../lib/hs/src/Thrift/Transport/Framed.hs       |   99 -
 .../lib/hs/src/Thrift/Transport/Handle.hs       |   68 -
 .../lib/hs/src/Thrift/Transport/HttpClient.hs   |  101 -
 .../lib/hs/src/Thrift/Transport/IOBuffer.hs     |   69 -
 .../thrift/lib/hs/src/Thrift/Types.hs           |  132 -
 .../thirdparty/thrift/lib/java/CMakeLists.txt   |   48 -
 depends/thirdparty/thrift/lib/java/Makefile.am  |   49 -
 depends/thirdparty/thrift/lib/java/README.md    |   53 -
 .../thirdparty/thrift/lib/java/build.properties |   31 -
 depends/thirdparty/thrift/lib/java/build.xml    |  414 --
 .../thrift/lib/java/coding_standards.md         |    1 -
 .../org/apache/thrift/AsyncProcessFunction.java |   56 -
 .../src/org/apache/thrift/EncodingUtils.java    |  148 -
 .../lib/java/src/org/apache/thrift/Option.java  |  121 -
 .../src/org/apache/thrift/ProcessFunction.java  |   68 -
 .../java/src/org/apache/thrift/ShortStack.java  |   82 -
 .../apache/thrift/TApplicationException.java    |  127 -
 .../src/org/apache/thrift/TAsyncProcessor.java  |   35 -
 .../lib/java/src/org/apache/thrift/TBase.java   |   81 -
 .../org/apache/thrift/TBaseAsyncProcessor.java  |   92 -
 .../java/src/org/apache/thrift/TBaseHelper.java |  327 --
 .../src/org/apache/thrift/TBaseProcessor.java   |   42 -
 .../apache/thrift/TByteArrayOutputStream.java   |   56 -
 .../src/org/apache/thrift/TDeserializer.java    |  358 --
 .../lib/java/src/org/apache/thrift/TEnum.java   |   24 -
 .../java/src/org/apache/thrift/TEnumHelper.java |   57 -
 .../java/src/org/apache/thrift/TException.java  |   45 -
 .../src/org/apache/thrift/TFieldIdEnum.java     |   34 -
 .../apache/thrift/TFieldRequirementType.java    |   30 -
 .../apache/thrift/TMultiplexedProcessor.java    |  143 -
 .../thrift/TNonblockingMultiFetchClient.java    |  399 --
 .../thrift/TNonblockingMultiFetchStats.java     |   80 -
 .../java/src/org/apache/thrift/TProcessor.java  |   32 -
 .../org/apache/thrift/TProcessorFactory.java    |   43 -
 .../java/src/org/apache/thrift/TSerializer.java |  110 -
 .../src/org/apache/thrift/TServiceClient.java   |   89 -
 .../apache/thrift/TServiceClientFactory.java    |   45 -
 .../lib/java/src/org/apache/thrift/TUnion.java  |  279 -
 .../thrift/async/AsyncMethodCallback.java       |   39 -
 .../org/apache/thrift/async/TAsyncClient.java   |  102 -
 .../thrift/async/TAsyncClientFactory.java       |   25 -
 .../thrift/async/TAsyncClientManager.java       |  201 -
 .../apache/thrift/async/TAsyncMethodCall.java   |  272 -
 .../apache/thrift/meta_data/EnumMetaData.java   |   31 -
 .../apache/thrift/meta_data/FieldMetaData.java  |   70 -
 .../thrift/meta_data/FieldValueMetaData.java    |   72 -
 .../apache/thrift/meta_data/ListMetaData.java   |   29 -
 .../apache/thrift/meta_data/MapMetaData.java    |   31 -
 .../apache/thrift/meta_data/SetMetaData.java    |   29 -
 .../apache/thrift/meta_data/StructMetaData.java |   31 -
 .../apache/thrift/protocol/TBase64Utils.java    |  127 -
 .../apache/thrift/protocol/TBinaryProtocol.java |  431 --
 .../thrift/protocol/TCompactProtocol.java       |  906 ---
 .../src/org/apache/thrift/protocol/TField.java  |   66 -
 .../apache/thrift/protocol/TJSONProtocol.java   |  957 ----
 .../src/org/apache/thrift/protocol/TList.java   |   38 -
 .../src/org/apache/thrift/protocol/TMap.java    |   40 -
 .../org/apache/thrift/protocol/TMessage.java    |   76 -
 .../apache/thrift/protocol/TMessageType.java    |   31 -
 .../thrift/protocol/TMultiplexedProtocol.java   |   91 -
 .../org/apache/thrift/protocol/TProtocol.java   |  162 -
 .../thrift/protocol/TProtocolDecorator.java     |  213 -
 .../thrift/protocol/TProtocolException.java     |   82 -
 .../thrift/protocol/TProtocolFactory.java       |   31 -
 .../apache/thrift/protocol/TProtocolUtil.java   |  220 -
 .../src/org/apache/thrift/protocol/TSet.java    |   42 -
 .../thrift/protocol/TSimpleJSONProtocol.java    |  438 --
 .../src/org/apache/thrift/protocol/TStruct.java |   36 -
 .../apache/thrift/protocol/TTupleProtocol.java  |   98 -
 .../src/org/apache/thrift/protocol/TType.java   |   40 -
 .../src/org/apache/thrift/scheme/IScheme.java   |   29 -
 .../org/apache/thrift/scheme/SchemeFactory.java |   25 -
 .../apache/thrift/scheme/StandardScheme.java    |   25 -
 .../org/apache/thrift/scheme/TupleScheme.java   |   25 -
 .../server/AbstractNonblockingServer.java       |  612 ---
 .../org/apache/thrift/server/Invocation.java    |   20 -
 .../org/apache/thrift/server/ServerContext.java |   26 -
 .../thrift/server/TExtensibleServlet.java       |  171 -
 .../org/apache/thrift/server/THsHaServer.java   |  179 -
 .../thrift/server/TNonblockingServer.java       |  248 -
 .../src/org/apache/thrift/server/TServer.java   |  177 -
 .../thrift/server/TServerEventHandler.java      |   59 -
 .../src/org/apache/thrift/server/TServlet.java  |  119 -
 .../org/apache/thrift/server/TSimpleServer.java |  117 -
 .../apache/thrift/server/TThreadPoolServer.java |  314 --
 .../thrift/server/TThreadedSelectorServer.java  |  668 ---
 .../thrift/transport/AutoExpandingBuffer.java   |   52 -
 .../AutoExpandingBufferReadTransport.java       |   84 -
 .../AutoExpandingBufferWriteTransport.java      |   66 -
 .../thrift/transport/TFastFramedTransport.java  |  188 -
 .../apache/thrift/transport/TFileProcessor.java |  120 -
 .../apache/thrift/transport/TFileTransport.java |  623 ---
 .../thrift/transport/TFramedTransport.java      |  175 -
 .../apache/thrift/transport/THttpClient.java    |  359 --
 .../thrift/transport/TIOStreamTransport.java    |  164 -
 .../apache/thrift/transport/TMemoryBuffer.java  |  102 -
 .../thrift/transport/TMemoryInputTransport.java |   96 -
 .../transport/TNonblockingServerSocket.java     |  163 -
 .../transport/TNonblockingServerTransport.java  |   31 -
 .../thrift/transport/TNonblockingSocket.java    |  211 -
 .../thrift/transport/TNonblockingTransport.java |   47 -
 .../thrift/transport/TSSLTransportFactory.java  |  385 --
 .../thrift/transport/TSaslClientTransport.java  |  107 -
 .../thrift/transport/TSaslServerTransport.java  |  229 -
 .../apache/thrift/transport/TSaslTransport.java |  578 --
 .../transport/TSaslTransportException.java      |   43 -
 .../apache/thrift/transport/TSeekableFile.java  |   33 -
 .../apache/thrift/transport/TServerSocket.java  |  158 -
 .../thrift/transport/TServerTransport.java      |   80 -
 .../thrift/transport/TSimpleFileTransport.java  |  216 -
 .../org/apache/thrift/transport/TSocket.java    |  248 -
 .../apache/thrift/transport/TStandardFile.java  |   60 -
 .../org/apache/thrift/transport/TTransport.java |  163 -
 .../thrift/transport/TTransportException.java   |   80 -
 .../thrift/transport/TTransportFactory.java     |   41 -
 .../apache/thrift/transport/TZlibTransport.java |  148 -
 .../thirdparty/thrift/lib/java/test/.keystore   |  Bin 2429 -> 0 bytes
 .../thirdparty/thrift/lib/java/test/.truststore |  Bin 1149 -> 0 bytes
 .../thrift/lib/java/test/log4j.properties       |    6 -
 .../java/test/org/apache/thrift/Fixtures.java   |  339 --
 .../test/org/apache/thrift/TestFullCamel.java   |   59 -
 .../test/org/apache/thrift/TestOptionType.java  |   66 -
 .../test/org/apache/thrift/TestOptionals.java   |   88 -
 .../java/test/org/apache/thrift/TestReuse.java  |   60 -
 .../test/org/apache/thrift/TestShortStack.java  |  116 -
 .../java/test/org/apache/thrift/TestStruct.java |  368 --
 .../test/org/apache/thrift/TestTBaseHelper.java |  209 -
 .../org/apache/thrift/TestTDeserializer.java    |  126 -
 .../test/org/apache/thrift/TestTEnumHelper.java |   41 -
 .../java/test/org/apache/thrift/TestTUnion.java |  268 -
 .../apache/thrift/async/TestTAsyncClient.java   |   28 -
 .../thrift/async/TestTAsyncClientManager.java   |  326 --
 .../thrift/protocol/BenchmarkProtocols.java     |   88 -
 .../thrift/protocol/ProtocolTestBase.java       |  422 --
 .../thrift/protocol/TestTCompactProtocol.java   |   56 -
 .../thrift/protocol/TestTJSONProtocol.java      |   31 -
 .../thrift/protocol/TestTProtocolUtil.java      |   97 -
 .../protocol/TestTSimpleJSONProtocol.java       |   82 -
 .../thrift/protocol/TestTTupleProtocol.java     |   27 -
 .../thrift/scheme/TestStandardScheme.java       |   40 -
 .../apache/thrift/server/ServerTestBase.java    |  706 ---
 .../apache/thrift/server/TestAsyncServer.java   |   28 -
 .../apache/thrift/server/TestHsHaServer.java    |   30 -
 .../thrift/server/TestNonblockingServer.java    |  123 -
 .../server/TestThreadedSelectorServer.java      |   30 -
 .../org/apache/thrift/test/EqualityTest.java    |  663 ---
 .../org/apache/thrift/test/JavaBeansTest.java   |  112 -
 .../test/org/apache/thrift/test/ReadStruct.java |   62 -
 .../thrift/test/SerializationBenchmark.java     |   80 -
 .../test/org/apache/thrift/test/TestClient.java |  653 ---
 .../thrift/test/TestNonblockingServer.java      |   76 -
 .../test/org/apache/thrift/test/TestServer.java |  276 -
 .../org/apache/thrift/test/WriteStruct.java     |   48 -
 .../thrift/transport/ReadCountingTransport.java |   47 -
 .../transport/TestAutoExpandingBuffer.java      |   37 -
 .../TestAutoExpandingBufferReadTransport.java   |   50 -
 .../TestAutoExpandingBufferWriteTransport.java  |   44 -
 .../transport/TestTFastFramedTransport.java     |   26 -
 .../thrift/transport/TestTFramedTransport.java  |  148 -
 .../transport/TestTMemoryInputTransport.java    |   85 -
 .../transport/TestTSSLTransportFactory.java     |   88 -
 .../TestTSSLTransportFactoryCustomClient1.java  |   35 -
 .../TestTSSLTransportFactoryCustomClient2.java  |   34 -
 .../thrift/transport/TestTSaslTransports.java   |  478 --
 .../transport/TestTSimpleFileTransport.java     |   74 -
 .../thrift/transport/TestTZlibTransport.java    |  120 -
 .../transport/WriteCountingTransport.java       |   54 -
 .../thrift/lib/javame/coding_standards.md       |    1 -
 .../apache/thrift/TApplicationException.java    |  132 -
 .../lib/javame/src/org/apache/thrift/TBase.java |   46 -
 .../src/org/apache/thrift/TBaseHelper.java      |  209 -
 .../apache/thrift/TByteArrayOutputStream.java   |   41 -
 .../src/org/apache/thrift/TDeserializer.java    |   95 -
 .../lib/javame/src/org/apache/thrift/TEnum.java |   24 -
 .../src/org/apache/thrift/TException.java       |   45 -
 .../apache/thrift/TFieldRequirementType.java    |   48 -
 .../src/org/apache/thrift/TProcessor.java       |   32 -
 .../org/apache/thrift/TProcessorFactory.java    |   39 -
 .../src/org/apache/thrift/TSerializer.java      |  110 -
 .../src/org/apache/thrift/TServiceClient.java   |   39 -
 .../apache/thrift/meta_data/FieldMetaData.java  |   88 -
 .../thrift/meta_data/FieldValueMetaData.java    |   61 -
 .../apache/thrift/meta_data/ListMetaData.java   |   49 -
 .../apache/thrift/meta_data/MapMetaData.java    |   51 -
 .../apache/thrift/meta_data/SetMetaData.java    |   47 -
 .../apache/thrift/meta_data/StructMetaData.java |   51 -
 .../apache/thrift/protocol/TBase64Utils.java    |  127 -
 .../apache/thrift/protocol/TBinaryProtocol.java |  329 --
 .../src/org/apache/thrift/protocol/TField.java  |   38 -
 .../apache/thrift/protocol/TJSONProtocol.java   |  888 ---
 .../src/org/apache/thrift/protocol/TList.java   |   36 -
 .../src/org/apache/thrift/protocol/TMap.java    |   38 -
 .../org/apache/thrift/protocol/TMessage.java    |   38 -
 .../apache/thrift/protocol/TMessageType.java    |   30 -
 .../org/apache/thrift/protocol/TProtocol.java   |  169 -
 .../thrift/protocol/TProtocolException.java     |   81 -
 .../thrift/protocol/TProtocolFactory.java       |   30 -
 .../apache/thrift/protocol/TProtocolUtil.java   |  158 -
 .../src/org/apache/thrift/protocol/TSet.java    |   36 -
 .../src/org/apache/thrift/protocol/TStruct.java |   34 -
 .../src/org/apache/thrift/protocol/TType.java   |   40 -
 .../thrift/transport/TFramedTransport.java      |  122 -
 .../apache/thrift/transport/THttpClient.java    |  163 -
 .../thrift/transport/TIOStreamTransport.java    |  153 -
 .../apache/thrift/transport/TMemoryBuffer.java  |   97 -
 .../org/apache/thrift/transport/TTransport.java |  121 -
 .../thrift/transport/TTransportException.java   |   80 -
 .../thrift/transport/TTransportFactory.java     |   41 -
 depends/thirdparty/thrift/lib/js/Gruntfile.js   |  172 -
 depends/thirdparty/thrift/lib/js/README.md      |  147 -
 .../thrift/lib/js/coding_standards.md           |    1 -
 depends/thirdparty/thrift/lib/js/package.json   |   14 -
 depends/thirdparty/thrift/lib/js/src/thrift.js  | 1507 -----
 .../thirdparty/thrift/lib/js/test/Makefile.am   |   29 -
 depends/thirdparty/thrift/lib/js/test/README.md |   68 -
 depends/thirdparty/thrift/lib/js/test/build.xml |  273 -
 .../thrift/lib/js/test/deep-constructor.test.js |  195 -
 .../thrift/lib/js/test/jsTestDriver.conf        |   17 -
 .../thrift/lib/js/test/phantomjs-qunit.js       |   91 -
 .../thrift/lib/js/test/server_http.js           |   49 -
 .../thrift/lib/js/test/server_https.js          |   57 -
 .../thrift/lib/js/test/src/test/Httpd.java      |  323 --
 .../thirdparty/thrift/lib/js/test/test-async.js |  348 --
 .../lib/js/test/test-deep-constructor.html      |   49 -
 .../thirdparty/thrift/lib/js/test/test-jq.js    |  158 -
 .../thrift/lib/js/test/test-nojq.html           |   52 -
 .../thirdparty/thrift/lib/js/test/test-nojq.js  |   49 -
 depends/thirdparty/thrift/lib/js/test/test.html |   59 -
 depends/thirdparty/thrift/lib/js/test/test.js   |  409 --
 .../thrift/lib/js/test/test_handler.js          |  199 -
 .../thirdparty/thrift/lib/js/test/testws.html   |   62 -
 depends/thirdparty/thrift/lib/lua/Makefile.am   |   67 -
 .../thrift/lib/lua/TBinaryProtocol.lua          |  264 -
 .../thrift/lib/lua/TBufferedTransport.lua       |   91 -
 .../thrift/lib/lua/TFramedTransport.lua         |  118 -
 .../thirdparty/thrift/lib/lua/TMemoryBuffer.lua |   91 -
 depends/thirdparty/thrift/lib/lua/TProtocol.lua |  162 -
 depends/thirdparty/thrift/lib/lua/TServer.lua   |  139 -
 depends/thirdparty/thrift/lib/lua/TSocket.lua   |  132 -
 .../thirdparty/thrift/lib/lua/TTransport.lua    |   93 -
 depends/thirdparty/thrift/lib/lua/Thrift.lua    |  281 -
 .../thrift/lib/lua/coding_standards.md          |    1 -
 .../thrift/lib/lua/src/longnumberutils.c        |   47 -
 .../thirdparty/thrift/lib/lua/src/luabitwise.c  |   83 -
 .../thirdparty/thrift/lib/lua/src/luabpack.c    |  162 -
 .../thrift/lib/lua/src/lualongnumber.c          |  228 -
 .../thirdparty/thrift/lib/lua/src/luasocket.c   |  380 --
 depends/thirdparty/thrift/lib/lua/src/socket.h  |   78 -
 depends/thirdparty/thrift/lib/lua/src/usocket.c |  362 --
 .../thirdparty/thrift/lib/nodejs/Makefile.am    |   43 -
 depends/thirdparty/thrift/lib/nodejs/README.md  |   65 -
 .../thrift/lib/nodejs/coding_standards.md       |    1 -
 .../thrift/lib/nodejs/examples/README.md        |   40 -
 .../thrift/lib/nodejs/examples/client.js        |   49 -
 .../nodejs/examples/client_multitransport.js    |   58 -
 .../thrift/lib/nodejs/examples/hello.html       |   65 -
 .../thrift/lib/nodejs/examples/hello.js         |   63 -
 .../thrift/lib/nodejs/examples/hello.thrift     |   27 -
 .../thrift/lib/nodejs/examples/httpClient.js    |   23 -
 .../thrift/lib/nodejs/examples/httpServer.js    |   31 -
 .../thrift/lib/nodejs/examples/httpServer.py    |   19 -
 .../thrift/lib/nodejs/examples/parse.js         |   46 -
 .../thrift/lib/nodejs/examples/server.js        |   39 -
 .../thrift/lib/nodejs/examples/server_http.js   |   53 -
 .../nodejs/examples/server_multitransport.js    |   46 -
 .../thrift/lib/nodejs/examples/user.thrift      |   27 -
 .../thrift/lib/nodejs/lib/thrift/binary.js      |  168 -
 .../lib/nodejs/lib/thrift/binary_protocol.js    |  356 --
 .../thrift/lib/nodejs/lib/thrift/browser.js     |   34 -
 .../lib/nodejs/lib/thrift/buffered_transport.js |  175 -
 .../lib/nodejs/lib/thrift/compact_protocol.js   |  904 ---
 .../thrift/lib/nodejs/lib/thrift/connection.js  |  368 --
 .../lib/nodejs/lib/thrift/create_client.js      |   54 -
 .../lib/nodejs/lib/thrift/framed_transport.js   |  182 -
 .../lib/nodejs/lib/thrift/http_connection.js    |  238 -
 .../thrift/lib/nodejs/lib/thrift/index.js       |   67 -
 .../lib/thrift/input_buffer_underrun_error.js   |   30 -
 .../lib/nodejs/lib/thrift/json_protocol.js      |  705 ---
 .../thrift/lib/nodejs/lib/thrift/log.js         |   26 -
 .../nodejs/lib/thrift/multiplexed_processor.js  |   63 -
 .../nodejs/lib/thrift/multiplexed_protocol.js   |   73 -
 .../thrift/lib/nodejs/lib/thrift/protocol.js    |   22 -
 .../thrift/lib/nodejs/lib/thrift/server.js      |  107 -
 .../thrift/lib/nodejs/lib/thrift/thrift.js      |  232 -
 .../thrift/lib/nodejs/lib/thrift/transport.js   |   22 -
 .../thrift/lib/nodejs/lib/thrift/web_server.js  |  564 --
 .../lib/nodejs/lib/thrift/ws_connection.js      |  286 -
 .../lib/nodejs/lib/thrift/ws_transport.js       |  204 -
 .../lib/nodejs/lib/thrift/xhr_connection.js     |  280 -
 .../thrift/lib/nodejs/test/binary.test.js       |  137 -
 .../thrift/lib/nodejs/test/browser_client.js    |   27 -
 .../thrift/lib/nodejs/test/certificates.README  |    7 -
 .../thirdparty/thrift/lib/nodejs/test/client.js |  129 -
 .../lib/nodejs/test/deep-constructor.test.js    |  249 -
 .../thrift/lib/nodejs/test/exceptions.js        |   55 -
 .../thrift/lib/nodejs/test/helpers.js           |   13 -
 .../thrift/lib/nodejs/test/server.crt           |   25 -
 .../thirdparty/thrift/lib/nodejs/test/server.js |  101 -
 .../thrift/lib/nodejs/test/server.key           |   28 -
 .../thrift/lib/nodejs/test/test-cases.js        |  141 -
 .../thrift/lib/nodejs/test/testAll.sh           |  107 -
 .../thrift/lib/nodejs/test/test_driver.js       |  283 -
 .../thrift/lib/nodejs/test/test_handler.js      |  238 -
 .../thirdparty/thrift/lib/ocaml/OCamlMakefile   | 1231 -----
 .../thrift/lib/ocaml/README-OCamlMakefile       |  643 ---
 depends/thirdparty/thrift/lib/ocaml/README.md   |  119 -
 depends/thirdparty/thrift/lib/ocaml/TODO        |    5 -
 depends/thirdparty/thrift/lib/ocaml/_oasis      |   19 -
 .../thrift/lib/ocaml/coding_standards.md        |    1 -
 .../thrift/lib/ocaml/src/TBinaryProtocol.ml     |  171 -
 .../thrift/lib/ocaml/src/TChannelTransport.ml   |   39 -
 .../thrift/lib/ocaml/src/TFramedTransport.ml    |   93 -
 .../thirdparty/thrift/lib/ocaml/src/TServer.ml  |   42 -
 .../thrift/lib/ocaml/src/TServerSocket.ml       |   41 -
 .../thrift/lib/ocaml/src/TSimpleServer.ml       |   40 -
 .../thirdparty/thrift/lib/ocaml/src/TSocket.ml  |   59 -
 .../thrift/lib/ocaml/src/TThreadedServer.ml     |   45 -
 .../thirdparty/thrift/lib/ocaml/src/Thrift.ml   |  383 --
 depends/thirdparty/thrift/lib/perl/Makefile.PL  |   29 -
 depends/thirdparty/thrift/lib/perl/Makefile.am  |   66 -
 depends/thirdparty/thrift/lib/perl/README.md    |   45 -
 .../thrift/lib/perl/coding_standards.md         |    1 -
 .../thirdparty/thrift/lib/perl/lib/Thrift.pm    |  182 -
 .../lib/perl/lib/Thrift/BinaryProtocol.pm       |  511 --
 .../lib/perl/lib/Thrift/BufferedTransport.pm    |  136 -
 .../lib/perl/lib/Thrift/FramedTransport.pm      |  193 -
 .../thrift/lib/perl/lib/Thrift/HttpClient.pm    |  200 -
 .../thrift/lib/perl/lib/Thrift/MemoryBuffer.pm  |  146 -
 .../thrift/lib/perl/lib/Thrift/MessageType.pm   |   32 -
 .../lib/perl/lib/Thrift/MultiplexedProcessor.pm |  121 -
 .../lib/perl/lib/Thrift/MultiplexedProtocol.pm  |   67 -
 .../thrift/lib/perl/lib/Thrift/Protocol.pm      |  544 --
 .../lib/perl/lib/Thrift/ProtocolDecorator.pm    |  360 --
 .../lib/perl/lib/Thrift/SSLServerSocket.pm      |   68 -
 .../thrift/lib/perl/lib/Thrift/SSLSocket.pm     |   89 -
 .../thrift/lib/perl/lib/Thrift/Server.pm        |  313 --
 .../thrift/lib/perl/lib/Thrift/ServerSocket.pm  |  117 -
 .../thrift/lib/perl/lib/Thrift/Socket.pm        |  317 --
 .../thrift/lib/perl/lib/Thrift/Transport.pm     |  177 -
 depends/thirdparty/thrift/lib/perl/test.pl      |   25 -
 .../thirdparty/thrift/lib/perl/test/Makefile.am |   42 -
 .../thrift/lib/perl/test/memory_buffer.t        |   53 -
 .../thirdparty/thrift/lib/perl/test/multiplex.t |  203 -
 .../thirdparty/thrift/lib/perl/test/processor.t |  104 -
 depends/thirdparty/thrift/lib/php/Makefile.am   |  134 -
 .../thirdparty/thrift/lib/php/README.apache.md  |   74 -
 depends/thirdparty/thrift/lib/php/README.md     |   53 -
 .../thrift/lib/php/coding_standards.md          |    1 -
 .../thrift/lib/php/lib/Thrift/Base/TBase.php    |  380 --
 .../Thrift/ClassLoader/ThriftClassLoader.php    |  210 -
 .../Thrift/Exception/TApplicationException.php  |   76 -
 .../lib/php/lib/Thrift/Exception/TException.php |  383 --
 .../lib/Thrift/Exception/TProtocolException.php |   50 -
 .../Thrift/Exception/TTransportException.php    |   40 -
 .../Thrift/Factory/TBinaryProtocolFactory.php   |   45 -
 .../Thrift/Factory/TCompactProtocolFactory.php  |   40 -
 .../lib/Thrift/Factory/TJSONProtocolFactory.php |   40 -
 .../php/lib/Thrift/Factory/TProtocolFactory.php |   36 -
 .../lib/Thrift/Factory/TStringFuncFactory.php   |   66 -
 .../lib/Thrift/Factory/TTransportFactory.php    |   18 -
 .../lib/Thrift/Protocol/JSON/BaseContext.php    |   39 -
 .../lib/Thrift/Protocol/JSON/ListContext.php    |   54 -
 .../Thrift/Protocol/JSON/LookaheadReader.php    |   57 -
 .../lib/Thrift/Protocol/JSON/PairContext.php    |   64 -
 .../php/lib/Thrift/Protocol/TBinaryProtocol.php |  453 --
 .../Protocol/TBinaryProtocolAccelerated.php     |   65 -
 .../lib/Thrift/Protocol/TCompactProtocol.php    |  753 ---
 .../php/lib/Thrift/Protocol/TJSONProtocol.php   |  769 ---
 .../Thrift/Protocol/TMultiplexedProtocol.php    |   85 -
 .../lib/php/lib/Thrift/Protocol/TProtocol.php   |  352 --
 .../lib/Thrift/Protocol/TProtocolDecorator.php  |  284 -
 .../lib/Thrift/Serializer/TBinarySerializer.php |   84 -
 .../php/lib/Thrift/Server/TForkingServer.php    |  120 -
 .../lib/php/lib/Thrift/Server/TServer.php       |  100 -
 .../lib/php/lib/Thrift/Server/TServerSocket.php |  102 -
 .../php/lib/Thrift/Server/TServerTransport.php  |   56 -
 .../lib/php/lib/Thrift/Server/TSimpleServer.php |   58 -
 .../lib/php/lib/Thrift/StringFunc/Core.php      |   40 -
 .../lib/php/lib/Thrift/StringFunc/Mbstring.php  |   46 -
 .../php/lib/Thrift/StringFunc/TStringFunc.php   |   28 -
 .../php/lib/Thrift/TMultiplexedProcessor.php    |  143 -
 .../lib/Thrift/Transport/TBufferedTransport.php |  181 -
 .../php/lib/Thrift/Transport/TCurlClient.php    |  231 -
 .../lib/Thrift/Transport/TFramedTransport.php   |  193 -
 .../php/lib/Thrift/Transport/THttpClient.php    |  229 -
 .../php/lib/Thrift/Transport/TMemoryBuffer.php  |   95 -
 .../php/lib/Thrift/Transport/TNullTransport.php |   51 -
 .../lib/php/lib/Thrift/Transport/TPhpStream.php |  123 -
 .../lib/php/lib/Thrift/Transport/TSocket.php    |  337 --
 .../php/lib/Thrift/Transport/TSocketPool.php    |  300 -
 .../lib/php/lib/Thrift/Transport/TTransport.php |   95 -
 .../lib/php/lib/Thrift/Type/TConstant.php       |   50 -
 .../lib/php/lib/Thrift/Type/TMessageType.php    |   34 -
 .../thrift/lib/php/lib/Thrift/Type/TType.php    |   47 -
 .../thrift/lib/php/src/TStringUtils.php         |   90 -
 .../thirdparty/thrift/lib/php/src/Thrift.php    |  821 ---
 .../thirdparty/thrift/lib/php/src/autoload.php  |   51 -
 .../thirdparty/thrift/lib/php/test/Makefile.am  |   60 -
 .../lib/php/test/Test/Thrift/Fixtures.php       |  191 -
 .../Thrift/JsonSerialize/JsonSerializeTest.php  |  103 -
 .../Thrift/Protocol/TestBinarySerializer.php    |   64 -
 .../Test/Thrift/Protocol/TestTJSONProtocol.php  |  564 --
 .../lib/php/test/Test/Thrift/TestValidators.php |  156 -
 .../thrift/lib/php/test/TestValidators.thrift   |   31 -
 .../thrift/lib/php/thrift_protocol.ini          |    1 -
 depends/thirdparty/thrift/lib/py/CMakeLists.txt |   26 -
 depends/thirdparty/thrift/lib/py/Makefile.am    |   44 -
 depends/thirdparty/thrift/lib/py/README.md      |   35 -
 .../thrift/lib/py/coding_standards.md           |    7 -
 .../thrift/lib/py/compat/win32/stdint.h         |  247 -
 depends/thirdparty/thrift/lib/py/setup.cfg      |    4 -
 depends/thirdparty/thrift/lib/py/setup.py       |  110 -
 .../thrift/lib/py/src/TMultiplexedProcessor.py  |   58 -
 depends/thirdparty/thrift/lib/py/src/TSCons.py  |   35 -
 .../thrift/lib/py/src/TSerialization.py         |   38 -
 .../thirdparty/thrift/lib/py/src/TTornado.py    |  182 -
 depends/thirdparty/thrift/lib/py/src/Thrift.py  |  170 -
 .../thirdparty/thrift/lib/py/src/__init__.py    |   20 -
 .../thrift/lib/py/src/protocol/TBase.py         |   81 -
 .../lib/py/src/protocol/TBinaryProtocol.py      |  260 -
 .../lib/py/src/protocol/TCompactProtocol.py     |  405 --
 .../thrift/lib/py/src/protocol/TJSONProtocol.py |  569 --
 .../lib/py/src/protocol/TMultiplexedProtocol.py |   39 -
 .../thrift/lib/py/src/protocol/TProtocol.py     |  421 --
 .../lib/py/src/protocol/TProtocolDecorator.py   |   42 -
 .../thrift/lib/py/src/protocol/__init__.py      |   20 -
 .../thrift/lib/py/src/protocol/fastbinary.c     | 1234 -----
 .../thrift/lib/py/src/server/THttpServer.py     |   87 -
 .../lib/py/src/server/TNonblockingServer.py     |  348 --
 .../lib/py/src/server/TProcessPoolServer.py     |  122 -
 .../thrift/lib/py/src/server/TServer.py         |  279 -
 .../thrift/lib/py/src/server/__init__.py        |   20 -
 .../thrift/lib/py/src/transport/THttpClient.py  |  151 -
 .../thrift/lib/py/src/transport/TSSLSocket.py   |  227 -
 .../thrift/lib/py/src/transport/TSocket.py      |  180 -
 .../thrift/lib/py/src/transport/TTransport.py   |  446 --
 .../thrift/lib/py/src/transport/TTwisted.py     |  324 --
 .../lib/py/src/transport/TZlibTransport.py      |  248 -
 .../thrift/lib/py/src/transport/__init__.py     |   20 -
 depends/thirdparty/thrift/lib/rb/Gemfile        |    4 -
 depends/thirdparty/thrift/lib/rb/Makefile.am    |   51 -
 depends/thirdparty/thrift/lib/rb/README.md      |   43 -
 depends/thirdparty/thrift/lib/rb/Rakefile       |  119 -
 .../thrift/lib/rb/benchmark/Benchmark.thrift    |   24 -
 .../thrift/lib/rb/benchmark/benchmark.rb        |  271 -
 .../thrift/lib/rb/benchmark/client.rb           |   74 -
 .../thrift/lib/rb/benchmark/server.rb           |   82 -
 .../thrift/lib/rb/benchmark/thin_server.rb      |   44 -
 .../thrift/lib/rb/coding_standards.md           |    1 -
 depends/thirdparty/thrift/lib/rb/lib/thrift.rb  |   68 -
 .../thrift/lib/rb/lib/thrift/bytes.rb           |  131 -
 .../thrift/lib/rb/lib/thrift/client.rb          |   71 -
 .../thrift/lib/rb/lib/thrift/core_ext.rb        |   23 -
 .../thrift/lib/rb/lib/thrift/core_ext/fixnum.rb |   29 -
 .../thrift/lib/rb/lib/thrift/exceptions.rb      |   87 -
 .../lib/rb/lib/thrift/multiplexed_processor.rb  |   76 -
 .../thrift/lib/rb/lib/thrift/processor.rb       |   68 -
 .../lib/rb/lib/thrift/protocol/base_protocol.rb |  379 --
 .../rb/lib/thrift/protocol/binary_protocol.rb   |  237 -
 .../protocol/binary_protocol_accelerated.rb     |   39 -
 .../rb/lib/thrift/protocol/compact_protocol.rb  |  435 --
 .../lib/rb/lib/thrift/protocol/json_protocol.rb |  769 ---
 .../lib/thrift/protocol/multiplexed_protocol.rb |   40 -
 .../lib/thrift/protocol/protocol_decorator.rb   |  194 -
 .../rb/lib/thrift/serializer/deserializer.rb    |   33 -
 .../lib/rb/lib/thrift/serializer/serializer.rb  |   34 -
 .../lib/rb/lib/thrift/server/base_server.rb     |   31 -
 .../rb/lib/thrift/server/mongrel_http_server.rb |   60 -
 .../rb/lib/thrift/server/nonblocking_server.rb  |  305 --
 .../lib/rb/lib/thrift/server/simple_server.rb   |   43 -
 .../rb/lib/thrift/server/thin_http_server.rb    |   91 -
 .../rb/lib/thrift/server/thread_pool_server.rb  |   75 -
 .../lib/rb/lib/thrift/server/threaded_server.rb |   47 -
 .../thrift/lib/rb/lib/thrift/struct.rb          |  237 -
 .../thrift/lib/rb/lib/thrift/struct_union.rb    |  192 -
 .../thrift/lib/rb/lib/thrift/thrift_native.rb   |   24 -
 .../thrift/transport/base_server_transport.rb   |   37 -
 .../rb/lib/thrift/transport/base_transport.rb   |  109 -
 .../lib/thrift/transport/buffered_transport.rb  |  114 -
 .../rb/lib/thrift/transport/framed_transport.rb |  117 -
 .../thrift/transport/http_client_transport.rb   |   56 -
 .../lib/thrift/transport/io_stream_transport.rb |   39 -
 .../thrift/transport/memory_buffer_transport.rb |  125 -
 .../rb/lib/thrift/transport/server_socket.rb    |   63 -
 .../lib/rb/lib/thrift/transport/socket.rb       |  139 -
 .../lib/thrift/transport/unix_server_socket.rb  |   60 -
 .../lib/rb/lib/thrift/transport/unix_socket.rb  |   40 -
 .../thrift/lib/rb/lib/thrift/types.rb           |  101 -
 .../thrift/lib/rb/lib/thrift/union.rb           |  176 -
 .../thrift/lib/rb/script/proto_benchmark.rb     |  121 -
 .../thrift/lib/rb/script/read_struct.rb         |   43 -
 .../thrift/lib/rb/script/write_struct.rb        |   30 -
 .../thrift/lib/rb/spec/BaseService.thrift       |   27 -
 .../thrift/lib/rb/spec/ExtendedService.thrift   |   25 -
 .../thrift/lib/rb/spec/Referenced.thrift        |   44 -
 .../lib/rb/spec/ThriftNamespacedSpec.thrift     |   53 -
 .../thrift/lib/rb/spec/ThriftSpec.thrift        |  183 -
 .../thrift/lib/rb/spec/base_protocol_spec.rb    |  217 -
 .../thrift/lib/rb/spec/base_transport_spec.rb   |  350 --
 .../rb/spec/binary_protocol_accelerated_spec.rb |   42 -
 .../thrift/lib/rb/spec/binary_protocol_spec.rb  |   66 -
 .../lib/rb/spec/binary_protocol_spec_shared.rb  |  455 --
 .../thirdparty/thrift/lib/rb/spec/bytes_spec.rb |  160 -
 .../thrift/lib/rb/spec/client_spec.rb           |   99 -
 .../thrift/lib/rb/spec/compact_protocol_spec.rb |  143 -
 .../thrift/lib/rb/spec/exception_spec.rb        |  141 -
 .../thirdparty/thrift/lib/rb/spec/flat_spec.rb  |   62 -
 .../thrift/lib/rb/spec/http_client_spec.rb      |  120 -
 .../thrift/lib/rb/spec/json_protocol_spec.rb    |  513 --
 .../thrift/lib/rb/spec/namespaced_spec.rb       |   67 -
 .../lib/rb/spec/nonblocking_server_spec.rb      |  263 -
 .../thrift/lib/rb/spec/processor_spec.rb        |   80 -
 .../thrift/lib/rb/spec/serializer_spec.rb       |   67 -
 .../thrift/lib/rb/spec/server_socket_spec.rb    |   79 -
 .../thrift/lib/rb/spec/server_spec.rb           |  147 -
 .../thrift/lib/rb/spec/socket_spec.rb           |   61 -
 .../thrift/lib/rb/spec/socket_spec_shared.rb    |  104 -
 .../thrift/lib/rb/spec/spec_helper.rb           |   64 -
 .../rb/spec/struct_nested_containers_spec.rb    |  191 -
 .../thrift/lib/rb/spec/struct_spec.rb           |  293 -
 .../thrift/lib/rb/spec/thin_http_server_spec.rb |  141 -
 .../thirdparty/thrift/lib/rb/spec/types_spec.rb |  115 -
 .../thirdparty/thrift/lib/rb/spec/union_spec.rb |  208 -
 .../thrift/lib/rb/spec/unix_socket_spec.rb      |  107 -
 depends/thirdparty/thrift/lib/rb/thrift.gemspec |   37 -
 depends/thirdparty/thrift/lib/st/README.md      |   39 -
 .../thrift/lib/st/coding_standards.md           |    1 -
 depends/thirdparty/thrift/lib/st/package.xml    |   26 -
 depends/thirdparty/thrift/lib/st/thrift.st      |  815 ---
 .../thrift/lib/ts/coding_standards.md           |    1 -
 depends/thirdparty/thrift/lib/ts/thrift.d.ts    |  699 ---
 depends/thirdparty/thrift/package.json          |   50 -
 depends/thirdparty/thrift/rat_exclude           |   35 -
 .../thirdparty/thrift/sonar-project.properties  |  140 -
 .../thrift/test/AnnotationTest.thrift           |   63 -
 .../thrift/test/BrokenConstants.thrift          |   25 -
 .../thirdparty/thrift/test/ConstantsDemo.thrift |   71 -
 .../thrift/test/DebugProtoTest.thrift           |  371 --
 .../thrift/test/DenseLinkingTest.thrift         |   98 -
 depends/thirdparty/thrift/test/DocTest.thrift   |  249 -
 depends/thirdparty/thrift/test/EnumTest.thrift  |   72 -
 .../thirdparty/thrift/test/FastbinaryTest.py    |  222 -
 depends/thirdparty/thrift/test/Include.thrift   |   24 -
 .../thirdparty/thrift/test/JavaBeansTest.thrift |   39 -
 .../thrift/test/JsDeepConstructorTest.thrift    |   16 -
 depends/thirdparty/thrift/test/Makefile.am      |  128 -
 .../thirdparty/thrift/test/ManyOptionals.thrift |  231 -
 .../thirdparty/thrift/test/ManyTypedefs.thrift  |   50 -
 .../thrift/test/NameConflictTest.thrift         |  110 -
 .../thrift/test/OptionalRequiredTest.thrift     |   82 -
 depends/thirdparty/thrift/test/README.md        |  178 -
 depends/thirdparty/thrift/test/Recursive.thrift |   47 -
 .../thirdparty/thrift/test/ReuseObjects.thrift  |   30 -
 depends/thirdparty/thrift/test/SmallTest.thrift |   60 -
 .../thirdparty/thrift/test/StressTest.thrift    |   35 -
 .../thirdparty/thrift/test/ThriftTest.thrift    |  400 --
 .../thirdparty/thrift/test/TypedefTest.thrift   |   36 -
 depends/thirdparty/thrift/test/audit/README.md  |   40 -
 .../thirdparty/thrift/test/audit/break1.thrift  |  188 -
 .../thirdparty/thrift/test/audit/break10.thrift |  190 -
 .../thirdparty/thrift/test/audit/break11.thrift |  190 -
 .../thirdparty/thrift/test/audit/break12.thrift |  191 -
 .../thirdparty/thrift/test/audit/break13.thrift |  191 -
 .../thirdparty/thrift/test/audit/break14.thrift |  190 -
 .../thirdparty/thrift/test/audit/break15.thrift |  190 -
 .../thirdparty/thrift/test/audit/break16.thrift |  191 -
 .../thirdparty/thrift/test/audit/break17.thrift |  191 -
 .../thirdparty/thrift/test/audit/break18.thrift |  191 -
 .../thirdparty/thrift/test/audit/break19.thrift |  191 -
 .../thirdparty/thrift/test/audit/break2.thrift  |  190 -
 .../thirdparty/thrift/test/audit/break20.thrift |  190 -
 .../thirdparty/thrift/test/audit/break21.thrift |  190 -
 .../thirdparty/thrift/test/audit/break22.thrift |  190 -
 .../thirdparty/thrift/test/audit/break23.thrift |  192 -
 .../thirdparty/thrift/test/audit/break24.thrift |  191 -
 .../thirdparty/thrift/test/audit/break25.thrift |  191 -
 .../thirdparty/thrift/test/audit/break26.thrift |  191 -
 .../thirdparty/thrift/test/audit/break27.thrift |  190 -
 .../thirdparty/thrift/test/audit/break28.thrift |  190 -
 .../thirdparty/thrift/test/audit/break29.thrift |  191 -
 .../thirdparty/thrift/test/audit/break3.thrift  |  191 -
 .../thirdparty/thrift/test/audit/break30.thrift |  190 -
 .../thirdparty/thrift/test/audit/break31.thrift |  191 -
 .../thirdparty/thrift/test/audit/break32.thrift |  191 -
 .../thirdparty/thrift/test/audit/break33.thrift |  191 -
 .../thirdparty/thrift/test/audit/break34.thrift |  192 -
 .../thirdparty/thrift/test/audit/break4.thrift  |  190 -
 .../thirdparty/thrift/test/audit/break5.thrift  |  190 -
 .../thirdparty/thrift/test/audit/break6.thrift  |  191 -
 .../thirdparty/thrift/test/audit/break7.thrift  |  190 -
 .../thirdparty/thrift/test/audit/break8.thrift  |  191 -
 .../thirdparty/thrift/test/audit/break9.thrift  |  190 -
 .../thirdparty/thrift/test/audit/test.thrift    |  189 -
 .../thrift/test/audit/thrift_audit_test.pl      |  261 -
 .../thirdparty/thrift/test/audit/warning.thrift |  190 -
 .../thirdparty/thrift/test/c_glib/Makefile.am   |   74 -
 .../thrift/test/c_glib/src/test_client.c        | 1566 ------
 .../thrift/test/c_glib/src/test_server.c        |  207 -
 .../test/c_glib/src/thrift_test_handler.c       |  871 ---
 .../test/c_glib/src/thrift_test_handler.h       |  241 -
 .../thirdparty/thrift/test/cpp/CMakeLists.txt   |   89 -
 depends/thirdparty/thrift/test/cpp/Makefile.am  |  125 -
 .../thrift/test/cpp/realloc/realloc_test.c      |  107 -
 .../thrift/test/cpp/src/StressTest.cpp          |  605 --
 .../test/cpp/src/StressTestNonBlocking.cpp      |  538 --
 .../thrift/test/cpp/src/TestClient.cpp          |  935 ----
 .../thrift/test/cpp/src/TestServer.cpp          |  772 ---
 .../thrift/test/cpp/src/ThriftTest_extras.cpp   |   33 -
 .../thrift/test/crossrunner/__init__.py         |   25 -
 .../thrift/test/crossrunner/collect.py          |  142 -
 .../thrift/test/crossrunner/prepare.py          |   55 -
 .../thrift/test/crossrunner/report.py           |  405 --
 .../thirdparty/thrift/test/crossrunner/run.py   |  317 --
 .../thirdparty/thrift/test/crossrunner/test.py  |  136 -
 .../thirdparty/thrift/test/crossrunner/util.py  |   31 -
 .../thrift/test/erl/LegacyNames.thrift          |   33 -
 depends/thirdparty/thrift/test/erl/Makefile.am  |   40 -
 depends/thirdparty/thrift/test/erl/rebar.config |    5 -
 .../thrift/test/erl/src/legacy_names_test.erl   |   69 -
 .../thrift/test/erl/src/name_conflict_test.erl  |  299 -
 .../thrift/test/erl/src/thrift_test.app.src     |   51 -
 .../thrift/test/erl/src/thrift_test_test.erl    |  655 ---
 depends/thirdparty/thrift/test/go/Makefile.am   |   63 -
 .../thrift/test/go/src/bin/stress/main.go       |  254 -
 .../thrift/test/go/src/bin/testclient/main.go   |  297 -
 .../thrift/test/go/src/bin/testserver/main.go   |   43 -
 .../thrift/test/go/src/common/client.go         |  102 -
 .../test/go/src/common/clientserver_test.go     |  312 --
 .../thrift/test/go/src/common/mock_handler.go   |  289 -
 .../test/go/src/common/printing_handler.go      |  383 --
 .../thrift/test/go/src/common/server.go         |  117 -
 .../thrift/test/go/src/common/simple_handler.go |  155 -
 depends/thirdparty/thrift/test/haxe/Makefile.am |   70 -
 .../thrift/test/haxe/TestClientServer.hxproj    |   67 -
 depends/thirdparty/thrift/test/haxe/cpp.hxml    |   41 -
 depends/thirdparty/thrift/test/haxe/csharp.hxml |   38 -
 depends/thirdparty/thrift/test/haxe/flash.hxml  |   41 -
 depends/thirdparty/thrift/test/haxe/java.hxml   |   38 -
 .../thirdparty/thrift/test/haxe/javascript.hxml |   44 -
 .../thirdparty/thrift/test/haxe/make_all.bat    |   68 -
 depends/thirdparty/thrift/test/haxe/make_all.sh |   41 -
 depends/thirdparty/thrift/test/haxe/neko.hxml   |   38 -
 depends/thirdparty/thrift/test/haxe/php.hxml    |   38 -
 .../thirdparty/thrift/test/haxe/project.hide    |   76 -
 depends/thirdparty/thrift/test/haxe/python.hxml |   38 -
 .../thrift/test/haxe/src/Arguments.hx           |  329 --
 depends/thirdparty/thrift/test/haxe/src/Main.hx |   51 -
 .../thrift/test/haxe/src/TestClient.hx          |  906 ---
 .../thrift/test/haxe/src/TestMacro.hx           |   40 -
 .../thrift/test/haxe/src/TestServer.hx          |  116 -
 .../test/haxe/src/TestServerEventHandler.hx     |   53 -
 .../thrift/test/haxe/src/TestServerHandler.hx   |  500 --
 .../thrift/test/hs/ConstantsDemo_Main.hs        |   68 -
 .../thrift/test/hs/DebugProtoTest_Main.hs       |  168 -
 .../thirdparty/thrift/test/hs/Include_Main.hs   |    7 -
 depends/thirdparty/thrift/test/hs/Makefile.am   |   41 -
 depends/thirdparty/thrift/test/hs/TestClient.hs |  303 --
 depends/thirdparty/thrift/test/hs/TestServer.hs |  303 --
 .../thrift/test/hs/ThriftTestUtils.hs           |   65 -
 .../thrift/test/hs/ThriftTest_Main.hs           |  214 -
 depends/thirdparty/thrift/test/hs/run-test.sh   |   43 -
 depends/thirdparty/thrift/test/keys/CA.pem      |   82 -
 depends/thirdparty/thrift/test/keys/README.md   |   83 -
 depends/thirdparty/thrift/test/keys/client.crt  |   20 -
 depends/thirdparty/thrift/test/keys/client.key  |   15 -
 depends/thirdparty/thrift/test/keys/client.p12  |  Bin 1877 -> 0 bytes
 depends/thirdparty/thrift/test/keys/client.pem  |   44 -
 depends/thirdparty/thrift/test/keys/server.crt  |   25 -
 depends/thirdparty/thrift/test/keys/server.key  |   28 -
 depends/thirdparty/thrift/test/keys/server.p12  |  Bin 2685 -> 0 bytes
 depends/thirdparty/thrift/test/keys/server.pem  |   53 -
 .../thrift/test/known_failures_Linux.json       |  295 -
 .../thrift/test/lua/test_basic_client.lua       |  138 -
 .../thrift/test/lua/test_basic_server.lua       |  108 -
 .../thrift/test/ocaml/client/TestClient.ml      |   82 -
 .../thrift/test/ocaml/server/TestServer.ml      |  137 -
 depends/thirdparty/thrift/test/perl/Makefile.am |   31 -
 .../thirdparty/thrift/test/perl/TestClient.pl   |  422 --
 .../thirdparty/thrift/test/perl/TestServer.pl   |  388 --
 depends/thirdparty/thrift/test/php/Makefile.am  |   34 -
 .../thirdparty/thrift/test/php/TestClient.php   |  427 --
 .../thirdparty/thrift/test/php/TestInline.php   |   24 -
 .../thrift/test/py.tornado/Makefile.am          |   30 -
 .../thrift/test/py.tornado/test_suite.py        |  232 -
 .../thrift/test/py.twisted/Makefile.am          |   30 -
 .../thrift/test/py.twisted/test_suite.py        |  189 -
 .../thirdparty/thrift/test/py/CMakeLists.txt    |   48 -
 depends/thirdparty/thrift/test/py/Makefile.am   |   84 -
 .../thrift/test/py/RunClientServer.py           |  214 -
 .../thrift/test/py/SerializationTest.py         |  371 --
 .../thrift/test/py/TSimpleJSONProtocolTest.py   |  119 -
 depends/thirdparty/thrift/test/py/TestClient.py |  272 -
 depends/thirdparty/thrift/test/py/TestEof.py    |  136 -
 depends/thirdparty/thrift/test/py/TestServer.py |  301 -
 depends/thirdparty/thrift/test/py/TestSocket.py |   89 -
 depends/thirdparty/thrift/test/py/TestSyntax.py |   33 -
 .../thrift/test/py/explicit_module/runtest.sh   |   35 -
 .../thrift/test/py/explicit_module/test1.thrift |   24 -
 .../thrift/test/py/explicit_module/test2.thrift |   24 -
 .../thrift/test/py/explicit_module/test3.thrift |   25 -
 depends/thirdparty/thrift/test/rb/Gemfile       |    6 -
 depends/thirdparty/thrift/test/rb/Makefile.am   |   33 -
 .../test/rb/benchmarks/protocol_benchmark.rb    |  174 -
 .../rb/core/test_backwards_compatability.rb     |   30 -
 .../thrift/test/rb/core/test_exceptions.rb      |   30 -
 .../test/rb/core/transport/test_transport.rb    |   70 -
 .../thrift/test/rb/fixtures/structs.rb          |  298 -
 .../thrift/test/rb/generation/test_enum.rb      |   34 -
 .../thrift/test/rb/generation/test_struct.rb    |   48 -
 .../thrift/test/rb/integration/TestClient.rb    |  314 --
 .../thrift/test/rb/integration/TestServer.rb    |  157 -
 .../thirdparty/thrift/test/rb/test_helper.rb    |   35 -
 depends/thirdparty/thrift/test/rb/test_suite.rb |   20 -
 .../thrift/test/rebuild_known_failures.sh       |   24 -
 depends/thirdparty/thrift/test/result.html      |   91 -
 depends/thirdparty/thrift/test/test.py          |  123 -
 depends/thirdparty/thrift/test/tests.json       |  360 --
 .../thrift/test/threads/ThreadsClient.cpp       |   69 -
 .../thrift/test/threads/ThreadsServer.cpp       |  148 -
 .../thrift/test/threads/ThreadsTest.thrift      |   28 -
 .../thirdparty/thrift/test/valgrind.suppress    |    9 -
 depends/thirdparty/thrift/tutorial/Makefile.am  |   90 -
 depends/thirdparty/thrift/tutorial/README.md    |   42 -
 .../thirdparty/thrift/tutorial/as3/build.xml    |   50 -
 .../thrift/tutorial/as3/src/CalculatorUI.as     |  142 -
 .../thrift/tutorial/c_glib/Makefile.am          |   85 -
 .../thrift/tutorial/c_glib/c_glib_client.c      |  190 -
 .../thrift/tutorial/c_glib/c_glib_server.c      |  527 --
 .../thrift/tutorial/cpp/CMakeLists.txt          |   51 -
 .../thrift/tutorial/cpp/CppClient.cpp           |   80 -
 .../thrift/tutorial/cpp/CppServer.cpp           |  181 -
 .../thirdparty/thrift/tutorial/cpp/Makefile.am  |   88 -
 .../csharp/CsharpClient/CsharpClient.cs         |   92 -
 .../csharp/CsharpClient/CsharpClient.csproj     |  110 -
 .../CsharpClient/Properties/AssemblyInfo.cs     |   55 -
 .../csharp/CsharpServer/CsharpServer.cs         |  129 -
 .../csharp/CsharpServer/CsharpServer.csproj     |  111 -
 .../CsharpServer/Properties/AssemblyInfo.cs     |   55 -
 .../thrift/tutorial/csharp/tutorial.sln         |   39 -
 .../thirdparty/thrift/tutorial/d/async_client.d |   86 -
 depends/thirdparty/thrift/tutorial/d/client.d   |   64 -
 depends/thirdparty/thrift/tutorial/d/server.d   |  111 -
 .../delphi/DelphiClient/DelphiClient.dpr        |  114 -
 .../delphi/DelphiClient/DelphiClient.dproj      |  119 -
 .../delphi/DelphiServer/DelphiServer.dpr        |  173 -
 .../delphi/DelphiServer/DelphiServer.dproj      |  118 -
 .../thrift/tutorial/delphi/Tutorial.groupproj   |   48 -
 .../thirdparty/thrift/tutorial/erl/README.md    |    8 -
 .../thirdparty/thrift/tutorial/erl/client.erl   |   78 -
 .../thirdparty/thrift/tutorial/erl/client.sh    |    1 -
 .../thrift/tutorial/erl/json_client.erl         |   89 -
 .../thirdparty/thrift/tutorial/erl/server.erl   |   82 -
 .../thirdparty/thrift/tutorial/erl/server.sh    |   37 -
 .../thirdparty/thrift/tutorial/go/Makefile.am   |   61 -
 .../thirdparty/thrift/tutorial/go/server.crt    |   25 -
 .../thirdparty/thrift/tutorial/go/server.key    |   28 -
 .../thirdparty/thrift/tutorial/go/src/client.go |   99 -
 .../thrift/tutorial/go/src/handler.go           |  101 -
 .../thirdparty/thrift/tutorial/go/src/main.go   |   82 -
 .../thirdparty/thrift/tutorial/go/src/server.go |   54 -
 .../thirdparty/thrift/tutorial/haxe/Makefile.am |   63 -
 .../thrift/tutorial/haxe/Tutorial.hxproj        |   67 -
 .../thirdparty/thrift/tutorial/haxe/cpp.hxml    |   41 -
 .../thirdparty/thrift/tutorial/haxe/csharp.hxml |   38 -
 .../thirdparty/thrift/tutorial/haxe/flash.hxml  |   41 -
 .../thirdparty/thrift/tutorial/haxe/java.hxml   |   38 -
 .../thrift/tutorial/haxe/javascript.hxml        |   44 -
 .../thrift/tutorial/haxe/make_all.bat           |   68 -
 .../thirdparty/thrift/tutorial/haxe/make_all.sh |   41 -
 .../thirdparty/thrift/tutorial/haxe/neko.hxml   |   38 -
 .../thirdparty/thrift/tutorial/haxe/php.hxml    |   38 -
 .../thrift/tutorial/haxe/project.hide           |  105 -
 .../thirdparty/thrift/tutorial/haxe/python.hxml |   38 -
 .../tutorial/haxe/src/CalculatorHandler.hx      |  101 -
 .../thirdparty/thrift/tutorial/haxe/src/Main.hx |  324 --
 .../thrift/tutorial/hs/HaskellClient.hs         |   76 -
 .../thrift/tutorial/hs/HaskellServer.hs         |  103 -
 .../thirdparty/thrift/tutorial/hs/Makefile.am   |   39 -
 depends/thirdparty/thrift/tutorial/hs/Setup.lhs |   21 -
 .../thrift/tutorial/hs/ThriftTutorial.cabal     |   73 -
 .../thirdparty/thrift/tutorial/java/Makefile.am |   45 -
 .../thirdparty/thrift/tutorial/java/README.md   |   24 -
 .../thirdparty/thrift/tutorial/java/build.xml   |  113 -
 .../tutorial/java/src/CalculatorHandler.java    |   92 -
 .../thrift/tutorial/java/src/JavaClient.java    |  106 -
 .../thrift/tutorial/java/src/JavaServer.java    |  110 -
 .../thirdparty/thrift/tutorial/js/Makefile.am   |   39 -
 depends/thirdparty/thrift/tutorial/js/build.xml |   90 -
 .../thrift/tutorial/js/src/Httpd.java           |  299 -
 .../thirdparty/thrift/tutorial/js/tutorial.html |  109 -
 .../thrift/tutorial/nodejs/Makefile.am          |   47 -
 .../thrift/tutorial/nodejs/NodeClient.js        |   79 -
 .../thrift/tutorial/nodejs/NodeClientPromise.js |   82 -
 .../thrift/tutorial/nodejs/NodeServer.js        |   85 -
 .../thrift/tutorial/nodejs/NodeServerPromise.js |   80 -
 .../thrift/tutorial/ocaml/CalcClient.ml         |   74 -
 .../thrift/tutorial/ocaml/CalcServer.ml         |   89 -
 .../thirdparty/thrift/tutorial/ocaml/README.md  |   15 -
 depends/thirdparty/thrift/tutorial/ocaml/_oasis |   32 -
 .../thrift/tutorial/perl/PerlClient.pl          |   82 -
 .../thrift/tutorial/perl/PerlServer.pl          |  124 -
 .../thrift/tutorial/php/PhpClient.php           |   91 -
 .../thrift/tutorial/php/PhpServer.php           |  130 -
 .../thirdparty/thrift/tutorial/php/runserver.py |   32 -
 .../thrift/tutorial/py.tornado/Makefile.am      |   38 -
 .../thrift/tutorial/py.tornado/PythonClient.py  |  116 -
 .../thrift/tutorial/py.tornado/PythonServer.py  |  104 -
 .../thrift/tutorial/py.twisted/Makefile.am      |   39 -
 .../thrift/tutorial/py.twisted/PythonClient.py  |   77 -
 .../thrift/tutorial/py.twisted/PythonServer.py  |   93 -
 .../thrift/tutorial/py.twisted/PythonServer.tac |   49 -
 .../thirdparty/thrift/tutorial/py/Makefile.am   |   38 -
 .../thrift/tutorial/py/PythonClient.py          |   83 -
 .../thrift/tutorial/py/PythonServer.py          |   97 -
 .../thirdparty/thrift/tutorial/rb/Makefile.am   |   38 -
 .../thirdparty/thrift/tutorial/rb/RubyClient.rb |   75 -
 .../thirdparty/thrift/tutorial/rb/RubyServer.rb |   95 -
 .../thirdparty/thrift/tutorial/shared.thrift    |   39 -
 .../thirdparty/thrift/tutorial/tutorial.thrift  |  153 -
 1854 files changed, 19 insertions(+), 338716 deletions(-)
----------------------------------------------------------------------



[48/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/CMakeLists.txt b/depends/thirdparty/thrift/CMakeLists.txt
deleted file mode 100644
index 44f65af..0000000
--- a/depends/thirdparty/thrift/CMakeLists.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-cmake_minimum_required(VERSION 2.8.12)
-
-project("Apache Thrift")
-
-set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
-
-# TODO: add `git rev-parse --short HEAD`
-# Read the version information from the Autoconf file
-file (STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/configure.ac" CONFIGURE_AC REGEX "AC_INIT\\(.*\\)" )
-
-# The following variable is used in the version.h.in file
-string(REGEX REPLACE "AC_INIT\\(\\[.*\\], \\[([0-9]+\\.[0-9]+\\.[0-9]+(-dev)?)\\]\\)" "\\1" PACKAGE_VERSION ${CONFIGURE_AC})
-message(STATUS "Parsed Thrift package version: ${PACKAGE_VERSION}")
-
-# These are internal to CMake
-string(REGEX REPLACE "([0-9]+\\.[0-9]+\\.[0-9]+)(-dev)?" "\\1" thrift_VERSION ${PACKAGE_VERSION})
-string(REGEX REPLACE "([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" thrift_VERSION_MAJOR ${thrift_VERSION})
-string(REGEX REPLACE "[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" thrift_VERSION_MINOR ${thrift_VERSION})
-string(REGEX REPLACE "[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" thrift_VERSION_PATCH ${thrift_VERSION})
-message(STATUS "Parsed Thrift version: ${thrift_VERSION} (${thrift_VERSION_MAJOR}.${thrift_VERSION_MINOR}.${thrift_VERSION_PATCH})")
-
-# Some default settings
-include(DefineCMakeDefaults)
-
-# Build time options are defined here
-include(DefineOptions)
-include(DefineInstallationPaths)
-
-# Based on the options set some platform specifics
-include(DefinePlatformSpecifc)
-
-# Generate the config.h file
-include(ConfigureChecks)
-
-# Package it
-include(CPackConfig)
-
-
-find_package(Threads)
-
-include(CTest)
-if(BUILD_TESTING)
-  message(STATUS "Building with unittests")
-
-  enable_testing()
-  # Define "make check" as alias for "make test"
-  add_custom_target(check COMMAND ctest)
-else ()
-  message(STATUS "Building without tests")
-endif ()
-if(BUILD_COMPILER)
-    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/compiler/cpp)
-endif()
-
-if(BUILD_CPP)
-    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/cpp)
-    if(BUILD_TUTORIALS)
-        add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tutorial/cpp)
-    endif(BUILD_TUTORIALS)
-    if(BUILD_TESTING)
-        if(WITH_LIBEVENT AND WITH_ZLIB AND WITH_OPENSSL)
-            add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/cpp)
-        else()
-            message(WARNING "libevent and/or ZLIB and/or OpenSSL not found or disabled; will not build some tests")
-        endif()
-    endif()
-endif()
-
-if(BUILD_C_GLIB)
-    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/c_glib)
-endif()
-
-if(BUILD_JAVA)
-    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/java)
-endif()
-
-if(BUILD_PYTHON)
-    add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/lib/py)
-    if(BUILD_TESTING)
-        add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/test/py)
-    endif()
-endif()
-
-PRINT_CONFIG_SUMMARY()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/CONTRIBUTING.md b/depends/thirdparty/thrift/CONTRIBUTING.md
deleted file mode 100644
index 76041f6..0000000
--- a/depends/thirdparty/thrift/CONTRIBUTING.md
+++ /dev/null
@@ -1,49 +0,0 @@
-## How to contribute
- 1. Help to review and verify existing patches
- 1. Make sure your issue is not all ready in the [Jira issue tracker](http://issues.apache.org/jira/browse/THRIFT)
- 1. If not, create a ticket describing the change you're proposing in the [Jira issue tracker](http://issues.apache.org/jira/browse/THRIFT)
- 1. Contribute your patch using one of the two methods below
-
-### Contributing via a patch
-
-1. Check out the latest version of the source code
-
-  * git clone https://git-wip-us.apache.org/repos/asf/thrift.git thrift
-
-1. Modify the source to include the improvement/bugfix
-
-  * Remember to provide *tests* for all submited changes
-  * When bugfixing: add test that will isolate bug *before* applying change that fixes it
-  * Verify that you follow [Thrift Coding Standards](/coding_standards) (you can run 'make style', which ensures proper format for some languages)
-
-1. Create a patch from project root directory (e.g. you@dev:~/thrift $ ):
-
-  * git diff > ../thrift-XXX-my-new-feature.patch
-
-1. Attach the newly generated patch to the issue
-1. Wait for other contributors or committers to review your new addition
-1. Wait for a committer to commit your patch
-
-### Contributing via GitHub pull requests
-
-1. Create a fork for http://github.com/apache/thrift
-1. Create a branch for your changes(best practice is issue as branch name, e.g. THRIFT-9999)
-1. Modify the source to include the improvement/bugfix
-
-  * Remember to provide *tests* for all submited changes
-  * When bugfixing: add test that will isolate bug *before* applying change that fixes it
-  * Verify that you follow [Thrift Coding Standards](/coding_standards) (you can run 'make style', which ensures proper format for some languages)
-  * Verify that your change works on other platforms by adding a GitHub service hook to [Travis CI](http://docs.travis-ci.com/user/getting-started/#Step-one%3A-Sign-in) and [AppVeyor](http://www.appveyor.com/docs)
-
-1. Commit and push changes to your branch (please use issue name and description as commit title, e.g. THRIFT-9999 make it perfect)
-1. Issue a pull request with the jira ticket number you are working on in it's name
-1. Wait for other contributors or committers to review your new addition
-1. Wait for a committer to commit your patch
-
-### More info
-
- Plenty of information on why and how to contribute is available on the Apache Software Foundation (ASF) web site. In particular, we recommend the following:
-
- * [Contributors Tech Guide](http://www.apache.org/dev/contributors)
- * [Get involved!](http://www.apache.org/foundation/getinvolved.html)
- * [Legal aspects on Submission of Contributions (Patches)](http://www.apache.org/licenses/LICENSE-2.0.html#contributions)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/LICENSE
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/LICENSE b/depends/thirdparty/thrift/LICENSE
deleted file mode 100644
index 8d5e082..0000000
--- a/depends/thirdparty/thrift/LICENSE
+++ /dev/null
@@ -1,253 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-
---------------------------------------------------
-SOFTWARE DISTRIBUTED WITH THRIFT:
-
-The Apache Thrift software includes a number of subcomponents with
-separate copyright notices and license terms. Your use of the source
-code for the these subcomponents is subject to the terms and
-conditions of the following licenses.
-
---------------------------------------------------
-Portions of the following files are licensed under the MIT License:
-
-  lib/erl/src/Makefile.am
-
-Please see doc/otp-base-license.txt for the full terms of this license.
-
---------------------------------------------------
-For the aclocal/ax_boost_base.m4 and contrib/fb303/aclocal/ax_boost_base.m4 components:
-
-#   Copyright (c) 2007 Thomas Porschberg <th...@randspringer.de>
-#
-#   Copying and distribution of this file, with or without
-#   modification, are permitted in any medium without royalty provided
-#   the copyright notice and this notice are preserved.
-
---------------------------------------------------
-For the compiler/cpp/src/thrift/md5.[ch] components:
-
-/*
-  Copyright (C) 1999, 2000, 2002 Aladdin Enterprises.  All rights reserved.
-
-  This software is provided 'as-is', without any express or implied
-  warranty.  In no event will the authors be held liable for any damages
-  arising from the use of this software.
-
-  Permission is granted to anyone to use this software for any purpose,
-  including commercial applications, and to alter it and redistribute it
-  freely, subject to the following restrictions:
-
-  1. The origin of this software must not be misrepresented; you must not
-     claim that you wrote the original software. If you use this software
-     in a product, an acknowledgment in the product documentation would be
-     appreciated but is not required.
-  2. Altered source versions must be plainly marked as such, and must not be
-     misrepresented as being the original software.
-  3. This notice may not be removed or altered from any source distribution.
-
-  L. Peter Deutsch
-  ghost@aladdin.com
-
- */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/Makefile.am b/depends/thirdparty/thrift/Makefile.am
deleted file mode 100755
index 42c82e2..0000000
--- a/depends/thirdparty/thrift/Makefile.am
+++ /dev/null
@@ -1,110 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-ACLOCAL_AMFLAGS = -I ./aclocal
-
-SUBDIRS = compiler/cpp lib
-
-if WITH_TESTS
-SUBDIRS += test
-endif
-
-if WITH_TUTORIAL
-SUBDIRS += tutorial
-endif
-
-dist-hook:
-	find $(distdir) -type f \( -iname ".DS_Store" -or -iname "._*" -or -iname ".gitignore" \) | xargs rm -rf
-	find $(distdir) -type d \( -iname ".deps" -or -iname ".libs" \) | xargs rm -rf
-	find $(distdir) -type d \( -iname ".svn" -or -iname ".git" \) | xargs rm -rf
-
-print-version:
-	@echo $(VERSION)
-
-.PHONY: precross cross
-precross-%: all
-	$(MAKE) -C $* precross
-precross: all precross-test precross-lib
-
-# TODO: generate --server and --client switches from "--with(out)-..." build flags
-
-
-empty :=
-space := $(empty) $(empty)
-comma := ,
-
-CROSS_LANGS = @MAYBE_CPP@ @MAYBE_C_GLIB@ @MAYBE_JAVA@ @MAYBE_CSHARP@ @MAYBE_PYTHON@ @MAYBE_RUBY@ @MAYBE_HASKELL@ @MAYBE_PERL@ @MAYBE_PHP@ @MAYBE_GO@ @MAYBE_NODEJS@
-CROSS_LANGS_COMMA_SEPARATED = $(subst $(space),$(comma),$(CROSS_LANGS))
-
-cross: precross
-	$(PYTHON) test/test.py -s --server $(CROSS_LANGS_COMMA_SEPARATED) --client $(CROSS_LANGS_COMMA_SEPARATED)
-
-TIMES = 1 2 3
-fail: precross
-	$(PYTHON) test/test.py || true
-	$(PYTHON) test/test.py --update-expected-failures=overwrite
-	$(foreach var,$(TIMES),test/test.py -s || true;test/test.py --update-expected-failures=merge;)
-
-codespell_skip_files = \
-	*.jar \
-	*.class \
-	*.so \
-	*.a \
-	*.la \
-	*.o \
-	*.p12 \
-	*OCamlMakefile \
-	.keystore \
-	.truststore \
-	CHANGES \
-	config.sub \
-	configure \
-	depcomp \
-	libtool.m4 \
-	output.* \
-	rebar \
-	thrift
-
-skipped_files = $(subst $(space),$(comma),$(codespell_skip_files))
-
-style-local:
-	codespell --write-changes --skip=$(skipped_files) --disable-colors
-
-EXTRA_DIST = \
-	.clang-format \
-	.editorconfig \
-	.travis.yml \
-	appveyor.yml \
-	bower.json \
-	build \
-	CMakeLists.txt \
-	composer.json \
-	contrib \
-	CONTRIBUTING.md \
-	debian \
-	doc \
-	doap.rdf \
-	json-schema.json \
-	package.json \
-	rat_exclude \
-	sonar-project.properties \
-	LICENSE \
-	CHANGES \
-	NOTICE \
-	README.md

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/NOTICE
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/NOTICE b/depends/thirdparty/thrift/NOTICE
deleted file mode 100644
index c23995a..0000000
--- a/depends/thirdparty/thrift/NOTICE
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Thrift
-Copyright 2006-2010 The Apache Software Foundation.
-
-This product includes software developed at
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/README.md b/depends/thirdparty/thrift/README.md
deleted file mode 100644
index a55389a..0000000
--- a/depends/thirdparty/thrift/README.md
+++ /dev/null
@@ -1,164 +0,0 @@
-Apache Thrift
-=============
-
-Last Modified: 2014-03-16
-
-License
-=======
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-
-Introduction
-============
-
-Thrift is a lightweight, language-independent software stack with an
-associated code generation mechanism for RPC. Thrift provides clean
-abstractions for data transport, data serialization, and application
-level processing. The code generation system takes a simple definition
-language as its input and generates code across programming languages that
-uses the abstracted stack to build interoperable RPC clients and servers.
-
-Thrift is specifically designed to support non-atomic version changes
-across client and server code.
-
-For more details on Thrift's design and implementation, take a gander at
-the Thrift whitepaper included in this distribution or at the README.md files
-in your particular subdirectory of interest.
-
-Hierarchy
-=========
-
-thrift/
-
-  compiler/
-
-    Contains the Thrift compiler, implemented in C++.
-
-  lib/
-
-    Contains the Thrift software library implementation, subdivided by
-    language of implementation.
-
-    cpp/
-    go/
-    java/
-    php/
-    py/
-    rb/
-
-  test/
-
-    Contains sample Thrift files and test code across the target programming
-    languages.
-
-  tutorial/
-
-    Contains a basic tutorial that will teach you how to develop software
-    using Thrift.
-
-Requirements
-============
-
-See http://thrift.apache.org/docs/install for an up-to-date list of build requirements.
-
-Resources
-=========
-
-More information about Thrift can be obtained on the Thrift webpage at:
-
-     http://thrift.apache.org
-
-Acknowledgments
-===============
-
-Thrift was inspired by pillar, a lightweight RPC tool written by Adam D'Angelo,
-and also by Google's protocol buffers.
-
-Installation
-============
-
-If you are building from the first time out of the source repository, you will
-need to generate the configure scripts.  (This is not necessary if you
-downloaded a tarball.)  From the top directory, do:
-
-    ./bootstrap.sh
-
-Once the configure scripts are generated, thrift can be configured.
-From the top directory, do:
-
-    ./configure
-
-You may need to specify the location of the boost files explicitly.
-If you installed boost in /usr/local, you would run configure as follows:
-
-    ./configure --with-boost=/usr/local
-
-Note that by default the thrift C++ library is typically built with debugging
-symbols included. If you want to customize these options you should use the
-CXXFLAGS option in configure, as such:
-
-    ./configure CXXFLAGS='-g -O2'
-    ./configure CFLAGS='-g -O2'
-    ./configure CPPFLAGS='-DDEBUG_MY_FEATURE'
-
-To enable gcov required options -fprofile-arcs -ftest-coverage enable them:
-
-    ./configure  --enable-coverage
-
-Run ./configure --help to see other configuration options
-
-Please be aware that the Python library will ignore the --prefix option
-and just install wherever Python's distutils puts it (usually along
-the lines of /usr/lib/pythonX.Y/site-packages/).  If you need to control
-where the Python modules are installed, set the PY_PREFIX variable.
-(DESTDIR is respected for Python and C++.)
-
-Make thrift:
-
-	make
-
-From the top directory, become superuser and do:
-
-	make install
-
-Note that some language packages must be installed manually using build tools
-better suited to those languages (at the time of this writing, this applies
-to Java, Ruby, PHP).
-
-Look for the README.md file in the lib/<language>/ folder for more details on the
-installation of each language library package.
-
-Testing
-=======
-
-There are a large number of client library tests that can all be run
-from the top-level directory.
-
-          make -k check
-
-This will make all of the libraries (as necessary), and run through
-the unit tests defined in each of the client libraries. If a single
-language fails, the make check will continue on and provide a synopsis
-at the end.
-
-To run the cross-language test suite, please run:
-
-          make cross
-
-This will run a set of tests that use different language clients and
-servers.

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ac_prog_bison.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ac_prog_bison.m4 b/depends/thirdparty/thrift/aclocal/ac_prog_bison.m4
deleted file mode 100644
index 4d1198b..0000000
--- a/depends/thirdparty/thrift/aclocal/ac_prog_bison.m4
+++ /dev/null
@@ -1,54 +0,0 @@
-dnl
-dnl Check Bison version
-dnl AC_PROG_BISON([MIN_VERSION=2.4])
-dnl
-dnl Will define BISON_USE_PARSER_H_EXTENSION if Automake is < 1.11
-dnl for use with .h includes.
-dnl
-
-AC_DEFUN([AC_PROG_BISON], [
-if test "x$1" = "x" ; then
-  bison_required_version="2.4"
-else
-  bison_required_version="$1"
-fi
-
-AC_CHECK_PROG(have_prog_bison, [bison], [yes],[no])
-
-AC_DEFINE_UNQUOTED([BISON_VERSION], [0.0], [Bison version if bison is not available])
-
-#Do not use *.h extension for parser header files, use newer *.hh
-bison_use_parser_h_extension=false
-
-if test "$have_prog_bison" = "yes" ; then
-  AC_MSG_CHECKING([for bison version >= $bison_required_version])
-  bison_version=`bison --version | head -n 1 | cut '-d ' -f 4`
-  AC_DEFINE_UNQUOTED([BISON_VERSION], [$bison_version], [Defines bison version])
-  if test "$bison_version" \< "$bison_required_version" ; then
-    BISON=:
-    AC_MSG_RESULT([no])
-    AC_MSG_ERROR([Bison version $bison_required_version or higher must be installed on the system!])
-  else
-    AC_MSG_RESULT([yes])
-    BISON=bison
-    AC_SUBST(BISON)
-
-    #Verify automake version 1.11 headers for yy files are .h, > 1.12 uses .hh
-    automake_version=`automake --version | head -n 1 | cut '-d ' -f 4`
-    AC_DEFINE_UNQUOTED([AUTOMAKE_VERSION], [$automake_version], [Defines automake version])
-
-    if test "$automake_version" \< "1.12" ; then
-      #Use *.h extension for parser header file
-      bison_use_parser_h_extension=true
-      echo "Automake version < 1.12"
-      AC_DEFINE([BISON_USE_PARSER_H_EXTENSION], [1], [Use *.h extension for parser header file])
-    fi
-  fi
-else
-  BISON=:
-  AC_MSG_RESULT([NO])
-fi
-
-AM_CONDITIONAL([BISON_USE_PARSER_H_EXTENSION], [test x$bison_use_parser_h_extension = xtrue])
-AC_SUBST(BISON)
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_boost_base.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_boost_base.m4 b/depends/thirdparty/thrift/aclocal/ax_boost_base.m4
deleted file mode 100644
index b496020..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_boost_base.m4
+++ /dev/null
@@ -1,272 +0,0 @@
-# ===========================================================================
-#       http://www.gnu.org/software/autoconf-archive/ax_boost_base.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_BOOST_BASE([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# DESCRIPTION
-#
-#   Test for the Boost C++ libraries of a particular version (or newer)
-#
-#   If no path to the installed boost library is given the macro searchs
-#   under /usr, /usr/local, /opt and /opt/local and evaluates the
-#   $BOOST_ROOT environment variable. Further documentation is available at
-#   <http://randspringer.de/boost/index.html>.
-#
-#   This macro calls:
-#
-#     AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
-#
-#   And sets:
-#
-#     HAVE_BOOST
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Thomas Porschberg <th...@randspringer.de>
-#   Copyright (c) 2009 Peter Adolphs
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 23
-
-AC_DEFUN([AX_BOOST_BASE],
-[
-AC_ARG_WITH([boost],
-  [AS_HELP_STRING([--with-boost@<:@=ARG@:>@],
-    [use Boost library from a standard location (ARG=yes),
-     from the specified location (ARG=<path>),
-     or disable it (ARG=no)
-     @<:@ARG=yes@:>@ ])],
-    [
-    if test "$withval" = "no"; then
-        want_boost="no"
-    elif test "$withval" = "yes"; then
-        want_boost="yes"
-        ac_boost_path=""
-    else
-        want_boost="yes"
-        ac_boost_path="$withval"
-    fi
-    ],
-    [want_boost="yes"])
-
-
-AC_ARG_WITH([boost-libdir],
-        AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
-        [Force given directory for boost libraries. Note that this will override library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
-        [
-        if test -d "$withval"
-        then
-                ac_boost_lib_path="$withval"
-        else
-                AC_MSG_ERROR(--with-boost-libdir expected directory name)
-        fi
-        ],
-        [ac_boost_lib_path=""]
-)
-
-if test "x$want_boost" = "xyes"; then
-    boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
-    boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
-    boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
-    boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
-    boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
-    if test "x$boost_lib_version_req_sub_minor" = "x" ; then
-        boost_lib_version_req_sub_minor="0"
-        fi
-    WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+  $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
-    AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
-    succeeded=no
-
-    dnl On 64-bit systems check for system libraries in both lib64 and lib.
-    dnl The former is specified by FHS, but e.g. Debian does not adhere to
-    dnl this (as it rises problems for generic multi-arch support).
-    dnl The last entry in the list is chosen by default when no libraries
-    dnl are found, e.g. when only header-only libraries are installed!
-    libsubdirs="lib"
-    ax_arch=`uname -m`
-    case $ax_arch in
-      x86_64|ppc64|s390x|sparc64|aarch64)
-        libsubdirs="lib64 lib lib64"
-        ;;
-    esac
-
-    dnl allow for real multi-arch paths e.g. /usr/lib/x86_64-linux-gnu. Give
-    dnl them priority over the other paths since, if libs are found there, they
-    dnl are almost assuredly the ones desired.
-    AC_REQUIRE([AC_CANONICAL_HOST])
-    libsubdirs="lib/${host_cpu}-${host_os} $libsubdirs"
-
-    case ${host_cpu} in
-      i?86)
-        libsubdirs="lib/i386-${host_os} $libsubdirs"
-        ;;
-    esac
-
-    dnl first we check the system location for boost libraries
-    dnl this location ist chosen if boost libraries are installed with the --layout=system option
-    dnl or if you install boost with RPM
-    if test "$ac_boost_path" != ""; then
-        BOOST_CPPFLAGS="-I$ac_boost_path/include"
-        for ac_boost_path_tmp in $libsubdirs; do
-                if test -d "$ac_boost_path"/"$ac_boost_path_tmp" ; then
-                        BOOST_LDFLAGS="-L$ac_boost_path/$ac_boost_path_tmp"
-                        break
-                fi
-        done
-    elif test "$cross_compiling" != yes; then
-        for ac_boost_path_tmp in $lt_sysroot/usr $lt_sysroot/usr/local $lt_sysroot/opt $lt_sysroot/opt/local ; do
-            if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
-                for libsubdir in $libsubdirs ; do
-                    if ls "$ac_boost_path_tmp/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
-                done
-                BOOST_LDFLAGS="-L$ac_boost_path_tmp/$libsubdir"
-                BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
-                break;
-            fi
-        done
-    fi
-
-    dnl overwrite ld flags if we have required special directory with
-    dnl --with-boost-libdir parameter
-    if test "$ac_boost_lib_path" != ""; then
-       BOOST_LDFLAGS="-L$ac_boost_lib_path"
-    fi
-
-    CPPFLAGS_SAVED="$CPPFLAGS"
-    CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
-    export CPPFLAGS
-
-    LDFLAGS_SAVED="$LDFLAGS"
-    LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
-    export LDFLAGS
-
-    AC_REQUIRE([AC_PROG_CXX])
-    AC_LANG_PUSH(C++)
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-    @%:@include <boost/version.hpp>
-    ]], [[
-    #if BOOST_VERSION >= $WANT_BOOST_VERSION
-    // Everything is okay
-    #else
-    #  error Boost version is too old
-    #endif
-    ]])],[
-        AC_MSG_RESULT(yes)
-    succeeded=yes
-    found_system=yes
-        ],[
-        ])
-    AC_LANG_POP([C++])
-
-
-
-    dnl if we found no boost with system layout we search for boost libraries
-    dnl built and installed without the --layout=system option or for a staged(not installed) version
-    if test "x$succeeded" != "xyes"; then
-        _version=0
-        if test "$ac_boost_path" != ""; then
-            if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-                for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-                    _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
-                    V_CHECK=`expr $_version_tmp \> $_version`
-                    if test "$V_CHECK" = "1" ; then
-                        _version=$_version_tmp
-                    fi
-                    VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-                    BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
-                done
-            fi
-        else
-            if test "$cross_compiling" != yes; then
-                for ac_boost_path in $lt_sysroot/usr $lt_sysroot/usr/local $lt_sysroot/opt $lt_sysroot/opt/local ; do
-                    if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
-                        for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
-                            _version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
-                            V_CHECK=`expr $_version_tmp \> $_version`
-                            if test "$V_CHECK" = "1" ; then
-                                _version=$_version_tmp
-                                best_path=$ac_boost_path
-                            fi
-                        done
-                    fi
-                done
-
-                VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
-                BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
-                if test "$ac_boost_lib_path" = ""; then
-                    for libsubdir in $libsubdirs ; do
-                        if ls "$best_path/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
-                    done
-                    BOOST_LDFLAGS="-L$best_path/$libsubdir"
-                fi
-            fi
-
-            if test "x$BOOST_ROOT" != "x"; then
-                for libsubdir in $libsubdirs ; do
-                    if ls "$BOOST_ROOT/stage/$libsubdir/libboost_"* >/dev/null 2>&1 ; then break; fi
-                done
-                if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/$libsubdir" && test -r "$BOOST_ROOT/stage/$libsubdir"; then
-                    version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
-                    stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
-                        stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
-                    V_CHECK=`expr $stage_version_shorten \>\= $_version`
-                    if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
-                        AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
-                        BOOST_CPPFLAGS="-I$BOOST_ROOT"
-                        BOOST_LDFLAGS="-L$BOOST_ROOT/stage/$libsubdir"
-                    fi
-                fi
-            fi
-        fi
-
-        CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
-        export CPPFLAGS
-        LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
-        export LDFLAGS
-
-        AC_LANG_PUSH(C++)
-            AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-        @%:@include <boost/version.hpp>
-        ]], [[
-        #if BOOST_VERSION >= $WANT_BOOST_VERSION
-        // Everything is okay
-        #else
-        #  error Boost version is too old
-        #endif
-        ]])],[
-            AC_MSG_RESULT(yes)
-        succeeded=yes
-        found_system=yes
-            ],[
-            ])
-        AC_LANG_POP([C++])
-    fi
-
-    if test "$succeeded" != "yes" ; then
-        if test "$_version" = "0" ; then
-            AC_MSG_NOTICE([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option.  If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
-        else
-            AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
-        fi
-        # execute ACTION-IF-NOT-FOUND (if present):
-        ifelse([$3], , :, [$3])
-    else
-        AC_SUBST(BOOST_CPPFLAGS)
-        AC_SUBST(BOOST_LDFLAGS)
-        AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
-        # execute ACTION-IF-FOUND (if present):
-        ifelse([$2], , :, [$2])
-    fi
-
-    CPPFLAGS="$CPPFLAGS_SAVED"
-    LDFLAGS="$LDFLAGS_SAVED"
-fi
-
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_check_openssl.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_check_openssl.m4 b/depends/thirdparty/thrift/aclocal/ax_check_openssl.m4
deleted file mode 100644
index a87c5a6..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_check_openssl.m4
+++ /dev/null
@@ -1,124 +0,0 @@
-# ===========================================================================
-#     http://www.gnu.org/software/autoconf-archive/ax_check_openssl.html
-# ===========================================================================
-#
-# SYNOPSIS
-#
-#   AX_CHECK_OPENSSL([action-if-found[, action-if-not-found]])
-#
-# DESCRIPTION
-#
-#   Look for OpenSSL in a number of default spots, or in a user-selected
-#   spot (via --with-openssl).  Sets
-#
-#     OPENSSL_INCLUDES to the include directives required
-#     OPENSSL_LIBS to the -l directives required
-#     OPENSSL_LDFLAGS to the -L or -R flags required
-#
-#   and calls ACTION-IF-FOUND or ACTION-IF-NOT-FOUND appropriately
-#
-#   This macro sets OPENSSL_INCLUDES such that source files should use the
-#   openssl/ directory in include directives:
-#
-#     #include <openssl/hmac.h>
-#
-# LICENSE
-#
-#   Copyright (c) 2009,2010 Zmanda Inc. <http://www.zmanda.com/>
-#   Copyright (c) 2009,2010 Dustin J. Mitchell <du...@zmanda.com>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 8
-
-AU_ALIAS([CHECK_SSL], [AX_CHECK_OPENSSL])
-AC_DEFUN([AX_CHECK_OPENSSL], [
-    found=false
-    AC_ARG_WITH([openssl],
-        [AS_HELP_STRING([--with-openssl=DIR],
-            [root of the OpenSSL directory])],
-        [
-            case "$withval" in
-            "" | y | ye | yes | n | no)
-            AC_MSG_ERROR([Invalid --with-openssl value])
-              ;;
-            *) ssldirs="$withval"
-              ;;
-            esac
-        ], [
-            # if pkg-config is installed and openssl has installed a .pc file,
-            # then use that information and don't search ssldirs
-            AC_PATH_PROG([PKG_CONFIG], [pkg-config])
-            if test x"$PKG_CONFIG" != x""; then
-                OPENSSL_LDFLAGS=`$PKG_CONFIG openssl --libs-only-L 2>/dev/null`
-                if test $? = 0; then
-                    OPENSSL_LIBS=`$PKG_CONFIG openssl --libs-only-l 2>/dev/null`
-                    OPENSSL_INCLUDES=`$PKG_CONFIG openssl --cflags-only-I 2>/dev/null`
-                    found=true
-                fi
-            fi
-
-            # no such luck; use some default ssldirs
-            if ! $found; then
-                ssldirs="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr"
-            fi
-        ]
-        )
-
-
-    # note that we #include <openssl/foo.h>, so the OpenSSL headers have to be in
-    # an 'openssl' subdirectory
-
-    if ! $found; then
-        OPENSSL_INCLUDES=
-        for ssldir in $ssldirs; do
-            AC_MSG_CHECKING([for openssl/ssl.h in $ssldir])
-            if test -f "$ssldir/include/openssl/ssl.h"; then
-                OPENSSL_INCLUDES="-I$ssldir/include"
-                OPENSSL_LDFLAGS="-L$ssldir/lib"
-                OPENSSL_LIBS="-lssl -lcrypto"
-                found=true
-                AC_MSG_RESULT([yes])
-                break
-            else
-                AC_MSG_RESULT([no])
-            fi
-        done
-
-        # if the file wasn't found, well, go ahead and try the link anyway -- maybe
-        # it will just work!
-    fi
-
-    # try the preprocessor and linker with our new flags,
-    # being careful not to pollute the global LIBS, LDFLAGS, and CPPFLAGS
-
-    AC_MSG_CHECKING([whether compiling and linking against OpenSSL works])
-    echo "Trying link with OPENSSL_LDFLAGS=$OPENSSL_LDFLAGS;" \
-        "OPENSSL_LIBS=$OPENSSL_LIBS; OPENSSL_INCLUDES=$OPENSSL_INCLUDES" >&AS_MESSAGE_LOG_FD
-
-    save_LIBS="$LIBS"
-    save_LDFLAGS="$LDFLAGS"
-    save_CPPFLAGS="$CPPFLAGS"
-    LDFLAGS="$LDFLAGS $OPENSSL_LDFLAGS"
-    LIBS="$OPENSSL_LIBS $LIBS"
-    CPPFLAGS="$OPENSSL_INCLUDES $CPPFLAGS"
-    AC_LINK_IFELSE(
-        [AC_LANG_PROGRAM([#include <openssl/ssl.h>], [SSL_new(NULL)])],
-        [
-            AC_MSG_RESULT([yes])
-            $1
-        ], [
-            AC_MSG_RESULT([no])
-            $2
-        ])
-    CPPFLAGS="$save_CPPFLAGS"
-    LDFLAGS="$save_LDFLAGS"
-    LIBS="$save_LIBS"
-
-    AC_SUBST([OPENSSL_INCLUDES])
-    AC_SUBST([OPENSSL_LIBS])
-    AC_SUBST([OPENSSL_LDFLAGS])
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_cxx_compile_stdcxx_11.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_cxx_compile_stdcxx_11.m4 b/depends/thirdparty/thrift/aclocal/ax_cxx_compile_stdcxx_11.m4
deleted file mode 100644
index a9a8f58..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_cxx_compile_stdcxx_11.m4
+++ /dev/null
@@ -1,165 +0,0 @@
-# ============================================================================
-#  http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html
-# ============================================================================
-#
-# SYNOPSIS
-#
-#   AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional])
-#
-# DESCRIPTION
-#
-#   Check for baseline language coverage in the compiler for the C++11
-#   standard; if necessary, add switches to CXXFLAGS to enable support.
-#
-#   The first argument, if specified, indicates whether you insist on an
-#   extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g.
-#   -std=c++11).  If neither is specified, you get whatever works, with
-#   preference for an extended mode.
-#
-#   The second argument, if specified 'mandatory' or if left unspecified,
-#   indicates that baseline C++11 support is required and that the macro
-#   should error out if no mode with that support is found.  If specified
-#   'optional', then configuration proceeds regardless, after defining
-#   HAVE_CXX11 if and only if a supporting mode is found.
-#
-# LICENSE
-#
-#   Copyright (c) 2008 Benjamin Kosnik <bk...@redhat.com>
-#   Copyright (c) 2012 Zack Weinberg <za...@panix.com>
-#   Copyright (c) 2013 Roy Stogner <ro...@ices.utexas.edu>
-#   Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <so...@google.com>
-#
-#   Copying and distribution of this file, with or without modification, are
-#   permitted in any medium without royalty provided the copyright notice
-#   and this notice are preserved. This file is offered as-is, without any
-#   warranty.
-
-#serial 10
-
-m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[
-  template <typename T>
-    struct check
-    {
-      static_assert(sizeof(int) <= sizeof(T), "not big enough");
-    };
-
-    struct Base {
-    virtual void f() {}
-    };
-    struct Child : public Base {
-    virtual void f() override {}
-    };
-
-    typedef check<check<bool>> right_angle_brackets;
-
-    int a;
-    decltype(a) b;
-
-    typedef check<int> check_type;
-    check_type c;
-    check_type&& cr = static_cast<check_type&&>(c);
-
-    auto d = a;
-    auto l = [](){};
-    // Prevent Clang error: unused variable 'l' [-Werror,-Wunused-variable]
-    struct use_l { use_l() { l(); } };
-
-    // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae
-    // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function because of this
-    namespace test_template_alias_sfinae {
-        struct foo {};
-
-        template<typename T>
-        using member = typename T::member_type;
-
-        template<typename T>
-        void func(...) {}
-
-        template<typename T>
-        void func(member<T>*) {}
-
-        void test();
-
-        void test() {
-            func<foo>(0);
-        }
-    }
-]])
-
-AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl
-  m4_if([$1], [], [],
-        [$1], [ext], [],
-        [$1], [noext], [],
-        [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl
-  m4_if([$2], [], [ax_cxx_compile_cxx11_required=true],
-        [$2], [mandatory], [ax_cxx_compile_cxx11_required=true],
-        [$2], [optional], [ax_cxx_compile_cxx11_required=false],
-        [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])])
-  AC_LANG_PUSH([C++])dnl
-  ac_success=no
-  AC_CACHE_CHECK(whether $CXX supports C++11 features by default,
-  ax_cv_cxx_compile_cxx11,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-    [ax_cv_cxx_compile_cxx11=yes],
-    [ax_cv_cxx_compile_cxx11=no])])
-  if test x$ax_cv_cxx_compile_cxx11 = xyes; then
-    ac_success=yes
-  fi
-
-  m4_if([$1], [noext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=gnu++11 -std=gnu++0x; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-
-  m4_if([$1], [ext], [], [dnl
-  if test x$ac_success = xno; then
-    for switch in -std=c++11 -std=c++0x; do
-      cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch])
-      AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch,
-                     $cachevar,
-        [ac_save_CXXFLAGS="$CXXFLAGS"
-         CXXFLAGS="$CXXFLAGS $switch"
-         AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])],
-          [eval $cachevar=yes],
-          [eval $cachevar=no])
-         CXXFLAGS="$ac_save_CXXFLAGS"])
-      if eval test x\$$cachevar = xyes; then
-        CXXFLAGS="$CXXFLAGS $switch"
-        ac_success=yes
-        break
-      fi
-    done
-  fi])
-  AC_LANG_POP([C++])
-  if test x$ax_cxx_compile_cxx11_required = xtrue; then
-    if test x$ac_success = xno; then
-      AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.])
-    fi
-  else
-    if test x$ac_success = xno; then
-      HAVE_CXX11=0
-      AC_MSG_NOTICE([No compiler with C++11 support was found])
-    else
-      HAVE_CXX11=1
-      AC_DEFINE(HAVE_CXX11,1,
-                [define if the compiler supports basic C++11 syntax])
-    fi
-
-    AC_SUBST(HAVE_CXX11)
-  fi
-])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_dmd.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_dmd.m4 b/depends/thirdparty/thrift/aclocal/ax_dmd.m4
deleted file mode 100644
index 13b84b0..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_dmd.m4
+++ /dev/null
@@ -1,107 +0,0 @@
-dnl @synopsis AX_DMD
-dnl
-dnl Test for the presence of a DMD-compatible D2 compiler, and (optionally)
-dnl specified modules on the import path.
-dnl
-dnl If "DMD" is defined in the environment, that will be the only
-dnl dmd command tested. Otherwise, a hard-coded list will be used.
-dnl
-dnl After AX_DMD runs, the shell variables "success" and "ax_dmd" are set to
-dnl "yes" or "no", and "DMD" is set to the appropriate command. Furthermore,
-dnl "dmd_optlink" will be set to "yes" or "no" depending on whether OPTLINK is
-dnl used as the linker (DMD/Windows), and "dmd_of_dirsep" will be set to the
-dnl directory separator to use when passing -of to DMD (OPTLINK requires a
-dnl backslash).
-dnl
-dnl AX_CHECK_D_MODULE must be run after AX_DMD. It tests for the presence of a
-dnl module in the import path of the chosen compiler, and sets the shell
-dnl variable "success" to "yes" or "no".
-dnl
-dnl @category D
-dnl @version 2011-05-31
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copyright (C) 2011 David Nadlinger
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-
-AC_DEFUN([AX_DMD],
-         [
-          dnl Hard-coded default commands to test.
-          DMD_PROGS="dmd,gdmd,ldmd"
-
-          dnl Allow the user to specify an alternative.
-          if test -n "$DMD" ; then
-            DMD_PROGS="$DMD"
-          fi
-
-          AC_MSG_CHECKING(for DMD)
-
-          # std.algorithm as a quick way to check for D2/Phobos.
-          echo "import std.algorithm; void main() {}" > configtest_ax_dmd.d
-          success=no
-          oIFS="$IFS"
-
-          IFS=","
-          for DMD in $DMD_PROGS ; do
-            IFS="$oIFS"
-
-            echo "Running \"$DMD configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
-            if $DMD configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
-              success=yes
-              break
-            fi
-          done
-
-          if test "$success" != "yes" ; then
-            AC_MSG_RESULT(no)
-            DMD=""
-          else
-            AC_MSG_RESULT(yes)
-          fi
-
-          ax_dmd="$success"
-
-          # Test whether OPTLINK is used by trying if DMD accepts -L/? without
-          # erroring out.
-          if test "$success" == "yes" ; then
-            AC_MSG_CHECKING(whether DMD uses OPTLINK)
-            echo "Running \\u201d$DMD -L/? configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
-            if $DMD -L/? configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
-              AC_MSG_RESULT(yes)
-              dmd_optlink="yes"
-
-              # This actually produces double slashes in the final configure
-              # output, but at least it works.
-              dmd_of_dirsep="\\\\"
-            else
-              AC_MSG_RESULT(no)
-              dmd_optlink="no"
-              dmd_of_dirsep="/"
-            fi
-          fi
-
-          rm -f configtest_ax_dmd*
-         ])
-
-
-AC_DEFUN([AX_CHECK_D_MODULE],
-         [
-          AC_MSG_CHECKING(for D module [$1])
-
-          echo "import $1; void main() {}" > configtest_ax_dmd.d
-
-          echo "Running \"$DMD configtest_ax_dmd.d\"" >&AS_MESSAGE_LOG_FD
-          if $DMD -c configtest_ax_dmd.d >&AS_MESSAGE_LOG_FD 2>&1 ; then
-            AC_MSG_RESULT(yes)
-            success=yes
-          else
-            AC_MSG_RESULT(no)
-            success=no
-          fi
-
-          rm -f configtest_ax_dmd*
-         ])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_javac_and_java.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_javac_and_java.m4 b/depends/thirdparty/thrift/aclocal/ax_javac_and_java.m4
deleted file mode 100644
index f341f50..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_javac_and_java.m4
+++ /dev/null
@@ -1,129 +0,0 @@
-dnl @synopsis AX_JAVAC_AND_JAVA
-dnl @synopsis AX_CHECK_JAVA_CLASS(CLASSNAME)
-dnl
-dnl Test for the presence of a JDK, and (optionally) specific classes.
-dnl
-dnl If "JAVA" is defined in the environment, that will be the only
-dnl java command tested.  Otherwise, a hard-coded list will be used.
-dnl Similarly for "JAVAC".
-dnl
-dnl AX_JAVAC_AND_JAVA does not currently support testing for a particular
-dnl Java version, testing for only one of "java" and "javac", or
-dnl compiling or running user-provided Java code.
-dnl
-dnl After AX_JAVAC_AND_JAVA runs, the shell variables "success" and
-dnl "ax_javac_and_java" are set to "yes" or "no", and "JAVAC" and
-dnl "JAVA" are set to the appropriate commands.
-dnl
-dnl AX_CHECK_JAVA_CLASS must be run after AX_JAVAC_AND_JAVA.
-dnl It tests for the presence of a class based on a fully-qualified name.
-dnl It sets the shell variable "success" to "yes" or "no".
-dnl
-dnl @category Java
-dnl @version 2009-02-09
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-
-AC_DEFUN([AX_JAVAC_AND_JAVA],
-         [
-
-          dnl Hard-coded default commands to test.
-          JAVAC_PROGS="javac,jikes,gcj -C"
-          JAVA_PROGS="java,kaffe"
-
-          dnl Allow the user to specify an alternative.
-          if test -n "$JAVAC" ; then
-            JAVAC_PROGS="$JAVAC"
-          fi
-          if test -n "$JAVA" ; then
-            JAVA_PROGS="$JAVA"
-          fi
-
-          AC_MSG_CHECKING(for javac and java)
-
-          echo "public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
-          success=no
-          oIFS="$IFS"
-
-          IFS=","
-          for JAVAC in $JAVAC_PROGS ; do
-            IFS="$oIFS"
-
-            echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
-            if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-
-              # prevent $JAVA VM issues with UTF-8 path names (THRIFT-3271)
-              oLC_ALL="$LC_ALL"
-              LC_ALL=""
-
-              IFS=","
-              for JAVA in $JAVA_PROGS ; do
-                IFS="$oIFS"
-
-                echo "Running \"$JAVA configtest_ax_javac_and_java\"" >&AS_MESSAGE_LOG_FD
-                if $JAVA configtest_ax_javac_and_java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-                  success=yes
-                  break 2
-                fi
-
-              done
-
-              # restore LC_ALL
-              LC_ALL="$oLC_ALL"
-              oLC_ALL=""
-
-            fi
-
-          done
-
-          rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
-
-          if test "$success" != "yes" ; then
-            AC_MSG_RESULT(no)
-            JAVAC=""
-            JAVA=""
-          else
-            AC_MSG_RESULT(yes)
-          fi
-
-          ax_javac_and_java="$success"
-
-          ])
-
-
-AC_DEFUN([AX_CHECK_JAVA_CLASS],
-         [
-          AC_MSG_CHECKING(for Java class [$1])
-
-          echo "import $1; public class configtest_ax_javac_and_java { public static void main(String args@<:@@:>@) { } }" > configtest_ax_javac_and_java.java
-
-          echo "Running \"$JAVAC configtest_ax_javac_and_java.java\"" >&AS_MESSAGE_LOG_FD
-          if $JAVAC configtest_ax_javac_and_java.java >&AS_MESSAGE_LOG_FD 2>&1 ; then
-            AC_MSG_RESULT(yes)
-            success=yes
-          else
-            AC_MSG_RESULT(no)
-            success=no
-          fi
-
-          rm -f configtest_ax_javac_and_java.java configtest_ax_javac_and_java.class
-          ])
-
-
-AC_DEFUN([AX_CHECK_ANT_VERSION],
-         [
-          AC_MSG_CHECKING(for ant version > $2)
-          ANT_VALID=`expr $($1 -version 2>/dev/null | sed -n 's/.*version \(@<:@0-9\.@:>@*\).*/\1/p') \>= $2`
-          if test "x$ANT_VALID" = "x1" ; then
-            AC_MSG_RESULT(yes)
-          else
-            AC_MSG_RESULT(no)
-            ANT=""
-          fi
-          ])
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_lib_event.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_lib_event.m4 b/depends/thirdparty/thrift/aclocal/ax_lib_event.m4
deleted file mode 100644
index d4dcdc9..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_lib_event.m4
+++ /dev/null
@@ -1,194 +0,0 @@
-dnl @synopsis AX_LIB_EVENT([MINIMUM-VERSION])
-dnl
-dnl Test for the libevent library of a particular version (or newer).
-dnl
-dnl If no path to the installed libevent is given, the macro will first try
-dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
-dnl and /opt/libevent.
-dnl If these all fail, it will try the $LIBEVENT_ROOT environment variable.
-dnl
-dnl This macro requires that #include <sys/types.h> works and defines u_char.
-dnl
-dnl This macro calls:
-dnl   AC_SUBST(LIBEVENT_CPPFLAGS)
-dnl   AC_SUBST(LIBEVENT_LDFLAGS)
-dnl   AC_SUBST(LIBEVENT_LIBS)
-dnl
-dnl And (if libevent is found):
-dnl   AC_DEFINE(HAVE_LIBEVENT)
-dnl
-dnl It also leaves the shell variables "success" and "ax_have_libevent"
-dnl set to "yes" or "no".
-dnl
-dnl NOTE: This macro does not currently work for cross-compiling,
-dnl       but it can be easily modified to allow it.  (grep "cross").
-dnl
-dnl @category InstalledPackages
-dnl @category C
-dnl @version 2007-09-12
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-dnl Input: ax_libevent_path, WANT_LIBEVENT_VERSION
-dnl Output: success=yes/no
-AC_DEFUN([AX_LIB_EVENT_DO_CHECK],
-         [
-          # Save our flags.
-          CPPFLAGS_SAVED="$CPPFLAGS"
-          LDFLAGS_SAVED="$LDFLAGS"
-          LIBS_SAVED="$LIBS"
-          LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"
-
-          # Set our flags if we are checking a specific directory.
-          if test -n "$ax_libevent_path" ; then
-            LIBEVENT_CPPFLAGS="-I$ax_libevent_path/include"
-            LIBEVENT_LDFLAGS="-L$ax_libevent_path/lib"
-            LD_LIBRARY_PATH="$ax_libevent_path/lib:$LD_LIBRARY_PATH"
-          else
-            LIBEVENT_CPPFLAGS=""
-            LIBEVENT_LDFLAGS=""
-          fi
-
-          # Required flag for libevent.
-          LIBEVENT_LIBS="-levent"
-
-          # Prepare the environment for compilation.
-          CPPFLAGS="$CPPFLAGS $LIBEVENT_CPPFLAGS"
-          LDFLAGS="$LDFLAGS $LIBEVENT_LDFLAGS"
-          LIBS="$LIBS $LIBEVENT_LIBS"
-          export CPPFLAGS
-          export LDFLAGS
-          export LIBS
-          export LD_LIBRARY_PATH
-
-          success=no
-
-          # Compile, link, and run the program.  This checks:
-          # - event.h is available for including.
-          # - event_get_version() is available for linking.
-          # - The event version string is lexicographically greater
-          #   than the required version.
-          AC_LANG_PUSH([C])
-          dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling,
-          dnl but then the version cannot be checked.
-          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-          #include <sys/types.h>
-          #include <event.h>
-          ]], [[
-          const char* lib_version = event_get_version();
-          const char* wnt_version = "$WANT_LIBEVENT_VERSION";
-          int lib_digits;
-          int wnt_digits;
-          for (;;) {
-            /* If we reached the end of the want version.  We have it. */
-            if (*wnt_version == '\0' || *wnt_version == '-') {
-              return 0;
-            }
-            /* If the want version continues but the lib version does not, */
-            /* we are missing a letter.  We don't have it. */
-            if (*lib_version == '\0' || *lib_version == '-') {
-              return 1;
-            }
-            /* In the 1.4 version numbering style, if there are more digits */
-            /* in one version than the other, that one is higher. */
-            for (lib_digits = 0;
-                lib_version[lib_digits] >= '0' &&
-                lib_version[lib_digits] <= '9';
-                lib_digits++)
-              ;
-            for (wnt_digits = 0;
-                wnt_version[wnt_digits] >= '0' &&
-                wnt_version[wnt_digits] <= '9';
-                wnt_digits++)
-              ;
-            if (lib_digits > wnt_digits) {
-              return 0;
-            }
-            if (lib_digits < wnt_digits) {
-              return 1;
-            }
-            /* If we have greater than what we want.  We have it. */
-            if (*lib_version > *wnt_version) {
-              return 0;
-            }
-            /* If we have less, we don't. */
-            if (*lib_version < *wnt_version) {
-              return 1;
-            }
-            lib_version++;
-            wnt_version++;
-          }
-          return 0;
-          ]])], [
-          success=yes
-          ])
-          AC_LANG_POP([C])
-
-          # Restore flags.
-          CPPFLAGS="$CPPFLAGS_SAVED"
-          LDFLAGS="$LDFLAGS_SAVED"
-          LIBS="$LIBS_SAVED"
-          LD_LIBRARY_PATH="$LD_LIBRARY_PATH_SAVED"
-         ])
-
-
-AC_DEFUN([AX_LIB_EVENT],
-         [
-
-          dnl Allow search path to be overridden on the command line.
-          AC_ARG_WITH([libevent],
-                      AS_HELP_STRING([--with-libevent@<:@=DIR@:>@], [use libevent [default=yes]. Optionally specify the root prefix dir where libevent is installed]),
-                      [
-                       if test "x$withval" = "xno"; then
-                         want_libevent="no"
-                       elif test "x$withval" = "xyes"; then
-                         want_libevent="yes"
-                         ax_libevent_path=""
-                       else
-                         want_libevent="yes"
-                         ax_libevent_path="$withval"
-                       fi
-                       ],
-                       [ want_libevent="yes" ; ax_libevent_path="" ])
-
-
-          if test "$want_libevent" = "yes"; then
-            WANT_LIBEVENT_VERSION=ifelse([$1], ,1.2,$1)
-
-            AC_MSG_CHECKING(for libevent >= $WANT_LIBEVENT_VERSION)
-
-            # Run tests.
-            if test -n "$ax_libevent_path"; then
-              AX_LIB_EVENT_DO_CHECK
-            else
-              for ax_libevent_path in "" $lt_sysroot/usr $lt_sysroot/usr/local $lt_sysroot/opt $lt_sysroot/opt/local $lt_sysroot/opt/libevent "$LIBEVENT_ROOT" ; do
-                AX_LIB_EVENT_DO_CHECK
-                if test "$success" = "yes"; then
-                  break;
-                fi
-              done
-            fi
-
-            if test "$success" != "yes" ; then
-              AC_MSG_RESULT(no)
-              LIBEVENT_CPPFLAGS=""
-              LIBEVENT_LDFLAGS=""
-              LIBEVENT_LIBS=""
-            else
-              AC_MSG_RESULT(yes)
-              AC_DEFINE(HAVE_LIBEVENT,,[define if libevent is available])
-              ax_have_libevent_[]m4_translit([$1], [.], [_])="yes"
-            fi
-
-            ax_have_libevent="$success"
-
-            AC_SUBST(LIBEVENT_CPPFLAGS)
-            AC_SUBST(LIBEVENT_LDFLAGS)
-            AC_SUBST(LIBEVENT_LIBS)
-          fi
-
-          ])

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/aclocal/ax_lib_zlib.m4
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/aclocal/ax_lib_zlib.m4 b/depends/thirdparty/thrift/aclocal/ax_lib_zlib.m4
deleted file mode 100644
index bdb9e11..0000000
--- a/depends/thirdparty/thrift/aclocal/ax_lib_zlib.m4
+++ /dev/null
@@ -1,173 +0,0 @@
-dnl @synopsis AX_LIB_ZLIB([MINIMUM-VERSION])
-dnl
-dnl Test for the libz library of a particular version (or newer).
-dnl
-dnl If no path to the installed zlib is given, the macro will first try
-dnl using no -I or -L flags, then searches under /usr, /usr/local, /opt,
-dnl and /opt/zlib.
-dnl If these all fail, it will try the $ZLIB_ROOT environment variable.
-dnl
-dnl This macro calls:
-dnl   AC_SUBST(ZLIB_CPPFLAGS)
-dnl   AC_SUBST(ZLIB_LDFLAGS)
-dnl   AC_SUBST(ZLIB_LIBS)
-dnl
-dnl And (if zlib is found):
-dnl   AC_DEFINE(HAVE_ZLIB)
-dnl
-dnl It also leaves the shell variables "success" and "ax_have_zlib"
-dnl set to "yes" or "no".
-dnl
-dnl NOTE: This macro does not currently work for cross-compiling,
-dnl       but it can be easily modified to allow it.  (grep "cross").
-dnl
-dnl @category InstalledPackages
-dnl @category C
-dnl @version 2007-09-12
-dnl @license AllPermissive
-dnl
-dnl Copyright (C) 2009 David Reiss
-dnl Copying and distribution of this file, with or without modification,
-dnl are permitted in any medium without royalty provided the copyright
-dnl notice and this notice are preserved.
-
-dnl Input: ax_zlib_path, WANT_ZLIB_VERSION
-dnl Output: success=yes/no
-AC_DEFUN([AX_LIB_ZLIB_DO_CHECK],
-         [
-          # Save our flags.
-          CPPFLAGS_SAVED="$CPPFLAGS"
-          LDFLAGS_SAVED="$LDFLAGS"
-          LIBS_SAVED="$LIBS"
-          LD_LIBRARY_PATH_SAVED="$LD_LIBRARY_PATH"
-
-          # Set our flags if we are checking a specific directory.
-          if test -n "$ax_zlib_path" ; then
-            ZLIB_CPPFLAGS="-I$ax_zlib_path/include"
-            ZLIB_LDFLAGS="-L$ax_zlib_path/lib"
-            LD_LIBRARY_PATH="$ax_zlib_path/lib:$LD_LIBRARY_PATH"
-          else
-            ZLIB_CPPFLAGS=""
-            ZLIB_LDFLAGS=""
-          fi
-
-          # Required flag for zlib.
-          ZLIB_LIBS="-lz"
-
-          # Prepare the environment for compilation.
-          CPPFLAGS="$CPPFLAGS $ZLIB_CPPFLAGS"
-          LDFLAGS="$LDFLAGS $ZLIB_LDFLAGS"
-          LIBS="$LIBS $ZLIB_LIBS"
-          export CPPFLAGS
-          export LDFLAGS
-          export LIBS
-          export LD_LIBRARY_PATH
-
-          success=no
-
-          # Compile, link, and run the program.  This checks:
-          # - zlib.h is available for including.
-          # - zlibVersion() is available for linking.
-          # - ZLIB_VERNUM is greater than or equal to the desired version.
-          # - ZLIB_VERSION (defined in zlib.h) matches zlibVersion()
-          #   (defined in the library).
-          AC_LANG_PUSH([C])
-          dnl This can be changed to AC_LINK_IFELSE if you are cross-compiling.
-          AC_LINK_IFELSE([AC_LANG_PROGRAM([[
-          #include <zlib.h>
-          #if ZLIB_VERNUM >= 0x$WANT_ZLIB_VERSION
-          #else
-          # error zlib is too old
-          #endif
-          ]], [[
-          const char* lib_version = zlibVersion();
-          const char* hdr_version = ZLIB_VERSION;
-          for (;;) {
-            if (*lib_version != *hdr_version) {
-              /* If this happens, your zlib header doesn't match your zlib */
-              /* library.  That is really bad. */
-              return 1;
-            }
-            if (*lib_version == '\0') {
-              break;
-            }
-            lib_version++;
-            hdr_version++;
-          }
-          return 0;
-          ]])], [
-          success=yes
-          ])
-          AC_LANG_POP([C])
-
-          # Restore flags.
-          CPPFLAGS="$CPPFLAGS_SAVED"
-          LDFLAGS="$LDFLAGS_SAVED"
-          LIBS="$LIBS_SAVED"
-          LD_LIBRARY_PATH="$LD_LIBRARY_PATH_SAVED"
-         ])
-
-
-AC_DEFUN([AX_LIB_ZLIB],
-         [
-
-          dnl Allow search path to be overridden on the command line.
-          AC_ARG_WITH([zlib],
-                      AS_HELP_STRING([--with-zlib@<:@=DIR@:>@], [use zlib (default is yes) - it is possible to specify an alternate root directory for zlib]),
-                      [
-                       if test "x$withval" = "xno"; then
-                         want_zlib="no"
-                       elif test "x$withval" = "xyes"; then
-                         want_zlib="yes"
-                         ax_zlib_path=""
-                       else
-                         want_zlib="yes"
-                         ax_zlib_path="$withval"
-                       fi
-                       ],
-                       [want_zlib="yes" ; ax_zlib_path="" ])
-
-
-          if test "$want_zlib" = "yes"; then
-            # Parse out the version.
-            zlib_version_req=ifelse([$1], ,1.2.3,$1)
-            zlib_version_req_major=`expr $zlib_version_req : '\([[0-9]]*\)'`
-            zlib_version_req_minor=`expr $zlib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
-            zlib_version_req_patch=`expr $zlib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
-            if test -z "$zlib_version_req_patch" ; then
-              zlib_version_req_patch="0"
-            fi
-            WANT_ZLIB_VERSION=`expr $zlib_version_req_major \* 1000 \+  $zlib_version_req_minor \* 100 \+ $zlib_version_req_patch \* 10`
-
-            AC_MSG_CHECKING(for zlib >= $zlib_version_req)
-
-            # Run tests.
-            if test -n "$ax_zlib_path"; then
-              AX_LIB_ZLIB_DO_CHECK
-            else
-              for ax_zlib_path in "" /usr /usr/local /opt /opt/zlib "$ZLIB_ROOT" ; do
-                AX_LIB_ZLIB_DO_CHECK
-                if test "$success" = "yes"; then
-                  break;
-                fi
-              done
-            fi
-
-            if test "$success" != "yes" ; then
-              AC_MSG_RESULT(no)
-              ZLIB_CPPFLAGS=""
-              ZLIB_LDFLAGS=""
-              ZLIB_LIBS=""
-            else
-              AC_MSG_RESULT(yes)
-              AC_DEFINE(HAVE_ZLIB,,[define if zlib is available])
-            fi
-
-            ax_have_zlib="$success"
-
-            AC_SUBST(ZLIB_CPPFLAGS)
-            AC_SUBST(ZLIB_LDFLAGS)
-            AC_SUBST(ZLIB_LIBS)
-          fi
-
-          ])


[05/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj b/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj
deleted file mode 100755
index 259bb20..0000000
--- a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj
+++ /dev/null
@@ -1,293 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug-mt|Win32">
-      <Configuration>Debug-mt</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug-mt|x64">
-      <Configuration>Debug-mt</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release-mt|Win32">
-      <Configuration>Release-mt</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release-mt|x64">
-      <Configuration>Release-mt</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\thrift\async\TAsyncProtocolProcessor.cpp"/>
-    <ClCompile Include="src\thrift\async\TEvhttpClientChannel.cpp"/>
-    <ClCompile Include="src\thrift\async\TEvhttpServer.cpp"/>
-    <ClCompile Include="src\thrift\server\TNonblockingServer.cpp"/>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\thrift\async\TAsyncProtocolProcessor.h" />
-    <ClInclude Include="src\thrift\async\TEvhttpClientChannel.h" />
-    <ClInclude Include="src\thrift\async\TEvhttpServer.h" />
-    <ClInclude Include="src\thrift\server\TNonblockingServer.h" />
-    <ClInclude Include="src\thrift\windows\config.h" />
-    <ClInclude Include="src\thrift\windows\force_inc.h" />
-    <ClInclude Include="src\thrift\windows\TargetVersion.h" />
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{D8696CCE-7D46-4659-B432-91754A41DEB0}</ProjectGuid>
-    <Keyword>Win32Proj</Keyword>
-    <RootNamespace>libthriftnb</RootNamespace>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>true</UseDebugLibraries>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <UseDebugLibraries>false</UseDebugLibraries>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-    <CharacterSet>MultiByte</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-    <Import Project="3rdparty.props" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'">
-    <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'">
-    <ClCompile>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level3</WarningLevel>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'">
-    <ClCompile>
-      <WarningLevel>Level3</WarningLevel>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <Optimization>MaxSpeed</Optimization>
-      <FunctionLevelLinking>true</FunctionLevelLinking>
-      <IntrinsicFunctions>true</IntrinsicFunctions>
-      <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-    </ClCompile>
-    <Link>
-      <SubSystem>Windows</SubSystem>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <OptimizeReferences>true</OptimizeReferences>
-    </Link>
-  </ItemDefinitionGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters b/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters
deleted file mode 100644
index 5245544..0000000
--- a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters
+++ /dev/null
@@ -1,57 +0,0 @@
-\ufeff<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup>
-    <Filter Include="server">
-      <UniqueIdentifier>{bf449d92-4be8-4f6f-a010-c536f57c6f13}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="async">
-      <UniqueIdentifier>{0294d0a6-ce46-4be8-a659-826d6e98ae41}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="windows">
-      <UniqueIdentifier>{60fc9e5e-0866-4aba-8662-439bb4a461d3}</UniqueIdentifier>
-    </Filter>
-  </ItemGroup>
-  <ItemGroup>
-    <ClCompile Include="src\thrift\server\TNonblockingServer.cpp">
-      <Filter>server</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\async\TEvhttpClientChannel.cpp">
-      <Filter>async</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\async\TEvhttpServer.cpp">
-      <Filter>async</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\async\TAsyncProtocolProcessor.cpp">
-      <Filter>async</Filter>
-    </ClCompile>
-    <ClCompile Include="src\thrift\windows\StdAfx.cpp">
-      <Filter>windows</Filter>
-    </ClCompile>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="src\thrift\server\TNonblockingServer.h">
-      <Filter>server</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\async\TEvhttpClientChannel.h">
-      <Filter>async</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\async\TEvhttpServer.h">
-      <Filter>async</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\async\TAsyncProtocolProcessor.h">
-      <Filter>async</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\config.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\StdAfx.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\TargetVersion.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-    <ClInclude Include="src\thrift\windows\force_inc.h">
-      <Filter>windows</Filter>
-    </ClInclude>
-  </ItemGroup>
-</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp
deleted file mode 100644
index 2f14653..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/TApplicationException.h>
-#include <thrift/protocol/TProtocol.h>
-
-namespace apache {
-namespace thrift {
-
-uint32_t TApplicationException::read(apache::thrift::protocol::TProtocol* iprot) {
-  uint32_t xfer = 0;
-  std::string fname;
-  apache::thrift::protocol::TType ftype;
-  int16_t fid;
-
-  xfer += iprot->readStructBegin(fname);
-
-  while (true) {
-    xfer += iprot->readFieldBegin(fname, ftype, fid);
-    if (ftype == apache::thrift::protocol::T_STOP) {
-      break;
-    }
-    switch (fid) {
-    case 1:
-      if (ftype == apache::thrift::protocol::T_STRING) {
-        xfer += iprot->readString(message_);
-      } else {
-        xfer += iprot->skip(ftype);
-      }
-      break;
-    case 2:
-      if (ftype == apache::thrift::protocol::T_I32) {
-        int32_t type;
-        xfer += iprot->readI32(type);
-        type_ = (TApplicationExceptionType)type;
-      } else {
-        xfer += iprot->skip(ftype);
-      }
-      break;
-    default:
-      xfer += iprot->skip(ftype);
-      break;
-    }
-    xfer += iprot->readFieldEnd();
-  }
-
-  xfer += iprot->readStructEnd();
-  return xfer;
-}
-
-uint32_t TApplicationException::write(apache::thrift::protocol::TProtocol* oprot) const {
-  uint32_t xfer = 0;
-  xfer += oprot->writeStructBegin("TApplicationException");
-  xfer += oprot->writeFieldBegin("message", apache::thrift::protocol::T_STRING, 1);
-  xfer += oprot->writeString(message_);
-  xfer += oprot->writeFieldEnd();
-  xfer += oprot->writeFieldBegin("type", apache::thrift::protocol::T_I32, 2);
-  xfer += oprot->writeI32(type_);
-  xfer += oprot->writeFieldEnd();
-  xfer += oprot->writeFieldStop();
-  xfer += oprot->writeStructEnd();
-  return xfer;
-}
-}
-} // apache::thrift

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h
deleted file mode 100644
index 0de5391..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_
-#define _THRIFT_TAPPLICATIONEXCEPTION_H_ 1
-
-#include <thrift/Thrift.h>
-
-namespace apache {
-namespace thrift {
-
-namespace protocol {
-class TProtocol;
-}
-
-class TApplicationException : public TException {
-public:
-  /**
-   * Error codes for the various types of exceptions.
-   */
-  enum TApplicationExceptionType {
-    UNKNOWN = 0,
-    UNKNOWN_METHOD = 1,
-    INVALID_MESSAGE_TYPE = 2,
-    WRONG_METHOD_NAME = 3,
-    BAD_SEQUENCE_ID = 4,
-    MISSING_RESULT = 5,
-    INTERNAL_ERROR = 6,
-    PROTOCOL_ERROR = 7,
-    INVALID_TRANSFORM = 8,
-    INVALID_PROTOCOL = 9,
-    UNSUPPORTED_CLIENT_TYPE = 10
-  };
-
-  TApplicationException() : TException(), type_(UNKNOWN) {}
-
-  TApplicationException(TApplicationExceptionType type) : TException(), type_(type) {}
-
-  TApplicationException(const std::string& message) : TException(message), type_(UNKNOWN) {}
-
-  TApplicationException(TApplicationExceptionType type, const std::string& message)
-    : TException(message), type_(type) {}
-
-  virtual ~TApplicationException() throw() {}
-
-  /**
-   * Returns an error code that provides information about the type of error
-   * that has occurred.
-   *
-   * @return Error code
-   */
-  TApplicationExceptionType getType() { return type_; }
-
-  virtual const char* what() const throw() {
-    if (message_.empty()) {
-      switch (type_) {
-      case UNKNOWN:
-        return "TApplicationException: Unknown application exception";
-      case UNKNOWN_METHOD:
-        return "TApplicationException: Unknown method";
-      case INVALID_MESSAGE_TYPE:
-        return "TApplicationException: Invalid message type";
-      case WRONG_METHOD_NAME:
-        return "TApplicationException: Wrong method name";
-      case BAD_SEQUENCE_ID:
-        return "TApplicationException: Bad sequence identifier";
-      case MISSING_RESULT:
-        return "TApplicationException: Missing result";
-      case INTERNAL_ERROR:
-        return "TApplicationException: Internal error";
-      case PROTOCOL_ERROR:
-        return "TApplicationException: Protocol error";
-      case INVALID_TRANSFORM:
-        return "TApplicationException: Invalid transform";
-      case INVALID_PROTOCOL:
-        return "TApplicationException: Invalid protocol";
-      case UNSUPPORTED_CLIENT_TYPE:
-        return "TApplicationException: Unsupported client type";
-      default:
-        return "TApplicationException: (Invalid exception type)";
-      };
-    } else {
-      return message_.c_str();
-    }
-  }
-
-  uint32_t read(protocol::TProtocol* iprot);
-  uint32_t write(protocol::TProtocol* oprot) const;
-
-protected:
-  /**
-   * Error code
-   */
-  TApplicationExceptionType type_;
-};
-}
-} // apache::thrift
-
-#endif // #ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h
deleted file mode 100644
index fd1dce7..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef _THRIFT_TDISPATCHPROCESSOR_H_
-#define _THRIFT_TDISPATCHPROCESSOR_H_ 1
-
-#include <thrift/TProcessor.h>
-
-namespace apache {
-namespace thrift {
-
-/**
- * TDispatchProcessor is a helper class to parse the message header then call
- * another function to dispatch based on the function name.
- *
- * Subclasses must implement dispatchCall() to dispatch on the function name.
- */
-template <class Protocol_>
-class TDispatchProcessorT : public TProcessor {
-public:
-  virtual bool process(boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out,
-                       void* connectionContext) {
-    protocol::TProtocol* inRaw = in.get();
-    protocol::TProtocol* outRaw = out.get();
-
-    // Try to dynamic cast to the template protocol type
-    Protocol_* specificIn = dynamic_cast<Protocol_*>(inRaw);
-    Protocol_* specificOut = dynamic_cast<Protocol_*>(outRaw);
-    if (specificIn && specificOut) {
-      return processFast(specificIn, specificOut, connectionContext);
-    }
-
-    // Log the fact that we have to use the slow path
-    T_GENERIC_PROTOCOL(this, inRaw, specificIn);
-    T_GENERIC_PROTOCOL(this, outRaw, specificOut);
-
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    inRaw->readMessageBegin(fname, mtype, seqid);
-
-    // If this doesn't look like a valid call, log an error and return false so
-    // that the server will close the connection.
-    //
-    // (The old generated processor code used to try to skip a T_STRUCT and
-    // continue.  However, that seems unsafe.)
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      return false;
-    }
-
-    return this->dispatchCall(inRaw, outRaw, fname, seqid, connectionContext);
-  }
-
-protected:
-  bool processFast(Protocol_* in, Protocol_* out, void* connectionContext) {
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    in->readMessageBegin(fname, mtype, seqid);
-
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      return false;
-    }
-
-    return this->dispatchCallTemplated(in, out, fname, seqid, connectionContext);
-  }
-
-  /**
-   * dispatchCall() methods must be implemented by subclasses
-   */
-  virtual bool dispatchCall(apache::thrift::protocol::TProtocol* in,
-                            apache::thrift::protocol::TProtocol* out,
-                            const std::string& fname,
-                            int32_t seqid,
-                            void* callContext) = 0;
-
-  virtual bool dispatchCallTemplated(Protocol_* in,
-                                     Protocol_* out,
-                                     const std::string& fname,
-                                     int32_t seqid,
-                                     void* callContext) = 0;
-};
-
-/**
- * Non-templatized version of TDispatchProcessor, that doesn't bother trying to
- * perform a dynamic_cast.
- */
-class TDispatchProcessor : public TProcessor {
-public:
-  virtual bool process(boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out,
-                       void* connectionContext) {
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    in->readMessageBegin(fname, mtype, seqid);
-
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      return false;
-    }
-
-    return dispatchCall(in.get(), out.get(), fname, seqid, connectionContext);
-  }
-
-protected:
-  virtual bool dispatchCall(apache::thrift::protocol::TProtocol* in,
-                            apache::thrift::protocol::TProtocol* out,
-                            const std::string& fname,
-                            int32_t seqid,
-                            void* callContext) = 0;
-};
-
-// Specialize TDispatchProcessorT for TProtocol and TDummyProtocol just to use
-// the generic TDispatchProcessor.
-template <>
-class TDispatchProcessorT<protocol::TDummyProtocol> : public TDispatchProcessor {};
-template <>
-class TDispatchProcessorT<protocol::TProtocol> : public TDispatchProcessor {};
-}
-} // apache::thrift
-
-#endif // _THRIFT_TDISPATCHPROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h
deleted file mode 100644
index 07ff030..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h
+++ /dev/null
@@ -1,195 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TLOGGING_H_
-#define _THRIFT_TLOGGING_H_ 1
-
-#include <thrift/thrift-config.h>
-
-/**
- * Contains utility macros for debugging and logging.
- *
- */
-
-#include <time.h>
-
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-
-/**
- * T_GLOBAL_DEBUGGING_LEVEL = 0: all debugging turned off, debug macros undefined
- * T_GLOBAL_DEBUGGING_LEVEL = 1: all debugging turned on
- */
-#define T_GLOBAL_DEBUGGING_LEVEL 0
-
-/**
- * T_GLOBAL_LOGGING_LEVEL = 0: all logging turned off, logging macros undefined
- * T_GLOBAL_LOGGING_LEVEL = 1: all logging turned on
- */
-#define T_GLOBAL_LOGGING_LEVEL 1
-
-/**
- * Standard wrapper around fprintf what will prefix the file name and line
- * number to the line. Uses T_GLOBAL_DEBUGGING_LEVEL to control whether it is
- * turned on or off.
- *
- * @param format_string
- */
-#if T_GLOBAL_DEBUGGING_LEVEL > 0
-#define T_DEBUG(format_string, ...)                                                                \
-  if (T_GLOBAL_DEBUGGING_LEVEL > 0) {                                                              \
-    fprintf(stderr, "[%s,%d] " format_string " \n", __FILE__, __LINE__, ##__VA_ARGS__);            \
-  }
-#else
-#define T_DEBUG(format_string, ...)
-#endif
-
-/**
- * analogous to T_DEBUG but also prints the time
- *
- * @param string  format_string input: printf style format string
- */
-#if T_GLOBAL_DEBUGGING_LEVEL > 0
-#define T_DEBUG_T(format_string, ...)                                                              \
-  {                                                                                                \
-    if (T_GLOBAL_DEBUGGING_LEVEL > 0) {                                                            \
-      time_t now;                                                                                  \
-      char dbgtime[26];                                                                            \
-      time(&now);                                                                                  \
-      THRIFT_CTIME_R(&now, dbgtime);                                                               \
-      dbgtime[24] = '\0';                                                                          \
-      fprintf(stderr,                                                                              \
-              "[%s,%d] [%s] " format_string " \n",                                                 \
-              __FILE__,                                                                            \
-              __LINE__,                                                                            \
-              dbgtime,                                                                             \
-              ##__VA_ARGS__);                                                                      \
-    }                                                                                              \
-  }
-#else
-#define T_DEBUG_T(format_string, ...)
-#endif
-
-/**
- * analogous to T_DEBUG but uses input level to determine whether or not the string
- * should be logged.
- *
- * @param int     level: specified debug level
- * @param string  format_string input: format string
- */
-#define T_DEBUG_L(level, format_string, ...)                                                       \
-  if ((level) > 0) {                                                                               \
-    fprintf(stderr, "[%s,%d] " format_string " \n", __FILE__, __LINE__, ##__VA_ARGS__);            \
-  }
-
-/**
- * Explicit error logging. Prints time, file name and line number
- *
- * @param string  format_string input: printf style format string
- */
-#define T_ERROR(format_string, ...)                                                                \
-  {                                                                                                \
-    time_t now;                                                                                    \
-    char dbgtime[26];                                                                              \
-    time(&now);                                                                                    \
-    THRIFT_CTIME_R(&now, dbgtime);                                                                 \
-    dbgtime[24] = '\0';                                                                            \
-    fprintf(stderr,                                                                                \
-            "[%s,%d] [%s] ERROR: " format_string " \n",                                            \
-            __FILE__,                                                                              \
-            __LINE__,                                                                              \
-            dbgtime,                                                                               \
-            ##__VA_ARGS__);                                                                        \
-  }
-
-/**
- * Analogous to T_ERROR, additionally aborting the process.
- * WARNING: macro calls abort(), ending program execution
- *
- * @param string  format_string input: printf style format string
- */
-#define T_ERROR_ABORT(format_string, ...)                                                          \
-  {                                                                                                \
-    time_t now;                                                                                    \
-    char dbgtime[26];                                                                              \
-    time(&now);                                                                                    \
-    THRIFT_CTIME_R(&now, dbgtime);                                                                 \
-    dbgtime[24] = '\0';                                                                            \
-    fprintf(stderr,                                                                                \
-            "[%s,%d] [%s] ERROR: Going to abort " format_string " \n",                             \
-            __FILE__,                                                                              \
-            __LINE__,                                                                              \
-            dbgtime,                                                                               \
-            ##__VA_ARGS__);                                                                        \
-    exit(1);                                                                                       \
-  }
-
-/**
- * Log input message
- *
- * @param string  format_string input: printf style format string
- */
-#if T_GLOBAL_LOGGING_LEVEL > 0
-#define T_LOG_OPER(format_string, ...)                                                             \
-  {                                                                                                \
-    if (T_GLOBAL_LOGGING_LEVEL > 0) {                                                              \
-      time_t now;                                                                                  \
-      char dbgtime[26];                                                                            \
-      time(&now);                                                                                  \
-      THRIFT_CTIME_R(&now, dbgtime);                                                               \
-      dbgtime[24] = '\0';                                                                          \
-      fprintf(stderr, "[%s] " format_string " \n", dbgtime, ##__VA_ARGS__);                        \
-    }                                                                                              \
-  }
-#else
-#define T_LOG_OPER(format_string, ...)
-#endif
-
-/**
- * T_GLOBAL_DEBUG_VIRTUAL = 0 or unset: normal operation,
- *                                      virtual call debug messages disabled
- * T_GLOBAL_DEBUG_VIRTUAL = 1:          log a debug messages whenever an
- *                                      avoidable virtual call is made
- * T_GLOBAL_DEBUG_VIRTUAL = 2:          record detailed info that can be
- *                                      printed by calling
- *                                      apache::thrift::profile_print_info()
- */
-#if T_GLOBAL_DEBUG_VIRTUAL > 1
-#define T_VIRTUAL_CALL() ::apache::thrift::profile_virtual_call(typeid(*this))
-#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot)                            \
-  do {                                                                                             \
-    if (!(specific_prot)) {                                                                        \
-      ::apache::thrift::profile_generic_protocol(typeid(*template_class), typeid(*generic_prot));  \
-    }                                                                                              \
-  } while (0)
-#elif T_GLOBAL_DEBUG_VIRTUAL == 1
-#define T_VIRTUAL_CALL() fprintf(stderr, "[%s,%d] virtual call\n", __FILE__, __LINE__)
-#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot)                            \
-  do {                                                                                             \
-    if (!(specific_prot)) {                                                                        \
-      fprintf(stderr, "[%s,%d] failed to cast to specific protocol type\n", __FILE__, __LINE__);   \
-    }                                                                                              \
-  } while (0)
-#else
-#define T_VIRTUAL_CALL()
-#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot)
-#endif
-
-#endif // #ifndef _THRIFT_TLOGGING_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp
deleted file mode 100644
index 5739d0f..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/Thrift.h>
-#include <cstring>
-#include <cstdlib>
-#include <boost/lexical_cast.hpp>
-#include <stdarg.h>
-#include <stdio.h>
-
-namespace apache {
-namespace thrift {
-
-TOutput GlobalOutput;
-
-void TOutput::printf(const char* message, ...) {
-#ifndef THRIFT_SQUELCH_CONSOLE_OUTPUT
-  // Try to reduce heap usage, even if printf is called rarely.
-  static const int STACK_BUF_SIZE = 256;
-  char stack_buf[STACK_BUF_SIZE];
-  va_list ap;
-
-#ifdef _MSC_VER
-  va_start(ap, message);
-  int need = _vscprintf(message, ap);
-  va_end(ap);
-
-  if (need < STACK_BUF_SIZE) {
-    va_start(ap, message);
-    vsnprintf_s(stack_buf, STACK_BUF_SIZE, _TRUNCATE, message, ap);
-    va_end(ap);
-    f_(stack_buf);
-    return;
-  }
-#else
-  va_start(ap, message);
-  int need = vsnprintf(stack_buf, STACK_BUF_SIZE, message, ap);
-  va_end(ap);
-
-  if (need < STACK_BUF_SIZE) {
-    f_(stack_buf);
-    return;
-  }
-#endif
-
-  char* heap_buf = (char*)malloc((need + 1) * sizeof(char));
-  if (heap_buf == NULL) {
-#ifdef _MSC_VER
-    va_start(ap, message);
-    vsnprintf_s(stack_buf, STACK_BUF_SIZE, _TRUNCATE, message, ap);
-    va_end(ap);
-#endif
-    // Malloc failed.  We might as well print the stack buffer.
-    f_(stack_buf);
-    return;
-  }
-
-  va_start(ap, message);
-  int rval = vsnprintf(heap_buf, need + 1, message, ap);
-  va_end(ap);
-  // TODO(shigin): inform user
-  if (rval != -1) {
-    f_(heap_buf);
-  }
-  free(heap_buf);
-#endif
-}
-
-void TOutput::errorTimeWrapper(const char* msg) {
-#ifndef THRIFT_SQUELCH_CONSOLE_OUTPUT
-  time_t now;
-  char dbgtime[26];
-  time(&now);
-  THRIFT_CTIME_R(&now, dbgtime);
-  dbgtime[24] = 0;
-  fprintf(stderr, "Thrift: %s %s\n", dbgtime, msg);
-#endif
-}
-
-void TOutput::perror(const char* message, int errno_copy) {
-  std::string out = message + strerror_s(errno_copy);
-  f_(out.c_str());
-}
-
-std::string TOutput::strerror_s(int errno_copy) {
-#ifndef HAVE_STRERROR_R
-  return "errno = " + boost::lexical_cast<std::string>(errno_copy);
-#else // HAVE_STRERROR_R
-
-  char b_errbuf[1024] = {'\0'};
-#ifdef STRERROR_R_CHAR_P
-  char* b_error = strerror_r(errno_copy, b_errbuf, sizeof(b_errbuf));
-#else
-  char* b_error = b_errbuf;
-  int rv = strerror_r(errno_copy, b_errbuf, sizeof(b_errbuf));
-  if (rv == -1) {
-    // strerror_r failed.  omgwtfbbq.
-    return "XSI-compliant strerror_r() failed with errno = "
-           + boost::lexical_cast<std::string>(errno_copy);
-  }
-#endif
-  // Can anyone prove that explicit cast is probably not necessary
-  // to ensure that the string object is constructed before
-  // b_error becomes invalid?
-  return std::string(b_error);
-
-#endif // HAVE_STRERROR_R
-}
-}
-} // apache::thrift

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h
deleted file mode 100644
index 1375f73..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_OUTPUT_H_
-#define _THRIFT_OUTPUT_H_ 1
-
-namespace apache {
-namespace thrift {
-
-class TOutput {
-public:
-  TOutput() : f_(&errorTimeWrapper) {}
-
-  inline void setOutputFunction(void (*function)(const char*)) { f_ = function; }
-
-  inline void operator()(const char* message) { f_(message); }
-
-  // It is important to have a const char* overload here instead of
-  // just the string version, otherwise errno could be corrupted
-  // if there is some problem allocating memory when constructing
-  // the string.
-  void perror(const char* message, int errno_copy);
-  inline void perror(const std::string& message, int errno_copy) {
-    perror(message.c_str(), errno_copy);
-  }
-
-  void printf(const char* message, ...);
-
-  static void errorTimeWrapper(const char* msg);
-
-  /** Just like strerror_r but returns a C++ string object. */
-  static std::string strerror_s(int errno_copy);
-
-private:
-  void (*f_)(const char*);
-};
-
-extern TOutput GlobalOutput;
-}
-} // namespace apache::thrift
-
-#endif //_THRIFT_OUTPUT_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h
deleted file mode 100644
index d8f86c4..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h
+++ /dev/null
@@ -1,230 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TPROCESSOR_H_
-#define _THRIFT_TPROCESSOR_H_ 1
-
-#include <string>
-#include <thrift/protocol/TProtocol.h>
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-
-/**
- * Virtual interface class that can handle events from the processor. To
- * use this you should subclass it and implement the methods that you care
- * about. Your subclass can also store local data that you may care about,
- * such as additional "arguments" to these methods (stored in the object
- * instance's state).
- */
-class TProcessorEventHandler {
-public:
-  virtual ~TProcessorEventHandler() {}
-
-  /**
-   * Called before calling other callback methods.
-   * Expected to return some sort of context object.
-   * The return value is passed to all other callbacks
-   * for that function invocation.
-   */
-  virtual void* getContext(const char* fn_name, void* serverContext) {
-    (void)fn_name;
-    (void)serverContext;
-    return NULL;
-  }
-
-  /**
-   * Expected to free resources associated with a context.
-   */
-  virtual void freeContext(void* ctx, const char* fn_name) {
-    (void)ctx;
-    (void)fn_name;
-  }
-
-  /**
-   * Called before reading arguments.
-   */
-  virtual void preRead(void* ctx, const char* fn_name) {
-    (void)ctx;
-    (void)fn_name;
-  }
-
-  /**
-   * Called between reading arguments and calling the handler.
-   */
-  virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) {
-    (void)ctx;
-    (void)fn_name;
-    (void)bytes;
-  }
-
-  /**
-   * Called between calling the handler and writing the response.
-   */
-  virtual void preWrite(void* ctx, const char* fn_name) {
-    (void)ctx;
-    (void)fn_name;
-  }
-
-  /**
-   * Called after writing the response.
-   */
-  virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) {
-    (void)ctx;
-    (void)fn_name;
-    (void)bytes;
-  }
-
-  /**
-   * Called when an async function call completes successfully.
-   */
-  virtual void asyncComplete(void* ctx, const char* fn_name) {
-    (void)ctx;
-    (void)fn_name;
-  }
-
-  /**
-   * Called if the handler throws an undeclared exception.
-   */
-  virtual void handlerError(void* ctx, const char* fn_name) {
-    (void)ctx;
-    (void)fn_name;
-  }
-
-protected:
-  TProcessorEventHandler() {}
-};
-
-/**
- * A helper class used by the generated code to free each context.
- */
-class TProcessorContextFreer {
-public:
-  TProcessorContextFreer(TProcessorEventHandler* handler, void* context, const char* method)
-    : handler_(handler), context_(context), method_(method) {}
-  ~TProcessorContextFreer() {
-    if (handler_ != NULL)
-      handler_->freeContext(context_, method_);
-  }
-  void unregister() { handler_ = NULL; }
-
-private:
-  apache::thrift::TProcessorEventHandler* handler_;
-  void* context_;
-  const char* method_;
-};
-
-/**
- * A processor is a generic object that acts upon two streams of data, one
- * an input and the other an output. The definition of this object is loose,
- * though the typical case is for some sort of server that either generates
- * responses to an input stream or forwards data from one pipe onto another.
- *
- */
-class TProcessor {
-public:
-  virtual ~TProcessor() {}
-
-  virtual bool process(boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out,
-                       void* connectionContext) = 0;
-
-  bool process(boost::shared_ptr<apache::thrift::protocol::TProtocol> io, void* connectionContext) {
-    return process(io, io, connectionContext);
-  }
-
-  boost::shared_ptr<TProcessorEventHandler> getEventHandler() { return eventHandler_; }
-
-  void setEventHandler(boost::shared_ptr<TProcessorEventHandler> eventHandler) {
-    eventHandler_ = eventHandler;
-  }
-
-protected:
-  TProcessor() {}
-
-  boost::shared_ptr<TProcessorEventHandler> eventHandler_;
-};
-
-/**
- * This is a helper class to allow boost::shared_ptr to be used with handler
- * pointers returned by the generated handler factories.
- *
- * The handler factory classes generated by the thrift compiler return raw
- * pointers, and factory->releaseHandler() must be called when the handler is
- * no longer needed.
- *
- * A ReleaseHandler object can be instantiated and passed as the second
- * parameter to a shared_ptr, so that factory->releaseHandler() will be called
- * when the object is no longer needed, instead of deleting the pointer.
- */
-template <typename HandlerFactory_>
-class ReleaseHandler {
-public:
-  ReleaseHandler(const boost::shared_ptr<HandlerFactory_>& handlerFactory)
-    : handlerFactory_(handlerFactory) {}
-
-  void operator()(typename HandlerFactory_::Handler* handler) {
-    if (handler) {
-      handlerFactory_->releaseHandler(handler);
-    }
-  }
-
-private:
-  boost::shared_ptr<HandlerFactory_> handlerFactory_;
-};
-
-struct TConnectionInfo {
-  // The input and output protocols
-  boost::shared_ptr<protocol::TProtocol> input;
-  boost::shared_ptr<protocol::TProtocol> output;
-  // The underlying transport used for the connection
-  // This is the transport that was returned by TServerTransport::accept(),
-  // and it may be different than the transport pointed to by the input and
-  // output protocols.
-  boost::shared_ptr<transport::TTransport> transport;
-};
-
-class TProcessorFactory {
-public:
-  virtual ~TProcessorFactory() {}
-
-  /**
-   * Get the TProcessor to use for a particular connection.
-   *
-   * This method is always invoked in the same thread that the connection was
-   * accepted on.  This generally means that this call does not need to be
-   * thread safe, as it will always be invoked from a single thread.
-   */
-  virtual boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo& connInfo) = 0;
-};
-
-class TSingletonProcessorFactory : public TProcessorFactory {
-public:
-  TSingletonProcessorFactory(boost::shared_ptr<TProcessor> processor) : processor_(processor) {}
-
-  boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo&) { return processor_; }
-
-private:
-  boost::shared_ptr<TProcessor> processor_;
-};
-}
-} // apache::thrift
-
-#endif // #ifndef _THRIFT_TPROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h
deleted file mode 100644
index 5023869..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TOSTRING_H_
-#define _THRIFT_TOSTRING_H_ 1
-
-#include <boost/lexical_cast.hpp>
-
-#include <vector>
-#include <map>
-#include <set>
-#include <string>
-#include <sstream>
-
-namespace apache {
-namespace thrift {
-
-template <typename T>
-std::string to_string(const T& t) {
-  return boost::lexical_cast<std::string>(t);
-}
-
-template <typename K, typename V>
-std::string to_string(const std::map<K, V>& m);
-
-template <typename T>
-std::string to_string(const std::set<T>& s);
-
-template <typename T>
-std::string to_string(const std::vector<T>& t);
-
-template <typename K, typename V>
-std::string to_string(const typename std::pair<K, V>& v) {
-  std::ostringstream o;
-  o << to_string(v.first) << ": " << to_string(v.second);
-  return o.str();
-}
-
-template <typename T>
-std::string to_string(const T& beg, const T& end) {
-  std::ostringstream o;
-  for (T it = beg; it != end; ++it) {
-    if (it != beg)
-      o << ", ";
-    o << to_string(*it);
-  }
-  return o.str();
-}
-
-template <typename T>
-std::string to_string(const std::vector<T>& t) {
-  std::ostringstream o;
-  o << "[" << to_string(t.begin(), t.end()) << "]";
-  return o.str();
-}
-
-template <typename K, typename V>
-std::string to_string(const std::map<K, V>& m) {
-  std::ostringstream o;
-  o << "{" << to_string(m.begin(), m.end()) << "}";
-  return o.str();
-}
-
-template <typename T>
-std::string to_string(const std::set<T>& s) {
-  std::ostringstream o;
-  o << "{" << to_string(s.begin(), s.end()) << "}";
-  return o.str();
-}
-}
-} // apache::thrift
-
-#endif // _THRIFT_TOSTRING_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h
deleted file mode 100644
index e8e70eb..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_THRIFT_H_
-#define _THRIFT_THRIFT_H_ 1
-
-#include <thrift/transport/PlatformSocket.h>
-
-#include <thrift/thrift-config.h>
-
-#include <stdio.h>
-#include <assert.h>
-
-#include <sys/types.h>
-#ifdef HAVE_NETINET_IN_H
-#include <netinet/in.h>
-#endif
-#ifdef HAVE_INTTYPES_H
-#include <inttypes.h>
-#endif
-#include <string>
-#include <map>
-#include <list>
-#include <set>
-#include <vector>
-#include <exception>
-#include <typeinfo>
-
-#include <boost/utility/enable_if.hpp>
-#include <boost/type_traits/is_convertible.hpp>
-
-#include <thrift/TLogging.h>
-#include <thrift/TOutput.h>
-
-#define THRIFT_UNUSED_VARIABLE(x) ((void)(x))
-
-namespace apache {
-namespace thrift {
-
-class TEnumIterator
-    : public std::iterator<std::forward_iterator_tag, std::pair<int, const char*> > {
-public:
-  TEnumIterator(int n, int* enums, const char** names)
-    : ii_(0), n_(n), enums_(enums), names_(names) {}
-
-  int operator++() { return ++ii_; }
-
-  bool operator!=(const TEnumIterator& end) {
-    THRIFT_UNUSED_VARIABLE(end);
-    assert(end.n_ == -1);
-    return (ii_ != n_);
-  }
-
-  std::pair<int, const char*> operator*() const { return std::make_pair(enums_[ii_], names_[ii_]); }
-
-private:
-  int ii_;
-  const int n_;
-  int* enums_;
-  const char** names_;
-};
-
-class TException : public std::exception {
-public:
-  TException() : message_() {}
-
-  TException(const std::string& message) : message_(message) {}
-
-  virtual ~TException() throw() {}
-
-  virtual const char* what() const throw() {
-    if (message_.empty()) {
-      return "Default TException.";
-    } else {
-      return message_.c_str();
-    }
-  }
-
-protected:
-  std::string message_;
-};
-
-class TDelayedException {
-public:
-  template <class E>
-  static TDelayedException* delayException(const E& e);
-  virtual void throw_it() = 0;
-  virtual ~TDelayedException(){};
-};
-
-template <class E>
-class TExceptionWrapper : public TDelayedException {
-public:
-  TExceptionWrapper(const E& e) : e_(e) {}
-  virtual void throw_it() {
-    E temp(e_);
-    delete this;
-    throw temp;
-  }
-
-private:
-  E e_;
-};
-
-template <class E>
-TDelayedException* TDelayedException::delayException(const E& e) {
-  return new TExceptionWrapper<E>(e);
-}
-
-#if T_GLOBAL_DEBUG_VIRTUAL > 1
-void profile_virtual_call(const std::type_info& info);
-void profile_generic_protocol(const std::type_info& template_type, const std::type_info& prot_type);
-void profile_print_info(FILE* f);
-void profile_print_info();
-void profile_write_pprof(FILE* gen_calls_f, FILE* virtual_calls_f);
-#endif
-}
-} // apache::thrift
-
-#endif // #ifndef _THRIFT_THRIFT_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp
deleted file mode 100644
index 6ce346b..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp
+++ /dev/null
@@ -1,425 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/Thrift.h>
-
-// Do nothing if virtual call profiling is not enabled
-#if T_GLOBAL_DEBUG_VIRTUAL > 1
-
-// TODO: This code only works with g++ (since we rely on the fact
-// that all std::type_info instances referring to a particular type
-// always return the exact same pointer value from name().)
-#ifndef __GNUG__
-#error "Thrift virtual function profiling currently only works with gcc"
-#endif // !__GNUG__
-
-// TODO: We also require glibc for the backtrace() and backtrace_symbols()
-// functions.
-#ifndef __GLIBC__
-#error "Thrift virtual function profiling currently requires glibc"
-#endif // !__GLIBC__
-
-#include <thrift/concurrency/Mutex.h>
-
-#include <ext/hash_map>
-#include <execinfo.h>
-#include <stdio.h>
-
-namespace apache {
-namespace thrift {
-
-using ::apache::thrift::concurrency::Mutex;
-using ::apache::thrift::concurrency::Guard;
-
-static const unsigned int MAX_STACK_DEPTH = 15;
-
-/**
- * A stack trace
- */
-class Backtrace {
-public:
-  Backtrace(int skip = 0);
-  Backtrace(Backtrace const& bt);
-
-  void operator=(Backtrace const& bt) {
-    numCallers_ = bt.numCallers_;
-    if (numCallers_ >= 0) {
-      memcpy(callers_, bt.callers_, numCallers_ * sizeof(void*));
-    }
-  }
-
-  bool operator==(Backtrace const& bt) const { return (cmp(bt) == 0); }
-
-  size_t hash() const {
-    intptr_t ret = 0;
-    for (int n = 0; n < numCallers_; ++n) {
-      ret ^= reinterpret_cast<intptr_t>(callers_[n]);
-    }
-    return static_cast<size_t>(ret);
-  }
-
-  int cmp(Backtrace const& bt) const {
-    int depth_diff = (numCallers_ - bt.numCallers_);
-    if (depth_diff != 0) {
-      return depth_diff;
-    }
-
-    for (int n = 0; n < numCallers_; ++n) {
-      int diff = reinterpret_cast<intptr_t>(callers_[n])
-                 - reinterpret_cast<intptr_t>(bt.callers_[n]);
-      if (diff != 0) {
-        return diff;
-      }
-    }
-
-    return 0;
-  }
-
-  void print(FILE* f, int indent = 0, int start = 0) const {
-    char** strings = backtrace_symbols(callers_, numCallers_);
-    if (strings) {
-      start += skip_;
-      if (start < 0) {
-        start = 0;
-      }
-      for (int n = start; n < numCallers_; ++n) {
-        fprintf(f, "%*s#%-2d %s\n", indent, "", n, strings[n]);
-      }
-      free(strings);
-    } else {
-      fprintf(f, "%*s<failed to determine symbols>\n", indent, "");
-    }
-  }
-
-  int getDepth() const { return numCallers_ - skip_; }
-
-  void* getFrame(int index) const {
-    int adjusted_index = index + skip_;
-    if (adjusted_index < 0 || adjusted_index >= numCallers_) {
-      return NULL;
-    }
-    return callers_[adjusted_index];
-  }
-
-private:
-  void* callers_[MAX_STACK_DEPTH];
-  int numCallers_;
-  int skip_;
-};
-
-// Define the constructors non-inline, so they consistently add a single
-// frame to the stack trace, regardless of whether optimization is enabled
-Backtrace::Backtrace(int skip)
-  : skip_(skip + 1) // ignore the constructor itself
-{
-  numCallers_ = backtrace(callers_, MAX_STACK_DEPTH);
-  if (skip_ > numCallers_) {
-    skip_ = numCallers_;
-  }
-}
-
-Backtrace::Backtrace(Backtrace const& bt) : numCallers_(bt.numCallers_), skip_(bt.skip_) {
-  if (numCallers_ >= 0) {
-    memcpy(callers_, bt.callers_, numCallers_ * sizeof(void*));
-  }
-}
-
-/**
- * A backtrace, plus one or two type names
- */
-class Key {
-public:
-  class Hash {
-  public:
-    size_t operator()(Key const& k) const { return k.hash(); }
-  };
-
-  Key(const Backtrace* bt, const std::type_info& type_info)
-    : backtrace_(bt), typeName1_(type_info.name()), typeName2_(NULL) {}
-
-  Key(const Backtrace* bt, const std::type_info& type_info1, const std::type_info& type_info2)
-    : backtrace_(bt), typeName1_(type_info1.name()), typeName2_(type_info2.name()) {}
-
-  Key(const Key& k)
-    : backtrace_(k.backtrace_), typeName1_(k.typeName1_), typeName2_(k.typeName2_) {}
-
-  void operator=(const Key& k) {
-    backtrace_ = k.backtrace_;
-    typeName1_ = k.typeName1_;
-    typeName2_ = k.typeName2_;
-  }
-
-  const Backtrace* getBacktrace() const { return backtrace_; }
-
-  const char* getTypeName() const { return typeName1_; }
-
-  const char* getTypeName2() const { return typeName2_; }
-
-  void makePersistent() {
-    // Copy the Backtrace object
-    backtrace_ = new Backtrace(*backtrace_);
-
-    // NOTE: We don't copy the type name.
-    // The GNU libstdc++ implementation of type_info::name() returns a value
-    // that will be valid for the lifetime of the program.  (Although the C++
-    // standard doesn't guarantee this will be true on all implementations.)
-  }
-
-  /**
-   * Clean up memory allocated by makePersistent()
-   *
-   * Should only be invoked if makePersistent() has previously been called.
-   * The Key should no longer be used after cleanup() is called.
-   */
-  void cleanup() {
-    delete backtrace_;
-    backtrace_ = NULL;
-  }
-
-  int cmp(const Key& k) const {
-    int ret = backtrace_->cmp(*k.backtrace_);
-    if (ret != 0) {
-      return ret;
-    }
-
-    // NOTE: We compare just the name pointers.
-    // With GNU libstdc++, every type_info object for the same type points to
-    // exactly the same name string.  (Although this isn't guaranteed by the
-    // C++ standard.)
-    ret = k.typeName1_ - typeName1_;
-    if (ret != 0) {
-      return ret;
-    }
-    return k.typeName2_ - typeName2_;
-  }
-
-  bool operator==(const Key& k) const { return cmp(k) == 0; }
-
-  size_t hash() const {
-    // NOTE: As above, we just use the name pointer value.
-    // Works with GNU libstdc++, but not guaranteed to be correct on all
-    // implementations.
-    return backtrace_->hash() ^ reinterpret_cast<size_t>(typeName1_)
-           ^ reinterpret_cast<size_t>(typeName2_);
-  }
-
-private:
-  const Backtrace* backtrace_;
-  const char* typeName1_;
-  const char* typeName2_;
-};
-
-/**
- * A functor that determines which of two BacktraceMap entries
- * has a higher count.
- */
-class CountGreater {
-public:
-  bool operator()(std::pair<Key, size_t> bt1, std::pair<Key, size_t> bt2) const {
-    return bt1.second > bt2.second;
-  }
-};
-
-typedef __gnu_cxx::hash_map<Key, size_t, Key::Hash> BacktraceMap;
-
-/**
- * A map describing how many times T_VIRTUAL_CALL() has been invoked.
- */
-BacktraceMap virtual_calls;
-Mutex virtual_calls_mutex;
-
-/**
- * A map describing how many times T_GENERIC_PROTOCOL() has been invoked.
- */
-BacktraceMap generic_calls;
-Mutex generic_calls_mutex;
-
-void _record_backtrace(BacktraceMap* map, const Mutex& mutex, Key* k) {
-  Guard guard(mutex);
-
-  BacktraceMap::iterator it = map->find(*k);
-  if (it == map->end()) {
-    k->makePersistent();
-    map->insert(std::make_pair(*k, 1));
-  } else {
-    // increment the count
-    // NOTE: we could assert if it->second is 0 afterwards, since that would
-    // mean we've wrapped.
-    ++(it->second);
-  }
-}
-
-/**
- * Record an unnecessary virtual function call.
- *
- * This method is invoked by the T_VIRTUAL_CALL() macro.
- */
-void profile_virtual_call(const std::type_info& type) {
-  int const skip = 1; // ignore this frame
-  Backtrace bt(skip);
-  Key k(&bt, type);
-  _record_backtrace(&virtual_calls, virtual_calls_mutex, &k);
-}
-
-/**
- * Record a call to a template processor with a protocol that is not the one
- * specified in the template parameter.
- *
- * This method is invoked by the T_GENERIC_PROTOCOL() macro.
- */
-void profile_generic_protocol(const std::type_info& template_type,
-                              const std::type_info& prot_type) {
-  int const skip = 1; // ignore this frame
-  Backtrace bt(skip);
-  Key k(&bt, template_type, prot_type);
-  _record_backtrace(&generic_calls, generic_calls_mutex, &k);
-}
-
-/**
- * Print the recorded profiling information to the specified file.
- */
-void profile_print_info(FILE* f) {
-  typedef std::vector<std::pair<Key, size_t> > BacktraceVector;
-
-  CountGreater is_greater;
-
-  // Grab both locks for the duration of the print operation,
-  // to ensure the output is a consistent snapshot of a single point in time
-  Guard generic_calls_guard(generic_calls_mutex);
-  Guard virtual_calls_guard(virtual_calls_mutex);
-
-  // print the info from generic_calls, sorted by frequency
-  //
-  // We print the generic_calls info ahead of virtual_calls, since it is more
-  // useful in some cases.  All T_GENERIC_PROTOCOL calls can be eliminated
-  // from most programs.  Not all T_VIRTUAL_CALLs will be eliminated by
-  // converting to templates.
-  BacktraceVector gp_sorted(generic_calls.begin(), generic_calls.end());
-  std::sort(gp_sorted.begin(), gp_sorted.end(), is_greater);
-
-  for (BacktraceVector::const_iterator it = gp_sorted.begin(); it != gp_sorted.end(); ++it) {
-    Key const& key = it->first;
-    size_t const count = it->second;
-    fprintf(f,
-            "T_GENERIC_PROTOCOL: %zu calls to %s with a %s:\n",
-            count,
-            key.getTypeName(),
-            key.getTypeName2());
-    key.getBacktrace()->print(f, 2);
-    fprintf(f, "\n");
-  }
-
-  // print the info from virtual_calls, sorted by frequency
-  BacktraceVector vc_sorted(virtual_calls.begin(), virtual_calls.end());
-  std::sort(vc_sorted.begin(), vc_sorted.end(), is_greater);
-
-  for (BacktraceVector::const_iterator it = vc_sorted.begin(); it != vc_sorted.end(); ++it) {
-    Key const& key = it->first;
-    size_t const count = it->second;
-    fprintf(f, "T_VIRTUAL_CALL: %zu calls on %s:\n", count, key.getTypeName());
-    key.getBacktrace()->print(f, 2);
-    fprintf(f, "\n");
-  }
-}
-
-/**
- * Print the recorded profiling information to stdout.
- */
-void profile_print_info() {
-  profile_print_info(stdout);
-}
-
-/**
- * Write a BacktraceMap as Google CPU profiler binary data.
- */
-static void profile_write_pprof_file(FILE* f, BacktraceMap const& map) {
-  // Write the header
-  uintptr_t header[5] = {0, 3, 0, 0, 0};
-  fwrite(&header, sizeof(header), 1, f);
-
-  // Write the profile records
-  for (BacktraceMap::const_iterator it = map.begin(); it != map.end(); ++it) {
-    uintptr_t count = it->second;
-    fwrite(&count, sizeof(count), 1, f);
-
-    Backtrace const* bt = it->first.getBacktrace();
-    uintptr_t num_pcs = bt->getDepth();
-    fwrite(&num_pcs, sizeof(num_pcs), 1, f);
-
-    for (uintptr_t n = 0; n < num_pcs; ++n) {
-      void* pc = bt->getFrame(n);
-      fwrite(&pc, sizeof(pc), 1, f);
-    }
-  }
-
-  // Write the trailer
-  uintptr_t trailer[3] = {0, 1, 0};
-  fwrite(&trailer, sizeof(trailer), 1, f);
-
-  // Write /proc/self/maps
-  // TODO(simpkins): This only works on linux
-  FILE* proc_maps = fopen("/proc/self/maps", "r");
-  if (proc_maps) {
-    uint8_t buf[4096];
-    while (true) {
-      size_t bytes_read = fread(buf, 1, sizeof(buf), proc_maps);
-      if (bytes_read == 0) {
-        break;
-      }
-      fwrite(buf, 1, bytes_read, f);
-    }
-    fclose(proc_maps);
-  }
-}
-
-/**
- * Write the recorded profiling information as pprof files.
- *
- * This writes the information using the Google CPU profiler binary data
- * format, so it can be analyzed with pprof.  Note that information about the
- * protocol/transport data types cannot be stored in this file format.
- *
- * See http://code.google.com/p/google-perftools/ for more details.
- *
- * @param gen_calls_f     The information about calls to
- *                        profile_generic_protocol() will be written to this
- *                        file.
- * @param virtual_calls_f The information about calls to
- *                        profile_virtual_call() will be written to this file.
- */
-void profile_write_pprof(FILE* gen_calls_f, FILE* virtual_calls_f) {
-  typedef std::vector<std::pair<Key, size_t> > BacktraceVector;
-
-  CountGreater is_greater;
-
-  // Grab both locks for the duration of the print operation,
-  // to ensure the output is a consistent snapshot of a single point in time
-  Guard generic_calls_guard(generic_calls_mutex);
-  Guard virtual_calls_guard(virtual_calls_mutex);
-
-  // write the info from generic_calls
-  profile_write_pprof_file(gen_calls_f, generic_calls);
-
-  // write the info from virtual_calls
-  profile_write_pprof_file(virtual_calls_f, virtual_calls);
-}
-}
-} // apache::thrift
-
-#endif // T_GLOBAL_PROFILE_VIRTUAL > 0

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
deleted file mode 100644
index 3c957a6..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_
-#define _THRIFT_TASYNC_BUFFER_PROCESSOR_H_ 1
-
-#include <thrift/cxxfunctional.h>
-#include <boost/shared_ptr.hpp>
-
-#include <thrift/transport/TBufferTransports.h>
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-class TAsyncBufferProcessor {
-public:
-  // Process data in "in", putting the result in "out".
-  // Call _return(true) when done, or _return(false) to
-  // forcefully close the connection (if applicable).
-  // "in" and "out" should be TMemoryBuffer or similar,
-  // not a wrapper around a socket.
-  virtual void process(apache::thrift::stdcxx::function<void(bool healthy)> _return,
-                       boost::shared_ptr<apache::thrift::transport::TBufferBase> ibuf,
-                       boost::shared_ptr<apache::thrift::transport::TBufferBase> obuf) = 0;
-  virtual ~TAsyncBufferProcessor() {}
-};
-}
-}
-} // apache::thrift::async
-
-#endif // #ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp
deleted file mode 100644
index 4716af2..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/async/TAsyncChannel.h>
-#include <thrift/cxxfunctional.h>
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-void TAsyncChannel::sendAndRecvMessage(const VoidCallback& cob,
-                                       TMemoryBuffer* sendBuf,
-                                       TMemoryBuffer* recvBuf) {
-  apache::thrift::stdcxx::function<void()> send_done
-      = apache::thrift::stdcxx::bind(&TAsyncChannel::recvMessage, this, cob, recvBuf);
-
-  sendMessage(send_done, sendBuf);
-}
-}
-}
-} // apache::thrift::async

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h
deleted file mode 100644
index eb3ce2a..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_ASYNC_TASYNCCHANNEL_H_
-#define _THRIFT_ASYNC_TASYNCCHANNEL_H_ 1
-
-#include <thrift/cxxfunctional.h>
-#include <thrift/Thrift.h>
-
-namespace apache {
-namespace thrift {
-namespace transport {
-class TMemoryBuffer;
-}
-}
-}
-
-namespace apache {
-namespace thrift {
-namespace async {
-using apache::thrift::transport::TMemoryBuffer;
-
-class TAsyncChannel {
-public:
-  typedef apache::thrift::stdcxx::function<void()> VoidCallback;
-
-  virtual ~TAsyncChannel() {}
-
-  // is the channel in a good state?
-  virtual bool good() const = 0;
-  virtual bool error() const = 0;
-  virtual bool timedOut() const = 0;
-
-  /**
-   * Send a message over the channel.
-   */
-  virtual void sendMessage(const VoidCallback& cob,
-                           apache::thrift::transport::TMemoryBuffer* message) = 0;
-
-  /**
-   * Receive a message from the channel.
-   */
-  virtual void recvMessage(const VoidCallback& cob,
-                           apache::thrift::transport::TMemoryBuffer* message) = 0;
-
-  /**
-   * Send a message over the channel and receive a response.
-   */
-  virtual void sendAndRecvMessage(const VoidCallback& cob,
-                                  apache::thrift::transport::TMemoryBuffer* sendBuf,
-                                  apache::thrift::transport::TMemoryBuffer* recvBuf);
-};
-}
-}
-} // apache::thrift::async
-
-#endif // #ifndef _THRIFT_ASYNC_TASYNCCHANNEL_H_


[29/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_json_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_json_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_json_generator.cc
deleted file mode 100644
index 3f44a82..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_json_generator.cc
+++ /dev/null
@@ -1,717 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <fstream>
-#include <iostream>
-#include <sstream>
-#include <limits>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-
-#include "t_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-using std::stack;
-
-static const string endl = "\n";
-static const string quot = "\"";
-static const bool NO_INDENT = false;
-static const bool FORCE_STRING = true;
-
-class t_json_generator : public t_generator {
-public:
-  t_json_generator(t_program* program,
-                   const std::map<std::string, std::string>& parsed_options,
-                   const std::string& option_string)
-    : t_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-json";
-
-    std::map<std::string, std::string>::const_iterator iter;
-    iter = parsed_options.find("merge");
-    should_merge_includes_ = (iter != parsed_options.end());
-  }
-
-  virtual ~t_json_generator() {}
-
-  /**
-  * Init and close methods
-  */
-
-  void init_generator();
-  void close_generator();
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_program();
-  void generate_function(t_function* tfunc);
-  void generate_field(t_field* field);
-
-  void generate_service(t_service* tservice);
-  void generate_struct(t_struct* tstruct);
-
-private:
-  bool should_merge_includes_;
-
-  std::ofstream f_json_;
-  std::stack<bool> comma_needed_;
-
-  template <typename T>
-  string number_to_string(T t) {
-    std::ostringstream out;
-    out.imbue(std::locale::classic());
-    out.precision(std::numeric_limits<T>::digits10);
-    out << t;
-    return out.str();
-  }
-
-  template <typename T>
-  void write_number(T n) {
-    f_json_ << number_to_string(n);
-  }
-
-  string get_type_name(t_type* ttype);
-  string get_qualified_name(t_type* ttype);
-
-  void start_object(bool should_indent = true);
-  void start_array();
-  void end_object();
-  void end_array();
-  void write_comma_if_needed();
-  void indicate_comma_needed();
-  string escape_json_string(const string& input);
-  string json_str(const string& str);
-  void merge_includes(t_program*);
-
-  void generate_constant(t_const* con);
-
-  void write_type_spec_entry(const char* name, t_type* ttype);
-  void write_type_spec_object(const char* name, t_type* ttype);
-  void write_type_spec(t_type* ttype);
-  void write_string(const string& value);
-  void write_value(t_type* tvalue);
-  void write_const_value(t_const_value* value, bool force_string = false);
-  void write_key_and(string key);
-  void write_key_and_string(string key, string val);
-  void write_key_and_integer(string key, int val);
-  void write_key_and_bool(string key, bool val);
-};
-
-void t_json_generator::init_generator() {
-  MKDIR(get_out_dir().c_str());
-
-  string f_json_name = get_out_dir() + program_->get_name() + ".json";
-  f_json_.open(f_json_name.c_str());
-
-  // Merge all included programs into this one so we can output one big file.
-  if (should_merge_includes_) {
-    merge_includes(program_);
-  }
-}
-
-string t_json_generator::escape_json_string(const string& input) {
-  std::ostringstream ss;
-  for (std::string::const_iterator iter = input.begin(); iter != input.end(); iter++) {
-    switch (*iter) {
-    case '\\':
-      ss << "\\\\";
-      break;
-    case '"':
-      ss << "\\\"";
-      break;
-    case '/':
-      ss << "\\/";
-      break;
-    case '\b':
-      ss << "\\b";
-      break;
-    case '\f':
-      ss << "\\f";
-      break;
-    case '\n':
-      ss << "\\n";
-      break;
-    case '\r':
-      ss << "\\r";
-      break;
-    case '\t':
-      ss << "\\t";
-      break;
-    default:
-      ss << *iter;
-      break;
-    }
-  }
-  return ss.str();
-}
-
-void t_json_generator::start_object(bool should_indent) {
-  f_json_ << (should_indent ? indent() : "") << "{" << endl;
-  indent_up();
-  comma_needed_.push(false);
-}
-
-void t_json_generator::start_array() {
-  f_json_ << "[" << endl;
-  indent_up();
-  comma_needed_.push(false);
-}
-
-void t_json_generator::write_comma_if_needed() {
-  if (comma_needed_.top()) {
-    f_json_ << "," << endl;
-  }
-}
-
-void t_json_generator::indicate_comma_needed() {
-  comma_needed_.pop();
-  comma_needed_.push(true);
-}
-
-void t_json_generator::write_key_and(string key) {
-  write_comma_if_needed();
-  indent(f_json_) << json_str(key) << ": ";
-  indicate_comma_needed();
-}
-
-void t_json_generator::write_key_and_integer(string key, int val) {
-  write_comma_if_needed();
-  indent(f_json_) << json_str(key) << ": " << number_to_string(val);
-  indicate_comma_needed();
-}
-
-void t_json_generator::write_key_and_string(string key, string val) {
-  write_comma_if_needed();
-  indent(f_json_) << json_str(key) << ": " << json_str(val);
-  indicate_comma_needed();
-}
-
-void t_json_generator::write_key_and_bool(string key, bool val) {
-  write_comma_if_needed();
-  indent(f_json_) << json_str(key) << ": " << (val ? "true" : "false");
-  indicate_comma_needed();
-}
-
-void t_json_generator::end_object() {
-  indent_down();
-  f_json_ << endl << indent() << "}";
-  comma_needed_.pop();
-}
-
-void t_json_generator::end_array() {
-  indent_down();
-  if (comma_needed_.top()) {
-    f_json_ << endl;
-  }
-  indent(f_json_) << "]";
-  comma_needed_.pop();
-}
-
-void t_json_generator::write_type_spec_object(const char* name, t_type* ttype) {
-  ttype = ttype->get_true_type();
-  if (ttype->is_struct() || ttype->is_xception() || ttype->is_container()) {
-    write_key_and(name);
-    start_object(NO_INDENT);
-    write_key_and("typeId");
-    write_type_spec(ttype);
-    end_object();
-  }
-}
-
-void t_json_generator::write_type_spec_entry(const char* name, t_type* ttype) {
-  write_key_and(name);
-  write_type_spec(ttype);
-}
-
-void t_json_generator::write_type_spec(t_type* ttype) {
-  ttype = ttype->get_true_type();
-
-  write_string(get_type_name(ttype));
-
-  if (ttype->is_struct() || ttype->is_xception()) {
-    write_key_and_string("class", get_qualified_name(ttype));
-  } else if (ttype->is_map()) {
-    t_type* ktype = ((t_map*)ttype)->get_key_type();
-    t_type* vtype = ((t_map*)ttype)->get_val_type();
-    write_key_and_string("keyTypeId", get_type_name(ktype));
-    write_key_and_string("valueTypeId", get_type_name(vtype));
-    write_type_spec_object("keyType", ktype);
-    write_type_spec_object("valueType", vtype);
-  } else if (ttype->is_list() || ttype->is_set()) {
-    t_type* etype = ((t_list*)ttype)->get_elem_type();
-    write_key_and_string("elemTypeId", get_type_name(etype));
-    write_type_spec_object("elemType", etype);
-  }
-}
-
-void t_json_generator::close_generator() {
-  f_json_ << endl;
-  f_json_.close();
-}
-
-void t_json_generator::merge_includes(t_program* program) {
-  vector<t_program*> includes = program->get_includes();
-  vector<t_program*>::iterator inc_iter;
-  for (inc_iter = includes.begin(); inc_iter != includes.end(); ++inc_iter) {
-    t_program* include = *inc_iter;
-    // recurse in case we get crazy
-    merge_includes(include);
-    // merge enums
-    vector<t_enum*> enums = include->get_enums();
-    vector<t_enum*>::iterator en_iter;
-    for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-      program->add_enum(*en_iter);
-    }
-    // merge typedefs
-    vector<t_typedef*> typedefs = include->get_typedefs();
-    vector<t_typedef*>::iterator td_iter;
-    for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-      program->add_typedef(*td_iter);
-    }
-    // merge structs
-    vector<t_struct*> objects = include->get_objects();
-    vector<t_struct*>::iterator o_iter;
-    for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-      program->add_struct(*o_iter);
-    }
-    // merge constants
-    vector<t_const*> consts = include->get_consts();
-    vector<t_const*>::iterator c_iter;
-    for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-      program->add_const(*c_iter);
-    }
-
-    // merge services
-    vector<t_service*> services = include->get_services();
-    vector<t_service*>::iterator sv_iter;
-    for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-      program->add_service(*sv_iter);
-    }
-  }
-}
-
-void t_json_generator::generate_program() {
-
-  init_generator();
-
-  start_object();
-  write_key_and_string("name", program_->get_name());
-  if (program_->has_doc()) {
-    write_key_and_string("doc", program_->get_doc());
-  }
-
-  // When merging includes, the "namespaces" and "includes" sections
-  // become ambiguous, so just skip them.
-  if (!should_merge_includes_) {
-    // Generate namespaces
-    write_key_and("namespaces");
-    start_object(NO_INDENT);
-    const map<string, string>& namespaces = program_->get_namespaces();
-    map<string, string>::const_iterator ns_it;
-    for (ns_it = namespaces.begin(); ns_it != namespaces.end(); ++ns_it) {
-      write_key_and_string(ns_it->first, ns_it->second);
-      indicate_comma_needed();
-    }
-    end_object();
-
-    // Generate includes
-    write_key_and("includes");
-    start_array();
-    const vector<t_program*> includes = program_->get_includes();
-    vector<t_program*>::const_iterator inc_it;
-    for (inc_it = includes.begin(); inc_it != includes.end(); ++inc_it) {
-      write_comma_if_needed();
-      write_string((*inc_it)->get_name());
-      indicate_comma_needed();
-    }
-    end_array();
-  }
-
-  // Generate enums
-  write_key_and("enums");
-  start_array();
-  vector<t_enum*> enums = program_->get_enums();
-  vector<t_enum*>::iterator en_iter;
-  for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-    write_comma_if_needed();
-    generate_enum(*en_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  // Generate typedefs
-  write_key_and("typedefs");
-  start_array();
-  vector<t_typedef*> typedefs = program_->get_typedefs();
-  vector<t_typedef*>::iterator td_iter;
-  for (td_iter = typedefs.begin(); td_iter != typedefs.end(); ++td_iter) {
-    write_comma_if_needed();
-    generate_typedef(*td_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  // Generate structs, exceptions, and unions in declared order
-  write_key_and("structs");
-  start_array();
-  vector<t_struct*> objects = program_->get_objects();
-  vector<t_struct*>::iterator o_iter;
-  for (o_iter = objects.begin(); o_iter != objects.end(); ++o_iter) {
-    write_comma_if_needed();
-    if ((*o_iter)->is_xception()) {
-      generate_xception(*o_iter);
-    } else {
-      generate_struct(*o_iter);
-    }
-    indicate_comma_needed();
-  }
-  end_array();
-
-  // Generate constants
-  write_key_and("constants");
-  start_array();
-  vector<t_const*> consts = program_->get_consts();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    write_comma_if_needed();
-    generate_constant(*c_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  // Generate services
-  write_key_and("services");
-  start_array();
-  vector<t_service*> services = program_->get_services();
-  vector<t_service*>::iterator sv_iter;
-  for (sv_iter = services.begin(); sv_iter != services.end(); ++sv_iter) {
-    write_comma_if_needed();
-    generate_service(*sv_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  end_object();
-
-  // Close the generator
-  close_generator();
-}
-
-void t_json_generator::generate_typedef(t_typedef* ttypedef) {
-  start_object();
-  write_key_and_string("name", get_qualified_name(ttypedef));
-  write_key_and_string("typeId", get_type_name(ttypedef->get_true_type()));
-  write_type_spec_object("type", ttypedef->get_true_type());
-  if (ttypedef->has_doc()) {
-    write_key_and_string("doc", ttypedef->get_doc());
-  }
-  end_object();
-}
-
-void t_json_generator::write_string(const string& value) {
-  f_json_ << quot << escape_json_string(value) << quot;
-}
-
-void t_json_generator::write_const_value(t_const_value* value, bool should_force_string) {
-
-  switch (value->get_type()) {
-
-  case t_const_value::CV_IDENTIFIER:
-  case t_const_value::CV_INTEGER:
-    if (should_force_string) {
-      write_string(number_to_string(value->get_integer()));
-    } else {
-      write_number(value->get_integer());
-    }
-    break;
-
-  case t_const_value::CV_DOUBLE:
-    if (should_force_string) {
-      write_string(number_to_string(value->get_double()));
-    } else {
-      write_number(value->get_double());
-    }
-    break;
-
-  case t_const_value::CV_STRING:
-    write_string(value->get_string());
-    break;
-
-  case t_const_value::CV_LIST: {
-    start_array();
-    std::vector<t_const_value*> list = value->get_list();
-    std::vector<t_const_value*>::iterator lit;
-    for (lit = list.begin(); lit != list.end(); ++lit) {
-      write_comma_if_needed();
-      f_json_ << indent();
-      write_const_value(*lit);
-      indicate_comma_needed();
-    }
-    end_array();
-    break;
-  }
-
-  case t_const_value::CV_MAP: {
-    start_object(NO_INDENT);
-    std::map<t_const_value*, t_const_value*> map = value->get_map();
-    std::map<t_const_value*, t_const_value*>::iterator mit;
-    for (mit = map.begin(); mit != map.end(); ++mit) {
-      write_comma_if_needed();
-      f_json_ << indent();
-      // JSON objects only allow string keys
-      write_const_value(mit->first, FORCE_STRING);
-      f_json_ << ": ";
-      write_const_value(mit->second);
-      indicate_comma_needed();
-    }
-    end_object();
-    break;
-  }
-
-  default:
-    f_json_ << "null";
-    break;
-  }
-}
-
-string t_json_generator::json_str(const string& str) {
-  return quot + escape_json_string(str) + quot;
-}
-
-void t_json_generator::generate_constant(t_const* con) {
-  start_object();
-
-  write_key_and_string("name", con->get_name());
-  write_key_and_string("typeId", get_type_name(con->get_type()));
-  write_type_spec_object("type", con->get_type());
-
-  if (con->has_doc()) {
-    write_key_and_string("doc", con->get_doc());
-  }
-
-  write_key_and("value");
-  write_const_value(con->get_value());
-
-  end_object();
-}
-
-void t_json_generator::generate_enum(t_enum* tenum) {
-  start_object();
-
-  write_key_and_string("name", tenum->get_name());
-
-  if (tenum->has_doc()) {
-    write_key_and_string("doc", tenum->get_doc());
-  }
-
-  write_key_and("members");
-  start_array();
-  vector<t_enum_value*> values = tenum->get_constants();
-  vector<t_enum_value*>::iterator val_iter;
-  for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
-    write_comma_if_needed();
-    t_enum_value* val = (*val_iter);
-    start_object();
-    write_key_and_string("name", val->get_name());
-    write_key_and_integer("value", val->get_value());
-    if (val->has_doc()) {
-      write_key_and_string("doc", val->get_doc());
-    }
-    end_object();
-    indicate_comma_needed();
-  }
-  end_array();
-
-  end_object();
-}
-
-void t_json_generator::generate_struct(t_struct* tstruct) {
-  start_object();
-
-  write_key_and_string("name", tstruct->get_name());
-
-  if (tstruct->has_doc()) {
-    write_key_and_string("doc", tstruct->get_doc());
-  }
-
-  write_key_and_bool("isException", tstruct->is_xception());
-
-  write_key_and_bool("isUnion", tstruct->is_union());
-
-  write_key_and("fields");
-  start_array();
-  vector<t_field*> members = tstruct->get_members();
-  vector<t_field*>::iterator mem_iter;
-  for (mem_iter = members.begin(); mem_iter != members.end(); mem_iter++) {
-    write_comma_if_needed();
-    generate_field(*mem_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  end_object();
-}
-
-void t_json_generator::generate_service(t_service* tservice) {
-  start_object();
-
-  write_key_and_string("name", get_qualified_name(tservice));
-
-  if (tservice->get_extends()) {
-    write_key_and_string("extends", get_qualified_name(tservice->get_extends()));
-  }
-
-  if (tservice->has_doc()) {
-    write_key_and_string("doc", tservice->get_doc());
-  }
-
-  write_key_and("functions");
-  start_array();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator fn_iter = functions.begin();
-  for (; fn_iter != functions.end(); fn_iter++) {
-    write_comma_if_needed();
-    generate_function(*fn_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  end_object();
-}
-
-void t_json_generator::generate_function(t_function* tfunc) {
-  start_object();
-
-  write_key_and_string("name", tfunc->get_name());
-
-  write_key_and_string("returnTypeId", get_type_name(tfunc->get_returntype()));
-  write_type_spec_object("returnType", tfunc->get_returntype());
-
-  write_key_and_bool("oneway", tfunc->is_oneway());
-
-  if (tfunc->has_doc()) {
-    write_key_and_string("doc", tfunc->get_doc());
-  }
-
-  write_key_and("arguments");
-  start_array();
-  vector<t_field*> members = tfunc->get_arglist()->get_members();
-  vector<t_field*>::iterator mem_iter = members.begin();
-  for (; mem_iter != members.end(); mem_iter++) {
-    write_comma_if_needed();
-    generate_field(*mem_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  write_key_and("exceptions");
-  start_array();
-  vector<t_field*> excepts = tfunc->get_xceptions()->get_members();
-  vector<t_field*>::iterator ex_iter = excepts.begin();
-  for (; ex_iter != excepts.end(); ex_iter++) {
-    write_comma_if_needed();
-    generate_field(*ex_iter);
-    indicate_comma_needed();
-  }
-  end_array();
-
-  end_object();
-}
-
-void t_json_generator::generate_field(t_field* field) {
-  start_object();
-
-  write_key_and_integer("key", field->get_key());
-  write_key_and_string("name", field->get_name());
-  write_key_and_string("typeId", get_type_name(field->get_type()));
-  write_type_spec_object("type", field->get_type());
-
-  if (field->has_doc()) {
-    write_key_and_string("doc", field->get_doc());
-  }
-
-  write_key_and("required");
-  switch (field->get_req()) {
-  case t_field::T_REQUIRED:
-    write_string("required");
-    break;
-  case t_field::T_OPT_IN_REQ_OUT:
-    write_string("req_out");
-    break;
-  default:
-    write_string("optional");
-    break;
-  }
-
-  if (field->get_value()) {
-    write_key_and("default");
-    write_const_value(field->get_value());
-  }
-
-  end_object();
-}
-
-string t_json_generator::get_type_name(t_type* ttype) {
-  ttype = ttype->get_true_type();
-  if (ttype->is_list()) {
-    return "list";
-  }
-  if (ttype->is_set()) {
-    return "set";
-  }
-  if (ttype->is_map()) {
-    return "map";
-  }
-  if (ttype->is_enum()) {
-    return "i32";
-  }
-  if (ttype->is_struct()) {
-    return ((t_struct*)ttype)->is_union() ? "union" : "struct";
-  }
-  if (ttype->is_xception()) {
-    return "exception";
-  }
-  //if (ttype->is_base_type() && ((t_base_type*)ttype)->is_binary()) {
-  return "binary";
-}
-
-string t_json_generator::get_qualified_name(t_type* ttype) {
-  if (should_merge_includes_ || ttype->get_program() == program_) {
-    return ttype->get_name();
-  }
-  return ttype->get_program()->get_name() + "." + ttype->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(json,
-                          "JSON",
-                          "    merge:           Generate output with included files merged\n")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_lua_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_lua_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_lua_generator.cc
deleted file mode 100644
index 3ca8ae0..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_lua_generator.cc
+++ /dev/null
@@ -1,1127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <sstream>
-#include "t_oop_generator.h"
-#include "platform.h"
-
-using std::ofstream;
-using std::string;
-using std::vector;
-using std::map;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * LUA code generator.
- *
- */
-class t_lua_generator : public t_oop_generator {
-public:
-  t_lua_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("omit_requires");
-    gen_requires_ = (iter == parsed_options.end());
-
-    out_dir_base_ = "gen-lua";
-  }
-
-  /**
-   * Init and close methods
-   */
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-private:
-  /**
-   * True iff we should generate lua require statements.
-   */
-  bool gen_requires_;
-
-  /**
-   * Struct-level generation functions
-   */
-  void generate_lua_struct_definition(std::ofstream& out,
-                                      t_struct* tstruct,
-                                      bool is_xception = false);
-  void generate_lua_struct_reader(std::ofstream& out, t_struct* tstruct);
-  void generate_lua_struct_writer(std::ofstream& out, t_struct* tstruct);
-
-  /**
-   * Service-level generation functions
-   */
-  void generate_service_client(std::ofstream& out, t_service* tservice);
-  void generate_service_interface(std::ofstream& out, t_service* tservice);
-  void generate_service_processor(std::ofstream& out, t_service* tservice);
-  void generate_process_function(std::ofstream& out, t_service* tservice, t_function* tfunction);
-  void generate_service_helpers(ofstream& out, t_service* tservice);
-  void generate_function_helpers(ofstream& out, t_function* tfunction);
-
-  /**
-   * Deserialization (Read)
-   */
-  void generate_deserialize_field(std::ofstream& out,
-                                  t_field* tfield,
-                                  bool local,
-                                  std::string prefix = "");
-
-  void generate_deserialize_struct(std::ofstream& out,
-                                   t_struct* tstruct,
-                                   bool local,
-                                   std::string prefix = "");
-
-  void generate_deserialize_container(std::ofstream& out,
-                                      t_type* ttype,
-                                      bool local,
-                                      std::string prefix = "");
-
-  void generate_deserialize_set_element(std::ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(std::ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(std::ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  /**
-   * Serialization (Write)
-   */
-  void generate_serialize_field(std::ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(std::ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(std::ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(std::ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(std::ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(std::ofstream& out, t_list* tlist, std::string iter);
-
-  /**
-   * Helper rendering functions
-   */
-  std::string lua_includes();
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct, std::string prefix = "");
-  std::string type_to_enum(t_type* ttype);
-  static std::string get_namespace(const t_program* program);
-
-  std::string autogen_comment() {
-    return std::string("--\n") + "-- Autogenerated by Thrift\n" + "--\n"
-           + "-- DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" + "-- @"
-                                                                                       "generated\n"
-           + "--\n";
-  }
-
-  /**
-   * File streams
-   */
-  std::ofstream f_types_;
-  std::ofstream f_consts_;
-  std::ofstream f_service_;
-};
-
-/**
- * Init and close methods
- */
-void t_lua_generator::init_generator() {
-  // Make output directory
-  string outdir = get_out_dir();
-  MKDIR(outdir.c_str());
-
-  // Make output files
-  string cur_namespace = get_namespace(program_);
-  string f_consts_name = outdir + cur_namespace + "constants.lua";
-  f_consts_.open(f_consts_name.c_str());
-  string f_types_name = outdir + cur_namespace + "ttypes.lua";
-  f_types_.open(f_types_name.c_str());
-
-  // Add headers
-  f_consts_ << autogen_comment() << lua_includes();
-  f_types_ << autogen_comment() << lua_includes();
-  if (gen_requires_) {
-    f_types_ << endl << "require '" << cur_namespace << "constants'";
-  }
-}
-
-void t_lua_generator::close_generator() {
-  // Close types file
-  f_types_.close();
-  f_consts_.close();
-}
-
-/**
- * Generate a typedef (essentially a constant)
- */
-void t_lua_generator::generate_typedef(t_typedef* ttypedef) {
-  f_types_ << endl << endl << indent() << ttypedef->get_symbolic() << " = "
-           << ttypedef->get_type()->get_name();
-}
-
-/**
- * Generates code for an enumerated type (table)
- */
-void t_lua_generator::generate_enum(t_enum* tenum) {
-  f_types_ << endl << endl << tenum->get_name() << " = {" << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end();) {
-    int32_t value = (*c_iter)->get_value();
-
-    f_types_ << "  " << (*c_iter)->get_name() << " = " << value;
-    ++c_iter;
-    if (c_iter != constants.end()) {
-      f_types_ << ",";
-    }
-    f_types_ << endl;
-  }
-  f_types_ << "}";
-}
-
-/**
- * Generate a constant (non-local) value
- */
-void t_lua_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  f_consts_ << endl << endl << name << " = ";
-  f_consts_ << render_const_value(type, value);
-}
-
-/**
- * Prints the value of a constant with the given type.
- */
-string t_lua_generator::render_const_value(t_type* type, t_const_value* value) {
-  std::ostringstream out;
-
-  type = get_true_type(type);
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << "'" << value->get_string() << "'";
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_I64:
-      out << "lualongnumber.new('" << value->get_string() << "')";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    out << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << type->get_name() << " = {" << endl;
-    indent_up();
-
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end();) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-
-      indent(out);
-      out << render_const_value(g_type_string, v_iter->first);
-      out << " = ";
-      out << render_const_value(field_type, v_iter->second);
-      ++v_iter;
-      if (v_iter != val.end()) {
-        out << ",";
-      }
-    }
-
-    out << "}";
-    indent_down();
-  } else if (type->is_map()) {
-    out << type->get_name() << "{" << endl;
-    indent_up();
-
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end();) {
-      indent(out) << "[" << render_const_value(ktype, v_iter->first)
-                  << "] = " << render_const_value(vtype, v_iter->second);
-      ++v_iter;
-      if (v_iter != val.end()) {
-        out << ",";
-      }
-      out << endl;
-    }
-    indent_down();
-    indent(out) << "}";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    out << type->get_name() << " = {" << endl;
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end();) {
-      indent(out);
-      out << "[" << render_const_value(etype, *v_iter) << "]";
-      if (type->is_set()) {
-        out << " = true";
-      } else {
-        out << " = false";
-      }
-      ++v_iter;
-      if (v_iter != val.end()) {
-        out << "," << endl;
-      }
-    }
-    out << "}";
-  }
-  return out.str();
-}
-
-/**
- * Generate a thrift struct
- */
-void t_lua_generator::generate_struct(t_struct* tstruct) {
-  generate_lua_struct_definition(f_types_, tstruct, false);
-}
-
-/**
- * Generate a thrift exception
- */
-void t_lua_generator::generate_xception(t_struct* txception) {
-  generate_lua_struct_definition(f_types_, txception, true);
-}
-
-/**
- * Generate a thrift struct or exception (lua table)
- */
-void t_lua_generator::generate_lua_struct_definition(ofstream& out,
-                                                     t_struct* tstruct,
-                                                     bool is_exception) {
-  vector<t_field*>::const_iterator m_iter;
-  const vector<t_field*>& members = tstruct->get_members();
-
-  indent(out) << endl << endl << tstruct->get_name();
-  if (is_exception) {
-    out << " = TException:new{" << endl << indent() << "  __type = '" << tstruct->get_name() << "'";
-    if (members.size() > 0) {
-      out << ",";
-    }
-    out << endl;
-  } else {
-    out << " = __TObject:new{" << endl;
-  }
-  indent_up();
-  for (m_iter = members.begin(); m_iter != members.end();) {
-    indent(out);
-    out << (*m_iter)->get_name();
-    ++m_iter;
-    if (m_iter != members.end()) {
-      out << "," << endl;
-    }
-  }
-  indent_down();
-  indent(out);
-  out << endl << "}";
-
-  generate_lua_struct_reader(out, tstruct);
-  generate_lua_struct_writer(out, tstruct);
-}
-
-/**
- * Generate a struct/exception reader
- */
-void t_lua_generator::generate_lua_struct_reader(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // function
-  indent(out) << endl << endl << "function " << tstruct->get_name() << ":read(iprot)" << endl;
-  indent_up();
-
-  indent(out) << "iprot:readStructBegin()" << endl;
-
-  // while: Read in fields
-  indent(out) << "while true do" << endl;
-  indent_up();
-
-  // if: Check what to read
-  indent(out) << "local fname, ftype, fid = iprot:readFieldBegin()" << endl;
-  indent(out) << "if ftype == TType.STOP then" << endl;
-  indent_up();
-  indent(out) << "break" << endl;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent_down();
-    indent(out) << "elseif fid == " << (*f_iter)->get_key() << " then" << endl;
-    indent_up();
-    indent(out) << "if ftype == " << type_to_enum((*f_iter)->get_type()) << " then" << endl;
-    indent_up();
-
-    // Read field contents
-    generate_deserialize_field(out, *f_iter, false, "self.");
-
-    indent_down();
-    indent(out) << "else" << endl;
-    indent(out) << "  iprot:skip(ftype)" << endl;
-    indent(out) << "end" << endl;
-  }
-
-  // end if
-  indent_down();
-  indent(out) << "else" << endl;
-  indent(out) << "  iprot:skip(ftype)" << endl;
-  indent(out) << "end" << endl;
-  indent(out) << "iprot:readFieldEnd()" << endl;
-
-  // end while
-  indent_down();
-  indent(out) << "end" << endl;
-  indent(out) << "iprot:readStructEnd()" << endl;
-
-  // end function
-  indent_down();
-  indent(out);
-  out << "end";
-}
-
-/**
- * Generate a struct/exception writer
- */
-void t_lua_generator::generate_lua_struct_writer(ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  // function
-  indent(out) << endl << endl << "function " << tstruct->get_name() << ":write(oprot)" << endl;
-  indent_up();
-
-  indent(out) << "oprot:writeStructBegin('" << tstruct->get_name() << "')" << endl;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    indent(out) << "if self." << (*f_iter)->get_name() << " then" << endl;
-    indent_up();
-    indent(out) << "oprot:writeFieldBegin('" << (*f_iter)->get_name() << "', "
-                << type_to_enum((*f_iter)->get_type()) << ", " << (*f_iter)->get_key() << ")"
-                << endl;
-
-    // Write field contents
-    generate_serialize_field(out, *f_iter, "self.");
-
-    indent(out) << "oprot:writeFieldEnd()" << endl;
-    indent_down();
-    indent(out) << "end" << endl;
-  }
-  indent(out) << "oprot:writeFieldStop()" << endl;
-  indent(out) << "oprot:writeStructEnd()" << endl;
-
-  // end function
-  indent_down();
-  indent(out);
-  out << "end";
-}
-
-/**
- * Generate a thrift service
- */
-void t_lua_generator::generate_service(t_service* tservice) {
-  // Get output directory
-  string outdir = get_out_dir();
-
-  // Open the file for writing
-  string cur_ns = get_namespace(program_);
-  string f_service_name = outdir + cur_ns + tservice->get_name() + ".lua";
-  f_service_.open(f_service_name.c_str());
-
-  // Headers
-  f_service_ << autogen_comment() << lua_includes();
-  if (gen_requires_) {
-    f_service_ << endl << "require '" << cur_ns << "ttypes'" << endl;
-
-    if (tservice->get_extends() != NULL) {
-      f_service_ << "require '" << get_namespace(tservice->get_extends()->get_program())
-                 << tservice->get_extends()->get_name() << "'" << endl;
-    }
-  }
-
-  f_service_ << endl;
-
-  generate_service_client(f_service_, tservice);
-  generate_service_interface(f_service_, tservice);
-  generate_service_processor(f_service_, tservice);
-  generate_service_helpers(f_service_, tservice);
-
-  // Close the file
-  f_service_.close();
-}
-
-void t_lua_generator::generate_service_interface(ofstream& out, t_service* tservice) {
-  string classname = tservice->get_name() + "Iface";
-  t_service* extends_s = tservice->get_extends();
-
-  // Interface object definition
-  out << classname << " = ";
-  if (extends_s) {
-    out << extends_s->get_name() << "Iface:new{" << endl;
-  } else {
-    out << "__TObject:new{" << endl;
-  }
-  out << "  __type = '" << classname << "'" << endl << "}" << endl << endl;
-}
-
-void t_lua_generator::generate_service_client(ofstream& out, t_service* tservice) {
-  string classname = tservice->get_name() + "Client";
-  t_service* extends_s = tservice->get_extends();
-
-  // Client object definition
-  out << classname << " = __TObject.new(";
-  if (extends_s != NULL) {
-    out << extends_s->get_name() << "Client";
-  } else {
-    out << "__TClient";
-  }
-  out << ", {" << endl << "  __type = '" << classname << "'" << endl << "})" << endl;
-
-  // Send/Recv functions
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string sig = function_signature(*f_iter);
-    string funcname = (*f_iter)->get_name();
-
-    // Wrapper function
-    indent(out) << endl << "function " << classname << ":" << sig << endl;
-    indent_up();
-
-    indent(out) << "self:send_" << sig << endl << indent();
-    if (!(*f_iter)->is_oneway()) {
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        out << "return ";
-      }
-      out << "self:recv_" << sig << endl;
-    }
-
-    indent_down();
-    indent(out) << "end" << endl;
-
-    // Send function
-    indent(out) << endl << "function " << classname << ":send_" << sig << endl;
-    indent_up();
-
-    indent(out) << "self.oprot:writeMessageBegin('" << funcname << "', "
-                << ((*f_iter)->is_oneway() ? "TMessageType.ONEWAY" : "TMessageType.CALL")
-                << ", self._seqid)" << endl;
-    indent(out) << "local args = " << funcname << "_args:new{}" << endl;
-
-    // Set the args
-    const vector<t_field*>& args = (*f_iter)->get_arglist()->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    for (fld_iter = args.begin(); fld_iter != args.end(); ++fld_iter) {
-      std::string argname = (*fld_iter)->get_name();
-      indent(out) << "args." << argname << " = " << argname << endl;
-    }
-
-    indent(out) << "args:write(self.oprot)" << endl;
-    indent(out) << "self.oprot:writeMessageEnd()" << endl;
-    indent(out) << "self.oprot.trans:flush()" << endl;
-
-    indent_down();
-    indent(out) << "end" << endl;
-
-    // Recv function
-    if (!(*f_iter)->is_oneway()) {
-      indent(out) << endl << "function " << classname << ":recv_" << sig << endl;
-      indent_up();
-
-      out << indent() << "local fname, mtype, rseqid = self.iprot:"
-          << "readMessageBegin()" << endl << indent() << "if mtype == TMessageType.EXCEPTION then"
-          << endl << indent() << "  local x = TApplicationException:new{}" << endl << indent()
-          << "  x:read(self.iprot)" << endl << indent() << "  self.iprot:readMessageEnd()" << endl
-          << indent() << "  error(x)" << endl << indent() << "end" << endl << indent()
-          << "local result = " << funcname << "_result:new{}" << endl << indent()
-          << "result:read(self.iprot)" << endl << indent() << "self.iprot:readMessageEnd()" << endl;
-
-      // Return the result if it's not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        out << indent() << "if result.success then" << endl << indent() << "  return result.success"
-            << endl;
-
-        // Throw custom exceptions
-        const std::vector<t_field*>& xf = (*f_iter)->get_xceptions()->get_members();
-        vector<t_field*>::const_iterator x_iter;
-        for (x_iter = xf.begin(); x_iter != xf.end(); ++x_iter) {
-          out << indent() << "elseif result." << (*x_iter)->get_name() << " then" << endl
-              << indent() << "  error(result." << (*x_iter)->get_name() << ")" << endl;
-        }
-
-        out << indent() << "end" << endl << indent()
-            << "error(TApplicationException:new{errorCode = "
-            << "TApplicationException.MISSING_RESULT})" << endl;
-      }
-
-      indent_down();
-      indent(out) << "end" << endl;
-    }
-  }
-}
-
-void t_lua_generator::generate_service_processor(ofstream& out, t_service* tservice) {
-  string classname = tservice->get_name() + "Processor";
-  t_service* extends_s = tservice->get_extends();
-
-  // Define processor table
-  out << endl << classname << " = __TObject.new(";
-  if (extends_s != NULL) {
-    out << extends_s << "Processor" << endl;
-  } else {
-    out << "__TProcessor" << endl;
-  }
-  out << ", {" << endl << " __type = '" << classname << "'" << endl << "})" << endl;
-
-  // Process function
-  indent(out) << endl << "function " << classname << ":process(iprot, oprot, server_ctx)" << endl;
-  indent_up();
-
-  indent(out) << "local name, mtype, seqid = iprot:readMessageBegin()" << endl;
-  indent(out) << "local func_name = 'process_' .. name" << endl;
-  indent(out) << "if not self[func_name] or ttype(self[func_name]) ~= 'function' then";
-  indent_up();
-  out << endl << indent() << "iprot:skip(TType.STRUCT)" << endl << indent()
-      << "iprot:readMessageEnd()" << endl << indent() << "x = TApplicationException:new{" << endl
-      << indent() << "  errorCode = TApplicationException.UNKNOWN_METHOD" << endl << indent() << "}"
-      << endl << indent() << "oprot:writeMessageBegin(name, TMessageType.EXCEPTION, "
-      << "seqid)" << endl << indent() << "x:write(oprot)" << endl << indent()
-      << "oprot:writeMessageEnd()" << endl << indent() << "oprot.trans:flush()" << endl;
-  indent_down();
-  indent(out) << "else" << endl << indent()
-              << "  self[func_name](self, seqid, iprot, oprot, server_ctx)" << endl << indent()
-              << "end" << endl;
-
-  indent_down();
-  indent(out) << "end" << endl;
-
-  // Generate the process subfunctions
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(out, tservice, *f_iter);
-  }
-}
-
-void t_lua_generator::generate_process_function(ofstream& out,
-                                                t_service* tservice,
-                                                t_function* tfunction) {
-  string classname = tservice->get_name() + "Processor";
-  string argsname = tfunction->get_name() + "_args";
-  string resultname = tfunction->get_name() + "_result";
-  string fn_name = tfunction->get_name();
-
-  indent(out) << endl << "function " << classname << ":process_" << fn_name
-              << "(seqid, iprot, oprot, server_ctx)" << endl;
-  indent_up();
-
-  // Read the request
-  out << indent() << "local args = " << argsname << ":new{}" << endl << indent()
-      << "local reply_type = TMessageType.REPLY" << endl << indent() << "args:read(iprot)" << endl
-      << indent() << "iprot:readMessageEnd()" << endl << indent() << "local result = " << resultname
-      << ":new{}" << endl << indent() << "local status, res = pcall(self.handler." << fn_name
-      << ", self.handler";
-
-  // Print arguments
-  t_struct* args = tfunction->get_arglist();
-  if (args->get_members().size() > 0) {
-    out << ", " << argument_list(args, "args.");
-  }
-
-  // Check for errors
-  out << ")" << endl << indent() << "if not status then" << endl << indent()
-      << "  reply_type = TMessageType.EXCEPTION" << endl << indent()
-      << "  result = TApplicationException:new{message = res}" << endl;
-
-  // Handle custom exceptions
-  const std::vector<t_field*>& xf = tfunction->get_xceptions()->get_members();
-  if (xf.size() > 0) {
-    vector<t_field*>::const_iterator x_iter;
-    for (x_iter = xf.begin(); x_iter != xf.end(); ++x_iter) {
-      out << indent() << "elseif ttype(res) == '" << (*x_iter)->get_type()->get_name() << "' then"
-          << endl << indent() << "  result." << (*x_iter)->get_name() << " = res" << endl;
-    }
-  }
-
-  // Set the result and write the reply
-  out << indent() << "else" << endl << indent() << "  result.success = res" << endl << indent()
-      << "end" << endl << indent() << "oprot:writeMessageBegin('" << fn_name << "', reply_type, "
-      << "seqid)" << endl << indent() << "result:write(oprot)" << endl << indent()
-      << "oprot:writeMessageEnd()" << endl << indent() << "oprot.trans:flush()" << endl;
-
-  indent_down();
-  indent(out) << "end" << endl;
-}
-
-// Service helpers
-void t_lua_generator::generate_service_helpers(ofstream& out, t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  out << endl << "-- HELPER FUNCTIONS AND STRUCTURES";
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_lua_struct_definition(out, ts, false);
-    generate_function_helpers(out, *f_iter);
-  }
-}
-
-void t_lua_generator::generate_function_helpers(ofstream& out, t_function* tfunction) {
-  if (!tfunction->is_oneway()) {
-    t_struct result(program_, tfunction->get_name() + "_result");
-    t_field success(tfunction->get_returntype(), "success", 0);
-    if (!tfunction->get_returntype()->is_void()) {
-      result.append(&success);
-    }
-
-    t_struct* xs = tfunction->get_xceptions();
-    const vector<t_field*>& fields = xs->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-      result.append(*f_iter);
-    }
-    generate_lua_struct_definition(out, &result, false);
-  }
-}
-
-/**
- * Deserialize (Read)
- */
-void t_lua_generator::generate_deserialize_field(ofstream& out,
-                                                 t_field* tfield,
-                                                 bool local,
-                                                 string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-
-  if (type->is_void()) {
-    throw "CANNOT GENERATE DESERIALIZE CODE FOR void TYPE: " + prefix + tfield->get_name();
-  }
-
-  string name = prefix + tfield->get_name();
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_deserialize_struct(out, (t_struct*)type, local, name);
-  } else if (type->is_container()) {
-    generate_deserialize_container(out, type, local, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << (local ? "local " : "") << name << " = iprot:";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << "readString()";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "readBool()";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "readByte()";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "readI16()";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "readI32()";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "readI64()";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "readDouble()";
-        break;
-      default:
-        throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "readI32()";
-    }
-    out << endl;
-
-  } else {
-    printf("DO NOT KNOW HOW TO DESERIALIZE FIELD '%s' TYPE '%s'\n",
-           tfield->get_name().c_str(),
-           type->get_name().c_str());
-  }
-}
-
-void t_lua_generator::generate_deserialize_struct(ofstream& out,
-                                                  t_struct* tstruct,
-                                                  bool local,
-                                                  string prefix) {
-  indent(out) << (local ? "local " : "") << prefix << " = " << tstruct->get_name() << ":new{}"
-              << endl << indent() << prefix << ":read(iprot)" << endl;
-}
-
-void t_lua_generator::generate_deserialize_container(ofstream& out,
-                                                     t_type* ttype,
-                                                     bool local,
-                                                     string prefix) {
-  string size = tmp("_size");
-  string ktype = tmp("_ktype");
-  string vtype = tmp("_vtype");
-  string etype = tmp("_etype");
-
-  t_field fsize(g_type_i32, size);
-  t_field fktype(g_type_byte, ktype);
-  t_field fvtype(g_type_byte, vtype);
-  t_field fetype(g_type_byte, etype);
-
-  // Declare variables, read header
-  indent(out) << (local ? "local " : "") << prefix << " = {}" << endl;
-  if (ttype->is_map()) {
-    indent(out) << "local " << ktype << ", " << vtype << ", " << size << " = iprot:readMapBegin() "
-                << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "local " << etype << ", " << size << " = iprot:readSetBegin()" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "local " << etype << ", " << size << " = iprot:readListBegin()" << endl;
-  }
-
-  // Deserialize
-  indent(out) << "for _i=1," << size << " do" << endl;
-  indent_up();
-
-  if (ttype->is_map()) {
-    generate_deserialize_map_element(out, (t_map*)ttype, prefix);
-  } else if (ttype->is_set()) {
-    generate_deserialize_set_element(out, (t_set*)ttype, prefix);
-  } else if (ttype->is_list()) {
-    generate_deserialize_list_element(out, (t_list*)ttype, prefix);
-  }
-
-  indent_down();
-  indent(out) << "end" << endl;
-
-  // Read container end
-  if (ttype->is_map()) {
-    indent(out) << "iprot:readMapEnd()" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "iprot:readSetEnd()" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "iprot:readListEnd()" << endl;
-  }
-}
-
-void t_lua_generator::generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix) {
-  // A map is represented by a table indexable by any lua type
-  string key = tmp("_key");
-  string val = tmp("_val");
-  t_field fkey(tmap->get_key_type(), key);
-  t_field fval(tmap->get_val_type(), val);
-
-  generate_deserialize_field(out, &fkey, true);
-  generate_deserialize_field(out, &fval, true);
-
-  indent(out) << prefix << "[" << key << "] = " << val << endl;
-}
-
-void t_lua_generator::generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix) {
-  // A set is represented by a table indexed by the value
-  string elem = tmp("_elem");
-  t_field felem(tset->get_elem_type(), elem);
-
-  generate_deserialize_field(out, &felem, true);
-
-  indent(out) << prefix << "[" << elem << "] = " << elem << endl;
-}
-
-void t_lua_generator::generate_deserialize_list_element(ofstream& out,
-                                                        t_list* tlist,
-                                                        string prefix) {
-  // A list is represented by a table indexed by integer values
-  // LUA natively provides all of the functions required to maintain a list
-  string elem = tmp("_elem");
-  t_field felem(tlist->get_elem_type(), elem);
-
-  generate_deserialize_field(out, &felem, true);
-
-  indent(out) << "table.insert(" << prefix << ", " << elem << ")" << endl;
-}
-
-/**
- * Serialize (Write)
- */
-void t_lua_generator::generate_serialize_field(ofstream& out, t_field* tfield, string prefix) {
-  t_type* type = get_true_type(tfield->get_type());
-  string name = prefix + tfield->get_name();
-
-  // Do nothing for void types
-  if (type->is_void()) {
-    throw "CANNOT GENERATE SERIALIZE CODE FOR void TYPE: " + name;
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    generate_serialize_struct(out, (t_struct*)type, name);
-  } else if (type->is_container()) {
-    generate_serialize_container(out, type, name);
-  } else if (type->is_base_type() || type->is_enum()) {
-    indent(out) << "oprot:";
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot serialize void field in a struct: " + name;
-        break;
-      case t_base_type::TYPE_STRING:
-        out << "writeString(" << name << ")";
-        break;
-      case t_base_type::TYPE_BOOL:
-        out << "writeBool(" << name << ")";
-        break;
-      case t_base_type::TYPE_BYTE:
-        out << "writeByte(" << name << ")";
-        break;
-      case t_base_type::TYPE_I16:
-        out << "writeI16(" << name << ")";
-        break;
-      case t_base_type::TYPE_I32:
-        out << "writeI32(" << name << ")";
-        break;
-      case t_base_type::TYPE_I64:
-        out << "writeI64(" << name << ")";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        out << "writeDouble(" << name << ")";
-        break;
-      default:
-        throw "compiler error: no PHP name for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      out << "writeI32(" << name << ")";
-    }
-    out << endl;
-  } else {
-    printf("DO NOT KNOW HOW TO SERIALIZE FIELD '%s' TYPE '%s'\n",
-           name.c_str(),
-           type->get_name().c_str());
-  }
-}
-
-void t_lua_generator::generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix) {
-  (void)tstruct;
-  indent(out) << prefix << ":write(oprot)" << endl;
-}
-
-void t_lua_generator::generate_serialize_container(ofstream& out, t_type* ttype, string prefix) {
-  // Begin writing
-  if (ttype->is_map()) {
-    indent(out) << "oprot:writeMapBegin(" << type_to_enum(((t_map*)ttype)->get_key_type()) << ", "
-                << type_to_enum(((t_map*)ttype)->get_val_type()) << ", "
-                << "ttable_size(" << prefix << "))" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot:writeSetBegin(" << type_to_enum(((t_set*)ttype)->get_elem_type()) << ", "
-                << "ttable_size(" << prefix << "))" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot:writeListBegin(" << type_to_enum(((t_list*)ttype)->get_elem_type())
-                << ", "
-                << "#" << prefix << ")" << endl;
-  }
-
-  // Serialize
-  if (ttype->is_map()) {
-    string kiter = tmp("kiter");
-    string viter = tmp("viter");
-    indent(out) << "for " << kiter << "," << viter << " in pairs(" << prefix << ") do" << endl;
-    indent_up();
-    generate_serialize_map_element(out, (t_map*)ttype, kiter, viter);
-    indent_down();
-    indent(out) << "end" << endl;
-  } else if (ttype->is_set()) {
-    string iter = tmp("iter");
-    indent(out) << "for " << iter << ",_ in pairs(" << prefix << ") do" << endl;
-    indent_up();
-    generate_serialize_set_element(out, (t_set*)ttype, iter);
-    indent_down();
-    indent(out) << "end" << endl;
-  } else if (ttype->is_list()) {
-    string iter = tmp("iter");
-    indent(out) << "for _," << iter << " in ipairs(" << prefix << ") do" << endl;
-    indent_up();
-    generate_serialize_list_element(out, (t_list*)ttype, iter);
-    indent_down();
-    indent(out) << "end" << endl;
-  }
-
-  // Finish writing
-  if (ttype->is_map()) {
-    indent(out) << "oprot:writeMapEnd()" << endl;
-  } else if (ttype->is_set()) {
-    indent(out) << "oprot:writeSetEnd()" << endl;
-  } else if (ttype->is_list()) {
-    indent(out) << "oprot:writeListEnd()" << endl;
-  }
-}
-
-void t_lua_generator::generate_serialize_map_element(ofstream& out,
-                                                     t_map* tmap,
-                                                     string kiter,
-                                                     string viter) {
-  t_field kfield(tmap->get_key_type(), kiter);
-  generate_serialize_field(out, &kfield, "");
-
-  t_field vfield(tmap->get_val_type(), viter);
-  generate_serialize_field(out, &vfield, "");
-}
-
-void t_lua_generator::generate_serialize_set_element(ofstream& out, t_set* tset, string iter) {
-  t_field efield(tset->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-void t_lua_generator::generate_serialize_list_element(ofstream& out, t_list* tlist, string iter) {
-  t_field efield(tlist->get_elem_type(), iter);
-  generate_serialize_field(out, &efield, "");
-}
-
-/**
- *  Helper rendering functions
- */
-string t_lua_generator::lua_includes() {
-  if (gen_requires_) {
-    return "\n\nrequire 'Thrift'";
-  } else {
-    return "";
-  }
-}
-
-string t_lua_generator::get_namespace(const t_program* program) {
-  std::string real_module = program->get_namespace("lua");
-  if (real_module.empty()) {
-    return program->get_name() + "_";
-  }
-  return real_module + "_";
-}
-
-string t_lua_generator::function_signature(t_function* tfunction, string prefix) {
-  (void)prefix;
-  std::string ret = tfunction->get_name() + "(" + argument_list(tfunction->get_arglist()) + ")";
-  return ret;
-}
-
-string t_lua_generator::argument_list(t_struct* tstruct, string prefix) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator fld_iter;
-  std::string ret = "";
-  for (fld_iter = fields.begin(); fld_iter != fields.end();) {
-    ret += prefix + (*fld_iter)->get_name();
-    ++fld_iter;
-    if (fld_iter != fields.end()) {
-      ret += ", ";
-    }
-  }
-  return ret;
-}
-
-string t_lua_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType.STRING";
-    case t_base_type::TYPE_BOOL:
-      return "TType.BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "TType.BYTE";
-    case t_base_type::TYPE_I16:
-      return "TType.I16";
-    case t_base_type::TYPE_I32:
-      return "TType.I32";
-    case t_base_type::TYPE_I64:
-      return "TType.I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType.DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "TType.I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType.STRUCT";
-  } else if (type->is_map()) {
-    return "TType.MAP";
-  } else if (type->is_set()) {
-    return "TType.SET";
-  } else if (type->is_list()) {
-    return "TType.LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(lua, "Lua", "")


[24/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_rb_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_rb_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_rb_generator.cc
deleted file mode 100644
index b25c248..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_rb_generator.cc
+++ /dev/null
@@ -1,1252 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <algorithm>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-
-#include "t_oop_generator.h"
-#include "platform.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * A subclass of std::ofstream that includes indenting functionality.
- */
-class t_rb_ofstream : public std::ofstream {
-private:
-  int indent_;
-
-public:
-  t_rb_ofstream() : std::ofstream(), indent_(0) {}
-  explicit t_rb_ofstream(const char* filename,
-                         ios_base::openmode mode = ios_base::out,
-                         int indent = 0)
-    : std::ofstream(filename, mode), indent_(indent) {}
-
-  t_rb_ofstream& indent() {
-    for (int i = 0; i < indent_; ++i) {
-      *this << "  ";
-    }
-    return *this;
-  }
-
-  void indent_up() { indent_++; }
-  void indent_down() { indent_--; }
-};
-
-/**
- * Ruby code generator.
- *
- */
-class t_rb_generator : public t_oop_generator {
-public:
-  t_rb_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    out_dir_base_ = "gen-rb";
-
-    require_rubygems_ = (parsed_options.find("rubygems") != parsed_options.end());
-    namespaced_ = (parsed_options.find("namespaced") != parsed_options.end());
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_union(t_struct* tunion);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-
-  t_rb_ofstream& render_const_value(t_rb_ofstream& out, t_type* type, t_const_value* value);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_rb_struct(t_rb_ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_rb_struct_required_validator(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_rb_union(t_rb_ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_rb_union_validator(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_rb_function_helpers(t_function* tfunction);
-  void generate_rb_simple_constructor(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_rb_simple_exception_constructor(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_field_constants(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_field_constructors(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_field_defns(t_rb_ofstream& out, t_struct* tstruct);
-  void generate_field_data(t_rb_ofstream& out,
-                           t_type* field_type,
-                           const std::string& field_name,
-                           t_const_value* field_value,
-                           bool optional);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* tfunction);
-
-  /**
-   * Serialization constructs
-   */
-
-  void generate_deserialize_field(t_rb_ofstream& out,
-                                  t_field* tfield,
-                                  std::string prefix = "",
-                                  bool inclass = false);
-
-  void generate_deserialize_struct(t_rb_ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_deserialize_container(t_rb_ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_deserialize_set_element(t_rb_ofstream& out, t_set* tset, std::string prefix = "");
-
-  void generate_deserialize_map_element(t_rb_ofstream& out, t_map* tmap, std::string prefix = "");
-
-  void generate_deserialize_list_element(t_rb_ofstream& out,
-                                         t_list* tlist,
-                                         std::string prefix = "");
-
-  void generate_serialize_field(t_rb_ofstream& out, t_field* tfield, std::string prefix = "");
-
-  void generate_serialize_struct(t_rb_ofstream& out, t_struct* tstruct, std::string prefix = "");
-
-  void generate_serialize_container(t_rb_ofstream& out, t_type* ttype, std::string prefix = "");
-
-  void generate_serialize_map_element(t_rb_ofstream& out,
-                                      t_map* tmap,
-                                      std::string kiter,
-                                      std::string viter);
-
-  void generate_serialize_set_element(t_rb_ofstream& out, t_set* tmap, std::string iter);
-
-  void generate_serialize_list_element(t_rb_ofstream& out, t_list* tlist, std::string iter);
-
-  void generate_rdoc(t_rb_ofstream& out, t_doc* tdoc);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string rb_autogen_comment();
-  std::string render_require_thrift();
-  std::string render_includes();
-  std::string declare_field(t_field* tfield);
-  std::string type_name(t_type* ttype);
-  std::string full_type_name(t_type* ttype);
-  std::string function_signature(t_function* tfunction, std::string prefix = "");
-  std::string argument_list(t_struct* tstruct);
-  std::string type_to_enum(t_type* ttype);
-  std::string rb_namespace_to_path_prefix(std::string rb_namespace);
-
-  std::vector<std::string> ruby_modules(t_program* p) {
-    std::string ns = p->get_namespace("rb");
-    std::vector<std::string> modules;
-    if (ns.empty()) {
-      return modules;
-    }
-
-    std::string::iterator pos = ns.begin();
-    while (true) {
-      std::string::iterator delim = std::find(pos, ns.end(), '.');
-      modules.push_back(capitalize(std::string(pos, delim)));
-      pos = delim;
-      if (pos == ns.end()) {
-        break;
-      }
-      ++pos;
-    }
-
-    return modules;
-  }
-
-  void begin_namespace(t_rb_ofstream&, std::vector<std::string>);
-  void end_namespace(t_rb_ofstream&, std::vector<std::string>);
-
-private:
-  /**
-   * File streams
-   */
-
-  t_rb_ofstream f_types_;
-  t_rb_ofstream f_consts_;
-  t_rb_ofstream f_service_;
-
-  std::string namespace_dir_;
-  std::string require_prefix_;
-
-  /** If true, add a "require 'rubygems'" line to the top of each gen-rb file. */
-  bool require_rubygems_;
-
-  /** If true, generate files in idiomatic namespaced directories. */
-  bool namespaced_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_rb_generator::init_generator() {
-  string subdir = get_out_dir();
-
-  // Make output directory
-  MKDIR(subdir.c_str());
-
-  if (namespaced_) {
-    require_prefix_ = rb_namespace_to_path_prefix(program_->get_namespace("rb"));
-
-    string dir = require_prefix_;
-    string::size_type loc;
-
-    while ((loc = dir.find("/")) != string::npos) {
-      subdir = subdir + dir.substr(0, loc) + "/";
-      MKDIR(subdir.c_str());
-      dir = dir.substr(loc + 1);
-    }
-  }
-
-  namespace_dir_ = subdir;
-
-  // Make output file
-  string f_types_name = namespace_dir_ + underscore(program_name_) + "_types.rb";
-  f_types_.open(f_types_name.c_str());
-
-  string f_consts_name = namespace_dir_ + underscore(program_name_) + "_constants.rb";
-  f_consts_.open(f_consts_name.c_str());
-
-  // Print header
-  f_types_ << rb_autogen_comment() << endl << render_require_thrift() << render_includes() << endl;
-  begin_namespace(f_types_, ruby_modules(program_));
-
-  f_consts_ << rb_autogen_comment() << endl << render_require_thrift() << "require '"
-            << require_prefix_ << underscore(program_name_) << "_types'" << endl << endl;
-  begin_namespace(f_consts_, ruby_modules(program_));
-}
-
-/**
- * Renders the require of thrift itself, and possibly of the rubygems dependency.
- */
-string t_rb_generator::render_require_thrift() {
-  if (require_rubygems_) {
-    return "require 'rubygems'\nrequire 'thrift'\n";
-  } else {
-    return "require 'thrift'\n";
-  }
-}
-
-/**
- * Renders all the imports necessary for including another Thrift program
- */
-string t_rb_generator::render_includes() {
-  const vector<t_program*>& includes = program_->get_includes();
-  string result = "";
-  for (size_t i = 0; i < includes.size(); ++i) {
-    if (namespaced_) {
-      t_program* included = includes[i];
-      std::string included_require_prefix
-          = rb_namespace_to_path_prefix(included->get_namespace("rb"));
-      std::string included_name = included->get_name();
-      result += "require '" + included_require_prefix + underscore(included_name) + "_types'\n";
-    } else {
-      result += "require '" + underscore(includes[i]->get_name()) + "_types'\n";
-    }
-  }
-  if (includes.size() > 0) {
-    result += "\n";
-  }
-  return result;
-}
-
-/**
- * Autogen'd comment
- */
-string t_rb_generator::rb_autogen_comment() {
-  return std::string("#\n") + "# Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-         + "#\n" + "# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" + "#\n";
-}
-
-/**
- * Closes the type files
- */
-void t_rb_generator::close_generator() {
-  // Close types file
-  end_namespace(f_types_, ruby_modules(program_));
-  end_namespace(f_consts_, ruby_modules(program_));
-  f_types_.close();
-  f_consts_.close();
-}
-
-/**
- * Generates a typedef. This is not done in Ruby, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_rb_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-/**
- * Generates code for an enumerated type. Done using a class to scope
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_rb_generator::generate_enum(t_enum* tenum) {
-  f_types_.indent() << "module " << capitalize(tenum->get_name()) << endl;
-  f_types_.indent_up();
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-
-    // Ruby class constants have to be capitalized... omg i am so on the fence
-    // about languages strictly enforcing capitalization why can't we just all
-    // agree and play nice.
-    string name = capitalize((*c_iter)->get_name());
-
-    generate_rdoc(f_types_, *c_iter);
-    f_types_.indent() << name << " = " << value << endl;
-  }
-
-  // Create a hash mapping values back to their names (as strings) since ruby has no native enum
-  // type
-  f_types_.indent() << "VALUE_MAP = {";
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    // Populate the hash
-    int value = (*c_iter)->get_value();
-    if (c_iter != constants.begin())
-      f_types_ << ", ";
-    f_types_ << value << " => \"" << capitalize((*c_iter)->get_name()) << "\"";
-  }
-  f_types_ << "}" << endl;
-
-  // Create a set with valid values for this enum
-  f_types_.indent() << "VALID_VALUES = Set.new([";
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    // Populate the set
-    if (c_iter != constants.begin())
-      f_types_ << ", ";
-    f_types_ << capitalize((*c_iter)->get_name());
-  }
-  f_types_ << "]).freeze" << endl;
-
-  f_types_.indent_down();
-  f_types_.indent() << "end" << endl << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_rb_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  name[0] = toupper(name[0]);
-
-  f_consts_.indent() << name << " = ";
-  render_const_value(f_consts_, type, value) << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-t_rb_ofstream& t_rb_generator::render_const_value(t_rb_ofstream& out,
-                                                  t_type* type,
-                                                  t_const_value* value) {
-  type = get_true_type(type);
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << "%q\"" << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    out.indent() << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << full_type_name(type) << ".new({" << endl;
-    out.indent_up();
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      out.indent();
-      render_const_value(out, g_type_string, v_iter->first) << " => ";
-      render_const_value(out, field_type, v_iter->second) << "," << endl;
-    }
-    out.indent_down();
-    out.indent() << "})";
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "{" << endl;
-    out.indent_up();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out.indent();
-      render_const_value(out, ktype, v_iter->first) << " => ";
-      render_const_value(out, vtype, v_iter->second) << "," << endl;
-    }
-    out.indent_down();
-    out.indent() << "}";
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    if (type->is_set()) {
-      out << "Set.new([" << endl;
-    } else {
-      out << "[" << endl;
-    }
-    out.indent_up();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out.indent();
-      render_const_value(out, etype, *v_iter) << "," << endl;
-    }
-    out.indent_down();
-    if (type->is_set()) {
-      out.indent() << "])";
-    } else {
-      out.indent() << "]";
-    }
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-  return out;
-}
-
-/**
- * Generates a ruby struct
- */
-void t_rb_generator::generate_struct(t_struct* tstruct) {
-  if (tstruct->is_union()) {
-    generate_rb_union(f_types_, tstruct, false);
-  } else {
-    generate_rb_struct(f_types_, tstruct, false);
-  }
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_rb_generator::generate_xception(t_struct* txception) {
-  generate_rb_struct(f_types_, txception, true);
-}
-
-/**
- * Generates a ruby struct
- */
-void t_rb_generator::generate_rb_struct(t_rb_ofstream& out,
-                                        t_struct* tstruct,
-                                        bool is_exception = false) {
-  generate_rdoc(out, tstruct);
-  out.indent() << "class " << type_name(tstruct);
-  if (is_exception) {
-    out << " < ::Thrift::Exception";
-  }
-  out << endl;
-
-  out.indent_up();
-  out.indent() << "include ::Thrift::Struct, ::Thrift::Struct_Union" << endl;
-
-  if (is_exception) {
-    generate_rb_simple_exception_constructor(out, tstruct);
-  }
-
-  generate_field_constants(out, tstruct);
-  generate_field_defns(out, tstruct);
-  generate_rb_struct_required_validator(out, tstruct);
-
-  out.indent() << "::Thrift::Struct.generate_accessors self" << endl;
-
-  out.indent_down();
-  out.indent() << "end" << endl << endl;
-}
-
-/**
- * Generates a ruby union
- */
-void t_rb_generator::generate_rb_union(t_rb_ofstream& out,
-                                       t_struct* tstruct,
-                                       bool is_exception = false) {
-  (void)is_exception;
-  generate_rdoc(out, tstruct);
-  out.indent() << "class " << type_name(tstruct) << " < ::Thrift::Union" << endl;
-
-  out.indent_up();
-  out.indent() << "include ::Thrift::Struct_Union" << endl;
-
-  generate_field_constructors(out, tstruct);
-
-  generate_field_constants(out, tstruct);
-  generate_field_defns(out, tstruct);
-  generate_rb_union_validator(out, tstruct);
-
-  out.indent() << "::Thrift::Union.generate_accessors self" << endl;
-
-  out.indent_down();
-  out.indent() << "end" << endl << endl;
-}
-
-void t_rb_generator::generate_field_constructors(t_rb_ofstream& out, t_struct* tstruct) {
-
-  out.indent() << "class << self" << endl;
-  out.indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (f_iter != fields.begin()) {
-      out << endl;
-    }
-    std::string field_name = (*f_iter)->get_name();
-
-    out.indent() << "def " << field_name << "(val)" << endl;
-    out.indent() << "  " << tstruct->get_name() << ".new(:" << field_name << ", val)" << endl;
-    out.indent() << "end" << endl;
-  }
-
-  out.indent_down();
-  out.indent() << "end" << endl;
-
-  out << endl;
-}
-
-void t_rb_generator::generate_rb_simple_exception_constructor(t_rb_ofstream& out,
-                                                              t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-
-  if (members.size() == 1) {
-    vector<t_field*>::const_iterator m_iter = members.begin();
-
-    if ((*m_iter)->get_type()->is_string()) {
-      string name = (*m_iter)->get_name();
-
-      out.indent() << "def initialize(message=nil)" << endl;
-      out.indent_up();
-      out.indent() << "super()" << endl;
-      out.indent() << "self." << name << " = message" << endl;
-      out.indent_down();
-      out.indent() << "end" << endl << endl;
-
-      if (name != "message") {
-        out.indent() << "def message; " << name << " end" << endl << endl;
-      }
-    }
-  }
-}
-
-void t_rb_generator::generate_field_constants(t_rb_ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    std::string field_name = (*f_iter)->get_name();
-    std::string cap_field_name = upcase_string(field_name);
-
-    out.indent() << cap_field_name << " = " << (*f_iter)->get_key() << endl;
-  }
-  out << endl;
-}
-
-void t_rb_generator::generate_field_defns(t_rb_ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out.indent() << "FIELDS = {" << endl;
-  out.indent_up();
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (f_iter != fields.begin()) {
-      out << "," << endl;
-    }
-
-    // generate the field docstrings within the FIELDS constant. no real better place...
-    generate_rdoc(out, *f_iter);
-
-    out.indent() << upcase_string((*f_iter)->get_name()) << " => ";
-
-    generate_field_data(out,
-                        (*f_iter)->get_type(),
-                        (*f_iter)->get_name(),
-                        (*f_iter)->get_value(),
-                        (*f_iter)->get_req() == t_field::T_OPTIONAL);
-  }
-  out.indent_down();
-  out << endl;
-  out.indent() << "}" << endl << endl;
-
-  out.indent() << "def struct_fields; FIELDS; end" << endl << endl;
-}
-
-void t_rb_generator::generate_field_data(t_rb_ofstream& out,
-                                         t_type* field_type,
-                                         const std::string& field_name = "",
-                                         t_const_value* field_value = NULL,
-                                         bool optional = false) {
-  field_type = get_true_type(field_type);
-
-  // Begin this field's defn
-  out << "{:type => " << type_to_enum(field_type);
-
-  if (!field_name.empty()) {
-    out << ", :name => '" << field_name << "'";
-  }
-
-  if (field_value != NULL) {
-    out << ", :default => ";
-    render_const_value(out, field_type, field_value);
-  }
-
-  if (!field_type->is_base_type()) {
-    if (field_type->is_struct() || field_type->is_xception()) {
-      out << ", :class => " << full_type_name((t_struct*)field_type);
-    } else if (field_type->is_list()) {
-      out << ", :element => ";
-      generate_field_data(out, ((t_list*)field_type)->get_elem_type());
-    } else if (field_type->is_map()) {
-      out << ", :key => ";
-      generate_field_data(out, ((t_map*)field_type)->get_key_type());
-      out << ", :value => ";
-      generate_field_data(out, ((t_map*)field_type)->get_val_type());
-    } else if (field_type->is_set()) {
-      out << ", :element => ";
-      generate_field_data(out, ((t_set*)field_type)->get_elem_type());
-    }
-  } else {
-    if (((t_base_type*)field_type)->is_binary()) {
-      out << ", :binary => true";
-    }
-  }
-
-  if (optional) {
-    out << ", :optional => true";
-  }
-
-  if (field_type->is_enum()) {
-    out << ", :enum_class => " << full_type_name(field_type);
-  }
-
-  // End of this field's defn
-  out << "}";
-}
-
-void t_rb_generator::begin_namespace(t_rb_ofstream& out, vector<std::string> modules) {
-  for (vector<std::string>::iterator m_iter = modules.begin(); m_iter != modules.end(); ++m_iter) {
-    out.indent() << "module " << *m_iter << endl;
-    out.indent_up();
-  }
-}
-
-void t_rb_generator::end_namespace(t_rb_ofstream& out, vector<std::string> modules) {
-  for (vector<std::string>::reverse_iterator m_iter = modules.rbegin(); m_iter != modules.rend();
-       ++m_iter) {
-    out.indent_down();
-    out.indent() << "end" << endl;
-  }
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_rb_generator::generate_service(t_service* tservice) {
-  string f_service_name = namespace_dir_ + underscore(service_name_) + ".rb";
-  f_service_.open(f_service_name.c_str());
-
-  f_service_ << rb_autogen_comment() << endl << render_require_thrift();
-
-  if (tservice->get_extends() != NULL) {
-    if (namespaced_) {
-      f_service_ << "require '" << rb_namespace_to_path_prefix(
-                                       tservice->get_extends()->get_program()->get_namespace("rb"))
-                 << underscore(tservice->get_extends()->get_name()) << "'" << endl;
-    } else {
-      f_service_ << "require '" << require_prefix_
-                 << underscore(tservice->get_extends()->get_name()) << "'" << endl;
-    }
-  }
-
-  f_service_ << "require '" << require_prefix_ << underscore(program_name_) << "_types'" << endl
-             << endl;
-
-  begin_namespace(f_service_, ruby_modules(tservice->get_program()));
-
-  f_service_.indent() << "module " << capitalize(tservice->get_name()) << endl;
-  f_service_.indent_up();
-
-  // Generate the three main parts of the service (well, two for now in PHP)
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-
-  f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
-
-  end_namespace(f_service_, ruby_modules(tservice->get_program()));
-
-  // Close service file
-  f_service_.close();
-}
-
-/**
- * Generates helper functions for a service.
- *
- * @param tservice The service to generate a header definition for
- */
-void t_rb_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  f_service_.indent() << "# HELPER FUNCTIONS AND STRUCTURES" << endl << endl;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_rb_struct(f_service_, ts);
-    generate_rb_function_helpers(*f_iter);
-  }
-}
-
-/**
- * Generates a struct and helpers for a function.
- *
- * @param tfunction The function
- */
-void t_rb_generator::generate_rb_function_helpers(t_function* tfunction) {
-  t_struct result(program_, tfunction->get_name() + "_result");
-  t_field success(tfunction->get_returntype(), "success", 0);
-  if (!tfunction->get_returntype()->is_void()) {
-    result.append(&success);
-  }
-
-  t_struct* xs = tfunction->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    result.append(*f_iter);
-  }
-  generate_rb_struct(f_service_, &result);
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_rb_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = full_type_name(tservice->get_extends());
-    extends_client = " < " + extends + "::Client ";
-  }
-
-  f_service_.indent() << "class Client" << extends_client << endl;
-  f_service_.indent_up();
-
-  f_service_.indent() << "include ::Thrift::Client" << endl << endl;
-
-  // Generate client method implementations
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    string funname = (*f_iter)->get_name();
-
-    // Open function
-    f_service_.indent() << "def " << function_signature(*f_iter) << endl;
-    f_service_.indent_up();
-    f_service_.indent() << "send_" << funname << "(";
-
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        f_service_ << ", ";
-      }
-      f_service_ << (*fld_iter)->get_name();
-    }
-    f_service_ << ")" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_service_.indent();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_ << "return ";
-      }
-      f_service_ << "recv_" << funname << "()" << endl;
-    }
-    f_service_.indent_down();
-    f_service_.indent() << "end" << endl;
-    f_service_ << endl;
-
-    f_service_.indent() << "def send_" << function_signature(*f_iter) << endl;
-    f_service_.indent_up();
-
-    std::string argsname = capitalize((*f_iter)->get_name() + "_args");
-    std::string messageSendProc = (*f_iter)->is_oneway() ? "send_oneway_message" : "send_message";
-
-    f_service_.indent() << messageSendProc << "('" << funname << "', " << argsname;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << ", :" << (*fld_iter)->get_name() << " => " << (*fld_iter)->get_name();
-    }
-
-    f_service_ << ")" << endl;
-
-    f_service_.indent_down();
-    f_service_.indent() << "end" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      std::string resultname = capitalize((*f_iter)->get_name() + "_result");
-      t_struct noargs(program_);
-
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs);
-      // Open function
-      f_service_ << endl;
-      f_service_.indent() << "def " << function_signature(&recv_function) << endl;
-      f_service_.indent_up();
-
-      // TODO(mcslee): Validate message reply here, seq ids etc.
-
-      f_service_.indent() << "result = receive_message(" << resultname << ")" << endl;
-
-      // Careful, only return _result if not a void function
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        f_service_.indent() << "return result.success unless result.success.nil?" << endl;
-      }
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        f_service_.indent() << "raise result." << (*x_iter)->get_name() << " unless result."
-                            << (*x_iter)->get_name() << ".nil?" << endl;
-      }
-
-      // Careful, only return _result if not a void function
-      if ((*f_iter)->get_returntype()->is_void()) {
-        f_service_.indent() << "return" << endl;
-      } else {
-        f_service_.indent() << "raise "
-                               "::Thrift::ApplicationException.new(::Thrift::ApplicationException::"
-                               "MISSING_RESULT, '" << (*f_iter)->get_name()
-                            << " failed: unknown result')" << endl;
-      }
-
-      // Close function
-      f_service_.indent_down();
-      f_service_.indent() << "end" << endl << endl;
-    }
-  }
-
-  f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
-}
-
-/**
- * Generates a service server definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_rb_generator::generate_service_server(t_service* tservice) {
-  // Generate the dispatch methods
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-  if (tservice->get_extends() != NULL) {
-    extends = full_type_name(tservice->get_extends());
-    extends_processor = " < " + extends + "::Processor ";
-  }
-
-  // Generate the header portion
-  f_service_.indent() << "class Processor" << extends_processor << endl;
-  f_service_.indent_up();
-
-  f_service_.indent() << "include ::Thrift::Processor" << endl << endl;
-
-  // Generate the process subfunctions
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_process_function(tservice, *f_iter);
-  }
-
-  f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
-}
-
-/**
- * Generates a process function definition.
- *
- * @param tfunction The function to write a dispatcher for
- */
-void t_rb_generator::generate_process_function(t_service* tservice, t_function* tfunction) {
-  (void)tservice;
-  // Open function
-  f_service_.indent() << "def process_" << tfunction->get_name() << "(seqid, iprot, oprot)" << endl;
-  f_service_.indent_up();
-
-  string argsname = capitalize(tfunction->get_name()) + "_args";
-  string resultname = capitalize(tfunction->get_name()) + "_result";
-
-  f_service_.indent() << "args = read_args(iprot, " << argsname << ")" << endl;
-
-  t_struct* xs = tfunction->get_xceptions();
-  const std::vector<t_field*>& xceptions = xs->get_members();
-  vector<t_field*>::const_iterator x_iter;
-
-  // Declare result for non oneway function
-  if (!tfunction->is_oneway()) {
-    f_service_.indent() << "result = " << resultname << ".new()" << endl;
-  }
-
-  // Try block for a function with exceptions
-  if (xceptions.size() > 0) {
-    f_service_.indent() << "begin" << endl;
-    f_service_.indent_up();
-  }
-
-  // Generate the function call
-  t_struct* arg_struct = tfunction->get_arglist();
-  const std::vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  f_service_.indent();
-  if (!tfunction->is_oneway() && !tfunction->get_returntype()->is_void()) {
-    f_service_ << "result.success = ";
-  }
-  f_service_ << "@handler." << tfunction->get_name() << "(";
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_service_ << ", ";
-    }
-    f_service_ << "args." << (*f_iter)->get_name();
-  }
-  f_service_ << ")" << endl;
-
-  if (!tfunction->is_oneway() && xceptions.size() > 0) {
-    f_service_.indent_down();
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      f_service_.indent() << "rescue " << full_type_name((*x_iter)->get_type()) << " => "
-                          << (*x_iter)->get_name() << endl;
-      if (!tfunction->is_oneway()) {
-        f_service_.indent_up();
-        f_service_.indent() << "result." << (*x_iter)->get_name() << " = " << (*x_iter)->get_name()
-                            << endl;
-        f_service_.indent_down();
-      }
-    }
-    f_service_.indent() << "end" << endl;
-  }
-
-  // Shortcut out here for oneway functions
-  if (tfunction->is_oneway()) {
-    f_service_.indent() << "return" << endl;
-    f_service_.indent_down();
-    f_service_.indent() << "end" << endl << endl;
-    return;
-  }
-
-  f_service_.indent() << "write_result(result, oprot, '" << tfunction->get_name() << "', seqid)"
-                      << endl;
-
-  // Close function
-  f_service_.indent_down();
-  f_service_.indent() << "end" << endl << endl;
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_rb_generator::function_signature(t_function* tfunction, string prefix) {
-  // TODO(mcslee): Nitpicky, no ',' if argument_list is empty
-  return prefix + tfunction->get_name() + "(" + argument_list(tfunction->get_arglist()) + ")";
-}
-
-/**
- * Renders a field list
- */
-string t_rb_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += (*f_iter)->get_name();
-  }
-  return result;
-}
-
-string t_rb_generator::type_name(t_type* ttype) {
-  string prefix = "";
-
-  string name = ttype->get_name();
-  if (ttype->is_struct() || ttype->is_xception() || ttype->is_enum()) {
-    name = capitalize(ttype->get_name());
-  }
-
-  return prefix + name;
-}
-
-string t_rb_generator::full_type_name(t_type* ttype) {
-  string prefix = "::";
-  vector<std::string> modules = ruby_modules(ttype->get_program());
-  for (vector<std::string>::iterator m_iter = modules.begin(); m_iter != modules.end(); ++m_iter) {
-    prefix += *m_iter + "::";
-  }
-  return prefix + type_name(ttype);
-}
-
-/**
- * Converts the parse type to a Ruby tyoe
- */
-string t_rb_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "::Thrift::Types::STRING";
-    case t_base_type::TYPE_BOOL:
-      return "::Thrift::Types::BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "::Thrift::Types::BYTE";
-    case t_base_type::TYPE_I16:
-      return "::Thrift::Types::I16";
-    case t_base_type::TYPE_I32:
-      return "::Thrift::Types::I32";
-    case t_base_type::TYPE_I64:
-      return "::Thrift::Types::I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "::Thrift::Types::DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "::Thrift::Types::I32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "::Thrift::Types::STRUCT";
-  } else if (type->is_map()) {
-    return "::Thrift::Types::MAP";
-  } else if (type->is_set()) {
-    return "::Thrift::Types::SET";
-  } else if (type->is_list()) {
-    return "::Thrift::Types::LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-string t_rb_generator::rb_namespace_to_path_prefix(string rb_namespace) {
-  string namespaces_left = rb_namespace;
-  string::size_type loc;
-
-  string path_prefix = "";
-
-  while ((loc = namespaces_left.find(".")) != string::npos) {
-    path_prefix = path_prefix + underscore(namespaces_left.substr(0, loc)) + "/";
-    namespaces_left = namespaces_left.substr(loc + 1);
-  }
-  if (namespaces_left.size() > 0) {
-    path_prefix = path_prefix + underscore(namespaces_left) + "/";
-  }
-  return path_prefix;
-}
-
-void t_rb_generator::generate_rdoc(t_rb_ofstream& out, t_doc* tdoc) {
-  if (tdoc->has_doc()) {
-    out.indent();
-    generate_docstring_comment(out, "", "# ", tdoc->get_doc(), "");
-  }
-}
-
-void t_rb_generator::generate_rb_struct_required_validator(t_rb_ofstream& out, t_struct* tstruct) {
-  out.indent() << "def validate" << endl;
-  out.indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = (*f_iter);
-    if (field->get_req() == t_field::T_REQUIRED) {
-      out.indent() << "raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, "
-                      "'Required field " << field->get_name() << " is unset!')";
-      if (field->get_type()->is_bool()) {
-        out << " if @" << field->get_name() << ".nil?";
-      } else {
-        out << " unless @" << field->get_name();
-      }
-      out << endl;
-    }
-  }
-
-  // if field is an enum, check that its value is valid
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    t_field* field = (*f_iter);
-
-    if (field->get_type()->is_enum()) {
-      out.indent() << "unless @" << field->get_name() << ".nil? || "
-                   << full_type_name(field->get_type()) << "::VALID_VALUES.include?(@"
-                   << field->get_name() << ")" << endl;
-      out.indent_up();
-      out.indent() << "raise ::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, "
-                      "'Invalid value of field " << field->get_name() << "!')" << endl;
-      out.indent_down();
-      out.indent() << "end" << endl;
-    }
-  }
-
-  out.indent_down();
-  out.indent() << "end" << endl << endl;
-}
-
-void t_rb_generator::generate_rb_union_validator(t_rb_ofstream& out, t_struct* tstruct) {
-  out.indent() << "def validate" << endl;
-  out.indent_up();
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out.indent()
-      << "raise(StandardError, 'Union fields are not set.') if get_set_field.nil? || get_value.nil?"
-      << endl;
-
-  // if field is an enum, check that its value is valid
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    const t_field* field = (*f_iter);
-
-    if (field->get_type()->is_enum()) {
-      out.indent() << "if get_set_field == :" << field->get_name() << endl;
-      out.indent() << "  raise "
-                      "::Thrift::ProtocolException.new(::Thrift::ProtocolException::UNKNOWN, "
-                      "'Invalid value of field " << field->get_name() << "!') unless "
-                   << full_type_name(field->get_type()) << "::VALID_VALUES.include?(get_value)"
-                   << endl;
-      out.indent() << "end" << endl;
-    }
-  }
-
-  out.indent_down();
-  out.indent() << "end" << endl << endl;
-}
-
-THRIFT_REGISTER_GENERATOR(
-    rb,
-    "Ruby",
-    "    rubygems:        Add a \"require 'rubygems'\" line to the top of each generated file.\n"
-    "    namespaced:      Generate files in idiomatic namespaced directories.\n")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_st_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_st_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_st_generator.cc
deleted file mode 100644
index 9235f68..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_st_generator.cc
+++ /dev/null
@@ -1,1049 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-
-#include <stdlib.h>
-#include <time.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sstream>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-#include "version.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * Smalltalk code generator.
- *
- */
-class t_st_generator : public t_oop_generator {
-public:
-  t_st_generator(t_program* program,
-                 const std::map<std::string, std::string>& parsed_options,
-                 const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-st";
-  }
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_const(t_const* tconst);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-  void generate_class_side_definition();
-  void generate_force_consts();
-
-  std::string render_const_value(t_type* type, t_const_value* value);
-
-  /**
-   * Struct generation code
-   */
-
-  void generate_st_struct(std::ofstream& out, t_struct* tstruct, bool is_exception);
-  void generate_accessors(std::ofstream& out, t_struct* tstruct);
-
-  /**
-   * Service-level generation functions
-   */
-
-  void generate_service_client(t_service* tservice);
-
-  void generate_send_method(t_function* tfunction);
-  void generate_recv_method(t_function* tfunction);
-
-  std::string map_reader(t_map* tmap);
-  std::string list_reader(t_list* tlist);
-  std::string set_reader(t_set* tset);
-  std::string struct_reader(t_struct* tstruct, std::string clsName);
-
-  std::string map_writer(t_map* tmap, std::string name);
-  std::string list_writer(t_list* tlist, std::string name);
-  std::string set_writer(t_set* tset, std::string name);
-  std::string struct_writer(t_struct* tstruct, std::string fname);
-
-  std::string write_val(t_type* t, std::string fname);
-  std::string read_val(t_type* t);
-
-  /**
-   * Helper rendering functions
-   */
-
-  std::string st_autogen_comment();
-
-  void st_class_def(std::ofstream& out, std::string name);
-  void st_method(std::ofstream& out, std::string cls, std::string name);
-  void st_method(std::ofstream& out, std::string cls, std::string name, std::string category);
-  void st_close_method(std::ofstream& out);
-  void st_class_method(std::ofstream& out, std::string cls, std::string name);
-  void st_class_method(std::ofstream& out, std::string cls, std::string name, std::string category);
-  void st_setter(std::ofstream& out, std::string cls, std::string name, std::string type);
-  void st_getter(std::ofstream& out, std::string cls, std::string name);
-  void st_accessors(std::ofstream& out, std::string cls, std::string name, std::string type);
-
-  std::string class_name();
-  static bool is_valid_namespace(const std::string& sub_namespace);
-  std::string client_class_name();
-  std::string prefix(std::string name);
-  std::string declare_field(t_field* tfield);
-  std::string type_name(t_type* ttype);
-
-  std::string function_signature(t_function* tfunction);
-  std::string argument_list(t_struct* tstruct);
-  std::string function_types_comment(t_function* fn);
-
-  std::string type_to_enum(t_type* ttype);
-  std::string a_type(t_type* type);
-  bool is_vowel(char c);
-  std::string temp_name();
-  std::string generated_category();
-
-private:
-  /**
-   * File streams
-   */
-  int temporary_var;
-  std::ofstream f_;
-};
-
-/**
- * Prepares for file generation by opening up the necessary file output
- * streams.
- *
- * @param tprogram The program to generate
- */
-void t_st_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  temporary_var = 0;
-
-  // Make output file
-  string f_name = get_out_dir() + "/" + program_name_ + ".st";
-  f_.open(f_name.c_str());
-
-  // Print header
-  f_ << st_autogen_comment() << endl;
-
-  st_class_def(f_, program_name_);
-  generate_class_side_definition();
-
-  // Generate enums
-  vector<t_enum*> enums = program_->get_enums();
-  vector<t_enum*>::iterator en_iter;
-  for (en_iter = enums.begin(); en_iter != enums.end(); ++en_iter) {
-    generate_enum(*en_iter);
-  }
-}
-
-string t_st_generator::class_name() {
-  return capitalize(program_name_);
-}
-
-bool t_st_generator::is_valid_namespace(const std::string& sub_namespace) {
-  return sub_namespace == "prefix" || sub_namespace == "category";
-}
-
-string t_st_generator::prefix(string class_name) {
-  string prefix = program_->get_namespace("smalltalk.prefix");
-  string name = capitalize(class_name);
-  name = prefix.empty() ? name : (prefix + name);
-  return name;
-}
-
-string t_st_generator::client_class_name() {
-  return capitalize(service_name_) + "Client";
-}
-
-/**
- * Autogen'd comment
- */
-string t_st_generator::st_autogen_comment() {
-  return std::string("'") + "Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n" + "\n"
-         + "DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n" + "'!\n";
-}
-
-void t_st_generator::generate_force_consts() {
-  f_ << prefix(class_name()) << " enums keysAndValuesDo: [:k :v | " << prefix(class_name())
-     << " enums at: k put: v value].!" << endl;
-
-  f_ << prefix(class_name()) << " constants keysAndValuesDo: [:k :v | " << prefix(class_name())
-     << " constants at: k put: v value].!" << endl;
-}
-
-void t_st_generator::close_generator() {
-  generate_force_consts();
-  f_.close();
-}
-
-string t_st_generator::generated_category() {
-  string cat = program_->get_namespace("smalltalk.category");
-  // For compatibility with the Thrift grammar, the category must
-  // be punctuated by dots.  Replaces them with dashes here.
-  for (string::iterator iter = cat.begin(); iter != cat.end(); ++iter) {
-    if (*iter == '.') {
-      *iter = '-';
-    }
-  }
-  return cat.size() ? cat : "Generated-" + class_name();
-}
-
-/**
- * Generates a typedef. This is not done in Smalltalk, types are all implicit.
- *
- * @param ttypedef The type definition
- */
-void t_st_generator::generate_typedef(t_typedef* ttypedef) {
-  (void)ttypedef;
-}
-
-void t_st_generator::st_class_def(std::ofstream& out, string name) {
-  out << "Object subclass: #" << prefix(name) << endl;
-  indent_up();
-  out << indent() << "instanceVariableNames: ''" << endl << indent() << "classVariableNames: ''"
-      << endl << indent() << "poolDictionaries: ''" << endl << indent() << "category: '"
-      << generated_category() << "'!" << endl << endl;
-}
-
-void t_st_generator::st_method(std::ofstream& out, string cls, string name) {
-  st_method(out, cls, name, "as yet uncategorized");
-}
-
-void t_st_generator::st_class_method(std::ofstream& out, string cls, string name) {
-  st_method(out, cls + " class", name);
-}
-
-void t_st_generator::st_class_method(std::ofstream& out, string cls, string name, string category) {
-  st_method(out, cls, name, category);
-}
-
-void t_st_generator::st_method(std::ofstream& out, string cls, string name, string category) {
-  char timestr[50];
-  time_t rawtime;
-  struct tm* tinfo;
-
-  time(&rawtime);
-  tinfo = localtime(&rawtime);
-  strftime(timestr, 50, "%m/%d/%Y %H:%M", tinfo);
-
-  out << "!" << prefix(cls) << " methodsFor: '" + category + "' stamp: 'thrift " << timestr
-      << "'!\n" << name << endl;
-
-  indent_up();
-  out << indent();
-}
-
-void t_st_generator::st_close_method(std::ofstream& out) {
-  out << "! !" << endl << endl;
-  indent_down();
-}
-
-void t_st_generator::st_setter(std::ofstream& out,
-                               string cls,
-                               string name,
-                               string type = "anObject") {
-  st_method(out, cls, name + ": " + type);
-  out << name << " := " + type;
-  st_close_method(out);
-}
-
-void t_st_generator::st_getter(std::ofstream& out, string cls, string name) {
-  st_method(out, cls, name + "");
-  out << "^ " << name;
-  st_close_method(out);
-}
-
-void t_st_generator::st_accessors(std::ofstream& out,
-                                  string cls,
-                                  string name,
-                                  string type = "anObject") {
-  st_setter(out, cls, name, type);
-  st_getter(out, cls, name);
-}
-
-void t_st_generator::generate_class_side_definition() {
-  f_ << prefix(class_name()) << " class" << endl << "\tinstanceVariableNames: 'constants enums'!"
-     << endl << endl;
-
-  st_accessors(f_, class_name() + " class", "enums");
-  st_accessors(f_, class_name() + " class", "constants");
-
-  f_ << prefix(class_name()) << " enums: Dictionary new!" << endl;
-  f_ << prefix(class_name()) << " constants: Dictionary new!" << endl;
-
-  f_ << endl;
-}
-
-/**
- * Generates code for an enumerated type. Done using a class to scope
- * the values.
- *
- * @param tenum The enumeration
- */
-void t_st_generator::generate_enum(t_enum* tenum) {
-  string cls_name = program_name_ + capitalize(tenum->get_name());
-
-  f_ << prefix(class_name()) << " enums at: '" << tenum->get_name() << "' put: ["
-     << "(Dictionary new " << endl;
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    int value = (*c_iter)->get_value();
-    f_ << "\tat: '" << (*c_iter)->get_name() << "' put: " << value << ";" << endl;
-  }
-
-  f_ << "\tyourself)]!" << endl << endl;
-}
-
-/**
- * Generate a constant value
- */
-void t_st_generator::generate_const(t_const* tconst) {
-  t_type* type = tconst->get_type();
-  string name = tconst->get_name();
-  t_const_value* value = tconst->get_value();
-
-  f_ << prefix(class_name()) << " constants at: '" << name << "' put: ["
-     << render_const_value(type, value) << "]!" << endl << endl;
-}
-
-/**
- * Prints the value of a constant with the given type. Note that type checking
- * is NOT performed in this function as it is always run beforehand using the
- * validate_types method in main.cc
- */
-string t_st_generator::render_const_value(t_type* type, t_const_value* value) {
-  type = get_true_type(type);
-  std::ostringstream out;
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      out << '"' << get_escaped_string(value) << '"';
-      break;
-    case t_base_type::TYPE_BOOL:
-      out << (value->get_integer() > 0 ? "true" : "false");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      out << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        out << value->get_integer();
-      } else {
-        out << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    indent(out) << value->get_integer();
-  } else if (type->is_struct() || type->is_xception()) {
-    out << "(" << capitalize(type->get_name()) << " new " << endl;
-    indent_up();
-
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-
-      out << indent() << v_iter->first->get_string() << ": "
-          << render_const_value(field_type, v_iter->second) << ";" << endl;
-    }
-    out << indent() << "yourself)";
-
-    indent_down();
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    out << "(Dictionary new" << endl;
-    indent_up();
-    indent_up();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << indent();
-      out << "at: " << render_const_value(ktype, v_iter->first);
-      out << " put: ";
-      out << render_const_value(vtype, v_iter->second);
-      out << ";" << endl;
-    }
-    out << indent() << indent() << "yourself)";
-    indent_down();
-    indent_down();
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-    if (type->is_set()) {
-      out << "(Set new" << endl;
-    } else {
-      out << "(OrderedCollection new" << endl;
-    }
-    indent_up();
-    indent_up();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      out << indent() << indent();
-      out << "add: " << render_const_value(etype, *v_iter);
-      out << ";" << endl;
-    }
-    out << indent() << indent() << "yourself)";
-    indent_down();
-    indent_down();
-  } else {
-    throw "CANNOT GENERATE CONSTANT FOR TYPE: " + type->get_name();
-  }
-  return out.str();
-}
-
-/**
- * Generates a Smalltalk struct
- */
-void t_st_generator::generate_struct(t_struct* tstruct) {
-  generate_st_struct(f_, tstruct, false);
-}
-
-/**
- * Generates a struct definition for a thrift exception. Basically the same
- * as a struct but extends the Exception class.
- *
- * @param txception The struct definition
- */
-void t_st_generator::generate_xception(t_struct* txception) {
-  generate_st_struct(f_, txception, true);
-}
-
-/**
- * Generates a smalltalk class to represent a struct
- */
-void t_st_generator::generate_st_struct(std::ofstream& out,
-                                        t_struct* tstruct,
-                                        bool is_exception = false) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  if (is_exception)
-    out << "Error";
-  else
-    out << "Object";
-
-  out << " subclass: #" << prefix(type_name(tstruct)) << endl << "\tinstanceVariableNames: '";
-
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if (m_iter != members.begin())
-        out << " ";
-      out << camelcase((*m_iter)->get_name());
-    }
-  }
-
-  out << "'\n"
-      << "\tclassVariableNames: ''\n"
-      << "\tpoolDictionaries: ''\n"
-      << "\tcategory: '" << generated_category() << "'!\n\n";
-
-  generate_accessors(out, tstruct);
-}
-
-bool t_st_generator::is_vowel(char c) {
-  switch (tolower(c)) {
-  case 'a':
-  case 'e':
-  case 'i':
-  case 'o':
-  case 'u':
-    return true;
-  }
-  return false;
-}
-
-string t_st_generator::a_type(t_type* type) {
-  string prefix;
-
-  if (is_vowel(type_name(type)[0]))
-    prefix = "an";
-  else
-    prefix = "a";
-
-  return prefix + capitalize(type_name(type));
-}
-
-void t_st_generator::generate_accessors(std::ofstream& out, t_struct* tstruct) {
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-  string type;
-  string prefix;
-
-  if (members.size() > 0) {
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      st_accessors(out,
-                   capitalize(type_name(tstruct)),
-                   camelcase((*m_iter)->get_name()),
-                   a_type((*m_iter)->get_type()));
-    }
-    out << endl;
-  }
-}
-
-/**
- * Generates a thrift service.
- *
- * @param tservice The service definition
- */
-void t_st_generator::generate_service(t_service* tservice) {
-  generate_service_client(tservice);
-  // generate_service_server(tservice);
-}
-
-string t_st_generator::temp_name() {
-  std::ostringstream out;
-  out << "temp" << temporary_var++;
-  return out.str();
-}
-
-string t_st_generator::map_writer(t_map* tmap, string fname) {
-  std::ostringstream out;
-  string key = temp_name();
-  string val = temp_name();
-
-  out << "[oprot writeMapBegin: (TMap new keyType: " << type_to_enum(tmap->get_key_type())
-      << "; valueType: " << type_to_enum(tmap->get_val_type()) << "; size: " << fname << " size)."
-      << endl;
-  indent_up();
-
-  out << indent() << fname << " keysAndValuesDo: [:" << key << " :" << val << " |" << endl;
-  indent_up();
-
-  out << indent() << write_val(tmap->get_key_type(), key) << "." << endl << indent()
-      << write_val(tmap->get_val_type(), val);
-  indent_down();
-
-  out << "]." << endl << indent() << "oprot writeMapEnd] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::map_reader(t_map* tmap) {
-  std::ostringstream out;
-  string desc = temp_name();
-  string val = temp_name();
-
-  out << "[|" << desc << " " << val << "| " << endl;
-  indent_up();
-
-  out << indent() << desc << " := iprot readMapBegin." << endl << indent() << val
-      << " := Dictionary new." << endl << indent() << desc << " size timesRepeat: [" << endl;
-
-  indent_up();
-  out << indent() << val << " at: " << read_val(tmap->get_key_type())
-      << " put: " << read_val(tmap->get_val_type());
-  indent_down();
-
-  out << "]." << endl << indent() << "iprot readMapEnd." << endl << indent() << val << "] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::list_writer(t_list* tlist, string fname) {
-  std::ostringstream out;
-  string val = temp_name();
-
-  out << "[oprot writeListBegin: (TList new elemType: " << type_to_enum(tlist->get_elem_type())
-      << "; size: " << fname << " size)." << endl;
-  indent_up();
-
-  out << indent() << fname << " do: [:" << val << "|" << endl;
-  indent_up();
-
-  out << indent() << write_val(tlist->get_elem_type(), val) << endl;
-  indent_down();
-
-  out << "]." << endl << indent() << "oprot writeListEnd] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::list_reader(t_list* tlist) {
-  std::ostringstream out;
-  string desc = temp_name();
-  string val = temp_name();
-
-  out << "[|" << desc << " " << val << "| " << desc << " := iprot readListBegin." << endl;
-  indent_up();
-
-  out << indent() << val << " := OrderedCollection new." << endl << indent() << desc
-      << " size timesRepeat: [" << endl;
-
-  indent_up();
-  out << indent() << val << " add: " << read_val(tlist->get_elem_type());
-  indent_down();
-
-  out << "]." << endl << indent() << "iprot readListEnd." << endl << indent() << val << "] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::set_writer(t_set* tset, string fname) {
-  std::ostringstream out;
-  string val = temp_name();
-
-  out << "[oprot writeSetBegin: (TSet new elemType: " << type_to_enum(tset->get_elem_type())
-      << "; size: " << fname << " size)." << endl;
-  indent_up();
-
-  out << indent() << fname << " do: [:" << val << "|" << endl;
-  indent_up();
-
-  out << indent() << write_val(tset->get_elem_type(), val) << endl;
-  indent_down();
-
-  out << "]." << endl << indent() << "oprot writeSetEnd] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::set_reader(t_set* tset) {
-  std::ostringstream out;
-  string desc = temp_name();
-  string val = temp_name();
-
-  out << "[|" << desc << " " << val << "| " << desc << " := iprot readSetBegin." << endl;
-  indent_up();
-
-  out << indent() << val << " := Set new." << endl << indent() << desc << " size timesRepeat: ["
-      << endl;
-
-  indent_up();
-  out << indent() << val << " add: " << read_val(tset->get_elem_type());
-  indent_down();
-
-  out << "]." << endl << indent() << "iprot readSetEnd." << endl << indent() << val << "] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::struct_writer(t_struct* tstruct, string sname) {
-  std::ostringstream out;
-  const vector<t_field*>& fields = tstruct->get_sorted_members();
-  vector<t_field*>::const_iterator fld_iter;
-
-  out << "[oprot writeStructBegin: "
-      << "(TStruct new name: '" + tstruct->get_name() + "')." << endl;
-  indent_up();
-
-  for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    bool optional = (*fld_iter)->get_req() == t_field::T_OPTIONAL;
-    string fname = camelcase((*fld_iter)->get_name());
-    string accessor = sname + " " + camelcase(fname);
-
-    if (optional) {
-      out << indent() << accessor << " ifNotNil: [" << endl;
-      indent_up();
-    }
-
-    out << indent() << "oprot writeFieldBegin: (TField new name: '" << fname
-        << "'; type: " << type_to_enum((*fld_iter)->get_type())
-        << "; id: " << (*fld_iter)->get_key() << ")." << endl;
-
-    out << indent() << write_val((*fld_iter)->get_type(), accessor) << "." << endl << indent()
-        << "oprot writeFieldEnd";
-
-    if (optional) {
-      out << "]";
-      indent_down();
-    }
-
-    out << "." << endl;
-  }
-
-  out << indent() << "oprot writeFieldStop; writeStructEnd] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::struct_reader(t_struct* tstruct, string clsName = "") {
-  std::ostringstream out;
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator fld_iter;
-  string val = temp_name();
-  string desc = temp_name();
-  string found = temp_name();
-
-  if (clsName.size() == 0) {
-    clsName = tstruct->get_name();
-  }
-
-  out << "[|" << desc << " " << val << "|" << endl;
-  indent_up();
-
-  // This is nasty, but without it we'll break things by prefixing TResult.
-  string name = ((capitalize(clsName) == "TResult") ? capitalize(clsName) : prefix(clsName));
-  out << indent() << val << " := " << name << " new." << endl;
-
-  out << indent() << "iprot readStructBegin." << endl << indent() << "[" << desc
-      << " := iprot readFieldBegin." << endl << indent() << desc
-      << " type = TType stop] whileFalse: [|" << found << "|" << endl;
-  indent_up();
-
-  for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    out << indent() << desc << " id = " << (*fld_iter)->get_key() << " ifTrue: [" << endl;
-    indent_up();
-
-    out << indent() << found << " := true." << endl << indent() << val << " "
-        << camelcase((*fld_iter)->get_name()) << ": " << read_val((*fld_iter)->get_type());
-    indent_down();
-
-    out << "]." << endl;
-  }
-
-  out << indent() << found << " ifNil: [iprot skip: " << desc << " type]]." << endl;
-  indent_down();
-
-  out << indent() << "oprot readStructEnd." << endl << indent() << val << "] value";
-  indent_down();
-
-  return out.str();
-}
-
-string t_st_generator::write_val(t_type* t, string fname) {
-  t = get_true_type(t);
-
-  if (t->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)t)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_DOUBLE:
-      return "iprot writeDouble: " + fname + " asFloat";
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      return "iprot write" + capitalize(type_name(t)) + ": " + fname + " asInteger";
-    default:
-      return "iprot write" + capitalize(type_name(t)) + ": " + fname;
-    }
-  } else if (t->is_map()) {
-    return map_writer((t_map*)t, fname);
-  } else if (t->is_struct() || t->is_xception()) {
-    return struct_writer((t_struct*)t, fname);
-  } else if (t->is_list()) {
-    return list_writer((t_list*)t, fname);
-  } else if (t->is_set()) {
-    return set_writer((t_set*)t, fname);
-  } else if (t->is_enum()) {
-    return "iprot writeI32: " + fname;
-  } else {
-    throw "Sorry, I don't know how to write this: " + type_name(t);
-  }
-}
-
-string t_st_generator::read_val(t_type* t) {
-  t = get_true_type(t);
-
-  if (t->is_base_type()) {
-    return "iprot read" + capitalize(type_name(t));
-  } else if (t->is_map()) {
-    return map_reader((t_map*)t);
-  } else if (t->is_struct() || t->is_xception()) {
-    return struct_reader((t_struct*)t);
-  } else if (t->is_list()) {
-    return list_reader((t_list*)t);
-  } else if (t->is_set()) {
-    return set_reader((t_set*)t);
-  } else if (t->is_enum()) {
-    return "iprot readI32";
-  } else {
-    throw "Sorry, I don't know how to read this: " + type_name(t);
-  }
-}
-
-void t_st_generator::generate_send_method(t_function* function) {
-  string funname = function->get_name();
-  string signature = function_signature(function);
-  t_struct* arg_struct = function->get_arglist();
-  const vector<t_field*>& fields = arg_struct->get_members();
-  vector<t_field*>::const_iterator fld_iter;
-
-  st_method(f_, client_class_name(), "send" + capitalize(signature));
-  f_ << "oprot writeMessageBegin:" << endl;
-  indent_up();
-
-  f_ << indent() << "(TCallMessage new" << endl;
-  indent_up();
-
-  f_ << indent() << "name: '" << funname << "'; " << endl << indent() << "seqid: self nextSeqid)."
-     << endl;
-  indent_down();
-  indent_down();
-
-  f_ << indent() << "oprot writeStructBegin: "
-     << "(TStruct new name: '" + capitalize(camelcase(funname)) + "_args')." << endl;
-
-  for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-    string fname = camelcase((*fld_iter)->get_name());
-
-    f_ << indent() << "oprot writeFieldBegin: (TField new name: '" << fname
-       << "'; type: " << type_to_enum((*fld_iter)->get_type()) << "; id: " << (*fld_iter)->get_key()
-       << ")." << endl;
-
-    f_ << indent() << write_val((*fld_iter)->get_type(), fname) << "." << endl << indent()
-       << "oprot writeFieldEnd." << endl;
-  }
-
-  f_ << indent() << "oprot writeFieldStop; writeStructEnd; writeMessageEnd." << endl;
-  f_ << indent() << "oprot transport flush";
-
-  st_close_method(f_);
-}
-
-// We only support receiving TResult structures (so this won't work on the server side)
-void t_st_generator::generate_recv_method(t_function* function) {
-  string funname = camelcase(function->get_name());
-  string signature = function_signature(function);
-
-  t_struct result(program_, "TResult");
-  t_field success(function->get_returntype(), "success", 0);
-  result.append(&success);
-
-  t_struct* xs = function->get_xceptions();
-  const vector<t_field*>& fields = xs->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    // duplicate the field, but call it "exception"... we don't need a dynamic name
-    t_field* exception = new t_field((*f_iter)->get_type(), "exception", (*f_iter)->get_key());
-    result.append(exception);
-  }
-
-  st_method(f_, client_class_name(), "recv" + capitalize(funname));
-  f_ << "| f msg res | " << endl << indent() << "msg := oprot readMessageBegin." << endl << indent()
-     << "self validateRemoteMessage: msg." << endl << indent()
-     << "res := " << struct_reader(&result) << "." << endl << indent() << "oprot readMessageEnd."
-     << endl << indent() << "oprot transport flush." << endl << indent()
-     << "res exception ifNotNil: [res exception signal]." << endl << indent() << "^ res";
-  st_close_method(f_);
-}
-
-string t_st_generator::function_types_comment(t_function* fn) {
-  std::ostringstream out;
-  const vector<t_field*>& fields = fn->get_arglist()->get_members();
-  vector<t_field*>::const_iterator f_iter;
-
-  out << "\"";
-
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    out << camelcase((*f_iter)->get_name()) << ": " << type_name((*f_iter)->get_type());
-    if ((f_iter + 1) != fields.end()) {
-      out << ", ";
-    }
-  }
-
-  out << "\"";
-
-  return out.str();
-}
-
-/**
- * Generates a service client definition.
- *
- * @param tservice The service to generate a server for.
- */
-void t_st_generator::generate_service_client(t_service* tservice) {
-  string extends = "";
-  string extends_client = "TClient";
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_client = extends + "Client";
-  }
-
-  f_ << extends_client << " subclass: #" << prefix(client_class_name()) << endl
-     << "\tinstanceVariableNames: ''\n"
-     << "\tclassVariableNames: ''\n"
-     << "\tpoolDictionaries: ''\n"
-     << "\tcategory: '" << generated_category() << "'!\n\n";
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = camelcase((*f_iter)->get_name());
-    string signature = function_signature(*f_iter);
-
-    st_method(f_, client_class_name(), signature);
-    f_ << function_types_comment(*f_iter) << endl << indent() << "self send"
-       << capitalize(signature) << "." << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      f_ << indent() << "^ self recv" << capitalize(funname) << " success " << endl;
-    }
-
-    st_close_method(f_);
-
-    generate_send_method(*f_iter);
-    if (!(*f_iter)->is_oneway()) {
-      generate_recv_method(*f_iter);
-    }
-  }
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_st_generator::function_signature(t_function* tfunction) {
-  return camelcase(tfunction->get_name()) + capitalize(argument_list(tfunction->get_arglist()));
-}
-
-/**
- * Renders a field list
- */
-string t_st_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += " ";
-    }
-    string name = camelcase((*f_iter)->get_name());
-    result += name + ": " + name;
-  }
-  return result;
-}
-
-string t_st_generator::type_name(t_type* ttype) {
-  string prefix = "";
-  t_program* program = ttype->get_program();
-  if (program != NULL && program != program_) {
-    if (!ttype->is_service()) {
-      prefix = program->get_name() + "_types.";
-    }
-  }
-
-  string name = ttype->get_name();
-  if (ttype->is_struct() || ttype->is_xception()) {
-    name = capitalize(ttype->get_name());
-  }
-
-  return prefix + name;
-}
-
-/* Convert t_type to Smalltalk type code */
-string t_st_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "TType string";
-    case t_base_type::TYPE_BOOL:
-      return "TType bool";
-    case t_base_type::TYPE_BYTE:
-      return "TType byte";
-    case t_base_type::TYPE_I16:
-      return "TType i16";
-    case t_base_type::TYPE_I32:
-      return "TType i32";
-    case t_base_type::TYPE_I64:
-      return "TType i64";
-    case t_base_type::TYPE_DOUBLE:
-      return "TType double";
-    }
-  } else if (type->is_enum()) {
-    return "TType i32";
-  } else if (type->is_struct() || type->is_xception()) {
-    return "TType struct";
-  } else if (type->is_map()) {
-    return "TType map";
-  } else if (type->is_set()) {
-    return "TType set";
-  } else if (type->is_list()) {
-    return "TType list";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-THRIFT_REGISTER_GENERATOR(st, "Smalltalk", "")

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_xsd_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_xsd_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_xsd_generator.cc
deleted file mode 100644
index ed76bec..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_xsd_generator.cc
+++ /dev/null
@@ -1,355 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <fstream>
-#include <iostream>
-#include <sstream>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include "t_generator.h"
-#include "platform.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/**
- * XSD generator, creates an XSD for the base types etc.
- *
- */
-class t_xsd_generator : public t_generator {
-public:
-  t_xsd_generator(t_program* program,
-                  const std::map<std::string, std::string>& parsed_options,
-                  const std::string& option_string)
-    : t_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    out_dir_base_ = "gen-xsd";
-  }
-
-  virtual ~t_xsd_generator() {}
-
-  /**
-   * Init and close methods
-   */
-
-  void init_generator();
-  void close_generator();
-
-  /**
-   * Program-level generation functions
-   */
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum) { (void)tenum; }
-
-  void generate_service(t_service* tservice);
-  void generate_struct(t_struct* tstruct);
-
-private:
-  void generate_element(std::ostream& out,
-                        std::string name,
-                        t_type* ttype,
-                        t_struct* attrs = NULL,
-                        bool optional = false,
-                        bool nillable = false,
-                        bool list_element = false);
-
-  std::string ns(std::string in, std::string ns) { return ns + ":" + in; }
-
-  std::string xsd(std::string in) { return ns(in, "xsd"); }
-
-  std::string type_name(t_type* ttype);
-  std::string base_type_name(t_base_type::t_base tbase);
-
-  /**
-   * Output xsd/php file
-   */
-  std::ofstream f_xsd_;
-  std::ofstream f_php_;
-
-  /**
-   * Output string stream
-   */
-  std::ostringstream s_xsd_types_;
-};
-
-void t_xsd_generator::init_generator() {
-  // Make output directory
-  MKDIR(get_out_dir().c_str());
-
-  // Make output file
-  string f_php_name = get_out_dir() + program_->get_name() + "_xsd.php";
-  f_php_.open(f_php_name.c_str());
-
-  f_php_ << "<?php" << endl;
-}
-
-void t_xsd_generator::close_generator() {
-  f_php_ << "?>" << endl;
-  f_php_.close();
-}
-
-void t_xsd_generator::generate_typedef(t_typedef* ttypedef) {
-  indent(s_xsd_types_) << "<xsd:simpleType name=\"" << ttypedef->get_name() << "\">" << endl;
-  indent_up();
-  if (ttypedef->get_type()->is_string() && ((t_base_type*)ttypedef->get_type())->is_string_enum()) {
-    indent(s_xsd_types_) << "<xsd:restriction base=\"" << type_name(ttypedef->get_type()) << "\">"
-                         << endl;
-    indent_up();
-    const vector<string>& values = ((t_base_type*)ttypedef->get_type())->get_string_enum_vals();
-    vector<string>::const_iterator v_iter;
-    for (v_iter = values.begin(); v_iter != values.end(); ++v_iter) {
-      indent(s_xsd_types_) << "<xsd:enumeration value=\"" << (*v_iter) << "\" />" << endl;
-    }
-    indent_down();
-    indent(s_xsd_types_) << "</xsd:restriction>" << endl;
-  } else {
-    indent(s_xsd_types_) << "<xsd:restriction base=\"" << type_name(ttypedef->get_type()) << "\" />"
-                         << endl;
-  }
-  indent_down();
-  indent(s_xsd_types_) << "</xsd:simpleType>" << endl << endl;
-}
-
-void t_xsd_generator::generate_struct(t_struct* tstruct) {
-  vector<t_field*>::const_iterator m_iter;
-  const vector<t_field*>& members = tstruct->get_members();
-  bool xsd_all = tstruct->get_xsd_all();
-
-  indent(s_xsd_types_) << "<xsd:complexType name=\"" << tstruct->get_name() << "\">" << endl;
-  indent_up();
-  if (xsd_all) {
-    indent(s_xsd_types_) << "<xsd:all>" << endl;
-  } else {
-    indent(s_xsd_types_) << "<xsd:sequence>" << endl;
-  }
-  indent_up();
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_element(s_xsd_types_,
-                     (*m_iter)->get_name(),
-                     (*m_iter)->get_type(),
-                     (*m_iter)->get_xsd_attrs(),
-                     (*m_iter)->get_xsd_optional() || xsd_all,
-                     (*m_iter)->get_xsd_nillable());
-  }
-
-  indent_down();
-  if (xsd_all) {
-    indent(s_xsd_types_) << "</xsd:all>" << endl;
-  } else {
-    indent(s_xsd_types_) << "</xsd:sequence>" << endl;
-  }
-  indent_down();
-  indent(s_xsd_types_) << "</xsd:complexType>" << endl << endl;
-}
-
-void t_xsd_generator::generate_element(ostream& out,
-                                       string name,
-                                       t_type* ttype,
-                                       t_struct* attrs,
-                                       bool optional,
-                                       bool nillable,
-                                       bool list_element) {
-  string sminOccurs = (optional || list_element) ? " minOccurs=\"0\"" : "";
-  string smaxOccurs = list_element ? " maxOccurs=\"unbounded\"" : "";
-  string soptional = sminOccurs + smaxOccurs;
-  string snillable = nillable ? " nillable=\"true\"" : "";
-
-  if (ttype->is_void() || ttype->is_list()) {
-    indent(out) << "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">" << endl;
-    indent_up();
-    if (attrs == NULL && ttype->is_void()) {
-      indent(out) << "<xsd:complexType />" << endl;
-    } else {
-      indent(out) << "<xsd:complexType>" << endl;
-      indent_up();
-      if (ttype->is_list()) {
-        indent(out) << "<xsd:sequence minOccurs=\"0\" maxOccurs=\"unbounded\">" << endl;
-        indent_up();
-        string subname;
-        t_type* subtype = ((t_list*)ttype)->get_elem_type();
-        if (subtype->is_base_type() || subtype->is_container()) {
-          subname = name + "_elt";
-        } else {
-          subname = type_name(subtype);
-        }
-        f_php_ << "$GLOBALS['" << program_->get_name() << "_xsd_elt_" << name << "'] = '" << subname
-               << "';" << endl;
-        generate_element(out, subname, subtype, NULL, false, false, true);
-        indent_down();
-        indent(out) << "</xsd:sequence>" << endl;
-        indent(out) << "<xsd:attribute name=\"list\" type=\"xsd:boolean\" />" << endl;
-      }
-      if (attrs != NULL) {
-        const vector<t_field*>& members = attrs->get_members();
-        vector<t_field*>::const_iterator a_iter;
-        for (a_iter = members.begin(); a_iter != members.end(); ++a_iter) {
-          indent(out) << "<xsd:attribute name=\"" << (*a_iter)->get_name() << "\" type=\""
-                      << type_name((*a_iter)->get_type()) << "\" />" << endl;
-        }
-      }
-      indent_down();
-      indent(out) << "</xsd:complexType>" << endl;
-    }
-    indent_down();
-    indent(out) << "</xsd:element>" << endl;
-  } else {
-    if (attrs == NULL) {
-      indent(out) << "<xsd:element name=\"" << name << "\""
-                  << " type=\"" << type_name(ttype) << "\"" << soptional << snillable << " />"
-                  << endl;
-    } else {
-      // Wow, all this work for a SIMPLE TYPE with attributes?!?!?!
-      indent(out) << "<xsd:element name=\"" << name << "\"" << soptional << snillable << ">"
-                  << endl;
-      indent_up();
-      indent(out) << "<xsd:complexType>" << endl;
-      indent_up();
-      indent(out) << "<xsd:complexContent>" << endl;
-      indent_up();
-      indent(out) << "<xsd:extension base=\"" << type_name(ttype) << "\">" << endl;
-      indent_up();
-      const vector<t_field*>& members = attrs->get_members();
-      vector<t_field*>::const_iterator a_iter;
-      for (a_iter = members.begin(); a_iter != members.end(); ++a_iter) {
-        indent(out) << "<xsd:attribute name=\"" << (*a_iter)->get_name() << "\" type=\""
-                    << type_name((*a_iter)->get_type()) << "\" />" << endl;
-      }
-      indent_down();
-      indent(out) << "</xsd:extension>" << endl;
-      indent_down();
-      indent(out) << "</xsd:complexContent>" << endl;
-      indent_down();
-      indent(out) << "</xsd:complexType>" << endl;
-      indent_down();
-      indent(out) << "</xsd:element>" << endl;
-    }
-  }
-}
-
-void t_xsd_generator::generate_service(t_service* tservice) {
-  // Make output file
-  string f_xsd_name = get_out_dir() + tservice->get_name() + ".xsd";
-  f_xsd_.open(f_xsd_name.c_str());
-
-  string ns = program_->get_namespace("xsd");
-  if (ns.size() > 0) {
-    ns = " targetNamespace=\"" + ns + "\" xmlns=\"" + ns + "\" "
-         + "elementFormDefault=\"qualified\"";
-  }
-
-  // Print the XSD header
-  f_xsd_ << "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" << endl
-         << "<xsd:schema xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"" << ns << ">" << endl
-         << endl << "<!-- Yo yo yo, this XSD woz be generated by Thrift. -->" << endl << endl;
-
-  // Print out the type definitions
-  indent(f_xsd_) << s_xsd_types_.str();
-
-  // Keep a list of all the possible exceptions that might get thrown
-  map<string, t_struct*> all_xceptions;
-
-  // List the elements that you might actually get
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string elemname = (*f_iter)->get_name() + "_response";
-    t_type* returntype = (*f_iter)->get_returntype();
-    generate_element(f_xsd_, elemname, returntype);
-    f_xsd_ << endl;
-
-    t_struct* xs = (*f_iter)->get_xceptions();
-    const std::vector<t_field*>& xceptions = xs->get_members();
-    vector<t_field*>::const_iterator x_iter;
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      all_xceptions[(*x_iter)->get_name()] = (t_struct*)((*x_iter)->get_type());
-    }
-  }
-
-  map<string, t_struct*>::iterator ax_iter;
-  for (ax_iter = all_xceptions.begin(); ax_iter != all_xceptions.end(); ++ax_iter) {
-    generate_element(f_xsd_, ax_iter->first, ax_iter->second);
-  }
-
-  // Close the XSD document
-  f_xsd_ << endl << "</xsd:schema>" << endl;
-  f_xsd_.close();
-}
-
-string t_xsd_generator::type_name(t_type* ttype) {
-  if (ttype->is_typedef()) {
-    return ttype->get_name();
-  }
-
-  if (ttype->is_base_type()) {
-    return xsd(base_type_name(((t_base_type*)ttype)->get_base()));
-  }
-
-  if (ttype->is_enum()) {
-    return xsd("int");
-  }
-
-  if (ttype->is_struct() || ttype->is_xception()) {
-    return ttype->get_name();
-  }
-
-  return "container";
-}
-
-/**
- * Returns the XSD type that corresponds to the thrift type.
- *
- * @param tbase The base type
- * @return Explicit XSD type, i.e. xsd:string
- */
-string t_xsd_generator::base_type_name(t_base_type::t_base tbase) {
-  switch (tbase) {
-  case t_base_type::TYPE_VOID:
-    return "void";
-  case t_base_type::TYPE_STRING:
-    return "string";
-  case t_base_type::TYPE_BOOL:
-    return "boolean";
-  case t_base_type::TYPE_BYTE:
-    return "byte";
-  case t_base_type::TYPE_I16:
-    return "short";
-  case t_base_type::TYPE_I32:
-    return "int";
-  case t_base_type::TYPE_I64:
-    return "long";
-  case t_base_type::TYPE_DOUBLE:
-    return "decimal";
-  default:
-    throw "compiler error: no XSD base type name for base type " + t_base_type::t_base_name(tbase);
-  }
-}
-
-THRIFT_REGISTER_GENERATOR(xsd, "XSD", "")



[39/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_delphi_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_delphi_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_delphi_generator.cc
deleted file mode 100644
index cdf49c6..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_delphi_generator.cc
+++ /dev/null
@@ -1,3900 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <cassert>
-
-#include <string>
-#include <fstream>
-#include <iostream>
-#include <vector>
-#include <list>
-
-#include <stdlib.h>
-#include <sys/stat.h>
-#include <sstream>
-#include <cctype>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-class t_delphi_generator : public t_oop_generator {
-public:
-  t_delphi_generator(t_program* program,
-                     const std::map<std::string, std::string>& parsed_options,
-                     const std::string& option_string)
-    : t_oop_generator(program) {
-    (void)option_string;
-    indent_impl_ = 0;
-    has_forward = false;
-    has_enum = false;
-    has_const = false;
-    std::map<std::string, std::string>::const_iterator iter;
-
-    iter = parsed_options.find("ansistr_binary");
-    ansistr_binary_ = (iter != parsed_options.end());
-    iter = parsed_options.find("register_types");
-    register_types_ = (iter != parsed_options.end());
-    iter = parsed_options.find("constprefix");
-    constprefix_ = (iter != parsed_options.end());
-    iter = parsed_options.find("events");
-    events_ = (iter != parsed_options.end());
-    iter = parsed_options.find("xmldoc");
-    xmldoc_ = (iter != parsed_options.end());
-
-    out_dir_base_ = "gen-delphi";
-    escape_.clear();
-    escape_['\''] = "''";
-  }
-
-  void init_generator();
-  void close_generator();
-
-  void generate_consts(std::vector<t_const*> consts);
-
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_forward_declaration(t_struct* tstruct);
-  void generate_struct(t_struct* tstruct);
-  void generate_xception(t_struct* txception);
-  void generate_service(t_service* tservice);
-  void generate_property(ostream& out, t_field* tfield, bool isPublic, bool is_xception);
-  void generate_property_writer_(ostream& out, t_field* tfield, bool isPublic);
-
-  void generate_delphi_property(ostream& out,
-                                bool struct_is_exception,
-                                t_field* tfield,
-                                bool isPublic,
-                                std::string fieldPrefix = "");
-  void generate_delphi_isset_reader_definition(ostream& out, t_field* tfield, bool is_xception);
-  void generate_delphi_property_reader_definition(ostream& out,
-                                                  t_field* tfield,
-                                                  bool is_xception_class);
-  void generate_delphi_property_writer_definition(ostream& out,
-                                                  t_field* tfield,
-                                                  bool is_xception_class);
-  void generate_delphi_property_reader_impl(ostream& out,
-                                            std::string cls_prefix,
-                                            std::string name,
-                                            t_type* type,
-                                            t_field* tfield,
-                                            std::string fieldPrefix,
-                                            bool is_xception_class);
-  void generate_delphi_property_writer_impl(ostream& out,
-                                            std::string cls_prefix,
-                                            std::string name,
-                                            t_type* type,
-                                            t_field* tfield,
-                                            std::string fieldPrefix,
-                                            bool is_xception_class,
-                                            bool is_union,
-                                            bool is_xception_factory,
-                                            std::string xception_factroy_name);
-  void generate_delphi_clear_union_value(ostream& out,
-                                         std::string cls_prefix,
-                                         std::string name,
-                                         t_type* type,
-                                         t_field* tfield,
-                                         std::string fieldPrefix,
-                                         bool is_xception_class,
-                                         bool is_union,
-                                         bool is_xception_factory,
-                                         std::string xception_factroy_name);
-  void generate_delphi_isset_reader_impl(ostream& out,
-                                         std::string cls_prefix,
-                                         std::string name,
-                                         t_type* type,
-                                         t_field* tfield,
-                                         std::string fieldPrefix,
-                                         bool is_xception);
-  void generate_delphi_struct_writer_impl(ostream& out,
-                                          std::string cls_prefix,
-                                          t_struct* tstruct,
-                                          bool is_exception);
-  void generate_delphi_struct_result_writer_impl(ostream& out,
-                                                 std::string cls_prefix,
-                                                 t_struct* tstruct,
-                                                 bool is_exception);
-
-  void generate_delphi_struct_tostring_impl(ostream& out,
-                                            std::string cls_prefix,
-                                            t_struct* tstruct,
-                                            bool is_exception,
-                                            bool is_x_factory);
-
-  void add_delphi_uses_list(string unitname);
-
-  void generate_delphi_struct_reader_impl(ostream& out,
-                                          std::string cls_prefix,
-                                          t_struct* tstruct,
-                                          bool is_exception);
-  void generate_delphi_create_exception_impl(ostream& out,
-                                             string cls_prefix,
-                                             t_struct* tstruct,
-                                             bool is_exception);
-
-  bool const_needs_var(t_type* type);
-  void print_const_prop(std::ostream& out, string name, t_type* type, t_const_value* value);
-  void print_private_field(std::ostream& out, string name, t_type* type, t_const_value* value);
-  void print_const_value(std::ostream& vars,
-                         std::ostream& out,
-                         std::string name,
-                         t_type* type,
-                         t_const_value* value);
-  void initialize_field(std::ostream& vars,
-                        std::ostream& out,
-                        std::string name,
-                        t_type* type,
-                        t_const_value* value);
-  void finalize_field(std::ostream& out,
-                      std::string name,
-                      t_type* type,
-                      t_const_value* value,
-                      std::string cls_nm = "");
-  std::string render_const_value(std::ostream& local_vars,
-                                 std::ostream& out,
-                                 std::string name,
-                                 t_type* type,
-                                 t_const_value* value);
-  void print_const_def_value(std::ostream& vars,
-                             std::ostream& out,
-                             std::string name,
-                             t_type* type,
-                             t_const_value* value,
-                             std::string cls_nm = "");
-  std::string make_constants_classname();
-
-  void generate_delphi_struct(t_struct* tstruct, bool is_exception);
-  void generate_delphi_struct_impl(ostream& out,
-                                   std::string cls_prefix,
-                                   t_struct* tstruct,
-                                   bool is_exception,
-                                   bool is_result = false,
-                                   bool is_x_factory = false);
-  void print_delphi_struct_type_factory_func(ostream& out, t_struct* tstruct);
-  void generate_delphi_struct_type_factory(ostream& out,
-                                           std::string cls_prefix,
-                                           t_struct* tstruct,
-                                           bool is_exception,
-                                           bool is_result = false,
-                                           bool is_x_factory = false);
-  void generate_delphi_struct_type_factory_registration(ostream& out,
-                                                        std::string cls_prefix,
-                                                        t_struct* tstruct,
-                                                        bool is_exception,
-                                                        bool is_result = false,
-                                                        bool is_x_factory = false);
-  void generate_delphi_struct_definition(std::ostream& out,
-                                         t_struct* tstruct,
-                                         bool is_xception = false,
-                                         bool in_class = false,
-                                         bool is_result = false,
-                                         bool is_x_factory = false);
-  void generate_delphi_struct_reader(std::ostream& out, t_struct* tstruct);
-  void generate_delphi_struct_result_writer(std::ostream& out, t_struct* tstruct);
-  void generate_delphi_struct_writer(std::ostream& out, t_struct* tstruct);
-  void generate_delphi_struct_tostring(std::ostream& out, t_struct* tstruct);
-
-  void generate_function_helpers(t_function* tfunction);
-  void generate_service_interface(t_service* tservice);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_process_function(t_service* tservice, t_function* function);
-
-  void generate_deserialize_field(std::ostream& out,
-                                  bool is_xception,
-                                  t_field* tfield,
-                                  std::string prefix,
-                                  std::ostream& local_vars);
-  void generate_deserialize_struct(std::ostream& out,
-                                   t_struct* tstruct,
-                                   std::string name,
-                                   std::string prefix);
-  void generate_deserialize_container(ostream& out,
-                                      bool is_xception,
-                                      t_type* ttype,
-                                      string name,
-                                      std::ostream& local_vars);
-
-  void generate_deserialize_set_element(std::ostream& out,
-                                        bool is_xception,
-                                        t_set* tset,
-                                        std::string prefix,
-                                        std::ostream& local_vars);
-  void generate_deserialize_map_element(std::ostream& out,
-                                        bool is_xception,
-                                        t_map* tmap,
-                                        std::string prefix,
-                                        std::ostream& local_vars);
-  void generate_deserialize_list_element(std::ostream& out,
-                                         bool is_xception,
-                                         t_list* list,
-                                         std::string prefix,
-                                         std::ostream& local_vars);
-
-  void generate_serialize_field(std::ostream& out,
-                                bool is_xception,
-                                t_field* tfield,
-                                std::string prefix,
-                                std::ostream& local_vars);
-  void generate_serialize_struct(std::ostream& out,
-                                 t_struct* tstruct,
-                                 std::string prefix,
-                                 std::ostream& local_vars);
-  void generate_serialize_container(std::ostream& out,
-                                    bool is_xception,
-                                    t_type* ttype,
-                                    std::string prefix,
-                                    std::ostream& local_vars);
-  void generate_serialize_map_element(std::ostream& out,
-                                      bool is_xception,
-                                      t_map* tmap,
-                                      std::string iter,
-                                      std::string map,
-                                      std::ostream& local_vars);
-  void generate_serialize_set_element(std::ostream& out,
-                                      bool is_xception,
-                                      t_set* tmap,
-                                      std::string iter,
-                                      std::ostream& local_vars);
-  void generate_serialize_list_element(std::ostream& out,
-                                       bool is_xception,
-                                       t_list* tlist,
-                                       std::string iter,
-                                       std::ostream& local_vars);
-
-  void delphi_type_usings(std::ostream& out);
-  std::string delphi_thrift_usings();
-
-  std::string type_name(t_type* ttype,
-                        bool b_cls = false,
-                        bool b_no_postfix = false,
-                        bool b_exception_factory = false,
-                        bool b_full_exception_factory = false);
-  std::string normalize_clsnm(std::string name,
-                              std::string prefix,
-                              bool b_no_check_keyword = false);
-  std::string make_valid_delphi_identifier(std::string const& fromName);
-  std::string input_arg_prefix(t_type* ttype);
-
-  std::string base_type_name(t_base_type* tbase);
-  std::string declare_field(t_field* tfield,
-                            bool init = false,
-                            std::string prefix = "",
-                            bool is_xception_class = false);
-  std::string function_signature(t_function* tfunction,
-                                 std::string full_cls = "",
-                                 bool is_xception = false);
-  std::string argument_list(t_struct* tstruct);
-  std::string constructor_argument_list(t_struct* tstruct, std::string current_indent);
-  std::string type_to_enum(t_type* ttype);
-  std::string prop_name(t_field* tfield, bool is_xception = false);
-  std::string prop_name(std::string name, bool is_xception = false);
-  std::string constructor_param_name(string name);
-
-  void write_enum(std::string line);
-  void write_forward_decr(std::string line);
-  void write_const(std::string line);
-  void write_struct(std::string line);
-  void write_service(std::string line);
-
-  virtual std::string autogen_comment() {
-    return std::string("(**\n") + " * Autogenerated by Thrift Compiler (" + THRIFT_VERSION + ")\n"
-           + " *\n" + " * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING\n"
-           + " *)\n";
-  }
-
-  string replace_all(string contents, string search, string replace);
-  string xml_encode(string contents);
-  string xmldoc_encode(string contents);
-  string xmlattrib_encode(string contents);
-  void generate_delphi_doc(std::ostream& out, t_field* field);
-  void generate_delphi_doc(std::ostream& out, t_doc* tdoc);
-  void generate_delphi_doc(std::ostream& out, t_function* tdoc);
-  void generate_delphi_docstring_comment(std::ostream& out, string contents);
-
-  bool type_can_be_null(t_type* ttype) {
-    while (ttype->is_typedef()) {
-      ttype = ((t_typedef*)ttype)->get_type();
-    }
-
-    return ttype->is_container() || ttype->is_struct() || ttype->is_xception();
-  }
-
-private:
-  std::string namespace_name_;
-  std::ostringstream s_forward_decr;
-  std::ostringstream s_enum;
-  std::ostringstream s_const;
-  std::ostringstream s_struct;
-  std::ostringstream s_service;
-  std::ostringstream s_const_impl;
-  std::ostringstream s_struct_impl;
-  std::ostringstream s_service_impl;
-  std::ostringstream s_type_factory_registration;
-  std::ostringstream s_type_factory_funcs;
-  bool has_forward;
-  bool has_enum;
-  bool has_const;
-  std::string namespace_dir_;
-  std::map<std::string, int> delphi_keywords;
-  std::map<std::string, int> delphi_reserved_method;
-  std::map<std::string, int> delphi_reserved_method_exception;
-  std::map<std::string, int> types_known;
-  std::list<t_typedef*> typedefs_pending;
-  std::vector<std::string> uses_list;
-  void create_keywords();
-  bool find_keyword(std::map<std::string, int>& keyword_map, std::string name);
-  std::string normalize_name(std::string name,
-                             bool b_method = false,
-                             bool b_exception_method = false);
-  std::string empty_value(t_type* type);
-  bool is_fully_defined_type(t_type* ttype);
-  void add_defined_type(t_type* ttype);
-  void init_known_types_list();
-  bool is_void(t_type* type);
-  int indent_impl_;
-  bool ansistr_binary_;
-  bool register_types_;
-  bool constprefix_;
-  bool events_;
-  bool xmldoc_;
-  void indent_up_impl() { ++indent_impl_; };
-  void indent_down_impl() { --indent_impl_; };
-  std::string indent_impl() {
-    std::string ind = "";
-    int i;
-    for (i = 0; i < indent_impl_; ++i) {
-      ind += "  ";
-    }
-    return ind;
-  };
-  std::ostream& indent_impl(std::ostream& os) { return os << indent_impl(); };
-};
-
-string t_delphi_generator::replace_all(string contents, string search, string repl) {
-  string str(contents);
-
-  size_t slen = search.length();
-  size_t rlen = repl.length();
-  size_t incr = (rlen > 0) ? rlen : 1;
-
-  if (slen > 0) {
-    size_t found = str.find(search);
-    while ((found != string::npos) && (found < str.length())) {
-      str.replace(found, slen, repl);
-      found = str.find(search, found + incr);
-    }
-  }
-
-  return str;
-}
-
-// XML encoding
-string t_delphi_generator::xml_encode(string contents) {
-  string str(contents);
-
-  // escape the escape
-  str = replace_all(str, "&", "&amp;");
-
-  // other standard XML entities
-  str = replace_all(str, "<", "&lt;");
-  str = replace_all(str, ">", "&gt;");
-
-  return str;
-}
-
-// XML attribute encoding
-string t_delphi_generator::xmlattrib_encode(string contents) {
-  string str(xml_encode(contents));
-
-  // our attribs are enclosed in "
-  str = replace_all(str, "\"", "\\\"");
-
-  return str;
-}
-
-// XML encoding for doc comments
-string t_delphi_generator::xmldoc_encode(string contents) {
-  string str(xml_encode(contents));
-
-  // XMLDoc specific: convert linebreaks into <para>graphs</para>
-  str = replace_all(str, "\r\n", "\r");
-  str = replace_all(str, "\n", "\r");
-  str = replace_all(str, "\r", "</para>\n<para>");
-
-  return str;
-}
-
-void t_delphi_generator::generate_delphi_docstring_comment(ostream& out, string contents) {
-  if (xmldoc_) {
-    generate_docstring_comment(out,
-                               "{$REGION 'XMLDoc'}/// <summary>\n",
-                               "/// ",
-                               "<para>" + contents + "</para>",
-                               "/// </summary>\n{$ENDREGION}\n");
-  }
-}
-
-void t_delphi_generator::generate_delphi_doc(ostream& out, t_field* field) {
-  if (xmldoc_) {
-    if (field->get_type()->is_enum()) {
-      string combined_message = xmldoc_encode(field->get_doc()) + "\n<seealso cref=\""
-                                + xmldoc_encode(type_name(field->get_type())) + "\"/>";
-      generate_delphi_docstring_comment(out, combined_message);
-    } else {
-      generate_delphi_doc(out, (t_doc*)field);
-    }
-  }
-}
-
-void t_delphi_generator::generate_delphi_doc(ostream& out, t_doc* tdoc) {
-  if (tdoc->has_doc() && xmldoc_) {
-    generate_delphi_docstring_comment(out, xmldoc_encode(tdoc->get_doc()));
-  }
-}
-
-void t_delphi_generator::generate_delphi_doc(ostream& out, t_function* tfunction) {
-  if (tfunction->has_doc() && xmldoc_) {
-    stringstream ps;
-    const vector<t_field*>& fields = tfunction->get_arglist()->get_members();
-    vector<t_field*>::const_iterator p_iter;
-    for (p_iter = fields.begin(); p_iter != fields.end(); ++p_iter) {
-      t_field* p = *p_iter;
-      ps << "\n<param name=\"" << xmlattrib_encode(p->get_name()) << "\">";
-      if (p->has_doc()) {
-        std::string str = p->get_doc();
-        str.erase(std::remove(str.begin(), str.end(), '\n'),
-                  str.end()); // remove the newlines that appear from the parser
-        ps << xmldoc_encode(str);
-      }
-      ps << "</param>";
-    }
-    generate_docstring_comment(out,
-                               "{$REGION 'XMLDoc'}",
-                               "/// ",
-                               "<summary><para>" + xmldoc_encode(tfunction->get_doc())
-                               + "</para></summary>" + ps.str(),
-                               "{$ENDREGION}\n");
-  }
-}
-
-bool t_delphi_generator::find_keyword(std::map<std::string, int>& keyword_map, std::string name) {
-  std::string::size_type len = name.length();
-
-  if (len <= 0) {
-    return false;
-  }
-
-  std::string::size_type nlast = name.find_last_of('_');
-
-  if (nlast >= 1) {
-    if (nlast == (len - 1)) {
-      string new_name(name, 0, nlast);
-      return find_keyword(keyword_map, new_name);
-    }
-  }
-  return (keyword_map[name] == 1);
-}
-
-std::string t_delphi_generator::normalize_name(std::string name,
-                                               bool b_method,
-                                               bool b_exception_method) {
-  string tmp(name);
-  std::transform(tmp.begin(), tmp.end(), tmp.begin(), static_cast<int (*)(int)>(std::tolower));
-
-  bool b_found = false;
-
-  if (find_keyword(delphi_keywords, tmp)) {
-    b_found = true;
-  } else if (b_method && find_keyword(delphi_reserved_method, tmp)) {
-    b_found = true;
-  } else if (b_exception_method && find_keyword(delphi_reserved_method_exception, tmp)) {
-    b_found = true;
-  }
-
-  if (b_found) {
-    return name + "_";
-  } else {
-    return name;
-  }
-}
-
-void t_delphi_generator::create_keywords() {
-  delphi_keywords["and"] = 1;
-  delphi_keywords["end"] = 1;
-  delphi_keywords["interface"] = 1;
-  delphi_keywords["raise"] = 1;
-  delphi_keywords["uses"] = 1;
-  delphi_keywords["array"] = 1;
-  delphi_keywords["except"] = 1;
-  delphi_keywords["is"] = 1;
-  delphi_keywords["record"] = 1;
-  delphi_keywords["var"] = 1;
-  delphi_keywords["as"] = 1;
-  delphi_keywords["exports"] = 1;
-  delphi_keywords["label"] = 1;
-  delphi_keywords["repeat"] = 1;
-  delphi_keywords["while"] = 1;
-  delphi_keywords["asm"] = 1;
-  delphi_keywords["file"] = 1;
-  delphi_keywords["library"] = 1;
-  delphi_keywords["resourcestring"] = 1;
-  delphi_keywords["with"] = 1;
-  delphi_keywords["begin"] = 1;
-  delphi_keywords["finalization"] = 1;
-  delphi_keywords["mod"] = 1;
-  delphi_keywords["set"] = 1;
-  delphi_keywords["xor"] = 1;
-  delphi_keywords["case"] = 1;
-  delphi_keywords["finally"] = 1;
-  delphi_keywords["nil"] = 1;
-  delphi_keywords["shl"] = 1;
-  delphi_keywords["class"] = 1;
-  delphi_keywords["for"] = 1;
-  delphi_keywords["not"] = 1;
-  delphi_keywords["shr"] = 1;
-  delphi_keywords["const"] = 1;
-  delphi_keywords["function"] = 1;
-  delphi_keywords["object"] = 1;
-  delphi_keywords["string"] = 1;
-  delphi_keywords["constructor"] = 1;
-  delphi_keywords["goto"] = 1;
-  delphi_keywords["of"] = 1;
-  delphi_keywords["then"] = 1;
-  delphi_keywords["destructor"] = 1;
-  delphi_keywords["if"] = 1;
-  delphi_keywords["or"] = 1;
-  delphi_keywords["threadvar"] = 1;
-  delphi_keywords["dispinterface"] = 1;
-  delphi_keywords["implementation"] = 1;
-  delphi_keywords["out"] = 1;
-  delphi_keywords["to"] = 1;
-  delphi_keywords["div"] = 1;
-  delphi_keywords["in"] = 1;
-  delphi_keywords["packed"] = 1;
-  delphi_keywords["try"] = 1;
-  delphi_keywords["do"] = 1;
-  delphi_keywords["inherited"] = 1;
-  delphi_keywords["procedure"] = 1;
-  delphi_keywords["type"] = 1;
-  delphi_keywords["downto"] = 1;
-  delphi_keywords["initialization"] = 1;
-  delphi_keywords["program"] = 1;
-  delphi_keywords["unit"] = 1;
-  delphi_keywords["else"] = 1;
-  delphi_keywords["inline"] = 1;
-  delphi_keywords["property"] = 1;
-  delphi_keywords["until"] = 1;
-  delphi_keywords["private"] = 1;
-  delphi_keywords["protected"] = 1;
-  delphi_keywords["public"] = 1;
-  delphi_keywords["published"] = 1;
-  delphi_keywords["automated"] = 1;
-  delphi_keywords["at"] = 1;
-  delphi_keywords["on"] = 1;
-
-  // reserved/predefined variables and types (lowercase!)
-  delphi_keywords["result"] = 1;
-  delphi_keywords["tbytes"] = 1;
-  delphi_keywords["tobject"] = 1;
-  delphi_keywords["tclass"] = 1;
-  delphi_keywords["tinterfacedobject"] = 1;
-
-  delphi_reserved_method["create"] = 1;
-  delphi_reserved_method["free"] = 1;
-  delphi_reserved_method["initinstance"] = 1;
-  delphi_reserved_method["cleanupinstance"] = 1;
-  delphi_reserved_method["classtype"] = 1;
-  delphi_reserved_method["classname"] = 1;
-  delphi_reserved_method["classnameis"] = 1;
-  delphi_reserved_method["classparent"] = 1;
-  delphi_reserved_method["classinfo"] = 1;
-  delphi_reserved_method["instancesize"] = 1;
-  delphi_reserved_method["inheritsfrom"] = 1;
-  delphi_reserved_method["methodaddress"] = 1;
-  delphi_reserved_method["methodaddress"] = 1;
-  delphi_reserved_method["methodname"] = 1;
-  delphi_reserved_method["fieldaddress"] = 1;
-  delphi_reserved_method["fieldaddress"] = 1;
-  delphi_reserved_method["getinterface"] = 1;
-  delphi_reserved_method["getinterfaceentry"] = 1;
-  delphi_reserved_method["getinterfacetable"] = 1;
-  delphi_reserved_method["unitname"] = 1;
-  delphi_reserved_method["equals"] = 1;
-  delphi_reserved_method["gethashcode"] = 1;
-  delphi_reserved_method["tostring"] = 1;
-  delphi_reserved_method["safecallexception"] = 1;
-  delphi_reserved_method["afterconstruction"] = 1;
-  delphi_reserved_method["beforedestruction"] = 1;
-  delphi_reserved_method["dispatch"] = 1;
-  delphi_reserved_method["defaulthandler"] = 1;
-  delphi_reserved_method["newinstance"] = 1;
-  delphi_reserved_method["freeinstance"] = 1;
-  delphi_reserved_method["destroy"] = 1;
-  delphi_reserved_method["read"] = 1;
-  delphi_reserved_method["write"] = 1;
-
-  delphi_reserved_method_exception["setinnerexception"] = 1;
-  delphi_reserved_method_exception["setstackinfo"] = 1;
-  delphi_reserved_method_exception["getstacktrace"] = 1;
-  delphi_reserved_method_exception["raisingexception"] = 1;
-  delphi_reserved_method_exception["createfmt"] = 1;
-  delphi_reserved_method_exception["createres"] = 1;
-  delphi_reserved_method_exception["createresfmt"] = 1;
-  delphi_reserved_method_exception["createhelp"] = 1;
-  delphi_reserved_method_exception["createfmthelp"] = 1;
-  delphi_reserved_method_exception["createreshelp"] = 1;
-  delphi_reserved_method_exception["createresfmthelp"] = 1;
-  delphi_reserved_method_exception["getbaseexception"] = 1;
-  delphi_reserved_method_exception["baseexception"] = 1;
-  delphi_reserved_method_exception["helpcontext"] = 1;
-  delphi_reserved_method_exception["innerexception"] = 1;
-  delphi_reserved_method_exception["message"] = 1;
-  delphi_reserved_method_exception["stacktrace"] = 1;
-  delphi_reserved_method_exception["stackinfo"] = 1;
-  delphi_reserved_method_exception["getexceptionstackinfoproc"] = 1;
-  delphi_reserved_method_exception["getstackinfostringproc"] = 1;
-  delphi_reserved_method_exception["cleanupstackinfoproc"] = 1;
-  delphi_reserved_method_exception["raiseouterexception"] = 1;
-  delphi_reserved_method_exception["throwouterexception"] = 1;
-}
-
-void t_delphi_generator::add_delphi_uses_list(string unitname) {
-  vector<std::string>::const_iterator s_iter;
-  bool found = false;
-  for (s_iter = uses_list.begin(); s_iter != uses_list.end(); ++s_iter) {
-    if ((*s_iter) == unitname) {
-      found = true;
-      break;
-    }
-  }
-  if (!found) {
-    uses_list.push_back(unitname);
-  }
-}
-
-void t_delphi_generator::init_generator() {
-  indent_impl_ = 0;
-  namespace_name_ = program_->get_namespace("delphi");
-  has_forward = false;
-  has_enum = false;
-  has_const = false;
-  create_keywords();
-  add_delphi_uses_list("Classes");
-  add_delphi_uses_list("SysUtils");
-  add_delphi_uses_list("Generics.Collections");
-  add_delphi_uses_list("Thrift");
-  add_delphi_uses_list("Thrift.Utils");
-  add_delphi_uses_list("Thrift.Collections");
-  add_delphi_uses_list("Thrift.Protocol");
-  add_delphi_uses_list("Thrift.Transport");
-
-  if (register_types_) {
-    add_delphi_uses_list("Thrift.TypeRegistry");
-  }
-
-  init_known_types_list();
-
-  string unitname, nsname;
-  const vector<t_program*>& includes = program_->get_includes();
-  for (size_t i = 0; i < includes.size(); ++i) {
-    unitname = includes[i]->get_name();
-    nsname = includes[i]->get_namespace("delphi");
-    if ("" != nsname) {
-      unitname = nsname;
-    }
-    add_delphi_uses_list(unitname);
-  }
-
-  MKDIR(get_out_dir().c_str());
-}
-
-void t_delphi_generator::close_generator() {
-  std::string unitname = program_name_;
-  if ("" != namespace_name_) {
-    unitname = namespace_name_;
-  }
-
-  for (int i = 0; i < (int)unitname.size(); i++) {
-    if (unitname[i] == ' ') {
-      unitname.replace(i, 1, "_");
-    }
-  }
-
-  std::string f_name = get_out_dir() + "/" + unitname + ".pas";
-  std::ofstream f_all;
-
-  f_all.open(f_name.c_str());
-
-  f_all << autogen_comment() << endl;
-  generate_delphi_doc(f_all, program_);
-  f_all << "unit " << unitname << ";" << endl << endl;
-  f_all << "interface" << endl << endl;
-  f_all << "uses" << endl;
-
-  indent_up();
-
-  vector<std::string>::const_iterator s_iter;
-  for (s_iter = uses_list.begin(); s_iter != uses_list.end(); ++s_iter) {
-    if (s_iter != uses_list.begin()) {
-      f_all << ",";
-      f_all << endl;
-    }
-    indent(f_all) << *s_iter;
-  }
-
-  f_all << ";" << endl << endl;
-
-  indent_down();
-
-  string tmp_unit(unitname);
-  for (int i = 0; i < (int)tmp_unit.size(); i++) {
-    if (tmp_unit[i] == '.') {
-      tmp_unit.replace(i, 1, "_");
-    }
-  }
-
-  f_all << "const" << endl;
-  indent_up();
-  indent(f_all) << "c" << tmp_unit
-                << "_Option_AnsiStr_Binary = " << (ansistr_binary_ ? "True" : "False") << ";"
-                << endl;
-  indent(f_all) << "c" << tmp_unit
-                << "_Option_Register_Types = " << (register_types_ ? "True" : "False") << ";"
-                << endl;
-  indent(f_all) << "c" << tmp_unit
-                << "_Option_ConstPrefix    = " << (constprefix_ ? "True" : "False") << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_Events         = " << (events_ ? "True" : "False")
-                << ";" << endl;
-  indent(f_all) << "c" << tmp_unit << "_Option_XmlDoc         = " << (xmldoc_ ? "True" : "False")
-                << ";" << endl;
-  indent_down();
-
-  f_all << endl;
-  f_all << "type" << endl;
-  if (has_forward) {
-    f_all << s_forward_decr.str() << endl;
-  }
-  if (has_enum) {
-    indent(f_all) << endl;
-    indent(f_all) << "{$SCOPEDENUMS ON}" << endl << endl;
-    f_all << s_enum.str();
-    indent(f_all) << "{$SCOPEDENUMS OFF}" << endl << endl;
-  }
-  f_all << s_struct.str();
-  f_all << s_service.str();
-  f_all << s_const.str();
-  f_all << "implementation" << endl << endl;
-  f_all << s_struct_impl.str();
-  f_all << s_service_impl.str();
-  f_all << s_const_impl.str();
-
-  if (register_types_) {
-    f_all << endl;
-    f_all << "// Type factory methods and registration" << endl;
-    f_all << s_type_factory_funcs.str();
-    f_all << "procedure RegisterTypeFactories;" << endl;
-    f_all << "begin" << endl;
-    f_all << s_type_factory_registration.str();
-    f_all << "end;" << endl;
-  }
-  f_all << endl;
-
-  string constants_class = make_constants_classname();
-
-  f_all << "initialization" << endl;
-  if (has_const) {
-    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
-    f_all << "  " << constants_class.c_str() << "_Initialize;" << endl;
-    f_all << "{$IFEND}" << endl;
-  }
-  if (register_types_) {
-    f_all << "  RegisterTypeFactories;" << endl;
-  }
-  f_all << endl;
-
-  f_all << "finalization" << endl;
-  if (has_const) {
-    f_all << "{$IF CompilerVersion < 21.0}  // D2010" << endl;
-    f_all << "  " << constants_class.c_str() << "_Finalize;" << endl;
-    f_all << "{$IFEND}" << endl;
-  }
-  f_all << endl << endl;
-
-  f_all << "end." << endl;
-  f_all.close();
-
-  if (!typedefs_pending.empty()) {
-    pwarning(0, "%d typedefs with unresolved type references left:\n", typedefs_pending.size());
-    for (std::list<t_typedef*>::iterator iter = typedefs_pending.begin();
-         typedefs_pending.end() != iter;
-         ++iter) {
-      pwarning(0, "- %s\n", (*iter)->get_symbolic().c_str());
-    }
-  }
-}
-
-void t_delphi_generator::delphi_type_usings(ostream& out) {
-  indent_up();
-  indent(out) << "Classes, SysUtils, Generics.Collections, Thrift.Collections, Thrift.Protocol,"
-              << endl;
-  indent(out) << "Thrift.Transport;" << endl << endl;
-  indent_down();
-}
-
-void t_delphi_generator::generate_forward_declaration(t_struct* tstruct) {
-  // Forward declare struct def
-  has_forward = true;
-  pverbose("forward declaration of %s\n", type_name(tstruct).c_str());
-
-  string what = tstruct->is_xception() ? "class" : "interface";
-
-  indent_up();
-  indent(s_forward_decr) << type_name(tstruct, tstruct->is_xception(), true) << " = " << what << ";"
-                         << endl;
-  indent_down();
-
-  add_defined_type(tstruct);
-}
-
-void t_delphi_generator::generate_typedef(t_typedef* ttypedef) {
-  t_type* type = ttypedef->get_type();
-
-  // write now or save for later?
-  if (!is_fully_defined_type(type)) {
-    pverbose("typedef %s: unresolved dependencies found\n", type_name(ttypedef).c_str());
-    typedefs_pending.push_back(ttypedef);
-    return;
-  }
-
-  indent_up();
-  generate_delphi_doc(s_struct, ttypedef);
-  indent(s_struct) << type_name(ttypedef) << " = ";
-
-  // commented out: the benefit is not big enough to risk breaking existing code
-  // bool container = type->is_list() || type->is_map() || type->is_set();
-  // if( ! container)
-  //  s_struct << "type ";  //the "type A = type B" syntax leads to E2574 with generics
-
-  s_struct << type_name(ttypedef->get_type()) << ";" << endl << endl;
-  indent_down();
-
-  add_defined_type(ttypedef);
-}
-
-bool t_delphi_generator::is_fully_defined_type(t_type* ttype) {
-  if ((NULL != ttype->get_program()) && (ttype->get_program() != program_)) {
-    t_scope* scope = ttype->get_program()->scope();
-    if (NULL != scope->get_type(ttype->get_name())) {
-      // printf("type %s found in included scope %s\n", ttype->get_name().c_str(),
-      // ttype->get_program()->get_name().c_str());
-      return true;
-    }
-  }
-
-  if (ttype->is_typedef()) {
-    return (1 == types_known[type_name(ttype)]);
-  }
-
-  if (ttype->is_base_type()) {
-    return (1 == types_known[base_type_name((t_base_type*)ttype)]);
-  } else if (ttype->is_enum()) {
-    return true; // enums are written first, before all other types
-  } else if (ttype->is_map()) {
-    t_map* tmap = (t_map*)ttype;
-    return is_fully_defined_type(tmap->get_key_type())
-           && is_fully_defined_type(tmap->get_val_type());
-  } else if (ttype->is_set()) {
-    t_set* tset = (t_set*)ttype;
-    return is_fully_defined_type(tset->get_elem_type());
-  } else if (ttype->is_list()) {
-    t_list* tlist = (t_list*)ttype;
-    return is_fully_defined_type(tlist->get_elem_type());
-  }
-
-  return (1 == types_known[type_name(ttype)]);
-}
-
-void t_delphi_generator::add_defined_type(t_type* ttype) {
-  // mark as known type
-  types_known[type_name(ttype)] = 1;
-
-  // check all pending typedefs
-  std::list<t_typedef*>::iterator iter;
-  bool more = true;
-  while (more && (!typedefs_pending.empty())) {
-    more = false;
-
-    for (iter = typedefs_pending.begin(); typedefs_pending.end() != iter; ++iter) {
-      t_typedef* ttypedef = (*iter);
-      if (is_fully_defined_type(ttypedef->get_type())) {
-        pverbose("typedef %s: all pending references are now resolved\n",
-                 type_name(ttypedef).c_str());
-        typedefs_pending.erase(iter);
-        generate_typedef(ttypedef);
-        more = true;
-        break;
-      }
-    }
-  }
-}
-
-void t_delphi_generator::init_known_types_list() {
-  // known base types
-  types_known[type_name(g_type_string)] = 1;
-  types_known[type_name(g_type_binary)] = 1;
-  types_known[type_name(g_type_bool)] = 1;
-  types_known[type_name(g_type_byte)] = 1;
-  types_known[type_name(g_type_i16)] = 1;
-  types_known[type_name(g_type_i32)] = 1;
-  types_known[type_name(g_type_i64)] = 1;
-  types_known[type_name(g_type_double)] = 1;
-}
-
-void t_delphi_generator::generate_enum(t_enum* tenum) {
-  has_enum = true;
-  indent_up();
-  generate_delphi_doc(s_enum, tenum);
-  indent(s_enum) << type_name(tenum, true, true) << " = "
-                 << "(" << endl;
-  indent_up();
-  vector<t_enum_value*> constants = tenum->get_constants();
-  if (constants.empty()) {
-    indent(s_enum) << "dummy = 0  // empty enums are not allowed";
-  } else {
-    vector<t_enum_value*>::iterator c_iter;
-    for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-      int value = (*c_iter)->get_value();
-      if (c_iter != constants.begin()) {
-        s_enum << ",";
-        s_enum << endl;
-      }
-      generate_delphi_doc(s_enum, *c_iter);
-      indent(s_enum) << normalize_name((*c_iter)->get_name()) << " = " << value;
-    }
-  }
-  s_enum << endl;
-  indent_down();
-  indent(s_enum) << ");" << endl << endl;
-  indent_down();
-}
-
-std::string t_delphi_generator::make_valid_delphi_identifier(std::string const& fromName) {
-  std::string str = fromName;
-  if (str.empty()) {
-    return str;
-  }
-
-  // tests rely on this
-  assert(('A' < 'Z') && ('a' < 'z') && ('0' < '9'));
-
-  // if the first letter is a number, we add an additional underscore in front of it
-  char c = str.at(0);
-  if (('0' <= c) && (c <= '9')) {
-    str = "_" + str;
-  }
-
-  // following chars: letter, number or underscore
-  for (size_t i = 0; i < str.size(); ++i) {
-    c = str.at(i);
-    if ((('A' > c) || (c > 'Z')) && (('a' > c) || (c > 'z')) && (('0' > c) || (c > '9'))
-        && ('_' != c)) {
-      str.replace(i, 1, "_");
-    }
-  }
-
-  return str;
-}
-
-std::string t_delphi_generator::make_constants_classname() {
-  if (constprefix_) {
-    return make_valid_delphi_identifier("T" + program_name_ + "Constants");
-  } else {
-    return "TConstants"; // compatibility
-  }
-}
-
-void t_delphi_generator::generate_consts(std::vector<t_const*> consts) {
-  if (consts.empty()) {
-    return;
-  }
-
-  has_const = true;
-  string constants_class = make_constants_classname();
-
-  indent_up();
-  indent(s_const) << constants_class.c_str() << " = class" << endl;
-  indent(s_const) << "private" << endl;
-  indent_up();
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    if (const_needs_var((*c_iter)->get_type())) {
-      print_private_field(s_const,
-                          normalize_name((*c_iter)->get_name()),
-                          (*c_iter)->get_type(),
-                          (*c_iter)->get_value());
-    }
-  }
-  indent_down();
-  indent(s_const) << "public" << endl;
-  indent_up();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    generate_delphi_doc(s_const, *c_iter);
-    print_const_prop(s_const,
-                     normalize_name((*c_iter)->get_name()),
-                     (*c_iter)->get_type(),
-                     (*c_iter)->get_value());
-  }
-  indent(s_const) << "{$IF CompilerVersion >= 21.0}" << endl;
-  indent(s_const) << "class constructor Create;" << endl;
-  indent(s_const) << "class destructor Destroy;" << endl;
-  indent(s_const) << "{$IFEND}" << endl;
-  indent_down();
-  indent(s_const) << "end;" << endl << endl;
-  indent_down();
-
-  std::ostringstream vars, code;
-
-  indent_up_impl();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    initialize_field(vars,
-                     code,
-                     "F" + prop_name((*c_iter)->get_name()),
-                     (*c_iter)->get_type(),
-                     (*c_iter)->get_value());
-  }
-  indent_down_impl();
-
-  indent_impl(s_const_impl) << "{$IF CompilerVersion >= 21.0}" << endl;
-  indent_impl(s_const_impl) << "class constructor " << constants_class.c_str() << ".Create;"
-                            << endl;
-
-  if (!vars.str().empty()) {
-    indent_impl(s_const_impl) << "var" << endl;
-    s_const_impl << vars.str();
-  }
-  indent_impl(s_const_impl) << "begin" << endl;
-  if (!code.str().empty()) {
-    s_const_impl << code.str();
-  }
-  indent_impl(s_const_impl) << "end;" << endl << endl;
-  indent_impl(s_const_impl) << "class destructor " << constants_class.c_str() << ".Destroy;"
-                            << endl;
-  indent_impl(s_const_impl) << "begin" << endl;
-  indent_up_impl();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    if (const_needs_var((*c_iter)->get_type())) {
-      finalize_field(s_const_impl,
-                     normalize_name((*c_iter)->get_name()),
-                     (*c_iter)->get_type(),
-                     (*c_iter)->get_value());
-    }
-  }
-  indent_impl(s_const_impl) << "inherited;" << endl;
-  indent_down_impl();
-  indent_impl(s_const_impl) << "end;" << endl;
-  indent_impl(s_const_impl) << "{$ELSE}" << endl;
-
-  vars.str("");
-  code.str("");
-
-  indent_up_impl();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    if (const_needs_var((*c_iter)->get_type())) {
-      initialize_field(vars,
-                       code,
-                       constants_class + ".F" + prop_name((*c_iter)->get_name()),
-                       (*c_iter)->get_type(),
-                       (*c_iter)->get_value());
-    }
-  }
-  indent_down_impl();
-
-  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Initialize;" << endl;
-  if (!vars.str().empty()) {
-    indent_impl(s_const_impl) << "var" << endl;
-    s_const_impl << vars.str();
-  }
-  indent_impl(s_const_impl) << "begin" << endl;
-  if (!code.str().empty()) {
-    s_const_impl << code.str();
-  }
-  indent_impl(s_const_impl) << "end;" << endl << endl;
-
-  indent_impl(s_const_impl) << "procedure " << constants_class.c_str() << "_Finalize;" << endl;
-  indent_impl(s_const_impl) << "begin" << endl;
-  indent_up_impl();
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    finalize_field(s_const_impl,
-                   normalize_name((*c_iter)->get_name()),
-                   (*c_iter)->get_type(),
-                   (*c_iter)->get_value(),
-                   constants_class);
-  }
-  indent_down_impl();
-  indent_impl(s_const_impl) << "end;" << endl;
-  indent_impl(s_const_impl) << "{$IFEND}" << endl << endl;
-}
-
-void t_delphi_generator::print_const_def_value(std::ostream& vars,
-                                               std::ostream& out,
-                                               string name,
-                                               t_type* type,
-                                               t_const_value* value,
-                                               string cls_nm) {
-
-  string cls_prefix;
-
-  if (cls_nm == "") {
-    cls_prefix = "";
-  } else {
-    cls_prefix = cls_nm + ".";
-  }
-
-  if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field " + v_iter->first->get_string();
-      }
-      string val = render_const_value(vars, out, name, field_type, v_iter->second);
-      indent_impl(out) << cls_prefix << normalize_name(name) << "."
-                       << prop_name(v_iter->first->get_string(), type->is_xception())
-                       << " := " << val << ";" << endl;
-    }
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string key = render_const_value(vars, out, name, ktype, v_iter->first);
-      string val = render_const_value(vars, out, name, vtype, v_iter->second);
-      indent_impl(out) << cls_prefix << normalize_name(name) << "[" << key << "]"
-                       << " := " << val << ";" << endl;
-    }
-  } else if (type->is_list() || type->is_set()) {
-    t_type* etype;
-    if (type->is_list()) {
-      etype = ((t_list*)type)->get_elem_type();
-    } else {
-      etype = ((t_set*)type)->get_elem_type();
-    }
-
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string val = render_const_value(vars, out, name, etype, *v_iter);
-      indent_impl(out) << cls_prefix << normalize_name(name) << ".Add(" << val << ");" << endl;
-    }
-  }
-}
-
-void t_delphi_generator::print_private_field(std::ostream& out,
-                                             string name,
-                                             t_type* type,
-                                             t_const_value* value) {
-  (void)value;
-  indent(out) << "class var F" << name << ": " << type_name(type) << ";" << endl;
-}
-
-bool t_delphi_generator::const_needs_var(t_type* type) {
-  t_type* truetype = type;
-  while (truetype->is_typedef()) {
-    truetype = ((t_typedef*)truetype)->get_type();
-  }
-  return (!truetype->is_base_type());
-}
-
-void t_delphi_generator::print_const_prop(std::ostream& out,
-                                          string name,
-                                          t_type* type,
-                                          t_const_value* value) {
-  (void)value;
-  if (const_needs_var(type)) {
-    indent(out) << "class property " << name << ": " << type_name(type) << " read F" << name << ";"
-                << endl;
-  } else {
-    std::ostringstream vars; // dummy
-    string v2 = render_const_value(vars, out, name, type, value);
-    indent(out) << "const " << name << " = " << v2 << ";" << endl;
-  }
-}
-
-void t_delphi_generator::print_const_value(std::ostream& vars,
-                                           std::ostream& out,
-                                           string name,
-                                           t_type* type,
-                                           t_const_value* value) {
-  t_type* truetype = type;
-  while (truetype->is_typedef()) {
-    truetype = ((t_typedef*)truetype)->get_type();
-  }
-
-  if (truetype->is_base_type()) {
-    // already done
-    // string v2 = render_const_value( vars, out, name, type, value);
-    // indent_impl(out) << name << " := " << v2 << ";" << endl;
-  } else if (truetype->is_enum()) {
-    indent_impl(out) << name << " := " << type_name(type) << "." << value->get_identifier_name()
-                     << ";" << endl;
-  } else {
-    string typname;
-    typname = type_name(truetype, true, false, type->is_xception(), type->is_xception());
-    indent_impl(out) << name << " := " << typname << ".Create;" << endl;
-    print_const_def_value(vars, out, name, truetype, value);
-  }
-}
-
-void t_delphi_generator::initialize_field(std::ostream& vars,
-                                          std::ostream& out,
-                                          string name,
-                                          t_type* type,
-                                          t_const_value* value) {
-  print_const_value(vars, out, name, type, value);
-}
-
-void t_delphi_generator::finalize_field(std::ostream& out,
-                                        string name,
-                                        t_type* type,
-                                        t_const_value* value,
-                                        string cls_nm) {
-  (void)out;
-  (void)name;
-  (void)type;
-  (void)value;
-  (void)cls_nm;
-}
-
-string t_delphi_generator::render_const_value(ostream& vars,
-                                              ostream& out,
-                                              string name,
-                                              t_type* type,
-                                              t_const_value* value) {
-  (void)name;
-
-  t_type* truetype = type;
-  while (truetype->is_typedef()) {
-    truetype = ((t_typedef*)truetype)->get_type();
-  }
-
-  std::ostringstream render;
-
-  if (truetype->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)truetype)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << "'" << get_escaped_string(value) << "'";
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() > 0) ? "True" : "False");
-      break;
-    case t_base_type::TYPE_BYTE:
-      render << "ShortInt( " << value->get_integer() << ")";
-      break;
-    case t_base_type::TYPE_I16:
-      render << "SmallInt( " << value->get_integer() << ")";
-      break;
-    case t_base_type::TYPE_I32:
-      render << "LongInt( " << value->get_integer() << ")";
-      break;
-    case t_base_type::TYPE_I64:
-      render << "Int64( " << value->get_integer() << ")";
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << value->get_integer() << ".0"; // make it a double constant by adding ".0"
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (truetype->is_enum()) {
-    render << type_name(type, false) << "." << value->get_identifier_name();
-  } else {
-    string t = tmp("tmp");
-    vars << "  " << t << " : " << type_name(type) << ";" << endl;
-    print_const_value(vars, out, t, type, value);
-    render << t;
-  }
-
-  return render.str();
-}
-
-void t_delphi_generator::generate_struct(t_struct* tstruct) {
-  generate_delphi_struct(tstruct, false);
-}
-
-void t_delphi_generator::generate_xception(t_struct* txception) {
-  generate_delphi_struct(txception, true);
-}
-
-void t_delphi_generator::generate_delphi_struct(t_struct* tstruct, bool is_exception) {
-  indent_up();
-  generate_delphi_struct_definition(s_struct, tstruct, is_exception);
-  indent_down();
-
-  add_defined_type(tstruct);
-
-  generate_delphi_struct_impl(s_struct_impl, "", tstruct, is_exception);
-  if (register_types_) {
-    generate_delphi_struct_type_factory(s_type_factory_funcs, "", tstruct, is_exception);
-    generate_delphi_struct_type_factory_registration(s_type_factory_registration,
-                                                     "",
-                                                     tstruct,
-                                                     is_exception);
-  }
-}
-
-void t_delphi_generator::generate_delphi_struct_impl(ostream& out,
-                                                     string cls_prefix,
-                                                     t_struct* tstruct,
-                                                     bool is_exception,
-                                                     bool is_result,
-                                                     bool is_x_factory) {
-
-  if (is_exception && (!is_x_factory)) {
-    generate_delphi_struct_impl(out, cls_prefix, tstruct, is_exception, is_result, true);
-  }
-
-  string cls_nm;
-
-  string exception_factory_name;
-
-  if (is_exception) {
-    exception_factory_name = normalize_clsnm(tstruct->get_name(), "", true) + "Factory";
-  }
-
-  if (is_exception) {
-    cls_nm = type_name(tstruct, true, (!is_x_factory), is_x_factory, true);
-  } else {
-    cls_nm = type_name(tstruct, true, false);
-  }
-
-  std::ostringstream vars, code;
-
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  indent_up_impl();
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = (*m_iter)->get_type();
-    while (t->is_typedef()) {
-      t = ((t_typedef*)t)->get_type();
-    }
-    if ((*m_iter)->get_value() != NULL) {
-      initialize_field(vars,
-                       code,
-                       "F" + prop_name((*m_iter)->get_name(), is_exception),
-                       t,
-                       (*m_iter)->get_value());
-      if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        indent_impl(code) << "F__isset_" << prop_name((*m_iter), is_exception) << " := True;"
-                          << endl;
-      }
-    }
-  }
-  indent_down_impl();
-
-  indent_impl(out) << "constructor " << cls_prefix << cls_nm << "."
-                   << "Create;" << endl;
-
-  if (!vars.str().empty()) {
-    out << "var" << endl;
-    out << vars.str();
-  }
-
-  indent_impl(out) << "begin" << endl;
-  indent_up_impl();
-  if (is_exception && (!is_x_factory)) {
-    indent_impl(out) << "inherited Create('');" << endl;
-    indent_impl(out) << "F" << exception_factory_name << " := T" << exception_factory_name
-                     << "Impl.Create;" << endl;
-  } else {
-    indent_impl(out) << "inherited;" << endl;
-  }
-
-  if (!code.str().empty()) {
-    out << code.str();
-  }
-
-  indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
-
-  if ((members.size() > 0) && is_exception && (!is_x_factory)) {
-    indent_impl(out) << "constructor " << cls_prefix << cls_nm << "."
-                     << "Create(" << constructor_argument_list(tstruct, indent_impl()) << ");"
-                     << endl;
-    indent_impl(out) << "begin" << endl;
-    indent_up_impl();
-    indent_impl(out) << "Create;" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      string propname = prop_name((*m_iter)->get_name(), is_exception);
-      string param_name = constructor_param_name((*m_iter)->get_name());
-      indent_impl(out) << propname << " := " << param_name << ";" << endl;
-    }
-    indent_impl(out) << "UpdateMessageProperty;" << endl;
-    indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
-  }
-
-  indent_impl(out) << "destructor " << cls_prefix << cls_nm << "."
-                   << "Destroy;" << endl;
-  indent_impl(out) << "begin" << endl;
-  indent_up_impl();
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = (*m_iter)->get_type();
-    while (t->is_typedef()) {
-      t = ((t_typedef*)t)->get_type();
-    }
-    finalize_field(out, prop_name(*m_iter, is_exception), t, (*m_iter)->get_value());
-  }
-
-  indent_impl(out) << "inherited;" << endl;
-  indent_down_impl();
-  indent_impl(out) << "end;" << endl << endl;
-
-  if (tstruct->is_union()) {
-    indent_impl(out) << "procedure " << cls_prefix << cls_nm << "."
-                     << "ClearUnionValues;" << endl;
-    indent_impl(out) << "begin" << endl;
-    indent_up_impl();
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      t_type* t = (*m_iter)->get_type();
-      while (t->is_typedef()) {
-        t = ((t_typedef*)t)->get_type();
-      }
-
-      generate_delphi_clear_union_value(out,
-                                        cls_prefix,
-                                        cls_nm,
-                                        t,
-                                        *m_iter,
-                                        "F",
-                                        is_exception,
-                                        tstruct->is_union(),
-                                        is_x_factory,
-                                        exception_factory_name);
-    }
-    indent_down_impl();
-    indent_impl(out) << "end;" << endl << endl;
-  }
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    t_type* t = (*m_iter)->get_type();
-    while (t->is_typedef()) {
-      t = ((t_typedef*)t)->get_type();
-    }
-    generate_delphi_property_reader_impl(out, cls_prefix, cls_nm, t, *m_iter, "F", is_exception);
-    generate_delphi_property_writer_impl(out,
-                                         cls_prefix,
-                                         cls_nm,
-                                         t,
-                                         *m_iter,
-                                         "F",
-                                         is_exception,
-                                         tstruct->is_union(),
-                                         is_x_factory,
-                                         exception_factory_name);
-    if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-      generate_delphi_isset_reader_impl(out, cls_prefix, cls_nm, t, *m_iter, "F", is_exception);
-    }
-  }
-
-  if ((!is_exception) || is_x_factory) {
-    generate_delphi_struct_reader_impl(out, cls_prefix, tstruct, is_exception);
-    if (is_result) {
-      generate_delphi_struct_result_writer_impl(out, cls_prefix, tstruct, is_exception);
-    } else {
-      generate_delphi_struct_writer_impl(out, cls_prefix, tstruct, is_exception);
-    }
-  }
-  generate_delphi_struct_tostring_impl(out, cls_prefix, tstruct, is_exception, is_x_factory);
-
-  if (is_exception && is_x_factory) {
-    generate_delphi_create_exception_impl(out, cls_prefix, tstruct, is_exception);
-  }
-}
-
-void t_delphi_generator::print_delphi_struct_type_factory_func(ostream& out, t_struct* tstruct) {
-  string struct_intf_name = type_name(tstruct);
-  out << "Create_";
-  out << struct_intf_name;
-  out << "_Impl";
-}
-
-void t_delphi_generator::generate_delphi_struct_type_factory(ostream& out,
-                                                             string cls_prefix,
-                                                             t_struct* tstruct,
-                                                             bool is_exception,
-                                                             bool is_result,
-                                                             bool is_x_factory) {
-  (void)cls_prefix;
-  if (is_exception)
-    return;
-  if (is_result)
-    return;
-  if (is_x_factory)
-    return;
-
-  string struct_intf_name = type_name(tstruct);
-  string cls_nm = type_name(tstruct, true, false);
-
-  out << "function ";
-  print_delphi_struct_type_factory_func(out, tstruct);
-  out << ": ";
-  out << struct_intf_name;
-  out << ";" << endl;
-  out << "begin" << endl;
-  indent_up();
-  indent(out) << "Result := " << cls_nm << ".Create;" << endl;
-  indent_down();
-  out << "end;" << endl << endl;
-}
-
-void t_delphi_generator::generate_delphi_struct_type_factory_registration(ostream& out,
-                                                                          string cls_prefix,
-                                                                          t_struct* tstruct,
-                                                                          bool is_exception,
-                                                                          bool is_result,
-                                                                          bool is_x_factory) {
-  (void)cls_prefix;
-  if (is_exception)
-    return;
-  if (is_result)
-    return;
-  if (is_x_factory)
-    return;
-
-  string struct_intf_name = type_name(tstruct);
-
-  indent(out) << "  TypeRegistry.RegisterTypeFactory<" << struct_intf_name << ">(";
-  print_delphi_struct_type_factory_func(out, tstruct);
-  out << ");";
-  out << endl;
-}
-
-void t_delphi_generator::generate_delphi_struct_definition(ostream& out,
-                                                           t_struct* tstruct,
-                                                           bool is_exception,
-                                                           bool in_class,
-                                                           bool is_result,
-                                                           bool is_x_factory) {
-  bool is_final = (tstruct->annotations_.find("final") != tstruct->annotations_.end());
-  string struct_intf_name;
-  string struct_name;
-  string isset_name;
-  const vector<t_field*>& members = tstruct->get_members();
-  vector<t_field*>::const_iterator m_iter;
-
-  string exception_factory_name = normalize_clsnm(tstruct->get_name(), "", true) + "Factory";
-
-  if (is_exception) {
-    struct_intf_name = type_name(tstruct, false, false, true);
-  } else {
-    struct_intf_name = type_name(tstruct);
-  }
-
-  if (is_exception) {
-    struct_name = type_name(tstruct, true, (!is_x_factory), is_x_factory);
-  } else {
-    struct_name = type_name(tstruct, true);
-  }
-
-  if ((!is_exception) || is_x_factory) {
-
-    generate_delphi_doc(out, tstruct);
-    indent(out) << struct_intf_name << " = interface(IBase)" << endl;
-    indent_up();
-
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      generate_delphi_property_reader_definition(out, *m_iter, is_exception);
-      generate_delphi_property_writer_definition(out, *m_iter, is_exception);
-    }
-
-    if (is_x_factory) {
-      out << endl;
-      indent(out) << "// Create Exception Object" << endl;
-      indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << endl;
-    }
-
-    if (members.size() > 0) {
-      out << endl;
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        generate_property(out, *m_iter, true, is_exception);
-      }
-    }
-
-    if (members.size() > 0) {
-      out << endl;
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-          generate_delphi_isset_reader_definition(out, *m_iter, is_exception);
-        }
-      }
-    }
-
-    if (members.size() > 0) {
-      out << endl;
-      for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-        if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-          isset_name = "__isset_" + prop_name(*m_iter, is_exception);
-          indent(out) << "property " << isset_name << ": Boolean read Get" << isset_name << ";"
-                      << endl;
-        }
-      }
-    }
-
-    indent_down();
-    indent(out) << "end;" << endl << endl;
-  }
-
-  generate_delphi_doc(out, tstruct);
-  indent(out) << struct_name << " = ";
-  if (is_final) {
-    out << "sealed ";
-  }
-  out << "class(";
-  if (is_exception && (!is_x_factory)) {
-    out << "TException";
-  } else {
-    out << "TInterfacedObject, IBase, " << struct_intf_name;
-  }
-  out << ")" << endl;
-
-  if (is_exception && (!is_x_factory)) {
-    indent(out) << "public" << endl;
-    indent_up();
-    indent(out) << "type" << endl;
-    indent_up();
-    generate_delphi_struct_definition(out, tstruct, is_exception, in_class, is_result, true);
-    indent_down();
-    indent_down();
-  }
-
-  indent(out) << "private" << endl;
-  indent_up();
-
-  if (is_exception && (!is_x_factory)) {
-    indent(out) << "F" << exception_factory_name << " :" << struct_intf_name << ";" << endl << endl;
-  }
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    indent(out) << declare_field(*m_iter, false, "F", is_exception) << endl;
-  }
-
-  if (members.size() > 0) {
-    indent(out) << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        isset_name = "F__isset_" + prop_name(*m_iter, is_exception);
-        indent(out) << isset_name << ": Boolean;" << endl;
-      }
-    }
-  }
-
-  indent(out) << endl;
-
-  for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-    generate_delphi_property_reader_definition(out, *m_iter, is_exception);
-    generate_delphi_property_writer_definition(out, *m_iter, is_exception);
-  }
-
-  if (tstruct->is_union()) {
-    out << endl;
-    indent(out) << "// Clear values(for union's property setter)" << endl;
-    indent(out) << "procedure ClearUnionValues;" << endl;
-  }
-
-  if (members.size() > 0) {
-    out << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        isset_name = "__isset_" + prop_name(*m_iter, is_exception);
-        indent(out) << "function Get" << isset_name << ": Boolean;" << endl;
-      }
-    }
-  }
-
-  indent_down();
-
-  indent(out) << "public" << endl;
-  indent_up();
-
-  if ((members.size() > 0) && is_exception && (!is_x_factory)) {
-    indent(out) << "constructor Create; overload;" << endl;
-    indent(out) << "constructor Create(" << constructor_argument_list(tstruct, indent())
-                << "); overload;" << endl;
-  } else {
-    indent(out) << "constructor Create;" << endl;
-  }
-
-  indent(out) << "destructor Destroy; override;" << endl;
-
-  out << endl;
-  indent(out) << "function ToString: string; override;" << endl;
-
-  if (is_exception && (!is_x_factory)) {
-    out << endl;
-    indent(out) << "// Exception Factory" << endl;
-    indent(out) << "property " << exception_factory_name << ": " << struct_intf_name << " read F"
-                << exception_factory_name << " write F" << exception_factory_name << ";" << endl;
-  }
-
-  if ((!is_exception) || is_x_factory) {
-    out << endl;
-    indent(out) << "// IBase" << endl;
-    indent(out) << "procedure Read( const iprot: IProtocol);" << endl;
-    indent(out) << "procedure Write( const oprot: IProtocol);" << endl;
-  }
-
-  if (is_exception && is_x_factory) {
-    out << endl;
-    indent(out) << "// Create Exception Object" << endl;
-    indent(out) << "function CreateException: " << type_name(tstruct, true, true) << ";" << endl;
-  }
-
-  if (members.size() > 0) {
-    out << endl;
-    indent(out) << "// Properties" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      generate_property(out, *m_iter, true, is_exception);
-    }
-  }
-
-  if (members.size() > 0) {
-    out << endl;
-    indent(out) << "// isset" << endl;
-    for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) {
-      if ((*m_iter)->get_req() != t_field::T_REQUIRED) {
-        isset_name = "__isset_" + prop_name(*m_iter, is_exception);
-        indent(out) << "property " << isset_name << ": Boolean read Get" << isset_name << ";"
-                    << endl;
-      }
-    }
-  }
-
-  indent_down();
-  indent(out) << "end;" << endl << endl;
-}
-
-void t_delphi_generator::generate_service(t_service* tservice) {
-  indent_up();
-  generate_delphi_doc(s_service, tservice);
-  indent(s_service) << normalize_clsnm(service_name_, "T") << " = class" << endl;
-  indent(s_service) << "public" << endl;
-  indent_up();
-  indent(s_service) << "type" << endl;
-  generate_service_interface(tservice);
-  generate_service_client(tservice);
-  generate_service_server(tservice);
-  generate_service_helpers(tservice);
-  indent_down();
-  indent_down();
-  indent(s_service) << "end;" << endl;
-  indent(s_service) << endl;
-  indent_down();
-}
-
-void t_delphi_generator::generate_service_interface(t_service* tservice) {
-  string extends = "";
-  string extends_iface = "";
-
-  indent_up();
-
-  generate_delphi_doc(s_service, tservice);
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends(), true, true);
-    extends_iface = extends + ".Iface";
-    generate_delphi_doc(s_service, tservice);
-    indent(s_service) << "Iface = interface(" << extends_iface << ")" << endl;
-  } else {
-    indent(s_service) << "Iface = interface" << endl;
-  }
-
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    generate_delphi_doc(s_service, *f_iter);
-    indent(s_service) << function_signature(*f_iter) << endl;
-  }
-  indent_down();
-  indent(s_service) << "end;" << endl << endl;
-
-  indent_down();
-}
-
-void t_delphi_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    t_struct* ts = (*f_iter)->get_arglist();
-    generate_delphi_struct_definition(s_service, ts, false, true);
-    generate_delphi_struct_impl(s_service_impl,
-                                normalize_clsnm(service_name_, "T") + ".",
-                                ts,
-                                false);
-    generate_function_helpers(*f_iter);
-  }
-}
-
-void t_delphi_generator::generate_service_client(t_service* tservice) {
-  indent_up();
-  string extends = "";
-  string extends_client = "";
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends());
-    extends_client = extends + ".Client, ";
-  }
-
-  generate_delphi_doc(s_service, tservice);
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends(), true, true);
-    extends_client = extends + ".TClient";
-    indent(s_service) << "TClient = class(" << extends_client << ", Iface)" << endl;
-  } else {
-    indent(s_service) << "TClient = class( TInterfacedObject, Iface)" << endl;
-  }
-
-  indent(s_service) << "public" << endl;
-  indent_up();
-
-  indent(s_service) << "constructor Create( prot: IProtocol); overload;" << endl;
-
-  indent_impl(s_service_impl) << "constructor " << normalize_clsnm(service_name_, "T")
-                              << ".TClient.Create( prot: IProtocol);" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "Create( prot, prot );" << endl;
-  indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
-
-  indent(s_service)
-      << "constructor Create( const iprot: IProtocol; const oprot: IProtocol); overload;" << endl;
-
-  indent_impl(s_service_impl) << "constructor " << normalize_clsnm(service_name_, "T")
-                              << ".TClient.Create( const iprot: IProtocol; const oprot: IProtocol);"
-                              << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "inherited Create;" << endl;
-  indent_impl(s_service_impl) << "iprot_ := iprot;" << endl;
-  indent_impl(s_service_impl) << "oprot_ := oprot;" << endl;
-  indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
-
-  indent_down();
-
-  if (extends.empty()) {
-    indent(s_service) << "protected" << endl;
-    indent_up();
-    indent(s_service) << "iprot_: IProtocol;" << endl;
-    indent(s_service) << "oprot_: IProtocol;" << endl;
-    indent(s_service) << "seqid_: Integer;" << endl;
-    indent_down();
-
-    indent(s_service) << "public" << endl;
-    indent_up();
-    indent(s_service) << "property InputProtocol: IProtocol read iprot_;" << endl;
-    indent(s_service) << "property OutputProtocol: IProtocol read oprot_;" << endl;
-    indent_down();
-  }
-
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-
-  indent(s_service) << "protected" << endl;
-  indent_up();
-  indent(s_service) << "// Iface" << endl;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-    generate_delphi_doc(s_service, *f_iter);
-    indent(s_service) << function_signature(*f_iter) << endl;
-  }
-  indent_down();
-
-  indent(s_service) << "public" << endl;
-  indent_up();
-
-  string full_cls = normalize_clsnm(service_name_, "T") + ".TClient";
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string funname = (*f_iter)->get_name();
-
-    indent_impl(s_service_impl) << function_signature(*f_iter, full_cls) << endl;
-    indent_impl(s_service_impl) << "begin" << endl;
-    indent_up_impl();
-    indent_impl(s_service_impl) << "send_" << funname << "(";
-
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    bool first = true;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      if (first) {
-        first = false;
-      } else {
-        s_service_impl << ", ";
-      }
-      s_service_impl << normalize_name((*fld_iter)->get_name());
-    }
-    s_service_impl << ");" << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      s_service_impl << indent_impl();
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        s_service_impl << "Result := ";
-      }
-      s_service_impl << "recv_" << funname << "();" << endl;
-    }
-
-    indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl << endl;
-
-    t_function send_function(g_type_void,
-                             string("send_") + (*f_iter)->get_name(),
-                             (*f_iter)->get_arglist());
-
-    string argsname = (*f_iter)->get_name() + "_args";
-    string args_clsnm = normalize_clsnm(argsname, "T");
-    string args_intfnm = normalize_clsnm(argsname, "I");
-
-    string argsvar = tmp("_args");
-    string msgvar = tmp("_msg");
-
-    indent(s_service) << function_signature(&send_function) << endl;
-    indent_impl(s_service_impl) << function_signature(&send_function, full_cls) << endl;
-    indent_impl(s_service_impl) << "var" << endl;
-    indent_up_impl();
-    indent_impl(s_service_impl) << argsvar << " : " << args_intfnm << ";" << endl;
-    indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.IMessage;" << endl;
-    indent_down_impl();
-    indent_impl(s_service_impl) << "begin" << endl;
-    indent_up_impl();
-
-    indent_impl(s_service_impl) << "seqid_ := seqid_ + 1;" << endl;
-    indent_impl(s_service_impl) << msgvar << " := Thrift.Protocol.TMessageImpl.Create('" << funname
-                                << "', " << ((*f_iter)->is_oneway() ? "TMessageType.Oneway"
-                                                                    : "TMessageType.Call")
-                                << ", seqid_);" << endl;
-
-    indent_impl(s_service_impl) << "oprot_.WriteMessageBegin( " << msgvar << " );" << endl;
-    indent_impl(s_service_impl) << argsvar << " := " << args_clsnm << "Impl.Create();" << endl;
-
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      indent_impl(s_service_impl) << argsvar << "." << prop_name(*fld_iter)
-                                  << " := " << normalize_name((*fld_iter)->get_name()) << ";"
-                                  << endl;
-    }
-    indent_impl(s_service_impl) << argsvar << ".Write(oprot_);" << endl;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      indent_impl(s_service_impl) << argsvar << "." << prop_name(*fld_iter)
-                                  << " := " << empty_value((*fld_iter)->get_type()) << ";" << endl;
-    }
-
-    indent_impl(s_service_impl) << "oprot_.WriteMessageEnd();" << endl;
-    indent_impl(s_service_impl) << "oprot_.Transport.Flush();" << endl;
-
-    indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl << endl;
-
-    if (!(*f_iter)->is_oneway()) {
-      string org_resultname = (*f_iter)->get_name() + "_result";
-      string result_clsnm = normalize_clsnm(org_resultname, "T");
-      string result_intfnm = normalize_clsnm(org_resultname, "I");
-
-      t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               string("recv_") + (*f_iter)->get_name(),
-                               &noargs,
-                               (*f_iter)->get_xceptions());
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-
-      string exceptvar = tmp("_ex");
-      string appexvar = tmp("_ax");
-      string retvar = tmp("_ret");
-
-      indent(s_service) << function_signature(&recv_function) << endl;
-      indent_impl(s_service_impl) << function_signature(&recv_function, full_cls) << endl;
-      indent_impl(s_service_impl) << "var" << endl;
-      indent_up_impl();
-      indent_impl(s_service_impl) << msgvar << " : Thrift.Protocol.IMessage;" << endl;
-      if (xceptions.size() > 0) {
-        indent_impl(s_service_impl) << exceptvar << " : Exception;" << endl;
-      }
-      indent_impl(s_service_impl) << appexvar << " : TApplicationException;" << endl;
-      indent_impl(s_service_impl) << retvar << " : " << result_intfnm << ";" << endl;
-
-      indent_down_impl();
-      indent_impl(s_service_impl) << "begin" << endl;
-      indent_up_impl();
-      indent_impl(s_service_impl) << msgvar << " := iprot_.ReadMessageBegin();" << endl;
-      indent_impl(s_service_impl) << "if (" << msgvar << ".Type_ = TMessageType.Exception) then"
-                                  << endl;
-      indent_impl(s_service_impl) << "begin" << endl;
-      indent_up_impl();
-      indent_impl(s_service_impl) << appexvar << " := TApplicationException.Read(iprot_);" << endl;
-      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << endl;
-      indent_impl(s_service_impl) << "raise " << appexvar << ";" << endl;
-      indent_down_impl();
-      indent_impl(s_service_impl) << "end;" << endl;
-
-      indent_impl(s_service_impl) << retvar << " := " << result_clsnm << "Impl.Create();" << endl;
-      indent_impl(s_service_impl) << retvar << ".Read(iprot_);" << endl;
-      indent_impl(s_service_impl) << "iprot_.ReadMessageEnd();" << endl;
-
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent_impl(s_service_impl) << "if (" << retvar << ".__isset_success) then" << endl;
-        indent_impl(s_service_impl) << "begin" << endl;
-        indent_up_impl();
-        indent_impl(s_service_impl) << "Result := " << retvar << ".Success;" << endl;
-        t_type* type = (*f_iter)->get_returntype();
-        if (type->is_struct() || type->is_xception() || type->is_map() || type->is_list()
-            || type->is_set()) {
-          indent_impl(s_service_impl) << retvar << ".Success := nil;" << endl;
-        }
-        indent_impl(s_service_impl) << "Exit;" << endl;
-        indent_down_impl();
-        indent_impl(s_service_impl) << "end;" << endl;
-      }
-
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        indent_impl(s_service_impl) << "if (" << retvar << ".__isset_" << prop_name(*x_iter)
-                                    << ") then" << endl;
-        indent_impl(s_service_impl) << "begin" << endl;
-        indent_up_impl();
-        indent_impl(s_service_impl) << exceptvar << " := " << retvar << "." << prop_name(*x_iter)
-                                    << ".CreateException;" << endl;
-        indent_impl(s_service_impl) << "raise " << exceptvar << ";" << endl;
-        indent_down_impl();
-        indent_impl(s_service_impl) << "end;" << endl;
-      }
-
-      if (!(*f_iter)->get_returntype()->is_void()) {
-        indent_impl(s_service_impl)
-            << "raise "
-               "TApplicationException.Create(TApplicationException.TExceptionType.MissingResult, '"
-            << (*f_iter)->get_name() << " failed: unknown result');" << endl;
-      }
-
-      indent_down_impl();
-      indent_impl(s_service_impl) << "end;" << endl << endl;
-    }
-  }
-
-  indent_down();
-  indent(s_service) << "end;" << endl << endl;
-}
-
-void t_delphi_generator::generate_service_server(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator f_iter;
-
-  string extends = "";
-  string extends_processor = "";
-
-  string full_cls = normalize_clsnm(service_name_, "T") + ".TProcessorImpl";
-
-  if (tservice->get_extends() != NULL) {
-    extends = type_name(tservice->get_extends(), true, true);
-    extends_processor = extends + ".TProcessorImpl";
-    indent(s_service) << "TProcessorImpl = class(" << extends_processor << ", IProcessor)" << endl;
-  } else {
-    indent(s_service) << "TProcessorImpl = class( TInterfacedObject, IProcessor)" << endl;
-  }
-
-  indent(s_service) << "public" << endl;
-  indent_up();
-  indent(s_service) << "constructor Create( iface_: Iface );" << endl;
-  indent(s_service) << "destructor Destroy; override;" << endl;
-  indent_down();
-
-  indent_impl(s_service_impl) << "constructor " << full_cls << ".Create( iface_: Iface );" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  if (tservice->get_extends() != NULL) {
-    indent_impl(s_service_impl) << "inherited Create( iface_);" << endl;
-  } else {
-    indent_impl(s_service_impl) << "inherited Create;" << endl;
-  }
-  indent_impl(s_service_impl) << "Self.iface_ := iface_;" << endl;
-  if (tservice->get_extends() != NULL) {
-    indent_impl(s_service_impl) << "ASSERT( processMap_ <> nil);  // inherited" << endl;
-  } else {
-    indent_impl(s_service_impl)
-        << "processMap_ := TThriftDictionaryImpl<string, TProcessFunction>.Create;" << endl;
-  }
-
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    indent_impl(s_service_impl) << "processMap_.AddOrSetValue( '" << (*f_iter)->get_name() << "', "
-                                << (*f_iter)->get_name() << "_Process);" << endl;
-  }
-  indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
-
-  indent_impl(s_service_impl) << "destructor " << full_cls << ".Destroy;" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "inherited;" << endl;
-  indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl << endl;
-
-  indent(s_service) << "private" << endl;
-  indent_up();
-  indent(s_service) << "iface_: Iface;" << endl;
-  indent_down();
-
-  if (tservice->get_extends() == NULL) {
-    indent(s_service) << "protected" << endl;
-    indent_up();
-    indent(s_service) << "type" << endl;
-    indent_up();
-    indent(s_service) << "TProcessFunction = reference to procedure( seqid: Integer; const iprot: "
-                         "IProtocol; const oprot: IProtocol"
-                      << (events_ ? "; const events : IRequestEvents" : "") << ");" << endl;
-    indent_down();
-    indent_down();
-    indent(s_service) << "protected" << endl;
-    indent_up();
-    indent(s_service) << "processMap_: IThriftDictionary<string, TProcessFunction>;" << endl;
-    indent_down();
-  }
-
-  indent(s_service) << "public" << endl;
-  indent_up();
-  if (extends.empty()) {
-    indent(s_service) << "function Process( const iprot: IProtocol; const oprot: IProtocol; const "
-                         "events : IProcessorEvents): Boolean;" << endl;
-  } else {
-    indent(s_service) << "function Process( const iprot: IProtocol; const oprot: IProtocol; const "
-                         "events : IProcessorEvents): Boolean; reintroduce;" << endl;
-  }
-
-  indent_impl(s_service_impl) << "function " << full_cls << ".Process( const iprot: IProtocol; "
-                                                            "const oprot: IProtocol; const events "
-                                                            ": IProcessorEvents): Boolean;" << endl;
-  ;
-  indent_impl(s_service_impl) << "var" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "msg : Thrift.Protocol.IMessage;" << endl;
-  indent_impl(s_service_impl) << "fn : TProcessFunction;" << endl;
-  indent_impl(s_service_impl) << "x : TApplicationException;" << endl;
-  if (events_) {
-    indent_impl(s_service_impl) << "context : IRequestEvents;" << endl;
-  }
-  indent_down_impl();
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "try" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "msg := iprot.ReadMessageBegin();" << endl;
-  indent_impl(s_service_impl) << "fn := nil;" << endl;
-  indent_impl(s_service_impl) << "if not processMap_.TryGetValue(msg.Name, fn)" << endl;
-  indent_impl(s_service_impl) << "or not Assigned(fn) then" << endl;
-  indent_impl(s_service_impl) << "begin" << endl;
-  indent_up_impl();
-  indent_impl(s_service_impl) << "TProtocolUtil.Skip(iprot, TType.Struct);" << endl;
-  indent_impl(s_service_impl) << "iprot.ReadMessageEnd();" << endl;
-  indent_impl(s_service_impl) << "x := "
-                                 "TApplicationException.Create(TApplicationException."
-                                 "TExceptionType.UnknownMethod, 'Invalid method name: ''' + "
-                                 "msg.Name + '''');" << endl;
-  indent_impl(s_service_impl)
-      << "msg := Thrift.Protocol.TMessageImpl.Create(msg.Name, TMessageType.Exception, msg.SeqID);"
-      << endl;
-  indent_impl(s_service_impl) << "oprot.WriteMessageBegin( msg);" << endl;
-  indent_impl(s_service_impl) << "x.Write(oprot);" << endl;
-  indent_impl(s_service_impl) << "oprot.WriteMessageEnd();" << endl;
-  indent_impl(s_service_impl) << "oprot.Transport.Flush();" << endl;
-  indent_impl(s_service_impl) << "Result := True;" << endl;
-  indent_impl(s_service_impl) << "Exit;" << endl;
-  indent_down_impl();
-  indent_impl(s_service_impl) << "end;" << endl;
-  if (events_) {
-    indent_impl(s_service_impl) << "if events <> nil" << endl;
-    indent_impl(s_service_impl) << "then context := events.CreateRequestContext(msg.Name)" << endl;
-    indent_impl(s_service_impl) << "else context := nil;" << endl;
-    indent_impl(s_service_impl) << "try" << endl;
-    indent_up_impl();
-    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot, context);" << endl;
-    indent_down_impl();
-    indent_impl(s_service_impl) << "finally" << endl;
-    indent_up_impl();
-    indent_impl(s_service_impl) << "if context <> nil then begin" << endl;
-    indent_up_impl();
-    indent_impl(s_service_impl) << "context.CleanupContext;" << endl;
-    indent_impl(s_service_impl) << "context := nil;" << endl;
-    indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
-    indent_down_impl();
-    indent_impl(s_service_impl) << "end;" << endl;
-  } else {
-    indent_impl(s_service_impl) << "fn(msg.SeqID, iprot, oprot);" << endl;
-  }
-  

<TRUNCATED>


[13/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TSocket.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TSocket.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TSocket.as
deleted file mode 100644
index 6891388..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TSocket.as
+++ /dev/null
@@ -1,189 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *		http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.transport
-{
-
-  import flash.events.EventDispatcher;
-  import flash.events.Event;
-  import flash.events.IOErrorEvent;
-  import flash.events.ProgressEvent;
-  import flash.events.SecurityErrorEvent;
-  import flash.errors.EOFError;
-  import flash.errors.IOError;
-  import flash.net.URLLoader;
-  import flash.net.URLLoaderDataFormat;
-  import flash.net.URLRequest;
-  import flash.net.URLRequestMethod;
-  import flash.utils.IDataInput;
-  import flash.utils.IDataOutput;
-  import flash.utils.ByteArray;
-  import flash.net.Socket;
-
-
-  /**
-   * Socket implementation of the TTransport interface. Used for working with a
-   * Thrift Socket Server based implementations.
-   */
-
-  public class TSocket extends TTransport
-  {
-    private var socket:Socket = null;
-
-    private var host:String;
-
-    private var port:int;
-
-    private var obuffer:ByteArray = new ByteArray();
-
-    private var input:IDataInput;
-
-    private var output:IDataOutput;
-
-    private var ioCallback:Function = null;
-
-    private var eventDispatcher:EventDispatcher = new EventDispatcher();
-
-    public function TSocket(host:String, port:int):void
-    {
-      this.host = host;
-      this.port = port;
-    }
-
-    public override function close():void
-    {
-      this.input = null;
-      this.output = null;
-      socket.close()
-    }
-
-    public override function peek():Boolean
-    {
-      if(socket.connected)
-      {
-        trace("Bytes remained:" + socket.bytesAvailable);
-        return socket.bytesAvailable>0;
-      }
-      return false;
-    }
-
-    public override function read(buf:ByteArray, off:int, len:int):int
-    {
-      var n1:int = 0, n2:int = 0, n3:int = 0, n4:int = 0, cidx:int = 2;
-      var chunkSize:ByteArray = new ByteArray();
-
-      try
-      {
-        input.readBytes(buf, off, len);
-        return len;
-      }
-      catch (e:EOFError)
-      {
-        trace(e);
-        throw new TTransportError(TTransportError.END_OF_FILE, "No more data available.");
-      }
-      catch (e:IOError)
-      {
-        trace(e);
-        if(isOpen())
-        {
-          throw new TTransportError(TTransportError.UNKNOWN, "IO error while reading: " + e);
-        }
-        else
-        {
-          throw new TTransportError(TTransportError.NOT_OPEN, "Socket seem not to be opened: " + e);
-    	}
-      }
-      catch (e:Error)
-      {
-        trace(e);
-        throw new TTransportError(TTransportError.UNKNOWN, "Bad IO error: " + e);
-      }
-      return 0;
-    }
-
-    public override function write(buf:ByteArray, off:int, len:int):void
-    {
-      obuffer.writeBytes(buf, off, len);
-    }
-
-    public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
-    {
-      this.eventDispatcher.addEventListener(type, listener, useCapture, priority, useWeakReference);
-    }
-
-    public override function open():void
-    {
-      this.socket = new Socket();
-      this.socket.addEventListener(Event.CONNECT, socketConnected);
-      this.socket.addEventListener(IOErrorEvent.IO_ERROR, socketError);
-      this.socket.addEventListener(SecurityErrorEvent.SECURITY_ERROR, socketSecurityError);
-      this.socket.addEventListener(ProgressEvent.SOCKET_DATA, socketDataHandler);
-      this.socket.connect(host, port);
-    }
-
-    public function socketConnected(event:Event):void
-    {
-      this.output = this.socket;
-      this.input = this.socket;
-      this.eventDispatcher.dispatchEvent(event);
-    }
-
-    public function socketError(event:IOErrorEvent):void
-    {
-      trace("Error Connecting:" + event);
-      this.close();
-      if (ioCallback == null)
-      {
-        return;
-      }
-      ioCallback(new TTransportError(TTransportError.UNKNOWN, "IOError: " + event.text));
-      this.eventDispatcher.dispatchEvent(event);
-    }
-
-    public function socketSecurityError(event:SecurityErrorEvent):void
-    {
-      trace("Security Error Connecting:" + event);
-      this.close();
-      this.eventDispatcher.dispatchEvent(event);
-    }
-
-    public function socketDataHandler(event:ProgressEvent):void
-    {
-      if (ioCallback != null)
-      {
-        ioCallback(null);
-      }
-      this.eventDispatcher.dispatchEvent(event);
-    }
-
-    public override function flush(callback:Function = null):void
-    {
-      this.ioCallback = callback;
-      this.output.writeBytes(this.obuffer);
-      this.socket.flush();
-      this.obuffer.clear();
-    }
-
-    public override function isOpen():Boolean
-    {
-      return (this.socket == null ? false : this.socket.connected);
-    }
-  }
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransport.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransport.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransport.as
deleted file mode 100644
index 83160af..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransport.as
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.thrift.transport {
-  
-  import flash.utils.ByteArray;
-  import org.apache.thrift.AbstractMethodError;
-  
-  public class TTransport {
-
-    /**
-     * Queries whether the transport is open.
-       *
-     * @return True if the transport is open.
-     */
-    public function isOpen():Boolean {
-      throw new AbstractMethodError();
-    }
-    
-    /**
-     * Is there more data to be read?
-     *
-     * @return True if the remote side is still alive and feeding us
-     */
-    public function peek():Boolean {
-      return isOpen();
-    }
-
-    /**
-     * Opens the transport for reading/writing.
-     *
-     * @throws TTransportException if the transport could not be opened
-     */
-    public function open():void {
-      throw new AbstractMethodError();
-    }
-
-    /**
-     * Closes the transport.
-     */
-    public function close():void {
-      throw new AbstractMethodError();
-    };
-
-    /**
-     * Reads up to len bytes into buffer buf, starting att offset off.
-     *
-     * @param buf Array to read into
-     * @param off Index to start reading at
-     * @param len Maximum number of bytes to read
-     * @return The number of bytes actually read
-     * @throws TTransportException if there was an error reading data
-     */
-     public function read(buf:ByteArray, off:int, len:int):int {
-      throw new AbstractMethodError();
-     }
-
-    /**
-     * Guarantees that all of len bytes are actually read off the transport.
-     *
-     * @param buf Array to read into
-     * @param off Index to start reading at
-     * @param len Maximum number of bytes to read
-     * @return The number of bytes actually read, which must be equal to len
-     * @throws TTransportException if there was an error reading data
-     */
-    public function readAll(buf:ByteArray, off:int, len:int):int {
-      var got:int = 0;
-        var ret:int = 0;
-        while (got < len) {
-            ret = read(buf, off+got, len-got);
-            if (ret <= 0) {
-              throw new TTransportError(TTransportError.UNKNOWN, "Cannot read. Remote side has closed. Tried to read " + len + " bytes, but only got " + got + " bytes.");
-            }
-            got += ret;
-          }
-        return got;
-      }
-
-    /**
-     * Writes the buffer to the output
-     *
-     * @param buf The output data buffer
-     * @throws TTransportException if an error occurs writing data
-     */
-    public function writeAll(buf:ByteArray):void {
-      write(buf, 0, buf.length);
-    }
-
-    /**
-     * Writes up to len bytes from the buffer.
-     *
-     * @param buf The output data buffer
-     * @param off The offset to start writing from
-     * @param len The number of bytes to write
-     * @throws TTransportException if there was an error writing data
-     */
-    public function write(buf:ByteArray, off:int, len:int):void {
-      throw new AbstractMethodError();
-    }
-
-    /**
-     * Flush any pending data out of a transport buffer.
-     *
-     * @throws TTransportException if there was an error writing out data.
-     */
-    public function flush(callback:Function=null):void {
-      throw new AbstractMethodError();
-    }
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransportError.as
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransportError.as b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransportError.as
deleted file mode 100644
index 10a6f62..0000000
--- a/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransportError.as
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
- 
-package org.apache.thrift.transport {
-  
-  import org.apache.thrift.TError;
-
-  public class TTransportError extends TError {
-    
-    public static const UNKNOWN:int = 0;
-    public static const NOT_OPEN:int = 1;
-    public static const ALREADY_OPEN:int = 2;
-    public static const TIMED_OUT:int = 3;
-    public static const END_OF_FILE:int = 4;
-  
-    public function TTransportError(error:int = UNKNOWN, message:String = "") {
-      super(message, error);
-    }
-    
-  }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/CMakeLists.txt b/depends/thirdparty/thrift/lib/c_glib/CMakeLists.txt
deleted file mode 100644
index 2c0ce76..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/CMakeLists.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-# Find required packages
-find_package(GLIB REQUIRED COMPONENTS gobject)
-include_directories(${GLIB_INCLUDE_DIRS})
-
-include_directories(src)
-
-# SYSLIBS contains libraries that need to be linked to all lib targets
-set(SYSLIBS ${GLIB_LIBRARIES} ${GLIB_GOBJECT_LIBRARIES})
-
-# Create the thrift C glib library
-set(thrift_c_glib_SOURCES
-    src/thrift/c_glib/thrift.c
-    src/thrift/c_glib/thrift_struct.c
-    src/thrift/c_glib/thrift_application_exception.c
-    src/thrift/c_glib/processor/thrift_processor.c
-    src/thrift/c_glib/processor/thrift_dispatch_processor.c
-    src/thrift/c_glib/protocol/thrift_protocol.c
-    src/thrift/c_glib/protocol/thrift_protocol_factory.c
-    src/thrift/c_glib/protocol/thrift_binary_protocol.c
-    src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c
-    src/thrift/c_glib/transport/thrift_transport.c
-    src/thrift/c_glib/transport/thrift_transport_factory.c
-    src/thrift/c_glib/transport/thrift_buffered_transport_factory.c
-    src/thrift/c_glib/transport/thrift_framed_transport_factory.c
-    src/thrift/c_glib/transport/thrift_socket.c
-    src/thrift/c_glib/transport/thrift_server_transport.c
-    src/thrift/c_glib/transport/thrift_server_socket.c
-    src/thrift/c_glib/transport/thrift_buffered_transport.c
-    src/thrift/c_glib/transport/thrift_framed_transport.c
-    src/thrift/c_glib/transport/thrift_memory_buffer.c
-    src/thrift/c_glib/server/thrift_server.c
-    src/thrift/c_glib/server/thrift_simple_server.c
-)
-
-# Contains the thrift specific ADD_LIBRARY_THRIFT and TARGET_LINK_LIBRARIES_THRIFT
-include(ThriftMacros)
-
-ADD_LIBRARY_THRIFT(thrift_c_glib ${thrift_c_glib_SOURCES})
-TARGET_LINK_LIBRARIES_THRIFT(thrift_c_glib ${SYSLIBS})
-
-# Install the headers
-install(DIRECTORY "src/thrift" DESTINATION "${INCLUDE_INSTALL_DIR}"
-    FILES_MATCHING PATTERN "*.h")
-
-if(BUILD_TESTING)
-    add_subdirectory(test)
-endif()

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/Makefile.am
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/Makefile.am b/depends/thirdparty/thrift/lib/c_glib/Makefile.am
deleted file mode 100755
index 153d14b..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/Makefile.am
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-#   http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-AUTOMAKE_OPTIONS = serial-tests
-SUBDIRS = . test
-
-pkgconfigdir = $(libdir)/pkgconfig
-
-lib_LTLIBRARIES = libthrift_c_glib.la
-pkgconfig_DATA = thrift_c_glib.pc
-
-AM_CPPFLAGS = -Isrc -I src/thrift/c_glib
-AM_CFLAGS = -Wall -Wextra -pedantic
-
-# Define the source files for the module
-
-libthrift_c_glib_la_SOURCES = src/thrift/c_glib/thrift.c \
-                              src/thrift/c_glib/thrift_struct.c \
-                              src/thrift/c_glib/thrift_application_exception.c \
-                              src/thrift/c_glib/processor/thrift_processor.c \
-                              src/thrift/c_glib/processor/thrift_dispatch_processor.c \
-                              src/thrift/c_glib/protocol/thrift_protocol.c \
-                              src/thrift/c_glib/protocol/thrift_protocol_factory.c \
-                              src/thrift/c_glib/protocol/thrift_binary_protocol.c \
-                              src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c \
-                              src/thrift/c_glib/transport/thrift_transport.c \
-                              src/thrift/c_glib/transport/thrift_transport_factory.c \
-                              src/thrift/c_glib/transport/thrift_buffered_transport_factory.c \
-                              src/thrift/c_glib/transport/thrift_framed_transport_factory.c \
-                              src/thrift/c_glib/transport/thrift_socket.c \
-                              src/thrift/c_glib/transport/thrift_server_transport.c \
-                              src/thrift/c_glib/transport/thrift_server_socket.c \
-                              src/thrift/c_glib/transport/thrift_buffered_transport.c \
-                              src/thrift/c_glib/transport/thrift_framed_transport.c \
-                              src/thrift/c_glib/transport/thrift_memory_buffer.c \
-                              src/thrift/c_glib/server/thrift_server.c \
-                              src/thrift/c_glib/server/thrift_simple_server.c
-
-libthrift_c_glib_la_CFLAGS = $(AM_CFLAGS) $(GLIB_CFLAGS)
-
-include_thriftdir = $(includedir)/thrift/c_glib
-include_thrift_HEADERS = \
-                         $(top_builddir)/config.h \
-                         src/thrift/c_glib/thrift.h \
-                         src/thrift/c_glib/thrift_application_exception.h \
-                         src/thrift/c_glib/thrift_struct.h
-
-include_protocoldir = $(include_thriftdir)/protocol
-include_protocol_HEADERS = src/thrift/c_glib/protocol/thrift_protocol.h \
-                           src/thrift/c_glib/protocol/thrift_protocol_factory.h \
-                           src/thrift/c_glib/protocol/thrift_binary_protocol.h \
-                           src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h
-
-include_transportdir = $(include_thriftdir)/transport
-include_transport_HEADERS = src/thrift/c_glib/transport/thrift_buffered_transport.h \
-                            src/thrift/c_glib/transport/thrift_framed_transport.h \
-                            src/thrift/c_glib/transport/thrift_memory_buffer.h \
-                            src/thrift/c_glib/transport/thrift_server_socket.h \
-                            src/thrift/c_glib/transport/thrift_server_transport.h \
-                            src/thrift/c_glib/transport/thrift_socket.h \
-                            src/thrift/c_glib/transport/thrift_transport.h \
-                            src/thrift/c_glib/transport/thrift_transport_factory.h \
-                            src/thrift/c_glib/transport/thrift_buffered_transport_factory.h \
-                            src/thrift/c_glib/transport/thrift_framed_transport_factory.h
-
-include_serverdir = $(include_thriftdir)/server
-include_server_HEADERS = src/thrift/c_glib/server/thrift_server.h \
-                         src/thrift/c_glib/server/thrift_simple_server.h
-
-include_processordir = $(include_thriftdir)/processor
-include_processor_HEADERS = src/thrift/c_glib/processor/thrift_processor.h \
-                            src/thrift/c_glib/processor/thrift_dispatch_processor.h
-
-
-EXTRA_DIST = \
-             CMakeLists.txt \
-             coding_standards.md \
-             README.md \
-             test/glib.suppress \
-             thrift_c_glib.pc.in
-
-CLEANFILES = \
-             *.gcno \
-             *.gcda

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/README.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/README.md b/depends/thirdparty/thrift/lib/c_glib/README.md
deleted file mode 100644
index fd70d08..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/README.md
+++ /dev/null
@@ -1,34 +0,0 @@
-Thrift C Software Library
-
-License
-=======
-
-Licensed to the Apache Software Foundation (ASF) under one
-or more contributor license agreements. See the NOTICE file
-distributed with this work for additional information
-regarding copyright ownership. The ASF licenses this file
-to you under the Apache License, Version 2.0 (the
-"License"); you may not use this file except in compliance
-with the License. You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing,
-software distributed under the License is distributed on an
-"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-KIND, either express or implied. See the License for the
-specific language governing permissions and limitations
-under the License.
-
-Using Thrift with C
-===================
-
-The Thrift C libraries are built using the GNU tools.  Follow the instructions
-in the top-level README in order to generate the Makefiles.
-
-Dependencies
-============
-
-GLib
-http://www.gtk.org/
-

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/coding_standards.md
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/coding_standards.md b/depends/thirdparty/thrift/lib/c_glib/coding_standards.md
deleted file mode 100644
index 24b3a00..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/coding_standards.md
+++ /dev/null
@@ -1,5 +0,0 @@
-## C Glib Coding Standards
-
-Please follow:
- * [Thrift General Coding Standards](/doc/coding_standards.md)
- * [GNOME C Coding Style](https://help.gnome.org/users/programming-guidelines/stable/c-coding-style.html.en)

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.c
deleted file mode 100644
index 57f0bed..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/thrift_application_exception.h>
-#include <thrift/c_glib/processor/thrift_dispatch_processor.h>
-
-G_DEFINE_ABSTRACT_TYPE (ThriftDispatchProcessor,
-                        thrift_dispatch_processor,
-                        THRIFT_TYPE_PROCESSOR)
-
-gboolean
-thrift_dispatch_processor_process (ThriftProcessor *processor,
-                                   ThriftProtocol *in,
-                                   ThriftProtocol *out,
-                                   GError **error)
-{
-  gchar *fname;
-  ThriftMessageType mtype;
-  gint32 seqid;
-  ThriftDispatchProcessor *dispatch_processor =
-    THRIFT_DISPATCH_PROCESSOR (processor);
-
-  /* Read the start of the message, which we expect to be a method call */
-  if (thrift_protocol_read_message_begin (in,
-                                          &fname,
-                                          &mtype,
-                                          &seqid,
-                                          error) < 0) {
-    g_warning ("error reading start of message: %s",
-               (error != NULL) ? (*error)->message : "(null)");
-    return FALSE;
-  }
-  else if (mtype != T_CALL && mtype != T_ONEWAY) {
-    g_warning ("received invalid message type %d from client", mtype);
-    return FALSE;
-  }
-
-  /* Dispatch the method call */
-  return THRIFT_DISPATCH_PROCESSOR_GET_CLASS (dispatch_processor)
-    ->dispatch_call (dispatch_processor,
-                     in,
-                     out,
-                     fname,
-                     seqid,
-                     error);
-}
-
-static gboolean
-thrift_dispatch_processor_real_dispatch_call (ThriftDispatchProcessor *self,
-                                              ThriftProtocol *in,
-                                              ThriftProtocol *out,
-                                              gchar *fname,
-                                              gint32 seqid,
-                                              GError **error)
-{
-  ThriftTransport *transport;
-  ThriftApplicationException *xception;
-  gchar *message;
-  gint32 result;
-  gboolean dispatch_result = FALSE;
-
-  THRIFT_UNUSED_VAR (self);
-
-  /* By default, return an application exception to the client indicating the
-     method name is not recognized. */
-
-  if ((thrift_protocol_skip (in, T_STRUCT, error) < 0) ||
-      (thrift_protocol_read_message_end (in, error) < 0))
-    return FALSE;
-
-  g_object_get (in, "transport", &transport, NULL);
-  result = thrift_transport_read_end (transport, error);
-  g_object_unref (transport);
-  if (result < 0)
-    return FALSE;
-
-  if (thrift_protocol_write_message_begin (out,
-                                           fname,
-                                           T_EXCEPTION,
-                                           seqid,
-                                           error) < 0)
-    return FALSE;
-  message = g_strconcat ("Invalid method name: '", fname, "'", NULL);
-  xception =
-    g_object_new (THRIFT_TYPE_APPLICATION_EXCEPTION,
-                  "type",    THRIFT_APPLICATION_EXCEPTION_ERROR_UNKNOWN_METHOD,
-                  "message", message,
-                  NULL);
-  g_free (message);
-  result = thrift_struct_write (THRIFT_STRUCT (xception),
-                                out,
-                                error);
-  g_object_unref (xception);
-  if ((result < 0) ||
-      (thrift_protocol_write_message_end (out, error) < 0))
-    return FALSE;
-
-  g_object_get (out, "transport", &transport, NULL);
-  dispatch_result =
-    ((thrift_transport_write_end (transport, error) >= 0) &&
-     (thrift_transport_flush (transport, error) >= 0));
-  g_object_unref (transport);
-
-  return dispatch_result;
-}
-
-static void
-thrift_dispatch_processor_init (ThriftDispatchProcessor *self)
-{
-  THRIFT_UNUSED_VAR (self);
-}
-
-static void
-thrift_dispatch_processor_class_init (ThriftDispatchProcessorClass *klass)
-{
-  ThriftProcessorClass *processor_class =
-    THRIFT_PROCESSOR_CLASS (klass);
-
-  /* Implement ThriftProcessor's process method */
-  processor_class->process = thrift_dispatch_processor_process;
-
-  /* Provide a default implement for dispatch_call, which returns an exception
-     to the client indicating the method name was not recognized */
-  klass->dispatch_call = thrift_dispatch_processor_real_dispatch_call;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.h
deleted file mode 100644
index 5afb85e..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_dispatch_processor.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_DISPATCH_PROCESSOR_H
-#define _THRIFT_DISPATCH_PROCESSOR_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/processor/thrift_processor.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_dispatch_processor.h
- *  \brief Parses a method-call message header and invokes a function
- *         to dispatch the call by function name.
- *
- * ThriftDispatchProcessor is an abstract helper class that parses the
- * header of a method-call message and invokes a member function,
- * dispatch_call, with the method's name.
- *
- * Subclasses must implement dispatch_call to dispatch the method call
- * to the implementing function.
- */
-
-/* Type macros */
-#define THRIFT_TYPE_DISPATCH_PROCESSOR (thrift_dispatch_processor_get_type ())
-#define THRIFT_DISPATCH_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_DISPATCH_PROCESSOR, ThriftDispatchProcessor))
-#define THRIFT_IS_DISPATCH_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_DISPATCH_PROCESSOR))
-#define THRIFT_DISPATCH_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_DISPATCH_PROCESSOR, ThriftDispatchProcessorClass))
-#define THRIFT_IS_DISPATCH_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_DISPATCH_PROCESSOR))
-#define THRIFT_DISPATCH_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_DISPATCH_PROCESSOR, ThriftDispatchProcessorClass))
-
-/*!
- * Thrift Dispatch Processor object
- */
-struct _ThriftDispatchProcessor
-{
-  ThriftProcessor parent;
-};
-typedef struct _ThriftDispatchProcessor ThriftDispatchProcessor;
-
-/*!
- * Thrift Dispatch Processor class
- */
-struct _ThriftDispatchProcessorClass
-{
-  ThriftProcessorClass parent;
-
-  /* public */
-  gboolean (*process) (ThriftProcessor *processor,
-                       ThriftProtocol *in,
-                       ThriftProtocol *out,
-                       GError **error);
-
-  /* protected */
-  gboolean (*dispatch_call) (ThriftDispatchProcessor *self,
-                             ThriftProtocol *in,
-                             ThriftProtocol *out,
-                             gchar *fname,
-                             gint32 seqid,
-                             GError **error);
-};
-typedef struct _ThriftDispatchProcessorClass ThriftDispatchProcessorClass;
-
-/* Used by THRIFT_TYPE_DISPATCH_PROCESSOR */
-GType thrift_dispatch_processor_get_type (void);
-
-/*!
- * Processes a request.
- * \public \memberof ThriftDispatchProcessorClass
- */
-gboolean thrift_dispatch_processor_process (ThriftProcessor *processor,
-                                            ThriftProtocol *in,
-                                            ThriftProtocol *out,
-                                            GError **error);
-
-G_END_DECLS
-
-#endif /* _THRIFT_DISPATCH_PROCESSOR_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.c
deleted file mode 100644
index c242c25..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.c
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/processor/thrift_processor.h>
-
-G_DEFINE_ABSTRACT_TYPE(ThriftProcessor, thrift_processor, G_TYPE_OBJECT)
-
-gboolean
-thrift_processor_process (ThriftProcessor *processor, ThriftProtocol *in,
-                          ThriftProtocol *out, GError **error)
-{
-  return
-    THRIFT_PROCESSOR_GET_CLASS (processor)->process (processor, in, out, error);
-}
-
-/* class initializer for ThriftProcessor */
-static void
-thrift_processor_class_init (ThriftProcessorClass *cls)
-{
-  /* set these as virtual methods to be implemented by a subclass */
-  cls->process = thrift_processor_process;
-}
-
-static void
-thrift_processor_init (ThriftProcessor *processor)
-{
-  THRIFT_UNUSED_VAR (processor);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.h
deleted file mode 100644
index ff2d2da..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/processor/thrift_processor.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_PROCESSOR_H
-#define _THRIFT_PROCESSOR_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_processor.h
- *  \brief Abstract class for Thrift processors.
- */
-
-/* type macros */
-#define THRIFT_TYPE_PROCESSOR (thrift_processor_get_type ())
-#define THRIFT_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_PROCESSOR, ThriftProcessor))
-#define THRIFT_IS_PROCESSOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_PROCESSOR))
-#define THRIFT_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_PROCESSOR, ThriftProcessorClass))
-#define THRIFT_IS_PROCESSOR_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_PROCESSOR))
-#define THRIFT_PROCESSOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_PROCESSOR, ThriftProcessorClass))
-
-/*!
- * Thrift Processorobject
- */
-struct _ThriftProcessor
-{
-  GObject parent;
-};
-typedef struct _ThriftProcessor ThriftProcessor;
-
-/*!
- * Thrift Processor class
- */
-struct _ThriftProcessorClass
-{
-  GObjectClass parent;
-
-  /* vtable */
-  gboolean (*process) (ThriftProcessor *processor, ThriftProtocol *in,
-                       ThriftProtocol *out, GError **error);
-};
-typedef struct _ThriftProcessorClass ThriftProcessorClass;
-
-/* used by THRIFT_TYPE_PROCESSOR */
-GType thrift_processor_get_type (void);
-
-/*!
- * Processes the request.
- * \public \memberof ThriftProcessorClass
- */
-gboolean thrift_processor_process (ThriftProcessor *processor,
-                                   ThriftProtocol *in, ThriftProtocol *out,
-                                   GError **error);
-
-G_END_DECLS
-
-#endif /* _THRIFT_PROCESSOR_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c
deleted file mode 100644
index 358396c..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.c
+++ /dev/null
@@ -1,904 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <string.h>
-#include <stdio.h>
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-
-G_DEFINE_TYPE(ThriftBinaryProtocol, thrift_binary_protocol, THRIFT_TYPE_PROTOCOL)
-
-static guint64
-thrift_bitwise_cast_guint64 (gdouble v)
-{
-  union {
-    gdouble from;
-    guint64 to;
-  } u;
-  u.from = v;
-  return u.to;
-}
-
-static gdouble
-thrift_bitwise_cast_gdouble (guint64 v)
-{
-  union {
-    guint64 from;
-    gdouble to;
-  } u;
-  u.from = v;
-  return u.to;
-}
-
-gint32
-thrift_binary_protocol_write_message_begin (ThriftProtocol *protocol,
-    const gchar *name, const ThriftMessageType message_type,
-    const gint32 seqid, GError **error)
-{
-  gint32 version = (THRIFT_BINARY_PROTOCOL_VERSION_1)
-                   | ((gint32) message_type);
-  gint32 ret;
-  gint32 xfer = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_write_i32 (protocol, version, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  if ((ret = thrift_protocol_write_string (protocol, name, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  if ((ret = thrift_protocol_write_i32 (protocol, seqid, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_write_message_end (ThriftProtocol *protocol,
-                                          GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_struct_begin (ThriftProtocol *protocol,
-                                           const gchar *name,
-                                           GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (name);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_struct_end (ThriftProtocol *protocol,
-                                         GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_field_begin (ThriftProtocol *protocol,
-                                          const gchar *name,
-                                          const ThriftType field_type,
-                                          const gint16 field_id,
-                                          GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  THRIFT_UNUSED_VAR (name);
-
-  if ((ret = thrift_protocol_write_byte (protocol, (gint8) field_type,
-                                         error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  if ((ret = thrift_protocol_write_i16 (protocol, field_id, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_write_field_end (ThriftProtocol *protocol,
-                                        GError **error)
-{
-  /* satisfy -Wall */
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_field_stop (ThriftProtocol *protocol,
-                                         GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-  return thrift_protocol_write_byte (protocol, (gint8) T_STOP, error);
-}
-
-gint32
-thrift_binary_protocol_write_map_begin (ThriftProtocol *protocol,
-                                        const ThriftType key_type,
-                                        const ThriftType value_type,
-                                        const guint32 size,
-                                        GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_write_byte (protocol, (gint8) key_type,
-                                         error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  if ((ret = thrift_protocol_write_byte (protocol, (gint8) value_type,
-                                         error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  if ((ret = thrift_protocol_write_i32 (protocol, (gint32) size, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_write_map_end (ThriftProtocol *protocol,
-                                      GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_list_begin (ThriftProtocol *protocol,
-                                         const ThriftType element_type,
-                                         const guint32 size, 
-                                         GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_write_byte (protocol, (gint8) element_type,
-                                         error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if ((ret = thrift_protocol_write_i32 (protocol, (gint32) size, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_write_list_end (ThriftProtocol *protocol,
-                                       GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_set_begin (ThriftProtocol *protocol,
-                                        const ThriftType element_type,
-                                        const guint32 size, 
-                                        GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  return thrift_protocol_write_list_begin (protocol, element_type,
-                                           size, error);
-}
-
-gint32
-thrift_binary_protocol_write_set_end (ThriftProtocol *protocol, GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_write_bool (ThriftProtocol *protocol,
-                                   const gboolean value, GError **error)
-{
-  guint8 tmp;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  tmp = value ? 1 : 0;
-  return thrift_protocol_write_byte (protocol, tmp, error);
-}
-
-gint32
-thrift_binary_protocol_write_byte (ThriftProtocol *protocol, const gint8 value,
-                                   GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-   
-  if (thrift_transport_write (protocol->transport,
-                              (const gpointer) &value, 1, error))
-  {
-    return 1;
-  } else {
-    return -1;
-  }
-}
-
-gint32
-thrift_binary_protocol_write_i16 (ThriftProtocol *protocol, const gint16 value,
-                                  GError **error)
-{
-  gint16 net;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  net = g_htons (value);
-  if (thrift_transport_write (protocol->transport,
-                              (const gpointer) &net, 2, error))
-  {
-    return 2;
-  } else {
-    return -1;
-  }
-}
-
-gint32
-thrift_binary_protocol_write_i32 (ThriftProtocol *protocol, const gint32 value,
-                                  GError **error)
-{
-  gint32 net;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  net = g_htonl (value);
-  if (thrift_transport_write (protocol->transport,
-                              (const gpointer) &net, 4, error))
-  {
-    return 4;
-  } else {
-    return -1;
-  }
-}
-
-gint32
-thrift_binary_protocol_write_i64 (ThriftProtocol *protocol, const gint64 value,
-                                  GError **error)
-{
-  gint64 net;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  net = GUINT64_TO_BE (value);
-  if (thrift_transport_write (protocol->transport,
-                              (const gpointer) &net, 8, error))
-  {
-    return 8;
-  } else {
-    return -1;
-  }
-}
-
-gint32
-thrift_binary_protocol_write_double (ThriftProtocol *protocol,
-                                     const gdouble value, GError **error)
-{
-  guint64 bits;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  bits = GUINT64_FROM_BE (thrift_bitwise_cast_guint64 (value));
-  if (thrift_transport_write (protocol->transport,
-                              (const gpointer) &bits, 8, error))
-  {
-    return 8;
-  } else {
-    return -1;
-  }
-}
-
-gint32
-thrift_binary_protocol_write_string (ThriftProtocol *protocol,
-                                     const gchar *str, GError **error)
-{
-  guint32 len;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  len = str != NULL ? strlen (str) : 0;
-  /* write the string length + 1 which includes the null terminator */
-  return thrift_protocol_write_binary (protocol, (const gpointer) str, 
-                                       len, error);
-}
-
-gint32
-thrift_binary_protocol_write_binary (ThriftProtocol *protocol,
-                                     const gpointer buf,
-                                     const guint32 len, GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_write_i32 (protocol, len, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (len > 0)
-  {
-    if (thrift_transport_write (protocol->transport,
-                                (const gpointer) buf, len, error) == FALSE)
-    {
-      return -1;
-    }
-    xfer += len;
-  }
-
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_message_begin (ThriftProtocol *protocol,
-                                           gchar **name,
-                                           ThriftMessageType *message_type,
-                                           gint32 *seqid, GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gint32 sz;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_read_i32 (protocol, &sz, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (sz < 0)
-  {
-    /* check for version */
-    guint32 version = sz & THRIFT_BINARY_PROTOCOL_VERSION_MASK;
-    if (version != THRIFT_BINARY_PROTOCOL_VERSION_1)
-    {
-      g_set_error (error, THRIFT_PROTOCOL_ERROR,
-                   THRIFT_PROTOCOL_ERROR_BAD_VERSION,
-                   "expected version %d, got %d",
-                   THRIFT_BINARY_PROTOCOL_VERSION_1, version);
-      return -1;
-    }
-
-    *message_type = (ThriftMessageType) (sz & 0x000000ff);
-
-    if ((ret = thrift_protocol_read_string (protocol, name, error)) < 0)
-    {
-      return -1;
-    }
-    xfer += ret;
-
-    if ((ret = thrift_protocol_read_i32 (protocol, seqid, error)) < 0)
-    {
-      return -1;
-    }
-    xfer += ret;
-  }
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_message_end (ThriftProtocol *protocol,
-                                         GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_struct_begin (ThriftProtocol *protocol,
-                                          gchar **name,
-                                          GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  *name = NULL;
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_struct_end (ThriftProtocol *protocol,
-                                        GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_field_begin (ThriftProtocol *protocol,
-                                         gchar **name,
-                                         ThriftType *field_type,
-                                         gint16 *field_id,
-                                         GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gint8 type;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  THRIFT_UNUSED_VAR (name);
-
-  if ((ret = thrift_protocol_read_byte (protocol, &type, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  *field_type = (ThriftType) type;
-  if (*field_type == T_STOP)
-  {
-    *field_id = 0;
-    return xfer;
-  }
-  if ((ret = thrift_protocol_read_i16 (protocol, field_id, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_field_end (ThriftProtocol *protocol,
-                                       GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_map_begin (ThriftProtocol *protocol,
-                                       ThriftType *key_type,
-                                       ThriftType *value_type,
-                                       guint32 *size,
-                                       GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gint8 k, v;
-  gint32 sizei;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_read_byte (protocol, &k, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  *key_type = (ThriftType) k;
-
-  if ((ret = thrift_protocol_read_byte (protocol, &v, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  *value_type = (ThriftType) v;
-
-  if ((ret = thrift_protocol_read_i32 (protocol, &sizei, error)) <0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (sizei < 0)
-  {
-    g_set_error (error, THRIFT_PROTOCOL_ERROR,
-                 THRIFT_PROTOCOL_ERROR_NEGATIVE_SIZE,
-                 "got negative size of %d", sizei);
-    return -1;
-  }
-
-  *size = (guint32) sizei;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_map_end (ThriftProtocol *protocol,
-                                     GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_list_begin (ThriftProtocol *protocol,
-                                        ThriftType *element_type,
-                                        guint32 *size, GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gint8 e;
-  gint32 sizei;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = thrift_protocol_read_byte (protocol, &e, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-  *element_type = (ThriftType) e;
-
-  if ((ret = thrift_protocol_read_i32 (protocol, &sizei, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (sizei < 0)
-  {
-    g_set_error (error, THRIFT_PROTOCOL_ERROR,
-                 THRIFT_PROTOCOL_ERROR_NEGATIVE_SIZE,
-                 "got negative size of %d", sizei);
-    return -1;
-  }
-
-  *size = (guint32) sizei;
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_list_end (ThriftProtocol *protocol,
-                                      GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_set_begin (ThriftProtocol *protocol,
-                                       ThriftType *element_type,
-                                       guint32 *size, GError **error)
-{
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  return thrift_protocol_read_list_begin (protocol, element_type, size, error);
-}
-
-gint32
-thrift_binary_protocol_read_set_end (ThriftProtocol *protocol,
-                                     GError **error)
-{
-  THRIFT_UNUSED_VAR (protocol);
-  THRIFT_UNUSED_VAR (error);
-  return 0;
-}
-
-gint32
-thrift_binary_protocol_read_bool (ThriftProtocol *protocol, gboolean *value,
-                                  GError **error)
-{
-  gint32 ret;
-  gpointer b[1];
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret = 
-       thrift_transport_read (protocol->transport,
-                              b, 1, error)) < 0)
-  {
-    return -1;
-  }
-  *value = *(gint8 *) b != 0;
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_byte (ThriftProtocol *protocol, gint8 *value,
-                                  GError **error)
-{
-  gint32 ret;
-  gpointer b[1];
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret =
-       thrift_transport_read (protocol->transport,
-                              b, 1, error)) < 0)
-  {
-    return -1;
-  }
-  *value = *(gint8 *) b;
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_i16 (ThriftProtocol *protocol, gint16 *value,
-                                 GError **error)
-{
-  gint32 ret;
-  union
-  {
-    gint8 byte_array[2];
-    gint16 int16;
-  } b;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret =
-       thrift_transport_read (protocol->transport,
-                              b.byte_array, 2, error)) < 0)
-  {
-    return -1;
-  }
-  *value = g_ntohs (b.int16);
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_i32 (ThriftProtocol *protocol, gint32 *value,
-                                 GError **error)
-{
-  gint32 ret;
-  union
-  {
-    gint8 byte_array[4];
-    gint32 int32;
-  } b;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret =
-       thrift_transport_read (protocol->transport,
-                              b.byte_array, 4, error)) < 0)
-  {
-    return -1;
-  }
-  *value = g_ntohl (b.int32);
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_i64 (ThriftProtocol *protocol, gint64 *value,
-                                 GError **error)
-{
-  gint32 ret;
-  union
-  {
-    gint8 byte_array[8];
-    gint64 int64;
-  } b;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret =
-       thrift_transport_read (protocol->transport,
-                              b.byte_array, 8, error)) < 0)
-  {
-    return -1;
-  }
-  *value = GUINT64_FROM_BE (b.int64);
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_double (ThriftProtocol *protocol,
-                                    gdouble *value, GError **error)
-{
-  gint32 ret;
-  union
-  {
-    gint8 byte_array[8];
-    guint64 uint64;
-  } b;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  if ((ret =
-       thrift_transport_read (protocol->transport,
-                              b.byte_array, 8, error)) < 0)
-  {
-    return -1;
-  }
-  *value = thrift_bitwise_cast_gdouble (GUINT64_FROM_BE (b.uint64));
-  return ret;
-}
-
-gint32
-thrift_binary_protocol_read_string (ThriftProtocol *protocol,
-                                    gchar **str, GError **error)
-{
-  guint32 len;
-  gint32 ret;
-  gint32 xfer = 0;
-  gint32 read_len = 0;
-
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  /* read the length into read_len */
-  if ((ret =
-       thrift_protocol_read_i32 (protocol, &read_len, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (read_len > 0)
-  {
-    /* allocate the memory for the string */
-    len = (guint32) read_len + 1; /* space for null terminator */
-    *str = g_new0 (gchar, len);
-    if ((ret =
-         thrift_transport_read (protocol->transport,
-                                *str, read_len, error)) < 0)
-    {
-      g_free (*str);
-      *str = NULL;
-      len = 0;
-      return -1;
-    }
-    xfer += ret;
-  } else {
-    *str = NULL;
-  }
-
-  return xfer;
-}
-
-gint32
-thrift_binary_protocol_read_binary (ThriftProtocol *protocol,
-                                    gpointer *buf, guint32 *len,
-                                    GError **error)
-{
-  gint32 ret;
-  gint32 xfer = 0;
-  gint32 read_len = 0;
- 
-  g_return_val_if_fail (THRIFT_IS_BINARY_PROTOCOL (protocol), -1);
-
-  /* read the length into read_len */
-  if ((ret =
-       thrift_protocol_read_i32 (protocol, &read_len, error)) < 0)
-  {
-    return -1;
-  }
-  xfer += ret;
-
-  if (read_len > 0)
-  {
-    /* allocate the memory as an array of unsigned char for binary data */
-    *len = (guint32) read_len;
-    *buf = g_new (guchar, *len);
-    if ((ret =
-         thrift_transport_read (protocol->transport,
-                                *buf, *len, error)) < 0)
-    {
-      g_free (*buf);
-      *buf = NULL;
-      *len = 0;
-      return -1;
-    }
-    xfer += ret;
-  } else {
-    *len = (guint32) read_len;
-    *buf = NULL;
-  }
-
-  return xfer;
-}
-
-static void
-thrift_binary_protocol_init (ThriftBinaryProtocol *protocol)
-{
-  THRIFT_UNUSED_VAR (protocol);
-}
-
-/* initialize the class */
-static void
-thrift_binary_protocol_class_init (ThriftBinaryProtocolClass *klass)
-{
-  ThriftProtocolClass *cls = THRIFT_PROTOCOL_CLASS (klass);
-
-  cls->write_message_begin = thrift_binary_protocol_write_message_begin;
-  cls->write_message_end = thrift_binary_protocol_write_message_end;
-  cls->write_struct_begin = thrift_binary_protocol_write_struct_begin;
-  cls->write_struct_end = thrift_binary_protocol_write_struct_end;
-  cls->write_field_begin = thrift_binary_protocol_write_field_begin;
-  cls->write_field_end = thrift_binary_protocol_write_field_end;
-  cls->write_field_stop = thrift_binary_protocol_write_field_stop;
-  cls->write_map_begin = thrift_binary_protocol_write_map_begin;
-  cls->write_map_end = thrift_binary_protocol_write_map_end;
-  cls->write_list_begin = thrift_binary_protocol_write_list_begin;
-  cls->write_list_end = thrift_binary_protocol_write_list_end;
-  cls->write_set_begin = thrift_binary_protocol_write_set_begin;
-  cls->write_set_end = thrift_binary_protocol_write_set_end;
-  cls->write_bool = thrift_binary_protocol_write_bool;
-  cls->write_byte = thrift_binary_protocol_write_byte;
-  cls->write_i16 = thrift_binary_protocol_write_i16;
-  cls->write_i32 = thrift_binary_protocol_write_i32;
-  cls->write_i64 = thrift_binary_protocol_write_i64;
-  cls->write_double = thrift_binary_protocol_write_double;
-  cls->write_string = thrift_binary_protocol_write_string;
-  cls->write_binary = thrift_binary_protocol_write_binary;
-  cls->read_message_begin = thrift_binary_protocol_read_message_begin;
-  cls->read_message_end = thrift_binary_protocol_read_message_end;
-  cls->read_struct_begin = thrift_binary_protocol_read_struct_begin;
-  cls->read_struct_end = thrift_binary_protocol_read_struct_end;
-  cls->read_field_begin = thrift_binary_protocol_read_field_begin;
-  cls->read_field_end = thrift_binary_protocol_read_field_end;
-  cls->read_map_begin = thrift_binary_protocol_read_map_begin;
-  cls->read_map_end = thrift_binary_protocol_read_map_end;
-  cls->read_list_begin = thrift_binary_protocol_read_list_begin;
-  cls->read_list_end = thrift_binary_protocol_read_list_end;
-  cls->read_set_begin = thrift_binary_protocol_read_set_begin;
-  cls->read_set_end = thrift_binary_protocol_read_set_end;
-  cls->read_bool = thrift_binary_protocol_read_bool;
-  cls->read_byte = thrift_binary_protocol_read_byte;
-  cls->read_i16 = thrift_binary_protocol_read_i16;
-  cls->read_i32 = thrift_binary_protocol_read_i32;
-  cls->read_i64 = thrift_binary_protocol_read_i64;
-  cls->read_double = thrift_binary_protocol_read_double;
-  cls->read_string = thrift_binary_protocol_read_string;
-  cls->read_binary = thrift_binary_protocol_read_binary;
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.h
deleted file mode 100644
index 5230bcc..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_BINARY_PROTOCOL_H
-#define _THRIFT_BINARY_PROTOCOL_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/protocol/thrift_protocol.h>
-#include <thrift/c_glib/transport/thrift_transport.h>
-
-G_BEGIN_DECLS
-
-/*! \file thrift_binary_protocol.h
- *  \brief Binary protocol implementation of a Thrift protocol.  Implements the
- *         ThriftProtocol interface.
- */
-
-/* type macros */
-#define THRIFT_TYPE_BINARY_PROTOCOL (thrift_binary_protocol_get_type ())
-#define THRIFT_BINARY_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_BINARY_PROTOCOL, ThriftBinaryProtocol))
-#define THRIFT_IS_BINARY_PROTOCOL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_BINARY_PROTOCOL))
-#define THRIFT_BINARY_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_BINARY_PROTOCOL, ThriftBinaryProtocolClass))
-#define THRIFT_IS_BINARY_PROTOCOL_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_BINARY_PROTOCOL))
-#define THRIFT_BINARY_PROTOCOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_BINARY_PROTOCOL, ThriftBinaryProtocolClass))
-
-/* version numbers */
-#define THRIFT_BINARY_PROTOCOL_VERSION_1 0x80010000
-#define THRIFT_BINARY_PROTOCOL_VERSION_MASK 0xffff0000
-
-typedef struct _ThriftBinaryProtocol ThriftBinaryProtocol;
-
-/*!
- * Thrift Binary Protocol instance.
- */
-struct _ThriftBinaryProtocol
-{
-  ThriftProtocol parent;
-};
-
-typedef struct _ThriftBinaryProtocolClass ThriftBinaryProtocolClass;
-
-/*!
- * Thrift Binary Protocol class.
- */
-struct _ThriftBinaryProtocolClass
-{
-  ThriftProtocolClass parent;
-};
-
-/* used by THRIFT_TYPE_BINARY_PROTOCOL */
-GType thrift_binary_protocol_get_type (void);
-
-G_END_DECLS
-
-#endif /* _THRIFT_BINARY_PROTOCOL_H */

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c
deleted file mode 100644
index 774e9ad..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.c
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/c_glib/thrift.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol.h>
-#include <thrift/c_glib/protocol/thrift_binary_protocol_factory.h>
-
-G_DEFINE_TYPE(ThriftBinaryProtocolFactory, thrift_binary_protocol_factory, THRIFT_TYPE_PROTOCOL_FACTORY)
-
-ThriftProtocol *
-thrift_binary_protocol_factory_get_protocol (ThriftProtocolFactory *factory,
-                                             ThriftTransport *transport)
-{
-  ThriftBinaryProtocol *tb = g_object_new (THRIFT_TYPE_BINARY_PROTOCOL,
-                                           "transport", transport, NULL);
-
-  THRIFT_UNUSED_VAR (factory);
-
-  return THRIFT_PROTOCOL (tb);
-}
-
-static void
-thrift_binary_protocol_factory_class_init (ThriftBinaryProtocolFactoryClass *cls)
-{
-  ThriftProtocolFactoryClass *protocol_factory_class = THRIFT_PROTOCOL_FACTORY_CLASS (cls);
-
-  protocol_factory_class->get_protocol = thrift_binary_protocol_factory_get_protocol;
-}
-
-static void
-thrift_binary_protocol_factory_init (ThriftBinaryProtocolFactory *factory)
-{
-  THRIFT_UNUSED_VAR (factory);
-}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h b/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h
deleted file mode 100644
index eddc073..0000000
--- a/depends/thirdparty/thrift/lib/c_glib/src/thrift/c_glib/protocol/thrift_binary_protocol_factory.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_BINARY_PROTOCOL_FACTORY_H
-#define _THRIFT_BINARY_PROTOCOL_FACTORY_H
-
-#include <glib-object.h>
-
-#include <thrift/c_glib/protocol/thrift_protocol_factory.h>
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define THRIFT_TYPE_BINARY_PROTOCOL_FACTORY (thrift_binary_protocol_factory_get_type ())
-#define THRIFT_BINARY_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, ThriftBinaryProtocolFactory))
-#define THRIFT_IS_BINARY_PROTOCOL_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), THRIFT_TYPE_BINARY_PROTOCOL_FACTORY))
-#define THRIFT_BINARY_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, ThriftBinaryProtocolFactoryClass))
-#define THRIFT_IS_BINARY_PROTOCOL_FACTORY_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), THRIFT_TYPE_BINARY_PROTOCOL_FACTORY))
-#define THRIFT_BINARY_PROTOCOL_FACTORY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), THRIFT_TYPE_BINARY_PROTOCOL_FACTORY, ThriftBinaryProtocolFactoryClass))
-
-typedef struct _ThriftBinaryProtocolFactory ThriftBinaryProtocolFactory;
-
-struct _ThriftBinaryProtocolFactory
-{
-  ThriftProtocolFactory parent;
-};
-
-typedef struct _ThriftBinaryProtocolFactoryClass ThriftBinaryProtocolFactoryClass;
-
-struct _ThriftBinaryProtocolFactoryClass
-{
-  ThriftProtocolFactoryClass parent;
-};
-
-/* used by THRIFT_TYPE_BINARY_PROTOCOL_FACTORY */
-GType thrift_binary_protocol_factory_get_type (void);
-
-G_END_DECLS
-
-#endif /* _THRIFT_BINARY_PROTOCOL_FACTORY_H */


[04/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
deleted file mode 100644
index e79c57d..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncDispatchProcessor.h
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef _THRIFT_ASYNC_TASYNCDISPATCHPROCESSOR_H_
-#define _THRIFT_ASYNC_TASYNCDISPATCHPROCESSOR_H_ 1
-
-#include <thrift/async/TAsyncProcessor.h>
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-/**
- * TAsyncDispatchProcessor is a helper class to parse the message header then
- * call another function to dispatch based on the function name.
- *
- * Subclasses must implement dispatchCall() to dispatch on the function name.
- */
-template <class Protocol_>
-class TAsyncDispatchProcessorT : public TAsyncProcessor {
-public:
-  virtual void process(apache::thrift::stdcxx::function<void(bool success)> _return,
-                       boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out) {
-    protocol::TProtocol* inRaw = in.get();
-    protocol::TProtocol* outRaw = out.get();
-
-    // Try to dynamic cast to the template protocol type
-    Protocol_* specificIn = dynamic_cast<Protocol_*>(inRaw);
-    Protocol_* specificOut = dynamic_cast<Protocol_*>(outRaw);
-    if (specificIn && specificOut) {
-      return processFast(_return, specificIn, specificOut);
-    }
-
-    // Log the fact that we have to use the slow path
-    T_GENERIC_PROTOCOL(this, inRaw, specificIn);
-    T_GENERIC_PROTOCOL(this, outRaw, specificOut);
-
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    inRaw->readMessageBegin(fname, mtype, seqid);
-
-    // If this doesn't look like a valid call, log an error and return false so
-    // that the server will close the connection.
-    //
-    // (The old generated processor code used to try to skip a T_STRUCT and
-    // continue.  However, that seems unsafe.)
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      _return(false);
-      return;
-    }
-
-    return this->dispatchCall(_return, inRaw, outRaw, fname, seqid);
-  }
-
-  void processFast(apache::thrift::stdcxx::function<void(bool success)> _return,
-                   Protocol_* in,
-                   Protocol_* out) {
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    in->readMessageBegin(fname, mtype, seqid);
-
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      _return(false);
-      return;
-    }
-
-    return this->dispatchCallTemplated(_return, in, out, fname, seqid);
-  }
-
-  virtual void dispatchCall(apache::thrift::stdcxx::function<void(bool ok)> _return,
-                            apache::thrift::protocol::TProtocol* in,
-                            apache::thrift::protocol::TProtocol* out,
-                            const std::string& fname,
-                            int32_t seqid) = 0;
-
-  virtual void dispatchCallTemplated(apache::thrift::stdcxx::function<void(bool ok)> _return,
-                                     Protocol_* in,
-                                     Protocol_* out,
-                                     const std::string& fname,
-                                     int32_t seqid) = 0;
-};
-
-/**
- * Non-templatized version of TAsyncDispatchProcessor,
- * that doesn't bother trying to perform a dynamic_cast.
- */
-class TAsyncDispatchProcessor : public TAsyncProcessor {
-public:
-  virtual void process(apache::thrift::stdcxx::function<void(bool success)> _return,
-                       boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out) {
-    protocol::TProtocol* inRaw = in.get();
-    protocol::TProtocol* outRaw = out.get();
-
-    std::string fname;
-    protocol::TMessageType mtype;
-    int32_t seqid;
-    inRaw->readMessageBegin(fname, mtype, seqid);
-
-    // If this doesn't look like a valid call, log an error and return false so
-    // that the server will close the connection.
-    //
-    // (The old generated processor code used to try to skip a T_STRUCT and
-    // continue.  However, that seems unsafe.)
-    if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) {
-      GlobalOutput.printf("received invalid message type %d from client", mtype);
-      _return(false);
-      return;
-    }
-
-    return dispatchCall(_return, inRaw, outRaw, fname, seqid);
-  }
-
-  virtual void dispatchCall(apache::thrift::stdcxx::function<void(bool ok)> _return,
-                            apache::thrift::protocol::TProtocol* in,
-                            apache::thrift::protocol::TProtocol* out,
-                            const std::string& fname,
-                            int32_t seqid) = 0;
-};
-
-// Specialize TAsyncDispatchProcessorT for TProtocol and TDummyProtocol just to
-// use the generic TDispatchProcessor.
-template <>
-class TAsyncDispatchProcessorT<protocol::TDummyProtocol> : public TAsyncDispatchProcessor {};
-template <>
-class TAsyncDispatchProcessorT<protocol::TProtocol> : public TAsyncDispatchProcessor {};
-}
-}
-} // apache::thrift::async
-
-#endif // _THRIFT_ASYNC_TASYNCDISPATCHPROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProcessor.h
deleted file mode 100644
index 033f7d9..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProcessor.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TASYNCPROCESSOR_H_
-#define _THRIFT_TASYNCPROCESSOR_H_ 1
-
-#include <thrift/cxxfunctional.h>
-#include <boost/shared_ptr.hpp>
-#include <thrift/protocol/TProtocol.h>
-#include <thrift/TProcessor.h>
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-/**
- * Async version of a TProcessor.  It is not expected to complete by the time
- * the call to process returns.  Instead, it calls a cob to signal completion.
- */
-
-class TEventServer; // forward declaration
-
-class TAsyncProcessor {
-public:
-  virtual ~TAsyncProcessor() {}
-
-  virtual void process(apache::thrift::stdcxx::function<void(bool success)> _return,
-                       boost::shared_ptr<protocol::TProtocol> in,
-                       boost::shared_ptr<protocol::TProtocol> out) = 0;
-
-  void process(apache::thrift::stdcxx::function<void(bool success)> _return,
-               boost::shared_ptr<apache::thrift::protocol::TProtocol> io) {
-    return process(_return, io, io);
-  }
-
-  boost::shared_ptr<TProcessorEventHandler> getEventHandler() { return eventHandler_; }
-
-  void setEventHandler(boost::shared_ptr<TProcessorEventHandler> eventHandler) {
-    eventHandler_ = eventHandler;
-  }
-
-  const TEventServer* getAsyncServer() { return asyncServer_; }
-
-protected:
-  TAsyncProcessor() {}
-
-  boost::shared_ptr<TProcessorEventHandler> eventHandler_;
-  const TEventServer* asyncServer_;
-
-private:
-  friend class TEventServer;
-  void setAsyncServer(const TEventServer* server) { asyncServer_ = server; }
-};
-
-class TAsyncProcessorFactory {
-public:
-  virtual ~TAsyncProcessorFactory() {}
-
-  /**
-   * Get the TAsyncProcessor to use for a particular connection.
-   *
-   * This method is always invoked in the same thread that the connection was
-   * accepted on.  This generally means that this call does not need to be
-   * thread safe, as it will always be invoked from a single thread.
-   */
-  virtual boost::shared_ptr<TAsyncProcessor> getProcessor(const TConnectionInfo& connInfo) = 0;
-};
-}
-}
-} // apache::thrift::async
-
-// XXX I'm lazy for now
-namespace apache {
-namespace thrift {
-using apache::thrift::async::TAsyncProcessor;
-}
-}
-
-#endif // #ifndef _THRIFT_TASYNCPROCESSOR_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
deleted file mode 100644
index 5a4f347..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/async/TAsyncProtocolProcessor.h>
-
-using apache::thrift::transport::TBufferBase;
-using apache::thrift::protocol::TProtocol;
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-void TAsyncProtocolProcessor::process(apache::thrift::stdcxx::function<void(bool healthy)> _return,
-                                      boost::shared_ptr<TBufferBase> ibuf,
-                                      boost::shared_ptr<TBufferBase> obuf) {
-  boost::shared_ptr<TProtocol> iprot(pfact_->getProtocol(ibuf));
-  boost::shared_ptr<TProtocol> oprot(pfact_->getProtocol(obuf));
-  return underlying_
-      ->process(apache::thrift::stdcxx::bind(&TAsyncProtocolProcessor::finish,
-                                             _return,
-                                             oprot,
-                                             apache::thrift::stdcxx::placeholders::_1),
-                iprot,
-                oprot);
-}
-
-/* static */ void TAsyncProtocolProcessor::finish(
-    apache::thrift::stdcxx::function<void(bool healthy)> _return,
-    boost::shared_ptr<TProtocol> oprot,
-    bool healthy) {
-  (void)oprot;
-  // This is a stub function to hold a reference to oprot.
-  return _return(healthy);
-}
-}
-}
-} // apache::thrift::async

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
deleted file mode 100644
index 3f2b394..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncProtocolProcessor.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TNAME_ME_H_
-#define _THRIFT_TNAME_ME_H_ 1
-
-#include <thrift/async/TAsyncProcessor.h>
-#include <thrift/async/TAsyncBufferProcessor.h>
-#include <thrift/protocol/TProtocol.h>
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-class TAsyncProtocolProcessor : public TAsyncBufferProcessor {
-public:
-  TAsyncProtocolProcessor(boost::shared_ptr<TAsyncProcessor> underlying,
-                          boost::shared_ptr<apache::thrift::protocol::TProtocolFactory> pfact)
-    : underlying_(underlying), pfact_(pfact) {}
-
-  virtual void process(apache::thrift::stdcxx::function<void(bool healthy)> _return,
-                       boost::shared_ptr<apache::thrift::transport::TBufferBase> ibuf,
-                       boost::shared_ptr<apache::thrift::transport::TBufferBase> obuf);
-
-  virtual ~TAsyncProtocolProcessor() {}
-
-private:
-  static void finish(apache::thrift::stdcxx::function<void(bool healthy)> _return,
-                     boost::shared_ptr<apache::thrift::protocol::TProtocol> oprot,
-                     bool healthy);
-
-  boost::shared_ptr<TAsyncProcessor> underlying_;
-  boost::shared_ptr<apache::thrift::protocol::TProtocolFactory> pfact_;
-};
-}
-}
-} // apache::thrift::async
-
-#endif // #ifndef _THRIFT_TNAME_ME_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.cpp
deleted file mode 100644
index c7e27c0..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.cpp
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/async/TConcurrentClientSyncInfo.h>
-#include <thrift/TApplicationException.h>
-#include <thrift/transport/TTransportException.h>
-#include <limits>
-
-namespace apache { namespace thrift { namespace async {
-
-using namespace ::apache::thrift::concurrency;
-
-TConcurrentClientSyncInfo::TConcurrentClientSyncInfo() :
-  stop_(false),
-  seqidMutex_(),
-  // test rollover all the time
-  nextseqid_((std::numeric_limits<int32_t>::max)()-10),
-  seqidToMonitorMap_(),
-  freeMonitors_(),
-  writeMutex_(),
-  readMutex_(),
-  recvPending_(false),
-  wakeupSomeone_(false),
-  seqidPending_(0),
-  fnamePending_(),
-  mtypePending_(::apache::thrift::protocol::T_CALL)
-{
-  freeMonitors_.reserve(MONITOR_CACHE_SIZE);
-}
-
-bool TConcurrentClientSyncInfo::getPending(
-  std::string &fname,
-  ::apache::thrift::protocol::TMessageType &mtype,
-  int32_t &rseqid)
-{
-  if(stop_)
-    throwDeadConnection_();
-  wakeupSomeone_ = false;
-  if(recvPending_)
-  {
-    recvPending_ = false;
-    rseqid = seqidPending_;
-    fname  = fnamePending_;
-    mtype  = mtypePending_;
-    return true;
-  }
-  return false;
-}
-
-void TConcurrentClientSyncInfo::updatePending(
-  const std::string &fname,
-  ::apache::thrift::protocol::TMessageType mtype,
-  int32_t rseqid)
-{
-  recvPending_ = true;
-  seqidPending_ = rseqid;
-  fnamePending_ = fname;
-  mtypePending_ = mtype;
-  MonitorPtr monitor;
-  {
-    Guard seqidGuard(seqidMutex_);
-    MonitorMap::iterator i = seqidToMonitorMap_.find(rseqid);
-    if(i == seqidToMonitorMap_.end())
-      throwBadSeqId_();
-    monitor = i->second;
-  }
-  monitor->notify();
-}
-
-void TConcurrentClientSyncInfo::waitForWork(int32_t seqid)
-{
-  MonitorPtr m;
-  {
-    Guard seqidGuard(seqidMutex_);
-    m = seqidToMonitorMap_[seqid];
-  }
-  while(true)
-  {
-    // be very careful about setting state in this loop that affects waking up.  You may exit
-    // this function, attempt to grab some work, and someone else could have beaten you (or not
-    // left) the read mutex, and that will put you right back in this loop, with the mangled
-    // state you left behind.
-    if(stop_)
-      throwDeadConnection_();
-    if(wakeupSomeone_)
-      return;
-    if(recvPending_ && seqidPending_ == seqid)
-      return;
-    m->waitForever();
-  }
-}
-
-void TConcurrentClientSyncInfo::throwBadSeqId_()
-{
-  throw apache::thrift::TApplicationException(
-    TApplicationException::BAD_SEQUENCE_ID,
-    "server sent a bad seqid");
-}
-
-void TConcurrentClientSyncInfo::throwDeadConnection_()
-{
-  throw apache::thrift::transport::TTransportException(
-    apache::thrift::transport::TTransportException::NOT_OPEN,
-    "this client died on another thread, and is now in an unusable state");
-}
-
-void TConcurrentClientSyncInfo::wakeupAnyone_(const Guard &)
-{
-  wakeupSomeone_ = true;
-  if(!seqidToMonitorMap_.empty())
-  {
-    // The monitor map maps integers to monitors.  Larger integers are more recent
-    // messages.  Since this is ordered, it means that the last element is the most recent.
-    // We are trying to guess which thread will have its message complete next, so we are picking
-    // the most recent. The oldest message is likely to be some polling, long lived message.
-    // If we guess right, the thread we wake up will handle the message that comes in.
-    // If we guess wrong, the thread we wake up will hand off the work to the correct thread,
-    // costing us an extra context switch.
-    seqidToMonitorMap_.rbegin()->second->notify();
-  }
-}
-
-void TConcurrentClientSyncInfo::markBad_(const Guard &)
-{
-  wakeupSomeone_ = true;
-  stop_ = true;
-  for(MonitorMap::iterator i = seqidToMonitorMap_.begin(); i != seqidToMonitorMap_.end(); ++i)
-    i->second->notify();
-}
-
-TConcurrentClientSyncInfo::MonitorPtr
-TConcurrentClientSyncInfo::newMonitor_(const Guard &)
-{
-  if(freeMonitors_.empty())
-    return MonitorPtr(new Monitor(&readMutex_));
-  MonitorPtr retval;
-  //swapping to avoid an atomic operation
-  retval.swap(freeMonitors_.back());
-  freeMonitors_.pop_back();
-  return retval;
-}
-
-void TConcurrentClientSyncInfo::deleteMonitor_(
-  const Guard &,
-  TConcurrentClientSyncInfo::MonitorPtr &m) /*noexcept*/
-{
-  if(freeMonitors_.size() > MONITOR_CACHE_SIZE)
-  {
-    m.reset();
-    return;
-  }
-  //freeMonitors_ was reserved up to MONITOR_CACHE_SIZE in the ctor,
-  //so this shouldn't throw
-  freeMonitors_.push_back(TConcurrentClientSyncInfo::MonitorPtr());
-  //swapping to avoid an atomic operation
-  m.swap(freeMonitors_.back());
-}
-
-int32_t TConcurrentClientSyncInfo::generateSeqId()
-{
-  Guard seqidGuard(seqidMutex_);
-  if(stop_)
-    throwDeadConnection_();
-
-  if(!seqidToMonitorMap_.empty())
-    if(nextseqid_ == seqidToMonitorMap_.begin()->first)
-      throw apache::thrift::TApplicationException(
-        TApplicationException::BAD_SEQUENCE_ID,
-        "about to repeat a seqid");
-  int32_t newSeqId = nextseqid_++;
-  seqidToMonitorMap_[newSeqId] = newMonitor_(seqidGuard);
-  return newSeqId;
-}
-
-TConcurrentRecvSentry::TConcurrentRecvSentry(TConcurrentClientSyncInfo *sync, int32_t seqid) :
-  sync_(*sync),
-  seqid_(seqid),
-  committed_(false)
-{
-  sync_.getReadMutex().lock();
-}
-
-TConcurrentRecvSentry::~TConcurrentRecvSentry()
-{
-  {
-    Guard seqidGuard(sync_.seqidMutex_);
-    sync_.deleteMonitor_(seqidGuard, sync_.seqidToMonitorMap_[seqid_]);
-
-    sync_.seqidToMonitorMap_.erase(seqid_);
-    if(committed_)
-      sync_.wakeupAnyone_(seqidGuard);
-    else
-      sync_.markBad_(seqidGuard);
-  }
-  sync_.getReadMutex().unlock();
-}
-
-void TConcurrentRecvSentry::commit()
-{
-  committed_ = true;
-}
-
-TConcurrentSendSentry::TConcurrentSendSentry(TConcurrentClientSyncInfo *sync) :
-  sync_(*sync),
-  committed_(false)
-{
-  sync_.getWriteMutex().lock();
-}
-
-TConcurrentSendSentry::~TConcurrentSendSentry()
-{
-  if(!committed_)
-  {
-    Guard seqidGuard(sync_.seqidMutex_);
-    sync_.markBad_(seqidGuard);
-  }
-  sync_.getWriteMutex().unlock();
-}
-
-void TConcurrentSendSentry::commit()
-{
-  committed_ = true;
-}
-
-
-}}} // apache::thrift::async

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
deleted file mode 100644
index 8997a23..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TConcurrentClientSyncInfo.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-#ifndef _THRIFT_TCONCURRENTCLIENTSYNCINFO_H_
-#define _THRIFT_TCONCURRENTCLIENTSYNCINFO_H_ 1
-
-#include <thrift/protocol/TProtocol.h>
-#include <thrift/concurrency/Mutex.h>
-#include <thrift/concurrency/Monitor.h>
-#include <boost/shared_ptr.hpp>
-#include <vector>
-#include <string>
-#include <map>
-
-namespace apache { namespace thrift { namespace async {
-
-class TConcurrentClientSyncInfo;
-
-class TConcurrentSendSentry
-{
-public:
-  explicit TConcurrentSendSentry(TConcurrentClientSyncInfo *sync);
-  ~TConcurrentSendSentry();
-
-  void commit();
-private:
-  TConcurrentClientSyncInfo &sync_;
-  bool committed_;
-};
-
-class TConcurrentRecvSentry
-{
-public:
-  TConcurrentRecvSentry(TConcurrentClientSyncInfo *sync, int32_t seqid);
-  ~TConcurrentRecvSentry();
-
-  void commit();
-private:
-  TConcurrentClientSyncInfo &sync_;
-  int32_t seqid_;
-  bool committed_;
-};
-
-class TConcurrentClientSyncInfo
-{
-private: //typedefs
-  typedef boost::shared_ptr< ::apache::thrift::concurrency::Monitor> MonitorPtr;
-  typedef std::map<int32_t, MonitorPtr> MonitorMap;
-public:
-  TConcurrentClientSyncInfo();
-
-  int32_t generateSeqId();
-
-  bool getPending(
-    std::string &fname,
-    ::apache::thrift::protocol::TMessageType &mtype,
-    int32_t &rseqid); /* requires readMutex_ */
-
-  void updatePending(
-    const std::string &fname,
-    ::apache::thrift::protocol::TMessageType mtype,
-    int32_t rseqid); /* requires readMutex_ */
-
-  void waitForWork(int32_t seqid); /* requires readMutex_ */
-
-  ::apache::thrift::concurrency::Mutex &getReadMutex() {return readMutex_;}
-  ::apache::thrift::concurrency::Mutex &getWriteMutex() {return writeMutex_;}
-
-private: //constants
-  enum {MONITOR_CACHE_SIZE = 10};
-private: //functions
-  MonitorPtr newMonitor_(
-    const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */
-  void deleteMonitor_(
-    const ::apache::thrift::concurrency::Guard &seqidGuard,
-    MonitorPtr &m); /*noexcept*/ /* requires seqidMutex_ */
-  void wakeupAnyone_(
-    const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */
-  void markBad_(
-    const ::apache::thrift::concurrency::Guard &seqidGuard); /* requires seqidMutex_ */
-  void throwBadSeqId_();
-  void throwDeadConnection_();
-private: //data members
-
-  volatile bool stop_;
-
-  ::apache::thrift::concurrency::Mutex seqidMutex_;
-  // begin seqidMutex_ protected members
-  int32_t nextseqid_;
-  MonitorMap seqidToMonitorMap_;
-  std::vector<MonitorPtr> freeMonitors_;
-  // end seqidMutex_ protected members
-
-  ::apache::thrift::concurrency::Mutex writeMutex_;
-
-  ::apache::thrift::concurrency::Mutex readMutex_;
-  // begin readMutex_ protected members
-  bool recvPending_;
-  bool wakeupSomeone_;
-  int32_t seqidPending_;
-  std::string fnamePending_;
-  ::apache::thrift::protocol::TMessageType mtypePending_;
-  // end readMutex_ protected members
-
-
-  friend class TConcurrentSendSentry;
-  friend class TConcurrentRecvSentry;
-};
-
-}}} // apache::thrift::async
-
-#endif // _THRIFT_TCONCURRENTCLIENTSYNCINFO_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
deleted file mode 100644
index 1279bc6..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.cpp
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/async/TEvhttpClientChannel.h>
-#include <evhttp.h>
-#include <event2/buffer.h>
-#include <event2/buffer_compat.h>
-#include <thrift/transport/TBufferTransports.h>
-#include <thrift/protocol/TProtocolException.h>
-
-#include <iostream>
-#include <sstream>
-
-using namespace apache::thrift::protocol;
-using apache::thrift::transport::TTransportException;
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-TEvhttpClientChannel::TEvhttpClientChannel(const std::string& host,
-                                           const std::string& path,
-                                           const char* address,
-                                           int port,
-                                           struct event_base* eb)
-  : host_(host), path_(path), recvBuf_(NULL), conn_(NULL) {
-  conn_ = evhttp_connection_new(address, port);
-  if (conn_ == NULL) {
-    throw TException("evhttp_connection_new failed");
-  }
-  evhttp_connection_set_base(conn_, eb);
-}
-
-TEvhttpClientChannel::~TEvhttpClientChannel() {
-  if (conn_ != NULL) {
-    evhttp_connection_free(conn_);
-  }
-}
-
-void TEvhttpClientChannel::sendAndRecvMessage(const VoidCallback& cob,
-                                              apache::thrift::transport::TMemoryBuffer* sendBuf,
-                                              apache::thrift::transport::TMemoryBuffer* recvBuf) {
-  cob_ = cob;
-  recvBuf_ = recvBuf;
-
-  struct evhttp_request* req = evhttp_request_new(response, this);
-  if (req == NULL) {
-    throw TException("evhttp_request_new failed");
-  }
-
-  int rv;
-
-  rv = evhttp_add_header(req->output_headers, "Host", host_.c_str());
-  if (rv != 0) {
-    throw TException("evhttp_add_header failed");
-  }
-
-  rv = evhttp_add_header(req->output_headers, "Content-Type", "application/x-thrift");
-  if (rv != 0) {
-    throw TException("evhttp_add_header failed");
-  }
-
-  uint8_t* obuf;
-  uint32_t sz;
-  sendBuf->getBuffer(&obuf, &sz);
-  rv = evbuffer_add(req->output_buffer, obuf, sz);
-  if (rv != 0) {
-    throw TException("evbuffer_add failed");
-  }
-
-  rv = evhttp_make_request(conn_, req, EVHTTP_REQ_POST, path_.c_str());
-  if (rv != 0) {
-    throw TException("evhttp_make_request failed");
-  }
-}
-
-void TEvhttpClientChannel::sendMessage(const VoidCallback& cob,
-                                       apache::thrift::transport::TMemoryBuffer* message) {
-  (void)cob;
-  (void)message;
-  throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
-                           "Unexpected call to TEvhttpClientChannel::sendMessage");
-}
-
-void TEvhttpClientChannel::recvMessage(const VoidCallback& cob,
-                                       apache::thrift::transport::TMemoryBuffer* message) {
-  (void)cob;
-  (void)message;
-  throw TProtocolException(TProtocolException::NOT_IMPLEMENTED,
-                           "Unexpected call to TEvhttpClientChannel::recvMessage");
-}
-
-void TEvhttpClientChannel::finish(struct evhttp_request* req) {
-  if (req == NULL) {
-    try {
-      cob_();
-    } catch (const TTransportException& e) {
-      if (e.getType() == TTransportException::END_OF_FILE)
-        throw TException("connect failed");
-      else
-        throw;
-    }
-    return;
-  } else if (req->response_code != 200) {
-    try {
-      cob_();
-    } catch (const TTransportException& e) {
-      std::stringstream ss;
-      ss << "server returned code " << req->response_code;
-      if (req->response_code_line)
-        ss << ": " << req->response_code_line;
-      if (e.getType() == TTransportException::END_OF_FILE)
-        throw TException(ss.str());
-      else
-        throw;
-    }
-    return;
-  }
-  recvBuf_->resetBuffer(EVBUFFER_DATA(req->input_buffer),
-                        static_cast<uint32_t>(EVBUFFER_LENGTH(req->input_buffer)));
-  cob_();
-  return;
-}
-
-/* static */ void TEvhttpClientChannel::response(struct evhttp_request* req, void* arg) {
-  TEvhttpClientChannel* self = (TEvhttpClientChannel*)arg;
-  try {
-    self->finish(req);
-  } catch (std::exception& e) {
-    // don't propagate a C++ exception in C code (e.g. libevent)
-    std::cerr << "TEvhttpClientChannel::response exception thrown (ignored): " << e.what()
-              << std::endl;
-  }
-}
-}
-}
-} // apache::thrift::async

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
deleted file mode 100644
index 72ed40f..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpClientChannel.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TEVHTTP_CLIENT_CHANNEL_H_
-#define _THRIFT_TEVHTTP_CLIENT_CHANNEL_H_ 1
-
-#include <string>
-#include <boost/shared_ptr.hpp>
-#include <thrift/async/TAsyncChannel.h>
-
-struct event_base;
-struct evhttp_connection;
-struct evhttp_request;
-
-namespace apache {
-namespace thrift {
-namespace transport {
-class TMemoryBuffer;
-}
-}
-}
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-class TEvhttpClientChannel : public TAsyncChannel {
-public:
-  using TAsyncChannel::VoidCallback;
-
-  TEvhttpClientChannel(const std::string& host,
-                       const std::string& path,
-                       const char* address,
-                       int port,
-                       struct event_base* eb);
-  ~TEvhttpClientChannel();
-
-  virtual void sendAndRecvMessage(const VoidCallback& cob,
-                                  apache::thrift::transport::TMemoryBuffer* sendBuf,
-                                  apache::thrift::transport::TMemoryBuffer* recvBuf);
-
-  virtual void sendMessage(const VoidCallback& cob,
-                           apache::thrift::transport::TMemoryBuffer* message);
-  virtual void recvMessage(const VoidCallback& cob,
-                           apache::thrift::transport::TMemoryBuffer* message);
-
-  void finish(struct evhttp_request* req);
-
-  // XXX
-  virtual bool good() const { return true; }
-  virtual bool error() const { return false; }
-  virtual bool timedOut() const { return false; }
-
-private:
-  static void response(struct evhttp_request* req, void* arg);
-
-  std::string host_;
-  std::string path_;
-  VoidCallback cob_;
-  apache::thrift::transport::TMemoryBuffer* recvBuf_;
-  struct evhttp_connection* conn_;
-};
-}
-}
-} // apache::thrift::async
-
-#endif // #ifndef _THRIFT_TEVHTTP_CLIENT_CHANNEL_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.cpp
deleted file mode 100644
index 57d0d61..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/async/TEvhttpServer.h>
-#include <thrift/async/TAsyncBufferProcessor.h>
-#include <thrift/transport/TBufferTransports.h>
-#include <evhttp.h>
-#include <event2/buffer.h>
-#include <event2/buffer_compat.h>
-
-#include <iostream>
-
-#ifndef HTTP_INTERNAL // libevent < 2
-#define HTTP_INTERNAL 500
-#endif
-
-using apache::thrift::transport::TMemoryBuffer;
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-struct TEvhttpServer::RequestContext {
-  struct evhttp_request* req;
-  boost::shared_ptr<apache::thrift::transport::TMemoryBuffer> ibuf;
-  boost::shared_ptr<apache::thrift::transport::TMemoryBuffer> obuf;
-
-  RequestContext(struct evhttp_request* req);
-};
-
-TEvhttpServer::TEvhttpServer(boost::shared_ptr<TAsyncBufferProcessor> processor)
-  : processor_(processor), eb_(NULL), eh_(NULL) {
-}
-
-TEvhttpServer::TEvhttpServer(boost::shared_ptr<TAsyncBufferProcessor> processor, int port)
-  : processor_(processor), eb_(NULL), eh_(NULL) {
-  // Create event_base and evhttp.
-  eb_ = event_base_new();
-  if (eb_ == NULL) {
-    throw TException("event_base_new failed");
-  }
-  eh_ = evhttp_new(eb_);
-  if (eh_ == NULL) {
-    event_base_free(eb_);
-    throw TException("evhttp_new failed");
-  }
-
-  // Bind to port.
-  int ret = evhttp_bind_socket(eh_, NULL, port);
-  if (ret < 0) {
-    evhttp_free(eh_);
-    event_base_free(eb_);
-    throw TException("evhttp_bind_socket failed");
-  }
-
-  // Register a handler.  If you use the other constructor,
-  // you will want to do this yourself.
-  // Don't forget to unregister before destorying this TEvhttpServer.
-  evhttp_set_cb(eh_, "/", request, (void*)this);
-}
-
-TEvhttpServer::~TEvhttpServer() {
-  if (eh_ != NULL) {
-    evhttp_free(eh_);
-  }
-  if (eb_ != NULL) {
-    event_base_free(eb_);
-  }
-}
-
-int TEvhttpServer::serve() {
-  if (eb_ == NULL) {
-    throw TException("Unexpected call to TEvhttpServer::serve");
-  }
-  return event_base_dispatch(eb_);
-}
-
-TEvhttpServer::RequestContext::RequestContext(struct evhttp_request* req)
-  : req(req),
-    ibuf(new TMemoryBuffer(EVBUFFER_DATA(req->input_buffer),
-                           static_cast<uint32_t>(EVBUFFER_LENGTH(req->input_buffer)))),
-    obuf(new TMemoryBuffer()) {
-}
-
-void TEvhttpServer::request(struct evhttp_request* req, void* self) {
-  try {
-    static_cast<TEvhttpServer*>(self)->process(req);
-  } catch (std::exception& e) {
-    evhttp_send_reply(req, HTTP_INTERNAL, e.what(), 0);
-  }
-}
-
-void TEvhttpServer::process(struct evhttp_request* req) {
-  RequestContext* ctx = new RequestContext(req);
-  return processor_->process(apache::thrift::stdcxx::bind(&TEvhttpServer::complete,
-                                                          this,
-                                                          ctx,
-                                                          apache::thrift::stdcxx::placeholders::_1),
-                             ctx->ibuf,
-                             ctx->obuf);
-}
-
-void TEvhttpServer::complete(RequestContext* ctx, bool success) {
-  (void)success;
-  std::auto_ptr<RequestContext> ptr(ctx);
-
-  int code = success ? 200 : 400;
-  const char* reason = success ? "OK" : "Bad Request";
-
-  int rv = evhttp_add_header(ctx->req->output_headers, "Content-Type", "application/x-thrift");
-  if (rv != 0) {
-    // TODO: Log an error.
-    std::cerr << "evhttp_add_header failed " << __FILE__ << ":" << __LINE__ << std::endl;
-  }
-
-  struct evbuffer* buf = evbuffer_new();
-  if (buf == NULL) {
-    // TODO: Log an error.
-    std::cerr << "evbuffer_new failed " << __FILE__ << ":" << __LINE__ << std::endl;
-  } else {
-    uint8_t* obuf;
-    uint32_t sz;
-    ctx->obuf->getBuffer(&obuf, &sz);
-    int ret = evbuffer_add(buf, obuf, sz);
-    if (ret != 0) {
-      // TODO: Log an error.
-      std::cerr << "evhttp_add failed with " << ret << " " << __FILE__ << ":" << __LINE__
-                << std::endl;
-    }
-  }
-
-  evhttp_send_reply(ctx->req, code, reason, buf);
-  if (buf != NULL) {
-    evbuffer_free(buf);
-  }
-}
-
-struct event_base* TEvhttpServer::getEventBase() {
-  return eb_;
-}
-}
-}
-} // apache::thrift::async

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.h
deleted file mode 100644
index 89bf337..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TEvhttpServer.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_TEVHTTP_SERVER_H_
-#define _THRIFT_TEVHTTP_SERVER_H_ 1
-
-#include <boost/shared_ptr.hpp>
-
-struct event_base;
-struct evhttp;
-struct evhttp_request;
-
-namespace apache {
-namespace thrift {
-namespace async {
-
-class TAsyncBufferProcessor;
-
-class TEvhttpServer {
-public:
-  /**
-   * Create a TEvhttpServer for use with an external evhttp instance.
-   * Must be manually installed with evhttp_set_cb, using
-   * TEvhttpServer::request as the callback and the
-   * address of the server as the extra arg.
-   * Do not call "serve" on this server.
-   */
-  TEvhttpServer(boost::shared_ptr<TAsyncBufferProcessor> processor);
-
-  /**
-   * Create a TEvhttpServer with an embedded event_base and evhttp,
-   * listening on port and responding on the endpoint "/".
-   * Call "serve" on this server to serve forever.
-   */
-  TEvhttpServer(boost::shared_ptr<TAsyncBufferProcessor> processor, int port);
-
-  ~TEvhttpServer();
-
-  static void request(struct evhttp_request* req, void* self);
-  int serve();
-
-  struct event_base* getEventBase();
-
-private:
-  struct RequestContext;
-
-  void process(struct evhttp_request* req);
-  void complete(RequestContext* ctx, bool success);
-
-  boost::shared_ptr<TAsyncBufferProcessor> processor_;
-  struct event_base* eb_;
-  struct evhttp* eh_;
-};
-}
-}
-} // apache::thrift::async
-
-#endif // #ifndef _THRIFT_TEVHTTP_SERVER_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
deleted file mode 100644
index 6c24d82..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMonitor.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/Monitor.h>
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Util.h>
-#include <thrift/transport/PlatformSocket.h>
-#include <assert.h>
-
-#include <boost/scoped_ptr.hpp>
-#include <boost/thread.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Monitor implementation using the boost thread library
- *
- * @version $Id:$
- */
-class Monitor::Impl : public boost::condition_variable_any {
-
-public:
-  Impl() : ownedMutex_(new Mutex()), mutex_(NULL) { init(ownedMutex_.get()); }
-
-  Impl(Mutex* mutex) : mutex_(NULL) { init(mutex); }
-
-  Impl(Monitor* monitor) : mutex_(NULL) { init(&(monitor->mutex())); }
-
-  Mutex& mutex() { return *mutex_; }
-  void lock() { mutex().lock(); }
-  void unlock() { mutex().unlock(); }
-
-  /**
-   * Exception-throwing version of waitForTimeRelative(), called simply
-   * wait(int64) for historical reasons.  Timeout is in milliseconds.
-   *
-   * If the condition occurs,  this function returns cleanly; on timeout or
-   * error an exception is thrown.
-   */
-  void wait(int64_t timeout_ms) {
-    int result = waitForTimeRelative(timeout_ms);
-    if (result == THRIFT_ETIMEDOUT) {
-      throw TimedOutException();
-    } else if (result != 0) {
-      throw TException("Monitor::wait() failed");
-    }
-  }
-
-  /**
-   * Waits until the specified timeout in milliseconds for the condition to
-   * occur, or waits forever if timeout_ms == 0.
-   *
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTimeRelative(int64_t timeout_ms) {
-    if (timeout_ms == 0LL) {
-      return waitForever();
-    }
-
-    assert(mutex_);
-    boost::timed_mutex* mutexImpl
-        = reinterpret_cast<boost::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    boost::timed_mutex::scoped_lock lock(*mutexImpl, boost::adopt_lock);
-    int res
-        = timed_wait(lock, boost::get_system_time() + boost::posix_time::milliseconds(timeout_ms))
-              ? 0
-              : THRIFT_ETIMEDOUT;
-    lock.release();
-    return res;
-  }
-
-  /**
-   * Waits until the absolute time specified using struct THRIFT_TIMESPEC.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const THRIFT_TIMESPEC* abstime) {
-    struct timeval temp;
-    temp.tv_sec = static_cast<long>(abstime->tv_sec);
-    temp.tv_usec = static_cast<long>(abstime->tv_nsec) / 1000;
-    return waitForTime(&temp);
-  }
-
-  /**
-   * Waits until the absolute time specified using struct timeval.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const struct timeval* abstime) {
-    assert(mutex_);
-    boost::timed_mutex* mutexImpl = static_cast<boost::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    struct timeval currenttime;
-    Util::toTimeval(currenttime, Util::currentTime());
-
-    long tv_sec = static_cast<long>(abstime->tv_sec - currenttime.tv_sec);
-    long tv_usec = static_cast<long>(abstime->tv_usec - currenttime.tv_usec);
-    if (tv_sec < 0)
-      tv_sec = 0;
-    if (tv_usec < 0)
-      tv_usec = 0;
-
-    boost::timed_mutex::scoped_lock lock(*mutexImpl, boost::adopt_lock);
-    int res = timed_wait(lock,
-                         boost::get_system_time() + boost::posix_time::seconds(tv_sec)
-                         + boost::posix_time::microseconds(tv_usec))
-                  ? 0
-                  : THRIFT_ETIMEDOUT;
-    lock.release();
-    return res;
-  }
-
-  /**
-   * Waits forever until the condition occurs.
-   * Returns 0 if condition occurs, or an error code otherwise.
-   */
-  int waitForever() {
-    assert(mutex_);
-    boost::timed_mutex* mutexImpl
-        = reinterpret_cast<boost::timed_mutex*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    boost::timed_mutex::scoped_lock lock(*mutexImpl, boost::adopt_lock);
-    ((boost::condition_variable_any*)this)->wait(lock);
-    lock.release();
-    return 0;
-  }
-
-  void notify() { notify_one(); }
-
-  void notifyAll() { notify_all(); }
-
-private:
-  void init(Mutex* mutex) { mutex_ = mutex; }
-
-  boost::scoped_ptr<Mutex> ownedMutex_;
-  Mutex* mutex_;
-};
-
-Monitor::Monitor() : impl_(new Monitor::Impl()) {
-}
-Monitor::Monitor(Mutex* mutex) : impl_(new Monitor::Impl(mutex)) {
-}
-Monitor::Monitor(Monitor* monitor) : impl_(new Monitor::Impl(monitor)) {
-}
-
-Monitor::~Monitor() {
-  delete impl_;
-}
-
-Mutex& Monitor::mutex() const {
-  return const_cast<Monitor::Impl*>(impl_)->mutex();
-}
-
-void Monitor::lock() const {
-  const_cast<Monitor::Impl*>(impl_)->lock();
-}
-
-void Monitor::unlock() const {
-  const_cast<Monitor::Impl*>(impl_)->unlock();
-}
-
-void Monitor::wait(int64_t timeout) const {
-  const_cast<Monitor::Impl*>(impl_)->wait(timeout);
-}
-
-int Monitor::waitForTime(const THRIFT_TIMESPEC* abstime) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTime(abstime);
-}
-
-int Monitor::waitForTime(const timeval* abstime) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTime(abstime);
-}
-
-int Monitor::waitForTimeRelative(int64_t timeout_ms) const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForTimeRelative(timeout_ms);
-}
-
-int Monitor::waitForever() const {
-  return const_cast<Monitor::Impl*>(impl_)->waitForever();
-}
-
-void Monitor::notify() const {
-  const_cast<Monitor::Impl*>(impl_)->notify();
-}
-
-void Monitor::notifyAll() const {
-  const_cast<Monitor::Impl*>(impl_)->notifyAll();
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMutex.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
deleted file mode 100644
index f7cadab..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostMutex.cpp
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#include <thrift/concurrency/Mutex.h>
-#include <thrift/concurrency/Util.h>
-#include <thrift/Thrift.h>
-
-#include <cassert>
-#include <boost/thread.hpp>
-#include <boost/thread/mutex.hpp>
-#include <boost/date_time/posix_time/posix_time.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Implementation of Mutex class using boost interprocess mutex
- *
- * @version $Id:$
- */
-class Mutex::impl : public boost::timed_mutex {};
-
-Mutex::Mutex(Initializer init) : impl_(new Mutex::impl()) {
-  THRIFT_UNUSED_VARIABLE(init);
-}
-
-void* Mutex::getUnderlyingImpl() const {
-  return impl_.get();
-}
-
-void Mutex::lock() const {
-  impl_->lock();
-}
-
-bool Mutex::trylock() const {
-  return impl_->try_lock();
-}
-
-bool Mutex::timedlock(int64_t ms) const {
-  return impl_->timed_lock(boost::get_system_time() + boost::posix_time::milliseconds(ms));
-}
-
-void Mutex::unlock() const {
-  impl_->unlock();
-}
-
-void Mutex::DEFAULT_INITIALIZER(void* arg) {
-  THRIFT_UNUSED_VARIABLE(arg);
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
deleted file mode 100644
index 96cb6d6..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/thrift-config.h>
-
-#if USE_BOOST_THREAD
-
-#include <thrift/concurrency/BoostThreadFactory.h>
-#include <thrift/concurrency/Exception.h>
-
-#include <cassert>
-
-#include <boost/weak_ptr.hpp>
-#include <boost/thread.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-using boost::shared_ptr;
-using boost::weak_ptr;
-
-/**
- * The boost thread class.
- *
- * @version $Id:$
- */
-class BoostThread : public Thread {
-public:
-  enum STATE { uninitialized, starting, started, stopping, stopped };
-
-  static void* threadMain(void* arg);
-
-private:
-  std::auto_ptr<boost::thread> thread_;
-  STATE state_;
-  weak_ptr<BoostThread> self_;
-  bool detached_;
-
-public:
-  BoostThread(bool detached, shared_ptr<Runnable> runnable)
-    : state_(uninitialized), detached_(detached) {
-    this->Thread::runnable(runnable);
-  }
-
-  ~BoostThread() {
-    if (!detached_) {
-      try {
-        join();
-      } catch (...) {
-        // We're really hosed.
-      }
-    }
-  }
-
-  void start() {
-    if (state_ != uninitialized) {
-      return;
-    }
-
-    // Create reference
-    shared_ptr<BoostThread>* selfRef = new shared_ptr<BoostThread>();
-    *selfRef = self_.lock();
-
-    state_ = starting;
-
-    thread_
-        = std::auto_ptr<boost::thread>(new boost::thread(boost::bind(threadMain, (void*)selfRef)));
-
-    if (detached_)
-      thread_->detach();
-  }
-
-  void join() {
-    if (!detached_ && state_ != uninitialized) {
-      thread_->join();
-    }
-  }
-
-  Thread::id_t getId() { return thread_.get() ? thread_->get_id() : boost::thread::id(); }
-
-  shared_ptr<Runnable> runnable() const { return Thread::runnable(); }
-
-  void runnable(shared_ptr<Runnable> value) { Thread::runnable(value); }
-
-  void weakRef(shared_ptr<BoostThread> self) {
-    assert(self.get() == this);
-    self_ = weak_ptr<BoostThread>(self);
-  }
-};
-
-void* BoostThread::threadMain(void* arg) {
-  shared_ptr<BoostThread> thread = *(shared_ptr<BoostThread>*)arg;
-  delete reinterpret_cast<shared_ptr<BoostThread>*>(arg);
-
-  if (!thread) {
-    return (void*)0;
-  }
-
-  if (thread->state_ != starting) {
-    return (void*)0;
-  }
-
-  thread->state_ = started;
-  thread->runnable()->run();
-
-  if (thread->state_ != stopping && thread->state_ != stopped) {
-    thread->state_ = stopping;
-  }
-  return (void*)0;
-}
-
-/**
- * POSIX Thread factory implementation
- */
-class BoostThreadFactory::Impl {
-
-private:
-  bool detached_;
-
-public:
-  Impl(bool detached) : detached_(detached) {}
-
-  /**
-   * Creates a new POSIX thread to run the runnable object
-   *
-   * @param runnable A runnable object
-   */
-  shared_ptr<Thread> newThread(shared_ptr<Runnable> runnable) const {
-    shared_ptr<BoostThread> result = shared_ptr<BoostThread>(new BoostThread(detached_, runnable));
-    result->weakRef(result);
-    runnable->thread(result);
-    return result;
-  }
-
-  bool isDetached() const { return detached_; }
-
-  void setDetached(bool value) { detached_ = value; }
-
-  Thread::id_t getCurrentThreadId() const { return boost::this_thread::get_id(); }
-};
-
-BoostThreadFactory::BoostThreadFactory(bool detached)
-  : impl_(new BoostThreadFactory::Impl(detached)) {
-}
-
-shared_ptr<Thread> BoostThreadFactory::newThread(shared_ptr<Runnable> runnable) const {
-  return impl_->newThread(runnable);
-}
-
-bool BoostThreadFactory::isDetached() const {
-  return impl_->isDetached();
-}
-
-void BoostThreadFactory::setDetached(bool value) {
-  impl_->setDetached(value);
-}
-
-Thread::id_t BoostThreadFactory::getCurrentThreadId() const {
-  return impl_->getCurrentThreadId();
-}
-}
-}
-} // apache::thrift::concurrency
-
-#endif // USE_BOOST_THREAD

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
deleted file mode 100644
index e6d1a56..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/BoostThreadFactory.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_BOOSTTHREADFACTORY_H_
-#define _THRIFT_CONCURRENCY_BOOSTTHREADFACTORY_H_ 1
-
-#include <thrift/concurrency/Thread.h>
-
-#include <boost/shared_ptr.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * A thread factory to create posix threads
- *
- * @version $Id:$
- */
-class BoostThreadFactory : public ThreadFactory {
-
-public:
-  /**
-   * Boost thread factory.  All threads created by a factory are reference-counted
-   * via boost::shared_ptr and boost::weak_ptr.  The factory guarantees that threads and
-   * the Runnable tasks they host will be properly cleaned up once the last strong reference
-   * to both is given up.
-   *
-   * Threads are created with the specified boost policy, priority, stack-size. A detachable thread
-   * is not joinable.
-   *
-   * By default threads are not joinable.
-   */
-
-  BoostThreadFactory(bool detached = true);
-
-  // From ThreadFactory;
-  boost::shared_ptr<Thread> newThread(boost::shared_ptr<Runnable> runnable) const;
-
-  // From ThreadFactory;
-  Thread::id_t getCurrentThreadId() const;
-
-  /**
-   * Sets detached mode of threads
-   */
-  virtual void setDetached(bool detached);
-
-  /**
-   * Gets current detached mode
-   */
-  virtual bool isDetached() const;
-
-private:
-  class Impl;
-  boost::shared_ptr<Impl> impl_;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_BOOSTTHREADFACTORY_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Exception.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Exception.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Exception.h
deleted file mode 100644
index 6438fda..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Exception.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_
-#define _THRIFT_CONCURRENCY_EXCEPTION_H_ 1
-
-#include <exception>
-#include <thrift/Thrift.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-class NoSuchTaskException : public apache::thrift::TException {};
-
-class UncancellableTaskException : public apache::thrift::TException {};
-
-class InvalidArgumentException : public apache::thrift::TException {};
-
-class IllegalStateException : public apache::thrift::TException {
-public:
-  IllegalStateException() {}
-  IllegalStateException(const std::string& message) : TException(message) {}
-};
-
-class TimedOutException : public apache::thrift::TException {
-public:
-  TimedOutException() : TException("TimedOutException"){};
-  TimedOutException(const std::string& message) : TException(message) {}
-};
-
-class TooManyPendingTasksException : public apache::thrift::TException {
-public:
-  TooManyPendingTasksException() : TException("TooManyPendingTasksException"){};
-  TooManyPendingTasksException(const std::string& message) : TException(message) {}
-};
-
-class SystemResourceException : public apache::thrift::TException {
-public:
-  SystemResourceException() {}
-
-  SystemResourceException(const std::string& message) : TException(message) {}
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/FunctionRunner.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/FunctionRunner.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/FunctionRunner.h
deleted file mode 100644
index b776794..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/FunctionRunner.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H
-#define _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H 1
-
-#include <thrift/cxxfunctional.h>
-#include <thrift/concurrency/Thread.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * Convenient implementation of Runnable that will execute arbitrary callbacks.
- * Interfaces are provided to accept both a generic 'void(void)' callback, and
- * a 'void* (void*)' pthread_create-style callback.
- *
- * Example use:
- *  void* my_thread_main(void* arg);
- *  shared_ptr<ThreadFactory> factory = ...;
- *  // To create a thread that executes my_thread_main once:
- *  shared_ptr<Thread> thread = factory->newThread(
- *    FunctionRunner::create(my_thread_main, some_argument));
- *  thread->start();
- *
- *  bool A::foo();
- *  A* a = new A();
- *  // To create a thread that executes a.foo() every 100 milliseconds:
- *  factory->newThread(FunctionRunner::create(
- *    apache::thrift::stdcxx::bind(&A::foo, a), 100))->start();
- *
- */
-
-class FunctionRunner : public Runnable {
-public:
-  // This is the type of callback 'pthread_create()' expects.
-  typedef void* (*PthreadFuncPtr)(void* arg);
-  // This a fully-generic void(void) callback for custom bindings.
-  typedef apache::thrift::stdcxx::function<void()> VoidFunc;
-
-  typedef apache::thrift::stdcxx::function<bool()> BoolFunc;
-
-  /**
-   * Syntactic sugar to make it easier to create new FunctionRunner
-   * objects wrapped in shared_ptr.
-   */
-  static boost::shared_ptr<FunctionRunner> create(const VoidFunc& cob) {
-    return boost::shared_ptr<FunctionRunner>(new FunctionRunner(cob));
-  }
-
-  static boost::shared_ptr<FunctionRunner> create(PthreadFuncPtr func, void* arg) {
-    return boost::shared_ptr<FunctionRunner>(new FunctionRunner(func, arg));
-  }
-
-private:
-  static void pthread_func_wrapper(PthreadFuncPtr func, void* arg) {
-    // discard return value
-    func(arg);
-  }
-
-public:
-  /**
-   * Given a 'pthread_create' style callback, this FunctionRunner will
-   * execute the given callback.  Note that the 'void*' return value is ignored.
-   */
-  FunctionRunner(PthreadFuncPtr func, void* arg)
-    : func_(apache::thrift::stdcxx::bind(pthread_func_wrapper, func, arg)) {}
-
-  /**
-   * Given a generic callback, this FunctionRunner will execute it.
-   */
-  FunctionRunner(const VoidFunc& cob) : func_(cob) {}
-
-  /**
-   * Given a bool foo(...) type callback, FunctionRunner will execute
-   * the callback repeatedly with 'intervalMs' milliseconds between the calls,
-   * until it returns false. Note that the actual interval between calls will
-   * be intervalMs plus execution time of the callback.
-   */
-  FunctionRunner(const BoolFunc& cob, int intervalMs) : repFunc_(cob), intervalMs_(intervalMs) {}
-
-  void run() {
-    if (repFunc_) {
-      while (repFunc_()) {
-        THRIFT_SLEEP_USEC(intervalMs_ * 1000);
-      }
-    } else {
-      func_();
-    }
-  }
-
-private:
-  VoidFunc func_;
-  BoolFunc repFunc_;
-  int intervalMs_;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.cpp
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.cpp
deleted file mode 100644
index 5e713c0..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#include <thrift/concurrency/Monitor.h>
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Util.h>
-#include <thrift/transport/PlatformSocket.h>
-
-#include <boost/scoped_ptr.hpp>
-
-#include <assert.h>
-
-#include <iostream>
-
-#include <pthread.h>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-using boost::scoped_ptr;
-
-/**
- * Monitor implementation using the POSIX pthread library
- *
- * @version $Id:$
- */
-class Monitor::Impl {
-
-public:
-  Impl() : ownedMutex_(new Mutex()), mutex_(NULL), condInitialized_(false) {
-    init(ownedMutex_.get());
-  }
-
-  Impl(Mutex* mutex) : mutex_(NULL), condInitialized_(false) { init(mutex); }
-
-  Impl(Monitor* monitor) : mutex_(NULL), condInitialized_(false) { init(&(monitor->mutex())); }
-
-  ~Impl() { cleanup(); }
-
-  Mutex& mutex() { return *mutex_; }
-  void lock() { mutex().lock(); }
-  void unlock() { mutex().unlock(); }
-
-  /**
-   * Exception-throwing version of waitForTimeRelative(), called simply
-   * wait(int64) for historical reasons.  Timeout is in milliseconds.
-   *
-   * If the condition occurs,  this function returns cleanly; on timeout or
-   * error an exception is thrown.
-   */
-  void wait(int64_t timeout_ms) const {
-    int result = waitForTimeRelative(timeout_ms);
-    if (result == THRIFT_ETIMEDOUT) {
-      // pthread_cond_timedwait has been observed to return early on
-      // various platforms, so comment out this assert.
-      // assert(Util::currentTime() >= (now + timeout));
-      throw TimedOutException();
-    } else if (result != 0) {
-      throw TException("pthread_cond_wait() or pthread_cond_timedwait() failed");
-    }
-  }
-
-  /**
-   * Waits until the specified timeout in milliseconds for the condition to
-   * occur, or waits forever if timeout_ms == 0.
-   *
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTimeRelative(int64_t timeout_ms) const {
-    if (timeout_ms == 0LL) {
-      return waitForever();
-    }
-
-    struct THRIFT_TIMESPEC abstime;
-    Util::toTimespec(abstime, Util::currentTime() + timeout_ms);
-    return waitForTime(&abstime);
-  }
-
-  /**
-   * Waits until the absolute time specified using struct THRIFT_TIMESPEC.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const THRIFT_TIMESPEC* abstime) const {
-    assert(mutex_);
-    pthread_mutex_t* mutexImpl = reinterpret_cast<pthread_mutex_t*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-
-    // XXX Need to assert that caller owns mutex
-    return pthread_cond_timedwait(&pthread_cond_, mutexImpl, abstime);
-  }
-
-  int waitForTime(const struct timeval* abstime) const {
-    struct THRIFT_TIMESPEC temp;
-    temp.tv_sec = abstime->tv_sec;
-    temp.tv_nsec = abstime->tv_usec * 1000;
-    return waitForTime(&temp);
-  }
-  /**
-   * Waits forever until the condition occurs.
-   * Returns 0 if condition occurs, or an error code otherwise.
-   */
-  int waitForever() const {
-    assert(mutex_);
-    pthread_mutex_t* mutexImpl = reinterpret_cast<pthread_mutex_t*>(mutex_->getUnderlyingImpl());
-    assert(mutexImpl);
-    return pthread_cond_wait(&pthread_cond_, mutexImpl);
-  }
-
-  void notify() {
-    // XXX Need to assert that caller owns mutex
-    int iret = pthread_cond_signal(&pthread_cond_);
-    THRIFT_UNUSED_VARIABLE(iret);
-    assert(iret == 0);
-  }
-
-  void notifyAll() {
-    // XXX Need to assert that caller owns mutex
-    int iret = pthread_cond_broadcast(&pthread_cond_);
-    THRIFT_UNUSED_VARIABLE(iret);
-    assert(iret == 0);
-  }
-
-private:
-  void init(Mutex* mutex) {
-    mutex_ = mutex;
-
-    if (pthread_cond_init(&pthread_cond_, NULL) == 0) {
-      condInitialized_ = true;
-    }
-
-    if (!condInitialized_) {
-      cleanup();
-      throw SystemResourceException();
-    }
-  }
-
-  void cleanup() {
-    if (condInitialized_) {
-      condInitialized_ = false;
-      int iret = pthread_cond_destroy(&pthread_cond_);
-      THRIFT_UNUSED_VARIABLE(iret);
-      assert(iret == 0);
-    }
-  }
-
-  scoped_ptr<Mutex> ownedMutex_;
-  Mutex* mutex_;
-
-  mutable pthread_cond_t pthread_cond_;
-  mutable bool condInitialized_;
-};
-
-Monitor::Monitor() : impl_(new Monitor::Impl()) {
-}
-Monitor::Monitor(Mutex* mutex) : impl_(new Monitor::Impl(mutex)) {
-}
-Monitor::Monitor(Monitor* monitor) : impl_(new Monitor::Impl(monitor)) {
-}
-
-Monitor::~Monitor() {
-  delete impl_;
-}
-
-Mutex& Monitor::mutex() const {
-  return impl_->mutex();
-}
-
-void Monitor::lock() const {
-  impl_->lock();
-}
-
-void Monitor::unlock() const {
-  impl_->unlock();
-}
-
-void Monitor::wait(int64_t timeout) const {
-  impl_->wait(timeout);
-}
-
-int Monitor::waitForTime(const THRIFT_TIMESPEC* abstime) const {
-  return impl_->waitForTime(abstime);
-}
-
-int Monitor::waitForTime(const timeval* abstime) const {
-  return impl_->waitForTime(abstime);
-}
-
-int Monitor::waitForTimeRelative(int64_t timeout_ms) const {
-  return impl_->waitForTimeRelative(timeout_ms);
-}
-
-int Monitor::waitForever() const {
-  return impl_->waitForever();
-}
-
-void Monitor::notify() const {
-  impl_->notify();
-}
-
-void Monitor::notifyAll() const {
-  impl_->notifyAll();
-}
-}
-}
-} // apache::thrift::concurrency

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.h
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.h
deleted file mode 100644
index 5472f85..0000000
--- a/depends/thirdparty/thrift/lib/cpp/src/thrift/concurrency/Monitor.h
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifndef _THRIFT_CONCURRENCY_MONITOR_H_
-#define _THRIFT_CONCURRENCY_MONITOR_H_ 1
-
-#include <thrift/concurrency/Exception.h>
-#include <thrift/concurrency/Mutex.h>
-
-#include <boost/utility.hpp>
-
-namespace apache {
-namespace thrift {
-namespace concurrency {
-
-/**
- * A monitor is a combination mutex and condition-event.  Waiting and
- * notifying condition events requires that the caller own the mutex.  Mutex
- * lock and unlock operations can be performed independently of condition
- * events.  This is more or less analogous to java.lang.Object multi-thread
- * operations.
- *
- * Note the Monitor can create a new, internal mutex; alternatively, a
- * separate Mutex can be passed in and the Monitor will re-use it without
- * taking ownership.  It's the user's responsibility to make sure that the
- * Mutex is not deallocated before the Monitor.
- *
- * Note that all methods are const.  Monitors implement logical constness, not
- * bit constness.  This allows const methods to call monitor methods without
- * needing to cast away constness or change to non-const signatures.
- *
- * @version $Id:$
- */
-class Monitor : boost::noncopyable {
-public:
-  /** Creates a new mutex, and takes ownership of it. */
-  Monitor();
-
-  /** Uses the provided mutex without taking ownership. */
-  explicit Monitor(Mutex* mutex);
-
-  /** Uses the mutex inside the provided Monitor without taking ownership. */
-  explicit Monitor(Monitor* monitor);
-
-  /** Deallocates the mutex only if we own it. */
-  virtual ~Monitor();
-
-  Mutex& mutex() const;
-
-  virtual void lock() const;
-
-  virtual void unlock() const;
-
-  /**
-   * Waits a maximum of the specified timeout in milliseconds for the condition
-   * to occur, or waits forever if timeout_ms == 0.
-   *
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTimeRelative(int64_t timeout_ms) const;
-
-  /**
-   * Waits until the absolute time specified using struct THRIFT_TIMESPEC.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const THRIFT_TIMESPEC* abstime) const;
-
-  /**
-   * Waits until the absolute time specified using struct timeval.
-   * Returns 0 if condition occurs, THRIFT_ETIMEDOUT on timeout, or an error code.
-   */
-  int waitForTime(const struct timeval* abstime) const;
-
-  /**
-   * Waits forever until the condition occurs.
-   * Returns 0 if condition occurs, or an error code otherwise.
-   */
-  int waitForever() const;
-
-  /**
-   * Exception-throwing version of waitForTimeRelative(), called simply
-   * wait(int64) for historical reasons.  Timeout is in milliseconds.
-   *
-   * If the condition occurs,  this function returns cleanly; on timeout or
-   * error an exception is thrown.
-   */
-  void wait(int64_t timeout_ms = 0LL) const;
-
-  /** Wakes up one thread waiting on this monitor. */
-  virtual void notify() const;
-
-  /** Wakes up all waiting threads on this monitor. */
-  virtual void notifyAll() const;
-
-private:
-  class Impl;
-
-  Impl* impl_;
-};
-
-class Synchronized {
-public:
-  Synchronized(const Monitor* monitor) : g(monitor->mutex()) {}
-  Synchronized(const Monitor& monitor) : g(monitor.mutex()) {}
-
-private:
-  Guard g;
-};
-}
-}
-} // apache::thrift::concurrency
-
-#endif // #ifndef _THRIFT_CONCURRENCY_MONITOR_H_


[44/54] [partial] incubator-hawq git commit: HAWQ-959. revert thrift build commands.

Posted by es...@apache.org.
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/compiler/cpp/src/generate/t_c_glib_generator.cc
----------------------------------------------------------------------
diff --git a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_c_glib_generator.cc b/depends/thirdparty/thrift/compiler/cpp/src/generate/t_c_glib_generator.cc
deleted file mode 100644
index 47aa4d2..0000000
--- a/depends/thirdparty/thrift/compiler/cpp/src/generate/t_c_glib_generator.cc
+++ /dev/null
@@ -1,4565 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- * Contains some contributions under the Thrift Software License.
- * Please see doc/old-thrift-license.txt in the Thrift distribution for
- * details.
- */
-
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-
-#include <ctype.h>
-
-#include "platform.h"
-#include "t_oop_generator.h"
-
-using std::map;
-using std::ofstream;
-using std::ostringstream;
-using std::string;
-using std::stringstream;
-using std::vector;
-
-static const string endl = "\n"; // avoid ostream << std::endl flushes
-
-/* forward declarations */
-string initial_caps_to_underscores(string name);
-string underscores_to_initial_caps(string name);
-string to_upper_case(string name);
-string to_lower_case(string name);
-
-/**
- * C code generator, using glib for C typing.
- */
-class t_c_glib_generator : public t_oop_generator {
-public:
-  /* constructor */
-  t_c_glib_generator(t_program* program,
-                     const map<string, string>& parsed_options,
-                     const string& option_string)
-    : t_oop_generator(program) {
-    (void)parsed_options;
-    (void)option_string;
-    /* set the output directory */
-    this->out_dir_base_ = "gen-c_glib";
-
-    /* set the namespace */
-    this->nspace = program_->get_namespace("c_glib");
-
-    if (this->nspace.empty()) {
-      this->nspace = "";
-      this->nspace_u = "";
-      this->nspace_uc = "";
-      this->nspace_lc = "";
-    } else {
-      /* replace dots with underscores */
-      char* tmp = strdup(this->nspace.c_str());
-      for (unsigned int i = 0; i < strlen(tmp); i++) {
-        if (tmp[i] == '.') {
-          tmp[i] = '_';
-        }
-      }
-      this->nspace = string(tmp, strlen(tmp));
-      free(tmp);
-
-      /* clean up the namespace for C.
-       * An input of 'namespace foo' should result in:
-       *  - nspace = foo       - for thrift objects and typedefs
-       *  - nspace_u = Foo     - for internal GObject prefixes
-       *  - nspace_uc = FOO_   - for macro prefixes
-       *  - nspace_lc = foo_   - for filename and method prefixes
-       * The underscores are there since uc and lc strings are used as file and
-       * variable prefixes.
-       */
-      this->nspace_u = initial_caps_to_underscores(this->nspace);
-      this->nspace_uc = to_upper_case(this->nspace_u) + "_";
-      this->nspace_lc = to_lower_case(this->nspace_u) + "_";
-    }
-  }
-
-  /* initialization and destruction */
-  void init_generator();
-  void close_generator();
-
-  /* generation functions */
-  void generate_typedef(t_typedef* ttypedef);
-  void generate_enum(t_enum* tenum);
-  void generate_consts(vector<t_const*> consts);
-  void generate_struct(t_struct* tstruct);
-  void generate_service(t_service* tservice);
-  void generate_xception(t_struct* tstruct);
-
-private:
-  /* file streams */
-  ofstream f_types_;
-  ofstream f_types_impl_;
-  ofstream f_header_;
-  ofstream f_service_;
-
-  /* namespace variables */
-  string nspace;
-  string nspace_u;
-  string nspace_uc;
-  string nspace_lc;
-
-  /* helper functions */
-  bool is_complex_type(t_type* ttype);
-  string type_name(t_type* ttype, bool in_typedef = false, bool is_const = false);
-  string property_type_name(t_type* ttype, bool in_typedef = false, bool is_const = false);
-  string base_type_name(t_base_type* type);
-  string type_to_enum(t_type* type);
-  string constant_literal(t_type* type, t_const_value* value);
-  string constant_value(string name, t_type* type, t_const_value* value);
-  string function_signature(t_function* tfunction);
-  string argument_list(t_struct* tstruct);
-  string xception_list(t_struct* tstruct);
-  string declare_field(t_field* tfield,
-                       bool init = false,
-                       bool pointer = false,
-                       bool constant = false,
-                       bool reference = false);
-  void declare_local_variable(ofstream& out, t_type* ttype, string& base_name);
-
-  /* generation functions */
-  void generate_const_initializer(string name, t_type* type, t_const_value* value);
-  void generate_service_helpers(t_service* tservice);
-  void generate_service_client(t_service* tservice);
-  void generate_service_handler(t_service* tservice);
-  void generate_service_processor(t_service* tservice);
-  void generate_service_server(t_service* tservice);
-  void generate_object(t_struct* tstruct);
-  void generate_struct_writer(ofstream& out,
-                              t_struct* tstruct,
-                              string this_name,
-                              string this_get = "",
-                              bool is_function = true);
-  void generate_struct_reader(ofstream& out,
-                              t_struct* tstruct,
-                              string this_name,
-                              string this_get = "",
-                              bool is_function = true);
-
-  void generate_serialize_field(ofstream& out,
-                                t_field* tfield,
-                                string prefix,
-                                string suffix,
-                                int error_ret);
-  void generate_serialize_struct(ofstream& out, t_struct* tstruct, string prefix, int error_ret);
-  void generate_serialize_container(ofstream& out, t_type* ttype, string prefix, int error_ret);
-  void generate_serialize_map_element(ofstream& out,
-                                      t_map* tmap,
-                                      string key,
-                                      string value,
-                                      int error_ret);
-  void generate_serialize_set_element(ofstream& out, t_set* tset, string element, int error_ret);
-  void generate_serialize_list_element(ofstream& out,
-                                       t_list* tlist,
-                                       string list,
-                                       string index,
-                                       int error_ret);
-
-  void generate_deserialize_field(ofstream& out,
-                                  t_field* tfield,
-                                  string prefix,
-                                  string suffix,
-                                  int error_ret,
-                                  bool allocate = true);
-  void generate_deserialize_struct(ofstream& out,
-                                   t_struct* tstruct,
-                                   string prefix,
-                                   int error_ret,
-                                   bool allocate = true);
-  void generate_deserialize_container(ofstream& out, t_type* ttype, string prefix, int error_ret);
-  void generate_deserialize_map_element(ofstream& out, t_map* tmap, string prefix, int error_ret);
-  void generate_deserialize_set_element(ofstream& out, t_set* tset, string prefix, int error_ret);
-  void generate_deserialize_list_element(ofstream& out,
-                                         t_list* tlist,
-                                         string prefix,
-                                         string index,
-                                         int error_ret);
-
-  string generate_new_hash_from_type(t_type* key, t_type* value);
-  string generate_new_array_from_type(t_type* ttype);
-
-  string generate_free_func_from_type(t_type* ttype);
-  string generate_hash_func_from_type(t_type* ttype);
-  string generate_cmp_func_from_type(t_type* ttype);
-};
-
-/**
- * Prepare for file generation by opening up the necessary file
- * output streams.
- */
-void t_c_glib_generator::init_generator() {
-  /* create output directory */
-  MKDIR(get_out_dir().c_str());
-
-  string program_name_u = initial_caps_to_underscores(program_name_);
-  string program_name_uc = to_upper_case(program_name_u);
-  string program_name_lc = to_lower_case(program_name_u);
-
-  /* create output files */
-  string f_types_name = get_out_dir() + this->nspace_lc + program_name_lc + "_types.h";
-  f_types_.open(f_types_name.c_str());
-  string f_types_impl_name = get_out_dir() + this->nspace_lc + program_name_lc + "_types.c";
-  f_types_impl_.open(f_types_impl_name.c_str());
-
-  /* add thrift boilerplate headers */
-  f_types_ << autogen_comment();
-  f_types_impl_ << autogen_comment();
-
-  /* include inclusion guard */
-  f_types_ << "#ifndef " << this->nspace_uc << program_name_uc << "_TYPES_H" << endl << "#define "
-           << this->nspace_uc << program_name_uc << "_TYPES_H" << endl << endl;
-
-  /* include base types */
-  f_types_ << "/* base includes */" << endl << "#include <glib-object.h>" << endl
-           << "#include <thrift/c_glib/thrift_struct.h>" << endl
-           << "#include <thrift/c_glib/protocol/thrift_protocol.h>" << endl;
-
-  /* include other thrift includes */
-  const vector<t_program*>& includes = program_->get_includes();
-  for (size_t i = 0; i < includes.size(); ++i) {
-    f_types_ << "/* other thrift includes */" << endl << "#include \"" << this->nspace_lc
-             << initial_caps_to_underscores(includes[i]->get_name()) << "_types.h\"" << endl;
-  }
-  f_types_ << endl;
-
-  /* include custom headers */
-  const vector<string>& c_includes = program_->get_c_includes();
-  f_types_ << "/* custom thrift includes */" << endl;
-  for (size_t i = 0; i < c_includes.size(); ++i) {
-    if (c_includes[i][0] == '<') {
-      f_types_ << "#include " << c_includes[i] << endl;
-    } else {
-      f_types_ << "#include \"" << c_includes[i] << "\"" << endl;
-    }
-  }
-  f_types_ << endl;
-
-  /* include math.h (for "INFINITY") in the implementation file, in case we
-     encounter a struct with a member of type double */
-  f_types_impl_ << endl << "#include <math.h>" << endl;
-
-  // include the types file
-  f_types_impl_ << endl << "#include \"" << this->nspace_lc << program_name_u << "_types.h\""
-                << endl << "#include <thrift/c_glib/thrift.h>" << endl << endl;
-
-  f_types_ << "/* begin types */" << endl << endl;
-}
-
-/**
- *  Finish up generation and close all file streams.
- */
-void t_c_glib_generator::close_generator() {
-  string program_name_uc = to_upper_case(initial_caps_to_underscores(program_name_));
-
-  /* end the header inclusion guard */
-  f_types_ << "#endif /* " << this->nspace_uc << program_name_uc << "_TYPES_H */" << endl;
-
-  /* close output file */
-  f_types_.close();
-  f_types_impl_.close();
-}
-
-/**
- * Generates a Thrift typedef in C code.  For example:
- *
- * Thrift:
- * typedef map<i32,i32> SomeMap
- *
- * C:
- * typedef GHashTable * ThriftSomeMap;
- */
-void t_c_glib_generator::generate_typedef(t_typedef* ttypedef) {
-  f_types_ << indent() << "typedef " << type_name(ttypedef->get_type(), true) << " " << this->nspace
-           << ttypedef->get_symbolic() << ";" << endl << endl;
-}
-
-/**
- * Generates a C enumeration.  For example:
- *
- * Thrift:
- * enum MyEnum {
- *   ONE = 1,
- *   TWO
- * }
- *
- * C:
- * enum _ThriftMyEnum {
- *   THRIFT_MY_ENUM_ONE = 1,
- *   THRIFT_MY_ENUM_TWO
- * };
- * typedef enum _ThriftMyEnum ThriftMyEnum;
- */
-void t_c_glib_generator::generate_enum(t_enum* tenum) {
-  string name = tenum->get_name();
-  string name_uc = to_upper_case(initial_caps_to_underscores(name));
-
-  f_types_ << indent() << "enum _" << this->nspace << name << " {" << endl;
-
-  indent_up();
-
-  vector<t_enum_value*> constants = tenum->get_constants();
-  vector<t_enum_value*>::iterator c_iter;
-  bool first = true;
-
-  /* output each of the enumeration elements */
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    if (first) {
-      first = false;
-    } else {
-      f_types_ << "," << endl;
-    }
-
-    f_types_ << indent() << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name();
-    f_types_ << " = " << (*c_iter)->get_value();
-  }
-
-  indent_down();
-  f_types_ << endl << "};" << endl << "typedef enum _" << this->nspace << name << " "
-           << this->nspace << name << ";" << endl << endl;
-
-  f_types_ << "/* return the name of the constant */" << endl;
-  f_types_ << "const char *" << endl;
-  f_types_ << "toString_" << name << "(int value); " << endl << endl;
-  ;
-  f_types_impl_ << "/* return the name of the constant */" << endl;
-  f_types_impl_ << "const char *" << endl;
-  f_types_impl_ << "toString_" << name << "(int value) " << endl;
-  f_types_impl_ << "{" << endl;
-  f_types_impl_ << "  static __thread char buf[16] = {0};" << endl;
-  f_types_impl_ << "  switch(value) {" << endl;
-  for (c_iter = constants.begin(); c_iter != constants.end(); ++c_iter) {
-    f_types_impl_ << "  case " << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name() << ":"
-                  << "return \"" << this->nspace_uc << name_uc << "_" << (*c_iter)->get_name()
-                  << "\";" << endl;
-  }
-  f_types_impl_ << "  default: g_snprintf(buf, 16, \"%d\", value); return buf;" << endl;
-  f_types_impl_ << "  }" << endl;
-  f_types_impl_ << "}" << endl << endl;
-}
-
-/**
- * Generates Thrift constants in C code.
- */
-void t_c_glib_generator::generate_consts(vector<t_const*> consts) {
-  f_types_ << "/* constants */" << endl;
-  f_types_impl_ << "/* constants */" << endl;
-
-  vector<t_const*>::iterator c_iter;
-  for (c_iter = consts.begin(); c_iter != consts.end(); ++c_iter) {
-    string name = (*c_iter)->get_name();
-    string name_uc = to_upper_case(name);
-    string name_lc = to_lower_case(name);
-    t_type* type = (*c_iter)->get_type();
-    t_const_value* value = (*c_iter)->get_value();
-
-    f_types_ << indent() << "#define " << this->nspace_uc << name_uc << " "
-             << constant_value(name_lc, type, value) << endl;
-
-    generate_const_initializer(name_lc, type, value);
-  }
-
-  f_types_ << endl;
-  f_types_impl_ << endl;
-}
-
-/**
- * Generate Thrift structs in C code, as GObjects.  Example:
- *
- * Thrift:
- * struct Bonk
- * {
- *   1: string message,
- *   2: i32 type
- * }
- *
- * C GObject instance header:
- * struct _ThriftBonk
- * {
- *   GObject parent;
- *
- *   gchar * message;
- *   gint32 type;
- * };
- * typedef struct _ThriftBonk ThriftBonk
- * // ... additional GObject boilerplate ...
- */
-void t_c_glib_generator::generate_struct(t_struct* tstruct) {
-  f_types_ << "/* struct " << tstruct->get_name() << " */" << endl;
-  generate_object(tstruct);
-}
-
-/**
- * Generate C code to represent Thrift services.  Creates a new GObject
- * which can be used to access the service.
- */
-void t_c_glib_generator::generate_service(t_service* tservice) {
-  string svcname_u = initial_caps_to_underscores(tservice->get_name());
-  string svcname_uc = this->nspace_uc + to_upper_case(svcname_u);
-  string filename = this->nspace_lc + to_lower_case(svcname_u);
-
-  // make output files
-  string f_header_name = get_out_dir() + filename + ".h";
-  f_header_.open(f_header_name.c_str());
-
-  string program_name_u = initial_caps_to_underscores(program_name_);
-  string program_name_lc = to_lower_case(program_name_u);
-
-  // add header file boilerplate
-  f_header_ << autogen_comment();
-
-  // add an inclusion guard
-  f_header_ << "#ifndef " << svcname_uc << "_H" << endl << "#define " << svcname_uc << "_H" << endl
-            << endl;
-
-  // add standard includes
-  f_header_ << "#include <thrift/c_glib/processor/thrift_dispatch_processor.h>" << endl << endl;
-  f_header_ << "#include \"" << this->nspace_lc << program_name_lc << "_types.h\"" << endl;
-
-  // if we are inheriting from another service, include its header
-  t_service* extends_service = tservice->get_extends();
-  if (extends_service != NULL) {
-    f_header_ << "#include \"" << this->nspace_lc
-              << to_lower_case(initial_caps_to_underscores(extends_service->get_name())) << ".h\""
-              << endl;
-  }
-  f_header_ << endl;
-
-  // create the service implementation
-  string f_service_name = get_out_dir() + filename + ".c";
-  f_service_.open(f_service_name.c_str());
-
-  // add the boilerplace header
-  f_service_ << autogen_comment();
-
-  // include the headers
-  f_service_ << "#include <string.h>" << endl << "#include <thrift/c_glib/thrift.h>" << endl
-             << "#include <thrift/c_glib/thrift_application_exception.h>" << endl << "#include \""
-             << filename << ".h\"" << endl << endl;
-
-  // generate the service-helper classes
-  generate_service_helpers(tservice);
-
-  // generate the client objects
-  generate_service_client(tservice);
-
-  // generate the server objects
-  generate_service_server(tservice);
-
-  // end the header inclusion guard
-  f_header_ << "#endif /* " << svcname_uc << "_H */" << endl;
-
-  // close the files
-  f_service_.close();
-  f_header_.close();
-}
-
-/**
- *
- */
-void t_c_glib_generator::generate_xception(t_struct* tstruct) {
-  string name = tstruct->get_name();
-  string name_u = initial_caps_to_underscores(name);
-  string name_lc = to_lower_case(name_u);
-  string name_uc = to_upper_case(name_u);
-
-  generate_object(tstruct);
-
-  f_types_ << "/* exception */" << endl
-           << "typedef enum" << endl
-           << "{" << endl;
-  indent_up();
-  f_types_ << indent() << this->nspace_uc << name_uc << "_ERROR_CODE" << endl;
-  indent_down();
-  f_types_ << "} " << this->nspace << name << "Error;" << endl
-           << endl
-           << "GQuark " << this->nspace_lc << name_lc
-           << "_error_quark (void);" << endl
-           << "#define " << this->nspace_uc << name_uc << "_ERROR ("
-           << this->nspace_lc << name_lc << "_error_quark())" << endl
-           << endl
-           << endl;
-
-  f_types_impl_ << "/* define the GError domain for exceptions */" << endl << "#define "
-                << this->nspace_uc << name_uc << "_ERROR_DOMAIN \"" << this->nspace_lc << name_lc
-                << "_error_quark\"" << endl << "GQuark" << endl << this->nspace_lc << name_lc
-                << "_error_quark (void)" << endl << "{" << endl
-                << "  return g_quark_from_static_string (" << this->nspace_uc << name_uc
-                << "_ERROR_DOMAIN);" << endl << "}" << endl << endl;
-}
-
-/********************
- * HELPER FUNCTIONS *
- ********************/
-
-/**
- * Returns true if ttype is not a primitive.
- */
-bool t_c_glib_generator::is_complex_type(t_type* ttype) {
-  ttype = get_true_type(ttype);
-
-  return ttype->is_container() || ttype->is_struct() || ttype->is_xception();
-}
-
-/**
- * Maps a Thrift t_type to a C type.
- */
-string t_c_glib_generator::type_name(t_type* ttype, bool in_typedef, bool is_const) {
-  if (ttype->is_base_type()) {
-    string bname = base_type_name((t_base_type*)ttype);
-
-    if (is_const) {
-      return "const " + bname;
-    } else {
-      return bname;
-    }
-  }
-
-  if (ttype->is_container()) {
-    string cname;
-
-    t_container* tcontainer = (t_container*)ttype;
-    if (tcontainer->has_cpp_name()) {
-      cname = tcontainer->get_cpp_name();
-    } else if (ttype->is_map()) {
-      cname = "GHashTable";
-    } else if (ttype->is_set()) {
-      // since a set requires unique elements, use a GHashTable, and
-      // populate the keys and values with the same data, using keys for
-      // the actual writes and reads.
-      // TODO: discuss whether or not to implement TSet, THashSet or GHashSet
-      cname = "GHashTable";
-    } else if (ttype->is_list()) {
-      // TODO: investigate other implementations besides GPtrArray
-      cname = "GPtrArray";
-      t_type* etype = ((t_list*)ttype)->get_elem_type();
-      if (etype->is_base_type()) {
-        t_base_type::t_base tbase = ((t_base_type*)etype)->get_base();
-        switch (tbase) {
-        case t_base_type::TYPE_VOID:
-          throw "compiler error: cannot determine array type";
-        case t_base_type::TYPE_BOOL:
-        case t_base_type::TYPE_BYTE:
-        case t_base_type::TYPE_I16:
-        case t_base_type::TYPE_I32:
-        case t_base_type::TYPE_I64:
-        case t_base_type::TYPE_DOUBLE:
-          cname = "GArray";
-          break;
-        case t_base_type::TYPE_STRING:
-          break;
-        default:
-          throw "compiler error: no array info for type";
-        }
-      }
-    }
-
-    /* Omit the dereference operator if we are aliasing this type within a
-       typedef, to allow the type to be used more naturally in client code;
-       otherwise, include it */
-    if (!in_typedef) {
-      cname += " *";
-    }
-
-    if (is_const) {
-      return "const " + cname;
-    } else {
-      return cname;
-    }
-  }
-
-  // check for a namespace
-  string pname = this->nspace + ttype->get_name();
-
-  if (is_complex_type(ttype)) {
-    pname += " *";
-  }
-
-  if (is_const) {
-    return "const " + pname;
-  } else {
-    return pname;
-  }
-}
-
-/**
- * Maps a Thrift primitive to the type needed to hold its value when used as an
- * object property.
- *
- * This method is needed because all integer properties of width less than 64
- * bits map to the same type, gint, as opposed to their width-specific type
- * (gint8, gint16 or gint32).
- */
-string t_c_glib_generator::property_type_name(t_type* ttype, bool in_typedef, bool is_const) {
-  string result;
-
-  if (ttype->is_base_type()) {
-    switch (((t_base_type*)ttype)->get_base()) {
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-      if (is_const) {
-        result = "const gint";
-      } else {
-        result = "gint";
-      }
-      break;
-
-    default:
-      result = type_name(ttype, in_typedef, is_const);
-    }
-  } else {
-    result = type_name(ttype, in_typedef, is_const);
-  }
-
-  return result;
-}
-
-/**
- * Maps a Thrift primitive to a C primitive.
- */
-string t_c_glib_generator::base_type_name(t_base_type* type) {
-  t_base_type::t_base tbase = type->get_base();
-
-  switch (tbase) {
-  case t_base_type::TYPE_VOID:
-    return "void";
-  case t_base_type::TYPE_STRING:
-    if (type->is_binary()) {
-      return "GByteArray *";
-    } else {
-      return "gchar *";
-    }
-  case t_base_type::TYPE_BOOL:
-    return "gboolean";
-  case t_base_type::TYPE_BYTE:
-    return "gint8";
-  case t_base_type::TYPE_I16:
-    return "gint16";
-  case t_base_type::TYPE_I32:
-    return "gint32";
-  case t_base_type::TYPE_I64:
-    return "gint64";
-  case t_base_type::TYPE_DOUBLE:
-    return "gdouble";
-  default:
-    throw "compiler error: no C base type name for base type " + t_base_type::t_base_name(tbase);
-  }
-}
-
-/**
- * Returns a member of the ThriftType C enumeration in thrift_protocol.h
- * for a Thrift type.
- */
-string t_c_glib_generator::type_to_enum(t_type* type) {
-  type = get_true_type(type);
-
-  if (type->is_base_type()) {
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-
-    switch (tbase) {
-    case t_base_type::TYPE_VOID:
-      throw "NO T_VOID CONSTRUCT";
-    case t_base_type::TYPE_STRING:
-      return "T_STRING";
-    case t_base_type::TYPE_BOOL:
-      return "T_BOOL";
-    case t_base_type::TYPE_BYTE:
-      return "T_BYTE";
-    case t_base_type::TYPE_I16:
-      return "T_I16";
-    case t_base_type::TYPE_I32:
-      return "T_I32";
-    case t_base_type::TYPE_I64:
-      return "T_I64";
-    case t_base_type::TYPE_DOUBLE:
-      return "T_DOUBLE";
-    }
-  } else if (type->is_enum()) {
-    return "T_I32";
-  } else if (type->is_struct()) {
-    return "T_STRUCT";
-  } else if (type->is_xception()) {
-    return "T_STRUCT";
-  } else if (type->is_map()) {
-    return "T_MAP";
-  } else if (type->is_set()) {
-    return "T_SET";
-  } else if (type->is_list()) {
-    return "T_LIST";
-  }
-
-  throw "INVALID TYPE IN type_to_enum: " + type->get_name();
-}
-
-/**
- * Returns a Thrift constant formatted as a literal for inclusion in C code.
- */
-string t_c_glib_generator::constant_literal(t_type* type, t_const_value* value) {
-  ostringstream render;
-
-  if (type->is_base_type()) {
-    /* primitives */
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << "\"" + value->get_string() + "\"";
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() != 0) ? "TRUE" : "FALSE");
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      render << value->get_double();
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else {
-    t_const_value::t_const_value_type value_type = value->get_type();
-
-    switch (value_type) {
-    case t_const_value::CV_IDENTIFIER:
-      render << value->get_integer();
-      break;
-    case t_const_value::CV_LIST:
-      render << "{ ";
-      {
-        t_type* elem_type = ((t_list*)type)->get_elem_type();
-        const vector<t_const_value*>& list = value->get_list();
-        vector<t_const_value*>::const_iterator list_iter;
-
-        if (list.size() > 0) {
-          list_iter = list.begin();
-          render << constant_literal(elem_type, *list_iter);
-
-          while (++list_iter != list.end()) {
-            render << ", " << constant_literal(elem_type, *list_iter);
-          }
-        }
-      }
-      render << " }";
-      break;
-    case t_const_value::CV_MAP:
-    default:
-      render << "NULL /* not supported */";
-    }
-  }
-
-  return render.str();
-}
-
-/**
- * Returns C code that represents a Thrift constant.
- */
-string t_c_glib_generator::constant_value(string name, t_type* type, t_const_value* value) {
-  ostringstream render;
-
-  if (type->is_base_type()) {
-    /* primitives */
-    t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-    switch (tbase) {
-    case t_base_type::TYPE_STRING:
-      render << "g_strdup (\"" + value->get_string() + "\")";
-      break;
-    case t_base_type::TYPE_BOOL:
-      render << ((value->get_integer() != 0) ? 1 : 0);
-      break;
-    case t_base_type::TYPE_BYTE:
-    case t_base_type::TYPE_I16:
-    case t_base_type::TYPE_I32:
-    case t_base_type::TYPE_I64:
-      render << value->get_integer();
-      break;
-    case t_base_type::TYPE_DOUBLE:
-      if (value->get_type() == t_const_value::CV_INTEGER) {
-        render << value->get_integer();
-      } else {
-        render << value->get_double();
-      }
-      break;
-    default:
-      throw "compiler error: no const of base type " + t_base_type::t_base_name(tbase);
-    }
-  } else if (type->is_enum()) {
-    render << "(" << type_name(type) << ")" << value->get_integer();
-  } else if (type->is_struct() || type->is_xception() || type->is_list() || type->is_set()
-             || type->is_map()) {
-    render << "(" << this->nspace_lc << to_lower_case(name) << "_constant())";
-  } else {
-    render << "NULL /* not supported */";
-  }
-
-  return render.str();
-}
-
-/**
- * Renders a function signature of the form 'type name(args)'
- *
- * @param tfunction Function definition
- * @return String of rendered function definition
- */
-string t_c_glib_generator::function_signature(t_function* tfunction) {
-  t_type* ttype = tfunction->get_returntype();
-  t_struct* arglist = tfunction->get_arglist();
-  t_struct* xlist = tfunction->get_xceptions();
-  string fname = initial_caps_to_underscores(tfunction->get_name());
-
-  bool has_return = !ttype->is_void();
-  bool has_args = arglist->get_members().size() == 0;
-  bool has_xceptions = xlist->get_members().size() == 0;
-  return "gboolean " + this->nspace_lc + fname + " (" + this->nspace + service_name_ + "If * iface"
-         + (has_return ? ", " + type_name(ttype) + "* _return" : "")
-         + (has_args ? "" : (", " + argument_list(arglist)))
-         + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError ** error)";
-}
-
-/**
- * Renders a field list
- *
- * @param tstruct The struct definition
- * @return Comma sepearated list of all field names in that struct
- */
-string t_c_glib_generator::argument_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += type_name((*f_iter)->get_type(), false, true) + " " + (*f_iter)->get_name();
-  }
-  return result;
-}
-
-/**
- * Renders mutable exception lists
- *
- * @param tstruct The struct definition
- * @return Comma sepearated list of all field names in that struct
- */
-string t_c_glib_generator::xception_list(t_struct* tstruct) {
-  string result = "";
-
-  const vector<t_field*>& fields = tstruct->get_members();
-  vector<t_field*>::const_iterator f_iter;
-  bool first = true;
-  for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-    if (first) {
-      first = false;
-    } else {
-      result += ", ";
-    }
-    result += type_name((*f_iter)->get_type(), false, false) + "* " + (*f_iter)->get_name();
-  }
-  return result;
-}
-
-/**
- * Declares a field, including any necessary initialization.
- */
-string t_c_glib_generator::declare_field(t_field* tfield,
-                                         bool init,
-                                         bool pointer,
-                                         bool constant,
-                                         bool reference) {
-  string result = "";
-  if (constant) {
-    result += "const ";
-  }
-  result += type_name(tfield->get_type());
-  if (pointer) {
-    result += "*";
-  }
-  if (reference) {
-    result += "*";
-  }
-  result += " " + tfield->get_name();
-  if (init) {
-    t_type* type = get_true_type(tfield->get_type());
-
-    if (type->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)type)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        break;
-      case t_base_type::TYPE_BOOL:
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-        result += " = 0";
-        break;
-      case t_base_type::TYPE_DOUBLE:
-        result += " = (gdouble) 0";
-        break;
-      case t_base_type::TYPE_STRING:
-        result += " = NULL";
-        break;
-      default:
-        throw "compiler error: no C intializer for base type " + t_base_type::t_base_name(tbase);
-      }
-    } else if (type->is_enum()) {
-      result += " = (" + type_name(type) + ") 0";
-    } else if (type->is_struct() || type->is_container()) {
-      result += " = NULL";
-    }
-  }
-
-  if (!reference) {
-    result += ";";
-  }
-
-  return result;
-}
-
-/**
- * Generates C code that initializes complex constants.
- */
-void t_c_glib_generator::generate_const_initializer(string name,
-                                                    t_type* type,
-                                                    t_const_value* value) {
-  string name_u = initial_caps_to_underscores(name);
-  string name_lc = to_lower_case(name_u);
-  string type_u = initial_caps_to_underscores(type->get_name());
-  string type_uc = to_upper_case(type_u);
-
-  if (type->is_struct() || type->is_xception()) {
-    const vector<t_field*>& fields = ((t_struct*)type)->get_members();
-    vector<t_field*>::const_iterator f_iter;
-    const map<t_const_value*, t_const_value*>& val = value->get_map();
-    map<t_const_value*, t_const_value*>::const_iterator v_iter;
-    ostringstream initializers;
-
-    // initialize any constants that may be referenced by this initializer
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      t_type* field_type = NULL;
-      string field_name = "";
-
-      for (f_iter = fields.begin(); f_iter != fields.end(); ++f_iter) {
-        if ((*f_iter)->get_name() == v_iter->first->get_string()) {
-          field_type = (*f_iter)->get_type();
-          field_name = (*f_iter)->get_name();
-        }
-      }
-      if (field_type == NULL) {
-        throw "type error: " + type->get_name() + " has no field "
-          + v_iter->first->get_string();
-      }
-      field_name = tmp(field_name);
-
-      generate_const_initializer(name + "_constant_" + field_name,
-                                 field_type,
-                                 v_iter->second);
-      initializers << "    constant->" << v_iter->first->get_string() << " = "
-                   << constant_value(name + "_constant_" + field_name,
-                                     field_type,
-                                     v_iter->second) << ";" << endl
-                   << "    constant->__isset_" << v_iter->first->get_string()
-                   << " = TRUE;" << endl;
-    }
-
-    // implement the initializer
-    f_types_impl_ << "static " << this->nspace << type->get_name() << " *"
-                  << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static " << this->nspace << type->get_name()
-                  << " *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "constant = g_object_new (" << this->nspace_uc
-                  << "TYPE_" << type_uc << ", NULL);" << endl
-                  << initializers.str();
-    scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
-    scope_down(f_types_impl_);
-    f_types_impl_ << endl;
-  } else if (type->is_list()) {
-    string list_type = "GPtrArray *";
-    // TODO: This initialization should contain a free function for container
-    string list_initializer = "g_ptr_array_new();";
-    string list_appender = "g_ptr_array_add";
-    bool list_variable = false;
-
-    t_type* etype = ((t_list*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    ostringstream initializers;
-    ostringstream appenders;
-
-    list_initializer = generate_new_array_from_type(etype);
-    if (etype->is_base_type()) {
-      t_base_type::t_base tbase = ((t_base_type*)etype)->get_base();
-      switch (tbase) {
-      case t_base_type::TYPE_VOID:
-        throw "compiler error: cannot determine array type";
-      case t_base_type::TYPE_BOOL:
-      case t_base_type::TYPE_BYTE:
-      case t_base_type::TYPE_I16:
-      case t_base_type::TYPE_I32:
-      case t_base_type::TYPE_I64:
-      case t_base_type::TYPE_DOUBLE:
-        list_type = "GArray *";
-        list_appender = "g_array_append_val";
-        list_variable = true;
-        break;
-      case t_base_type::TYPE_STRING:
-        break;
-      default:
-        throw "compiler error: no array info for type";
-      }
-    }
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string fname = tmp(name);
-
-      generate_const_initializer(fname, etype, (*v_iter));
-      if (list_variable) {
-        initializers << "    " << type_name(etype) << " " << fname << " = "
-                     << constant_value(fname, (t_type*)etype, (*v_iter)) << ";"
-                     << endl;
-        appenders << "    " << list_appender << "(constant, " << fname << ");"
-                  << endl;
-      } else {
-        appenders << "    " << list_appender << "(constant, "
-                  << constant_value(fname, (t_type*)etype, (*v_iter)) << ");"
-                  << endl;
-      }
-    }
-
-    f_types_impl_ << "static " << list_type << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static " << list_type << " constant = NULL;"
-                  << endl
-                  << indent() << "if (constant == NULL)" << endl;
-    scope_up(f_types_impl_);
-    if (!initializers.str().empty()) {
-      f_types_impl_ << initializers.str()
-                    << endl;
-    }
-    f_types_impl_ << indent() << "constant = " << list_initializer << endl
-                  << appenders.str();
-    scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
-    scope_down(f_types_impl_);
-    f_types_impl_ << endl;
-  } else if (type->is_set()) {
-    t_type* etype = ((t_set*)type)->get_elem_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    ostringstream initializers;
-    ostringstream appenders;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string fname = tmp(name);
-      generate_const_initializer(fname, etype, (*v_iter));
-      initializers << "    " << type_name(etype) << " " << fname << " = "
-                   << constant_value(fname, (t_type*)etype, (*v_iter)) << ";"
-                   << endl;
-      appenders << "    g_hash_table_insert (constant, &" << fname << ", &"
-                << fname << ");" << endl;
-    }
-
-    f_types_impl_ << "static GHashTable *" << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << initializers.str()
-                  << endl
-                  // TODO: This initialization should contain a free function
-                  // for elements
-                  << indent() << "constant = g_hash_table_new (NULL, NULL);"
-                  << endl
-                  << appenders.str();
-    scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
-    scope_down(f_types_impl_);
-    f_types_impl_ << endl;
-  } else if (type->is_map()) {
-    t_type* ktype = ((t_map*)type)->get_key_type();
-    t_type* vtype = ((t_map*)type)->get_val_type();
-    const vector<t_const_value*>& val = value->get_list();
-    vector<t_const_value*>::const_iterator v_iter;
-    ostringstream initializers;
-    ostringstream appenders;
-
-    for (v_iter = val.begin(); v_iter != val.end(); ++v_iter) {
-      string fname = tmp(name);
-      string kname = fname + "key";
-      string vname = fname + "val";
-      generate_const_initializer(kname, ktype, (*v_iter));
-      generate_const_initializer(vname, vtype, (*v_iter));
-
-      initializers << "    " << type_name(ktype) << " " << kname << " = "
-                   << constant_value(kname, (t_type*)ktype, (*v_iter)) << ";"
-                   << endl
-                   << "    " << type_name(vtype) << " " << vname << " = "
-                   << constant_value(vname, (t_type*)vtype, (*v_iter)) << ";"
-                   << endl;
-      appenders << "    g_hash_table_insert (constant, &" << fname << ", &"
-                << fname << ");"
-                << endl;
-    }
-
-    f_types_impl_ << "static GHashTable *" << endl
-                  << this->nspace_lc << name_lc << "_constant (void)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << indent() << "static GHashTable *constant = NULL;" << endl
-                  << indent() << "if (constant == NULL)" << endl;
-    scope_up(f_types_impl_);
-    f_types_impl_ << initializers.str()
-                  << endl
-                  // TODO: This initialization should contain a free function
-                  // for elements
-                  << indent() << "constant = g_hash_table_new (NULL, NULL);"
-                  << endl
-                  << appenders.str();
-    scope_down(f_types_impl_);
-    f_types_impl_ << indent() << "return constant;" << endl;
-    scope_down(f_types_impl_);
-    f_types_impl_ << endl;
-  }
-}
-
-/**
- * Generates helper classes for a service, consisting of a ThriftStruct subclass
- * for the arguments to and the result from each method.
- *
- * @param tservice The service for which to generate helper classes
- */
-void t_c_glib_generator::generate_service_helpers(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::iterator function_iter;
-
-  // Iterate through the service's methods
-  for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
-    string function_name = (*function_iter)->get_name();
-    t_struct* arg_list = (*function_iter)->get_arglist();
-    string arg_list_name_orig = arg_list->get_name();
-
-    // Generate the arguments class
-    arg_list->set_name(tservice->get_name() + underscores_to_initial_caps(function_name) + "Args");
-    generate_struct(arg_list);
-
-    arg_list->set_name(arg_list_name_orig);
-
-    // Generate the result class
-    if (!(*function_iter)->is_oneway()) {
-      t_struct result(program_,
-                      tservice->get_name() + underscores_to_initial_caps(function_name) + "Result");
-      t_field success((*function_iter)->get_returntype(), "success", 0);
-      success.set_req(t_field::T_OPTIONAL);
-      if (!(*function_iter)->get_returntype()->is_void()) {
-        result.append(&success);
-      }
-
-      t_struct* xs = (*function_iter)->get_xceptions();
-      const vector<t_field*>& fields = xs->get_members();
-      vector<t_field*>::const_iterator field_iter;
-      for (field_iter = fields.begin(); field_iter != fields.end(); ++field_iter) {
-        (*field_iter)->set_req(t_field::T_OPTIONAL);
-        result.append(*field_iter);
-      }
-
-      generate_struct(&result);
-    }
-  }
-}
-
-/**
- * Generates C code that represents a Thrift service client.
- */
-void t_c_glib_generator::generate_service_client(t_service* tservice) {
-  /* get some C friendly service names */
-  string service_name_lc = to_lower_case(initial_caps_to_underscores(service_name_));
-  string service_name_uc = to_upper_case(service_name_lc);
-
-  string parent_service_name;
-  string parent_service_name_lc;
-  string parent_service_name_uc;
-
-  string parent_class_name = "GObject";
-  string parent_type_name = "G_TYPE_OBJECT";
-
-  // The service this service extends, or NULL if it extends no
-  // service
-  t_service* extends_service = tservice->get_extends();
-  if (extends_service) {
-    // The name of the parent service
-    parent_service_name = extends_service->get_name();
-    parent_service_name_lc = to_lower_case(initial_caps_to_underscores(parent_service_name));
-    parent_service_name_uc = to_upper_case(parent_service_name_lc);
-
-    // The names of the client class' parent class and type
-    parent_class_name = this->nspace + parent_service_name + "Client";
-    parent_type_name = this->nspace_uc + "TYPE_" + parent_service_name_uc + "_CLIENT";
-  }
-
-  // The base service (the topmost in the "extends" hierarchy), on
-  // whose client class the "input_protocol" and "output_protocol"
-  // properties are defined
-  t_service* base_service = tservice;
-  while (base_service->get_extends()) {
-    base_service = base_service->get_extends();
-  }
-
-  string base_service_name = base_service->get_name();
-  string base_service_name_lc = to_lower_case(initial_caps_to_underscores(base_service_name));
-  string base_service_name_uc = to_upper_case(base_service_name_lc);
-
-  // Generate the client interface dummy object in the header.
-  f_header_ << "/* " << service_name_ << " service interface */" << endl << "typedef struct _"
-            << this->nspace << service_name_ << "If " << this->nspace << service_name_ << "If; "
-            << " /* dummy object */" << endl << endl;
-
-  // Generate the client interface object in the header.
-  f_header_ << "struct _" << this->nspace << service_name_ << "IfInterface" << endl << "{" << endl
-            << "  GTypeInterface parent;" << endl << endl;
-
-  /* write out the functions for this interface */
-  indent_up();
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator f_iter;
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    /* make the function name C friendly */
-    string funname = initial_caps_to_underscores((*f_iter)->get_name());
-    t_type* ttype = (*f_iter)->get_returntype();
-    t_struct* arglist = (*f_iter)->get_arglist();
-    t_struct* xlist = (*f_iter)->get_xceptions();
-    bool has_return = !ttype->is_void();
-    bool has_args = arglist->get_members().size() == 0;
-    bool has_xceptions = xlist->get_members().size() == 0;
-
-    string params = "(" + this->nspace + service_name_ + "If *iface"
-                    + (has_return ? ", " + type_name(ttype) + "* _return" : "")
-                    + (has_args ? "" : (", " + argument_list(arglist)))
-                    + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError **error)";
-
-    indent(f_header_) << "gboolean (*" << funname << ") " << params << ";" << endl;
-  }
-  indent_down();
-
-  f_header_ << "};" << endl << "typedef struct _" << this->nspace << service_name_ << "IfInterface "
-            << this->nspace << service_name_ << "IfInterface;" << endl << endl;
-
-  // generate all the interface boilerplate
-  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_if_get_type (void);" << endl
-            << "#define " << this->nspace_uc << "TYPE_" << service_name_uc << "_IF "
-            << "(" << this->nspace_lc << service_name_lc << "_if_get_type())" << endl << "#define "
-            << this->nspace_uc << service_name_uc << "_IF(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_IF, " << this->nspace << service_name_ << "If))" << endl
-            << "#define " << this->nspace_uc << "IS_" << service_name_uc << "_IF(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_IF))" << endl << "#define " << this->nspace_uc
-            << service_name_uc << "_IF_GET_INTERFACE(inst) (G_TYPE_INSTANCE_GET_INTERFACE ((inst), "
-            << this->nspace_uc << "TYPE_" << service_name_uc << "_IF, " << this->nspace
-            << service_name_ << "IfInterface))" << endl << endl;
-
-  // write out all the interface function prototypes
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    /* make the function name C friendly */
-    string funname = initial_caps_to_underscores((*f_iter)->get_name());
-    t_type* ttype = (*f_iter)->get_returntype();
-    t_struct* arglist = (*f_iter)->get_arglist();
-    t_struct* xlist = (*f_iter)->get_xceptions();
-    bool has_return = !ttype->is_void();
-    bool has_args = arglist->get_members().size() == 0;
-    bool has_xceptions = xlist->get_members().size() == 0;
-
-    string params = "(" + this->nspace + service_name_ + "If *iface"
-                    + (has_return ? ", " + type_name(ttype) + "* _return" : "")
-                    + (has_args ? "" : (", " + argument_list(arglist)))
-                    + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError **error)";
-
-    f_header_ << "gboolean " << this->nspace_lc << service_name_lc << "_if_" << funname << " "
-              << params << ";" << endl;
-  }
-  f_header_ << endl;
-
-  // Generate the client object instance definition in the header.
-  f_header_ << "/* " << service_name_ << " service client */" << endl << "struct _" << this->nspace
-            << service_name_ << "Client" << endl << "{" << endl << "  " << parent_class_name
-            << " parent;" << endl;
-  if (!extends_service) {
-    // Define "input_protocol" and "output_protocol" properties only
-    // for base services; child service-client classes will inherit
-    // these
-    f_header_ << endl << "  ThriftProtocol *input_protocol;" << endl
-              << "  ThriftProtocol *output_protocol;" << endl;
-  }
-  f_header_ << "};" << endl << "typedef struct _" << this->nspace << service_name_ << "Client "
-            << this->nspace << service_name_ << "Client;" << endl << endl;
-
-  // Generate the class definition in the header.
-  f_header_ << "struct _" << this->nspace << service_name_ << "ClientClass" << endl << "{" << endl
-            << "  " << parent_class_name << "Class parent;" << endl << "};" << endl
-            << "typedef struct _" << this->nspace << service_name_ << "ClientClass " << this->nspace
-            << service_name_ << "ClientClass;" << endl << endl;
-
-  // Create all the GObject boilerplate
-  f_header_ << "GType " << this->nspace_lc << service_name_lc << "_client_get_type (void);" << endl
-            << "#define " << this->nspace_uc << "TYPE_" << service_name_uc << "_CLIENT "
-            << "(" << this->nspace_lc << service_name_lc << "_client_get_type())" << endl
-            << "#define " << this->nspace_uc << service_name_uc << "_CLIENT(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_CLIENT, " << this->nspace << service_name_ << "Client))" << endl
-            << "#define " << this->nspace_uc << service_name_uc << "_CLIENT_CLASS(c) "
-            << "(G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_CLIENT, " << this->nspace << service_name_ << "ClientClass))" << endl << "#define "
-            << this->nspace_uc << service_name_uc << "_IS_CLIENT(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_CLIENT))" << endl << "#define " << this->nspace_uc
-            << service_name_uc << "_IS_CLIENT_CLASS(c) "
-            << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_CLIENT))" << endl << "#define " << this->nspace_uc << service_name_uc
-            << "_CLIENT_GET_CLASS(obj) "
-            << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_CLIENT, " << this->nspace << service_name_ << "ClientClass))"
-            << endl << endl;
-
-  /* write out the function prototypes */
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    /* make the function name C friendly */
-    string funname = to_lower_case(initial_caps_to_underscores((*f_iter)->get_name()));
-
-    t_function service_function((*f_iter)->get_returntype(),
-                                service_name_lc + string("_client_") + funname,
-                                (*f_iter)->get_arglist(),
-                                (*f_iter)->get_xceptions());
-    indent(f_header_) << function_signature(&service_function) << ";" << endl;
-
-    t_function send_function(g_type_void,
-                             service_name_lc + string("_client_send_") + funname,
-                             (*f_iter)->get_arglist());
-    indent(f_header_) << function_signature(&send_function) << ";" << endl;
-
-    // implement recv if not a oneway service
-    if (!(*f_iter)->is_oneway()) {
-      t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               service_name_lc + string("_client_recv_") + funname,
-                               &noargs,
-                               (*f_iter)->get_xceptions());
-      indent(f_header_) << function_signature(&recv_function) << ";" << endl;
-    }
-  }
-
-  /* write out the get/set function prototypes */
-  f_header_ << "void " + service_name_lc + "_client_set_property (GObject *object, guint "
-                                           "property_id, const GValue *value, GParamSpec *pspec);"
-            << endl;
-  f_header_ << "void " + service_name_lc + "_client_get_property (GObject *object, guint "
-                                           "property_id, GValue *value, GParamSpec *pspec);"
-            << endl;
-
-  f_header_ << endl;
-  // end of header code
-
-  // Generate interface method implementations
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    /* make the function name C friendly */
-    string funname = initial_caps_to_underscores((*f_iter)->get_name());
-    t_type* ttype = (*f_iter)->get_returntype();
-    t_struct* arglist = (*f_iter)->get_arglist();
-    t_struct* xlist = (*f_iter)->get_xceptions();
-    bool has_return = !ttype->is_void();
-    bool has_args = arglist->get_members().size() == 0;
-    bool has_xceptions = xlist->get_members().size() == 0;
-
-    string params = "(" + this->nspace + service_name_ + "If *iface"
-                    + (has_return ? ", " + type_name(ttype) + "* _return" : "")
-                    + (has_args ? "" : (", " + argument_list(arglist)))
-                    + (has_xceptions ? "" : (", " + xception_list(xlist))) + ", GError **error)";
-
-    string params_without_type = string("iface, ") + (has_return ? "_return, " : "");
-
-    const vector<t_field*>& fields = arglist->get_members();
-    vector<t_field*>::const_iterator f_iter_field;
-    for (f_iter_field = fields.begin(); f_iter_field != fields.end(); ++f_iter_field) {
-      params_without_type += (*f_iter_field)->get_name();
-      params_without_type += ", ";
-    }
-
-    const vector<t_field*>& xceptions = xlist->get_members();
-    vector<t_field*>::const_iterator x_iter;
-    for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-      params_without_type += (*x_iter)->get_name();
-      params_without_type += ", ";
-    }
-
-    f_service_ << "gboolean" << endl << this->nspace_lc << service_name_lc << "_if_" << funname
-               << " " << params << endl << "{" << endl << "  return " << this->nspace_uc
-               << service_name_uc << "_IF_GET_INTERFACE (iface)->" << funname << " ("
-               << params_without_type << "error);" << endl << "}" << endl << endl;
-  }
-
-  // Generate interface boilerplate
-  f_service_ << "GType" << endl << this->nspace_lc << service_name_lc << "_if_get_type (void)"
-             << endl << "{" << endl << "  static GType type = 0;" << endl << "  if (type == 0)"
-             << endl << "  {" << endl << "    static const GTypeInfo type_info =" << endl << "    {"
-             << endl << "      sizeof (" << this->nspace << service_name_ << "IfInterface)," << endl
-             << "      NULL,  /* base_init */" << endl << "      NULL,  /* base_finalize */" << endl
-             << "      NULL,  /* class_init */" << endl << "      NULL,  /* class_finalize */"
-             << endl << "      NULL,  /* class_data */" << endl
-             << "      0,     /* instance_size */" << endl << "      0,     /* n_preallocs */"
-             << endl << "      NULL,  /* instance_init */" << endl
-             << "      NULL   /* value_table */" << endl << "    };" << endl
-             << "    type = g_type_register_static (G_TYPE_INTERFACE," << endl
-             << "                                   \"" << this->nspace << service_name_ << "If\","
-             << endl << "                                   &type_info, 0);" << endl << "  }"
-             << endl << "  return type;" << endl << "}" << endl << endl;
-
-  // Generate client boilerplate
-  f_service_ << "static void " << endl << this->nspace_lc << service_name_lc
-             << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface);"
-             << endl << endl << "G_DEFINE_TYPE_WITH_CODE (" << this->nspace << service_name_
-             << "Client, " << this->nspace_lc << service_name_lc << "_client," << endl
-             << "                         " << parent_type_name << ", " << endl
-             << "                         G_IMPLEMENT_INTERFACE (" << this->nspace_uc << "TYPE_"
-             << service_name_uc << "_IF," << endl
-             << "                                                " << this->nspace_lc
-             << service_name_lc << "_if_interface_init))" << endl << endl;
-
-  // Generate property-related code only for base services---child
-  // service-client classes have only properties inherited from their
-  // parent class
-  if (!extends_service) {
-    // Generate client properties
-    f_service_ << "enum _" << this->nspace << service_name_ << "ClientProperties" << endl << "{"
-               << endl << "  PROP_0," << endl << "  PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_INPUT_PROTOCOL," << endl << "  PROP_" << this->nspace_uc
-               << service_name_uc << "_CLIENT_OUTPUT_PROTOCOL" << endl << "};" << endl << endl;
-
-    // generate property setter
-    f_service_ << "void" << endl << this->nspace_lc << service_name_lc << "_client_set_property ("
-               << "GObject *object, guint property_id, const GValue *value, "
-               << "GParamSpec *pspec)" << endl << "{" << endl << "  " << this->nspace
-               << service_name_ << "Client *client = " << this->nspace_uc << service_name_uc
-               << "_CLIENT (object);" << endl << endl << "  THRIFT_UNUSED_VAR (pspec);" << endl
-               << endl << "  switch (property_id)" << endl << "  {" << endl << "    case PROP_"
-               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << endl
-               << "      client->input_protocol = g_value_get_object (value);" << endl
-               << "      break;" << endl << "    case PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL:" << endl
-               << "      client->output_protocol = g_value_get_object (value);" << endl
-               << "      break;" << endl << "  }" << endl << "}" << endl << endl;
-
-    // generate property getter
-    f_service_ << "void" << endl << this->nspace_lc << service_name_lc << "_client_get_property ("
-               << "GObject *object, guint property_id, GValue *value, "
-               << "GParamSpec *pspec)" << endl << "{" << endl << "  " << this->nspace
-               << service_name_ << "Client *client = " << this->nspace_uc << service_name_uc
-               << "_CLIENT (object);" << endl << endl << "  THRIFT_UNUSED_VAR (pspec);" << endl
-               << endl << "  switch (property_id)" << endl << "  {" << endl << "    case PROP_"
-               << this->nspace_uc << service_name_uc << "_CLIENT_INPUT_PROTOCOL:" << endl
-               << "      g_value_set_object (value, client->input_protocol);" << endl
-               << "      break;" << endl << "    case PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL:" << endl
-               << "      g_value_set_object (value, client->output_protocol);" << endl
-               << "      break;" << endl << "  }" << endl << "}" << endl << endl;
-  }
-
-  // Generate client method implementations
-  for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-    string name = (*f_iter)->get_name();
-    string funname = initial_caps_to_underscores(name);
-
-    // Get the struct of function call params and exceptions
-    t_struct* arg_struct = (*f_iter)->get_arglist();
-
-    // Function for sending
-    t_function send_function(g_type_void,
-                             service_name_lc + string("_client_send_") + funname,
-                             (*f_iter)->get_arglist());
-
-    // Open the send function
-    indent(f_service_) << function_signature(&send_function) << endl;
-    scope_up(f_service_);
-
-    string reqType = (*f_iter)->is_oneway() ? "T_ONEWAY" : "T_CALL";
-
-    // Serialize the request
-    f_service_ << indent() << "gint32 cseqid = 0;" << endl << indent()
-               << "ThriftProtocol * protocol = " << this->nspace_uc << base_service_name_uc
-               << "_CLIENT (iface)->output_protocol;" << endl << endl << indent()
-               << "if (thrift_protocol_write_message_begin (protocol, \"" << name << "\", "
-               << reqType << ", cseqid, error) < 0)" << endl << indent() << "  return FALSE;"
-               << endl << endl;
-
-    generate_struct_writer(f_service_, arg_struct, "", "", false);
-
-    f_service_ << indent() << "if (thrift_protocol_write_message_end (protocol, error) < 0)" << endl
-               << indent() << "  return FALSE;" << endl << indent()
-               << "if (!thrift_transport_flush (protocol->transport, error))" << endl << indent()
-               << "  return FALSE;" << endl << indent()
-               << "if (!thrift_transport_write_end (protocol->transport, error))" << endl
-               << indent() << "  return FALSE;" << endl << endl << indent() << "return TRUE;"
-               << endl;
-
-    scope_down(f_service_);
-    f_service_ << endl;
-
-    // Generate recv function only if not an async function
-    if (!(*f_iter)->is_oneway()) {
-      t_struct noargs(program_);
-      t_function recv_function((*f_iter)->get_returntype(),
-                               service_name_lc + string("_client_recv_") + funname,
-                               &noargs,
-                               (*f_iter)->get_xceptions());
-      // Open function
-      indent(f_service_) << function_signature(&recv_function) << endl;
-      scope_up(f_service_);
-
-      f_service_ << indent() << "gint32 rseqid;" << endl
-                 << indent() << "gchar * fname = NULL;" << endl
-                 << indent() << "ThriftMessageType mtype;" << endl
-                 << indent() << "ThriftProtocol * protocol = "
-                 << this->nspace_uc << base_service_name_uc
-                 << "_CLIENT (iface)->input_protocol;" << endl
-                 << indent() << "ThriftApplicationException *xception;" << endl
-                 << endl
-                 << indent() << "if (thrift_protocol_read_message_begin "
-                    "(protocol, &fname, &mtype, &rseqid, error) < 0) {" << endl;
-      indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "return FALSE;" << endl;
-      indent_down();
-      f_service_ << indent() << "}" << endl
-                 << endl
-                 << indent() << "if (mtype == T_EXCEPTION) {" << endl;
-      indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "xception = g_object_new "
-                    "(THRIFT_TYPE_APPLICATION_EXCEPTION, NULL);" << endl
-                 << indent() << "thrift_struct_read (THRIFT_STRUCT (xception), "
-                    "protocol, NULL);" << endl
-                 << indent() << "thrift_protocol_read_message_end "
-                    "(protocol, NULL);" << endl
-                 << indent() << "thrift_transport_read_end "
-                    "(protocol->transport, NULL);" << endl
-                 << indent() << "g_set_error (error, "
-                    "THRIFT_APPLICATION_EXCEPTION_ERROR,xception->type, "
-                    "\"application error: %s\", xception->message);" << endl
-                 << indent() << "g_object_unref (xception);" << endl
-                 << indent() << "return FALSE;" << endl;
-      indent_down();
-      f_service_ << indent() << "} else if (mtype != T_REPLY) {" << endl;
-      indent_up();
-      f_service_ << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "thrift_protocol_skip (protocol, T_STRUCT, "
-                    "NULL);" << endl
-                 << indent() << "thrift_protocol_read_message_end (protocol, "
-                    "NULL);" << endl
-                 << indent() << "thrift_transport_read_end ("
-                    "protocol->transport, NULL);" << endl
-                 << indent() << "g_set_error (error, "
-                    "THRIFT_APPLICATION_EXCEPTION_ERROR, "
-                    "THRIFT_APPLICATION_EXCEPTION_ERROR_INVALID_MESSAGE_TYPE, "
-                    "\"invalid message type %d, expected T_REPLY\", mtype);"
-                 << endl
-                 << indent() << "return FALSE;" << endl;
-      indent_down();
-      f_service_ << indent() << "} else if (strncmp (fname, \"" << name
-                 << "\", " << name.length() << ") != 0) {" << endl;
-      indent_up();
-      f_service_ << indent() << "thrift_protocol_skip (protocol, T_STRUCT, "
-                    "NULL);" << endl
-                 << indent() << "thrift_protocol_read_message_end (protocol,"
-                    "error);" << endl
-                 << indent() << "thrift_transport_read_end ("
-                    "protocol->transport, error);" << endl
-                 << indent() << "g_set_error (error, "
-                    "THRIFT_APPLICATION_EXCEPTION_ERROR, "
-                    "THRIFT_APPLICATION_EXCEPTION_ERROR_WRONG_METHOD_NAME, "
-                    "\"wrong method name %s, expected " << name
-                    << "\", fname);" << endl
-                 << indent() << "if (fname) g_free (fname);" << endl
-                 << indent() << "return FALSE;" << endl;
-      indent_down();
-      f_service_ << indent() << "}" << endl
-                 << indent() << "if (fname) g_free (fname);" << endl
-                 << endl;
-
-      t_struct* xs = (*f_iter)->get_xceptions();
-      const std::vector<t_field*>& xceptions = xs->get_members();
-      vector<t_field*>::const_iterator x_iter;
-
-      {
-        t_struct result(program_, tservice->get_name() + "_" + (*f_iter)->get_name() + "_result");
-        t_field success((*f_iter)->get_returntype(), "*_return", 0);
-        if (!(*f_iter)->get_returntype()->is_void()) {
-          result.append(&success);
-        }
-
-        // add readers for exceptions, dereferencing the pointer.
-        for (x_iter = xceptions.begin(); x_iter != xceptions.end(); x_iter++) {
-          t_field* xception = new t_field((*x_iter)->get_type(),
-                                          "*" + (*x_iter)->get_name(),
-                                          (*x_iter)->get_key());
-          result.append(xception);
-        }
-
-        generate_struct_reader(f_service_, &result, "", "", false);
-      }
-
-      f_service_ << indent() << "if (thrift_protocol_read_message_end (protocol, error) < 0)"
-                 << endl << indent() << "  return FALSE;" << endl << endl << indent()
-                 << "if (!thrift_transport_read_end (protocol->transport, error))" << endl
-                 << indent() << "  return FALSE;" << endl << endl;
-
-      // copy over any throw exceptions and return failure
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); x_iter++) {
-        f_service_ << indent() << "if (*" << (*x_iter)->get_name() << " != NULL)" << endl
-                   << indent() << "{" << endl << indent() << "    g_set_error (error, "
-                   << this->nspace_uc
-                   << to_upper_case(initial_caps_to_underscores((*x_iter)->get_type()->get_name()))
-                   << "_ERROR, " << this->nspace_uc
-                   << to_upper_case(initial_caps_to_underscores((*x_iter)->get_type()->get_name()))
-                   << "_ERROR_CODE, \"" << (*x_iter)->get_type()->get_name() << "\");" << endl
-                   << indent() << "    return FALSE;" << endl << indent() << "}" << endl;
-      }
-      // Close function
-      indent(f_service_) << "return TRUE;" << endl;
-      scope_down(f_service_);
-      f_service_ << endl;
-    }
-
-    // Open function
-    t_function service_function((*f_iter)->get_returntype(),
-                                service_name_lc + string("_client_") + funname,
-                                (*f_iter)->get_arglist(),
-                                (*f_iter)->get_xceptions());
-    indent(f_service_) << function_signature(&service_function) << endl;
-    scope_up(f_service_);
-
-    // wrap each function
-    f_service_ << indent() << "if (!" << this->nspace_lc << service_name_lc << "_client_send_"
-               << funname << " (iface";
-
-    // Declare the function arguments
-    const vector<t_field*>& fields = arg_struct->get_members();
-    vector<t_field*>::const_iterator fld_iter;
-    for (fld_iter = fields.begin(); fld_iter != fields.end(); ++fld_iter) {
-      f_service_ << ", " << (*fld_iter)->get_name();
-    }
-    f_service_ << ", error))" << endl << indent() << "  return FALSE;" << endl;
-
-    // if not oneway, implement recv
-    if (!(*f_iter)->is_oneway()) {
-      string ret = (*f_iter)->get_returntype()->is_void() ? "" : "_return, ";
-
-      const vector<t_field*>& xceptions = (*f_iter)->get_xceptions()->get_members();
-      vector<t_field*>::const_iterator x_iter;
-      for (x_iter = xceptions.begin(); x_iter != xceptions.end(); ++x_iter) {
-        ret += (*x_iter)->get_name();
-        ret += ", ";
-      }
-
-      f_service_ << indent() << "if (!" << this->nspace_lc << service_name_lc << "_client_recv_"
-                 << funname << " (iface, " << ret << "error))" << endl << indent()
-                 << "  return FALSE;" << endl;
-    }
-
-    // return TRUE which means all functions were called OK
-    indent(f_service_) << "return TRUE;" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  // create the interface initializer
-  f_service_ << "static void" << endl
-             << this->nspace_lc << service_name_lc << "_if_interface_init ("
-             << this->nspace << service_name_ << "IfInterface *iface)" << endl;
-  scope_up(f_service_);
-  if (functions.size() > 0) {
-    for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) {
-      /* make the function name C friendly */
-      string funname = initial_caps_to_underscores((*f_iter)->get_name());
-
-      f_service_ << indent() << "iface->" << funname << " = " << this->nspace_lc
-                 << service_name_lc << "_client_" << funname << ";" << endl;
-    }
-  }
-  else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (iface);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // create the client instance initializer
-  f_service_ << "static void" << endl
-             << this->nspace_lc << service_name_lc << "_client_init ("
-             << this->nspace << service_name_ << "Client *client)" << endl;
-  scope_up(f_service_);
-  if (!extends_service) {
-    f_service_ << indent() << "client->input_protocol = NULL;" << endl
-               << indent() << "client->output_protocol = NULL;" << endl;
-  }
-  else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (client);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // create the client class initializer
-  f_service_ << "static void" << endl << this->nspace_lc << service_name_lc
-             << "_client_class_init (" << this->nspace << service_name_ << "ClientClass *cls)"
-             << endl << "{" << endl;
-  if (!extends_service) {
-    f_service_ << "  GObjectClass *gobject_class = G_OBJECT_CLASS (cls);" << endl
-               << "  GParamSpec *param_spec;" << endl << endl
-               << "  gobject_class->set_property = " << this->nspace_lc << service_name_lc
-               << "_client_set_property;" << endl
-               << "  gobject_class->get_property = " << this->nspace_lc << service_name_lc
-               << "_client_get_property;" << endl << endl
-               << "  param_spec = g_param_spec_object (\"input_protocol\"," << endl
-               << "                                    \"input protocol (construct)\"," << endl
-               << "                                    \"Set the client input protocol\"," << endl
-               << "                                    THRIFT_TYPE_PROTOCOL," << endl
-               << "                                    G_PARAM_READWRITE);" << endl
-               << "  g_object_class_install_property (gobject_class," << endl
-               << "                                   PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_INPUT_PROTOCOL, param_spec);" << endl << endl
-               << "  param_spec = g_param_spec_object (\"output_protocol\"," << endl
-               << "                                    \"output protocol (construct)\"," << endl
-               << "                                    \"Set the client output protocol\"," << endl
-               << "                                    THRIFT_TYPE_PROTOCOL," << endl
-               << "                                    G_PARAM_READWRITE);" << endl
-               << "  g_object_class_install_property (gobject_class," << endl
-               << "                                   PROP_" << this->nspace_uc << service_name_uc
-               << "_CLIENT_OUTPUT_PROTOCOL, param_spec);" << endl;
-  }
-  else {
-    f_service_ << "  THRIFT_UNUSED_VAR (cls);" << endl;
-  }
-  f_service_ << "}" << endl << endl;
-}
-
-/**
- * Generates C code that represents a Thrift service handler.
- *
- * @param tservice The service for which to generate a handler.
- */
-void t_c_glib_generator::generate_service_handler(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator function_iter;
-
-  string service_name_lc = to_lower_case(initial_caps_to_underscores(service_name_));
-  string service_name_uc = to_upper_case(service_name_lc);
-
-  string class_name = this->nspace + service_name_ + "Handler";
-  string class_name_lc = to_lower_case(initial_caps_to_underscores(class_name));
-  string class_name_uc = to_upper_case(class_name_lc);
-
-  string parent_class_name;
-  string parent_type_name;
-
-  string args_indent;
-
-  // The service this service extends, or NULL if it extends no service
-  t_service* extends_service = tservice->get_extends();
-
-  // Determine the name of our parent service (if any) and the handler class'
-  // parent class name and type
-  if (extends_service) {
-    string parent_service_name = extends_service->get_name();
-    string parent_service_name_lc = to_lower_case(initial_caps_to_underscores(parent_service_name));
-    string parent_service_name_uc = to_upper_case(parent_service_name_lc);
-
-    parent_class_name = this->nspace + parent_service_name + "Handler";
-    parent_type_name = this->nspace_uc + "TYPE_" + parent_service_name_uc + "_HANDLER";
-  } else {
-    parent_class_name = "GObject";
-    parent_type_name = "G_TYPE_OBJECT";
-  }
-
-  // Generate the handler class' definition in the header file
-
-  // Generate the handler instance definition
-  f_header_ << "/* " << service_name_ << " handler (abstract base class) */" << endl << "struct _"
-            << class_name << endl << "{" << endl;
-  indent_up();
-  f_header_ << indent() << parent_class_name << " parent;" << endl;
-  indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << " " << class_name << ";" << endl
-            << endl;
-
-  // Generate the handler class definition, including its class members
-  // (methods)
-  f_header_ << "struct _" << class_name << "Class" << endl << "{" << endl;
-  indent_up();
-  f_header_ << indent() << parent_class_name << "Class parent;" << endl << endl;
-
-  for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
-    string method_name = initial_caps_to_underscores((*function_iter)->get_name());
-    t_type* return_type = (*function_iter)->get_returntype();
-    t_struct* arg_list = (*function_iter)->get_arglist();
-    t_struct* x_list = (*function_iter)->get_xceptions();
-    bool has_return = !return_type->is_void();
-    bool has_args = arg_list->get_members().size() == 0;
-    bool has_xceptions = x_list->get_members().size() == 0;
-
-    string params = "(" + this->nspace + service_name_ + "If *iface"
-                    + (has_return ? ", " + type_name(return_type) + "* _return" : "")
-                    + (has_args ? "" : (", " + argument_list(arg_list)))
-                    + (has_xceptions ? "" : (", " + xception_list(x_list))) + ", GError **error)";
-
-    indent(f_header_) << "gboolean (*" << method_name << ") " << params << ";" << endl;
-  }
-  indent_down();
-
-  f_header_ << "};" << endl << "typedef struct _" << class_name << "Class " << class_name
-            << "Class;" << endl << endl;
-
-  // Generate the remaining header boilerplate
-  f_header_ << "GType " << class_name_lc << "_get_type (void);" << endl << "#define "
-            << this->nspace_uc << "TYPE_" << service_name_uc << "_HANDLER "
-            << "(" << class_name_lc << "_get_type())" << endl << "#define " << class_name_uc
-            << "(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "))" << endl << "#define "
-            << this->nspace_uc << "IS_" << service_name_uc << "_HANDLER(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER))" << endl << "#define " << class_name_uc
-            << "_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "Class))" << endl << "#define "
-            << this->nspace_uc << "IS_" << service_name_uc << "_HANDLER_CLASS(c) "
-            << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_HANDLER))" << endl << "#define " << this->nspace_uc << service_name_uc
-            << "_HANDLER_GET_CLASS(obj) "
-            << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_HANDLER, " << class_name << "Class))" << endl << endl;
-
-  // Generate the handler class' method definitions
-  for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
-    string method_name = initial_caps_to_underscores((*function_iter)->get_name());
-    t_type* return_type = (*function_iter)->get_returntype();
-    t_struct* arg_list = (*function_iter)->get_arglist();
-    t_struct* x_list = (*function_iter)->get_xceptions();
-    bool has_return = !return_type->is_void();
-    bool has_args = arg_list->get_members().size() == 0;
-    bool has_xceptions = x_list->get_members().size() == 0;
-
-    string params = "(" + this->nspace + service_name_ + "If *iface"
-                    + (has_return ? ", " + type_name(return_type) + "* _return" : "")
-                    + (has_args ? "" : (", " + argument_list(arg_list)))
-                    + (has_xceptions ? "" : (", " + xception_list(x_list))) + ", GError **error)";
-
-    f_header_ << "gboolean " << class_name_lc << "_" << method_name << " " << params << ";" << endl;
-  }
-  f_header_ << endl;
-
-  // Generate the handler's implementation in the implementation file
-
-  // Generate the implementation boilerplate
-  f_service_ << "static void" << endl << class_name_lc << "_" << service_name_lc
-             << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface);"
-             << endl << endl;
-
-  args_indent = string(25, ' ');
-  f_service_ << "G_DEFINE_TYPE_WITH_CODE (" << class_name << ", " << endl << args_indent
-             << class_name_lc << "," << endl << args_indent << parent_type_name << "," << endl
-             << args_indent << "G_IMPLEMENT_INTERFACE (" << this->nspace_uc << "TYPE_"
-             << service_name_uc << "_IF," << endl;
-  args_indent += string(23, ' ');
-  f_service_ << args_indent << class_name_lc << "_" << service_name_lc << "_if_interface_init))"
-             << endl << endl;
-
-  // Generate the handler method implementations
-  for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
-    string function_name = (*function_iter)->get_name();
-    string method_name = initial_caps_to_underscores(function_name);
-    t_type* return_type = (*function_iter)->get_returntype();
-    t_struct* arg_list = (*function_iter)->get_arglist();
-    t_struct* x_list = (*function_iter)->get_xceptions();
-
-    const vector<t_field*>& args = arg_list->get_members();
-    const vector<t_field*>& xceptions = x_list->get_members();
-
-    vector<t_field*>::const_iterator field_iter;
-
-    t_function implementing_function(return_type,
-                                     service_name_lc + "_handler_" + method_name,
-                                     arg_list,
-                                     x_list,
-                                     (*function_iter)->is_oneway());
-
-    indent(f_service_) << function_signature(&implementing_function) << endl;
-    scope_up(f_service_);
-    f_service_ << indent() << "g_return_val_if_fail (" << this->nspace_uc << "IS_"
-               << service_name_uc << "_HANDLER (iface), FALSE);" << endl << endl << indent()
-               << "return " << class_name_uc << "_GET_CLASS (iface)"
-               << "->" << method_name << " (iface, ";
-
-    if (!return_type->is_void()) {
-      f_service_ << "_return, ";
-    }
-    for (field_iter = args.begin(); field_iter != args.end(); ++field_iter) {
-      f_service_ << (*field_iter)->get_name() << ", ";
-    }
-    for (field_iter = xceptions.begin(); field_iter != xceptions.end(); ++field_iter) {
-      f_service_ << (*field_iter)->get_name() << ", ";
-    }
-    f_service_ << "error);" << endl;
-    scope_down(f_service_);
-    f_service_ << endl;
-  }
-
-  // Generate the handler interface initializer
-  f_service_ << "static void" << endl << class_name_lc << "_" << service_name_lc
-             << "_if_interface_init (" << this->nspace << service_name_ << "IfInterface *iface)"
-             << endl;
-  scope_up(f_service_);
-  if (functions.size() > 0) {
-    for (function_iter = functions.begin(); function_iter != functions.end(); ++function_iter) {
-      string method_name = initial_caps_to_underscores((*function_iter)->get_name());
-
-      f_service_ << indent() << "iface->" << method_name << " = " << class_name_lc << "_"
-                 << method_name << ";" << endl;
-    }
-  }
-  else {
-    f_service_ << "THRIFT_UNUSED_VAR (iface);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the handler instance initializer
-  f_service_ << "static void" << endl << class_name_lc << "_init (" << class_name << " *self)"
-             << endl;
-  scope_up(f_service_);
-  f_service_ << indent() << "THRIFT_UNUSED_VAR (self);" << endl;
-  scope_down(f_service_);
-  f_service_ << endl;
-
-  // Generate the handler class initializer
-  f_service_ << "static void" << endl
-             << class_name_lc << "_class_init (" << class_name << "Class *cls)"
-             << endl;
-  scope_up(f_service_);
-  if (functions.size() > 0) {
-    for (function_iter = functions.begin();
-         function_iter != functions.end();
-         ++function_iter) {
-      string function_name = (*function_iter)->get_name();
-      string method_name = initial_caps_to_underscores(function_name);
-
-      // All methods are pure virtual and must be implemented by subclasses
-      f_service_ << indent() << "cls->" << method_name << " = NULL;" << endl;
-    }
-  }
-  else {
-    f_service_ << indent() << "THRIFT_UNUSED_VAR (cls);" << endl;
-  }
-  scope_down(f_service_);
-  f_service_ << endl;
-}
-
-/**
- * Generates C code that represents a Thrift service processor.
- *
- * @param tservice The service for which to generate a processor
- */
-void t_c_glib_generator::generate_service_processor(t_service* tservice) {
-  vector<t_function*> functions = tservice->get_functions();
-  vector<t_function*>::const_iterator function_iter;
-
-  string service_name_lc = to_lower_case(initial_caps_to_underscores(service_name_));
-  string service_name_uc = to_upper_case(service_name_lc);
-
-  string class_name = this->nspace + service_name_ + "Processor";
-  string class_name_lc = to_lower_case(initial_caps_to_underscores(class_name));
-  string class_name_uc = to_upper_case(class_name_lc);
-
-  string parent_class_name;
-  string parent_type_name;
-
-  string handler_class_name = this->nspace + service_name_ + "Handler";
-  string handler_class_name_lc = initial_caps_to_underscores(handler_class_name);
-
-  string process_function_type_name = class_name + "ProcessFunction";
-  string process_function_def_type_name =
-    class_name_lc + "_process_function_def";
-
-  string function_name;
-  string args_indent;
-
-  // The service this service extends, or NULL if it extends no service
-  t_service* extends_service = tservice->get_extends();
-
-  // Determine the name of our parent service (if any) and the
-  // processor class' parent class name and type
-  if (extends_service) {
-    string parent_service_name = extends_service->get_name();
-    string parent_service_name_lc = to_lower_case(initial_caps_to_underscores(parent_service_name));
-    string parent_service_name_uc = to_upper_case(parent_service_name_lc);
-
-    parent_class_name = this->nspace + parent_service_name + "Processor";
-    parent_type_name = this->nspace_uc + "TYPE_" + parent_service_name_uc + "_PROCESSOR";
-  } else {
-    parent_class_name = "ThriftDispatchProcessor";
-    parent_type_name = "THRIFT_TYPE_DISPATCH_PROCESSOR";
-  }
-
-  // Generate the processor class' definition in the header file
-
-  // Generate the processor instance definition
-  f_header_ << "/* " << service_name_ << " processor */" << endl << "struct _" << class_name << endl
-            << "{" << endl;
-  indent_up();
-  f_header_ << indent() << parent_class_name << " parent;" << endl << endl << indent()
-            << "/* protected */" << endl << indent()
-            << this->nspace + service_name_ + "Handler *handler;" << endl << indent()
-            << "GHashTable *process_map;" << endl;
-  indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << " " << class_name << ";" << endl
-            << endl;
-
-  // Generate the processor class definition
-  f_header_ << "struct _" << class_name << "Class" << endl << "{" << endl;
-  indent_up();
-  f_header_ << indent() << parent_class_name << "Class parent;" << endl << endl << indent()
-            << "/* protected */" << endl << indent()
-            << "gboolean (*dispatch_call) (ThriftDispatchProcessor *processor," << endl;
-  args_indent = indent() + string(27, ' ');
-  f_header_ << args_indent << "ThriftProtocol *in," << endl << args_indent << "ThriftProtocol *out,"
-            << endl << args_indent << "gchar *fname," << endl << args_indent << "gint32 seqid,"
-            << endl << args_indent << "GError **error);" << endl;
-  indent_down();
-  f_header_ << "};" << endl << "typedef struct _" << class_name << "Class " << class_name
-            << "Class;" << endl << endl;
-
-  // Generate the remaining header boilerplate
-  f_header_ << "GType " << class_name_lc << "_get_type (void);" << endl << "#define "
-            << this->nspace_uc << "TYPE_" << service_name_uc << "_PROCESSOR "
-            << "(" << class_name_lc << "_get_type())" << endl << "#define " << class_name_uc
-            << "(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_CAST ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR, " << class_name << "))" << endl << "#define "
-            << this->nspace_uc << "IS_" << service_name_uc << "_PROCESSOR(obj) "
-            << "(G_TYPE_CHECK_INSTANCE_TYPE ((obj), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR))" << endl << "#define " << class_name_uc
-            << "_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), " << this->nspace_uc << "TYPE_"
-            << service_name_uc << "_PROCESSOR, " << class_name << "Class))" << endl << "#define "
-            << this->nspace_uc << "IS_" << service_name_uc << "_PROCESSOR_CLASS(c) "
-            << "(G_TYPE_CHECK_CLASS_TYPE ((c), " << this->nspace_uc << "TYPE_" << service_name_uc
-            << "_PROCESSOR))" << endl << "#define " << this->nspace_uc << service_name_uc
-            << "_PROCESSOR_GET_CLASS(obj) "
-            << "(G_TYPE_INSTANCE_GET_CLASS ((obj), " << this->nspace_

<TRUNCATED>