/Users/deen/code/yugabyte-db/src/yb/yql/redis/redisserver/redis_server.h
Line | Count | Source |
1 | | // Copyright (c) YugaByte, Inc. |
2 | | // |
3 | | // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except |
4 | | // in compliance with the License. You may obtain a copy of the License at |
5 | | // |
6 | | // http://www.apache.org/licenses/LICENSE-2.0 |
7 | | // |
8 | | // Unless required by applicable law or agreed to in writing, software distributed under the License |
9 | | // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express |
10 | | // or implied. See the License for the specific language governing permissions and limitations |
11 | | // under the License. |
12 | | // |
13 | | |
14 | | #ifndef YB_YQL_REDIS_REDISSERVER_REDIS_SERVER_H_ |
15 | | #define YB_YQL_REDIS_REDISSERVER_REDIS_SERVER_H_ |
16 | | |
17 | | #include <string> |
18 | | |
19 | | #include "yb/gutil/macros.h" |
20 | | #include "yb/yql/redis/redisserver/redis_server_options.h" |
21 | | #include "yb/server/server_base.h" |
22 | | #include "yb/tserver/tserver_fwd.h" |
23 | | #include "yb/util/status_fwd.h" |
24 | | |
25 | | namespace yb { |
26 | | namespace redisserver { |
27 | | |
28 | | class RedisServer : public server::RpcAndWebServerBase { |
29 | | public: |
30 | | static const uint16_t kDefaultPort = 6379; |
31 | | static const uint16_t kDefaultWebPort = 11000; |
32 | | |
33 | | explicit RedisServer(const RedisServerOptions& opts, tserver::TabletServerIf* tserver); |
34 | | |
35 | | CHECKED_STATUS Start(); |
36 | | |
37 | | using server::RpcAndWebServerBase::Shutdown; |
38 | | |
39 | 362 | tserver::TabletServerIf* tserver() const { return tserver_; } |
40 | | |
41 | 106k | const std::shared_ptr<MemTracker>& mem_tracker() const { return mem_tracker_; } |
42 | | |
43 | 513 | const RedisServerOptions& opts() const { return opts_; } |
44 | | |
45 | | private: |
46 | | RedisServerOptions opts_; |
47 | | tserver::TabletServerIf* const tserver_; |
48 | | |
49 | | DISALLOW_COPY_AND_ASSIGN(RedisServer); |
50 | | }; |
51 | | |
52 | | } // namespace redisserver |
53 | | } // namespace yb |
54 | | #endif // YB_YQL_REDIS_REDISSERVER_REDIS_SERVER_H_ |