Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ldap-test.cc
Go to the documentation of this file.
1 #include "gen-cpp/LdapTest.h"
2 #include "rpc/thrift-server.h"
3 #include "common/init.h"
4 #include <boost/shared_ptr.hpp>
5 #include "rpc/auth-provider.h"
6 #include "rpc/authentication.h"
7 
8 using namespace boost;
9 using namespace apache::thrift;
10 using namespace apache::thrift::protocol;
11 using namespace apache::thrift::transport;
12 using namespace apache::thrift::server;
13 using namespace apache::thrift::concurrency;
14 
15 namespace impala {
16 
17 class LdapTestServer : public LdapTestIf {
18  public:
19  virtual bool Ping() {
20  LOG(INFO) << "Ping!";
21  return true;
22  }
23 };
24 
25 }
26 
27 DECLARE_string(principal);
28 
29 using namespace impala;
30 
31 int main(int argc, char** argv) {
32  InitCommonRuntime(argc, argv, false);
33  // if (!FLAGS_principal.empty()) {
34  // EXIT_IF_ERROR(InitKerberos("Impalad"));
35  // }
36  EXIT_IF_ERROR(InitAuth("ldap-test"));
37  LdapAuthProvider auth;
38  shared_ptr<LdapTestServer> handler(new LdapTestServer());
39  shared_ptr<TProcessor> ldap_processor(new LdapTestProcessor(handler));
40  AuthProvider* provider = new LdapAuthProvider();
41  provider->Start();
42  ThriftServer svr("ldap-server", ldap_processor, 12345, provider);
43  EXIT_IF_ERROR(svr.Start());
44  svr.Join();
45 }
DECLARE_string(principal)
const StringSearch UrlParser::protocol_search & protocol
Definition: url-parser.cc:36
int main(int argc, char **argv)
Definition: ldap-test.cc:31
void InitCommonRuntime(int argc, char **argv, bool init_jvm, TestInfo::Mode m=TestInfo::NON_TEST)
Definition: init.cc:122
void Join()
Blocks until the server stops and exits its main thread.
virtual Status Start()=0
Initialises any state required to perform authentication using this provider.
#define EXIT_IF_ERROR(stmt)
Definition: status.h:248
virtual bool Ping()
Definition: ldap-test.cc:19
Status InitAuth(const std::string &appname)