http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj b/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj deleted file mode 100755 index 259bb20..0000000 --- a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj +++ /dev/null @@ -1,293 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup Label="ProjectConfigurations"> - <ProjectConfiguration Include="Debug-mt|Win32"> - <Configuration>Debug-mt</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug-mt|x64"> - <Configuration>Debug-mt</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|Win32"> - <Configuration>Debug</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Debug|x64"> - <Configuration>Debug</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release-mt|Win32"> - <Configuration>Release-mt</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release-mt|x64"> - <Configuration>Release-mt</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|Win32"> - <Configuration>Release</Configuration> - <Platform>Win32</Platform> - </ProjectConfiguration> - <ProjectConfiguration Include="Release|x64"> - <Configuration>Release</Configuration> - <Platform>x64</Platform> - </ProjectConfiguration> - </ItemGroup> - <ItemGroup> - <ClCompile Include="src\thrift\async\TAsyncProtocolProcessor.cpp"/> - <ClCompile Include="src\thrift\async\TEvhttpClientChannel.cpp"/> - <ClCompile Include="src\thrift\async\TEvhttpServer.cpp"/> - <ClCompile Include="src\thrift\server\TNonblockingServer.cpp"/> - </ItemGroup> - <ItemGroup> - <ClInclude Include="src\thrift\async\TAsyncProtocolProcessor.h" /> - <ClInclude Include="src\thrift\async\TEvhttpClientChannel.h" /> - <ClInclude Include="src\thrift\async\TEvhttpServer.h" /> - <ClInclude Include="src\thrift\server\TNonblockingServer.h" /> - <ClInclude Include="src\thrift\windows\config.h" /> - <ClInclude Include="src\thrift\windows\force_inc.h" /> - <ClInclude Include="src\thrift\windows\TargetVersion.h" /> - </ItemGroup> - <PropertyGroup Label="Globals"> - <ProjectGuid>{D8696CCE-7D46-4659-B432-91754A41DEB0}</ProjectGuid> - <Keyword>Win32Proj</Keyword> - <RootNamespace>libthriftnb</RootNamespace> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>true</UseDebugLibraries> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="Configuration"> - <ConfigurationType>StaticLibrary</ConfigurationType> - <UseDebugLibraries>false</UseDebugLibraries> - <WholeProgramOptimization>true</WholeProgramOptimization> - <CharacterSet>MultiByte</CharacterSet> - </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> - <ImportGroup Label="ExtensionSettings"> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'" Label="PropertySheets"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - <Import Project="3rdparty.props" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'"> - <IncludePath>$(ProjectDir)\src\;$(ProjectDir)\src\thrift\windows\;$(BOOST_ROOT)\include;$(BOOST_ROOT)\;$(LIBEVENT_ROOT)\WIN32-Code\;$(LIBEVENT_ROOT)\include;$(LIBEVENT_ROOT)\;$(IncludePath)</IncludePath> - </PropertyGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|Win32'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-mt|x64'"> - <ClCompile> - <PrecompiledHeader> - </PrecompiledHeader> - <WarningLevel>Level3</WarningLevel> - <Optimization>Disabled</Optimization> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|Win32'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <ProgramDataBaseFileName>$(IntDir)libthriftnb.pdb</ProgramDataBaseFileName> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release-mt|x64'"> - <ClCompile> - <WarningLevel>Level3</WarningLevel> - <PrecompiledHeader> - </PrecompiledHeader> - <Optimization>MaxSpeed</Optimization> - <FunctionLevelLinking>true</FunctionLevelLinking> - <IntrinsicFunctions>true</IntrinsicFunctions> - <PreprocessorDefinitions>HAVE_CONFIG_H=1;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <RuntimeLibrary>MultiThreaded</RuntimeLibrary> - </ClCompile> - <Link> - <SubSystem>Windows</SubSystem> - <GenerateDebugInformation>true</GenerateDebugInformation> - <EnableCOMDATFolding>true</EnableCOMDATFolding> - <OptimizeReferences>true</OptimizeReferences> - </Link> - </ItemDefinitionGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> - <ImportGroup Label="ExtensionTargets"> - </ImportGroup> -</Project>
http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters b/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters deleted file mode 100644 index 5245544..0000000 --- a/depends/thirdparty/thrift/lib/cpp/libthriftnb.vcxproj.filters +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <ItemGroup> - <Filter Include="server"> - <UniqueIdentifier>{bf449d92-4be8-4f6f-a010-c536f57c6f13}</UniqueIdentifier> - </Filter> - <Filter Include="async"> - <UniqueIdentifier>{0294d0a6-ce46-4be8-a659-826d6e98ae41}</UniqueIdentifier> - </Filter> - <Filter Include="windows"> - <UniqueIdentifier>{60fc9e5e-0866-4aba-8662-439bb4a461d3}</UniqueIdentifier> - </Filter> - </ItemGroup> - <ItemGroup> - <ClCompile Include="src\thrift\server\TNonblockingServer.cpp"> - <Filter>server</Filter> - </ClCompile> - <ClCompile Include="src\thrift\async\TEvhttpClientChannel.cpp"> - <Filter>async</Filter> - </ClCompile> - <ClCompile Include="src\thrift\async\TEvhttpServer.cpp"> - <Filter>async</Filter> - </ClCompile> - <ClCompile Include="src\thrift\async\TAsyncProtocolProcessor.cpp"> - <Filter>async</Filter> - </ClCompile> - <ClCompile Include="src\thrift\windows\StdAfx.cpp"> - <Filter>windows</Filter> - </ClCompile> - </ItemGroup> - <ItemGroup> - <ClInclude Include="src\thrift\server\TNonblockingServer.h"> - <Filter>server</Filter> - </ClInclude> - <ClInclude Include="src\thrift\async\TEvhttpClientChannel.h"> - <Filter>async</Filter> - </ClInclude> - <ClInclude Include="src\thrift\async\TEvhttpServer.h"> - <Filter>async</Filter> - </ClInclude> - <ClInclude Include="src\thrift\async\TAsyncProtocolProcessor.h"> - <Filter>async</Filter> - </ClInclude> - <ClInclude Include="src\thrift\windows\config.h"> - <Filter>windows</Filter> - </ClInclude> - <ClInclude Include="src\thrift\windows\StdAfx.h"> - <Filter>windows</Filter> - </ClInclude> - <ClInclude Include="src\thrift\windows\TargetVersion.h"> - <Filter>windows</Filter> - </ClInclude> - <ClInclude Include="src\thrift\windows\force_inc.h"> - <Filter>windows</Filter> - </ClInclude> - </ItemGroup> -</Project> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp deleted file mode 100644 index 2f14653..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include <thrift/TApplicationException.h> -#include <thrift/protocol/TProtocol.h> - -namespace apache { -namespace thrift { - -uint32_t TApplicationException::read(apache::thrift::protocol::TProtocol* iprot) { - uint32_t xfer = 0; - std::string fname; - apache::thrift::protocol::TType ftype; - int16_t fid; - - xfer += iprot->readStructBegin(fname); - - while (true) { - xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == apache::thrift::protocol::T_STOP) { - break; - } - switch (fid) { - case 1: - if (ftype == apache::thrift::protocol::T_STRING) { - xfer += iprot->readString(message_); - } else { - xfer += iprot->skip(ftype); - } - break; - case 2: - if (ftype == apache::thrift::protocol::T_I32) { - int32_t type; - xfer += iprot->readI32(type); - type_ = (TApplicationExceptionType)type; - } else { - xfer += iprot->skip(ftype); - } - break; - default: - xfer += iprot->skip(ftype); - break; - } - xfer += iprot->readFieldEnd(); - } - - xfer += iprot->readStructEnd(); - return xfer; -} - -uint32_t TApplicationException::write(apache::thrift::protocol::TProtocol* oprot) const { - uint32_t xfer = 0; - xfer += oprot->writeStructBegin("TApplicationException"); - xfer += oprot->writeFieldBegin("message", apache::thrift::protocol::T_STRING, 1); - xfer += oprot->writeString(message_); - xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("type", apache::thrift::protocol::T_I32, 2); - xfer += oprot->writeI32(type_); - xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldStop(); - xfer += oprot->writeStructEnd(); - return xfer; -} -} -} // apache::thrift http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h deleted file mode 100644 index 0de5391..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TApplicationException.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_ -#define _THRIFT_TAPPLICATIONEXCEPTION_H_ 1 - -#include <thrift/Thrift.h> - -namespace apache { -namespace thrift { - -namespace protocol { -class TProtocol; -} - -class TApplicationException : public TException { -public: - /** - * Error codes for the various types of exceptions. - */ - enum TApplicationExceptionType { - UNKNOWN = 0, - UNKNOWN_METHOD = 1, - INVALID_MESSAGE_TYPE = 2, - WRONG_METHOD_NAME = 3, - BAD_SEQUENCE_ID = 4, - MISSING_RESULT = 5, - INTERNAL_ERROR = 6, - PROTOCOL_ERROR = 7, - INVALID_TRANSFORM = 8, - INVALID_PROTOCOL = 9, - UNSUPPORTED_CLIENT_TYPE = 10 - }; - - TApplicationException() : TException(), type_(UNKNOWN) {} - - TApplicationException(TApplicationExceptionType type) : TException(), type_(type) {} - - TApplicationException(const std::string& message) : TException(message), type_(UNKNOWN) {} - - TApplicationException(TApplicationExceptionType type, const std::string& message) - : TException(message), type_(type) {} - - virtual ~TApplicationException() throw() {} - - /** - * Returns an error code that provides information about the type of error - * that has occurred. - * - * @return Error code - */ - TApplicationExceptionType getType() { return type_; } - - virtual const char* what() const throw() { - if (message_.empty()) { - switch (type_) { - case UNKNOWN: - return "TApplicationException: Unknown application exception"; - case UNKNOWN_METHOD: - return "TApplicationException: Unknown method"; - case INVALID_MESSAGE_TYPE: - return "TApplicationException: Invalid message type"; - case WRONG_METHOD_NAME: - return "TApplicationException: Wrong method name"; - case BAD_SEQUENCE_ID: - return "TApplicationException: Bad sequence identifier"; - case MISSING_RESULT: - return "TApplicationException: Missing result"; - case INTERNAL_ERROR: - return "TApplicationException: Internal error"; - case PROTOCOL_ERROR: - return "TApplicationException: Protocol error"; - case INVALID_TRANSFORM: - return "TApplicationException: Invalid transform"; - case INVALID_PROTOCOL: - return "TApplicationException: Invalid protocol"; - case UNSUPPORTED_CLIENT_TYPE: - return "TApplicationException: Unsupported client type"; - default: - return "TApplicationException: (Invalid exception type)"; - }; - } else { - return message_.c_str(); - } - } - - uint32_t read(protocol::TProtocol* iprot); - uint32_t write(protocol::TProtocol* oprot) const; - -protected: - /** - * Error code - */ - TApplicationExceptionType type_; -}; -} -} // apache::thrift - -#endif // #ifndef _THRIFT_TAPPLICATIONEXCEPTION_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h deleted file mode 100644 index fd1dce7..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TDispatchProcessor.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -#ifndef _THRIFT_TDISPATCHPROCESSOR_H_ -#define _THRIFT_TDISPATCHPROCESSOR_H_ 1 - -#include <thrift/TProcessor.h> - -namespace apache { -namespace thrift { - -/** - * TDispatchProcessor is a helper class to parse the message header then call - * another function to dispatch based on the function name. - * - * Subclasses must implement dispatchCall() to dispatch on the function name. - */ -template <class Protocol_> -class TDispatchProcessorT : public TProcessor { -public: - virtual bool process(boost::shared_ptr<protocol::TProtocol> in, - boost::shared_ptr<protocol::TProtocol> out, - void* connectionContext) { - protocol::TProtocol* inRaw = in.get(); - protocol::TProtocol* outRaw = out.get(); - - // Try to dynamic cast to the template protocol type - Protocol_* specificIn = dynamic_cast<Protocol_*>(inRaw); - Protocol_* specificOut = dynamic_cast<Protocol_*>(outRaw); - if (specificIn && specificOut) { - return processFast(specificIn, specificOut, connectionContext); - } - - // Log the fact that we have to use the slow path - T_GENERIC_PROTOCOL(this, inRaw, specificIn); - T_GENERIC_PROTOCOL(this, outRaw, specificOut); - - std::string fname; - protocol::TMessageType mtype; - int32_t seqid; - inRaw->readMessageBegin(fname, mtype, seqid); - - // If this doesn't look like a valid call, log an error and return false so - // that the server will close the connection. - // - // (The old generated processor code used to try to skip a T_STRUCT and - // continue. However, that seems unsafe.) - if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) { - GlobalOutput.printf("received invalid message type %d from client", mtype); - return false; - } - - return this->dispatchCall(inRaw, outRaw, fname, seqid, connectionContext); - } - -protected: - bool processFast(Protocol_* in, Protocol_* out, void* connectionContext) { - std::string fname; - protocol::TMessageType mtype; - int32_t seqid; - in->readMessageBegin(fname, mtype, seqid); - - if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) { - GlobalOutput.printf("received invalid message type %d from client", mtype); - return false; - } - - return this->dispatchCallTemplated(in, out, fname, seqid, connectionContext); - } - - /** - * dispatchCall() methods must be implemented by subclasses - */ - virtual bool dispatchCall(apache::thrift::protocol::TProtocol* in, - apache::thrift::protocol::TProtocol* out, - const std::string& fname, - int32_t seqid, - void* callContext) = 0; - - virtual bool dispatchCallTemplated(Protocol_* in, - Protocol_* out, - const std::string& fname, - int32_t seqid, - void* callContext) = 0; -}; - -/** - * Non-templatized version of TDispatchProcessor, that doesn't bother trying to - * perform a dynamic_cast. - */ -class TDispatchProcessor : public TProcessor { -public: - virtual bool process(boost::shared_ptr<protocol::TProtocol> in, - boost::shared_ptr<protocol::TProtocol> out, - void* connectionContext) { - std::string fname; - protocol::TMessageType mtype; - int32_t seqid; - in->readMessageBegin(fname, mtype, seqid); - - if (mtype != protocol::T_CALL && mtype != protocol::T_ONEWAY) { - GlobalOutput.printf("received invalid message type %d from client", mtype); - return false; - } - - return dispatchCall(in.get(), out.get(), fname, seqid, connectionContext); - } - -protected: - virtual bool dispatchCall(apache::thrift::protocol::TProtocol* in, - apache::thrift::protocol::TProtocol* out, - const std::string& fname, - int32_t seqid, - void* callContext) = 0; -}; - -// Specialize TDispatchProcessorT for TProtocol and TDummyProtocol just to use -// the generic TDispatchProcessor. -template <> -class TDispatchProcessorT<protocol::TDummyProtocol> : public TDispatchProcessor {}; -template <> -class TDispatchProcessorT<protocol::TProtocol> : public TDispatchProcessor {}; -} -} // apache::thrift - -#endif // _THRIFT_TDISPATCHPROCESSOR_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h deleted file mode 100644 index 07ff030..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TLogging.h +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_TLOGGING_H_ -#define _THRIFT_TLOGGING_H_ 1 - -#include <thrift/thrift-config.h> - -/** - * Contains utility macros for debugging and logging. - * - */ - -#include <time.h> - -#ifdef HAVE_STDINT_H -#include <stdint.h> -#endif - -/** - * T_GLOBAL_DEBUGGING_LEVEL = 0: all debugging turned off, debug macros undefined - * T_GLOBAL_DEBUGGING_LEVEL = 1: all debugging turned on - */ -#define T_GLOBAL_DEBUGGING_LEVEL 0 - -/** - * T_GLOBAL_LOGGING_LEVEL = 0: all logging turned off, logging macros undefined - * T_GLOBAL_LOGGING_LEVEL = 1: all logging turned on - */ -#define T_GLOBAL_LOGGING_LEVEL 1 - -/** - * Standard wrapper around fprintf what will prefix the file name and line - * number to the line. Uses T_GLOBAL_DEBUGGING_LEVEL to control whether it is - * turned on or off. - * - * @param format_string - */ -#if T_GLOBAL_DEBUGGING_LEVEL > 0 -#define T_DEBUG(format_string, ...) \ - if (T_GLOBAL_DEBUGGING_LEVEL > 0) { \ - fprintf(stderr, "[%s,%d] " format_string " \n", __FILE__, __LINE__, ##__VA_ARGS__); \ - } -#else -#define T_DEBUG(format_string, ...) -#endif - -/** - * analogous to T_DEBUG but also prints the time - * - * @param string format_string input: printf style format string - */ -#if T_GLOBAL_DEBUGGING_LEVEL > 0 -#define T_DEBUG_T(format_string, ...) \ - { \ - if (T_GLOBAL_DEBUGGING_LEVEL > 0) { \ - time_t now; \ - char dbgtime[26]; \ - time(&now); \ - THRIFT_CTIME_R(&now, dbgtime); \ - dbgtime[24] = '\0'; \ - fprintf(stderr, \ - "[%s,%d] [%s] " format_string " \n", \ - __FILE__, \ - __LINE__, \ - dbgtime, \ - ##__VA_ARGS__); \ - } \ - } -#else -#define T_DEBUG_T(format_string, ...) -#endif - -/** - * analogous to T_DEBUG but uses input level to determine whether or not the string - * should be logged. - * - * @param int level: specified debug level - * @param string format_string input: format string - */ -#define T_DEBUG_L(level, format_string, ...) \ - if ((level) > 0) { \ - fprintf(stderr, "[%s,%d] " format_string " \n", __FILE__, __LINE__, ##__VA_ARGS__); \ - } - -/** - * Explicit error logging. Prints time, file name and line number - * - * @param string format_string input: printf style format string - */ -#define T_ERROR(format_string, ...) \ - { \ - time_t now; \ - char dbgtime[26]; \ - time(&now); \ - THRIFT_CTIME_R(&now, dbgtime); \ - dbgtime[24] = '\0'; \ - fprintf(stderr, \ - "[%s,%d] [%s] ERROR: " format_string " \n", \ - __FILE__, \ - __LINE__, \ - dbgtime, \ - ##__VA_ARGS__); \ - } - -/** - * Analogous to T_ERROR, additionally aborting the process. - * WARNING: macro calls abort(), ending program execution - * - * @param string format_string input: printf style format string - */ -#define T_ERROR_ABORT(format_string, ...) \ - { \ - time_t now; \ - char dbgtime[26]; \ - time(&now); \ - THRIFT_CTIME_R(&now, dbgtime); \ - dbgtime[24] = '\0'; \ - fprintf(stderr, \ - "[%s,%d] [%s] ERROR: Going to abort " format_string " \n", \ - __FILE__, \ - __LINE__, \ - dbgtime, \ - ##__VA_ARGS__); \ - exit(1); \ - } - -/** - * Log input message - * - * @param string format_string input: printf style format string - */ -#if T_GLOBAL_LOGGING_LEVEL > 0 -#define T_LOG_OPER(format_string, ...) \ - { \ - if (T_GLOBAL_LOGGING_LEVEL > 0) { \ - time_t now; \ - char dbgtime[26]; \ - time(&now); \ - THRIFT_CTIME_R(&now, dbgtime); \ - dbgtime[24] = '\0'; \ - fprintf(stderr, "[%s] " format_string " \n", dbgtime, ##__VA_ARGS__); \ - } \ - } -#else -#define T_LOG_OPER(format_string, ...) -#endif - -/** - * T_GLOBAL_DEBUG_VIRTUAL = 0 or unset: normal operation, - * virtual call debug messages disabled - * T_GLOBAL_DEBUG_VIRTUAL = 1: log a debug messages whenever an - * avoidable virtual call is made - * T_GLOBAL_DEBUG_VIRTUAL = 2: record detailed info that can be - * printed by calling - * apache::thrift::profile_print_info() - */ -#if T_GLOBAL_DEBUG_VIRTUAL > 1 -#define T_VIRTUAL_CALL() ::apache::thrift::profile_virtual_call(typeid(*this)) -#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot) \ - do { \ - if (!(specific_prot)) { \ - ::apache::thrift::profile_generic_protocol(typeid(*template_class), typeid(*generic_prot)); \ - } \ - } while (0) -#elif T_GLOBAL_DEBUG_VIRTUAL == 1 -#define T_VIRTUAL_CALL() fprintf(stderr, "[%s,%d] virtual call\n", __FILE__, __LINE__) -#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot) \ - do { \ - if (!(specific_prot)) { \ - fprintf(stderr, "[%s,%d] failed to cast to specific protocol type\n", __FILE__, __LINE__); \ - } \ - } while (0) -#else -#define T_VIRTUAL_CALL() -#define T_GENERIC_PROTOCOL(template_class, generic_prot, specific_prot) -#endif - -#endif // #ifndef _THRIFT_TLOGGING_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp deleted file mode 100644 index 5739d0f..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include <thrift/Thrift.h> -#include <cstring> -#include <cstdlib> -#include <boost/lexical_cast.hpp> -#include <stdarg.h> -#include <stdio.h> - -namespace apache { -namespace thrift { - -TOutput GlobalOutput; - -void TOutput::printf(const char* message, ...) { -#ifndef THRIFT_SQUELCH_CONSOLE_OUTPUT - // Try to reduce heap usage, even if printf is called rarely. - static const int STACK_BUF_SIZE = 256; - char stack_buf[STACK_BUF_SIZE]; - va_list ap; - -#ifdef _MSC_VER - va_start(ap, message); - int need = _vscprintf(message, ap); - va_end(ap); - - if (need < STACK_BUF_SIZE) { - va_start(ap, message); - vsnprintf_s(stack_buf, STACK_BUF_SIZE, _TRUNCATE, message, ap); - va_end(ap); - f_(stack_buf); - return; - } -#else - va_start(ap, message); - int need = vsnprintf(stack_buf, STACK_BUF_SIZE, message, ap); - va_end(ap); - - if (need < STACK_BUF_SIZE) { - f_(stack_buf); - return; - } -#endif - - char* heap_buf = (char*)malloc((need + 1) * sizeof(char)); - if (heap_buf == NULL) { -#ifdef _MSC_VER - va_start(ap, message); - vsnprintf_s(stack_buf, STACK_BUF_SIZE, _TRUNCATE, message, ap); - va_end(ap); -#endif - // Malloc failed. We might as well print the stack buffer. - f_(stack_buf); - return; - } - - va_start(ap, message); - int rval = vsnprintf(heap_buf, need + 1, message, ap); - va_end(ap); - // TODO(shigin): inform user - if (rval != -1) { - f_(heap_buf); - } - free(heap_buf); -#endif -} - -void TOutput::errorTimeWrapper(const char* msg) { -#ifndef THRIFT_SQUELCH_CONSOLE_OUTPUT - time_t now; - char dbgtime[26]; - time(&now); - THRIFT_CTIME_R(&now, dbgtime); - dbgtime[24] = 0; - fprintf(stderr, "Thrift: %s %s\n", dbgtime, msg); -#endif -} - -void TOutput::perror(const char* message, int errno_copy) { - std::string out = message + strerror_s(errno_copy); - f_(out.c_str()); -} - -std::string TOutput::strerror_s(int errno_copy) { -#ifndef HAVE_STRERROR_R - return "errno = " + boost::lexical_cast<std::string>(errno_copy); -#else // HAVE_STRERROR_R - - char b_errbuf[1024] = {'\0'}; -#ifdef STRERROR_R_CHAR_P - char* b_error = strerror_r(errno_copy, b_errbuf, sizeof(b_errbuf)); -#else - char* b_error = b_errbuf; - int rv = strerror_r(errno_copy, b_errbuf, sizeof(b_errbuf)); - if (rv == -1) { - // strerror_r failed. omgwtfbbq. - return "XSI-compliant strerror_r() failed with errno = " - + boost::lexical_cast<std::string>(errno_copy); - } -#endif - // Can anyone prove that explicit cast is probably not necessary - // to ensure that the string object is constructed before - // b_error becomes invalid? - return std::string(b_error); - -#endif // HAVE_STRERROR_R -} -} -} // apache::thrift http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h deleted file mode 100644 index 1375f73..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TOutput.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_OUTPUT_H_ -#define _THRIFT_OUTPUT_H_ 1 - -namespace apache { -namespace thrift { - -class TOutput { -public: - TOutput() : f_(&errorTimeWrapper) {} - - inline void setOutputFunction(void (*function)(const char*)) { f_ = function; } - - inline void operator()(const char* message) { f_(message); } - - // It is important to have a const char* overload here instead of - // just the string version, otherwise errno could be corrupted - // if there is some problem allocating memory when constructing - // the string. - void perror(const char* message, int errno_copy); - inline void perror(const std::string& message, int errno_copy) { - perror(message.c_str(), errno_copy); - } - - void printf(const char* message, ...); - - static void errorTimeWrapper(const char* msg); - - /** Just like strerror_r but returns a C++ string object. */ - static std::string strerror_s(int errno_copy); - -private: - void (*f_)(const char*); -}; - -extern TOutput GlobalOutput; -} -} // namespace apache::thrift - -#endif //_THRIFT_OUTPUT_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h deleted file mode 100644 index d8f86c4..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TProcessor.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_TPROCESSOR_H_ -#define _THRIFT_TPROCESSOR_H_ 1 - -#include <string> -#include <thrift/protocol/TProtocol.h> -#include <boost/shared_ptr.hpp> - -namespace apache { -namespace thrift { - -/** - * Virtual interface class that can handle events from the processor. To - * use this you should subclass it and implement the methods that you care - * about. Your subclass can also store local data that you may care about, - * such as additional "arguments" to these methods (stored in the object - * instance's state). - */ -class TProcessorEventHandler { -public: - virtual ~TProcessorEventHandler() {} - - /** - * Called before calling other callback methods. - * Expected to return some sort of context object. - * The return value is passed to all other callbacks - * for that function invocation. - */ - virtual void* getContext(const char* fn_name, void* serverContext) { - (void)fn_name; - (void)serverContext; - return NULL; - } - - /** - * Expected to free resources associated with a context. - */ - virtual void freeContext(void* ctx, const char* fn_name) { - (void)ctx; - (void)fn_name; - } - - /** - * Called before reading arguments. - */ - virtual void preRead(void* ctx, const char* fn_name) { - (void)ctx; - (void)fn_name; - } - - /** - * Called between reading arguments and calling the handler. - */ - virtual void postRead(void* ctx, const char* fn_name, uint32_t bytes) { - (void)ctx; - (void)fn_name; - (void)bytes; - } - - /** - * Called between calling the handler and writing the response. - */ - virtual void preWrite(void* ctx, const char* fn_name) { - (void)ctx; - (void)fn_name; - } - - /** - * Called after writing the response. - */ - virtual void postWrite(void* ctx, const char* fn_name, uint32_t bytes) { - (void)ctx; - (void)fn_name; - (void)bytes; - } - - /** - * Called when an async function call completes successfully. - */ - virtual void asyncComplete(void* ctx, const char* fn_name) { - (void)ctx; - (void)fn_name; - } - - /** - * Called if the handler throws an undeclared exception. - */ - virtual void handlerError(void* ctx, const char* fn_name) { - (void)ctx; - (void)fn_name; - } - -protected: - TProcessorEventHandler() {} -}; - -/** - * A helper class used by the generated code to free each context. - */ -class TProcessorContextFreer { -public: - TProcessorContextFreer(TProcessorEventHandler* handler, void* context, const char* method) - : handler_(handler), context_(context), method_(method) {} - ~TProcessorContextFreer() { - if (handler_ != NULL) - handler_->freeContext(context_, method_); - } - void unregister() { handler_ = NULL; } - -private: - apache::thrift::TProcessorEventHandler* handler_; - void* context_; - const char* method_; -}; - -/** - * A processor is a generic object that acts upon two streams of data, one - * an input and the other an output. The definition of this object is loose, - * though the typical case is for some sort of server that either generates - * responses to an input stream or forwards data from one pipe onto another. - * - */ -class TProcessor { -public: - virtual ~TProcessor() {} - - virtual bool process(boost::shared_ptr<protocol::TProtocol> in, - boost::shared_ptr<protocol::TProtocol> out, - void* connectionContext) = 0; - - bool process(boost::shared_ptr<apache::thrift::protocol::TProtocol> io, void* connectionContext) { - return process(io, io, connectionContext); - } - - boost::shared_ptr<TProcessorEventHandler> getEventHandler() { return eventHandler_; } - - void setEventHandler(boost::shared_ptr<TProcessorEventHandler> eventHandler) { - eventHandler_ = eventHandler; - } - -protected: - TProcessor() {} - - boost::shared_ptr<TProcessorEventHandler> eventHandler_; -}; - -/** - * This is a helper class to allow boost::shared_ptr to be used with handler - * pointers returned by the generated handler factories. - * - * The handler factory classes generated by the thrift compiler return raw - * pointers, and factory->releaseHandler() must be called when the handler is - * no longer needed. - * - * A ReleaseHandler object can be instantiated and passed as the second - * parameter to a shared_ptr, so that factory->releaseHandler() will be called - * when the object is no longer needed, instead of deleting the pointer. - */ -template <typename HandlerFactory_> -class ReleaseHandler { -public: - ReleaseHandler(const boost::shared_ptr<HandlerFactory_>& handlerFactory) - : handlerFactory_(handlerFactory) {} - - void operator()(typename HandlerFactory_::Handler* handler) { - if (handler) { - handlerFactory_->releaseHandler(handler); - } - } - -private: - boost::shared_ptr<HandlerFactory_> handlerFactory_; -}; - -struct TConnectionInfo { - // The input and output protocols - boost::shared_ptr<protocol::TProtocol> input; - boost::shared_ptr<protocol::TProtocol> output; - // The underlying transport used for the connection - // This is the transport that was returned by TServerTransport::accept(), - // and it may be different than the transport pointed to by the input and - // output protocols. - boost::shared_ptr<transport::TTransport> transport; -}; - -class TProcessorFactory { -public: - virtual ~TProcessorFactory() {} - - /** - * Get the TProcessor to use for a particular connection. - * - * This method is always invoked in the same thread that the connection was - * accepted on. This generally means that this call does not need to be - * thread safe, as it will always be invoked from a single thread. - */ - virtual boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo& connInfo) = 0; -}; - -class TSingletonProcessorFactory : public TProcessorFactory { -public: - TSingletonProcessorFactory(boost::shared_ptr<TProcessor> processor) : processor_(processor) {} - - boost::shared_ptr<TProcessor> getProcessor(const TConnectionInfo&) { return processor_; } - -private: - boost::shared_ptr<TProcessor> processor_; -}; -} -} // apache::thrift - -#endif // #ifndef _THRIFT_TPROCESSOR_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h deleted file mode 100644 index 5023869..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/TToString.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_TOSTRING_H_ -#define _THRIFT_TOSTRING_H_ 1 - -#include <boost/lexical_cast.hpp> - -#include <vector> -#include <map> -#include <set> -#include <string> -#include <sstream> - -namespace apache { -namespace thrift { - -template <typename T> -std::string to_string(const T& t) { - return boost::lexical_cast<std::string>(t); -} - -template <typename K, typename V> -std::string to_string(const std::map<K, V>& m); - -template <typename T> -std::string to_string(const std::set<T>& s); - -template <typename T> -std::string to_string(const std::vector<T>& t); - -template <typename K, typename V> -std::string to_string(const typename std::pair<K, V>& v) { - std::ostringstream o; - o << to_string(v.first) << ": " << to_string(v.second); - return o.str(); -} - -template <typename T> -std::string to_string(const T& beg, const T& end) { - std::ostringstream o; - for (T it = beg; it != end; ++it) { - if (it != beg) - o << ", "; - o << to_string(*it); - } - return o.str(); -} - -template <typename T> -std::string to_string(const std::vector<T>& t) { - std::ostringstream o; - o << "[" << to_string(t.begin(), t.end()) << "]"; - return o.str(); -} - -template <typename K, typename V> -std::string to_string(const std::map<K, V>& m) { - std::ostringstream o; - o << "{" << to_string(m.begin(), m.end()) << "}"; - return o.str(); -} - -template <typename T> -std::string to_string(const std::set<T>& s) { - std::ostringstream o; - o << "{" << to_string(s.begin(), s.end()) << "}"; - return o.str(); -} -} -} // apache::thrift - -#endif // _THRIFT_TOSTRING_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h deleted file mode 100644 index e8e70eb..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/Thrift.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_THRIFT_H_ -#define _THRIFT_THRIFT_H_ 1 - -#include <thrift/transport/PlatformSocket.h> - -#include <thrift/thrift-config.h> - -#include <stdio.h> -#include <assert.h> - -#include <sys/types.h> -#ifdef HAVE_NETINET_IN_H -#include <netinet/in.h> -#endif -#ifdef HAVE_INTTYPES_H -#include <inttypes.h> -#endif -#include <string> -#include <map> -#include <list> -#include <set> -#include <vector> -#include <exception> -#include <typeinfo> - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_convertible.hpp> - -#include <thrift/TLogging.h> -#include <thrift/TOutput.h> - -#define THRIFT_UNUSED_VARIABLE(x) ((void)(x)) - -namespace apache { -namespace thrift { - -class TEnumIterator - : public std::iterator<std::forward_iterator_tag, std::pair<int, const char*> > { -public: - TEnumIterator(int n, int* enums, const char** names) - : ii_(0), n_(n), enums_(enums), names_(names) {} - - int operator++() { return ++ii_; } - - bool operator!=(const TEnumIterator& end) { - THRIFT_UNUSED_VARIABLE(end); - assert(end.n_ == -1); - return (ii_ != n_); - } - - std::pair<int, const char*> operator*() const { return std::make_pair(enums_[ii_], names_[ii_]); } - -private: - int ii_; - const int n_; - int* enums_; - const char** names_; -}; - -class TException : public std::exception { -public: - TException() : message_() {} - - TException(const std::string& message) : message_(message) {} - - virtual ~TException() throw() {} - - virtual const char* what() const throw() { - if (message_.empty()) { - return "Default TException."; - } else { - return message_.c_str(); - } - } - -protected: - std::string message_; -}; - -class TDelayedException { -public: - template <class E> - static TDelayedException* delayException(const E& e); - virtual void throw_it() = 0; - virtual ~TDelayedException(){}; -}; - -template <class E> -class TExceptionWrapper : public TDelayedException { -public: - TExceptionWrapper(const E& e) : e_(e) {} - virtual void throw_it() { - E temp(e_); - delete this; - throw temp; - } - -private: - E e_; -}; - -template <class E> -TDelayedException* TDelayedException::delayException(const E& e) { - return new TExceptionWrapper<E>(e); -} - -#if T_GLOBAL_DEBUG_VIRTUAL > 1 -void profile_virtual_call(const std::type_info& info); -void profile_generic_protocol(const std::type_info& template_type, const std::type_info& prot_type); -void profile_print_info(FILE* f); -void profile_print_info(); -void profile_write_pprof(FILE* gen_calls_f, FILE* virtual_calls_f); -#endif -} -} // apache::thrift - -#endif // #ifndef _THRIFT_THRIFT_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp deleted file mode 100644 index 6ce346b..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/VirtualProfiling.cpp +++ /dev/null @@ -1,425 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include <thrift/Thrift.h> - -// Do nothing if virtual call profiling is not enabled -#if T_GLOBAL_DEBUG_VIRTUAL > 1 - -// TODO: This code only works with g++ (since we rely on the fact -// that all std::type_info instances referring to a particular type -// always return the exact same pointer value from name().) -#ifndef __GNUG__ -#error "Thrift virtual function profiling currently only works with gcc" -#endif // !__GNUG__ - -// TODO: We also require glibc for the backtrace() and backtrace_symbols() -// functions. -#ifndef __GLIBC__ -#error "Thrift virtual function profiling currently requires glibc" -#endif // !__GLIBC__ - -#include <thrift/concurrency/Mutex.h> - -#include <ext/hash_map> -#include <execinfo.h> -#include <stdio.h> - -namespace apache { -namespace thrift { - -using ::apache::thrift::concurrency::Mutex; -using ::apache::thrift::concurrency::Guard; - -static const unsigned int MAX_STACK_DEPTH = 15; - -/** - * A stack trace - */ -class Backtrace { -public: - Backtrace(int skip = 0); - Backtrace(Backtrace const& bt); - - void operator=(Backtrace const& bt) { - numCallers_ = bt.numCallers_; - if (numCallers_ >= 0) { - memcpy(callers_, bt.callers_, numCallers_ * sizeof(void*)); - } - } - - bool operator==(Backtrace const& bt) const { return (cmp(bt) == 0); } - - size_t hash() const { - intptr_t ret = 0; - for (int n = 0; n < numCallers_; ++n) { - ret ^= reinterpret_cast<intptr_t>(callers_[n]); - } - return static_cast<size_t>(ret); - } - - int cmp(Backtrace const& bt) const { - int depth_diff = (numCallers_ - bt.numCallers_); - if (depth_diff != 0) { - return depth_diff; - } - - for (int n = 0; n < numCallers_; ++n) { - int diff = reinterpret_cast<intptr_t>(callers_[n]) - - reinterpret_cast<intptr_t>(bt.callers_[n]); - if (diff != 0) { - return diff; - } - } - - return 0; - } - - void print(FILE* f, int indent = 0, int start = 0) const { - char** strings = backtrace_symbols(callers_, numCallers_); - if (strings) { - start += skip_; - if (start < 0) { - start = 0; - } - for (int n = start; n < numCallers_; ++n) { - fprintf(f, "%*s#%-2d %s\n", indent, "", n, strings[n]); - } - free(strings); - } else { - fprintf(f, "%*s<failed to determine symbols>\n", indent, ""); - } - } - - int getDepth() const { return numCallers_ - skip_; } - - void* getFrame(int index) const { - int adjusted_index = index + skip_; - if (adjusted_index < 0 || adjusted_index >= numCallers_) { - return NULL; - } - return callers_[adjusted_index]; - } - -private: - void* callers_[MAX_STACK_DEPTH]; - int numCallers_; - int skip_; -}; - -// Define the constructors non-inline, so they consistently add a single -// frame to the stack trace, regardless of whether optimization is enabled -Backtrace::Backtrace(int skip) - : skip_(skip + 1) // ignore the constructor itself -{ - numCallers_ = backtrace(callers_, MAX_STACK_DEPTH); - if (skip_ > numCallers_) { - skip_ = numCallers_; - } -} - -Backtrace::Backtrace(Backtrace const& bt) : numCallers_(bt.numCallers_), skip_(bt.skip_) { - if (numCallers_ >= 0) { - memcpy(callers_, bt.callers_, numCallers_ * sizeof(void*)); - } -} - -/** - * A backtrace, plus one or two type names - */ -class Key { -public: - class Hash { - public: - size_t operator()(Key const& k) const { return k.hash(); } - }; - - Key(const Backtrace* bt, const std::type_info& type_info) - : backtrace_(bt), typeName1_(type_info.name()), typeName2_(NULL) {} - - Key(const Backtrace* bt, const std::type_info& type_info1, const std::type_info& type_info2) - : backtrace_(bt), typeName1_(type_info1.name()), typeName2_(type_info2.name()) {} - - Key(const Key& k) - : backtrace_(k.backtrace_), typeName1_(k.typeName1_), typeName2_(k.typeName2_) {} - - void operator=(const Key& k) { - backtrace_ = k.backtrace_; - typeName1_ = k.typeName1_; - typeName2_ = k.typeName2_; - } - - const Backtrace* getBacktrace() const { return backtrace_; } - - const char* getTypeName() const { return typeName1_; } - - const char* getTypeName2() const { return typeName2_; } - - void makePersistent() { - // Copy the Backtrace object - backtrace_ = new Backtrace(*backtrace_); - - // NOTE: We don't copy the type name. - // The GNU libstdc++ implementation of type_info::name() returns a value - // that will be valid for the lifetime of the program. (Although the C++ - // standard doesn't guarantee this will be true on all implementations.) - } - - /** - * Clean up memory allocated by makePersistent() - * - * Should only be invoked if makePersistent() has previously been called. - * The Key should no longer be used after cleanup() is called. - */ - void cleanup() { - delete backtrace_; - backtrace_ = NULL; - } - - int cmp(const Key& k) const { - int ret = backtrace_->cmp(*k.backtrace_); - if (ret != 0) { - return ret; - } - - // NOTE: We compare just the name pointers. - // With GNU libstdc++, every type_info object for the same type points to - // exactly the same name string. (Although this isn't guaranteed by the - // C++ standard.) - ret = k.typeName1_ - typeName1_; - if (ret != 0) { - return ret; - } - return k.typeName2_ - typeName2_; - } - - bool operator==(const Key& k) const { return cmp(k) == 0; } - - size_t hash() const { - // NOTE: As above, we just use the name pointer value. - // Works with GNU libstdc++, but not guaranteed to be correct on all - // implementations. - return backtrace_->hash() ^ reinterpret_cast<size_t>(typeName1_) - ^ reinterpret_cast<size_t>(typeName2_); - } - -private: - const Backtrace* backtrace_; - const char* typeName1_; - const char* typeName2_; -}; - -/** - * A functor that determines which of two BacktraceMap entries - * has a higher count. - */ -class CountGreater { -public: - bool operator()(std::pair<Key, size_t> bt1, std::pair<Key, size_t> bt2) const { - return bt1.second > bt2.second; - } -}; - -typedef __gnu_cxx::hash_map<Key, size_t, Key::Hash> BacktraceMap; - -/** - * A map describing how many times T_VIRTUAL_CALL() has been invoked. - */ -BacktraceMap virtual_calls; -Mutex virtual_calls_mutex; - -/** - * A map describing how many times T_GENERIC_PROTOCOL() has been invoked. - */ -BacktraceMap generic_calls; -Mutex generic_calls_mutex; - -void _record_backtrace(BacktraceMap* map, const Mutex& mutex, Key* k) { - Guard guard(mutex); - - BacktraceMap::iterator it = map->find(*k); - if (it == map->end()) { - k->makePersistent(); - map->insert(std::make_pair(*k, 1)); - } else { - // increment the count - // NOTE: we could assert if it->second is 0 afterwards, since that would - // mean we've wrapped. - ++(it->second); - } -} - -/** - * Record an unnecessary virtual function call. - * - * This method is invoked by the T_VIRTUAL_CALL() macro. - */ -void profile_virtual_call(const std::type_info& type) { - int const skip = 1; // ignore this frame - Backtrace bt(skip); - Key k(&bt, type); - _record_backtrace(&virtual_calls, virtual_calls_mutex, &k); -} - -/** - * Record a call to a template processor with a protocol that is not the one - * specified in the template parameter. - * - * This method is invoked by the T_GENERIC_PROTOCOL() macro. - */ -void profile_generic_protocol(const std::type_info& template_type, - const std::type_info& prot_type) { - int const skip = 1; // ignore this frame - Backtrace bt(skip); - Key k(&bt, template_type, prot_type); - _record_backtrace(&generic_calls, generic_calls_mutex, &k); -} - -/** - * Print the recorded profiling information to the specified file. - */ -void profile_print_info(FILE* f) { - typedef std::vector<std::pair<Key, size_t> > BacktraceVector; - - CountGreater is_greater; - - // Grab both locks for the duration of the print operation, - // to ensure the output is a consistent snapshot of a single point in time - Guard generic_calls_guard(generic_calls_mutex); - Guard virtual_calls_guard(virtual_calls_mutex); - - // print the info from generic_calls, sorted by frequency - // - // We print the generic_calls info ahead of virtual_calls, since it is more - // useful in some cases. All T_GENERIC_PROTOCOL calls can be eliminated - // from most programs. Not all T_VIRTUAL_CALLs will be eliminated by - // converting to templates. - BacktraceVector gp_sorted(generic_calls.begin(), generic_calls.end()); - std::sort(gp_sorted.begin(), gp_sorted.end(), is_greater); - - for (BacktraceVector::const_iterator it = gp_sorted.begin(); it != gp_sorted.end(); ++it) { - Key const& key = it->first; - size_t const count = it->second; - fprintf(f, - "T_GENERIC_PROTOCOL: %zu calls to %s with a %s:\n", - count, - key.getTypeName(), - key.getTypeName2()); - key.getBacktrace()->print(f, 2); - fprintf(f, "\n"); - } - - // print the info from virtual_calls, sorted by frequency - BacktraceVector vc_sorted(virtual_calls.begin(), virtual_calls.end()); - std::sort(vc_sorted.begin(), vc_sorted.end(), is_greater); - - for (BacktraceVector::const_iterator it = vc_sorted.begin(); it != vc_sorted.end(); ++it) { - Key const& key = it->first; - size_t const count = it->second; - fprintf(f, "T_VIRTUAL_CALL: %zu calls on %s:\n", count, key.getTypeName()); - key.getBacktrace()->print(f, 2); - fprintf(f, "\n"); - } -} - -/** - * Print the recorded profiling information to stdout. - */ -void profile_print_info() { - profile_print_info(stdout); -} - -/** - * Write a BacktraceMap as Google CPU profiler binary data. - */ -static void profile_write_pprof_file(FILE* f, BacktraceMap const& map) { - // Write the header - uintptr_t header[5] = {0, 3, 0, 0, 0}; - fwrite(&header, sizeof(header), 1, f); - - // Write the profile records - for (BacktraceMap::const_iterator it = map.begin(); it != map.end(); ++it) { - uintptr_t count = it->second; - fwrite(&count, sizeof(count), 1, f); - - Backtrace const* bt = it->first.getBacktrace(); - uintptr_t num_pcs = bt->getDepth(); - fwrite(&num_pcs, sizeof(num_pcs), 1, f); - - for (uintptr_t n = 0; n < num_pcs; ++n) { - void* pc = bt->getFrame(n); - fwrite(&pc, sizeof(pc), 1, f); - } - } - - // Write the trailer - uintptr_t trailer[3] = {0, 1, 0}; - fwrite(&trailer, sizeof(trailer), 1, f); - - // Write /proc/self/maps - // TODO(simpkins): This only works on linux - FILE* proc_maps = fopen("/proc/self/maps", "r"); - if (proc_maps) { - uint8_t buf[4096]; - while (true) { - size_t bytes_read = fread(buf, 1, sizeof(buf), proc_maps); - if (bytes_read == 0) { - break; - } - fwrite(buf, 1, bytes_read, f); - } - fclose(proc_maps); - } -} - -/** - * Write the recorded profiling information as pprof files. - * - * This writes the information using the Google CPU profiler binary data - * format, so it can be analyzed with pprof. Note that information about the - * protocol/transport data types cannot be stored in this file format. - * - * See http://code.google.com/p/google-perftools/ for more details. - * - * @param gen_calls_f The information about calls to - * profile_generic_protocol() will be written to this - * file. - * @param virtual_calls_f The information about calls to - * profile_virtual_call() will be written to this file. - */ -void profile_write_pprof(FILE* gen_calls_f, FILE* virtual_calls_f) { - typedef std::vector<std::pair<Key, size_t> > BacktraceVector; - - CountGreater is_greater; - - // Grab both locks for the duration of the print operation, - // to ensure the output is a consistent snapshot of a single point in time - Guard generic_calls_guard(generic_calls_mutex); - Guard virtual_calls_guard(virtual_calls_mutex); - - // write the info from generic_calls - profile_write_pprof_file(gen_calls_f, generic_calls); - - // write the info from virtual_calls - profile_write_pprof_file(virtual_calls_f, virtual_calls); -} -} -} // apache::thrift - -#endif // T_GLOBAL_PROFILE_VIRTUAL > 0 http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h deleted file mode 100644 index 3c957a6..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncBufferProcessor.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_ -#define _THRIFT_TASYNC_BUFFER_PROCESSOR_H_ 1 - -#include <thrift/cxxfunctional.h> -#include <boost/shared_ptr.hpp> - -#include <thrift/transport/TBufferTransports.h> - -namespace apache { -namespace thrift { -namespace async { - -class TAsyncBufferProcessor { -public: - // Process data in "in", putting the result in "out". - // Call _return(true) when done, or _return(false) to - // forcefully close the connection (if applicable). - // "in" and "out" should be TMemoryBuffer or similar, - // not a wrapper around a socket. - virtual void process(apache::thrift::stdcxx::function<void(bool healthy)> _return, - boost::shared_ptr<apache::thrift::transport::TBufferBase> ibuf, - boost::shared_ptr<apache::thrift::transport::TBufferBase> obuf) = 0; - virtual ~TAsyncBufferProcessor() {} -}; -} -} -} // apache::thrift::async - -#endif // #ifndef _THRIFT_TASYNC_BUFFER_PROCESSOR_H_ http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp deleted file mode 100644 index 4716af2..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#include <thrift/async/TAsyncChannel.h> -#include <thrift/cxxfunctional.h> - -namespace apache { -namespace thrift { -namespace async { - -void TAsyncChannel::sendAndRecvMessage(const VoidCallback& cob, - TMemoryBuffer* sendBuf, - TMemoryBuffer* recvBuf) { - apache::thrift::stdcxx::function<void()> send_done - = apache::thrift::stdcxx::bind(&TAsyncChannel::recvMessage, this, cob, recvBuf); - - sendMessage(send_done, sendBuf); -} -} -} -} // apache::thrift::async http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/928eade3/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h ---------------------------------------------------------------------- diff --git a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h b/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h deleted file mode 100644 index eb3ce2a..0000000 --- a/depends/thirdparty/thrift/lib/cpp/src/thrift/async/TAsyncChannel.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#ifndef _THRIFT_ASYNC_TASYNCCHANNEL_H_ -#define _THRIFT_ASYNC_TASYNCCHANNEL_H_ 1 - -#include <thrift/cxxfunctional.h> -#include <thrift/Thrift.h> - -namespace apache { -namespace thrift { -namespace transport { -class TMemoryBuffer; -} -} -} - -namespace apache { -namespace thrift { -namespace async { -using apache::thrift::transport::TMemoryBuffer; - -class TAsyncChannel { -public: - typedef apache::thrift::stdcxx::function<void()> VoidCallback; - - virtual ~TAsyncChannel() {} - - // is the channel in a good state? - virtual bool good() const = 0; - virtual bool error() const = 0; - virtual bool timedOut() const = 0; - - /** - * Send a message over the channel. - */ - virtual void sendMessage(const VoidCallback& cob, - apache::thrift::transport::TMemoryBuffer* message) = 0; - - /** - * Receive a message from the channel. - */ - virtual void recvMessage(const VoidCallback& cob, - apache::thrift::transport::TMemoryBuffer* message) = 0; - - /** - * Send a message over the channel and receive a response. - */ - virtual void sendAndRecvMessage(const VoidCallback& cob, - apache::thrift::transport::TMemoryBuffer* sendBuf, - apache::thrift::transport::TMemoryBuffer* recvBuf); -}; -} -} -} // apache::thrift::async - -#endif // #ifndef _THRIFT_ASYNC_TASYNCCHANNEL_H_
