From 675394d0400717332f81039492b03efab4f38087 Mon Sep 17 00:00:00 2001 From: wangyunlai Date: Tue, 14 May 2024 13:39:05 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=B7=A5=E5=85=B7=E6=94=B9?= =?UTF-8?q?=E6=88=90mkdocs=20(#407)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 文档工具改成mkdocs --- .github/workflows/gh-pages.yml | 19 +-- README.md | 2 +- Doxyfile => docs/Doxyfile | 2 +- docs/book.toml | 14 -- docs/docs/assets/favicon.ico | Bin 0 -> 3465 bytes docs/docs/assets/logo.png | Bin 0 -> 6140 bytes docs/{src => docs}/blog/1.md | 4 + .../blog/images/1-hekaton-storage-engine.png | Bin .../blog/images/1-range-index-bw-tree.png | Bin .../blog/images/1-record-lock.png | Bin .../images/1-storage-engine-prototype.png | Bin .../images/1-transaction-process-phases-2.png | Bin .../images/1-transaction-process-phases.png | Bin .../blog/images/1-transaction-state.png | Bin docs/{src => docs}/blog/introduction.md | 4 + .../design/images/bplus-tree.jpg | Bin .../design/images/miniob-architecture.svg | 0 .../miniob-bplus-tree-deletion-migration.png | Bin .../miniob-bplus-tree-deletion-move.png | Bin .../miniob-bplus-tree-deletion-move2.png | Bin .../images/miniob-bplus-tree-deletion.png | Bin .../images/miniob-bplus-tree-index-file.png | Bin .../miniob-bplus-tree-internal-node.png | Bin .../miniob-bplus-tree-internal-struct.png | Bin .../miniob-bplus-tree-internal-struct2.png | Bin .../images/miniob-bplus-tree-leaf-node.png | Bin .../images/miniob-bplus-tree-leaf-page.png | Bin .../miniob-bplus-tree-pages-in-file.png | Bin .../images/miniob-buffer-pool-directory.png | Bin .../miniob-buffer-pool-implementation.png | Bin .../design/images/miniob-buffer-pool-page.png | Bin .../images/miniob-buffer-pool-record.png | Bin .../miniob-double-write-buffer-struct.png | Bin .../design/images/miniob-overview.png | Bin .../design/images/mysql-auth.png | Bin .../design/images/mysql-command-packet.png | Bin .../design/images/mysql-error-packet.png | Bin .../design/images/mysql-flow.png | Bin .../design/images/mysql-handshake.png | Bin .../design/images/mysql-ok-eof-packet.png | Bin .../design/images/mysql-ok-packet.png | Bin .../design/images/mysql-packet-flow.png | Bin .../design/images/mysql-result-set-packet.png | Bin ...thread-model-one-thread-per-connection.png | Bin .../images/thread-model-thread-pool.png | Bin docs/{src => docs}/design/introduction.md | 0 .../design/miniob-architecture.md | 40 +++--- .../design/miniob-bplus-tree-concurrency.md | 29 +++-- .../{src => docs}/design/miniob-bplus-tree.md | 26 ++-- .../design/miniob-buffer-pool.md | 14 +- .../design/miniob-double-write-buffer.md | 6 +- .../{src => docs}/design/miniob-durability.md | 6 +- .../design/miniob-how-to-add-new-sql.md | 4 + .../design/miniob-mysql-protocol.md | 32 +++-- .../design/miniob-sql-expression.md | 7 +- .../{src => docs}/design/miniob-sql-parser.md | 4 + .../design/miniob-thread-model.md | 27 ++-- .../design/miniob-transaction.md | 4 + docs/{src => docs}/dev-env/dev_by_gitpod.md | 85 ++++++------ .../dev-env/how-to-dev-using-docker.md | 4 + ...ow_to_dev_in_docker_container_by_vscode.md | 4 + ...n_docker_container_by_vscode_on_windows.md | 4 + .../how_to_dev_miniob_by_docker_on_windows.md | 4 + .../dev-env/how_to_dev_miniob_by_vscode.md | 4 + .../images/dev_by_gitpod_build_init.png | Bin .../dev_by_gitpod_build_init_output.png | Bin .../images/dev_by_gitpod_build_others.png | Bin .../images/dev_by_gitpod_build_output.png | Bin .../dev_by_gitpod_build_run_build_task.png | Bin .../images/dev_by_gitpod_build_run_task.png | Bin .../images/dev_by_gitpod_dashboard.png | Bin .../images/dev_by_gitpod_debug_breakpoint.png | Bin .../images/dev_by_gitpod_debug_console.png | Bin .../dev_by_gitpod_debug_debugging_view.png | Bin .../images/dev_by_gitpod_debug_start.png | Bin .../dev_by_gitpod_debug_take_breakpoint.png | Bin .../images/dev_by_gitpod_debug_terminal.png | Bin .../images/dev_by_gitpod_fork_repo.png | Bin .../dev-env/images/dev_by_gitpod_git_auth.png | Bin .../images/dev_by_gitpod_git_auth1.png | Bin .../images/dev_by_gitpod_git_commit.png | Bin .../dev_by_gitpod_git_edit_permissions.png | Bin .../images/dev_by_gitpod_git_operations.png | Bin ...dev_by_gitpod_git_pre_edit_permissions.png | Bin .../images/dev_by_gitpod_git_push_error.png | Bin .../dev_by_gitpod_gitpod_new_workspace.png | Bin .../dev-env/images/dev_by_gitpod_ides.png | Bin .../images/dev_by_gitpod_miniob_workspace.png | Bin .../images/dev_by_gitpod_open_gitpod.png | Bin .../images/dev_by_gitpod_open_miniob.jpg | Bin .../images/dev_by_gitpod_vscode_homepage.png | Bin .../images/dev_by_gitpod_workspace.png | Bin ..._container_by_vscode_on_windows_Docker.png | Bin ...r_container_by_vscode_on_windows_clone.png | Bin ...iner_by_vscode_on_windows_clone_branch.png | Bin ...tainer_by_vscode_on_windows_clone_done.png | Bin ...r_by_vscode_on_windows_clone_file_info.png | Bin ...er_by_vscode_on_windows_downloadDocker.png | Bin ..._container_by_vscode_on_windows_plugin.png | Bin ...er_by_vscode_on_windows_prepareDocker1.png | Bin ...er_by_vscode_on_windows_prepareDocker2.png | Bin ...er_by_vscode_on_windows_prepareDocker3.png | Bin ...ntainer_by_vscode_on_windows_searchEnv.png | Bin ...tainer_by_vscode_on_windows_searchEnv2.png | Bin ...tainer_by_vscode_on_windows_searchEnv3.png | Bin ...ode_on_windows_startDocker_in_vscode_1.png | Bin ...ode_on_windows_startDocker_in_vscode_2.png | Bin ...ode_on_windows_startDocker_in_vscode_3.png | Bin ...ode_on_windows_startDocker_in_vscode_4.png | Bin .../dev-env/images/vsc_add_new_ssh_host.png | Bin .../dev-env/images/vsc_config_file.png | Bin .../dev-env/images/vsc_container_started.png | Bin .../dev-env/images/vsc_cpp_extensions.png | Bin .../dev-env/images/vsc_debug.png | Bin .../dev-env/images/vsc_kit_for_miniob.png | Bin .../dev-env/images/vsc_open_folder.png | Bin docs/{src => docs}/dev-env/images/vsc_pwd.png | Bin .../images/vsc_remote_ssh_connect_cmd.png | Bin .../images/vsc_remote_ssh_extension.png | Bin .../dev-env/images/vsc_server_started.png | Bin .../dev-env/images/vsc_ssh_connect.png | Bin .../images/vscode_C++_plugs_detail.png | Bin .../dev-env/images/vscode_break_point.png | Bin .../dev-env/images/vscode_build_ouput.png | Bin .../dev-env/images/vscode_cmake.png | Bin .../dev-env/images/vscode_debug_miniob.png | Bin .../dev-env/images/vscode_search_plugs.png | Bin .../windows-enable-disable-functions.png | Bin .../dev-env/images/windows-enable-service.png | Bin .../dev-env/images/windows-functions.png | Bin .../dev-env/images/windows-search-service.png | Bin .../images/windows-terminal-mutli-shell.png | Bin .../dev-env/images/windows-terminal.png | Bin .../dev-env/images/windows-wsl.png | Bin docs/{src => docs}/dev-env/introduction.md | 4 + .../dev-env/miniob-how-to-debug.md | 7 +- docs/{src => docs}/game/debug-output.md | 4 + docs/{src => docs}/game/gitee-instructions.md | 4 + .../{src => docs}/game/github-introduction.md | 26 ++-- .../{src => docs}/game/images/add-members.png | Bin .../{src => docs}/game/images/create-repo.png | Bin .../game/images/create-repo2.png | Bin .../game/images/github-add-people.png | Bin .../game/images/github-add-tester-2.png | Bin .../game/images/github-add-tester.png | Bin .../game/images/github-begin-import-form.png | Bin .../game/images/github-import-done.png | Bin .../game/images/github-import-repository.png | Bin .../game/images/github-invite-success.png | Bin .../game/images/github-pending-invite.png | Bin .../game/images/github-view-repo.png | Bin .../game/images/invite-users.png | Bin docs/{src => docs}/game/images/reporter.png | Bin docs/{src => docs}/game/introduction.md | 4 + .../game/miniob-date-implementation.md | 7 +- .../game/miniob-drop-table-implementation.md | 4 + docs/{src => docs}/game/miniob-memtracer.md | 3 + .../game/miniob-output-convention.md | 3 + .../game/miniob-test-comment-date.md | 3 + docs/{src => docs}/game/miniob_topics.md | 4 + docs/{src => docs}/how_to_build.md | 14 +- docs/{src => docs}/how_to_run.md | 4 + ...miniob-introduction-running-the-client.png | Bin ...miniob-introduction-running-the-server.png | Bin .../images/miniob-introduction-sql-flow.png | Bin .../miniob-introduction.md => docs/index.md} | 10 +- docs/{src => docs}/lectures/copyright.md | 4 + docs/{src => docs}/lectures/images/1-1.png | Bin .../lectures/images/1.3.1.3-1.png | Bin .../lectures/images/1.3.1.3-2.png | Bin docs/{src => docs}/lectures/images/2-1.png | Bin docs/{src => docs}/lectures/images/2-2.png | Bin docs/{src => docs}/lectures/images/2-3.png | Bin docs/{src => docs}/lectures/images/2-4.png | Bin docs/{src => docs}/lectures/images/2-5.png | Bin docs/{src => docs}/lectures/images/2-6.png | Bin docs/{src => docs}/lectures/images/2-7.png | Bin docs/{src => docs}/lectures/images/2-8.png | Bin docs/{src => docs}/lectures/images/3-1.png | Bin docs/{src => docs}/lectures/images/3-2-a.png | Bin docs/{src => docs}/lectures/images/3-2-b.png | Bin docs/{src => docs}/lectures/images/3-2-c.png | Bin docs/{src => docs}/lectures/images/3-3-a.png | Bin docs/{src => docs}/lectures/images/3-3-b.png | Bin docs/{src => docs}/lectures/images/3-3-c.png | Bin docs/{src => docs}/lectures/images/3-4.png | Bin docs/{src => docs}/lectures/images/3-5.png | Bin docs/{src => docs}/lectures/images/3-6-a.png | Bin docs/{src => docs}/lectures/images/3-6-b.png | Bin docs/{src => docs}/lectures/images/3-7-a.png | Bin docs/{src => docs}/lectures/images/3-7-b.png | Bin docs/{src => docs}/lectures/images/3-7-c.png | Bin docs/{src => docs}/lectures/images/4-1.png | Bin docs/{src => docs}/lectures/images/4-2.png | Bin docs/{src => docs}/lectures/images/4-3.png | Bin docs/{src => docs}/lectures/images/4-4.png | Bin docs/{src => docs}/lectures/images/4-5.png | Bin docs/{src => docs}/lectures/images/4-6.png | Bin docs/{src => docs}/lectures/images/5-1.png | Bin .../lectures/images/5.2.1.1-1.png | Bin .../lectures/images/5.2.1.1-2.png | Bin .../lectures/images/5.2.1.1-3.png | Bin .../lectures/images/5.2.1.1-4.png | Bin .../lectures/images/5.2.2.1-1.png | Bin .../lectures/images/5.3.1.1-4.png | Bin docs/{src => docs}/lectures/images/6-1.png | Bin docs/{src => docs}/lectures/images/6-2.png | Bin docs/{src => docs}/lectures/images/6-3.png | Bin docs/{src => docs}/lectures/images/6-4.png | Bin docs/{src => docs}/lectures/index.md | 0 docs/{src => docs}/lectures/lecture-1.md | 4 + docs/{src => docs}/lectures/lecture-2.md | 3 + docs/{src => docs}/lectures/lecture-3.md | 3 + docs/{src => docs}/lectures/lecture-4.md | 3 + docs/{src => docs}/lectures/lecture-5.md | 3 + docs/{src => docs}/lectures/lecture-6.md | 3 + docs/{src => docs}/lectures/references.md | 4 + docs/mkdocs.yml | 122 ++++++++++++++++++ docs/requirements.txt | 3 + docs/src/SUMMARY.md | 52 -------- 220 files changed, 442 insertions(+), 212 deletions(-) rename Doxyfile => docs/Doxyfile (99%) delete mode 100644 docs/book.toml create mode 100644 docs/docs/assets/favicon.ico create mode 100644 docs/docs/assets/logo.png rename docs/{src => docs}/blog/1.md (99%) rename docs/{src => docs}/blog/images/1-hekaton-storage-engine.png (100%) rename docs/{src => docs}/blog/images/1-range-index-bw-tree.png (100%) rename docs/{src => docs}/blog/images/1-record-lock.png (100%) rename docs/{src => docs}/blog/images/1-storage-engine-prototype.png (100%) rename docs/{src => docs}/blog/images/1-transaction-process-phases-2.png (100%) rename docs/{src => docs}/blog/images/1-transaction-process-phases.png (100%) rename docs/{src => docs}/blog/images/1-transaction-state.png (100%) rename docs/{src => docs}/blog/introduction.md (91%) rename docs/{src => docs}/design/images/bplus-tree.jpg (100%) rename docs/{src => docs}/design/images/miniob-architecture.svg (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-deletion-migration.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-deletion-move.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-deletion-move2.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-deletion.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-index-file.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-internal-node.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-internal-struct.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-internal-struct2.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-leaf-node.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-leaf-page.png (100%) rename docs/{src => docs}/design/images/miniob-bplus-tree-pages-in-file.png (100%) rename docs/{src => docs}/design/images/miniob-buffer-pool-directory.png (100%) rename docs/{src => docs}/design/images/miniob-buffer-pool-implementation.png (100%) rename docs/{src => docs}/design/images/miniob-buffer-pool-page.png (100%) rename docs/{src => docs}/design/images/miniob-buffer-pool-record.png (100%) rename docs/{src => docs}/design/images/miniob-double-write-buffer-struct.png (100%) rename docs/{src => docs}/design/images/miniob-overview.png (100%) rename docs/{src => docs}/design/images/mysql-auth.png (100%) rename docs/{src => docs}/design/images/mysql-command-packet.png (100%) rename docs/{src => docs}/design/images/mysql-error-packet.png (100%) rename docs/{src => docs}/design/images/mysql-flow.png (100%) rename docs/{src => docs}/design/images/mysql-handshake.png (100%) rename docs/{src => docs}/design/images/mysql-ok-eof-packet.png (100%) rename docs/{src => docs}/design/images/mysql-ok-packet.png (100%) rename docs/{src => docs}/design/images/mysql-packet-flow.png (100%) rename docs/{src => docs}/design/images/mysql-result-set-packet.png (100%) rename docs/{src => docs}/design/images/thread-model-one-thread-per-connection.png (100%) rename docs/{src => docs}/design/images/thread-model-thread-pool.png (100%) rename docs/{src => docs}/design/introduction.md (100%) rename docs/{src => docs}/design/miniob-architecture.md (94%) rename docs/{src => docs}/design/miniob-bplus-tree-concurrency.md (97%) rename docs/{src => docs}/design/miniob-bplus-tree.md (80%) rename docs/{src => docs}/design/miniob-buffer-pool.md (92%) rename docs/{src => docs}/design/miniob-double-write-buffer.md (95%) rename docs/{src => docs}/design/miniob-durability.md (99%) rename docs/{src => docs}/design/miniob-how-to-add-new-sql.md (99%) rename docs/{src => docs}/design/miniob-mysql-protocol.md (81%) rename docs/{src => docs}/design/miniob-sql-expression.md (99%) rename docs/{src => docs}/design/miniob-sql-parser.md (99%) rename docs/{src => docs}/design/miniob-thread-model.md (86%) rename docs/{src => docs}/design/miniob-transaction.md (99%) rename docs/{src => docs}/dev-env/dev_by_gitpod.md (70%) rename docs/{src => docs}/dev-env/how-to-dev-using-docker.md (96%) rename docs/{src => docs}/dev-env/how_to_dev_in_docker_container_by_vscode.md (99%) rename docs/{src => docs}/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md (96%) rename docs/{src => docs}/dev-env/how_to_dev_miniob_by_docker_on_windows.md (98%) rename docs/{src => docs}/dev-env/how_to_dev_miniob_by_vscode.md (98%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_init.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_init_output.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_others.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_output.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_run_build_task.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_build_run_task.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_dashboard.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_breakpoint.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_console.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_debugging_view.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_start.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_take_breakpoint.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_debug_terminal.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_fork_repo.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_auth.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_auth1.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_commit.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_edit_permissions.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_operations.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_pre_edit_permissions.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_git_push_error.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_gitpod_new_workspace.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_ides.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_miniob_workspace.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_open_gitpod.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_open_miniob.jpg (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_vscode_homepage.png (100%) rename docs/{src => docs}/dev-env/images/dev_by_gitpod_workspace.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_Docker.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_branch.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_done.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_file_info.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_downloadDocker.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_plugin.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker1.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker2.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker3.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv2.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv3.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_1.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_2.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_3.png (100%) rename docs/{src => docs}/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_4.png (100%) rename docs/{src => docs}/dev-env/images/vsc_add_new_ssh_host.png (100%) rename docs/{src => docs}/dev-env/images/vsc_config_file.png (100%) rename docs/{src => docs}/dev-env/images/vsc_container_started.png (100%) rename docs/{src => docs}/dev-env/images/vsc_cpp_extensions.png (100%) rename docs/{src => docs}/dev-env/images/vsc_debug.png (100%) rename docs/{src => docs}/dev-env/images/vsc_kit_for_miniob.png (100%) rename docs/{src => docs}/dev-env/images/vsc_open_folder.png (100%) rename docs/{src => docs}/dev-env/images/vsc_pwd.png (100%) rename docs/{src => docs}/dev-env/images/vsc_remote_ssh_connect_cmd.png (100%) rename docs/{src => docs}/dev-env/images/vsc_remote_ssh_extension.png (100%) rename docs/{src => docs}/dev-env/images/vsc_server_started.png (100%) rename docs/{src => docs}/dev-env/images/vsc_ssh_connect.png (100%) rename docs/{src => docs}/dev-env/images/vscode_C++_plugs_detail.png (100%) rename docs/{src => docs}/dev-env/images/vscode_break_point.png (100%) rename docs/{src => docs}/dev-env/images/vscode_build_ouput.png (100%) rename docs/{src => docs}/dev-env/images/vscode_cmake.png (100%) rename docs/{src => docs}/dev-env/images/vscode_debug_miniob.png (100%) rename docs/{src => docs}/dev-env/images/vscode_search_plugs.png (100%) rename docs/{src => docs}/dev-env/images/windows-enable-disable-functions.png (100%) rename docs/{src => docs}/dev-env/images/windows-enable-service.png (100%) rename docs/{src => docs}/dev-env/images/windows-functions.png (100%) rename docs/{src => docs}/dev-env/images/windows-search-service.png (100%) rename docs/{src => docs}/dev-env/images/windows-terminal-mutli-shell.png (100%) rename docs/{src => docs}/dev-env/images/windows-terminal.png (100%) rename docs/{src => docs}/dev-env/images/windows-wsl.png (100%) rename docs/{src => docs}/dev-env/introduction.md (96%) rename docs/{src => docs}/dev-env/miniob-how-to-debug.md (99%) rename docs/{src => docs}/game/debug-output.md (97%) rename docs/{src => docs}/game/gitee-instructions.md (98%) rename docs/{src => docs}/game/github-introduction.md (70%) rename docs/{src => docs}/game/images/add-members.png (100%) rename docs/{src => docs}/game/images/create-repo.png (100%) rename docs/{src => docs}/game/images/create-repo2.png (100%) rename docs/{src => docs}/game/images/github-add-people.png (100%) rename docs/{src => docs}/game/images/github-add-tester-2.png (100%) rename docs/{src => docs}/game/images/github-add-tester.png (100%) rename docs/{src => docs}/game/images/github-begin-import-form.png (100%) rename docs/{src => docs}/game/images/github-import-done.png (100%) rename docs/{src => docs}/game/images/github-import-repository.png (100%) rename docs/{src => docs}/game/images/github-invite-success.png (100%) rename docs/{src => docs}/game/images/github-pending-invite.png (100%) rename docs/{src => docs}/game/images/github-view-repo.png (100%) rename docs/{src => docs}/game/images/invite-users.png (100%) rename docs/{src => docs}/game/images/reporter.png (100%) rename docs/{src => docs}/game/introduction.md (98%) rename docs/{src => docs}/game/miniob-date-implementation.md (99%) rename docs/{src => docs}/game/miniob-drop-table-implementation.md (99%) rename docs/{src => docs}/game/miniob-memtracer.md (99%) rename docs/{src => docs}/game/miniob-output-convention.md (99%) rename docs/{src => docs}/game/miniob-test-comment-date.md (98%) rename docs/{src => docs}/game/miniob_topics.md (99%) rename docs/{src => docs}/how_to_build.md (93%) rename docs/{src => docs}/how_to_run.md (99%) rename docs/{src => docs}/images/miniob-introduction-running-the-client.png (100%) rename docs/{src => docs}/images/miniob-introduction-running-the-server.png (100%) rename docs/{src => docs}/images/miniob-introduction-sql-flow.png (100%) rename docs/{src/miniob-introduction.md => docs/index.md} (97%) rename docs/{src => docs}/lectures/copyright.md (97%) rename docs/{src => docs}/lectures/images/1-1.png (100%) rename docs/{src => docs}/lectures/images/1.3.1.3-1.png (100%) rename docs/{src => docs}/lectures/images/1.3.1.3-2.png (100%) rename docs/{src => docs}/lectures/images/2-1.png (100%) rename docs/{src => docs}/lectures/images/2-2.png (100%) rename docs/{src => docs}/lectures/images/2-3.png (100%) rename docs/{src => docs}/lectures/images/2-4.png (100%) rename docs/{src => docs}/lectures/images/2-5.png (100%) rename docs/{src => docs}/lectures/images/2-6.png (100%) rename docs/{src => docs}/lectures/images/2-7.png (100%) rename docs/{src => docs}/lectures/images/2-8.png (100%) rename docs/{src => docs}/lectures/images/3-1.png (100%) rename docs/{src => docs}/lectures/images/3-2-a.png (100%) rename docs/{src => docs}/lectures/images/3-2-b.png (100%) rename docs/{src => docs}/lectures/images/3-2-c.png (100%) rename docs/{src => docs}/lectures/images/3-3-a.png (100%) rename docs/{src => docs}/lectures/images/3-3-b.png (100%) rename docs/{src => docs}/lectures/images/3-3-c.png (100%) rename docs/{src => docs}/lectures/images/3-4.png (100%) rename docs/{src => docs}/lectures/images/3-5.png (100%) rename docs/{src => docs}/lectures/images/3-6-a.png (100%) rename docs/{src => docs}/lectures/images/3-6-b.png (100%) rename docs/{src => docs}/lectures/images/3-7-a.png (100%) rename docs/{src => docs}/lectures/images/3-7-b.png (100%) rename docs/{src => docs}/lectures/images/3-7-c.png (100%) rename docs/{src => docs}/lectures/images/4-1.png (100%) rename docs/{src => docs}/lectures/images/4-2.png (100%) rename docs/{src => docs}/lectures/images/4-3.png (100%) rename docs/{src => docs}/lectures/images/4-4.png (100%) rename docs/{src => docs}/lectures/images/4-5.png (100%) rename docs/{src => docs}/lectures/images/4-6.png (100%) rename docs/{src => docs}/lectures/images/5-1.png (100%) rename docs/{src => docs}/lectures/images/5.2.1.1-1.png (100%) rename docs/{src => docs}/lectures/images/5.2.1.1-2.png (100%) rename docs/{src => docs}/lectures/images/5.2.1.1-3.png (100%) rename docs/{src => docs}/lectures/images/5.2.1.1-4.png (100%) rename docs/{src => docs}/lectures/images/5.2.2.1-1.png (100%) rename docs/{src => docs}/lectures/images/5.3.1.1-4.png (100%) rename docs/{src => docs}/lectures/images/6-1.png (100%) rename docs/{src => docs}/lectures/images/6-2.png (100%) rename docs/{src => docs}/lectures/images/6-3.png (100%) rename docs/{src => docs}/lectures/images/6-4.png (100%) rename docs/{src => docs}/lectures/index.md (100%) rename docs/{src => docs}/lectures/lecture-1.md (99%) rename docs/{src => docs}/lectures/lecture-2.md (99%) rename docs/{src => docs}/lectures/lecture-3.md (99%) rename docs/{src => docs}/lectures/lecture-4.md (99%) rename docs/{src => docs}/lectures/lecture-5.md (99%) rename docs/{src => docs}/lectures/lecture-6.md (99%) rename docs/{src => docs}/lectures/references.md (95%) create mode 100644 docs/mkdocs.yml create mode 100644 docs/requirements.txt delete mode 100644 docs/src/SUMMARY.md diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 1152f8340..d9174d777 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -28,34 +28,27 @@ jobs: # Build job build: runs-on: ubuntu-latest - env: - MDBOOK_VERSION: 0.4.21 steps: - uses: actions/checkout@v3 - - name: Install mdBook + - name: Install Dependencies run: | - curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf -y | sh - rustup update - cargo install --version ${MDBOOK_VERSION} mdbook + python3 -m pip install -r ./docs/requirements.txt - name: Setup Pages - id: pages - uses: actions/configure-pages@v3 - - - name: Build with mdBook - run: mdbook build + run: | + mkdocs build working-directory: ./docs - name: Doxygen Action uses: mattnotmitt/doxygen-action@v1.9.5 with: working-directory: . - doxyfile-path: ./Doxyfile + doxyfile-path: ./docs/Doxyfile - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: - path: docs/book + path: docs/site # Deployment job deploy: diff --git a/README.md b/README.md index ea09c915c..184c58876 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ MiniOB 整体代码简洁,容易上手,设计了一系列由浅入深的题 MiniOB 整体架构如下图所示: -InternalNode +InternalNode 其中: diff --git a/Doxyfile b/docs/Doxyfile similarity index 99% rename from Doxyfile rename to docs/Doxyfile index 8f8a12b42..c60266b9d 100644 --- a/Doxyfile +++ b/docs/Doxyfile @@ -68,7 +68,7 @@ PROJECT_LOGO = # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = docs/book/design/doxy +OUTPUT_DIRECTORY = docs/site/design/doxy # If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096 # sub-directories (in 2 levels) under the output directory of each output format diff --git a/docs/book.toml b/docs/book.toml deleted file mode 100644 index 8ec29edab..000000000 --- a/docs/book.toml +++ /dev/null @@ -1,14 +0,0 @@ -[book] -language = "cn" -multilingual = false -src = "src" -title = "MiniOB" - -[output.html] -git-repository-url = "https://github.com/oceanbase/miniob" - -[output.html.fold] -enable = true -level = 1 - -[output.html.code] diff --git a/docs/docs/assets/favicon.ico b/docs/docs/assets/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..9f938fad4b1d3d24fb4fa18feeb277d469e3ccb8 GIT binary patch literal 3465 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 mOSF3MV)_UFVwO}i-!OIR_$G* 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 d4** 本篇文章来自 [OceanBase](https://github.com/oceanbase/oceanbase) 内部论文分享 本篇文章分享的论文是[《High-Performance Concurrency Control Mechanisms for Main-Memory Databases》](https://www.microsoft.com/en-us/research/wp-content/uploads/2011/12/MVCC-published-revised.pdf),该论文介绍了微软SQL Server内存数据库Hekaton所使用的并发控制算法原型,提出了一种无锁的乐观并发控制以及一种无锁的悲观并发控制方法,最终Hekaton采用的是其中的乐观并发控制方法,其也是第一个在生产中将OCC落地的数据库。欢迎感兴趣的同学一起交流学习~ diff --git a/docs/src/blog/images/1-hekaton-storage-engine.png b/docs/docs/blog/images/1-hekaton-storage-engine.png similarity index 100% rename from docs/src/blog/images/1-hekaton-storage-engine.png rename to docs/docs/blog/images/1-hekaton-storage-engine.png diff --git a/docs/src/blog/images/1-range-index-bw-tree.png b/docs/docs/blog/images/1-range-index-bw-tree.png similarity index 100% rename from docs/src/blog/images/1-range-index-bw-tree.png rename to docs/docs/blog/images/1-range-index-bw-tree.png diff --git a/docs/src/blog/images/1-record-lock.png b/docs/docs/blog/images/1-record-lock.png similarity index 100% rename from docs/src/blog/images/1-record-lock.png rename to docs/docs/blog/images/1-record-lock.png diff --git a/docs/src/blog/images/1-storage-engine-prototype.png b/docs/docs/blog/images/1-storage-engine-prototype.png similarity index 100% rename from docs/src/blog/images/1-storage-engine-prototype.png rename to docs/docs/blog/images/1-storage-engine-prototype.png diff --git a/docs/src/blog/images/1-transaction-process-phases-2.png b/docs/docs/blog/images/1-transaction-process-phases-2.png similarity index 100% rename from docs/src/blog/images/1-transaction-process-phases-2.png rename to docs/docs/blog/images/1-transaction-process-phases-2.png diff --git a/docs/src/blog/images/1-transaction-process-phases.png b/docs/docs/blog/images/1-transaction-process-phases.png similarity index 100% rename from docs/src/blog/images/1-transaction-process-phases.png rename to docs/docs/blog/images/1-transaction-process-phases.png diff --git a/docs/src/blog/images/1-transaction-state.png b/docs/docs/blog/images/1-transaction-state.png similarity index 100% rename from docs/src/blog/images/1-transaction-state.png rename to docs/docs/blog/images/1-transaction-state.png diff --git a/docs/src/blog/introduction.md b/docs/docs/blog/introduction.md similarity index 91% rename from docs/src/blog/introduction.md rename to docs/docs/blog/introduction.md index be638042f..fdc7ca07a 100644 --- a/docs/src/blog/introduction.md +++ b/docs/docs/blog/introduction.md @@ -1 +1,5 @@ +--- +title: 介绍 +--- + MiniOB 博客放一些数据库技术实现原理相关的内容,有些来自[OceanBase](https://github.com/oceanbase) 内部分享的一些论文阅读笔记、技术分享、开发心得等,希望能够帮助大家了解数据库。 \ No newline at end of file diff --git a/docs/src/design/images/bplus-tree.jpg b/docs/docs/design/images/bplus-tree.jpg similarity index 100% rename from docs/src/design/images/bplus-tree.jpg rename to docs/docs/design/images/bplus-tree.jpg diff --git a/docs/src/design/images/miniob-architecture.svg b/docs/docs/design/images/miniob-architecture.svg similarity index 100% rename from docs/src/design/images/miniob-architecture.svg rename to docs/docs/design/images/miniob-architecture.svg diff --git a/docs/src/design/images/miniob-bplus-tree-deletion-migration.png b/docs/docs/design/images/miniob-bplus-tree-deletion-migration.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-deletion-migration.png rename to docs/docs/design/images/miniob-bplus-tree-deletion-migration.png diff --git a/docs/src/design/images/miniob-bplus-tree-deletion-move.png b/docs/docs/design/images/miniob-bplus-tree-deletion-move.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-deletion-move.png rename to docs/docs/design/images/miniob-bplus-tree-deletion-move.png diff --git a/docs/src/design/images/miniob-bplus-tree-deletion-move2.png b/docs/docs/design/images/miniob-bplus-tree-deletion-move2.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-deletion-move2.png rename to docs/docs/design/images/miniob-bplus-tree-deletion-move2.png diff --git a/docs/src/design/images/miniob-bplus-tree-deletion.png b/docs/docs/design/images/miniob-bplus-tree-deletion.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-deletion.png rename to docs/docs/design/images/miniob-bplus-tree-deletion.png diff --git a/docs/src/design/images/miniob-bplus-tree-index-file.png b/docs/docs/design/images/miniob-bplus-tree-index-file.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-index-file.png rename to docs/docs/design/images/miniob-bplus-tree-index-file.png diff --git a/docs/src/design/images/miniob-bplus-tree-internal-node.png b/docs/docs/design/images/miniob-bplus-tree-internal-node.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-internal-node.png rename to docs/docs/design/images/miniob-bplus-tree-internal-node.png diff --git a/docs/src/design/images/miniob-bplus-tree-internal-struct.png b/docs/docs/design/images/miniob-bplus-tree-internal-struct.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-internal-struct.png rename to docs/docs/design/images/miniob-bplus-tree-internal-struct.png diff --git a/docs/src/design/images/miniob-bplus-tree-internal-struct2.png b/docs/docs/design/images/miniob-bplus-tree-internal-struct2.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-internal-struct2.png rename to docs/docs/design/images/miniob-bplus-tree-internal-struct2.png diff --git a/docs/src/design/images/miniob-bplus-tree-leaf-node.png b/docs/docs/design/images/miniob-bplus-tree-leaf-node.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-leaf-node.png rename to docs/docs/design/images/miniob-bplus-tree-leaf-node.png diff --git a/docs/src/design/images/miniob-bplus-tree-leaf-page.png b/docs/docs/design/images/miniob-bplus-tree-leaf-page.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-leaf-page.png rename to docs/docs/design/images/miniob-bplus-tree-leaf-page.png diff --git a/docs/src/design/images/miniob-bplus-tree-pages-in-file.png b/docs/docs/design/images/miniob-bplus-tree-pages-in-file.png similarity index 100% rename from docs/src/design/images/miniob-bplus-tree-pages-in-file.png rename to docs/docs/design/images/miniob-bplus-tree-pages-in-file.png diff --git a/docs/src/design/images/miniob-buffer-pool-directory.png b/docs/docs/design/images/miniob-buffer-pool-directory.png similarity index 100% rename from docs/src/design/images/miniob-buffer-pool-directory.png rename to docs/docs/design/images/miniob-buffer-pool-directory.png diff --git a/docs/src/design/images/miniob-buffer-pool-implementation.png b/docs/docs/design/images/miniob-buffer-pool-implementation.png similarity index 100% rename from docs/src/design/images/miniob-buffer-pool-implementation.png rename to docs/docs/design/images/miniob-buffer-pool-implementation.png diff --git a/docs/src/design/images/miniob-buffer-pool-page.png b/docs/docs/design/images/miniob-buffer-pool-page.png similarity index 100% rename from docs/src/design/images/miniob-buffer-pool-page.png rename to docs/docs/design/images/miniob-buffer-pool-page.png diff --git a/docs/src/design/images/miniob-buffer-pool-record.png b/docs/docs/design/images/miniob-buffer-pool-record.png similarity index 100% rename from docs/src/design/images/miniob-buffer-pool-record.png rename to docs/docs/design/images/miniob-buffer-pool-record.png diff --git a/docs/src/design/images/miniob-double-write-buffer-struct.png b/docs/docs/design/images/miniob-double-write-buffer-struct.png similarity index 100% rename from docs/src/design/images/miniob-double-write-buffer-struct.png rename to docs/docs/design/images/miniob-double-write-buffer-struct.png diff --git a/docs/src/design/images/miniob-overview.png b/docs/docs/design/images/miniob-overview.png similarity index 100% rename from docs/src/design/images/miniob-overview.png rename to docs/docs/design/images/miniob-overview.png diff --git a/docs/src/design/images/mysql-auth.png b/docs/docs/design/images/mysql-auth.png similarity index 100% rename from docs/src/design/images/mysql-auth.png rename to docs/docs/design/images/mysql-auth.png diff --git a/docs/src/design/images/mysql-command-packet.png b/docs/docs/design/images/mysql-command-packet.png similarity index 100% rename from docs/src/design/images/mysql-command-packet.png rename to docs/docs/design/images/mysql-command-packet.png diff --git a/docs/src/design/images/mysql-error-packet.png b/docs/docs/design/images/mysql-error-packet.png similarity index 100% rename from docs/src/design/images/mysql-error-packet.png rename to docs/docs/design/images/mysql-error-packet.png diff --git a/docs/src/design/images/mysql-flow.png b/docs/docs/design/images/mysql-flow.png similarity index 100% rename from docs/src/design/images/mysql-flow.png rename to docs/docs/design/images/mysql-flow.png diff --git a/docs/src/design/images/mysql-handshake.png b/docs/docs/design/images/mysql-handshake.png similarity index 100% rename from docs/src/design/images/mysql-handshake.png rename to docs/docs/design/images/mysql-handshake.png diff --git a/docs/src/design/images/mysql-ok-eof-packet.png b/docs/docs/design/images/mysql-ok-eof-packet.png similarity index 100% rename from docs/src/design/images/mysql-ok-eof-packet.png rename to docs/docs/design/images/mysql-ok-eof-packet.png diff --git a/docs/src/design/images/mysql-ok-packet.png b/docs/docs/design/images/mysql-ok-packet.png similarity index 100% rename from docs/src/design/images/mysql-ok-packet.png rename to docs/docs/design/images/mysql-ok-packet.png diff --git a/docs/src/design/images/mysql-packet-flow.png b/docs/docs/design/images/mysql-packet-flow.png similarity index 100% rename from docs/src/design/images/mysql-packet-flow.png rename to docs/docs/design/images/mysql-packet-flow.png diff --git a/docs/src/design/images/mysql-result-set-packet.png b/docs/docs/design/images/mysql-result-set-packet.png similarity index 100% rename from docs/src/design/images/mysql-result-set-packet.png rename to docs/docs/design/images/mysql-result-set-packet.png diff --git a/docs/src/design/images/thread-model-one-thread-per-connection.png b/docs/docs/design/images/thread-model-one-thread-per-connection.png similarity index 100% rename from docs/src/design/images/thread-model-one-thread-per-connection.png rename to docs/docs/design/images/thread-model-one-thread-per-connection.png diff --git a/docs/src/design/images/thread-model-thread-pool.png b/docs/docs/design/images/thread-model-thread-pool.png similarity index 100% rename from docs/src/design/images/thread-model-thread-pool.png rename to docs/docs/design/images/thread-model-thread-pool.png diff --git a/docs/src/design/introduction.md b/docs/docs/design/introduction.md similarity index 100% rename from docs/src/design/introduction.md rename to docs/docs/design/introduction.md diff --git a/docs/src/design/miniob-architecture.md b/docs/docs/design/miniob-architecture.md similarity index 94% rename from docs/src/design/miniob-architecture.md rename to docs/docs/design/miniob-architecture.md index 25937e115..b60b3b425 100644 --- a/docs/src/design/miniob-architecture.md +++ b/docs/docs/design/miniob-architecture.md @@ -1,13 +1,17 @@ +--- +title: MiniOB架构 +--- + # MiniOB代码架构框架设计和说明 -# MiniOB代码结构说明 +## MiniOB代码结构说明 -## 背景 +### 背景 MiniOB旨在帮助不太熟悉数据库设计和实现的同学快速掌握和深入学习数据库内核。我们希望通过MiniOB的培训,学生能够理解不同数据库内核模块的功能和它们之间的联系。这个项目主要面向在校学生,对模块的设计和实现进行了简化处理,以便于他们更好地理解和学习。 -## MiniOB架构介绍 +### MiniOB架构介绍 -InternalNode +![MiniOB架构](./images/miniob-architecture.svg) - 网络模块(NET Service):负责与客户端交互,收发客户端请求与应答; - SQL解析(Parser):将用户输入的SQL语句解析成语法树; @@ -24,9 +28,9 @@ MiniOB旨在帮助不太熟悉数据库设计和实现的同学快速掌握和 - 客户端(Client):作为测试工具,接收用户请求,向服务端发起请求。 -## 各模块工作原理介绍 +### 各模块工作原理介绍 -### 服务端启动过程 +#### 服务端启动过程 虽然代码是模块化的,并且面向对象设计思想如此流行,但是很多同学还是喜欢从main函数看起。那么就先介绍一下服务端的启动流程。 @@ -44,14 +48,14 @@ main函数参考 main@src/observer/main.cpp。启动流程大致如下: 建议把精力更多的留在核心模块上,以更快的了解数据库的工作原理。 -### 网络模块 +#### 网络模块 网络模块代码参考src/observer/net,主要是Server类。 当前支持TCP socket和Unix socket,TCP socket可以跨主机通讯,需要服务端监听特定端口。Unix socket只能在本机通讯,测试非常方便。 在处理具体连接的网络IO请求时,会有具体的线程模型来处理,当前支持一对一连接线程模型和线程池模型,可以参考文档[MiniOB线程模型](./miniob-thread-model.md)。 网络服务启动后,会监听端口(TCP)或Unix连接,当接收到新的连接,会将新的连接描述字加入网络线程模型中。 线程模型会在进程运行时持续监听对应socket上新请求的到达,然后将请求交给具体的处理模块。 -### SQL解析 +#### SQL解析 SQL解析模块是接收到用户请求,开始正式处理的第一步。它将用户输入的数据转换成内部数据结构,一个语法树。 解析模块的代码在`src/observer/sql/parser`下,其中`lex_sql.l`是词法解析代码,`yacc_sql.y`是语法解析代码,`parse_defs.h`中包含了语法树中各个数据结构。 对于词法解析和语法解析,原理概念可以参考《编译原理》。 @@ -61,28 +65,28 @@ NOTE:在查询相关的地方,都是用关键字relation、attribute,而 更多相关内容请参考 [MiniOB SQL语法解析](./miniob-sql-parser.md)。 -### 语义解析 +#### 语义解析 语法解析会将用户发来的SQL文本内容,解析为一个文本描述的语法树,语义解析(Resolver)将语法树中的一些节点,比如表名、字段名称等,转换为内部数据结构中的真实对象。 解析可以做的更多,比如在解析表字段映射的过程中,可以创建Tuple,将字段名直接转换为使用更快的Field或数字索引的方式来访问某一行数据的字段。当前没有做此优化,每次都是在执行过程中根据字段名字来查找特定的字段,参考类 `ProjectTuple`。 -### 优化 +#### 优化 优化决定SQL执行效率非常重要的一环,通常会根据一定的规则,对SQL语法树做等价调整,再根据一些统计数据,比如表中的数据量、索引情况等,来选择更好的执行计划。 MiniOB中的执行计划优化仅实现了简单的框架,可以参考 `OptimizeStage`。 -### 计划执行 +#### 计划执行 顾名思义,计划执行就是按照优化后生成的执行计划原意执行,获取SQL结果。 当前查询语句被转换成了火山执行计划,执行时按照火山模型算子中,通过执行算子的 `next` 方法获取每行的执行结果。 对于DDL等操作,SQL最终被转换为各种Command,由`CommandExecutor`来执行。 计划执行的代码在`src/observer/sql/executor/`下,主要参考`execute_stage.cpp`的实现。 -### 元数据管理模块 +#### 元数据管理模块 元数据是指数据库一些核心概念,包括db、table、field、index等,记录它们的信息。比如db,记录db文件所属目录;field,记录字段的类型、长度、偏移量等。代码文件分散于`src/observer/storage/table,field,index`中,文件名中包含`meta`关键字。 -### 客户端 +#### 客户端 这里的客户端提供了一种测试miniob的方法。从标准输入接收用户输入,将请求发给服务端,并展示返回结果。这里简化了输入的处理,用户输入一行,就认为是一个命令。 -### 通信协议 +#### 通信协议 MiniOB 采用TCP通信,支持两种通讯协议,分别是纯文本模式和MySQL通讯协议,详细设计请参考 [MySQL 通讯协议设计](./miniob-mysql-protocol.md)。 对于纯文本模式,客户端与服务端发送数据时,使用普通的字符串来传递数据,使用'\0'字符作为每个消息的终结符。 @@ -91,7 +95,7 @@ MiniOB 采用TCP通信,支持两种通讯协议,分别是纯文本模式和M 为了方便测试,MiniOB 支持不使用客户端,可以直接启动后在终端输入命令的方式做交互,在启动 observer 时,增加 `-P cli` 参数即可,更多信息请参考 [如何运行MiniOB](../how_to_run.md)。 -# 参考 +## 参考 - 《数据库系统概念》 - 《数据库系统实现》 - 《flex_bison》 flex/bison手册 @@ -102,10 +106,10 @@ MiniOB 采用TCP通信,支持两种通讯协议,分别是纯文本模式和M - [OceanBase数据库文档](https://www.oceanbase.com/docs) - [OceanBase开源网站](https://github.com/oceanbase/oceanbase) -# 附录-编译安装测试 +## 附录-编译安装测试 -## 编译 +### 编译 参考 [如何构建MiniOB](../how_to_build.md) 文件。 -## 运行服务端 +### 运行服务端 参考 [如何运行MiniOB](../how_to_run.md)。 diff --git a/docs/src/design/miniob-bplus-tree-concurrency.md b/docs/docs/design/miniob-bplus-tree-concurrency.md similarity index 97% rename from docs/src/design/miniob-bplus-tree-concurrency.md rename to docs/docs/design/miniob-bplus-tree-concurrency.md index 5bba20b8b..be7c580ea 100644 --- a/docs/src/design/miniob-bplus-tree-concurrency.md +++ b/docs/docs/design/miniob-bplus-tree-concurrency.md @@ -1,15 +1,20 @@ +--- +title: B+ 树并发操作 +--- + +# B+ 树并发操作 > [MiniOB](https://github.com/oceanbase/miniob) 是 [OceanBase](https://github.com/oceanbase/oceanbase) 联合华中科技大学推出的一款用于教学的小型数据库系统,希望能够帮助数据库爱好者系统性的学习数据库原理与实战。 -# B+ 树介绍 +## B+ 树介绍 B+ 树是传统数据库中常见的索引数据结构,比如MySQL、PostgreSQL都实现了B+树索引。B+ 树是一个平衡多叉树,层级少(通常只有3层)、数据块(内部节点/叶子节点)大小固定,是一个非常优秀的磁盘数据结构。关于B+ 树的原理和实现,网上有非常多的介绍,就不在此聒噪。这里将介绍如何实现支持并发操作的B+树以及MiniOB中的实现。 -# B+树的并发操作 +## B+树的并发操作 在多线程并发操作时,通常使用的手段是加锁,这里的实现方法也是这样。不过在学习并发B+树实现原理之前,需要对B+树的实现比较熟悉,有兴趣的同学可以网上搜索一下。 -## Crabing Protocol +### Crabing Protocol 在操作B+树时加对应的读写锁是一种最简单粗暴但是有效的方法,只是这样实现效率不高。于是就有一些研究创建了更高效的并发协议,并且会在协议设计上防止死锁的发生。 ![B+树示例](images/bplus-tree.jpg) @@ -30,11 +35,11 @@ B+树的操作除了上述的插入、删除和查询,还有一个扫描操作 问题:哪种场景下,扫描加锁可能会与更新操作的加锁引起死锁? 问题:请参考[2],给出一个遍历时不需要重试的加锁方案。 -## MiniOB实现 +### MiniOB实现 MiniOB的B+树并发实现方案与上个章节描述的方法是一致的。这里介绍一些实现细节。 > 在这里假设同学们对B+树的实现已经有了一定的了解。 -### B+树与Buffer Pool +#### B+树与Buffer Pool B+树的数据是放在磁盘上的,但是直接读写磁盘是很慢的一个操作,因此这里增加一个内存缓冲层,叫做Buffer Pool。了解数据库实现的同学对这个名词不会陌生。在MiniOB中,Buffer Pool的实现是 `class DiskBufferPool`。对Buffer Pool实现不太了解也没关系,这里接单介绍一下。 `DiskBufferPool` 将一个磁盘文件按照页来划分(假设一页是8K,但是不一定),每次从磁盘中读取文件或者将数据写入到文件,都是以页为单位的。在将文件某个页面加载到内存中时,需要申请一块内存。内存通常会比磁盘要小很多,就需要引入内存管理。在这里引入Frame(页帧)的概念(参考 `class Frame`),每个Frame关联一个页面。`FrameManager`负责分配、释放Frame,并且在没有足够Frame的情况下,淘汰掉一些Frame,然后将这些Frame关联到新的磁盘页面。 @@ -48,7 +53,7 @@ B+ 树的数据保存在磁盘,其树节点,包括内部节点和叶子节 问题:为什么一定要先执行解锁,再执行unpin(frame引用计数减1)? -### 处理流程 +#### 处理流程 B+树相关的操作一共有4个:插入、删除、查找和遍历/扫描。这里对每个操作的流程都做一个汇总说明,希望能帮助大家了解大致的流程。 **插入操作** @@ -113,7 +118,7 @@ B+树相关的操作一共有4个:插入、删除、查找和遍历/扫描。 memo.release_last // 释放当前节点之前加到的锁 ``` -### 根节点处理 +#### 根节点处理 前面描述的几个操作,没有特殊考虑根节点。根节点与其它节点相比有一些特殊的地方: - B+树有一个单独的数据记录根节点的页面ID,如果根节点发生变更,这个数据也要随着变更。这个数据不是被Frame的锁保护的; - 根节点具有一定的特殊性,它是否“安全”,就是根节点是否需要变更,与普通节点的判断有些不同。 @@ -123,15 +128,15 @@ B+树相关的操作一共有4个:插入、删除、查找和遍历/扫描。 在MiniOB中,可以参考`LatchMemo`,是直接使用xlatch/slatch对Mutex来记录加过的锁,这里可以直接把根节点数据保护锁,告诉LatchMemo,让它来负责相关处理工作。 判断根节点是否安全,可以参考`IndexNodeHandler::is_safe`中`is_root_node`相关的判断。 -### 如何测试 +#### 如何测试 想要保证并发实现没有问题是在太困难了,虽然有一些工具来证明自己的逻辑模型没有问题,但是这些工具使用起来也很困难。这里使用了一个比较简单的方法,基于google benchmark框架,编写了一个多线程请求客户端。如果多个客户端在一段时间内,一直能够比较平稳的发起请求与收到应答,就认为B+树的并发没有问题。测试代码在`bplus_tree_concurrency_test.cpp`文件中,这里包含了多线程插入、删除、查询、扫描以及混合场景测试。 -## 其它 +### 其它 -### 有条件的开启并发 +#### 有条件的开启并发 MiniOB是一个用来学习的小型数据库,为了简化上手难度,只有使用-DCONCURRENCY=ON时,并发才能生效,可以参考 mutex.h中`class Mutex`和`class SharedMutex`的实现。当CONCURRENCY=OFF时,所有的加锁和解锁函数相当于什么都没做。 -### 并发中的调试 +#### 并发中的调试 死锁是让人非常头疼的事情,我们给Frame增加了调试日志,并且配合pin_count的动作,每次加锁、解锁以及pin/unpin都会打印相关日志,并在出现非预期的情况下,直接ABORT,以尽早的发现问题。这个调试能力需要在编译时使用条件 `-DDEBUG=ON` 才会生效。 以写锁为例: @@ -157,7 +162,7 @@ void Frame::write_latch(intptr_t xid) } ``` -# 参考 +## 参考 [1] [15445 indexconcurrency](https://15445.courses.cs.cmu.edu/fall2021/notes/08-indexconcurrency.pdf) [2] Concurrency of Operations on B-Trees diff --git a/docs/src/design/miniob-bplus-tree.md b/docs/docs/design/miniob-bplus-tree.md similarity index 80% rename from docs/src/design/miniob-bplus-tree.md rename to docs/docs/design/miniob-bplus-tree.md index 7359ab5af..9d4ae2e26 100644 --- a/docs/src/design/miniob-bplus-tree.md +++ b/docs/docs/design/miniob-bplus-tree.md @@ -1,24 +1,28 @@ +--- +title: B+Tree 实现 +--- + # MiniOB B+Tree 实现 ## 简介 在基本的逻辑上,MiniOB 的 B+Tree 和 B+Tree 是一致的,查询和插入都是从根逐层定位到叶结点,然后在叶结点内获取或者插入。如果插入过程发生叶结点满的情况,同样会进行分裂,并向上递归这一过程。 -LeafNode +![LeafNode](images/miniob-bplus-tree-leaf-node.png) 如上图,每个结点组织成一个固定大小的 page,之前介绍过每个 page 首先有一个 page_num 表示 page 在文件中的序号,每个结点 page 都有一个common header 实现为 IndexNode 结构,其中包括 is_leaf(是否为叶结点)、key_num(结点中 key 的个数)、parent(结点父结点的 page num),当 parent=-1 时表示该结点没有父结点。 除此之外,Leaf page 还有 prev_brother(左结点的 page num)和 next_brother(右结点的 page num),这两项用于帮助遍历。最后 page 所剩下的空间就顺序存放键值对,叶结点所存放的 key 是索引列的值加上 RID(该行数据在磁盘上的位置),Value 则为 RID,也就是说键值数据都是存放在叶结点上的,和 B+Tree 中叶结点的值是指向记录的指针不同。 -InternalNode +![InternalNode](images/miniob-bplus-tree-internal-node.png) 内部结点和叶结点有两点不同,一个是没有左右结点的 page num;另一个是所存放的值是 page num,也就是标识了子结点的 page 位置。如上图所示,键值对在内部结点是这样表示的,第一个键值对中的键是一个无效数据,真正用于比较的只有 k1 和 k2。 -IndeFile +![IndexFile](images/miniob-bplus-tree-index-file.png) 所有的结点(即 page)都存储在外存的索引文件 IndexFile 中,其中文件的第一个 page 是索引文件头,存储了一些元数据,如 root page 的 page num,内部结点和叶子结点能够存储键值对的最大个数等。 -PagesInFile +![PagesInFile](images/miniob-bplus-tree-pages-in-file.png) 上图是一个简单的 MiniOB B+Tree 示例,其中叶结点能够访问到左右结点,并且每个结点能够访问到父结点。我们能够从 IndexFile 的第一个 page 得到 root page,而在知道一棵 B+Tree 的 root page 以后就足够访问到任意一个结点了。查询时我们会从 root page 开始逐层向下定位到目标叶结点,在每个 page 内遍历搜索查找键。 @@ -28,16 +32,16 @@ 我们将先创建一个新的右兄弟结点,即 page5,然后在原结点内保留前一半的键值对,剩余的键值对则移动到新结点,并修改 page2 的后向 page num,page5 的前后向 page num 以及 page4 的前向 page num,再根据之前定位的插入位置判断是插入 page2 还是 page5 ,完成叶结点的插入。 -LeafPages +![LeafPage](images/miniob-bplus-tree-leaf-page.png) 此外,由于我们新增了结点,我们需要在父结点也插入新的键值对,这一步将涉及到原结点,新结点以及新结点中的最小键,分为以下两种情况: 1. 有父结点,那么直接将新结点中的最小键以及新结点的 page num 作为键值对插入父结点即可。 - InternalStruct + ![InternalStruct](images/miniob-bplus-tree-internal-struct.png) 2. 假设此时没有父结点,那么我们将创建一个新的根结点,除了把新结点键值对插入,还会将原结点的 page num 作为第一个键值对的值进行插入。 - InternalStruct2 + ![InternalStruct2](images/miniob-bplus-tree-internal-struct2.png) 如果父结点的键值对插入同样触发了分裂,我们将按上述的步骤递归执行。 @@ -47,20 +51,20 @@ 首先在结点内删除键值对,然后判断其中的键值对数目是否小于一半,如果是则需要进行特殊处理。比如 page2 中删除一个键值对,导致其键值对数目小于一半,此时通过它的父结点找到该结点的左兄弟,如果是最左边的结点,则找到其右兄弟。 -Deletion +![Deletion](images/miniob-bplus-tree-deletion.png) - 如果两个结点的所有键值对能容纳在一个结点内,那么进行合并操作,将右结点的数据迁移到左结点,并删除父结点中指向右结点的键值对。 - Deletion + ![Deletion](images/miniob-bplus-tree-deletion-migration.png) - 如果两个结点的所有键值对不能容纳在一个结点内,那么进行重构操作。 - 当所删除键值对的结点不是第一个结点时,那么选择将左兄弟的最后一个键值对移动到当前结点,并修改父结点中指向当前结点的键。 - Deletion + ![Deletion](images/miniob-bplus-tree-deletion-move.png) - 当所删除键值对的结点是第一个结点时,那么选择将右兄弟的第一个键值对移动到当前结点,并修改父结点中指向右兄弟的键。 - Deletion + ![Deletion](images/miniob-bplus-tree-deletion-move2.png) 在上述两种操作中,合并操作会导致父结点删除键值对,因此会向上递归地去判断是否需要再次的合并与重构。 diff --git a/docs/src/design/miniob-buffer-pool.md b/docs/docs/design/miniob-buffer-pool.md similarity index 92% rename from docs/src/design/miniob-buffer-pool.md rename to docs/docs/design/miniob-buffer-pool.md index 4aed44f81..e6ce7bdbd 100644 --- a/docs/src/design/miniob-buffer-pool.md +++ b/docs/docs/design/miniob-buffer-pool.md @@ -1,3 +1,7 @@ +--- +title: 存储实现 +--- + # MiniOB 存储实现 本节将从存储层面介绍 MiniOB 的实现。 @@ -6,7 +10,7 @@ 首先回顾一下 MiniOB 的框架,在 MiniOB 概述章节已经简单的介绍过,本节重点介绍执行器(Executor)访问的存储引擎。 -Overview +![Overview](images/miniob-overview.png) 存储引擎控制整个数据、记录是如何在文件和磁盘中存储,以及如何跟内部 SQL 模块之间进行交互。存储引擎中有三个关键模块: @@ -20,7 +24,7 @@ 首先介绍 MiniOB 中文件是怎么存放,文件需要管理一些基础对象,如数据结构、表、索引。数据库在 MiniOB 这里体现就是一个文件夹,如下图所示,最上面就是一个目录,MiniOB 启动后会默认创建一个 sys 数据库,所有的操作都默认在 sys 中。 -directory +![目录](images/miniob-buffer-pool-directory.png) 一个数据库下会有多张表。上图示例中只有三张表,接下来以 test1 表为例介绍一下表里都存放什么内容。 @@ -36,7 +40,7 @@ Buffer Pool 在传统数据库里是非常重要的基础组件。 首先来了解一下为什么要有一个 Buffer Pool ,数据库的数据是存放在磁盘里的,但不能直接从磁盘中读取数据,而是需要先把磁盘的数据读取到内存中,再在 CPU 做一些运算之后,展示给前端用户。写入也是一样的,一般都会先写入到内存,再把内存中的数据写入到磁盘。这种做法也是一个很常见的缓存机制。 -buffer pool +![Buffer Pool](images/miniob-buffer-pool-implementation.png) 接着来看 Buffer Pool 在 MiniOB 中是如何组织的。如上图所示,左边是内存,把内存拆分成不同的帧(frame)。假如内存中有四个 frame,对应了右边的多个文件,每个文件按照每页来划分,每个页的大小都是固定的,每个页读取时是以页为单位跟内存中的一个 frame 相对应。 @@ -52,7 +56,7 @@ Buffer Pool 在 MiniOB 里面组织的时候,一个 DiskBufferPool 对象对 - 内存没有空闲空间,还要再去读 Page4,已经没有办法去申请新的内存了。此时就需要从现有的 frame 中淘汰一个页面,比如把 frame1 淘汰掉了,然后把 frame1 跟 Page4 关联起来,再把 Page4 的数据读取到 frame1 里面。淘汰机制也是有一些淘汰条件和算法的,可以先做简单的了解,暂时先不深入讨论细节。 -Page +![Page](images/miniob-buffer-pool-page.png) 再来看一下,一个物理的文件上面都有哪些组织结构,如上图所示。 @@ -74,7 +78,7 @@ Buffer Pool 在 MiniOB 里面组织的时候,一个 DiskBufferPool 对象对 MiniOB 的 Record Manager 做了简化,有一些假设,记录通常都是比较短的,加上页表头,不会超出一个页面的大小。另外记录都是固定长度的,这个简化让学习 MiniOB 变得更简单一点。 -Record Manager +![Record Manager](images/miniob-buffer-pool-record.png) 上面的图片展示了 MiniOB 的 Record Manager 是怎么实现的,以及 Record 在文件中是如何组织的。 diff --git a/docs/src/design/miniob-double-write-buffer.md b/docs/docs/design/miniob-double-write-buffer.md similarity index 95% rename from docs/src/design/miniob-double-write-buffer.md rename to docs/docs/design/miniob-double-write-buffer.md index 14a6c3158..941ad03bf 100644 --- a/docs/src/design/miniob-double-write-buffer.md +++ b/docs/docs/design/miniob-double-write-buffer.md @@ -1,3 +1,7 @@ +--- +title: Double Write Buffer 实现 +--- + # MiniOB Double Write Buffer 实现 ## 当前MiniOB的问题 @@ -18,7 +22,7 @@ Double Write其实就是在重做日志前,用户需要一个页的副本, ## Double Write Buffer架构 -Overview +![Double Write Buffer](images/miniob-double-write-buffer-struct.png) ## Double Write Buffer 工作流程 diff --git a/docs/src/design/miniob-durability.md b/docs/docs/design/miniob-durability.md similarity index 99% rename from docs/src/design/miniob-durability.md rename to docs/docs/design/miniob-durability.md index 3d4573aaf..45665a101 100644 --- a/docs/src/design/miniob-durability.md +++ b/docs/docs/design/miniob-durability.md @@ -1,7 +1,11 @@ -本文介绍 [MiniOB](https://github.com/oceanbase/miniob) 中的 clog 模块是如何工作的。 +--- +title: 持久化 +--- # 背景 +> 本文介绍 [MiniOB](https://github.com/oceanbase/miniob) 中的 clog 模块是如何工作的。 + 持久化(Durability) 是事务中非常重要的一个模块,也是最复杂的一个模块,实现持久化才能保证数据不丢失。而持久化同时还要保证事务的原子性与数据完整性。如果对事务的一些概念不太了解,建议先学习了解事务的基本概念,比如学习[事务处理](lectures/lecture-6.md)章节,或者在网上搜索更多资料。 # MiniOB 日志设计与实现 diff --git a/docs/src/design/miniob-how-to-add-new-sql.md b/docs/docs/design/miniob-how-to-add-new-sql.md similarity index 99% rename from docs/src/design/miniob-how-to-add-new-sql.md rename to docs/docs/design/miniob-how-to-add-new-sql.md index eefd1b0ef..aa62b942f 100644 --- a/docs/src/design/miniob-how-to-add-new-sql.md +++ b/docs/docs/design/miniob-how-to-add-new-sql.md @@ -1,3 +1,7 @@ +--- +title: 如何新增一种类型的SQL语句 +--- + > 本文介绍如何新增一种类型的SQL语句。 当前的SQL实现已经比较复杂,这里以新增一个简单的SQL语句为例,介绍如何新增一种类型的SQL语句。 diff --git a/docs/src/design/miniob-mysql-protocol.md b/docs/docs/design/miniob-mysql-protocol.md similarity index 81% rename from docs/src/design/miniob-mysql-protocol.md rename to docs/docs/design/miniob-mysql-protocol.md index 5b5baa6f7..aad8dbca7 100644 --- a/docs/src/design/miniob-mysql-protocol.md +++ b/docs/docs/design/miniob-mysql-protocol.md @@ -1,12 +1,18 @@ +--- +title: MySQL 协议 +--- + +# MySQL 通讯协议 + > 本篇文档介绍MySQL的通讯流程以及MiniOB对它的支持与实现 -# MiniOB 通讯协议简介 +## MiniOB 通讯协议简介 MiniOB 支持使用客户端/服务端模式,客户端与服务端需要通过通讯来交互。当前服务端支持普通的文本协议与MySQL协议。 普通的文本协议非常简单,每个请求和应答都使用字符串来传递,字符串以'\0'字符结尾,因此文本协议不能支持二进制数据的传输。 MySQL 是一个非常流行的开源数据库,它有非常丰富的周边生态工具,如果MiniOB可以支持MySQL协议,后续就可以逐步扩展支持这些工具。 -# MySQL 通讯协议 +## MySQL 通讯协议 MySQL 服务端与客户端交互的过程。 @@ -24,26 +30,26 @@ MySQL 服务端与客户端交互的过程。 客户端 -> 服务器:发送退出命令包。 5. 四次握手断开 TCP 连接。 -## MySQL Packet +### MySQL Packet MySQL 协议通过packet来交互。每个packet都包含一个packet header和packet payload。 packet header包含payload的长度和当前消息包的sequence。sequence是从1开始,每发出一个消息包,sequence都会加1。 每个消息包都由一些字段构成,字段的类型有很多种,主要有整形和字符串。每种类型又有多种编码方式,比如字符串有固定长度的、以'\0'结尾的和带长度编码的。这些可以参考 mysql_communicator.cpp::store_xxx 函数。 > 注意,MySQL协议中数字都是小端编码。而MiniOB没有对大小端做处理,所以当前只能运行在小端的机器上。 -## 认证阶段 +### 认证阶段 完成MySQL客户端与MiniOB的建连。 构造handshake包,解析验证包, 返回OK包,确保server与客户端的建连。 **握手包handshake格式** -mysql-handshake +![mysql-handshake](images/mysql-handshake.png) 在accept接收到新的连接时,server端需要先发起handshake握手包给客户端。 **认证报文** -mysql-auth +![mysql-auth](images/mysql-auth.png) 这里有两次hash加密,基于随机挑战码和密码加密后返回给server端。 @@ -51,13 +57,13 @@ MyqlCommunicator::init是在刚接收到新的客户端连接时的接口,它 **OK包报文** -mysql-ok-packet +![mysql-ok-packet](images/mysql-ok-packet.png) -## 请求交互阶段 +### 请求交互阶段 在完成鉴权后,客户端就可以发送普通的请求命令到服务端,比如 "select * from t;" 查询语句。 -mysql-command-packet +![mysql-command-packet](images/mysql-command-packet.png) MiniOB 仅考虑支持普通的文本查询命令。普通的文本查询命令,包格式也符合MySQL Packet的要求。其payload的第一个字节是command,接着就是请求命令,也就是SQL语句。 @@ -67,18 +73,18 @@ SQL请求的返回数据类型比较丰富,有OK、Error、EOF和ResultSet。 **OK/EOF包** -mysql-ok-eof-packet +![mysql-ok-eof-packet](images/mysql-ok-eof-packet.png) **Error包** -mysql-error-packet +![mysql-error-packet](images/mysql-error-packet.png) **ResultSet** -mysql-result-set-packet +![mysql-result-set-packet](images/mysql-result-set-packet.png) **抓包** 抓包可以很清晰的看到整个流程。 -mysql-packet-flow +![mysql-packet-flow](images/mysql-packet-flow.png) diff --git a/docs/src/design/miniob-sql-expression.md b/docs/docs/design/miniob-sql-expression.md similarity index 99% rename from docs/src/design/miniob-sql-expression.md rename to docs/docs/design/miniob-sql-expression.md index 8bc320187..23d05c258 100644 --- a/docs/src/design/miniob-sql-expression.md +++ b/docs/docs/design/miniob-sql-expression.md @@ -1,6 +1,11 @@ -> 本文介绍如何解析表达式 +--- +title: SQL 表达式 +--- # 介绍 + +> 本文介绍如何解析表达式 + 表达式是SQL操作中非常基础的内容。 我们常见的表达式就是四则运算的表达式,比如`1+2`、`3*(10-3)`等。在常见的数据库中,比如MySQL、[OceanBase](https://github.com/oceanbase/oceanbase),可以运行 `select 1+2`、`select 3*(10-3)`,来获取这种表达式的结果。但是同时在SQL中,也可以执行 `select 1`、`select field1 from table1`,来查询一个常量或者一个字段。那我们就可以把表达式的概念抽象出来,认为常量、四则运算、表字段、函数调用等都是表达式。 diff --git a/docs/src/design/miniob-sql-parser.md b/docs/docs/design/miniob-sql-parser.md similarity index 99% rename from docs/src/design/miniob-sql-parser.md rename to docs/docs/design/miniob-sql-parser.md index c843a191e..59efb8797 100644 --- a/docs/src/design/miniob-sql-parser.md +++ b/docs/docs/design/miniob-sql-parser.md @@ -1,3 +1,7 @@ +--- +title: SQL 词法语法分析 +--- + > 这部分内容会介绍一些如何对miniob中的词法语法分析模块进行开发与调试,以及依赖的工具。 # 简介 diff --git a/docs/src/design/miniob-thread-model.md b/docs/docs/design/miniob-thread-model.md similarity index 86% rename from docs/src/design/miniob-thread-model.md rename to docs/docs/design/miniob-thread-model.md index c6851d5c0..7cf8df93b 100644 --- a/docs/src/design/miniob-thread-model.md +++ b/docs/docs/design/miniob-thread-model.md @@ -1,16 +1,24 @@ +--- +title: 线程模型 +--- + +# 线程模型 + > 本篇文档介绍 MiniOB 中的线程池模型。 -# 简介 +## 简介 多线程是提高系统资源利用率的一种常用手段,也是我们学习软件开发进阶的必经之路。 MiniOB 实现了一个可扩展的线程模型,当前支持两种线程池模型: + - 一个连接一个线程; + - 一个线程池处理所有连接。 > 这种设计是模仿了MySQL/MariaDB的线程模型设计。 -# 线程模型设计 +## 线程模型设计 -## 命令行参数 +### 命令行参数 当前MiniOB的线程池模型通过命令行接口指定使用哪种类型: ```bash # 一个连接一个线程(默认) @@ -21,17 +29,17 @@ observer -T=java-thread-pool ThreadHandler::create 会根据传入的名字创建对应的 ThreadHandler 对象。 -## 线程池模型做什么 +### 线程池模型做什么 这个模型并不负责所有的任务,只处理客户端发来的请求。包括监听客户端是否有消息到达、处理SQL请求与返回应答、关闭连接等。 线程模型并不负责监听新的客户端连接,这是在主线程中做的事情,参考 `NetServer::serve`。当有新的连接到达时,会调用 `ThreadHandler::new_connection`,线程模型按照自己的模型设计来处理新来的连接。 -## 一个连接一个线程 +### 一个连接一个线程 OneThreadPerConnectionThreadHandler 会为每个连接创建一个线程,这个线程负责监听这个连接是否有消息到达、处理SQL请求与返回应答、关闭连接等。 -OneThreadPerConnectionThreadHandler +![OneThreadPerConnectionThreadHandler](images/thread-model-one-thread-per-connection.png) -## 线程池模型 +### 线程池模型 JavaThreadPoolThreadHandler 会创建一个线程池,线程池中一个线程负责监听所有连接是否有消息到达。如果有消息到达,就将这个连接对象放入线程池任务队列中,等待线程池中的线程来处理。在某个连接的任务处理完成之前,不会监听它的新消息。 这个线程池使用libevent实现消息监听,参考 `JavaThreadPoolThreadHandler::start`。 @@ -40,10 +48,9 @@ JavaThreadPoolThreadHandler 会创建一个线程池,线程池中一个线程 ThreadPoolExecutor 是一个简单的可伸缩线程池。当任务比当前空闲线程多的时候,就会扩容。当某些线程空闲时间比较久,就会自动退出。 -JavaThreadPoolThreadHandler - +![JavaThreadPoolThreadHandler](images/thread-model-thread-pool.png) -# 参考 +## 参考 - [MySQL Percona Thread Pool](https://docs.percona.com/percona-server/5.7/performance/threadpool.html#handling-of-long-network-waits) - [MariaDB Thread Pool](https://mariadb.com/kb/en/thread-groups-in-the-unix-implementation-of-the-thread-pool/) - [Java ThreadPoolExecutor](https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html) \ No newline at end of file diff --git a/docs/src/design/miniob-transaction.md b/docs/docs/design/miniob-transaction.md similarity index 99% rename from docs/src/design/miniob-transaction.md rename to docs/docs/design/miniob-transaction.md index 3ac46731d..faba57979 100644 --- a/docs/src/design/miniob-transaction.md +++ b/docs/docs/design/miniob-transaction.md @@ -1,3 +1,7 @@ +--- +title: 事务模块 +--- + 本篇文档介绍 MiniOB 中的事务模块是如何工作的。 # 背景 diff --git a/docs/src/dev-env/dev_by_gitpod.md b/docs/docs/dev-env/dev_by_gitpod.md similarity index 70% rename from docs/src/dev-env/dev_by_gitpod.md rename to docs/docs/dev-env/dev_by_gitpod.md index 1f00dbf5c..d6485a538 100644 --- a/docs/src/dev-env/dev_by_gitpod.md +++ b/docs/docs/dev-env/dev_by_gitpod.md @@ -1,18 +1,24 @@ +--- +title: 使用 GitPod 开发 MiniOB +--- + +# 使用 GitPod 开发 MiniOB + > [MiniOB](https://github.com/oceanbase/miniob) 是 [OceanBase](https://github.com/oceanbase/oceanbase) 联合华中科技大学推出的一款用于教学的小型数据库系统,希望能够帮助数据库爱好者系统性的学习数据库原理与实战。 本篇文章介绍如何使用 [GitPod](https://www.gitpod.io/) 开发 [MiniOB](https://github.com/oceanbase/miniob)。 也可以参考这篇文章了解如何使用 Visual Studio Code 来开发调试 MiniOB。 -# GitPod 简介 +## GitPod 简介 [GitPod](https://www.gitpod.io/) 是一个能让我们在任何地方都能方便开发自己代码的云平台。在开发时,GitPod会提供一个虚拟机一样的开发环境,开发平台是Linux,并且GitPod可以直接打开GitHub项目,支持很多IDE,比如Visual Studio Code、Clion、VIM等。 -GitPod支持的IDE +![GitPod支持的IDE](images/dev_by_gitpod_ides.png) 本篇文章将介绍如何在GitPod上使用Visual Studio Code(浏览器版)来开发MiniOB。 -# 在 GitPod 上开发自己的 MiniOB +## 在 GitPod 上开发自己的 MiniOB -## 创建自己的GitHub项目 +### 创建自己的GitHub项目 在开发MiniOB之前,应该先在GitHub上将MiniOB放在自己的私有仓库中。为了方便演示,我这里直接使用fork的方式,在自己的个人仓库中创建一个共有(public)仓库。 @@ -20,35 +26,35 @@ fork后就会在自己的个人名下有一个miniob仓库代码 - Fork MiniOB 仓库 + ![Fork MiniOB 仓库](images/dev_by_gitpod_fork_repo.png) -## 在 GitPod 上打开自己的项目 +### 在 GitPod 上打开自己的项目 使用 [GitPod](https://www.gitpod.io/) 打开自己的项目 > 如果是第一次使用,需要输入一些额外的信息,按照GitPod的引导来走就行,最终会引导你打开你的项目。 - 打开GitPod + ![打开GitPod](images/dev_by_gitpod_open_gitpod.png) - gitpod new workspace + ![gitpod new workspace](images/dev_by_gitpod_gitpod_new_workspace.png) 这里选择自己的代码项目,并且使用vscode浏览器版本,容器规格也选择最小的(最小的规格对miniob来说已经非常充足) - gitpod open miniob + ![gitpod open miniob](images/dev_by_gitpod_open_miniob.png) - gitpod miniob workspace + ![gitpod miniob workspace](images/dev_by_gitpod_miniob_workspace.png) - gitpod miniob workspace + ![gitpod miniob workspace](images/dev_by_gitpod_vscode_homepage.png) 如果以前已经操作过上面的步骤,可以直接从gitpod的首页找到自己的项目。 -GitPod Dashboard +![GitPod Dashboard](images/dev_by_gitpod_dashboard.png) -GitPod Workspaces +![GitPod Workspaces](images/dev_by_gitpod_workspace.png) -## 代码构建 +### 代码构建 **环境初始化** 因为MiniOB当前已经将.vscode文件加入到项目中,所以可以直接使用当前已有的一些命令(task)来构建代码。 @@ -63,31 +69,31 @@ 所有的任务都可以从这里找到入口。 -build run task +![build run task](images/dev_by_gitpod_build_run_task.png) 运行 init 命令的入口。 -build init +![build init](images/dev_by_gitpod_build_init.png) -build init output select +![build init output select](images/dev_by_gitpod_build_init_output.png) 运行构建(编译)的入口。需要设置默认构建的任务,vscode才能运行。这里已经设置过了。 -build run build task +![build run build task](images/dev_by_gitpod_build_run_build_task.png) 构建(编译)时,会有一些输出,如果有编译错误,也可以直接使用鼠标点击跳转到错误的地方。 -build output +![build output](images/dev_by_gitpod_build_output.png) 还可以构建其它模式。 -build others +![build others](images/dev_by_gitpod_build_others.png) > WARNING: 不要在gitpod的终端上,执行 sh build.sh,而是执行 bash build.sh 或者直接运行 ./build.sh miniob 虽然是cmake功能,可以使用vscode带的cmake配置,但是miniob在编译时,会使用一些变量来控制编译什么版本,比如是否编译UNITTEST,是否开启ASAN等。因此这里使用build.sh脚本来简化项目的编译命令。 -## 代码调试 +### 代码调试 与代码构建类似,MiniOB 可以支持在vscode中直接启动调试程序。启动的调试程序为默认构建项目,当前是 debug 模式编译的miniob。 与普通的调试类似,可以自行设置断点。断点可以在运行程序之前也可以在其后。 启动调试服务端后,打开一个新的终端,来运行客户端,以便向服务端发起命令。 @@ -95,61 +101,60 @@ miniob 虽然是cmake功能,可以使用vscode带的cmake配置,但是miniob **下断点** 光标放到某一行,vscode编辑框的左边就会出现一个粉红色的圆点,点击圆点就可以下断点 -debug take a breakpoint + +![debug take a breakpoint](images/dev_by_gitpod_debug_take_breakpoint.png) 圆点变成红色,断点下成功了。 -debug breakpoint +![debug breakpoint](images/dev_by_gitpod_debug_breakpoint.png) **启动调试** -debug start program +![debug start program](images/dev_by_gitpod_debug_start.png) - -debug console output +![debug console output](images/dev_by_gitpod_debug_console.png) vscode 为调试进程也创建了一个终端,可以在这里看到observer运行期间在控制台上的输出。 -debug terminal output +![debug terminal output](images/dev_by_gitpod_debug_terminal.png) 调试时显示的界面。可以看到最上面中央处,有一个调试的界面,可以执行单步调试,或者跳转到函数内。这与普通的调试器界面类似。左边有一些变量的展示。 另外,我这里开了一个终端,运行客户端连接服务端发起命令请求。 -debug debugging view +![debug debugging view](images/dev_by_gitpod_debug_debugging_view.png) -## 代码提交 +### 代码提交 作为一个GitHub项目,一个功能或者BUG开发完成后,需要将代码推送到远程仓库。vscode已经集成了GitHub和git插件,可以方便的进行操作。 完成一个功能,就提交一次。这里输入commit message后直接提交即可。 注意这里仅仅提交到了本地,如果要提交到GitHub(远程仓库),需要执行”推送“,即 git push。 -git commit +![git commit](images/dev_by_gitpod_git_commit.png) Git的其它操作链接在这里 -git operations +![git operations](images/dev_by_gitpod_git_operations.png) 如果推送时出现这样的错误,可能是没有权限。gitpod 会自动提示然后跳转过去设置权限即可。 -git push errors +![git push errors](images/dev_by_gitpod_git_push_error.png) -git pre edit permissions +![git pre edit permissions](images/dev_by_gitpod_git_pre_edit_permissions.png) 我这里就是没有写权限,所以无法推送到远程仓库。 -git edit permissions - -git auth +![git edit permissions](images/dev_by_gitpod_git_edit_permissions.png) -git auth1 +![git auth](images/dev_by_gitpod_git_auth.png) +![git auth1](images/dev_by_gitpod_git_auth2.png) -# 信息介绍 +## 信息介绍 -## MiniOB 中的 tasks +### MiniOB 中的 tasks vscode 可以非常方便的运行任务(task)来运行预配置的命令,比如shell。 miniob 的编译也可以通过脚本来执行(build.sh)。这里预配置了几个编译任务,可以按需自取,也可以按照需要,增加新的配置,运行自己的参数。 @@ -175,7 +180,7 @@ miniob 的编译也可以通过脚本来执行(build.sh)。这里预配置了几 } ``` -## MiniOB 中的 launch +### MiniOB 中的 launch 很多同学不习惯使用gdb的终端界面来调试程序,那么在 vscode 中调试miniob非常方便,与Visual Studio、Clion中类似,都有一个操作界面。 vscode中启动调试程序是通过launch.json来配置的,这里简单介绍一下主要内容。 diff --git a/docs/src/dev-env/how-to-dev-using-docker.md b/docs/docs/dev-env/how-to-dev-using-docker.md similarity index 96% rename from docs/src/dev-env/how-to-dev-using-docker.md rename to docs/docs/dev-env/how-to-dev-using-docker.md index a5a213267..c005281ac 100644 --- a/docs/src/dev-env/how-to-dev-using-docker.md +++ b/docs/docs/dev-env/how-to-dev-using-docker.md @@ -1,3 +1,7 @@ +--- +title: 使用Docker开发MiniOB +--- + 本篇文章介绍如何使用Docker来开发MiniOB。 MiniOB 依赖的第三方组件比较多,搭建开发环境比较繁琐,建议同学们直接使用我们提供的Docker环境进行开发。 diff --git a/docs/src/dev-env/how_to_dev_in_docker_container_by_vscode.md b/docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode.md similarity index 99% rename from docs/src/dev-env/how_to_dev_in_docker_container_by_vscode.md rename to docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode.md index 8b772aeed..a68825a55 100644 --- a/docs/src/dev-env/how_to_dev_in_docker_container_by_vscode.md +++ b/docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode.md @@ -1,3 +1,7 @@ +--- +title: 使用 Docker 和 VSCode 远程开发 Miniob +--- + # 使用 Docker 和 VSCode 远程开发 Miniob 本文档阐述如何使用 Docker 构建一个具备 Miniob 开发环境的容器,并且通过 VSCode 的 Remote-SSH 插件 SSH 到容器中进行远程开发。Docker 和 VSCode 可以安装在不同机器上。 diff --git a/docs/src/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md b/docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md similarity index 96% rename from docs/src/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md rename to docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md index a5516c10a..ebb2a4fc7 100644 --- a/docs/src/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md +++ b/docs/docs/dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md @@ -1,3 +1,7 @@ +--- +title: 在windows上通过docker配置环境并利用vscode调试代码(手把手版) +--- + # 在windows上通过docker配置环境并利用vscode调试代码(手把手版) -- 由严奕凡编写,就读于重庆大学. diff --git a/docs/src/dev-env/how_to_dev_miniob_by_docker_on_windows.md b/docs/docs/dev-env/how_to_dev_miniob_by_docker_on_windows.md similarity index 98% rename from docs/src/dev-env/how_to_dev_miniob_by_docker_on_windows.md rename to docs/docs/dev-env/how_to_dev_miniob_by_docker_on_windows.md index 156ec60bf..edcd564ef 100644 --- a/docs/src/dev-env/how_to_dev_miniob_by_docker_on_windows.md +++ b/docs/docs/dev-env/how_to_dev_miniob_by_docker_on_windows.md @@ -1,3 +1,7 @@ +--- +title: Windows 如何使用 Docker 开发miniob +--- + Windows 如何使用 Docker 开发miniob miniob 是 OceanBase联合华中科技大学开发的一款帮助零基础开发者数据库开发实战的系统,目前已经开源,可以在GitHub网站查看:[miniob github首页](https://github.com/oceanbase/miniob)。 diff --git a/docs/src/dev-env/how_to_dev_miniob_by_vscode.md b/docs/docs/dev-env/how_to_dev_miniob_by_vscode.md similarity index 98% rename from docs/src/dev-env/how_to_dev_miniob_by_vscode.md rename to docs/docs/dev-env/how_to_dev_miniob_by_vscode.md index 014754b2f..0dcd02ee8 100644 --- a/docs/src/dev-env/how_to_dev_miniob_by_vscode.md +++ b/docs/docs/dev-env/how_to_dev_miniob_by_vscode.md @@ -1,3 +1,7 @@ +--- +title: 使用vscode开发miniob +--- + # 环境准备 ## 运行环境 * 操作系统 diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_init.png b/docs/docs/dev-env/images/dev_by_gitpod_build_init.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_init.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_init.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_init_output.png b/docs/docs/dev-env/images/dev_by_gitpod_build_init_output.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_init_output.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_init_output.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_others.png b/docs/docs/dev-env/images/dev_by_gitpod_build_others.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_others.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_others.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_output.png b/docs/docs/dev-env/images/dev_by_gitpod_build_output.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_output.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_output.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_run_build_task.png b/docs/docs/dev-env/images/dev_by_gitpod_build_run_build_task.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_run_build_task.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_run_build_task.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_build_run_task.png b/docs/docs/dev-env/images/dev_by_gitpod_build_run_task.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_build_run_task.png rename to docs/docs/dev-env/images/dev_by_gitpod_build_run_task.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_dashboard.png b/docs/docs/dev-env/images/dev_by_gitpod_dashboard.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_dashboard.png rename to docs/docs/dev-env/images/dev_by_gitpod_dashboard.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_breakpoint.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_breakpoint.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_breakpoint.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_breakpoint.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_console.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_console.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_console.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_console.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_debugging_view.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_debugging_view.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_debugging_view.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_debugging_view.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_start.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_start.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_start.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_start.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_take_breakpoint.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_take_breakpoint.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_take_breakpoint.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_take_breakpoint.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_debug_terminal.png b/docs/docs/dev-env/images/dev_by_gitpod_debug_terminal.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_debug_terminal.png rename to docs/docs/dev-env/images/dev_by_gitpod_debug_terminal.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_fork_repo.png b/docs/docs/dev-env/images/dev_by_gitpod_fork_repo.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_fork_repo.png rename to docs/docs/dev-env/images/dev_by_gitpod_fork_repo.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_auth.png b/docs/docs/dev-env/images/dev_by_gitpod_git_auth.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_auth.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_auth.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_auth1.png b/docs/docs/dev-env/images/dev_by_gitpod_git_auth1.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_auth1.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_auth1.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_commit.png b/docs/docs/dev-env/images/dev_by_gitpod_git_commit.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_commit.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_commit.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_edit_permissions.png b/docs/docs/dev-env/images/dev_by_gitpod_git_edit_permissions.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_edit_permissions.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_edit_permissions.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_operations.png b/docs/docs/dev-env/images/dev_by_gitpod_git_operations.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_operations.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_operations.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_pre_edit_permissions.png b/docs/docs/dev-env/images/dev_by_gitpod_git_pre_edit_permissions.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_pre_edit_permissions.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_pre_edit_permissions.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_git_push_error.png b/docs/docs/dev-env/images/dev_by_gitpod_git_push_error.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_git_push_error.png rename to docs/docs/dev-env/images/dev_by_gitpod_git_push_error.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_gitpod_new_workspace.png b/docs/docs/dev-env/images/dev_by_gitpod_gitpod_new_workspace.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_gitpod_new_workspace.png rename to docs/docs/dev-env/images/dev_by_gitpod_gitpod_new_workspace.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_ides.png b/docs/docs/dev-env/images/dev_by_gitpod_ides.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_ides.png rename to docs/docs/dev-env/images/dev_by_gitpod_ides.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_miniob_workspace.png b/docs/docs/dev-env/images/dev_by_gitpod_miniob_workspace.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_miniob_workspace.png rename to docs/docs/dev-env/images/dev_by_gitpod_miniob_workspace.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_open_gitpod.png b/docs/docs/dev-env/images/dev_by_gitpod_open_gitpod.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_open_gitpod.png rename to docs/docs/dev-env/images/dev_by_gitpod_open_gitpod.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_open_miniob.jpg b/docs/docs/dev-env/images/dev_by_gitpod_open_miniob.jpg similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_open_miniob.jpg rename to docs/docs/dev-env/images/dev_by_gitpod_open_miniob.jpg diff --git a/docs/src/dev-env/images/dev_by_gitpod_vscode_homepage.png b/docs/docs/dev-env/images/dev_by_gitpod_vscode_homepage.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_vscode_homepage.png rename to docs/docs/dev-env/images/dev_by_gitpod_vscode_homepage.png diff --git a/docs/src/dev-env/images/dev_by_gitpod_workspace.png b/docs/docs/dev-env/images/dev_by_gitpod_workspace.png similarity index 100% rename from docs/src/dev-env/images/dev_by_gitpod_workspace.png rename to docs/docs/dev-env/images/dev_by_gitpod_workspace.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_Docker.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_Docker.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_Docker.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_Docker.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_branch.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_branch.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_branch.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_branch.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_done.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_done.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_done.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_done.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_file_info.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_file_info.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_file_info.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_clone_file_info.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_downloadDocker.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_downloadDocker.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_downloadDocker.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_downloadDocker.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_plugin.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_plugin.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_plugin.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_plugin.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker1.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker1.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker1.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker1.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker2.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker2.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker2.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker2.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker3.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker3.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker3.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_prepareDocker3.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv2.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv2.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv2.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv2.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv3.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv3.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv3.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_searchEnv3.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_1.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_1.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_1.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_1.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_2.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_2.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_2.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_2.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_3.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_3.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_3.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_3.png diff --git a/docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_4.png b/docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_4.png similarity index 100% rename from docs/src/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_4.png rename to docs/docs/dev-env/images/dev_in_docker_container_by_vscode_on_windows_startDocker_in_vscode_4.png diff --git a/docs/src/dev-env/images/vsc_add_new_ssh_host.png b/docs/docs/dev-env/images/vsc_add_new_ssh_host.png similarity index 100% rename from docs/src/dev-env/images/vsc_add_new_ssh_host.png rename to docs/docs/dev-env/images/vsc_add_new_ssh_host.png diff --git a/docs/src/dev-env/images/vsc_config_file.png b/docs/docs/dev-env/images/vsc_config_file.png similarity index 100% rename from docs/src/dev-env/images/vsc_config_file.png rename to docs/docs/dev-env/images/vsc_config_file.png diff --git a/docs/src/dev-env/images/vsc_container_started.png b/docs/docs/dev-env/images/vsc_container_started.png similarity index 100% rename from docs/src/dev-env/images/vsc_container_started.png rename to docs/docs/dev-env/images/vsc_container_started.png diff --git a/docs/src/dev-env/images/vsc_cpp_extensions.png b/docs/docs/dev-env/images/vsc_cpp_extensions.png similarity index 100% rename from docs/src/dev-env/images/vsc_cpp_extensions.png rename to docs/docs/dev-env/images/vsc_cpp_extensions.png diff --git a/docs/src/dev-env/images/vsc_debug.png b/docs/docs/dev-env/images/vsc_debug.png similarity index 100% rename from docs/src/dev-env/images/vsc_debug.png rename to docs/docs/dev-env/images/vsc_debug.png diff --git a/docs/src/dev-env/images/vsc_kit_for_miniob.png b/docs/docs/dev-env/images/vsc_kit_for_miniob.png similarity index 100% rename from docs/src/dev-env/images/vsc_kit_for_miniob.png rename to docs/docs/dev-env/images/vsc_kit_for_miniob.png diff --git a/docs/src/dev-env/images/vsc_open_folder.png b/docs/docs/dev-env/images/vsc_open_folder.png similarity index 100% rename from docs/src/dev-env/images/vsc_open_folder.png rename to docs/docs/dev-env/images/vsc_open_folder.png diff --git a/docs/src/dev-env/images/vsc_pwd.png b/docs/docs/dev-env/images/vsc_pwd.png similarity index 100% rename from docs/src/dev-env/images/vsc_pwd.png rename to docs/docs/dev-env/images/vsc_pwd.png diff --git a/docs/src/dev-env/images/vsc_remote_ssh_connect_cmd.png b/docs/docs/dev-env/images/vsc_remote_ssh_connect_cmd.png similarity index 100% rename from docs/src/dev-env/images/vsc_remote_ssh_connect_cmd.png rename to docs/docs/dev-env/images/vsc_remote_ssh_connect_cmd.png diff --git a/docs/src/dev-env/images/vsc_remote_ssh_extension.png b/docs/docs/dev-env/images/vsc_remote_ssh_extension.png similarity index 100% rename from docs/src/dev-env/images/vsc_remote_ssh_extension.png rename to docs/docs/dev-env/images/vsc_remote_ssh_extension.png diff --git a/docs/src/dev-env/images/vsc_server_started.png b/docs/docs/dev-env/images/vsc_server_started.png similarity index 100% rename from docs/src/dev-env/images/vsc_server_started.png rename to docs/docs/dev-env/images/vsc_server_started.png diff --git a/docs/src/dev-env/images/vsc_ssh_connect.png b/docs/docs/dev-env/images/vsc_ssh_connect.png similarity index 100% rename from docs/src/dev-env/images/vsc_ssh_connect.png rename to docs/docs/dev-env/images/vsc_ssh_connect.png diff --git a/docs/src/dev-env/images/vscode_C++_plugs_detail.png b/docs/docs/dev-env/images/vscode_C++_plugs_detail.png similarity index 100% rename from docs/src/dev-env/images/vscode_C++_plugs_detail.png rename to docs/docs/dev-env/images/vscode_C++_plugs_detail.png diff --git a/docs/src/dev-env/images/vscode_break_point.png b/docs/docs/dev-env/images/vscode_break_point.png similarity index 100% rename from docs/src/dev-env/images/vscode_break_point.png rename to docs/docs/dev-env/images/vscode_break_point.png diff --git a/docs/src/dev-env/images/vscode_build_ouput.png b/docs/docs/dev-env/images/vscode_build_ouput.png similarity index 100% rename from docs/src/dev-env/images/vscode_build_ouput.png rename to docs/docs/dev-env/images/vscode_build_ouput.png diff --git a/docs/src/dev-env/images/vscode_cmake.png b/docs/docs/dev-env/images/vscode_cmake.png similarity index 100% rename from docs/src/dev-env/images/vscode_cmake.png rename to docs/docs/dev-env/images/vscode_cmake.png diff --git a/docs/src/dev-env/images/vscode_debug_miniob.png b/docs/docs/dev-env/images/vscode_debug_miniob.png similarity index 100% rename from docs/src/dev-env/images/vscode_debug_miniob.png rename to docs/docs/dev-env/images/vscode_debug_miniob.png diff --git a/docs/src/dev-env/images/vscode_search_plugs.png b/docs/docs/dev-env/images/vscode_search_plugs.png similarity index 100% rename from docs/src/dev-env/images/vscode_search_plugs.png rename to docs/docs/dev-env/images/vscode_search_plugs.png diff --git a/docs/src/dev-env/images/windows-enable-disable-functions.png b/docs/docs/dev-env/images/windows-enable-disable-functions.png similarity index 100% rename from docs/src/dev-env/images/windows-enable-disable-functions.png rename to docs/docs/dev-env/images/windows-enable-disable-functions.png diff --git a/docs/src/dev-env/images/windows-enable-service.png b/docs/docs/dev-env/images/windows-enable-service.png similarity index 100% rename from docs/src/dev-env/images/windows-enable-service.png rename to docs/docs/dev-env/images/windows-enable-service.png diff --git a/docs/src/dev-env/images/windows-functions.png b/docs/docs/dev-env/images/windows-functions.png similarity index 100% rename from docs/src/dev-env/images/windows-functions.png rename to docs/docs/dev-env/images/windows-functions.png diff --git a/docs/src/dev-env/images/windows-search-service.png b/docs/docs/dev-env/images/windows-search-service.png similarity index 100% rename from docs/src/dev-env/images/windows-search-service.png rename to docs/docs/dev-env/images/windows-search-service.png diff --git a/docs/src/dev-env/images/windows-terminal-mutli-shell.png b/docs/docs/dev-env/images/windows-terminal-mutli-shell.png similarity index 100% rename from docs/src/dev-env/images/windows-terminal-mutli-shell.png rename to docs/docs/dev-env/images/windows-terminal-mutli-shell.png diff --git a/docs/src/dev-env/images/windows-terminal.png b/docs/docs/dev-env/images/windows-terminal.png similarity index 100% rename from docs/src/dev-env/images/windows-terminal.png rename to docs/docs/dev-env/images/windows-terminal.png diff --git a/docs/src/dev-env/images/windows-wsl.png b/docs/docs/dev-env/images/windows-wsl.png similarity index 100% rename from docs/src/dev-env/images/windows-wsl.png rename to docs/docs/dev-env/images/windows-wsl.png diff --git a/docs/src/dev-env/introduction.md b/docs/docs/dev-env/introduction.md similarity index 96% rename from docs/src/dev-env/introduction.md rename to docs/docs/dev-env/introduction.md index 31c287de9..0633594fd 100644 --- a/docs/src/dev-env/introduction.md +++ b/docs/docs/dev-env/introduction.md @@ -1,3 +1,7 @@ +--- +title: 开发环境介绍 +--- + # 搭建开发环境 MiniOB 当前可以在Linux/MacOS上编译,所以开发环境最好是Linux或者MacOS。Windows上可以使用WSL2,或者使用Docker。这里有几个文档,大家可以参考并选择自己的开发环境。另外,很多同学喜欢使用visual studio code开发,MiniOB 中也将vscode的一些配置文件放在了仓库中,比如 .vscode/tasks.json 和 .vscode/launch.json,可以参考使用。 diff --git a/docs/src/dev-env/miniob-how-to-debug.md b/docs/docs/dev-env/miniob-how-to-debug.md similarity index 99% rename from docs/src/dev-env/miniob-how-to-debug.md rename to docs/docs/dev-env/miniob-how-to-debug.md index 24389d17e..75315bf20 100644 --- a/docs/src/dev-env/miniob-how-to-debug.md +++ b/docs/docs/dev-env/miniob-how-to-debug.md @@ -1,6 +1,9 @@ -# miniob调试篇 +--- +title: 调试 +author: caizj +--- --- by caizj +# miniob调试篇 调试c/c++程序,常用的有两种方式,一是打印日志调试,二是gdb调试,调试不仅可以定位问题,也可以用来熟悉代码。 diff --git a/docs/src/game/debug-output.md b/docs/docs/game/debug-output.md similarity index 97% rename from docs/src/game/debug-output.md rename to docs/docs/game/debug-output.md index 4bcfa3d80..7f9b5df4b 100644 --- a/docs/src/game/debug-output.md +++ b/docs/docs/game/debug-output.md @@ -1,3 +1,7 @@ +--- +title: 输出调试信息 +--- + 本篇文档介绍如何向[训练营](https://open.oceanbase.com/train)输出调试信息。 在使用训练营提交测试时,有时候会遇到本地环境没有问题,但是训练营上的输出总是不符合预期。但是训练营没有办法调试,这时候就需要在训练营上输出调试信息,以便于定位问题。 diff --git a/docs/src/game/gitee-instructions.md b/docs/docs/game/gitee-instructions.md similarity index 98% rename from docs/src/game/gitee-instructions.md rename to docs/docs/game/gitee-instructions.md index 69d007bfb..418fe584a 100644 --- a/docs/src/game/gitee-instructions.md +++ b/docs/docs/game/gitee-instructions.md @@ -1,3 +1,7 @@ +--- +title: MiniOB Gitee 在训练营中的使用说明 +--- + # MiniOB Gitee 在训练营中的使用说明 实战 MiniOB 编程需要在 Gitee 上创建自己的 private 仓库,在开发完成后,将代码提交到自己的仓库中,然后在训练营中进行测试。 diff --git a/docs/src/game/github-introduction.md b/docs/docs/game/github-introduction.md similarity index 70% rename from docs/src/game/github-introduction.md rename to docs/docs/game/github-introduction.md index 8fdc22812..3b1954a9f 100644 --- a/docs/src/game/github-introduction.md +++ b/docs/docs/game/github-introduction.md @@ -1,5 +1,11 @@ +--- +title: MiniOB GitHub 在训练营中的使用说明 +--- + # MiniOB GitHub 在训练营中的使用说明 +## 简介 + 训练营测试后端现在支持使用 [GitHub](https://github.com) 和 [Gitee](https://gitee.com) 作为代码仓库管理平台。 本文介绍如何在GitHub上创建私有仓库,并将MiniOB代码提交到自己的仓库中,然后在训练营中进行测试。 @@ -10,13 +16,15 @@ MiniOB 仓库地址: ## GitHub 私有仓库创建 +**NOTE** 一定要使用私有仓库进行测试。 + 首先你要有一个自己的GitHub账号。账号的注册流程比较简单,没有账号的同学登录GitHub网站创建即可。 1. 登录GitHub网站,并登录自己的账号 2. 在网站右上角点击 "Import Repository" -Import Repository +![Import Repository](images/github-import-repository.png) 3. 填写导入表单 @@ -26,39 +34,39 @@ MiniOB 仓库地址: https://github.com/oceanbase/miniob ``` -fill out begin import form +![fill out begin import form](images/github-begin-import-form.png) 4. 点击"Begin import"按钮,开始导入仓库 导入会花费一定时间,导入完成后,可以看到: -import done +![import done](images/github-import-done.png) 5. 查看仓库首页 点击"Code" 标签,就可以进入到仓库首页。 -view repo +![view repo](images/github-view-repo.png) 6. 邀请OceanBase测试账号 点击"Settings"标签,进入仓库设置页面,点击"Collaborators"标签,进入仓库权限管理页面。 -add people +![add people](images/github-add-people.png) 在"Search by username, full name or email address"中输入"oceanbase-ce-game-test"(官方测试账号),点击"Add collaborator"按钮,即可将OceanBase测试账号添加到仓库中。 -add tester +![add tester](images/github-add-tester.png) -add tester2 +![add tester2](images/github-add-tester-2.png) GitHub 在邀请别人加入仓库时,会发送邮件通知被邀请人,需要对方同意后,才能加入。 因此这个步骤需要等待,官方测试人员会定期刷新邮件处理邀请。如果长时间没有看到邀请成功的信息,请联系官方人员。 也可以直接将邀请链接发送给官方人员,邀请链接可以点击"Pending invite" 右侧的方形按钮复制。 -pending invite +![pending invite](images/github-pending-invite.png) -invite success +![invite success](images/images/github-invite-success.png) 7. 提交测试 diff --git a/docs/src/game/images/add-members.png b/docs/docs/game/images/add-members.png similarity index 100% rename from docs/src/game/images/add-members.png rename to docs/docs/game/images/add-members.png diff --git a/docs/src/game/images/create-repo.png b/docs/docs/game/images/create-repo.png similarity index 100% rename from docs/src/game/images/create-repo.png rename to docs/docs/game/images/create-repo.png diff --git a/docs/src/game/images/create-repo2.png b/docs/docs/game/images/create-repo2.png similarity index 100% rename from docs/src/game/images/create-repo2.png rename to docs/docs/game/images/create-repo2.png diff --git a/docs/src/game/images/github-add-people.png b/docs/docs/game/images/github-add-people.png similarity index 100% rename from docs/src/game/images/github-add-people.png rename to docs/docs/game/images/github-add-people.png diff --git a/docs/src/game/images/github-add-tester-2.png b/docs/docs/game/images/github-add-tester-2.png similarity index 100% rename from docs/src/game/images/github-add-tester-2.png rename to docs/docs/game/images/github-add-tester-2.png diff --git a/docs/src/game/images/github-add-tester.png b/docs/docs/game/images/github-add-tester.png similarity index 100% rename from docs/src/game/images/github-add-tester.png rename to docs/docs/game/images/github-add-tester.png diff --git a/docs/src/game/images/github-begin-import-form.png b/docs/docs/game/images/github-begin-import-form.png similarity index 100% rename from docs/src/game/images/github-begin-import-form.png rename to docs/docs/game/images/github-begin-import-form.png diff --git a/docs/src/game/images/github-import-done.png b/docs/docs/game/images/github-import-done.png similarity index 100% rename from docs/src/game/images/github-import-done.png rename to docs/docs/game/images/github-import-done.png diff --git a/docs/src/game/images/github-import-repository.png b/docs/docs/game/images/github-import-repository.png similarity index 100% rename from docs/src/game/images/github-import-repository.png rename to docs/docs/game/images/github-import-repository.png diff --git a/docs/src/game/images/github-invite-success.png b/docs/docs/game/images/github-invite-success.png similarity index 100% rename from docs/src/game/images/github-invite-success.png rename to docs/docs/game/images/github-invite-success.png diff --git a/docs/src/game/images/github-pending-invite.png b/docs/docs/game/images/github-pending-invite.png similarity index 100% rename from docs/src/game/images/github-pending-invite.png rename to docs/docs/game/images/github-pending-invite.png diff --git a/docs/src/game/images/github-view-repo.png b/docs/docs/game/images/github-view-repo.png similarity index 100% rename from docs/src/game/images/github-view-repo.png rename to docs/docs/game/images/github-view-repo.png diff --git a/docs/src/game/images/invite-users.png b/docs/docs/game/images/invite-users.png similarity index 100% rename from docs/src/game/images/invite-users.png rename to docs/docs/game/images/invite-users.png diff --git a/docs/src/game/images/reporter.png b/docs/docs/game/images/reporter.png similarity index 100% rename from docs/src/game/images/reporter.png rename to docs/docs/game/images/reporter.png diff --git a/docs/src/game/introduction.md b/docs/docs/game/introduction.md similarity index 98% rename from docs/src/game/introduction.md rename to docs/docs/game/introduction.md index 1474bfc1e..920b70bbd 100644 --- a/docs/src/game/introduction.md +++ b/docs/docs/game/introduction.md @@ -1,3 +1,7 @@ +--- +title: OceanBase 数据库大赛 +--- + > ***注意*** 由于最新代码的事务模型与2022年已经不同,因此最新代码不能通过MiniOB-2022的训练营测试的basic用例,但是不影响做其它的用例测试。同学们遇到官方代码无法通过MiniOB-2022的basic用例,请忽略。 # OceanBase 数据库大赛 diff --git a/docs/src/game/miniob-date-implementation.md b/docs/docs/game/miniob-date-implementation.md similarity index 99% rename from docs/src/game/miniob-date-implementation.md rename to docs/docs/game/miniob-date-implementation.md index 2875347bf..a64fd51cb 100644 --- a/docs/src/game/miniob-date-implementation.md +++ b/docs/docs/game/miniob-date-implementation.md @@ -1,9 +1,12 @@ +--- +title: Date 实现解析 +author: caizj +--- + # Date实现解析 > 此实现解析有往届选手提供。具体代码实现已经有所变更,因此仅供参考。 -- by caizj - ## DATE的存储 diff --git a/docs/src/game/miniob-drop-table-implementation.md b/docs/docs/game/miniob-drop-table-implementation.md similarity index 99% rename from docs/src/game/miniob-drop-table-implementation.md rename to docs/docs/game/miniob-drop-table-implementation.md index 62017f27e..f7ad93519 100644 --- a/docs/src/game/miniob-drop-table-implementation.md +++ b/docs/docs/game/miniob-drop-table-implementation.md @@ -1,3 +1,7 @@ +--- +title: Drop table 实现解析 +--- + # miniob - drop table 实现解析 > 此实现解析有往届选手提供。具体代码实现已经有所变更,因此仅供参考。 diff --git a/docs/src/game/miniob-memtracer.md b/docs/docs/game/miniob-memtracer.md similarity index 99% rename from docs/src/game/miniob-memtracer.md rename to docs/docs/game/miniob-memtracer.md index 25603f73f..4b50def87 100644 --- a/docs/src/game/miniob-memtracer.md +++ b/docs/docs/game/miniob-memtracer.md @@ -1,3 +1,6 @@ +--- +title: MemTracer 内存监控 +--- # MemTracer MemTracer 是一个动态链接库,被用于监控 MiniOB 内存使用;用于在内存受限的条件下,运行和调试 MiniOB。MemTracer 通过 hook 内存分配释放函数,记录 MiniOB 进程中的内存分配情况。 diff --git a/docs/src/game/miniob-output-convention.md b/docs/docs/game/miniob-output-convention.md similarity index 99% rename from docs/src/game/miniob-output-convention.md rename to docs/docs/game/miniob-output-convention.md index 7c59a8341..15999d0c8 100644 --- a/docs/src/game/miniob-output-convention.md +++ b/docs/docs/game/miniob-output-convention.md @@ -1,3 +1,6 @@ +--- +title: 输出规范 +--- 对于比赛和训练营测试后台,需要做一些输出约定,才能正确的进行测试。 diff --git a/docs/src/game/miniob-test-comment-date.md b/docs/docs/game/miniob-test-comment-date.md similarity index 98% rename from docs/src/game/miniob-test-comment-date.md rename to docs/docs/game/miniob-test-comment-date.md index 02abe2542..e6d55d146 100644 --- a/docs/src/game/miniob-test-comment-date.md +++ b/docs/docs/game/miniob-test-comment-date.md @@ -1,3 +1,6 @@ +--- +title: Date 测试解说 +--- > 此实现解析有往届选手提供。具体代码实现已经有所变更,因此仅供参考。 diff --git a/docs/src/game/miniob_topics.md b/docs/docs/game/miniob_topics.md similarity index 99% rename from docs/src/game/miniob_topics.md rename to docs/docs/game/miniob_topics.md index eb1c034b2..299b5eb89 100644 --- a/docs/src/game/miniob_topics.md +++ b/docs/docs/game/miniob_topics.md @@ -1,3 +1,7 @@ +--- +title: OceanBase 数据库大赛2021届题目 +--- + miniob 题目 # 背景 diff --git a/docs/src/how_to_build.md b/docs/docs/how_to_build.md similarity index 93% rename from docs/src/how_to_build.md rename to docs/docs/how_to_build.md index b1555a559..acddb4ffc 100644 --- a/docs/src/how_to_build.md +++ b/docs/docs/how_to_build.md @@ -1,3 +1,7 @@ +--- +title: 如何编译 +--- + # 如何编译 ## 0. base @@ -52,7 +56,7 @@ bash build.sh release ### 1. sudo找不到cmake -#### Q: +**Q:** 在“1. 环境初始化”中执行命令: @@ -66,15 +70,15 @@ sudo bash build.sh init build.sh: line xx: cmake: command not found ``` -#### A: +**A:** -##### 1. 检查“0. base”中cmake版本要求是否满足。 +- 1. 检查“0. base”中cmake版本要求是否满足。 ```bash cmake --version ``` -##### 2. 检查是否出现了“Linux系统下执行sudo命令环境变量失效现象”。 +- 2. 检查是否出现了“Linux系统下执行sudo命令环境变量失效现象”。 ***检查*** @@ -128,7 +132,7 @@ sudo bash build.sh init 则不会因为找不到cmake而报错。 -##### 更多信息: +**更多信息:** 关于该问题的更多细节,请参考[问题来源](https://ask.oceanbase.com/t/topic/35604437/7)。 关于该问题的进一步分析,请参考[Linux系统下执行sudo命令环境变量失效现象](https://zhuanlan.zhihu.com/p/669332689)。 diff --git a/docs/src/how_to_run.md b/docs/docs/how_to_run.md similarity index 99% rename from docs/src/how_to_run.md rename to docs/docs/how_to_run.md index 4e7ce5336..dc421ba10 100644 --- a/docs/src/how_to_run.md +++ b/docs/docs/how_to_run.md @@ -1,3 +1,7 @@ +--- +title: 如何运行 +--- + # 如何运行 编译完成后,可以在build目录(可能是build_debug或build_release)下找到bin/observer,就是我们的服务端程序,bin/obclient是自带的客户端程序。 diff --git a/docs/src/images/miniob-introduction-running-the-client.png b/docs/docs/images/miniob-introduction-running-the-client.png similarity index 100% rename from docs/src/images/miniob-introduction-running-the-client.png rename to docs/docs/images/miniob-introduction-running-the-client.png diff --git a/docs/src/images/miniob-introduction-running-the-server.png b/docs/docs/images/miniob-introduction-running-the-server.png similarity index 100% rename from docs/src/images/miniob-introduction-running-the-server.png rename to docs/docs/images/miniob-introduction-running-the-server.png diff --git a/docs/src/images/miniob-introduction-sql-flow.png b/docs/docs/images/miniob-introduction-sql-flow.png similarity index 100% rename from docs/src/images/miniob-introduction-sql-flow.png rename to docs/docs/images/miniob-introduction-sql-flow.png diff --git a/docs/src/miniob-introduction.md b/docs/docs/index.md similarity index 97% rename from docs/src/miniob-introduction.md rename to docs/docs/index.md index 3deabe7aa..694167efa 100644 --- a/docs/src/miniob-introduction.md +++ b/docs/docs/index.md @@ -1,3 +1,11 @@ +--- +title: MiniOB 介绍 +hide: + - navigation + - toc + - path +--- + # MiniOB 介绍 MiniOB 是 [OceanBase](https://github.com/oceanbase/oceanbase) 团队基于华中科技大学数据库课程原型,联合多所高校重新开发的、专为零基础的同学设计的数据库入门学习项目。我们的目标是为在校学生、数据库从业者、爱好者或对基础技术感兴趣的人提供一个友好的数据库学习项目。 @@ -25,7 +33,7 @@ MiniOB 提供了丰富的设计文档和代码注释。如果在阅读代码过 ## 系统架构 -InternalNode +![MiniOB 架构](./design/images/miniob-architecture.svg) 其中: diff --git a/docs/src/lectures/copyright.md b/docs/docs/lectures/copyright.md similarity index 97% rename from docs/src/lectures/copyright.md rename to docs/docs/lectures/copyright.md index 685063a54..bc5b431d4 100644 --- a/docs/src/lectures/copyright.md +++ b/docs/docs/lectures/copyright.md @@ -1,3 +1,7 @@ +--- +title: 版权声明 +--- + # 版权声明 本版权声明仅针对《数据库管理系统实现基础讲义》(以下简称“本教材”)的所有内容。 diff --git a/docs/src/lectures/images/1-1.png b/docs/docs/lectures/images/1-1.png similarity index 100% rename from docs/src/lectures/images/1-1.png rename to docs/docs/lectures/images/1-1.png diff --git a/docs/src/lectures/images/1.3.1.3-1.png b/docs/docs/lectures/images/1.3.1.3-1.png similarity index 100% rename from docs/src/lectures/images/1.3.1.3-1.png rename to docs/docs/lectures/images/1.3.1.3-1.png diff --git a/docs/src/lectures/images/1.3.1.3-2.png b/docs/docs/lectures/images/1.3.1.3-2.png similarity index 100% rename from docs/src/lectures/images/1.3.1.3-2.png rename to docs/docs/lectures/images/1.3.1.3-2.png diff --git a/docs/src/lectures/images/2-1.png b/docs/docs/lectures/images/2-1.png similarity index 100% rename from docs/src/lectures/images/2-1.png rename to docs/docs/lectures/images/2-1.png diff --git a/docs/src/lectures/images/2-2.png b/docs/docs/lectures/images/2-2.png similarity index 100% rename from docs/src/lectures/images/2-2.png rename to docs/docs/lectures/images/2-2.png diff --git a/docs/src/lectures/images/2-3.png b/docs/docs/lectures/images/2-3.png similarity index 100% rename from docs/src/lectures/images/2-3.png rename to docs/docs/lectures/images/2-3.png diff --git a/docs/src/lectures/images/2-4.png b/docs/docs/lectures/images/2-4.png similarity index 100% rename from docs/src/lectures/images/2-4.png rename to docs/docs/lectures/images/2-4.png diff --git a/docs/src/lectures/images/2-5.png b/docs/docs/lectures/images/2-5.png similarity index 100% rename from docs/src/lectures/images/2-5.png rename to docs/docs/lectures/images/2-5.png diff --git a/docs/src/lectures/images/2-6.png b/docs/docs/lectures/images/2-6.png similarity index 100% rename from docs/src/lectures/images/2-6.png rename to docs/docs/lectures/images/2-6.png diff --git a/docs/src/lectures/images/2-7.png b/docs/docs/lectures/images/2-7.png similarity index 100% rename from docs/src/lectures/images/2-7.png rename to docs/docs/lectures/images/2-7.png diff --git a/docs/src/lectures/images/2-8.png b/docs/docs/lectures/images/2-8.png similarity index 100% rename from docs/src/lectures/images/2-8.png rename to docs/docs/lectures/images/2-8.png diff --git a/docs/src/lectures/images/3-1.png b/docs/docs/lectures/images/3-1.png similarity index 100% rename from docs/src/lectures/images/3-1.png rename to docs/docs/lectures/images/3-1.png diff --git a/docs/src/lectures/images/3-2-a.png b/docs/docs/lectures/images/3-2-a.png similarity index 100% rename from docs/src/lectures/images/3-2-a.png rename to docs/docs/lectures/images/3-2-a.png diff --git a/docs/src/lectures/images/3-2-b.png b/docs/docs/lectures/images/3-2-b.png similarity index 100% rename from docs/src/lectures/images/3-2-b.png rename to docs/docs/lectures/images/3-2-b.png diff --git a/docs/src/lectures/images/3-2-c.png b/docs/docs/lectures/images/3-2-c.png similarity index 100% rename from docs/src/lectures/images/3-2-c.png rename to docs/docs/lectures/images/3-2-c.png diff --git a/docs/src/lectures/images/3-3-a.png b/docs/docs/lectures/images/3-3-a.png similarity index 100% rename from docs/src/lectures/images/3-3-a.png rename to docs/docs/lectures/images/3-3-a.png diff --git a/docs/src/lectures/images/3-3-b.png b/docs/docs/lectures/images/3-3-b.png similarity index 100% rename from docs/src/lectures/images/3-3-b.png rename to docs/docs/lectures/images/3-3-b.png diff --git a/docs/src/lectures/images/3-3-c.png b/docs/docs/lectures/images/3-3-c.png similarity index 100% rename from docs/src/lectures/images/3-3-c.png rename to docs/docs/lectures/images/3-3-c.png diff --git a/docs/src/lectures/images/3-4.png b/docs/docs/lectures/images/3-4.png similarity index 100% rename from docs/src/lectures/images/3-4.png rename to docs/docs/lectures/images/3-4.png diff --git a/docs/src/lectures/images/3-5.png b/docs/docs/lectures/images/3-5.png similarity index 100% rename from docs/src/lectures/images/3-5.png rename to docs/docs/lectures/images/3-5.png diff --git a/docs/src/lectures/images/3-6-a.png b/docs/docs/lectures/images/3-6-a.png similarity index 100% rename from docs/src/lectures/images/3-6-a.png rename to docs/docs/lectures/images/3-6-a.png diff --git a/docs/src/lectures/images/3-6-b.png b/docs/docs/lectures/images/3-6-b.png similarity index 100% rename from docs/src/lectures/images/3-6-b.png rename to docs/docs/lectures/images/3-6-b.png diff --git a/docs/src/lectures/images/3-7-a.png b/docs/docs/lectures/images/3-7-a.png similarity index 100% rename from docs/src/lectures/images/3-7-a.png rename to docs/docs/lectures/images/3-7-a.png diff --git a/docs/src/lectures/images/3-7-b.png b/docs/docs/lectures/images/3-7-b.png similarity index 100% rename from docs/src/lectures/images/3-7-b.png rename to docs/docs/lectures/images/3-7-b.png diff --git a/docs/src/lectures/images/3-7-c.png b/docs/docs/lectures/images/3-7-c.png similarity index 100% rename from docs/src/lectures/images/3-7-c.png rename to docs/docs/lectures/images/3-7-c.png diff --git a/docs/src/lectures/images/4-1.png b/docs/docs/lectures/images/4-1.png similarity index 100% rename from docs/src/lectures/images/4-1.png rename to docs/docs/lectures/images/4-1.png diff --git a/docs/src/lectures/images/4-2.png b/docs/docs/lectures/images/4-2.png similarity index 100% rename from docs/src/lectures/images/4-2.png rename to docs/docs/lectures/images/4-2.png diff --git a/docs/src/lectures/images/4-3.png b/docs/docs/lectures/images/4-3.png similarity index 100% rename from docs/src/lectures/images/4-3.png rename to docs/docs/lectures/images/4-3.png diff --git a/docs/src/lectures/images/4-4.png b/docs/docs/lectures/images/4-4.png similarity index 100% rename from docs/src/lectures/images/4-4.png rename to docs/docs/lectures/images/4-4.png diff --git a/docs/src/lectures/images/4-5.png b/docs/docs/lectures/images/4-5.png similarity index 100% rename from docs/src/lectures/images/4-5.png rename to docs/docs/lectures/images/4-5.png diff --git a/docs/src/lectures/images/4-6.png b/docs/docs/lectures/images/4-6.png similarity index 100% rename from docs/src/lectures/images/4-6.png rename to docs/docs/lectures/images/4-6.png diff --git a/docs/src/lectures/images/5-1.png b/docs/docs/lectures/images/5-1.png similarity index 100% rename from docs/src/lectures/images/5-1.png rename to docs/docs/lectures/images/5-1.png diff --git a/docs/src/lectures/images/5.2.1.1-1.png b/docs/docs/lectures/images/5.2.1.1-1.png similarity index 100% rename from docs/src/lectures/images/5.2.1.1-1.png rename to docs/docs/lectures/images/5.2.1.1-1.png diff --git a/docs/src/lectures/images/5.2.1.1-2.png b/docs/docs/lectures/images/5.2.1.1-2.png similarity index 100% rename from docs/src/lectures/images/5.2.1.1-2.png rename to docs/docs/lectures/images/5.2.1.1-2.png diff --git a/docs/src/lectures/images/5.2.1.1-3.png b/docs/docs/lectures/images/5.2.1.1-3.png similarity index 100% rename from docs/src/lectures/images/5.2.1.1-3.png rename to docs/docs/lectures/images/5.2.1.1-3.png diff --git a/docs/src/lectures/images/5.2.1.1-4.png b/docs/docs/lectures/images/5.2.1.1-4.png similarity index 100% rename from docs/src/lectures/images/5.2.1.1-4.png rename to docs/docs/lectures/images/5.2.1.1-4.png diff --git a/docs/src/lectures/images/5.2.2.1-1.png b/docs/docs/lectures/images/5.2.2.1-1.png similarity index 100% rename from docs/src/lectures/images/5.2.2.1-1.png rename to docs/docs/lectures/images/5.2.2.1-1.png diff --git a/docs/src/lectures/images/5.3.1.1-4.png b/docs/docs/lectures/images/5.3.1.1-4.png similarity index 100% rename from docs/src/lectures/images/5.3.1.1-4.png rename to docs/docs/lectures/images/5.3.1.1-4.png diff --git a/docs/src/lectures/images/6-1.png b/docs/docs/lectures/images/6-1.png similarity index 100% rename from docs/src/lectures/images/6-1.png rename to docs/docs/lectures/images/6-1.png diff --git a/docs/src/lectures/images/6-2.png b/docs/docs/lectures/images/6-2.png similarity index 100% rename from docs/src/lectures/images/6-2.png rename to docs/docs/lectures/images/6-2.png diff --git a/docs/src/lectures/images/6-3.png b/docs/docs/lectures/images/6-3.png similarity index 100% rename from docs/src/lectures/images/6-3.png rename to docs/docs/lectures/images/6-3.png diff --git a/docs/src/lectures/images/6-4.png b/docs/docs/lectures/images/6-4.png similarity index 100% rename from docs/src/lectures/images/6-4.png rename to docs/docs/lectures/images/6-4.png diff --git a/docs/src/lectures/index.md b/docs/docs/lectures/index.md similarity index 100% rename from docs/src/lectures/index.md rename to docs/docs/lectures/index.md diff --git a/docs/src/lectures/lecture-1.md b/docs/docs/lectures/lecture-1.md similarity index 99% rename from docs/src/lectures/lecture-1.md rename to docs/docs/lectures/lecture-1.md index 992ba3290..a384d4893 100644 --- a/docs/src/lectures/lecture-1.md +++ b/docs/docs/lectures/lecture-1.md @@ -1,3 +1,7 @@ +--- +title: 第1章 数据库管理系统概述 +--- + # 第1章 数据库管理系统概述 ## 1.1 课程简介 diff --git a/docs/src/lectures/lecture-2.md b/docs/docs/lectures/lecture-2.md similarity index 99% rename from docs/src/lectures/lecture-2.md rename to docs/docs/lectures/lecture-2.md index 44844227e..0b2c8ce51 100644 --- a/docs/src/lectures/lecture-2.md +++ b/docs/docs/lectures/lecture-2.md @@ -1,3 +1,6 @@ +--- +title: 第2章 数据库的存储结构 +--- # 第2章 数据库的存储结构 diff --git a/docs/src/lectures/lecture-3.md b/docs/docs/lectures/lecture-3.md similarity index 99% rename from docs/src/lectures/lecture-3.md rename to docs/docs/lectures/lecture-3.md index 944944dc4..0a31bd3b2 100644 --- a/docs/src/lectures/lecture-3.md +++ b/docs/docs/lectures/lecture-3.md @@ -1,3 +1,6 @@ +--- +title: 第3章 索引结构 +--- # 第3章 索引结构 diff --git a/docs/src/lectures/lecture-4.md b/docs/docs/lectures/lecture-4.md similarity index 99% rename from docs/src/lectures/lecture-4.md rename to docs/docs/lectures/lecture-4.md index 070a0b809..51dddaf2a 100644 --- a/docs/src/lectures/lecture-4.md +++ b/docs/docs/lectures/lecture-4.md @@ -1,3 +1,6 @@ +--- +title: 第4章 查询处理 +--- # 第4章 查询处理 diff --git a/docs/src/lectures/lecture-5.md b/docs/docs/lectures/lecture-5.md similarity index 99% rename from docs/src/lectures/lecture-5.md rename to docs/docs/lectures/lecture-5.md index 6951f35df..2c90217ad 100644 --- a/docs/src/lectures/lecture-5.md +++ b/docs/docs/lectures/lecture-5.md @@ -1,3 +1,6 @@ +--- +title: 第5章 查询优化 +--- # 第5章 查询优化 diff --git a/docs/src/lectures/lecture-6.md b/docs/docs/lectures/lecture-6.md similarity index 99% rename from docs/src/lectures/lecture-6.md rename to docs/docs/lectures/lecture-6.md index 01daef4e1..7683ab492 100644 --- a/docs/src/lectures/lecture-6.md +++ b/docs/docs/lectures/lecture-6.md @@ -1,3 +1,6 @@ +--- +title: 第6章 事务处理 +--- # 第6章 事务处理 diff --git a/docs/src/lectures/references.md b/docs/docs/lectures/references.md similarity index 95% rename from docs/src/lectures/references.md rename to docs/docs/lectures/references.md index 3ee5fb078..d0a65e903 100644 --- a/docs/src/lectures/references.md +++ b/docs/docs/lectures/references.md @@ -1,3 +1,7 @@ +--- +title: 参考资料 +--- + # 参考资料 1. 王珊, 萨师煊. 数据库系统概论(第5版). 北京: 高等教育出版社, 2014 diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 000000000..6fa8c8234 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,122 @@ +site_name: MiniOB +site_url: https://oceanbase.github.io/miniob +repo_url: https://github.com/oceanbase/miniob +repo_name: oceanbase/miniob +edit_uri: edit/main/docs/docs/ +copyright: Copyright © 2024 OceanBase +plugins: + - search + - git-authors +nav: + - 首页: index.md + - 快速开始: + - 编译: how_to_build.md + - 运行: how_to_run.md + - 开发环境: + - dev-env/introduction.md + - dev-env/dev_by_gitpod.md + - dev-env/how-to-dev-using-docker.md + - dev-env/how_to_dev_in_docker_container_by_vscode.md + - dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md + - dev-env/how_to_dev_miniob_by_docker_on_windows.md + - dev-env/how_to_dev_miniob_by_vscode.md + - dev-env/miniob-how-to-debug.md + - 设计文档: + - design/miniob-architecture.md + - design/miniob-buffer-pool.md + - design/miniob-double-write-buffer.md + - design/miniob-transaction.md + - design/miniob-durability.md + - design/miniob-sql-parser.md + - design/miniob-how-to-add-new-sql.md + - design/miniob-sql-expression.md + - design/miniob-bplus-tree.md + - design/miniob-bplus-tree-concurrency.md + - design/miniob-thread-model.md + - design/miniob-mysql-protocol.md + - Doxy 代码文档: design/doxy/html/index.html + - OceanBase 数据库大赛: + - game/introduction.md + - game/miniob-output-convention.md + - game/debug-output.md + - game/miniob-memtracer.md + - game/miniob_topics.md + - game/github-introduction.md + - game/gitee-instructions.md + - game/miniob-test-comment-date.md + - game/miniob-date-implementation.md + - game/miniob-drop-table-implementation.md + - 数据库实现简明教程: + - lectures/copyright.md + - lectures/lecture-1.md + - lectures/lecture-2.md + - lectures/lecture-3.md + - lectures/lecture-4.md + - lectures/lecture-5.md + - lectures/lecture-6.md + - lectures/references.md + - 博客: + - blog/introduction.md + - blog/1.md + +markdown_extensions: + - pymdownx.highlight: + anchor_linenums: true + - pymdownx.inlinehilite + - pymdownx.snippets + - pymdownx.superfences + +theme: + name: material + language: zh + features: + - search.highlight + - navigation.sections + - navigation.path + - navigation.top + - navigation.instant + - navigation.tracking + - navigation.tabs + - navigation.tabs.sticky + - navigation.footer + - toc.follow + - content.code.copy + - content.action.edit + logo: assets/logo.png + favicon: assets/favicon.ico + icon: + repo: fontawesome/brands/github + palette: + + # Palette toggle for automatic mode + - media: "(prefers-color-scheme)" + toggle: + icon: material/brightness-auto + name: Switch to light mode + + # Palette toggle for light mode + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/brightness-7 + name: Switch to dark mode + + # Palette toggle for dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/brightness-4 + name: Switch to system preference + +extra: + social: + - icon: fontawesome/brands/github + link: https://github.com/oceanbase + - icon: fontawesome/brands/docker + link: https://hub.docker.com/r/oceanbase/miniob + - icon: fontawesome/brands/slack + link: https://join.slack.com/t/oceanbase/shared_invite/zt-1e25oz3ol-lJ6YNqPHaKwY_mhhioyEuw + +markdown_extensions: + - toc: + permalink: true diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..b5a5f8ec0 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,3 @@ +mkdocs-material +mkdocs-git-authors-plugin +mkdocs-glightbox \ No newline at end of file diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md deleted file mode 100644 index 577eceb1b..000000000 --- a/docs/src/SUMMARY.md +++ /dev/null @@ -1,52 +0,0 @@ -# Summary - -- [MiniOB 简介](./miniob-introduction.md) -- [如何编译](./how_to_build.md) -- [如何运行](./how_to_run.md) -- [开发环境搭建](./dev-env/introduction.md) - - [使用 GitPod 开发 MiniOB](./dev-env/dev_by_gitpod.md) - - [开发环境搭建(本地调试, 适用 Linux 和 Mac)](./dev-env/how_to_dev_miniob_by_vscode.md) - - [开发环境搭建(远程调试, 适用于 Window, Linux 和 Mac)](./dev-env/how_to_dev_in_docker_container_by_vscode.md) - - [Windows 使用Docker开发MiniOB](./dev-env/how_to_dev_miniob_by_docker_on_windows.md) - - [手把手教你在windows上用docker和vscode配置环境](./dev-env/how_to_dev_in_docker_container_by_vscode_on_windows.md) - - [使用Docker开发MiniOB](./dev-env/how-to-dev-using-docker.md) - - [MiniOB 调试](./dev-env/miniob-how-to-debug.md) - -- [功能模块设计说明文档](./design/introduction.md) - - [Miniob架构](./design/miniob-architecture.md) - - [存储实现](./design/miniob-buffer-pool.md) - - [Double Write Buffer](./design/miniob-double-write-buffer.md) - - [事务](./design/miniob-transaction.md) - - [持久化](./design/miniob-durability.md) - - [SQL Parser](./design/miniob-sql-parser.md) - - [如何新增支持一种新类型SQL](./design/miniob-how-to-add-new-sql.md) - - [表达式解析](./design/miniob-sql-expression.md) - - [B+树实现](./design/miniob-bplus-tree.md) - - [并发B+树实现](./design/miniob-bplus-tree-concurrency.md) - - [线程池模型](./design/miniob-thread-model.md) - - [通讯协议简介](./design/miniob-mysql-protocol.md) - - [Doxy代码文档](./design/doxy/html/index.html) - -- [OceanBase 数据库大赛](./game/introduction.md) - - [提交测试需要满足的输出要求](./game/miniob-output-convention.md) - - [自助输出调试信息](./game/debug-output.md) - - [2021届大赛题目介绍](./game/miniob_topics.md) - - [使用GitHub参加训练营](./game/github-introduction.md) - - [使用Gitee参加训练营](./game/gitee-instructions.md) - - [date 测试说明](./game/miniob-test-comment-date.md) - - [date 实现解析](./game/miniob-date-implementation.md) - - [drop table 实现解析](./game/miniob-drop-table-implementation.md) - - [内存使用监控相关功能介绍](./game/miniob-memtracer.md) - -- [数据库基础理论课程](./lectures/index.md) - - [版权声明](./lectures/copyright.md) - - [第1章 数据库管理系统概述](./lectures/lecture-1.md) - - [第2章 数据库的存储结构](./lectures/lecture-2.md) - - [第3章 索引结构](./lectures/lecture-3.md) - - [第4章 查询处理](./lectures/lecture-4.md) - - [第5章 查询优化](./lectures/lecture-5.md) - - [第6章 事务处理](./lectures/lecture-6.md) - - [参考资料](./lectures/references.md) - -- [Blog](./blog/introduction.md) - - [High-Performance Concurrency Control Mechanisms for Main-Memory Databases](./blog/1.md) \ No newline at end of file