| 301 |
ashish |
1 |
// Copyright (c) 2007-2008 Facebook
|
|
|
2 |
//
|
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
|
5 |
// You may obtain a copy of the License at
|
|
|
6 |
//
|
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
8 |
//
|
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
12 |
// See the License for the specific language governing permissions and
|
|
|
13 |
// limitations under the License.
|
|
|
14 |
//
|
|
|
15 |
// See accompanying file LICENSE or visit the Scribe site at:
|
|
|
16 |
// http://developers.facebook.com/scribe/
|
|
|
17 |
//
|
|
|
18 |
// @author Bobby Johnson
|
|
|
19 |
// @author Jason Sobel
|
|
|
20 |
|
|
|
21 |
#ifndef SCRIBE_COMMON_H
|
|
|
22 |
#define SCRIBE_COMMON_H
|
|
|
23 |
|
|
|
24 |
#include <sstream>
|
|
|
25 |
#include <iostream>
|
|
|
26 |
#include <iomanip>
|
|
|
27 |
#include <fstream>
|
|
|
28 |
#include <string>
|
|
|
29 |
#include <queue>
|
|
|
30 |
#include <vector>
|
|
|
31 |
#include <pthread.h>
|
|
|
32 |
#include <semaphore.h>
|
|
|
33 |
#include <map>
|
|
|
34 |
#include <set>
|
|
|
35 |
#include <stdexcept>
|
|
|
36 |
#include <errno.h>
|
|
|
37 |
#include <stdint.h>
|
|
|
38 |
#include <stdio.h>
|
|
|
39 |
#include <stdlib.h>
|
|
|
40 |
#include <getopt.h>
|
|
|
41 |
#include <sys/resource.h>
|
|
|
42 |
#include <sys/types.h>
|
|
|
43 |
#include <sys/stat.h>
|
|
|
44 |
#include <unistd.h>
|
|
|
45 |
#include <boost/shared_ptr.hpp>
|
|
|
46 |
#include <boost/filesystem/operations.hpp>
|
|
|
47 |
#include <boost/filesystem/convenience.hpp>
|
|
|
48 |
|
|
|
49 |
#include "thrift/protocol/TBinaryProtocol.h"
|
|
|
50 |
#include "thrift/server/TNonblockingServer.h"
|
|
|
51 |
#include "thrift/concurrency/ThreadManager.h"
|
|
|
52 |
#include "thrift/concurrency/PosixThreadFactory.h"
|
|
|
53 |
#include "thrift/concurrency/Mutex.h"
|
|
|
54 |
#include "thrift/transport/TSocket.h"
|
|
|
55 |
#include "thrift/transport/TSocketPool.h"
|
|
|
56 |
#include "thrift/transport/TServerSocket.h"
|
|
|
57 |
#include "thrift/transport/TTransportUtils.h"
|
|
|
58 |
#include "thrift/transport/THttpClient.h"
|
|
|
59 |
#include "thrift/transport/TFileTransport.h"
|
|
|
60 |
#include "fb303/FacebookBase.h"
|
|
|
61 |
|
|
|
62 |
#include "src/gen-cpp/scribe.h"
|
|
|
63 |
|
|
|
64 |
typedef boost::shared_ptr<scribe::thrift::LogEntry> logentry_ptr_t;
|
|
|
65 |
typedef std::vector<logentry_ptr_t> logentry_vector_t;
|
|
|
66 |
typedef std::vector<std::pair<std::string, int> > server_vector_t;
|
|
|
67 |
|
|
|
68 |
// For security reasons we can't release everything that's compiled
|
|
|
69 |
// in at facebook. Other users might find this useful as well for
|
|
|
70 |
// integrating to their environment.
|
|
|
71 |
// Things in this file include network based configuration and debug messages
|
|
|
72 |
#ifdef FACEBOOK
|
|
|
73 |
#include "env_facebook.h"
|
|
|
74 |
#else
|
|
|
75 |
#include "env_default.h"
|
|
|
76 |
#endif
|
|
|
77 |
|
|
|
78 |
#endif // !defined SCRIBE_COMMON_H
|