From: T Jake Luciani Date: Sat, 31 Jan 2009 22:36:20 +0000 (+0000) Subject: THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift X-Git-Tag: 0.2.0~341 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=b5e6221eb5cbabab25d5c9badb7262b15c42cfdd;p=common%2Fthrift.git THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739644 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/compiler/cpp/src/generate/t_cpp_generator.cc b/compiler/cpp/src/generate/t_cpp_generator.cc index 2bb24c43..4cb35384 100644 --- a/compiler/cpp/src/generate/t_cpp_generator.cc +++ b/compiler/cpp/src/generate/t_cpp_generator.cc @@ -618,7 +618,7 @@ void t_cpp_generator::generate_struct_definition(ofstream& out, bool write) { string extends = ""; if (is_exception) { - extends = " : public facebook::thrift::TException"; + extends = " : public apache::thrift::TException"; } // Open struct def @@ -687,7 +687,7 @@ void t_cpp_generator::generate_struct_definition(ofstream& out, // Pointer to this structure's reflection local typespec. if (gen_dense_) { indent(out) << - "static facebook::thrift::reflection::local::TypeSpec* local_reflection;" << + "static apache::thrift::reflection::local::TypeSpec* local_reflection;" << endl << endl; } @@ -784,11 +784,11 @@ void t_cpp_generator::generate_struct_definition(ofstream& out, } if (read) { out << - indent() << "uint32_t read(facebook::thrift::protocol::TProtocol* iprot);" << endl; + indent() << "uint32_t read(apache::thrift::protocol::TProtocol* iprot);" << endl; } if (write) { out << - indent() << "uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const;" << endl; + indent() << "uint32_t write(apache::thrift::protocol::TProtocol* oprot) const;" << endl; } out << endl; @@ -879,7 +879,7 @@ void t_cpp_generator::generate_local_reflection(std::ofstream& out, // For definitions of structures, do the arrays of metas and field specs also. if (is_definition) { out << - indent() << "facebook::thrift::reflection::local::FieldMeta" << endl << + indent() << "apache::thrift::reflection::local::FieldMeta" << endl << indent() << local_reflection_name("metas", ttype) <<"[] = {" << endl; indent_up(); for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) { @@ -892,7 +892,7 @@ void t_cpp_generator::generate_local_reflection(std::ofstream& out, indent_down(); out << - indent() << "facebook::thrift::reflection::local::TypeSpec*" << endl << + indent() << "apache::thrift::reflection::local::TypeSpec*" << endl << indent() << local_reflection_name("specs", ttype) <<"[] = {" << endl; indent_up(); for (m_iter = members.begin(); m_iter != members.end(); ++m_iter) { @@ -909,7 +909,7 @@ void t_cpp_generator::generate_local_reflection(std::ofstream& out, out << indent() << "// " << ttype->get_fingerprint_material() << endl << indent() << (is_definition ? "" : "extern ") << - "facebook::thrift::reflection::local::TypeSpec" << endl << + "apache::thrift::reflection::local::TypeSpec" << endl << local_reflection_name("typespec", ttype) << (is_definition ? "(" : ";") << endl; @@ -921,7 +921,7 @@ void t_cpp_generator::generate_local_reflection(std::ofstream& out, indent_up(); if (ttype->is_void()) { - indent(out) << "facebook::thrift::protocol::T_STOP"; + indent(out) << "apache::thrift::protocol::T_STOP"; } else { indent(out) << type_to_enum(ttype); } @@ -960,7 +960,7 @@ void t_cpp_generator::generate_local_reflection_pointer(std::ofstream& out, return; } indent(out) << - "facebook::thrift::reflection::local::TypeSpec* " << + "apache::thrift::reflection::local::TypeSpec* " << ttype->get_name() << "::local_reflection = " << endl << indent() << " &" << local_reflection_name("typespec", ttype) << ";" << endl << endl; @@ -976,7 +976,7 @@ void t_cpp_generator::generate_struct_reader(ofstream& out, t_struct* tstruct, bool pointers) { indent(out) << - "uint32_t " << tstruct->get_name() << "::read(facebook::thrift::protocol::TProtocol* iprot) {" << endl; + "uint32_t " << tstruct->get_name() << "::read(apache::thrift::protocol::TProtocol* iprot) {" << endl; indent_up(); const vector& fields = tstruct->get_members(); @@ -987,12 +987,12 @@ void t_cpp_generator::generate_struct_reader(ofstream& out, endl << indent() << "uint32_t xfer = 0;" << endl << indent() << "std::string fname;" << endl << - indent() << "facebook::thrift::protocol::TType ftype;" << endl << + indent() << "apache::thrift::protocol::TType ftype;" << endl << indent() << "int16_t fid;" << endl << endl << indent() << "xfer += iprot->readStructBegin(fname);" << endl << endl << - indent() << "using facebook::thrift::protocol::TProtocolException;" << endl << + indent() << "using apache::thrift::protocol::TProtocolException;" << endl << endl; // Required variables aren't in __isset, so we need tmp vars to check them. @@ -1014,7 +1014,7 @@ void t_cpp_generator::generate_struct_reader(ofstream& out, // Check for field STOP marker out << - indent() << "if (ftype == facebook::thrift::protocol::T_STOP) {" << endl << + indent() << "if (ftype == apache::thrift::protocol::T_STOP) {" << endl << indent() << " break;" << endl << indent() << "}" << endl; @@ -1115,7 +1115,7 @@ void t_cpp_generator::generate_struct_writer(ofstream& out, vector::const_iterator f_iter; indent(out) << - "uint32_t " << tstruct->get_name() << "::write(facebook::thrift::protocol::TProtocol* oprot) const {" << endl; + "uint32_t " << tstruct->get_name() << "::write(apache::thrift::protocol::TProtocol* oprot) const {" << endl; indent_up(); out << @@ -1177,7 +1177,7 @@ void t_cpp_generator::generate_struct_result_writer(ofstream& out, vector::const_iterator f_iter; indent(out) << - "uint32_t " << tstruct->get_name() << "::write(facebook::thrift::protocol::TProtocol* oprot) const {" << endl; + "uint32_t " << tstruct->get_name() << "::write(apache::thrift::protocol::TProtocol* oprot) const {" << endl; indent_up(); out << @@ -1360,12 +1360,12 @@ void t_cpp_generator::generate_service_interface(t_service* tservice) { if (gen_reflection_limited_) { f_header_ << indent() << "static void getStaticLimitedReflection" << - "(facebook::thrift::reflection::limited::Service & _return);" << endl; + "(apache::thrift::reflection::limited::Service & _return);" << endl; // TODO(dreiss): Uncomment and test this if we decide we need // a virtual function with this effect. //f_header_ << // indent() << "virtual void getVirtualLimitedReflection" << - // "(facebook::thrift::reflection::limited::Service & _return) "; + // "(apache::thrift::reflection::limited::Service & _return) "; //scope_up(f_header_); //f_header_ << // indent() << "getStaticLimitedReflection(_return);" << endl; @@ -1575,7 +1575,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { indent_up(); f_header_ << - indent() << service_name_ << "Client(boost::shared_ptr prot) :" << endl; + indent() << service_name_ << "Client(boost::shared_ptr prot) :" << endl; if (extends.empty()) { f_header_ << indent() << " piprot_(prot)," << endl << @@ -1589,7 +1589,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { } f_header_ << - indent() << service_name_ << "Client(boost::shared_ptr iprot, boost::shared_ptr oprot) :" << endl; + indent() << service_name_ << "Client(boost::shared_ptr iprot, boost::shared_ptr oprot) :" << endl; if (extends.empty()) { f_header_ << indent() << " piprot_(iprot)," << endl << @@ -1604,12 +1604,12 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { // Generate getters for the protocols. f_header_ << - indent() << "boost::shared_ptr getInputProtocol() {" << endl << + indent() << "boost::shared_ptr getInputProtocol() {" << endl << indent() << " return piprot_;" << endl << indent() << "}" << endl; f_header_ << - indent() << "boost::shared_ptr getOutputProtocol() {" << endl << + indent() << "boost::shared_ptr getOutputProtocol() {" << endl << indent() << " return poprot_;" << endl << indent() << "}" << endl; @@ -1636,10 +1636,10 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { " protected:" << endl; indent_up(); f_header_ << - indent() << "boost::shared_ptr piprot_;" << endl << - indent() << "boost::shared_ptr poprot_;" << endl << - indent() << "facebook::thrift::protocol::TProtocol* iprot_;" << endl << - indent() << "facebook::thrift::protocol::TProtocol* oprot_;" << endl; + indent() << "boost::shared_ptr piprot_;" << endl << + indent() << "boost::shared_ptr poprot_;" << endl << + indent() << "apache::thrift::protocol::TProtocol* iprot_;" << endl << + indent() << "apache::thrift::protocol::TProtocol* oprot_;" << endl; indent_down(); } @@ -1710,7 +1710,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { // Serialize the request f_service_ << indent() << "int32_t cseqid = 0;" << endl << - indent() << "oprot_->writeMessageBegin(\"" << (*f_iter)->get_name() << "\", facebook::thrift::protocol::T_CALL, cseqid);" << endl << + indent() << "oprot_->writeMessageBegin(\"" << (*f_iter)->get_name() << "\", apache::thrift::protocol::T_CALL, cseqid);" << endl << endl << indent() << argsname << " args;" << endl; @@ -1744,27 +1744,27 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { endl << indent() << "int32_t rseqid = 0;" << endl << indent() << "std::string fname;" << endl << - indent() << "facebook::thrift::protocol::TMessageType mtype;" << endl << + indent() << "apache::thrift::protocol::TMessageType mtype;" << endl << endl << indent() << "iprot_->readMessageBegin(fname, mtype, rseqid);" << endl << - indent() << "if (mtype == facebook::thrift::protocol::T_EXCEPTION) {" << endl << - indent() << " facebook::thrift::TApplicationException x;" << endl << + indent() << "if (mtype == apache::thrift::protocol::T_EXCEPTION) {" << endl << + indent() << " apache::thrift::TApplicationException x;" << endl << indent() << " x.read(iprot_);" << endl << indent() << " iprot_->readMessageEnd();" << endl << indent() << " iprot_->getTransport()->readEnd();" << endl << indent() << " throw x;" << endl << indent() << "}" << endl << - indent() << "if (mtype != facebook::thrift::protocol::T_REPLY) {" << endl << - indent() << " iprot_->skip(facebook::thrift::protocol::T_STRUCT);" << endl << + indent() << "if (mtype != apache::thrift::protocol::T_REPLY) {" << endl << + indent() << " iprot_->skip(apache::thrift::protocol::T_STRUCT);" << endl << indent() << " iprot_->readMessageEnd();" << endl << indent() << " iprot_->getTransport()->readEnd();" << endl << - indent() << " throw facebook::thrift::TApplicationException(facebook::thrift::TApplicationException::INVALID_MESSAGE_TYPE);" << endl << + indent() << " throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE);" << endl << indent() << "}" << endl << indent() << "if (fname.compare(\"" << (*f_iter)->get_name() << "\") != 0) {" << endl << - indent() << " iprot_->skip(facebook::thrift::protocol::T_STRUCT);" << endl << + indent() << " iprot_->skip(apache::thrift::protocol::T_STRUCT);" << endl << indent() << " iprot_->readMessageEnd();" << endl << indent() << " iprot_->getTransport()->readEnd();" << endl << - indent() << " throw facebook::thrift::TApplicationException(facebook::thrift::TApplicationException::WRONG_METHOD_NAME);" << endl << + indent() << " throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::WRONG_METHOD_NAME);" << endl << indent() << "}" << endl; if (!(*f_iter)->get_returntype()->is_void() && @@ -1820,7 +1820,7 @@ void t_cpp_generator::generate_service_client(t_service* tservice) { "return;" << endl; } else { f_service_ << - indent() << "throw facebook::thrift::TApplicationException(facebook::thrift::TApplicationException::MISSING_RESULT, \"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl; + indent() << "throw apache::thrift::TApplicationException(apache::thrift::TApplicationException::MISSING_RESULT, \"" << (*f_iter)->get_name() << " failed: unknown result\");" << endl; } // Close function @@ -1850,7 +1850,7 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { // Generate the header portion f_header_ << "class " << service_name_ << "Processor : " << - "virtual public facebook::thrift::TProcessor" << + "virtual public apache::thrift::TProcessor" << extends_processor << " {" << endl; // Protected data members @@ -1860,7 +1860,7 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { f_header_ << indent() << "boost::shared_ptr<" << service_name_ << "If> iface_;" << endl; f_header_ << - indent() << "virtual bool process_fn(facebook::thrift::protocol::TProtocol* iprot, facebook::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid);" << endl; + indent() << "virtual bool process_fn(apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid);" << endl; indent_down(); // Process function declarations @@ -1868,10 +1868,10 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { " private:" << endl; indent_up(); f_header_ << - indent() << "std::map processMap_;" << endl; + indent() << "std::map processMap_;" << endl; for (f_iter = functions.begin(); f_iter != functions.end(); ++f_iter) { indent(f_header_) << - "void process_" << (*f_iter)->get_name() << "(int32_t seqid, facebook::thrift::protocol::TProtocol* iprot, facebook::thrift::protocol::TProtocol* oprot);" << endl; + "void process_" << (*f_iter)->get_name() << "(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot);" << endl; } indent_down(); @@ -1906,7 +1906,7 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { declare_map << indent() << "}" << endl << endl << - indent() << "virtual bool process(boost::shared_ptr piprot, boost::shared_ptr poprot);" << endl << + indent() << "virtual bool process(boost::shared_ptr piprot, boost::shared_ptr poprot);" << endl << indent() << "virtual ~" << service_name_ << "Processor() {}" << endl; indent_down(); f_header_ << @@ -1914,25 +1914,25 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { // Generate the server implementation f_service_ << - "bool " << service_name_ << "Processor::process(boost::shared_ptr piprot, boost::shared_ptr poprot) {" << endl; + "bool " << service_name_ << "Processor::process(boost::shared_ptr piprot, boost::shared_ptr poprot) {" << endl; indent_up(); f_service_ << endl << - indent() << "facebook::thrift::protocol::TProtocol* iprot = piprot.get();" << endl << - indent() << "facebook::thrift::protocol::TProtocol* oprot = poprot.get();" << endl << + indent() << "apache::thrift::protocol::TProtocol* iprot = piprot.get();" << endl << + indent() << "apache::thrift::protocol::TProtocol* oprot = poprot.get();" << endl << indent() << "std::string fname;" << endl << - indent() << "facebook::thrift::protocol::TMessageType mtype;" << endl << + indent() << "apache::thrift::protocol::TMessageType mtype;" << endl << indent() << "int32_t seqid;" << endl << endl << indent() << "iprot->readMessageBegin(fname, mtype, seqid);" << endl << endl << - indent() << "if (mtype != facebook::thrift::protocol::T_CALL) {" << endl << - indent() << " iprot->skip(facebook::thrift::protocol::T_STRUCT);" << endl << + indent() << "if (mtype != apache::thrift::protocol::T_CALL) {" << endl << + indent() << " iprot->skip(apache::thrift::protocol::T_STRUCT);" << endl << indent() << " iprot->readMessageEnd();" << endl << indent() << " iprot->getTransport()->readEnd();" << endl << - indent() << " facebook::thrift::TApplicationException x(facebook::thrift::TApplicationException::INVALID_MESSAGE_TYPE);" << endl << - indent() << " oprot->writeMessageBegin(fname, facebook::thrift::protocol::T_EXCEPTION, seqid);" << endl << + indent() << " apache::thrift::TApplicationException x(apache::thrift::TApplicationException::INVALID_MESSAGE_TYPE);" << endl << + indent() << " oprot->writeMessageBegin(fname, apache::thrift::protocol::T_EXCEPTION, seqid);" << endl << indent() << " x.write(oprot);" << endl << indent() << " oprot->writeMessageEnd();" << endl << indent() << " oprot->getTransport()->flush();" << endl << @@ -1949,21 +1949,21 @@ void t_cpp_generator::generate_service_processor(t_service* tservice) { endl; f_service_ << - "bool " << service_name_ << "Processor::process_fn(facebook::thrift::protocol::TProtocol* iprot, facebook::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid) {" << endl; + "bool " << service_name_ << "Processor::process_fn(apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot, std::string& fname, int32_t seqid) {" << endl; indent_up(); // HOT: member function pointer map f_service_ << - indent() << "std::map::iterator pfn;" << endl << + indent() << "std::map::iterator pfn;" << endl << indent() << "pfn = processMap_.find(fname);" << endl << indent() << "if (pfn == processMap_.end()) {" << endl; if (extends.empty()) { f_service_ << - indent() << " iprot->skip(facebook::thrift::protocol::T_STRUCT);" << endl << + indent() << " iprot->skip(apache::thrift::protocol::T_STRUCT);" << endl << indent() << " iprot->readMessageEnd();" << endl << indent() << " iprot->getTransport()->readEnd();" << endl << - indent() << " facebook::thrift::TApplicationException x(facebook::thrift::TApplicationException::UNKNOWN_METHOD, \"Invalid method name: '\"+fname+\"'\");" << endl << - indent() << " oprot->writeMessageBegin(fname, facebook::thrift::protocol::T_EXCEPTION, seqid);" << endl << + indent() << " apache::thrift::TApplicationException x(apache::thrift::TApplicationException::UNKNOWN_METHOD, \"Invalid method name: '\"+fname+\"'\");" << endl << + indent() << " oprot->writeMessageBegin(fname, apache::thrift::protocol::T_EXCEPTION, seqid);" << endl << indent() << " x.write(oprot);" << endl << indent() << " oprot->writeMessageEnd();" << endl << indent() << " oprot->getTransport()->flush();" << endl << @@ -2034,7 +2034,7 @@ void t_cpp_generator::generate_process_function(t_service* tservice, f_service_ << "void " << tservice->get_name() << "Processor::" << "process_" << tfunction->get_name() << - "(int32_t seqid, facebook::thrift::protocol::TProtocol* iprot, facebook::thrift::protocol::TProtocol* oprot)" << endl; + "(int32_t seqid, apache::thrift::protocol::TProtocol* iprot, apache::thrift::protocol::TProtocol* oprot)" << endl; scope_up(f_service_); string argsname = tservice->get_name() + "_" + tfunction->get_name() + "_args"; @@ -2120,8 +2120,8 @@ void t_cpp_generator::generate_process_function(t_service* tservice, if (!tfunction->is_async()) { indent_up(); f_service_ << - indent() << "facebook::thrift::TApplicationException x(e.what());" << endl << - indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() << "\", facebook::thrift::protocol::T_EXCEPTION, seqid);" << endl << + indent() << "apache::thrift::TApplicationException x(e.what());" << endl << + indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() << "\", apache::thrift::protocol::T_EXCEPTION, seqid);" << endl << indent() << "x.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();" << endl << indent() << "oprot->getTransport()->flush();" << endl << @@ -2144,7 +2144,7 @@ void t_cpp_generator::generate_process_function(t_service* tservice, // Serialize the result into a struct f_service_ << endl << - indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() << "\", facebook::thrift::protocol::T_REPLY, seqid);" << endl << + indent() << "oprot->writeMessageBegin(\"" << tfunction->get_name() << "\", apache::thrift::protocol::T_REPLY, seqid);" << endl << indent() << "result.write(oprot);" << endl << indent() << "oprot->writeMessageEnd();" << endl << indent() << "oprot->getTransport()->flush();" << endl << @@ -2268,10 +2268,10 @@ void t_cpp_generator::generate_service_limited_reflector(t_service* tservice) { // Open function f_service_ << indent() << "void " << tservice->get_name() << "If::getStaticLimitedReflection" << - "(facebook::thrift::reflection::limited::Service & _return) "; + "(apache::thrift::reflection::limited::Service & _return) "; scope_up(f_service_); - f_service_ << indent() << "using namespace facebook::thrift::reflection::limited;" << endl; + f_service_ << indent() << "using namespace apache::thrift::reflection::limited;" << endl; f_service_ << indent() << "_return.name = \"" << tservice->get_name() << "\";" << endl; f_service_ << indent() << "_return.fully_reflected = true;" << endl; @@ -2340,10 +2340,10 @@ void t_cpp_generator::generate_service_skeleton(t_service* tservice) { "#include " << endl << "#include " << endl << endl << - "using namespace facebook::thrift;" << endl << - "using namespace facebook::thrift::protocol;" << endl << - "using namespace facebook::thrift::transport;" << endl << - "using namespace facebook::thrift::server;" << endl << + "using namespace apache::thrift;" << endl << + "using namespace apache::thrift::protocol;" << endl << + "using namespace apache::thrift::transport;" << endl << + "using namespace apache::thrift::server;" << endl << endl << "using boost::shared_ptr;" << endl << endl; @@ -2507,18 +2507,18 @@ void t_cpp_generator::generate_deserialize_container(ofstream& out, // Declare variables, read header if (ttype->is_map()) { out << - indent() << "facebook::thrift::protocol::TType " << ktype << ";" << endl << - indent() << "facebook::thrift::protocol::TType " << vtype << ";" << endl << + indent() << "apache::thrift::protocol::TType " << ktype << ";" << endl << + indent() << "apache::thrift::protocol::TType " << vtype << ";" << endl << indent() << "iprot->readMapBegin(" << ktype << ", " << vtype << ", " << size << ");" << endl; } else if (ttype->is_set()) { out << - indent() << "facebook::thrift::protocol::TType " << etype << ";" << endl << + indent() << "apache::thrift::protocol::TType " << etype << ";" << endl << indent() << "iprot->readSetBegin(" << etype << ", " << size << ");" << endl; } else if (ttype->is_list()) { out << - indent() << "facebook::thrift::protocol::TType " << etype << ";" << endl << + indent() << "apache::thrift::protocol::TType " << etype << ";" << endl << indent() << "iprot->readListBegin(" << etype << ", " << size << ");" << endl; if (!use_push) { @@ -3084,32 +3084,32 @@ string t_cpp_generator::type_to_enum(t_type* type) { case t_base_type::TYPE_VOID: throw "NO T_VOID CONSTRUCT"; case t_base_type::TYPE_STRING: - return "facebook::thrift::protocol::T_STRING"; + return "apache::thrift::protocol::T_STRING"; case t_base_type::TYPE_BOOL: - return "facebook::thrift::protocol::T_BOOL"; + return "apache::thrift::protocol::T_BOOL"; case t_base_type::TYPE_BYTE: - return "facebook::thrift::protocol::T_BYTE"; + return "apache::thrift::protocol::T_BYTE"; case t_base_type::TYPE_I16: - return "facebook::thrift::protocol::T_I16"; + return "apache::thrift::protocol::T_I16"; case t_base_type::TYPE_I32: - return "facebook::thrift::protocol::T_I32"; + return "apache::thrift::protocol::T_I32"; case t_base_type::TYPE_I64: - return "facebook::thrift::protocol::T_I64"; + return "apache::thrift::protocol::T_I64"; case t_base_type::TYPE_DOUBLE: - return "facebook::thrift::protocol::T_DOUBLE"; + return "apache::thrift::protocol::T_DOUBLE"; } } else if (type->is_enum()) { - return "facebook::thrift::protocol::T_I32"; + return "apache::thrift::protocol::T_I32"; } else if (type->is_struct()) { - return "facebook::thrift::protocol::T_STRUCT"; + return "apache::thrift::protocol::T_STRUCT"; } else if (type->is_xception()) { - return "facebook::thrift::protocol::T_STRUCT"; + return "apache::thrift::protocol::T_STRUCT"; } else if (type->is_map()) { - return "facebook::thrift::protocol::T_MAP"; + return "apache::thrift::protocol::T_MAP"; } else if (type->is_set()) { - return "facebook::thrift::protocol::T_SET"; + return "apache::thrift::protocol::T_SET"; } else if (type->is_list()) { - return "facebook::thrift::protocol::T_LIST"; + return "apache::thrift::protocol::T_LIST"; } throw "INVALID TYPE IN type_to_enum: " + type->get_name(); diff --git a/lib/cpp/src/TProcessor.h b/lib/cpp/src/TProcessor.h index cba4a844..3c4b1713 100644 --- a/lib/cpp/src/TProcessor.h +++ b/lib/cpp/src/TProcessor.h @@ -11,7 +11,7 @@ #include #include -namespace facebook { namespace thrift { +namespace apache { namespace thrift { /** * A processor is a generic object that acts upon two streams of data, one @@ -28,7 +28,7 @@ class TProcessor { virtual bool process(boost::shared_ptr in, boost::shared_ptr out) = 0; - bool process(boost::shared_ptr io) { + bool process(boost::shared_ptr io) { return process(io, io); } @@ -36,6 +36,6 @@ class TProcessor { TProcessor() {} }; -}} // facebook::thrift +}} // apache::thrift #endif // #ifndef _THRIFT_PROCESSOR_H_ diff --git a/lib/cpp/src/TReflectionLocal.h b/lib/cpp/src/TReflectionLocal.h index 8e391170..3644140c 100644 --- a/lib/cpp/src/TReflectionLocal.h +++ b/lib/cpp/src/TReflectionLocal.h @@ -19,9 +19,9 @@ * @author David Reiss */ -namespace facebook { namespace thrift { namespace reflection { namespace local { +namespace apache { namespace thrift { namespace reflection { namespace local { -using facebook::thrift::protocol::TType; +using apache::thrift::protocol::TType; // We include this many bytes of the structure's fingerprint when serializing // a top-level structure. Long enough to make collisions unlikely, short @@ -79,6 +79,6 @@ struct TypeSpec { }; -}}}} // facebook::thrift::reflection::local +}}}} // apache::thrift::reflection::local #endif // #ifndef _THRIFT_TREFLECTIONLOCAL_H_ diff --git a/lib/cpp/src/Thrift.cpp b/lib/cpp/src/Thrift.cpp index fb6bcbc5..bbf97104 100644 --- a/lib/cpp/src/Thrift.cpp +++ b/lib/cpp/src/Thrift.cpp @@ -11,7 +11,7 @@ #include #include -namespace facebook { namespace thrift { +namespace apache { namespace thrift { TOutput GlobalOutput; @@ -77,29 +77,29 @@ std::string TOutput::strerror_s(int errno_copy) { #endif // HAVE_STRERROR_R } -uint32_t TApplicationException::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t TApplicationException::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_STRING) { + if (ftype == apache::thrift::protocol::T_STRING) { xfer += iprot->readString(message_); } else { xfer += iprot->skip(ftype); } break; case 2: - if (ftype == facebook::thrift::protocol::T_I32) { + if (ftype == apache::thrift::protocol::T_I32) { int32_t type; xfer += iprot->readI32(type); type_ = (TApplicationExceptionType)type; @@ -118,13 +118,13 @@ uint32_t TApplicationException::read(facebook::thrift::protocol::TProtocol* ipro return xfer; } -uint32_t TApplicationException::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t TApplicationException::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("TApplicationException"); - xfer += oprot->writeFieldBegin("message", facebook::thrift::protocol::T_STRING, 1); + xfer += oprot->writeFieldBegin("message", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString(message_); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("type", facebook::thrift::protocol::T_I32, 2); + xfer += oprot->writeFieldBegin("type", apache::thrift::protocol::T_I32, 2); xfer += oprot->writeI32(type_); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -132,4 +132,4 @@ uint32_t TApplicationException::write(facebook::thrift::protocol::TProtocol* opr return xfer; } -}} // facebook::thrift +}} // apache::thrift diff --git a/lib/cpp/src/Thrift.h b/lib/cpp/src/Thrift.h index eb5000e0..624687bc 100644 --- a/lib/cpp/src/Thrift.h +++ b/lib/cpp/src/Thrift.h @@ -24,7 +24,7 @@ #include "TLogging.h" -namespace facebook { namespace thrift { +namespace apache { namespace thrift { class TOutput { public: @@ -171,6 +171,6 @@ struct TypeSpec; }} -}} // facebook::thrift +}} // apache::thrift #endif // #ifndef _THRIFT_THRIFT_H_ diff --git a/lib/cpp/src/concurrency/Exception.h b/lib/cpp/src/concurrency/Exception.h index 00e26497..cdc85387 100644 --- a/lib/cpp/src/concurrency/Exception.h +++ b/lib/cpp/src/concurrency/Exception.h @@ -10,31 +10,31 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { -class NoSuchTaskException : public facebook::thrift::TException {}; +class NoSuchTaskException : public apache::thrift::TException {}; -class UncancellableTaskException : public facebook::thrift::TException {}; +class UncancellableTaskException : public apache::thrift::TException {}; -class InvalidArgumentException : public facebook::thrift::TException {}; +class InvalidArgumentException : public apache::thrift::TException {}; -class IllegalStateException : public facebook::thrift::TException {}; +class IllegalStateException : public apache::thrift::TException {}; -class TimedOutException : public facebook::thrift::TException { +class TimedOutException : public apache::thrift::TException { public: TimedOutException():TException("TimedOutException"){}; TimedOutException(const std::string& message ) : TException(message) {} }; -class TooManyPendingTasksException : public facebook::thrift::TException { +class TooManyPendingTasksException : public apache::thrift::TException { public: TooManyPendingTasksException():TException("TooManyPendingTasksException"){}; TooManyPendingTasksException(const std::string& message ) : TException(message) {} }; -class SystemResourceException : public facebook::thrift::TException { +class SystemResourceException : public apache::thrift::TException { public: SystemResourceException() {} @@ -42,6 +42,6 @@ public: TException(message) {} }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_EXCEPTION_H_ diff --git a/lib/cpp/src/concurrency/FunctionRunner.h b/lib/cpp/src/concurrency/FunctionRunner.h index 94ab837b..6379c1cf 100644 --- a/lib/cpp/src/concurrency/FunctionRunner.h +++ b/lib/cpp/src/concurrency/FunctionRunner.h @@ -10,7 +10,7 @@ #include #include "thrift/lib/cpp/concurrency/Thread.h" -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Convenient implementation of Runnable that will execute arbitrary callbacks. @@ -60,6 +60,6 @@ class FunctionRunner : public Runnable { VoidFunc func_; }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_FUNCTION_RUNNER_H diff --git a/lib/cpp/src/concurrency/Monitor.cpp b/lib/cpp/src/concurrency/Monitor.cpp index 932ae686..81855dc4 100644 --- a/lib/cpp/src/concurrency/Monitor.cpp +++ b/lib/cpp/src/concurrency/Monitor.cpp @@ -15,7 +15,7 @@ #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Monitor implementation using the POSIX pthread library @@ -122,4 +122,4 @@ void Monitor::notify() const { impl_->notify(); } void Monitor::notifyAll() const { impl_->notifyAll(); } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/Monitor.h b/lib/cpp/src/concurrency/Monitor.h index 1eb36ebe..fe7bf112 100644 --- a/lib/cpp/src/concurrency/Monitor.h +++ b/lib/cpp/src/concurrency/Monitor.h @@ -9,7 +9,7 @@ #include "Exception.h" -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * A monitor is a combination mutex and condition-event. Waiting and @@ -67,6 +67,6 @@ class Synchronized { }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_MONITOR_H_ diff --git a/lib/cpp/src/concurrency/Mutex.cpp b/lib/cpp/src/concurrency/Mutex.cpp index b160b670..af68db67 100644 --- a/lib/cpp/src/concurrency/Mutex.cpp +++ b/lib/cpp/src/concurrency/Mutex.cpp @@ -11,7 +11,7 @@ using boost::shared_ptr; -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Implementation of Mutex class using POSIX mutex @@ -145,5 +145,5 @@ bool ReadWriteMutex::attemptWrite() const { return impl_->attemptWrite(); } void ReadWriteMutex::release() const { impl_->release(); } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/Mutex.h b/lib/cpp/src/concurrency/Mutex.h index 3b8631bc..92eb0dbd 100644 --- a/lib/cpp/src/concurrency/Mutex.h +++ b/lib/cpp/src/concurrency/Mutex.h @@ -9,7 +9,7 @@ #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * A simple mutex class @@ -95,6 +95,6 @@ class RWGuard { #define RWGuard(m) incorrect_use_of_RWGuard(m) -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_MUTEX_H_ diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.cpp b/lib/cpp/src/concurrency/PosixThreadFactory.cpp index 001d6ad8..9655a865 100644 --- a/lib/cpp/src/concurrency/PosixThreadFactory.cpp +++ b/lib/cpp/src/concurrency/PosixThreadFactory.cpp @@ -18,7 +18,7 @@ #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { using boost::shared_ptr; using boost::weak_ptr; @@ -293,4 +293,4 @@ void PosixThreadFactory::setDetached(bool value) { impl_->setDetached(value); } Thread::id_t PosixThreadFactory::getCurrentThreadId() const { return impl_->getCurrentThreadId(); } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/PosixThreadFactory.h b/lib/cpp/src/concurrency/PosixThreadFactory.h index 0f12fc93..66df4b39 100644 --- a/lib/cpp/src/concurrency/PosixThreadFactory.h +++ b/lib/cpp/src/concurrency/PosixThreadFactory.h @@ -11,7 +11,7 @@ #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * A thread factory to create posix threads @@ -113,6 +113,6 @@ class PosixThreadFactory : public ThreadFactory { boost::shared_ptr impl_; }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_POSIXTHREADFACTORY_H_ diff --git a/lib/cpp/src/concurrency/Thread.h b/lib/cpp/src/concurrency/Thread.h index 39ee8167..0ce5e170 100644 --- a/lib/cpp/src/concurrency/Thread.h +++ b/lib/cpp/src/concurrency/Thread.h @@ -10,7 +10,7 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { class Thread; @@ -49,7 +49,7 @@ class Runnable { * is difficult to abstract across platforms and is left for platform-specific * ThreadFactory implemtations to deal with * - * @see facebook::thrift::concurrency::ThreadFactory) + * @see apache::thrift::concurrency::ThreadFactory) */ class Thread { @@ -107,6 +107,6 @@ class ThreadFactory { virtual Thread::id_t getCurrentThreadId() const = 0; }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_THREAD_H_ diff --git a/lib/cpp/src/concurrency/ThreadManager.cpp b/lib/cpp/src/concurrency/ThreadManager.cpp index 34acc4cf..11c19a84 100644 --- a/lib/cpp/src/concurrency/ThreadManager.cpp +++ b/lib/cpp/src/concurrency/ThreadManager.cpp @@ -18,7 +18,7 @@ #include #endif //defined(DEBUG) -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { using boost::shared_ptr; using boost::dynamic_pointer_cast; @@ -477,5 +477,5 @@ shared_ptr ThreadManager::newSimpleThreadManager(size_t count, si return shared_ptr(new SimpleThreadManager(count, pendingTaskCountMax)); } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/ThreadManager.h b/lib/cpp/src/concurrency/ThreadManager.h index 7bca5d0e..b973b080 100644 --- a/lib/cpp/src/concurrency/ThreadManager.h +++ b/lib/cpp/src/concurrency/ThreadManager.h @@ -11,7 +11,7 @@ #include #include "Thread.h" -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Thread Pool Manager and related classes @@ -152,6 +152,6 @@ class ThreadManager { class Impl; }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_THREADMANAGER_H_ diff --git a/lib/cpp/src/concurrency/TimerManager.cpp b/lib/cpp/src/concurrency/TimerManager.cpp index e3b7a89f..c9555fb9 100644 --- a/lib/cpp/src/concurrency/TimerManager.cpp +++ b/lib/cpp/src/concurrency/TimerManager.cpp @@ -12,7 +12,7 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { using boost::shared_ptr; @@ -268,5 +268,5 @@ void TimerManager::remove(shared_ptr task) { const TimerManager::STATE TimerManager::state() const { return state_; } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/TimerManager.h b/lib/cpp/src/concurrency/TimerManager.h index 6d2eae95..37296469 100644 --- a/lib/cpp/src/concurrency/TimerManager.h +++ b/lib/cpp/src/concurrency/TimerManager.h @@ -15,7 +15,7 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Timer Manager @@ -103,6 +103,6 @@ class TimerManager { boost::shared_ptr dispatcherThread_; }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_TIMERMANAGER_H_ diff --git a/lib/cpp/src/concurrency/Util.cpp b/lib/cpp/src/concurrency/Util.cpp index eeee0e57..c220238c 100644 --- a/lib/cpp/src/concurrency/Util.cpp +++ b/lib/cpp/src/concurrency/Util.cpp @@ -16,7 +16,7 @@ #include #endif // defined(HAVE_CLOCK_GETTIME) -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { const int64_t Util::currentTime() { int64_t result; @@ -39,4 +39,4 @@ const int64_t Util::currentTime() { } -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/concurrency/Util.h b/lib/cpp/src/concurrency/Util.h index 483d14a5..fa5b7f4b 100644 --- a/lib/cpp/src/concurrency/Util.h +++ b/lib/cpp/src/concurrency/Util.h @@ -13,7 +13,7 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { +namespace apache { namespace thrift { namespace concurrency { /** * Utility methods @@ -83,6 +83,6 @@ class Util { static const int64_t currentTime(); }; -}}} // facebook::thrift::concurrency +}}} // apache::thrift::concurrency #endif // #ifndef _THRIFT_CONCURRENCY_UTIL_H_ diff --git a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h b/lib/cpp/src/concurrency/test/ThreadFactoryTests.h index 0dcf0bb5..440f69be 100644 --- a/lib/cpp/src/concurrency/test/ThreadFactoryTests.h +++ b/lib/cpp/src/concurrency/test/ThreadFactoryTests.h @@ -14,10 +14,10 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { namespace test { +namespace apache { namespace thrift { namespace concurrency { namespace test { using boost::shared_ptr; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift::concurrency; /** * ThreadManagerTests class @@ -341,5 +341,5 @@ public: const double ThreadFactoryTests::ERROR = .20; -}}}} // facebook::thrift::concurrency::test +}}}} // apache::thrift::concurrency::test diff --git a/lib/cpp/src/concurrency/test/ThreadManagerTests.h b/lib/cpp/src/concurrency/test/ThreadManagerTests.h index 261ad5e5..feb3e479 100644 --- a/lib/cpp/src/concurrency/test/ThreadManagerTests.h +++ b/lib/cpp/src/concurrency/test/ThreadManagerTests.h @@ -16,9 +16,9 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { namespace test { +namespace apache { namespace thrift { namespace concurrency { namespace test { -using namespace facebook::thrift::concurrency; +using namespace apache::thrift::concurrency; /** * ThreadManagerTests class @@ -348,7 +348,7 @@ public: const double ThreadManagerTests::ERROR = .20; -}}}} // facebook::thrift::concurrency +}}}} // apache::thrift::concurrency -using namespace facebook::thrift::concurrency::test; +using namespace apache::thrift::concurrency::test; diff --git a/lib/cpp/src/concurrency/test/TimerManagerTests.h b/lib/cpp/src/concurrency/test/TimerManagerTests.h index 13e3ef89..9e4e757e 100644 --- a/lib/cpp/src/concurrency/test/TimerManagerTests.h +++ b/lib/cpp/src/concurrency/test/TimerManagerTests.h @@ -12,9 +12,9 @@ #include #include -namespace facebook { namespace thrift { namespace concurrency { namespace test { +namespace apache { namespace thrift { namespace concurrency { namespace test { -using namespace facebook::thrift::concurrency; +using namespace apache::thrift::concurrency; /** * ThreadManagerTests class @@ -126,5 +126,5 @@ class TimerManagerTests { const double TimerManagerTests::ERROR = .20; -}}}} // facebook::thrift::concurrency +}}}} // apache::thrift::concurrency diff --git a/lib/cpp/src/processor/PeekProcessor.cpp b/lib/cpp/src/processor/PeekProcessor.cpp index d8648059..4cbaca00 100644 --- a/lib/cpp/src/processor/PeekProcessor.cpp +++ b/lib/cpp/src/processor/PeekProcessor.cpp @@ -1,10 +1,10 @@ #include "PeekProcessor.h" -using namespace facebook::thrift::transport; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift; +using namespace apache::thrift::transport; +using namespace apache::thrift::protocol; +using namespace apache::thrift; -namespace facebook { namespace thrift { namespace processor { +namespace apache { namespace thrift { namespace processor { PeekProcessor::PeekProcessor() { memoryBuffer_.reset(new TMemoryBuffer()); diff --git a/lib/cpp/src/processor/PeekProcessor.h b/lib/cpp/src/processor/PeekProcessor.h index 697be27e..6404b718 100644 --- a/lib/cpp/src/processor/PeekProcessor.h +++ b/lib/cpp/src/processor/PeekProcessor.h @@ -14,7 +14,7 @@ #include #include -namespace facebook { namespace thrift { namespace processor { +namespace apache { namespace thrift { namespace processor { /* * Class for peeking at the raw data that is being processed by another processor @@ -22,7 +22,7 @@ namespace facebook { namespace thrift { namespace processor { * * @author James Wang */ -class PeekProcessor : public facebook::thrift::TProcessor { +class PeekProcessor : public apache::thrift::TProcessor { public: PeekProcessor(); @@ -32,34 +32,34 @@ class PeekProcessor : public facebook::thrift::TProcessor { // protocolFactory - the protocol factory used to wrap the memory buffer // transportFactory - this TPipedTransportFactory is used to wrap the source transport // via a call to getPipedTransport - void initialize(boost::shared_ptr actualProcessor, - boost::shared_ptr protocolFactory, - boost::shared_ptr transportFactory); + void initialize(boost::shared_ptr actualProcessor, + boost::shared_ptr protocolFactory, + boost::shared_ptr transportFactory); - boost::shared_ptr getPipedTransport(boost::shared_ptr in); + boost::shared_ptr getPipedTransport(boost::shared_ptr in); - void setTargetTransport(boost::shared_ptr targetTransport); + void setTargetTransport(boost::shared_ptr targetTransport); - virtual bool process(boost::shared_ptr in, - boost::shared_ptr out); + virtual bool process(boost::shared_ptr in, + boost::shared_ptr out); // The following three functions can be overloaded by child classes to // achieve desired peeking behavior virtual void peekName(const std::string& fname); virtual void peekBuffer(uint8_t* buffer, uint32_t size); - virtual void peek(boost::shared_ptr in, - facebook::thrift::protocol::TType ftype, + virtual void peek(boost::shared_ptr in, + apache::thrift::protocol::TType ftype, int16_t fid); virtual void peekEnd(); private: - boost::shared_ptr actualProcessor_; - boost::shared_ptr pipedProtocol_; - boost::shared_ptr transportFactory_; - boost::shared_ptr memoryBuffer_; - boost::shared_ptr targetTransport_; + boost::shared_ptr actualProcessor_; + boost::shared_ptr pipedProtocol_; + boost::shared_ptr transportFactory_; + boost::shared_ptr memoryBuffer_; + boost::shared_ptr targetTransport_; }; -}}} // facebook::thrift::processor +}}} // apache::thrift::processor #endif diff --git a/lib/cpp/src/processor/StatsProcessor.h b/lib/cpp/src/processor/StatsProcessor.h index 140a1d49..2cccab10 100644 --- a/lib/cpp/src/processor/StatsProcessor.h +++ b/lib/cpp/src/processor/StatsProcessor.h @@ -12,14 +12,14 @@ #include #include -namespace facebook { namespace thrift { namespace processor { +namespace apache { namespace thrift { namespace processor { /* * Class for keeping track of function call statistics and printing them if desired * * @author James Wang */ -class StatsProcessor : public facebook::thrift::TProcessor { +class StatsProcessor : public apache::thrift::TProcessor { public: StatsProcessor(bool print, bool frequency) : print_(print), @@ -27,20 +27,20 @@ public: {} virtual ~StatsProcessor() {}; - virtual bool process(boost::shared_ptr piprot, boost::shared_ptr poprot) { + virtual bool process(boost::shared_ptr piprot, boost::shared_ptr poprot) { piprot_ = piprot; std::string fname; - facebook::thrift::protocol::TMessageType mtype; + apache::thrift::protocol::TMessageType mtype; int32_t seqid; piprot_->readMessageBegin(fname, mtype, seqid); - if (mtype != facebook::thrift::protocol::T_CALL) { + if (mtype != apache::thrift::protocol::T_CALL) { if (print_) { printf("Unknown message type\n"); } - throw facebook::thrift::TException("Unexpected message type"); + throw apache::thrift::TException("Unexpected message type"); } if (print_) { printf("%s (", fname.c_str()); @@ -53,12 +53,12 @@ public: } } - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; while (true) { piprot_->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } @@ -79,9 +79,9 @@ public: } protected: - void printAndPassToBuffer(facebook::thrift::protocol::TType ftype) { + void printAndPassToBuffer(apache::thrift::protocol::TType ftype) { switch (ftype) { - case facebook::thrift::protocol::T_BOOL: + case apache::thrift::protocol::T_BOOL: { bool boolv; piprot_->readBool(boolv); @@ -90,7 +90,7 @@ protected: } } break; - case facebook::thrift::protocol::T_BYTE: + case apache::thrift::protocol::T_BYTE: { int8_t bytev; piprot_->readByte(bytev); @@ -99,7 +99,7 @@ protected: } } break; - case facebook::thrift::protocol::T_I16: + case apache::thrift::protocol::T_I16: { int16_t i16; piprot_->readI16(i16); @@ -108,7 +108,7 @@ protected: } } break; - case facebook::thrift::protocol::T_I32: + case apache::thrift::protocol::T_I32: { int32_t i32; piprot_->readI32(i32); @@ -117,7 +117,7 @@ protected: } } break; - case facebook::thrift::protocol::T_I64: + case apache::thrift::protocol::T_I64: { int64_t i64; piprot_->readI64(i64); @@ -126,7 +126,7 @@ protected: } } break; - case facebook::thrift::protocol::T_DOUBLE: + case apache::thrift::protocol::T_DOUBLE: { double dub; piprot_->readDouble(dub); @@ -135,7 +135,7 @@ protected: } } break; - case facebook::thrift::protocol::T_STRING: + case apache::thrift::protocol::T_STRING: { std::string str; piprot_->readString(str); @@ -144,18 +144,18 @@ protected: } } break; - case facebook::thrift::protocol::T_STRUCT: + case apache::thrift::protocol::T_STRUCT: { std::string name; int16_t fid; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; piprot_->readStructBegin(name); if (print_) { printf("<"); } while (true) { piprot_->readFieldBegin(name, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } printAndPassToBuffer(ftype); @@ -170,10 +170,10 @@ protected: } } break; - case facebook::thrift::protocol::T_MAP: + case apache::thrift::protocol::T_MAP: { - facebook::thrift::protocol::TType keyType; - facebook::thrift::protocol::TType valType; + apache::thrift::protocol::TType keyType; + apache::thrift::protocol::TType valType; uint32_t i, size; piprot_->readMapBegin(keyType, valType, size); if (print_) { @@ -195,9 +195,9 @@ protected: } } break; - case facebook::thrift::protocol::T_SET: + case apache::thrift::protocol::T_SET: { - facebook::thrift::protocol::TType elemType; + apache::thrift::protocol::TType elemType; uint32_t i, size; piprot_->readSetBegin(elemType, size); if (print_) { @@ -215,9 +215,9 @@ protected: } } break; - case facebook::thrift::protocol::T_LIST: + case apache::thrift::protocol::T_LIST: { - facebook::thrift::protocol::TType elemType; + apache::thrift::protocol::TType elemType; uint32_t i, size; piprot_->readListBegin(elemType, size); if (print_) { @@ -240,13 +240,13 @@ protected: } } - boost::shared_ptr piprot_; + boost::shared_ptr piprot_; std::map frequency_map_; bool print_; bool frequency_; }; -}}} // facebook::thrift::processor +}}} // apache::thrift::processor #endif diff --git a/lib/cpp/src/protocol/TBase64Utils.cpp b/lib/cpp/src/protocol/TBase64Utils.cpp index beb659fc..b294eec6 100644 --- a/lib/cpp/src/protocol/TBase64Utils.cpp +++ b/lib/cpp/src/protocol/TBase64Utils.cpp @@ -10,7 +10,7 @@ using std::string; -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { static const uint8_t *kBase64EncodeTable = (const uint8_t *) @@ -63,4 +63,4 @@ void base64_decode(uint8_t *buf, uint32_t len) { } -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol diff --git a/lib/cpp/src/protocol/TBase64Utils.h b/lib/cpp/src/protocol/TBase64Utils.h index ec3daf32..f81476d9 100644 --- a/lib/cpp/src/protocol/TBase64Utils.h +++ b/lib/cpp/src/protocol/TBase64Utils.h @@ -9,7 +9,7 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { // in must be at least len bytes // len must be 1, 2, or 3 @@ -23,6 +23,6 @@ void base64_encode(const uint8_t *in, uint32_t len, uint8_t *buf); // no '=' padding should be included in the input void base64_decode(uint8_t *buf, uint32_t len); -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #define _THRIFT_PROTOCOL_TBASE64UTILS_H_ diff --git a/lib/cpp/src/protocol/TBinaryProtocol.cpp b/lib/cpp/src/protocol/TBinaryProtocol.cpp index 2962180a..2da5c114 100644 --- a/lib/cpp/src/protocol/TBinaryProtocol.cpp +++ b/lib/cpp/src/protocol/TBinaryProtocol.cpp @@ -51,7 +51,7 @@ static inline To bitwise_cast(From from) { } -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { uint32_t TBinaryProtocol::writeMessageBegin(const std::string& name, const TMessageType messageType, @@ -419,4 +419,4 @@ uint32_t TBinaryProtocol::readStringBody(string& str, int32_t size) { return (uint32_t)size; } -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/protocol/TBinaryProtocol.h index a6a8983f..b38b493a 100644 --- a/lib/cpp/src/protocol/TBinaryProtocol.h +++ b/lib/cpp/src/protocol/TBinaryProtocol.h @@ -11,7 +11,7 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { /** * The default binary protocol for thrift. Writes all data in a very basic @@ -237,6 +237,6 @@ class TBinaryProtocolFactory : public TProtocolFactory { }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_ diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/protocol/TDebugProtocol.cpp index 92e9d36e..05291efd 100644 --- a/lib/cpp/src/protocol/TDebugProtocol.cpp +++ b/lib/cpp/src/protocol/TDebugProtocol.cpp @@ -25,7 +25,7 @@ static string byte_to_hex(const uint8_t byte) { } -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { string TDebugProtocol::fieldTypeName(TType type) { switch (type) { @@ -330,4 +330,4 @@ uint32_t TDebugProtocol::writeBinary(const string& str) { return TDebugProtocol::writeString(str); } -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h index dbad1e32..fa4b8073 100644 --- a/lib/cpp/src/protocol/TDebugProtocol.h +++ b/lib/cpp/src/protocol/TDebugProtocol.h @@ -12,7 +12,7 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { /* @@ -153,18 +153,18 @@ class TDebugProtocolFactory : public TProtocolFactory { }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol // TODO(dreiss): Move (part of) ThriftDebugString into a .cpp file and remove this. #include -namespace facebook { namespace thrift { +namespace apache { namespace thrift { template std::string ThriftDebugString(const ThriftStruct& ts) { - using namespace facebook::thrift::transport; - using namespace facebook::thrift::protocol; + using namespace apache::thrift::transport; + using namespace apache::thrift::protocol; TMemoryBuffer* buffer = new TMemoryBuffer; boost::shared_ptr trans(buffer); TDebugProtocol protocol(trans); @@ -181,8 +181,8 @@ std::string ThriftDebugString(const ThriftStruct& ts) { #if 0 template std::string DebugString(const std::vector& vec) { - using namespace facebook::thrift::transport; - using namespace facebook::thrift::protocol; + using namespace apache::thrift::transport; + using namespace apache::thrift::protocol; TMemoryBuffer* buffer = new TMemoryBuffer; boost::shared_ptr trans(buffer); TDebugProtocol protocol(trans); @@ -205,7 +205,7 @@ std::string DebugString(const std::vector& vec) { } #endif // 0 -}} // facebook::thrift +}} // apache::thrift #endif // #ifndef _THRIFT_PROTOCOL_TDEBUGPROTOCOL_H_ diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/protocol/TDenseProtocol.cpp index d1602a03..70059b37 100644 --- a/lib/cpp/src/protocol/TDenseProtocol.cpp +++ b/lib/cpp/src/protocol/TDenseProtocol.cpp @@ -104,10 +104,10 @@ using std::string; #define UNLIKELY(val) (val) #endif -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { const int TDenseProtocol::FP_PREFIX_LEN = - facebook::thrift::reflection::local::FP_PREFIX_LEN; + apache::thrift::reflection::local::FP_PREFIX_LEN; // Top TypeSpec. TypeSpec of the structure being encoded. #define TTS (ts_stack_.back()) // type = TypeSpec* @@ -746,4 +746,4 @@ uint32_t TDenseProtocol::subReadString(std::string& str) { return xfer + readStringBody(str, size); } -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/protocol/TDenseProtocol.h index 5dd5a8c6..4692132e 100644 --- a/lib/cpp/src/protocol/TDenseProtocol.h +++ b/lib/cpp/src/protocol/TDenseProtocol.h @@ -9,7 +9,7 @@ #include "TBinaryProtocol.h" -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { /** * !!!WARNING!!! @@ -51,7 +51,7 @@ class TDenseProtocol : public TBinaryProtocol { static const int32_t VERSION_2 = 0x80020000; public: - typedef facebook::thrift::reflection::local::TypeSpec TypeSpec; + typedef apache::thrift::reflection::local::TypeSpec TypeSpec; static const int FP_PREFIX_LEN; /** @@ -236,6 +236,6 @@ class TDenseProtocol : public TBinaryProtocol { bool standalone_; }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #ifndef _THRIFT_PROTOCOL_TDENSEPROTOCOL_H_ diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/protocol/TJSONProtocol.cpp index ca3a51f6..01fe471c 100644 --- a/lib/cpp/src/protocol/TJSONProtocol.cpp +++ b/lib/cpp/src/protocol/TJSONProtocol.cpp @@ -11,9 +11,9 @@ #include "TBase64Utils.h" #include -using namespace facebook::thrift::transport; +using namespace apache::thrift::transport; -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { // Static data @@ -874,7 +874,7 @@ uint32_t TJSONProtocol::readFieldBegin(std::string& name, // Check if we hit the end of the list uint8_t ch = reader_.peek(); if (ch == kJSONObjectEnd) { - fieldType = facebook::thrift::protocol::T_STOP; + fieldType = apache::thrift::protocol::T_STOP; } else { uint64_t tmpVal = 0; @@ -982,4 +982,4 @@ uint32_t TJSONProtocol::readBinary(std::string &str) { return readJSONBase64(str); } -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol diff --git a/lib/cpp/src/protocol/TJSONProtocol.h b/lib/cpp/src/protocol/TJSONProtocol.h index cbf4ef8e..4287adff 100644 --- a/lib/cpp/src/protocol/TJSONProtocol.h +++ b/lib/cpp/src/protocol/TJSONProtocol.h @@ -11,7 +11,7 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { // Forward declaration class TJSONContext; @@ -299,18 +299,18 @@ class TJSONProtocolFactory : public TProtocolFactory { } }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol // TODO(dreiss): Move part of ThriftJSONString into a .cpp file and remove this. #include -namespace facebook { namespace thrift { +namespace apache { namespace thrift { template std::string ThriftJSONString(const ThriftStruct& ts) { - using namespace facebook::thrift::transport; - using namespace facebook::thrift::protocol; + using namespace apache::thrift::transport; + using namespace apache::thrift::protocol; TMemoryBuffer* buffer = new TMemoryBuffer; boost::shared_ptr trans(buffer); TJSONProtocol protocol(trans); @@ -323,6 +323,6 @@ template return std::string((char*)buf, (unsigned int)size); } -}} // facebook::thrift +}} // apache::thrift #endif // #define _THRIFT_PROTOCOL_TJSONPROTOCOL_H_ 1 diff --git a/lib/cpp/src/protocol/TOneWayProtocol.h b/lib/cpp/src/protocol/TOneWayProtocol.h index dda113f9..ad5f8fa6 100644 --- a/lib/cpp/src/protocol/TOneWayProtocol.h +++ b/lib/cpp/src/protocol/TOneWayProtocol.h @@ -9,7 +9,7 @@ #include "TProtocol.h" -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { /** * Abstract class for implementing a protocol that can only be written, @@ -288,6 +288,6 @@ class TReadOnlyProtocol : public TProtocol { std::string subclass_; }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_ diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h index 1e9ce995..e4cfe0fb 100644 --- a/lib/cpp/src/protocol/TProtocol.h +++ b/lib/cpp/src/protocol/TProtocol.h @@ -17,9 +17,9 @@ #include #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { -using facebook::thrift::transport::TTransport; +using apache::thrift::transport::TTransport; #ifdef HAVE_ENDIAN_H #include @@ -352,6 +352,6 @@ class TProtocolFactory { virtual boost::shared_ptr getProtocol(boost::shared_ptr trans) = 0; }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1 diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/protocol/TProtocolException.h index b3146d5c..be0767be 100644 --- a/lib/cpp/src/protocol/TProtocolException.h +++ b/lib/cpp/src/protocol/TProtocolException.h @@ -9,7 +9,7 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { /** * Class to encapsulate all the possible types of protocol errors that may @@ -20,7 +20,7 @@ namespace facebook { namespace thrift { namespace protocol { * * @author Mark Slee */ -class TProtocolException : public facebook::thrift::TException { +class TProtocolException : public apache::thrift::TException { public: /** @@ -36,19 +36,19 @@ class TProtocolException : public facebook::thrift::TException { }; TProtocolException() : - facebook::thrift::TException(), + apache::thrift::TException(), type_(UNKNOWN) {} TProtocolException(TProtocolExceptionType type) : - facebook::thrift::TException(), + apache::thrift::TException(), type_(type) {} TProtocolException(const std::string& message) : - facebook::thrift::TException(message), + apache::thrift::TException(message), type_(UNKNOWN) {} TProtocolException(TProtocolExceptionType type, const std::string& message) : - facebook::thrift::TException(message), + apache::thrift::TException(message), type_(type) {} virtual ~TProtocolException() throw() {} @@ -87,6 +87,6 @@ class TProtocolException : public facebook::thrift::TException { }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #ifndef _THRIFT_PROTOCOL_TPROTOCOLEXCEPTION_H_ diff --git a/lib/cpp/src/protocol/TProtocolTap.h b/lib/cpp/src/protocol/TProtocolTap.h index 162f7831..07f000d6 100644 --- a/lib/cpp/src/protocol/TProtocolTap.h +++ b/lib/cpp/src/protocol/TProtocolTap.h @@ -9,9 +9,9 @@ #include -namespace facebook { namespace thrift { namespace protocol { +namespace apache { namespace thrift { namespace protocol { -using facebook::thrift::transport::TTransport; +using apache::thrift::transport::TTransport; /** * Puts a wiretap on a protocol object. Any reads to this class are passed @@ -170,6 +170,6 @@ class TProtocolTap : public TReadOnlyProtocol { boost::shared_ptr sink_; }; -}}} // facebook::thrift::protocol +}}} // apache::thrift::protocol #endif // #define _THRIFT_PROTOCOL_TPROTOCOLTAP_H_ 1 diff --git a/lib/cpp/src/reflection_limited_types.cpp b/lib/cpp/src/reflection_limited_types.cpp index 2f53e9ec..8bd4248a 100644 --- a/lib/cpp/src/reflection_limited_types.cpp +++ b/lib/cpp/src/reflection_limited_types.cpp @@ -5,33 +5,33 @@ */ #include "reflection_limited_types.h" -namespace facebook { namespace thrift { namespace reflection { namespace limited { +namespace apache { namespace thrift { namespace reflection { namespace limited { const char* SimpleType::ascii_fingerprint = "19B5240589E680301A7E32DF3971EFBE"; const uint8_t SimpleType::binary_fingerprint[16] = {0x19,0xB5,0x24,0x05,0x89,0xE6,0x80,0x30,0x1A,0x7E,0x32,0xDF,0x39,0x71,0xEF,0xBE}; -uint32_t SimpleType::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t SimpleType::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_I32) { + if (ftype == apache::thrift::protocol::T_I32) { int32_t ecast0; xfer += iprot->readI32(ecast0); this->ttype = (TTypeTag)ecast0; @@ -41,7 +41,7 @@ uint32_t SimpleType::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_STRING) { + if (ftype == apache::thrift::protocol::T_STRING) { xfer += iprot->readString(this->name); this->__isset.name = true; } else { @@ -60,13 +60,13 @@ uint32_t SimpleType::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t SimpleType::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t SimpleType::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("SimpleType"); - xfer += oprot->writeFieldBegin("ttype", facebook::thrift::protocol::T_I32, 1); + xfer += oprot->writeFieldBegin("ttype", apache::thrift::protocol::T_I32, 1); xfer += oprot->writeI32((int32_t)this->ttype); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("name", facebook::thrift::protocol::T_STRING, 2); + xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 2); xfer += oprot->writeString(this->name); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -77,28 +77,28 @@ uint32_t SimpleType::write(facebook::thrift::protocol::TProtocol* oprot) const { const char* ContainerType::ascii_fingerprint = "654FA6EFFF8242F4C2A604B970686634"; const uint8_t ContainerType::binary_fingerprint[16] = {0x65,0x4F,0xA6,0xEF,0xFF,0x82,0x42,0xF4,0xC2,0xA6,0x04,0xB9,0x70,0x68,0x66,0x34}; -uint32_t ContainerType::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t ContainerType::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_I32) { + if (ftype == apache::thrift::protocol::T_I32) { int32_t ecast1; xfer += iprot->readI32(ecast1); this->ttype = (TTypeTag)ecast1; @@ -108,7 +108,7 @@ uint32_t ContainerType::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->subtype1.read(iprot); this->__isset.subtype1 = true; } else { @@ -116,7 +116,7 @@ uint32_t ContainerType::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 3: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->subtype2.read(iprot); this->__isset.subtype2 = true; } else { @@ -135,17 +135,17 @@ uint32_t ContainerType::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t ContainerType::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t ContainerType::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ContainerType"); - xfer += oprot->writeFieldBegin("ttype", facebook::thrift::protocol::T_I32, 1); + xfer += oprot->writeFieldBegin("ttype", apache::thrift::protocol::T_I32, 1); xfer += oprot->writeI32((int32_t)this->ttype); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("subtype1", facebook::thrift::protocol::T_STRUCT, 2); + xfer += oprot->writeFieldBegin("subtype1", apache::thrift::protocol::T_STRUCT, 2); xfer += this->subtype1.write(oprot); xfer += oprot->writeFieldEnd(); if (this->__isset.subtype2) { - xfer += oprot->writeFieldBegin("subtype2", facebook::thrift::protocol::T_STRUCT, 3); + xfer += oprot->writeFieldBegin("subtype2", apache::thrift::protocol::T_STRUCT, 3); xfer += this->subtype2.write(oprot); xfer += oprot->writeFieldEnd(); } @@ -157,28 +157,28 @@ uint32_t ContainerType::write(facebook::thrift::protocol::TProtocol* oprot) cons const char* ThriftType::ascii_fingerprint = "76BC1CC759001D7D85FEE75C4F183062"; const uint8_t ThriftType::binary_fingerprint[16] = {0x76,0xBC,0x1C,0xC7,0x59,0x00,0x1D,0x7D,0x85,0xFE,0xE7,0x5C,0x4F,0x18,0x30,0x62}; -uint32_t ThriftType::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t ThriftType::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_BOOL) { + if (ftype == apache::thrift::protocol::T_BOOL) { xfer += iprot->readBool(this->is_container); this->__isset.is_container = true; } else { @@ -186,7 +186,7 @@ uint32_t ThriftType::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->simple_type.read(iprot); this->__isset.simple_type = true; } else { @@ -194,7 +194,7 @@ uint32_t ThriftType::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 3: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->container_type.read(iprot); this->__isset.container_type = true; } else { @@ -213,19 +213,19 @@ uint32_t ThriftType::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t ThriftType::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t ThriftType::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("ThriftType"); - xfer += oprot->writeFieldBegin("is_container", facebook::thrift::protocol::T_BOOL, 1); + xfer += oprot->writeFieldBegin("is_container", apache::thrift::protocol::T_BOOL, 1); xfer += oprot->writeBool(this->is_container); xfer += oprot->writeFieldEnd(); if (this->__isset.simple_type) { - xfer += oprot->writeFieldBegin("simple_type", facebook::thrift::protocol::T_STRUCT, 2); + xfer += oprot->writeFieldBegin("simple_type", apache::thrift::protocol::T_STRUCT, 2); xfer += this->simple_type.write(oprot); xfer += oprot->writeFieldEnd(); } if (this->__isset.container_type) { - xfer += oprot->writeFieldBegin("container_type", facebook::thrift::protocol::T_STRUCT, 3); + xfer += oprot->writeFieldBegin("container_type", apache::thrift::protocol::T_STRUCT, 3); xfer += this->container_type.write(oprot); xfer += oprot->writeFieldEnd(); } @@ -237,28 +237,28 @@ uint32_t ThriftType::write(facebook::thrift::protocol::TProtocol* oprot) const { const char* Argument::ascii_fingerprint = "8C45506BE0EFBB22FB19FA40DDCECB3F"; const uint8_t Argument::binary_fingerprint[16] = {0x8C,0x45,0x50,0x6B,0xE0,0xEF,0xBB,0x22,0xFB,0x19,0xFA,0x40,0xDD,0xCE,0xCB,0x3F}; -uint32_t Argument::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t Argument::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_I16) { + if (ftype == apache::thrift::protocol::T_I16) { xfer += iprot->readI16(this->key); this->__isset.key = true; } else { @@ -266,7 +266,7 @@ uint32_t Argument::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_STRING) { + if (ftype == apache::thrift::protocol::T_STRING) { xfer += iprot->readString(this->name); this->__isset.name = true; } else { @@ -274,7 +274,7 @@ uint32_t Argument::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 3: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->type.read(iprot); this->__isset.type = true; } else { @@ -293,16 +293,16 @@ uint32_t Argument::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t Argument::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t Argument::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("Argument"); - xfer += oprot->writeFieldBegin("key", facebook::thrift::protocol::T_I16, 1); + xfer += oprot->writeFieldBegin("key", apache::thrift::protocol::T_I16, 1); xfer += oprot->writeI16(this->key); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("name", facebook::thrift::protocol::T_STRING, 2); + xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 2); xfer += oprot->writeString(this->name); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("type", facebook::thrift::protocol::T_STRUCT, 3); + xfer += oprot->writeFieldBegin("type", apache::thrift::protocol::T_STRUCT, 3); xfer += this->type.write(oprot); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); @@ -313,28 +313,28 @@ uint32_t Argument::write(facebook::thrift::protocol::TProtocol* oprot) const { const char* Method::ascii_fingerprint = "E6573428C492D24C84A19432D39A17B0"; const uint8_t Method::binary_fingerprint[16] = {0xE6,0x57,0x34,0x28,0xC4,0x92,0xD2,0x4C,0x84,0xA1,0x94,0x32,0xD3,0x9A,0x17,0xB0}; -uint32_t Method::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t Method::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_STRING) { + if (ftype == apache::thrift::protocol::T_STRING) { xfer += iprot->readString(this->name); this->__isset.name = true; } else { @@ -342,7 +342,7 @@ uint32_t Method::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_STRUCT) { + if (ftype == apache::thrift::protocol::T_STRUCT) { xfer += this->return_type.read(iprot); this->__isset.return_type = true; } else { @@ -350,11 +350,11 @@ uint32_t Method::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 3: - if (ftype == facebook::thrift::protocol::T_LIST) { + if (ftype == apache::thrift::protocol::T_LIST) { { this->arguments.clear(); uint32_t _size2; - facebook::thrift::protocol::TType _etype5; + apache::thrift::protocol::TType _etype5; iprot->readListBegin(_etype5, _size2); this->arguments.resize(_size2); uint32_t _i6; @@ -381,18 +381,18 @@ uint32_t Method::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t Method::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t Method::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("Method"); - xfer += oprot->writeFieldBegin("name", facebook::thrift::protocol::T_STRING, 1); + xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString(this->name); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("return_type", facebook::thrift::protocol::T_STRUCT, 2); + xfer += oprot->writeFieldBegin("return_type", apache::thrift::protocol::T_STRUCT, 2); xfer += this->return_type.write(oprot); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("arguments", facebook::thrift::protocol::T_LIST, 3); + xfer += oprot->writeFieldBegin("arguments", apache::thrift::protocol::T_LIST, 3); { - xfer += oprot->writeListBegin(facebook::thrift::protocol::T_STRUCT, this->arguments.size()); + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->arguments.size()); std::vector ::const_iterator _iter7; for (_iter7 = this->arguments.begin(); _iter7 != this->arguments.end(); ++_iter7) { @@ -409,28 +409,28 @@ uint32_t Method::write(facebook::thrift::protocol::TProtocol* oprot) const { const char* Service::ascii_fingerprint = "4673B0777B701D9B02A7A74CEC7908A7"; const uint8_t Service::binary_fingerprint[16] = {0x46,0x73,0xB0,0x77,0x7B,0x70,0x1D,0x9B,0x02,0xA7,0xA7,0x4C,0xEC,0x79,0x08,0xA7}; -uint32_t Service::read(facebook::thrift::protocol::TProtocol* iprot) { +uint32_t Service::read(apache::thrift::protocol::TProtocol* iprot) { uint32_t xfer = 0; std::string fname; - facebook::thrift::protocol::TType ftype; + apache::thrift::protocol::TType ftype; int16_t fid; xfer += iprot->readStructBegin(fname); - using facebook::thrift::protocol::TProtocolException; + using apache::thrift::protocol::TProtocolException; while (true) { xfer += iprot->readFieldBegin(fname, ftype, fid); - if (ftype == facebook::thrift::protocol::T_STOP) { + if (ftype == apache::thrift::protocol::T_STOP) { break; } switch (fid) { case 1: - if (ftype == facebook::thrift::protocol::T_STRING) { + if (ftype == apache::thrift::protocol::T_STRING) { xfer += iprot->readString(this->name); this->__isset.name = true; } else { @@ -438,11 +438,11 @@ uint32_t Service::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 2: - if (ftype == facebook::thrift::protocol::T_LIST) { + if (ftype == apache::thrift::protocol::T_LIST) { { this->methods.clear(); uint32_t _size8; - facebook::thrift::protocol::TType _etype11; + apache::thrift::protocol::TType _etype11; iprot->readListBegin(_etype11, _size8); this->methods.resize(_size8); uint32_t _i12; @@ -458,7 +458,7 @@ uint32_t Service::read(facebook::thrift::protocol::TProtocol* iprot) { } break; case 3: - if (ftype == facebook::thrift::protocol::T_BOOL) { + if (ftype == apache::thrift::protocol::T_BOOL) { xfer += iprot->readBool(this->fully_reflected); this->__isset.fully_reflected = true; } else { @@ -477,15 +477,15 @@ uint32_t Service::read(facebook::thrift::protocol::TProtocol* iprot) { return xfer; } -uint32_t Service::write(facebook::thrift::protocol::TProtocol* oprot) const { +uint32_t Service::write(apache::thrift::protocol::TProtocol* oprot) const { uint32_t xfer = 0; xfer += oprot->writeStructBegin("Service"); - xfer += oprot->writeFieldBegin("name", facebook::thrift::protocol::T_STRING, 1); + xfer += oprot->writeFieldBegin("name", apache::thrift::protocol::T_STRING, 1); xfer += oprot->writeString(this->name); xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("methods", facebook::thrift::protocol::T_LIST, 2); + xfer += oprot->writeFieldBegin("methods", apache::thrift::protocol::T_LIST, 2); { - xfer += oprot->writeListBegin(facebook::thrift::protocol::T_STRUCT, this->methods.size()); + xfer += oprot->writeListBegin(apache::thrift::protocol::T_STRUCT, this->methods.size()); std::vector ::const_iterator _iter13; for (_iter13 = this->methods.begin(); _iter13 != this->methods.end(); ++_iter13) { @@ -494,7 +494,7 @@ uint32_t Service::write(facebook::thrift::protocol::TProtocol* oprot) const { xfer += oprot->writeListEnd(); } xfer += oprot->writeFieldEnd(); - xfer += oprot->writeFieldBegin("fully_reflected", facebook::thrift::protocol::T_BOOL, 3); + xfer += oprot->writeFieldBegin("fully_reflected", apache::thrift::protocol::T_BOOL, 3); xfer += oprot->writeBool(this->fully_reflected); xfer += oprot->writeFieldEnd(); xfer += oprot->writeFieldStop(); diff --git a/lib/cpp/src/reflection_limited_types.h b/lib/cpp/src/reflection_limited_types.h index 23bf83b7..570397a5 100644 --- a/lib/cpp/src/reflection_limited_types.h +++ b/lib/cpp/src/reflection_limited_types.h @@ -13,7 +13,7 @@ -namespace facebook { namespace thrift { namespace reflection { namespace limited { +namespace apache { namespace thrift { namespace reflection { namespace limited { enum TTypeTag { T_VOID = 1, @@ -66,8 +66,8 @@ class SimpleType { bool operator < (const SimpleType & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; @@ -111,8 +111,8 @@ class ContainerType { bool operator < (const ContainerType & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; @@ -158,8 +158,8 @@ class ThriftType { bool operator < (const ThriftType & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; @@ -201,8 +201,8 @@ class Argument { bool operator < (const Argument & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; @@ -244,8 +244,8 @@ class Method { bool operator < (const Method & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; @@ -287,8 +287,8 @@ class Service { bool operator < (const Service & ) const; - uint32_t read(facebook::thrift::protocol::TProtocol* iprot); - uint32_t write(facebook::thrift::protocol::TProtocol* oprot) const; + uint32_t read(apache::thrift::protocol::TProtocol* iprot); + uint32_t write(apache::thrift::protocol::TProtocol* oprot) const; }; diff --git a/lib/cpp/src/server/TNonblockingServer.cpp b/lib/cpp/src/server/TNonblockingServer.cpp index 06f11aa7..86445266 100644 --- a/lib/cpp/src/server/TNonblockingServer.cpp +++ b/lib/cpp/src/server/TNonblockingServer.cpp @@ -16,11 +16,11 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::concurrency; using namespace std; class TConnection::Task: public Runnable { @@ -685,4 +685,4 @@ void TNonblockingServer::serve() { event_base_loop(eventBase_, 0); } -}}} // facebook::thrift::server +}}} // apache::thrift::server diff --git a/lib/cpp/src/server/TNonblockingServer.h b/lib/cpp/src/server/TNonblockingServer.h index a2d6533b..cf024ed5 100644 --- a/lib/cpp/src/server/TNonblockingServer.h +++ b/lib/cpp/src/server/TNonblockingServer.h @@ -17,12 +17,12 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { -using facebook::thrift::transport::TMemoryBuffer; -using facebook::thrift::protocol::TProtocol; -using facebook::thrift::concurrency::Runnable; -using facebook::thrift::concurrency::ThreadManager; +using apache::thrift::transport::TMemoryBuffer; +using apache::thrift::protocol::TProtocol; +using apache::thrift::concurrency::Runnable; +using apache::thrift::concurrency::ThreadManager; // Forward declaration of class class TConnection; @@ -300,7 +300,7 @@ class TConnection { TConnection(int socket, short eventFlags, TNonblockingServer *s) { readBuffer_ = (uint8_t*)std::malloc(1024); if (readBuffer_ == NULL) { - throw new facebook::thrift::TException("Out of memory."); + throw new apache::thrift::TException("Out of memory."); } readBufferSize_ = 1024; @@ -341,6 +341,6 @@ class TConnection { }; -}}} // facebook::thrift::server +}}} // apache::thrift::server #endif // #ifndef _THRIFT_SERVER_TSIMPLESERVER_H_ diff --git a/lib/cpp/src/server/TServer.cpp b/lib/cpp/src/server/TServer.cpp index 6febf982..a21fab6e 100644 --- a/lib/cpp/src/server/TServer.cpp +++ b/lib/cpp/src/server/TServer.cpp @@ -8,7 +8,7 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { int increase_max_fds(int max_fds=(1<<24)) { struct rlimit fdmaxrl; @@ -22,4 +22,4 @@ int increase_max_fds(int max_fds=(1<<24)) { return fdmaxrl.rlim_cur; } -}}} // facebook::thrift::server +}}} // apache::thrift::server diff --git a/lib/cpp/src/server/TServer.h b/lib/cpp/src/server/TServer.h index f05b2ebb..c30b561b 100644 --- a/lib/cpp/src/server/TServer.h +++ b/lib/cpp/src/server/TServer.h @@ -14,15 +14,15 @@ #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { -using facebook::thrift::TProcessor; -using facebook::thrift::protocol::TBinaryProtocolFactory; -using facebook::thrift::protocol::TProtocol; -using facebook::thrift::protocol::TProtocolFactory; -using facebook::thrift::transport::TServerTransport; -using facebook::thrift::transport::TTransport; -using facebook::thrift::transport::TTransportFactory; +using apache::thrift::TProcessor; +using apache::thrift::protocol::TBinaryProtocolFactory; +using apache::thrift::protocol::TProtocol; +using apache::thrift::protocol::TProtocolFactory; +using apache::thrift::transport::TServerTransport; +using apache::thrift::transport::TTransport; +using apache::thrift::transport::TTransportFactory; /** * Virtual interface class that can handle events from the server core. To @@ -196,6 +196,6 @@ public: int increase_max_fds(int max_fds=(1<<24)); -}}} // facebook::thrift::server +}}} // apache::thrift::server #endif // #ifndef _THRIFT_SERVER_TSERVER_H_ diff --git a/lib/cpp/src/server/TSimpleServer.cpp b/lib/cpp/src/server/TSimpleServer.cpp index f3011a20..08309b2d 100644 --- a/lib/cpp/src/server/TSimpleServer.cpp +++ b/lib/cpp/src/server/TSimpleServer.cpp @@ -9,12 +9,12 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; using boost::shared_ptr; /** @@ -103,4 +103,4 @@ void TSimpleServer::serve() { } } -}}} // facebook::thrift::server +}}} // apache::thrift::server diff --git a/lib/cpp/src/server/TSimpleServer.h b/lib/cpp/src/server/TSimpleServer.h index 1ab6f073..8bed8c2f 100644 --- a/lib/cpp/src/server/TSimpleServer.h +++ b/lib/cpp/src/server/TSimpleServer.h @@ -10,7 +10,7 @@ #include "server/TServer.h" #include "transport/TServerTransport.h" -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { /** * This is the most basic simple server. It is single-threaded and runs a @@ -53,6 +53,6 @@ class TSimpleServer : public TServer { }; -}}} // facebook::thrift::server +}}} // apache::thrift::server #endif // #ifndef _THRIFT_SERVER_TSIMPLESERVER_H_ diff --git a/lib/cpp/src/server/TThreadPoolServer.cpp b/lib/cpp/src/server/TThreadPoolServer.cpp index 55a73d38..49240447 100644 --- a/lib/cpp/src/server/TThreadPoolServer.cpp +++ b/lib/cpp/src/server/TThreadPoolServer.cpp @@ -11,14 +11,14 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { using boost::shared_ptr; using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::concurrency; -using namespace facebook::thrift::protocol;; -using namespace facebook::thrift::transport; +using namespace apache::thrift; +using namespace apache::thrift::concurrency; +using namespace apache::thrift::protocol;; +using namespace apache::thrift::transport; class TThreadPoolServer::Task : public Runnable { @@ -201,4 +201,4 @@ void TThreadPoolServer::setTimeout(int64_t value) { timeout_ = value; } -}}} // facebook::thrift::server +}}} // apache::thrift::server diff --git a/lib/cpp/src/server/TThreadPoolServer.h b/lib/cpp/src/server/TThreadPoolServer.h index f27e8f70..0cd3a4a0 100644 --- a/lib/cpp/src/server/TThreadPoolServer.h +++ b/lib/cpp/src/server/TThreadPoolServer.h @@ -13,12 +13,12 @@ #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { -using facebook::thrift::concurrency::ThreadManager; -using facebook::thrift::protocol::TProtocolFactory; -using facebook::thrift::transport::TServerTransport; -using facebook::thrift::transport::TTransportFactory; +using apache::thrift::concurrency::ThreadManager; +using apache::thrift::protocol::TProtocolFactory; +using apache::thrift::transport::TServerTransport; +using apache::thrift::transport::TTransportFactory; class TThreadPoolServer : public TServer { public: @@ -61,6 +61,6 @@ class TThreadPoolServer : public TServer { }; -}}} // facebook::thrift::server +}}} // apache::thrift::server #endif // #ifndef _THRIFT_SERVER_TTHREADPOOLSERVER_H_ diff --git a/lib/cpp/src/server/TThreadedServer.cpp b/lib/cpp/src/server/TThreadedServer.cpp index a08fd549..4840b7f2 100644 --- a/lib/cpp/src/server/TThreadedServer.cpp +++ b/lib/cpp/src/server/TThreadedServer.cpp @@ -13,14 +13,14 @@ #include #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { using boost::shared_ptr; using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::concurrency; class TThreadedServer::Task: public Runnable { @@ -217,4 +217,4 @@ void TThreadedServer::serve() { } -}}} // facebook::thrift::server +}}} // apache::thrift::server diff --git a/lib/cpp/src/server/TThreadedServer.h b/lib/cpp/src/server/TThreadedServer.h index 28d35491..8294f699 100644 --- a/lib/cpp/src/server/TThreadedServer.h +++ b/lib/cpp/src/server/TThreadedServer.h @@ -14,13 +14,13 @@ #include -namespace facebook { namespace thrift { namespace server { +namespace apache { namespace thrift { namespace server { -using facebook::thrift::TProcessor; -using facebook::thrift::transport::TServerTransport; -using facebook::thrift::transport::TTransportFactory; -using facebook::thrift::concurrency::Monitor; -using facebook::thrift::concurrency::ThreadFactory; +using apache::thrift::TProcessor; +using apache::thrift::transport::TServerTransport; +using apache::thrift::transport::TTransportFactory; +using apache::thrift::concurrency::Monitor; +using apache::thrift::concurrency::ThreadFactory; class TThreadedServer : public TServer { @@ -50,6 +50,6 @@ class TThreadedServer : public TServer { }; -}}} // facebook::thrift::server +}}} // apache::thrift::server #endif // #ifndef _THRIFT_SERVER_TTHREADEDSERVER_H_ diff --git a/lib/cpp/src/transport/TBufferTransports.cpp b/lib/cpp/src/transport/TBufferTransports.cpp index 15830149..8829b48a 100644 --- a/lib/cpp/src/transport/TBufferTransports.cpp +++ b/lib/cpp/src/transport/TBufferTransports.cpp @@ -11,7 +11,7 @@ using std::string; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { uint32_t TBufferedTransport::readSlow(uint8_t* buf, uint32_t len) { @@ -354,4 +354,4 @@ const uint8_t* TMemoryBuffer::borrowSlow(uint8_t* buf, uint32_t* len) { return NULL; } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TBufferTransports.h b/lib/cpp/src/transport/TBufferTransports.h index 334ad51f..f0298df2 100644 --- a/lib/cpp/src/transport/TBufferTransports.h +++ b/lib/cpp/src/transport/TBufferTransports.h @@ -20,7 +20,7 @@ #define TDB_UNLIKELY(val) (val) #endif -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** @@ -660,6 +660,6 @@ class TMemoryBuffer : public TBufferBase { // you add new members. }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TBUFFERTRANSPORTS_H_ diff --git a/lib/cpp/src/transport/TFDTransport.cpp b/lib/cpp/src/transport/TFDTransport.cpp index bbdcb193..dbc7e4e8 100644 --- a/lib/cpp/src/transport/TFDTransport.cpp +++ b/lib/cpp/src/transport/TFDTransport.cpp @@ -13,7 +13,7 @@ using namespace std; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { void TFDTransport::close() { if (!isOpen()) { @@ -61,4 +61,4 @@ void TFDTransport::write(const uint8_t* buf, uint32_t len) { } } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TFDTransport.h b/lib/cpp/src/transport/TFDTransport.h index 7cb61400..56408cab 100644 --- a/lib/cpp/src/transport/TFDTransport.h +++ b/lib/cpp/src/transport/TFDTransport.h @@ -13,7 +13,7 @@ #include "TTransport.h" #include "TServerSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * Dead-simple wrapper around a file descriptor. @@ -56,6 +56,6 @@ class TFDTransport : public TTransport { ClosePolicy close_policy_; }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TFDTRANSPORT_H_ diff --git a/lib/cpp/src/transport/TFileTransport.cpp b/lib/cpp/src/transport/TFileTransport.cpp index 121b4df1..3bc2b91d 100644 --- a/lib/cpp/src/transport/TFileTransport.cpp +++ b/lib/cpp/src/transport/TFileTransport.cpp @@ -28,11 +28,11 @@ #include #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { using boost::shared_ptr; using namespace std; -using namespace facebook::thrift::protocol; +using namespace apache::thrift::protocol; #ifndef HAVE_CLOCK_GETTIME @@ -938,4 +938,4 @@ void TFileProcessor::processChunk() { } } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TFileTransport.h b/lib/cpp/src/transport/TFileTransport.h index c4c921e2..66f17d33 100644 --- a/lib/cpp/src/transport/TFileTransport.h +++ b/lib/cpp/src/transport/TFileTransport.h @@ -16,10 +16,10 @@ #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { -using facebook::thrift::TProcessor; -using facebook::thrift::protocol::TProtocolFactory; +using apache::thrift::TProcessor; +using apache::thrift::protocol::TProtocolFactory; // Data pertaining to a single event typedef struct eventInfo { @@ -424,6 +424,6 @@ class TFileProcessor { }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // _THRIFT_TRANSPORT_TFILETRANSPORT_H_ diff --git a/lib/cpp/src/transport/THttpClient.cpp b/lib/cpp/src/transport/THttpClient.cpp index 8c82d7fd..fffb4bdc 100644 --- a/lib/cpp/src/transport/THttpClient.cpp +++ b/lib/cpp/src/transport/THttpClient.cpp @@ -10,7 +10,7 @@ #include "THttpClient.h" #include "TSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { using namespace std; @@ -333,4 +333,4 @@ void THttpClient::flush() { readHeaders_ = true; } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/THttpClient.h b/lib/cpp/src/transport/THttpClient.h index dbffe99d..b0fa28ee 100644 --- a/lib/cpp/src/transport/THttpClient.h +++ b/lib/cpp/src/transport/THttpClient.h @@ -9,7 +9,7 @@ #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * HTTP client implementation of the thrift transport. This was irritating @@ -94,6 +94,6 @@ class THttpClient : public TTransport { }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_THTTPCLIENT_H_ diff --git a/lib/cpp/src/transport/TServerSocket.cpp b/lib/cpp/src/transport/TServerSocket.cpp index 3493fc09..69f5217f 100644 --- a/lib/cpp/src/transport/TServerSocket.cpp +++ b/lib/cpp/src/transport/TServerSocket.cpp @@ -18,7 +18,7 @@ #include "TServerSocket.h" #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { using namespace std; using boost::shared_ptr; @@ -350,4 +350,4 @@ void TServerSocket::close() { intSock2_ = -1; } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TServerSocket.h b/lib/cpp/src/transport/TServerSocket.h index b6bafa0f..b406b78f 100644 --- a/lib/cpp/src/transport/TServerSocket.h +++ b/lib/cpp/src/transport/TServerSocket.h @@ -10,7 +10,7 @@ #include "TServerTransport.h" #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { class TSocket; @@ -59,6 +59,6 @@ class TServerSocket : public TServerTransport { int intSock2_; }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TSERVERSOCKET_H_ diff --git a/lib/cpp/src/transport/TServerTransport.h b/lib/cpp/src/transport/TServerTransport.h index b8e6b97d..612a94c3 100644 --- a/lib/cpp/src/transport/TServerTransport.h +++ b/lib/cpp/src/transport/TServerTransport.h @@ -11,7 +11,7 @@ #include "TTransportException.h" #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * Server transport framework. A server needs to have some facility for @@ -75,6 +75,6 @@ class TServerTransport { }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TSERVERTRANSPORT_H_ diff --git a/lib/cpp/src/transport/TShortReadTransport.h b/lib/cpp/src/transport/TShortReadTransport.h index 428fa9e5..8b9b192d 100644 --- a/lib/cpp/src/transport/TShortReadTransport.h +++ b/lib/cpp/src/transport/TShortReadTransport.h @@ -11,7 +11,7 @@ #include -namespace facebook { namespace thrift { namespace transport { namespace test { +namespace apache { namespace thrift { namespace transport { namespace test { /** * This class is only meant for testing. It wraps another transport. @@ -79,6 +79,6 @@ class TShortReadTransport : public TTransport { double fullProb_; }; -}}}} // facebook::thrift::transport::test +}}}} // apache::thrift::transport::test #endif // #ifndef _THRIFT_TRANSPORT_TSHORTREADTRANSPORT_H_ diff --git a/lib/cpp/src/transport/TSocket.cpp b/lib/cpp/src/transport/TSocket.cpp index 46cd2b48..04cd81e1 100644 --- a/lib/cpp/src/transport/TSocket.cpp +++ b/lib/cpp/src/transport/TSocket.cpp @@ -22,7 +22,7 @@ #include "TSocket.h" #include "TTransportException.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { using namespace std; @@ -556,4 +556,4 @@ int TSocket::getPeerPort() { return peerPort_; } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TSocket.h b/lib/cpp/src/transport/TSocket.h index 8d4a5a77..27baa99d 100644 --- a/lib/cpp/src/transport/TSocket.h +++ b/lib/cpp/src/transport/TSocket.h @@ -13,7 +13,7 @@ #include "TTransport.h" #include "TServerSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * TCP Socket implementation of the TTransport interface. @@ -225,7 +225,7 @@ class TSocket : public TTransport { struct timeval recvTimeval_; }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TSOCKET_H_ diff --git a/lib/cpp/src/transport/TSocketPool.cpp b/lib/cpp/src/transport/TSocketPool.cpp index d5a65012..549569f7 100644 --- a/lib/cpp/src/transport/TSocketPool.cpp +++ b/lib/cpp/src/transport/TSocketPool.cpp @@ -9,7 +9,7 @@ #include "TSocketPool.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { using namespace std; @@ -221,4 +221,4 @@ void TSocketPool::close() { } } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TSocketPool.h b/lib/cpp/src/transport/TSocketPool.h index a455acaf..b72dfb2f 100644 --- a/lib/cpp/src/transport/TSocketPool.h +++ b/lib/cpp/src/transport/TSocketPool.h @@ -10,7 +10,7 @@ #include #include "TSocket.h" -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * Class to hold server information for TSocketPool @@ -174,7 +174,7 @@ class TSocketPool : public TSocket { bool alwaysTryLast_; }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TSOCKETPOOL_H_ diff --git a/lib/cpp/src/transport/TTransport.h b/lib/cpp/src/transport/TTransport.h index d775d4e5..e2e30f83 100644 --- a/lib/cpp/src/transport/TTransport.h +++ b/lib/cpp/src/transport/TTransport.h @@ -12,7 +12,7 @@ #include #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * Generic interface for a method of transporting data. A TTransport may be @@ -208,6 +208,6 @@ class TTransportFactory { }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TTRANSPORT_H_ diff --git a/lib/cpp/src/transport/TTransportException.cpp b/lib/cpp/src/transport/TTransportException.cpp index e231a93a..e48fe93b 100644 --- a/lib/cpp/src/transport/TTransportException.cpp +++ b/lib/cpp/src/transport/TTransportException.cpp @@ -12,7 +12,7 @@ using std::string; using boost::lexical_cast; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TTransportException.h b/lib/cpp/src/transport/TTransportException.h index e254aac4..d0c44cfd 100644 --- a/lib/cpp/src/transport/TTransportException.h +++ b/lib/cpp/src/transport/TTransportException.h @@ -10,7 +10,7 @@ #include #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * Class to encapsulate all the possible types of transport errors that may @@ -21,7 +21,7 @@ namespace facebook { namespace thrift { namespace transport { * * @author Mark Slee */ -class TTransportException : public facebook::thrift::TException { +class TTransportException : public apache::thrift::TException { public: /** * Error codes for the various types of exceptions. @@ -39,25 +39,25 @@ class TTransportException : public facebook::thrift::TException { }; TTransportException() : - facebook::thrift::TException(), + apache::thrift::TException(), type_(UNKNOWN) {} TTransportException(TTransportExceptionType type) : - facebook::thrift::TException(), + apache::thrift::TException(), type_(type) {} TTransportException(const std::string& message) : - facebook::thrift::TException(message), + apache::thrift::TException(message), type_(UNKNOWN) {} TTransportException(TTransportExceptionType type, const std::string& message) : - facebook::thrift::TException(message), + apache::thrift::TException(message), type_(type) {} TTransportException(TTransportExceptionType type, const std::string& message, int errno_copy) : - facebook::thrift::TException(message + ": " + TOutput::strerror_s(errno_copy)), + apache::thrift::TException(message + ": " + TOutput::strerror_s(errno_copy)), type_(type) {} virtual ~TTransportException() throw() {} @@ -100,6 +100,6 @@ class TTransportException : public facebook::thrift::TException { }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TTRANSPORTEXCEPTION_H_ diff --git a/lib/cpp/src/transport/TTransportUtils.cpp b/lib/cpp/src/transport/TTransportUtils.cpp index d365a3cc..6ce0c1ae 100644 --- a/lib/cpp/src/transport/TTransportUtils.cpp +++ b/lib/cpp/src/transport/TTransportUtils.cpp @@ -8,7 +8,7 @@ using std::string; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { uint32_t TPipedTransport::read(uint8_t* buf, uint32_t len) { uint32_t need = len; @@ -162,4 +162,4 @@ void TPipedFileReaderTransport::seekToEnd() { srcTrans_->seekToEnd(); } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/transport/TTransportUtils.h index 61f6822d..50ce8594 100644 --- a/lib/cpp/src/transport/TTransportUtils.h +++ b/lib/cpp/src/transport/TTransportUtils.h @@ -16,7 +16,7 @@ #include #include -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { /** * The null transport is a dummy transport that doesn't actually do anything. @@ -274,6 +274,6 @@ class TPipedFileReaderTransportFactory : public TPipedTransportFactory { } }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TTRANSPORTUTILS_H_ diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/transport/TZlibTransport.cpp index c14b0398..7519d965 100644 --- a/lib/cpp/src/transport/TZlibTransport.cpp +++ b/lib/cpp/src/transport/TZlibTransport.cpp @@ -12,7 +12,7 @@ using std::string; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { // Don't call this outside of the constructor. void TZlibTransport::initZlib() { @@ -283,4 +283,4 @@ void TZlibTransport::verifyChecksum() { } -}}} // facebook::thrift::transport +}}} // apache::thrift::transport diff --git a/lib/cpp/src/transport/TZlibTransport.h b/lib/cpp/src/transport/TZlibTransport.h index c2c18495..482bfda1 100644 --- a/lib/cpp/src/transport/TZlibTransport.h +++ b/lib/cpp/src/transport/TZlibTransport.h @@ -12,7 +12,7 @@ struct z_stream_s; -namespace facebook { namespace thrift { namespace transport { +namespace apache { namespace thrift { namespace transport { class TZlibTransportException : public TTransportException { public: @@ -202,6 +202,6 @@ class TZlibTransport : public TTransport { struct z_stream_s* wstream_; }; -}}} // facebook::thrift::transport +}}} // apache::thrift::transport #endif // #ifndef _THRIFT_TRANSPORT_TZLIBTRANSPORT_H_ diff --git a/test/Benchmark.cpp b/test/Benchmark.cpp index af118eee..0f799760 100644 --- a/test/Benchmark.cpp +++ b/test/Benchmark.cpp @@ -32,8 +32,8 @@ public: int main() { using namespace std; using namespace thrift::test::debug; - using namespace facebook::thrift::transport; - using namespace facebook::thrift::protocol; + using namespace apache::thrift::transport; + using namespace apache::thrift::protocol; using namespace boost; OneOfEach ooe; @@ -79,7 +79,7 @@ int main() { TBinaryProtocol prot(buf2); ooe2.read(&prot); - //cout << facebook::thrift::ThriftDebugString(ooe2) << endl << endl; + //cout << apache::thrift::ThriftDebugString(ooe2) << endl << endl; } cout << " Read: " << num / (1000 * timer.frame()) << " kHz" << endl; } diff --git a/test/DebugProtoTest.cpp b/test/DebugProtoTest.cpp index 98ff43c7..48aaeaaf 100644 --- a/test/DebugProtoTest.cpp +++ b/test/DebugProtoTest.cpp @@ -20,7 +20,7 @@ int main() { ooe.some_characters = "Debug THIS!"; ooe.zomg_unicode = "\xd7\n\a\t"; - cout << facebook::thrift::ThriftDebugString(ooe) << endl << endl; + cout << apache::thrift::ThriftDebugString(ooe) << endl << endl; Nesting n; @@ -36,7 +36,7 @@ int main() { n.my_bonk.type = 31337; n.my_bonk.message = "I am a bonk... xor!"; - cout << facebook::thrift::ThriftDebugString(n) << endl << endl; + cout << apache::thrift::ThriftDebugString(n) << endl << endl; HolyMoley hm; @@ -79,7 +79,7 @@ int main() { stage2.back().message = "nevermore"; hm.bonks["poe"] = stage2; - cout << facebook::thrift::ThriftDebugString(hm) << endl << endl; + cout << apache::thrift::ThriftDebugString(hm) << endl << endl; return 0; diff --git a/test/DenseProtoTest.cpp b/test/DenseProtoTest.cpp index 68b5df9c..d65a6c15 100644 --- a/test/DenseProtoTest.cpp +++ b/test/DenseProtoTest.cpp @@ -41,8 +41,8 @@ int main() { using std::endl; using boost::shared_ptr; using namespace thrift::test::debug; - using namespace facebook::thrift::transport; - using namespace facebook::thrift::protocol; + using namespace apache::thrift::transport; + using namespace apache::thrift::protocol; OneOfEach ooe; @@ -56,7 +56,7 @@ int main() { ooe.some_characters = "Debug THIS!"; ooe.zomg_unicode = "\xd7\n\a\t"; - //cout << facebook::thrift::ThriftDebugString(ooe) << endl << endl; + //cout << apache::thrift::ThriftDebugString(ooe) << endl << endl; Nesting n; @@ -72,7 +72,7 @@ int main() { n.my_bonk.type = 31337; n.my_bonk.message = "I am a bonk... xor!"; - //cout << facebook::thrift::ThriftDebugString(n) << endl << endl; + //cout << apache::thrift::ThriftDebugString(n) << endl << endl; HolyMoley hm; @@ -115,7 +115,7 @@ int main() { stage2.back().message = "nevermore"; hm.bonks["poe"] = stage2; - //cout << facebook::thrift::ThriftDebugString(hm) << endl << endl; + //cout << apache::thrift::ThriftDebugString(hm) << endl << endl; shared_ptr buffer(new TMemoryBuffer()); shared_ptr proto(new TDenseProtocol(buffer)); diff --git a/test/JSONProtoTest.cpp b/test/JSONProtoTest.cpp index eb7f4162..30652760 100644 --- a/test/JSONProtoTest.cpp +++ b/test/JSONProtoTest.cpp @@ -8,8 +8,8 @@ int main() { using std::cout; using std::endl; using namespace thrift::test::debug; - using facebook::thrift::transport::TMemoryBuffer; - using facebook::thrift::protocol::TJSONProtocol; + using apache::thrift::transport::TMemoryBuffer; + using apache::thrift::protocol::TJSONProtocol; OneOfEach ooe; ooe.im_true = true; @@ -22,7 +22,7 @@ int main() { ooe.some_characters = "JSON THIS! \"\1"; ooe.zomg_unicode = "\xd7\n\a\t"; ooe.base64 = "\1\2\3\255"; - cout << facebook::thrift::ThriftJSONString(ooe) << endl << endl; + cout << apache::thrift::ThriftJSONString(ooe) << endl << endl; Nesting n; @@ -38,7 +38,7 @@ int main() { n.my_bonk.type = 31337; n.my_bonk.message = "I am a bonk... xor!"; - cout << facebook::thrift::ThriftJSONString(n) << endl << endl; + cout << apache::thrift::ThriftJSONString(n) << endl << endl; HolyMoley hm; @@ -81,7 +81,7 @@ int main() { stage2.back().message = "nevermore"; hm.bonks["poe"] = stage2; - cout << facebook::thrift::ThriftJSONString(hm) << endl << endl; + cout << apache::thrift::ThriftJSONString(hm) << endl << endl; boost::shared_ptr buffer(new TMemoryBuffer()); boost::shared_ptr proto(new TJSONProtocol(buffer)); @@ -117,7 +117,7 @@ int main() { dub.small = 1E-305; dub.zero = 0.0; dub.negzero = -0.0; - cout << facebook::thrift::ThriftJSONString(dub) << endl << endl; + cout << apache::thrift::ThriftJSONString(dub) << endl << endl; cout << "Testing base" << endl; diff --git a/test/OptionalRequiredTest.cpp b/test/OptionalRequiredTest.cpp index c3fbfd1c..028ca775 100644 --- a/test/OptionalRequiredTest.cpp +++ b/test/OptionalRequiredTest.cpp @@ -11,9 +11,9 @@ using std::endl; using std::map; using std::string; using namespace thrift::test; -using namespace facebook::thrift; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::protocol; +using namespace apache::thrift; +using namespace apache::thrift::transport; +using namespace apache::thrift::protocol; /* diff --git a/test/ReflectionTest.cpp b/test/ReflectionTest.cpp index d60b52cc..c670c828 100644 --- a/test/ReflectionTest.cpp +++ b/test/ReflectionTest.cpp @@ -7,13 +7,13 @@ int main() { using std::cout; using std::endl; - facebook::thrift::reflection::limited::Service srv1; + apache::thrift::reflection::limited::Service srv1; thrift::test::debug::PartiallyReflectableIf::getStaticLimitedReflection(srv1); - cout << facebook::thrift::ThriftDebugString(srv1) << endl << endl; + cout << apache::thrift::ThriftDebugString(srv1) << endl << endl; - facebook::thrift::reflection::limited::Service srv2; + apache::thrift::reflection::limited::Service srv2; test::stress::ServiceIf::getStaticLimitedReflection(srv2); - cout << facebook::thrift::ThriftDebugString(srv2) << endl << endl; + cout << apache::thrift::ThriftDebugString(srv2) << endl << endl; return 0; } diff --git a/test/TBufferBaseTest.cpp b/test/TBufferBaseTest.cpp index cd394b2c..ac7e9cb2 100644 --- a/test/TBufferBaseTest.cpp +++ b/test/TBufferBaseTest.cpp @@ -6,10 +6,10 @@ using std::string; using boost::shared_ptr; -using facebook::thrift::transport::TMemoryBuffer; -using facebook::thrift::transport::TBufferedTransport; -using facebook::thrift::transport::TFramedTransport; -using facebook::thrift::transport::test::TShortReadTransport; +using apache::thrift::transport::TMemoryBuffer; +using apache::thrift::transport::TBufferedTransport; +using apache::thrift::transport::TFramedTransport; +using apache::thrift::transport::test::TShortReadTransport; #define foreach BOOST_FOREACH diff --git a/test/TFDTransportTest.cpp b/test/TFDTransportTest.cpp index dfc2d277..5e7e032f 100644 --- a/test/TFDTransportTest.cpp +++ b/test/TFDTransportTest.cpp @@ -2,8 +2,8 @@ #include #include #include -using facebook::thrift::transport::TTransportException; -using facebook::thrift::transport::TFDTransport; +using apache::thrift::transport::TTransportException; +using apache::thrift::transport::TFDTransport; class DummyException : std::exception { }; diff --git a/test/TMemoryBufferTest.cpp b/test/TMemoryBufferTest.cpp index 4614196d..61f7ecfb 100644 --- a/test/TMemoryBufferTest.cpp +++ b/test/TMemoryBufferTest.cpp @@ -9,8 +9,8 @@ BOOST_AUTO_TEST_SUITE( TMemoryBufferTest ) BOOST_AUTO_TEST_CASE( test_roundtrip ) { - using facebook::thrift::transport::TMemoryBuffer; - using facebook::thrift::protocol::TBinaryProtocol; + using apache::thrift::transport::TMemoryBuffer; + using apache::thrift::protocol::TBinaryProtocol; using boost::shared_ptr; shared_ptr strBuffer(new TMemoryBuffer()); @@ -36,7 +36,7 @@ BOOST_AUTO_TEST_CASE( test_roundtrip ) { BOOST_AUTO_TEST_CASE( test_copy ) { - using facebook::thrift::transport::TMemoryBuffer; + using apache::thrift::transport::TMemoryBuffer; using std::string; using std::cout; using std::endl; @@ -62,8 +62,8 @@ BOOST_AUTO_TEST_CASE( test_copy ) BOOST_AUTO_TEST_CASE( test_exceptions ) { - using facebook::thrift::transport::TTransportException; - using facebook::thrift::transport::TMemoryBuffer; + using apache::thrift::transport::TTransportException; + using apache::thrift::transport::TMemoryBuffer; using std::string; char data[] = "foo\0bar"; diff --git a/test/TPipedTransportTest.cpp b/test/TPipedTransportTest.cpp index 06950ea4..991032ab 100644 --- a/test/TPipedTransportTest.cpp +++ b/test/TPipedTransportTest.cpp @@ -5,9 +5,9 @@ #include using namespace std; using boost::shared_ptr; -using facebook::thrift::transport::TTransportException; -using facebook::thrift::transport::TPipedTransport; -using facebook::thrift::transport::TMemoryBuffer; +using apache::thrift::transport::TTransportException; +using apache::thrift::transport::TPipedTransport; +using apache::thrift::transport::TMemoryBuffer; int main() { shared_ptr underlying(new TMemoryBuffer); diff --git a/test/ThriftTest_extras.cpp b/test/ThriftTest_extras.cpp index aa761a85..6a56d315 100644 --- a/test/ThriftTest_extras.cpp +++ b/test/ThriftTest_extras.cpp @@ -7,7 +7,7 @@ namespace thrift { namespace test { bool Insanity::operator<(thrift::test::Insanity const& other) const { - using facebook::thrift::ThriftDebugString; + using apache::thrift::ThriftDebugString; return ThriftDebugString(*this) < ThriftDebugString(other); } diff --git a/test/ZlibTest.cpp b/test/ZlibTest.cpp index 08ec1742..3084728b 100644 --- a/test/ZlibTest.cpp +++ b/test/ZlibTest.cpp @@ -147,7 +147,7 @@ unsigned int dist[][5000] = { int main() { using namespace std; using namespace boost; - using namespace facebook::thrift::transport; + using namespace apache::thrift::transport; char *file_names[] = { // Highly compressible. diff --git a/test/cpp/src/TestClient.cpp b/test/cpp/src/TestClient.cpp index 85299389..53502977 100644 --- a/test/cpp/src/TestClient.cpp +++ b/test/cpp/src/TestClient.cpp @@ -13,9 +13,9 @@ using namespace boost; using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; using namespace thrift::test; //extern uint32_t g_socket_syscalls; diff --git a/test/cpp/src/TestServer.cpp b/test/cpp/src/TestServer.cpp index 602f454d..56068f1b 100644 --- a/test/cpp/src/TestServer.cpp +++ b/test/cpp/src/TestServer.cpp @@ -19,11 +19,11 @@ using namespace std; using namespace boost; -using namespace facebook::thrift; -using namespace facebook::thrift::concurrency; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; +using namespace apache::thrift; +using namespace apache::thrift::concurrency; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; using namespace thrift::test; @@ -223,7 +223,7 @@ class TestHandler : public ThriftTestIf { } void testException(const std::string &arg) - throw(Xception, facebook::thrift::TException) + throw(Xception, apache::thrift::TException) { printf("testException(%s)\n", arg.c_str()); if (arg.compare("Xception") == 0) { @@ -232,7 +232,7 @@ class TestHandler : public ThriftTestIf { e.message = arg; throw e; } else if (arg.compare("ApplicationException") == 0) { - facebook::thrift::TException e; + apache::thrift::TException e; throw e; } else { Xtruct result; diff --git a/test/cpp/src/main.cpp b/test/cpp/src/main.cpp index 78491d62..d0a3cd27 100644 --- a/test/cpp/src/main.cpp +++ b/test/cpp/src/main.cpp @@ -28,11 +28,11 @@ using __gnu_cxx::hash; using namespace std; using namespace boost; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; +using namespace apache::thrift::concurrency; using namespace test::stress; diff --git a/test/cpp/src/nb-main.cpp b/test/cpp/src/nb-main.cpp index 164febb3..188c4408 100644 --- a/test/cpp/src/nb-main.cpp +++ b/test/cpp/src/nb-main.cpp @@ -32,11 +32,11 @@ using __gnu_cxx::hash; using namespace std; using namespace boost; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; +using namespace apache::thrift::concurrency; using namespace test::stress; diff --git a/test/threads/ThreadsClient.cpp b/test/threads/ThreadsClient.cpp index 7ad6f00b..24a1540f 100644 --- a/test/threads/ThreadsClient.cpp +++ b/test/threads/ThreadsClient.cpp @@ -11,11 +11,11 @@ #include using boost::shared_ptr; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; +using namespace apache::thrift::concurrency; int main(int argc, char **argv) { int port = 9090; diff --git a/test/threads/ThreadsServer.cpp b/test/threads/ThreadsServer.cpp index 826bbdb8..c4ce2c99 100644 --- a/test/threads/ThreadsServer.cpp +++ b/test/threads/ThreadsServer.cpp @@ -12,11 +12,11 @@ #include using boost::shared_ptr; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; -using namespace facebook::thrift::concurrency; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; +using namespace apache::thrift::concurrency; class ThreadsTestHandler : virtual public ThreadsTestIf { diff --git a/tutorial/cpp/CppClient.cpp b/tutorial/cpp/CppClient.cpp index a21125b2..da77c7d5 100644 --- a/tutorial/cpp/CppClient.cpp +++ b/tutorial/cpp/CppClient.cpp @@ -9,9 +9,9 @@ #include "../gen-cpp/Calculator.h" using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; using namespace tutorial; using namespace shared; diff --git a/tutorial/cpp/CppServer.cpp b/tutorial/cpp/CppServer.cpp index 3be19c0b..a2c30d2a 100644 --- a/tutorial/cpp/CppServer.cpp +++ b/tutorial/cpp/CppServer.cpp @@ -14,10 +14,10 @@ #include "../gen-cpp/Calculator.h" using namespace std; -using namespace facebook::thrift; -using namespace facebook::thrift::protocol; -using namespace facebook::thrift::transport; -using namespace facebook::thrift::server; +using namespace apache::thrift; +using namespace apache::thrift::protocol; +using namespace apache::thrift::transport; +using namespace apache::thrift::server; using namespace tutorial; using namespace shared;