hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [14/51] [abbrv] [partial] incubator-hawq git commit: HAWQ-735. Import thrift-0.9.3 into depends/thirdparty/thrift folder
Date Wed, 18 May 2016 02:50:27 GMT
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d709f67d/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
new file mode 100644
index 0000000..a2082b8
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/AbstractMethodError.as
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..ae5f428
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/Set.as
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..3448fce
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TApplicationError.as
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..615db1d
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TBase.as
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..ccc13b5
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TError.as
@@ -0,0 +1,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.
+ */
+ 
+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/d709f67d/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
new file mode 100644
index 0000000..6fb4e58
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TFieldRequirementType.as
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..850acc9
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/TProcessor.as
@@ -0,0 +1,32 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..cb18a14
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldMetaData.as
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..07fe1be
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/FieldValueMetaData.as
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..a2cc732
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/ListMetaData.as
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..e7f1f9f
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/MapMetaData.as
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..390f034
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/SetMetaData.as
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..fc9b0be
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/meta_data/StructMetaData.as
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..b2ff9d8
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TBinaryProtocol.as
@@ -0,0 +1,316 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..1277f3a
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TField.as
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..f0bdbad
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TList.as
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..2298804
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMap.as
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..9817235
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessage.as
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..56a9ba5
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TMessageType.as
@@ -0,0 +1,28 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..bb9d744
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocol.as
@@ -0,0 +1,124 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..9fff730
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolError.as
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..c7f5e29
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolFactory.as
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..513df95
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TProtocolUtil.as
@@ -0,0 +1,148 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..3f0e1a6
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TSet.as
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..dffad79
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TStruct.as
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..69af208
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/protocol/TType.as
@@ -0,0 +1,39 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..863c59b
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TFullDuplexHttpClient.as
@@ -0,0 +1,251 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..435f911
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/THttpClient.as
@@ -0,0 +1,134 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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;
+    }
+
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d709f67d/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
new file mode 100644
index 0000000..6891388
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TSocket.as
@@ -0,0 +1,189 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *		http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..83160af
--- /dev/null
+++ b/depends/thirdparty/thrift/lib/as3/src/org/apache/thrift/transport/TTransport.as
@@ -0,0 +1,127 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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



Mime
View raw message