Skip to content

Commit

Permalink
print startup tips (#372)
Browse files Browse the repository at this point in the history
### What problem were solved in this pull request?

Problem:
While people are learning about miniob, they don't know the owner of the
project.

### What is changed and how it works?
Printing copyright information when starting observer and obclient.
  • Loading branch information
hnwyllmm authored Apr 8, 2024
1 parent ab25a46 commit 6e9355b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/obclient/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,20 @@ int init_tcp_sock(const char *server_host, int server_port)
return sockfd;
}

const char *startup_tips = R"(
Welcome to the OceanBase database implementation course.
Copyright (c) 2021 OceanBase and/or its affiliates.
Learn more about OceanBase at https://github.com/oceanbase/oceanbase
Learn more about MiniOB at https://github.com/oceanbase/miniob
)";

int main(int argc, char *argv[])
{
printf("%s", startup_tips);

const char *unix_socket_path = nullptr;
const char *server_host = "127.0.0.1";
int server_port = PORT_DEFAULT;
Expand Down
12 changes: 12 additions & 0 deletions src/observer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,22 @@ void quit_signal_handle(int signum)
pthread_create(&tid, nullptr, quit_thread_func, (void *)(intptr_t)signum);
}

const char *startup_tips = R"(
Welcome to the OceanBase database implementation course.
Copyright (c) 2021 OceanBase and/or its affiliates.
Learn more about OceanBase at https://github.com/oceanbase/oceanbase
Learn more about MiniOB at https://github.com/oceanbase/miniob
)";

int main(int argc, char **argv)
{
int rc = STATUS_SUCCESS;

cout << startup_tips;

set_signal_handler(quit_signal_handle);

parse_parameter(argc, argv);
Expand Down

0 comments on commit 6e9355b

Please sign in to comment.