mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
Fix 'include' errors
This commit is contained in:
@@ -18,8 +18,7 @@
|
||||
|
||||
#ifndef _DNSROUTINE_H_
|
||||
#define _DNSROUTINE_H_
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
#include <netdb.h>
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include <type_traits>
|
||||
#include "rbtree.h"
|
||||
|
||||
namespace algorithm
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <string>
|
||||
#include <openssl/bio.h>
|
||||
#include <openssl/ssl.h>
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include "list.h"
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
#include "HttpMessage.h"
|
||||
#include "MySQLMessage.h"
|
||||
#include "DnsMessage.h"
|
||||
#include "DnsRoutine.h"
|
||||
#include "Workflow.h"
|
||||
#include "WFTask.h"
|
||||
#include "WFGraphTask.h"
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <sys/uio.h>
|
||||
#include <sys/eventfd.h>
|
||||
#include <stddef.h>
|
||||
#include <pthread.h>
|
||||
#include "list.h"
|
||||
|
||||
#define IOS_STATE_SUCCESS 0
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _SLEEPREQUEST_H_
|
||||
#define _SLEEPREQUEST_H_
|
||||
|
||||
#include <errno.h>
|
||||
#include "SubTask.h"
|
||||
#include "Communicator.h"
|
||||
#include "CommScheduler.h"
|
||||
|
||||
@@ -19,8 +19,7 @@
|
||||
#ifndef _MPOLLER_H_
|
||||
#define _MPOLLER_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <stddef.h>
|
||||
#include "poller.h"
|
||||
|
||||
typedef struct __mpoller mpoller_t;
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#ifndef _DNSCACHE_H_
|
||||
#define _DNSCACHE_H_
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netdb.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
@@ -31,7 +32,6 @@
|
||||
#include "list.h"
|
||||
#include "rbtree.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "WFConnection.h"
|
||||
#include "MD5Util.h"
|
||||
#include "CommScheduler.h"
|
||||
#include "EndpointParams.h"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <pthread.h>
|
||||
#include "UpstreamManager.h"
|
||||
#include "WFNameService.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "UpstreamPolicies.h"
|
||||
|
||||
class __UpstreamManager
|
||||
|
||||
@@ -18,11 +18,9 @@
|
||||
|
||||
#ifndef _UPSTREAM_MANAGER_H_
|
||||
#define _UPSTREAM_MANAGER_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
#include "URIParser.h"
|
||||
#include "EndpointParams.h"
|
||||
#include "WFServiceGovernance.h"
|
||||
#include "UpstreamPolicies.h"
|
||||
#include "WFGlobal.h"
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
Xie Han (xiehan@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <signal.h>
|
||||
#include <pthread.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <ctype.h>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <atomic>
|
||||
@@ -35,8 +35,6 @@
|
||||
#include <openssl/engine.h>
|
||||
#include <openssl/conf.h>
|
||||
#include <openssl/crypto.h>
|
||||
#include "WFGlobal.h"
|
||||
#include "EndpointParams.h"
|
||||
#include "CommScheduler.h"
|
||||
#include "DnsCache.h"
|
||||
#include "RouteManager.h"
|
||||
@@ -46,6 +44,7 @@
|
||||
#include "WFNameService.h"
|
||||
#include "WFDnsResolver.h"
|
||||
#include "WFDnsClient.h"
|
||||
#include "WFGlobal.h"
|
||||
|
||||
class __WFGlobal
|
||||
{
|
||||
|
||||
@@ -26,13 +26,7 @@
|
||||
|
||||
#include <string>
|
||||
#include <openssl/ssl.h>
|
||||
#include "CommScheduler.h"
|
||||
#include "DnsCache.h"
|
||||
#include "RouteManager.h"
|
||||
#include "Executor.h"
|
||||
#include "EndpointParams.h"
|
||||
#include "WFNameService.h"
|
||||
#include "WFDnsResolver.h"
|
||||
|
||||
/**
|
||||
* @file WFGlobal.h
|
||||
@@ -114,18 +108,18 @@ public:
|
||||
|
||||
// Internal usage only
|
||||
public:
|
||||
static CommScheduler *get_scheduler();
|
||||
static DnsCache *get_dns_cache();
|
||||
static RouteManager *get_route_manager();
|
||||
static class CommScheduler *get_scheduler();
|
||||
static class DnsCache *get_dns_cache();
|
||||
static class RouteManager *get_route_manager();
|
||||
static SSL_CTX *get_ssl_client_ctx();
|
||||
static SSL_CTX *new_ssl_server_ctx();
|
||||
static ExecQueue *get_exec_queue(const std::string& queue_name);
|
||||
static Executor *get_compute_executor();
|
||||
static IOService *get_io_service();
|
||||
static ExecQueue *get_dns_queue();
|
||||
static Executor *get_dns_executor();
|
||||
static WFNameService *get_name_service();
|
||||
static WFDnsResolver *get_dns_resolver();
|
||||
static class ExecQueue *get_exec_queue(const std::string& queue_name);
|
||||
static class Executor *get_compute_executor();
|
||||
static class IOService *get_io_service();
|
||||
static class ExecQueue *get_dns_queue();
|
||||
static class Executor *get_dns_executor();
|
||||
static class WFNameService *get_name_service();
|
||||
static class WFDnsResolver *get_dns_resolver();
|
||||
static class WFDnsClient *get_dns_client();
|
||||
|
||||
public:
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
#include <pthread.h>
|
||||
#include <algorithm>
|
||||
#include <random>
|
||||
#include "rbtree.h"
|
||||
#include "URIParser.h"
|
||||
#include "StringUtil.h"
|
||||
#include "UpstreamPolicies.h"
|
||||
|
||||
class EndpointGroup
|
||||
|
||||
@@ -19,15 +19,12 @@
|
||||
#ifndef _UPSTREAM_POLICIES_H_
|
||||
#define _UPSTREAM_POLICIES_H_
|
||||
|
||||
#include <pthread.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
#include <functional>
|
||||
#include "URIParser.h"
|
||||
#include "EndpointParams.h"
|
||||
#include "WFNameService.h"
|
||||
#include "WFDnsResolver.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "WFTaskError.h"
|
||||
#include "WFServiceGovernance.h"
|
||||
|
||||
using upstream_route_t = std::function<unsigned int (const char *, const char *, const char *)>;
|
||||
|
||||
@@ -33,10 +33,10 @@
|
||||
#include "EndpointParams.h"
|
||||
#include "RouteManager.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "WFTaskError.h"
|
||||
#include "WFTaskFactory.h"
|
||||
#include "WFResourcePool.h"
|
||||
#include "WFNameService.h"
|
||||
#include "DnsCache.h"
|
||||
#include "DnsUtil.h"
|
||||
#include "WFDnsClient.h"
|
||||
#include "WFDnsResolver.h"
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include <errno.h>
|
||||
#include <stddef.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include "rbtree.h"
|
||||
|
||||
@@ -17,12 +17,14 @@
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
#include "URIParser.h"
|
||||
#include "WFTaskError.h"
|
||||
#include "StringUtil.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "WFNameService.h"
|
||||
#include "WFDnsResolver.h"
|
||||
#include "WFServiceGovernance.h"
|
||||
#include "UpstreamManager.h"
|
||||
|
||||
#define GET_CURRENT_SECOND std::chrono::duration_cast<std::chrono::seconds>(std::chrono::steady_clock::now().time_since_epoch()).count()
|
||||
|
||||
|
||||
@@ -26,9 +26,6 @@
|
||||
#include "URIParser.h"
|
||||
#include "EndpointParams.h"
|
||||
#include "WFNameService.h"
|
||||
#include "WFDnsResolver.h"
|
||||
#include "WFGlobal.h"
|
||||
#include "WFTaskError.h"
|
||||
|
||||
#define MTTR_SECOND_DEFAULT 30
|
||||
#define VIRTUAL_GROUP_SIZE 16
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _DNSUTIL_H_
|
||||
#define _DNSUTIL_H_
|
||||
|
||||
#include <netdb.h>
|
||||
#include "DnsMessage.h"
|
||||
|
||||
/**
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include "HttpUtil.h"
|
||||
#include "URIParser.h"
|
||||
#include "http_parser.h"
|
||||
#include "HttpMessage.h"
|
||||
#include "HttpUtil.h"
|
||||
|
||||
namespace protocol
|
||||
{
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include "HttpMessage.h"
|
||||
#include "http_parser.h"
|
||||
#include "HttpMessage.h"
|
||||
|
||||
/**
|
||||
* @file HttpUtil.h
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <snappy.h>
|
||||
#include <snappy-sinksource.h>
|
||||
#include "crc32c.h"
|
||||
#include "EncodeStream.h"
|
||||
#include "KafkaMessage.h"
|
||||
|
||||
namespace protocol
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <functional>
|
||||
#include "kafka_parser.h"
|
||||
#include "ProtocolMessage.h"
|
||||
#include "EncodeStream.h"
|
||||
#include "KafkaDataTypes.h"
|
||||
|
||||
|
||||
@@ -184,7 +183,7 @@ protected:
|
||||
using parse_func = std::function<int (void **buf, size_t *size)>;
|
||||
std::map<int, parse_func> parse_func_map;
|
||||
|
||||
EncodeStream *stream;
|
||||
class EncodeStream *stream;
|
||||
std::string msgbuf;
|
||||
std::string headbuf;
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <openssl/sha.h>
|
||||
#include <utility>
|
||||
#include "SSLWrapper.h"
|
||||
#include "mysql_byteorder.h"
|
||||
#include "mysql_types.h"
|
||||
#include "MySQLResult.h"
|
||||
#include "MySQLMessage.h"
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include "ProtocolMessage.h"
|
||||
#include "mysql_stream.h"
|
||||
#include "mysql_parser.h"
|
||||
#include "mysql_byteorder.h"
|
||||
|
||||
/**
|
||||
* @file MySQLMessage.h
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
#include <string>
|
||||
#include <openssl/ssl.h>
|
||||
#include "SSLWrapper.h"
|
||||
#include "mysql_byteorder.h"
|
||||
|
||||
namespace protocol
|
||||
{
|
||||
|
||||
@@ -16,8 +16,10 @@
|
||||
Authors: Li Yingxin (liyingxin@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
#include "mysql_types.h"
|
||||
#include "mysql_byteorder.h"
|
||||
#include "MySQLMessage.h"
|
||||
#include "MySQLResult.h"
|
||||
|
||||
namespace protocol
|
||||
|
||||
@@ -23,8 +23,9 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include "MySQLMessage.h"
|
||||
#include "mysql_types.h"
|
||||
#include "mysql_parser.h"
|
||||
#include "MySQLMessage.h"
|
||||
|
||||
/**
|
||||
* @file MySQLResult.h
|
||||
|
||||
@@ -18,10 +18,10 @@
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sstream>
|
||||
#include <utility>
|
||||
#include "EncodeStream.h"
|
||||
#include "RedisMessage.h"
|
||||
|
||||
namespace protocol
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "ProtocolMessage.h"
|
||||
#include "EncodeStream.h"
|
||||
#include "redis_parser.h"
|
||||
|
||||
/**
|
||||
@@ -141,7 +140,7 @@ protected:
|
||||
virtual int append(const void *buf, size_t *size);
|
||||
bool encode_reply(redis_reply_t *reply);
|
||||
|
||||
EncodeStream *stream_;
|
||||
class EncodeStream *stream_;
|
||||
|
||||
private:
|
||||
size_t cur_size_;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "list.h"
|
||||
#include "http_parser.h"
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
Authors: Li Yingxin (liyingxin@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "mysql_types.h"
|
||||
#include "mysql_byteorder.h"
|
||||
#include "mysql_parser.h"
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#ifndef _MYSQL_PARSER_H_
|
||||
#define _MYSQL_PARSER_H_
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
#include "list.h"
|
||||
|
||||
// the first byte in response message
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
Authors: Wu Jiaxu (wujiaxu@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "list.h"
|
||||
#include "redis_parser.h"
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#ifndef _REDIS_PARSER_H_
|
||||
#define _REDIS_PARSER_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include "list.h"
|
||||
|
||||
// redis_parser_t is absolutely same as hiredis-redisReply in memory
|
||||
@@ -121,3 +122,4 @@ static inline void redis_reply_set_status(const char *str, size_t len,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
Authors: Wu Jiaxu (wujiaxu@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <sys/uio.h>
|
||||
#include "WFMySQLServer.h"
|
||||
|
||||
WFConnection *WFMySQLServer::new_connection(int accept_fd)
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#include <atomic>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
#include "CommScheduler.h"
|
||||
#include "WFTaskFactory.h"
|
||||
|
||||
struct WFServerParams
|
||||
@@ -179,7 +178,7 @@ private:
|
||||
std::mutex mutex;
|
||||
std::condition_variable cond;
|
||||
|
||||
CommScheduler *scheduler;
|
||||
class CommScheduler *scheduler;
|
||||
};
|
||||
|
||||
template<class REQ, class RESP>
|
||||
|
||||
@@ -16,8 +16,8 @@
|
||||
Authors: Wu Jiaxu (wujiaxu@sogou-inc.com)
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <string>
|
||||
#include "list.h"
|
||||
#include "EncodeStream.h"
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ typedef typename Map::const_iterator MapConstIterator;
|
||||
|
||||
public:
|
||||
LRUCache():
|
||||
max_size_(0),
|
||||
max_size_(1),
|
||||
size_(0)
|
||||
{
|
||||
not_use_.next = ¬_use_;
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
*/
|
||||
|
||||
#include <openssl/md5.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <string>
|
||||
#include "MD5Util.h"
|
||||
|
||||
static inline void __md5(const std::string& str, unsigned char *md)
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include "StringUtil.h"
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#ifndef _STRINGUTIL_H_
|
||||
#define _STRINGUTIL_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
|
||||
@@ -19,9 +19,10 @@
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "StringUtil.h"
|
||||
#include "URIParser.h"
|
||||
|
||||
|
||||
@@ -119,7 +119,7 @@ void process(WFHttpTask *proxy_task)
|
||||
});
|
||||
|
||||
context->is_keep_alive = req->is_keep_alive();
|
||||
http_task = WFTaskFactory::create_http_task(req->get_request_uri(), 0, 0,
|
||||
http_task = WFTaskFactory::create_http_task(req->get_request_uri(), 3, 2,
|
||||
http_callback);
|
||||
|
||||
const void *body;
|
||||
@@ -158,6 +158,8 @@ int main(int argc, char *argv[])
|
||||
signal(SIGINT, sig_handler);
|
||||
|
||||
struct WFGlobalSettings settings = GLOBAL_SETTINGS_DEFAULT;
|
||||
settings.dns_ttl_default = 10;
|
||||
settings.dns_ttl_min = 5;
|
||||
settings.resolv_conf_path = "/etc/resolv.conf";
|
||||
settings.hosts_path = "/etc/hosts";
|
||||
WORKFLOW_library_init(&settings);
|
||||
|
||||
Reference in New Issue
Block a user