hawq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [17/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:30 GMT
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d709f67d/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
new file mode 100644
index 0000000..779c339
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj
@@ -0,0 +1,105 @@
+?<?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/d709f67d/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
new file mode 100644
index 0000000..3ec7bde
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/client/client.vcxproj.filters
@@ -0,0 +1,66 @@
+?<?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/d709f67d/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
new file mode 100644
index 0000000..4bd151e
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.cpp
@@ -0,0 +1,8 @@
+// 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/d709f67d/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
new file mode 100644
index 0000000..b005a83
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/client/stdafx.h
@@ -0,0 +1,15 @@
+// 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/d709f67d/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
new file mode 100644
index 0000000..87c0086
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/client/targetver.h
@@ -0,0 +1,8 @@
+#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/d709f67d/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
new file mode 100644
index 0000000..a20d785
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/config.h
@@ -0,0 +1,24 @@
+//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/d709f67d/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
new file mode 100644
index 0000000..53c0ee5
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/ReadMe.txt
@@ -0,0 +1,40 @@
+========================================================================
+    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/d709f67d/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
new file mode 100644
index 0000000..dba8368
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/server.cpp
@@ -0,0 +1,168 @@
+// 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/d709f67d/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
new file mode 100644
index 0000000..8e39b26
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj
@@ -0,0 +1,106 @@
+?<?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/d709f67d/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
new file mode 100644
index 0000000..8bb6dfb
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/server.vcxproj.filters
@@ -0,0 +1,66 @@
+?<?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/d709f67d/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
new file mode 100644
index 0000000..c25ff61
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.cpp
@@ -0,0 +1,8 @@
+// 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/d709f67d/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
new file mode 100644
index 0000000..b005a83
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/stdafx.h
@@ -0,0 +1,15 @@
+// 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/d709f67d/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
new file mode 100644
index 0000000..87c0086
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/server/targetver.h
@@ -0,0 +1,8 @@
+#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/d709f67d/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
new file mode 100644
index 0000000..4b1ef78
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/thriftme.bat
@@ -0,0 +1 @@
+thrift.exe --gen cpp Sample.thrift

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d709f67d/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
new file mode 100644
index 0000000..3b18f90
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/thriftme.sh
@@ -0,0 +1,24 @@
+#!/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/d709f67d/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
new file mode 100644
index 0000000..a9fa1ef
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/transport-sample/transport-sample.sln
@@ -0,0 +1,26 @@
+?
+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/d709f67d/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
new file mode 100644
index 0000000..76dca44
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/README.md
@@ -0,0 +1,61 @@
+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/d709f67d/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
new file mode 100644
index 0000000..6207958
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/vagrant/centos-6.5/Vagrantfile
@@ -0,0 +1,274 @@
+# -*- 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/d709f67d/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
new file mode 100644
index 0000000..9e0b5bd
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/README.md
@@ -0,0 +1,30 @@
+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/d709f67d/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
new file mode 100644
index 0000000..56278f3
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.cpp
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..df16e03
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.h
@@ -0,0 +1,65 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..d560697
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqClient.py
@@ -0,0 +1,63 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..f031458
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.cpp
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..a840c86
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.h
@@ -0,0 +1,83 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..c83cc8d
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/TZmqServer.py
@@ -0,0 +1,78 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..12cd434
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/AssemblyInfo.cs
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT 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/d709f67d/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
new file mode 100644
index 0000000..e66cfe0
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/Main.cs
@@ -0,0 +1,60 @@
+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/d709f67d/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
new file mode 100644
index 0000000..e9ab516
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqClient.cs
@@ -0,0 +1,78 @@
+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/d709f67d/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
new file mode 100644
index 0000000..535c623
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/TZmqServer.cs
@@ -0,0 +1,56 @@
+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/d709f67d/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
new file mode 100755
index 0000000..958fc55
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.csproj
@@ -0,0 +1,91 @@
+<?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/d709f67d/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
new file mode 100755
index 0000000..6af57b6
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/csharp/ThriftZMQ.sln
@@ -0,0 +1,42 @@
+
+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/d709f67d/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
new file mode 100644
index 0000000..a1ea967
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/storage.thrift
@@ -0,0 +1,4 @@
+service Storage {
+  oneway void incr(1: i32 amount);
+  i32 get();
+}

http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/d709f67d/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
new file mode 100644
index 0000000..d2fc56c
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/test-client.cpp
@@ -0,0 +1,40 @@
+#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/d709f67d/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
new file mode 100755
index 0000000..1886d9c
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/test-client.py
@@ -0,0 +1,36 @@
+#!/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/d709f67d/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
new file mode 100644
index 0000000..8fe69da
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/test-receiver.cpp
@@ -0,0 +1,40 @@
+#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/d709f67d/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
new file mode 100644
index 0000000..6b0eef1
--- /dev/null
+++ b/depends/thirdparty/thrift/contrib/zeromq/test-sender.cpp
@@ -0,0 +1,32 @@
+#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;
+}



Mime
View raw message