Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add comment & delete unused file & improve user command processing logic #435

Merged
merged 51 commits into from
Aug 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
3d087f4
Fix compile error bug
Iam-WenYi Aug 10, 2024
236b2d7
Update pstd_hash.cc
AlexStocks Aug 10, 2024
b0ba5a1
update README.md, delete 'sh'
Iam-WenYi Aug 10, 2024
a630532
Add 'run' section to README.md & README_CN.md
Iam-WenYi Aug 10, 2024
f8e6833
Merge branch 'OpenAtomFoundation:unstable' into unstable
Iam-WenYi Aug 14, 2024
6be184e
完成 Rocky Linux 移植工作
Iam-WenYi Aug 14, 2024
d6aed9d
修订围绕 Rocky Linux 的论述
Iam-WenYi Aug 14, 2024
891201a
Imporve the CMakeLists.txt
Iam-WenYi Aug 16, 2024
ce5761a
update url_hash for all the extern library
Iam-WenYi Aug 18, 2024
5e3db10
Merge branch 'OpenAtomFoundation:unstable' into unstable
Iam-WenYi Aug 18, 2024
770fd84
Remove outdated and useless files, add appropriate comments, and impr…
Iam-WenYi Aug 21, 2024
704bf39
Merge
Iam-WenYi Aug 21, 2024
5023556
Merge branch 'OpenAtomFoundation:unstable' into unstable
Iam-WenYi Aug 21, 2024
8585d85
Improve format
Iam-WenYi Aug 21, 2024
bbceee4
Merge branch 'unstable' of https://github.com/IamJingZhang/pikiwidb i…
Iam-WenYi Aug 21, 2024
6e4119a
Improve format & Fix spelling bug
Iam-WenYi Aug 21, 2024
270b0fa
Improve format
Iam-WenYi Aug 21, 2024
1f8297b
Imporve format
Iam-WenYi Aug 21, 2024
144b337
Improve format
Iam-WenYi Aug 21, 2024
9bb2c65
Fix some wrong spell
Iam-WenYi Aug 21, 2024
a4d8f9d
Fix wrong spell
Iam-WenYi Aug 21, 2024
77e5abc
Fix bug
Iam-WenYi Aug 21, 2024
ae07cbf
Improve format & Fix error
Iam-WenYi Aug 21, 2024
70c3e12
Improve format
Iam-WenYi Aug 24, 2024
2a56e45
Improve format
Iam-WenYi Aug 24, 2024
401be34
Improve format
Iam-WenYi Aug 24, 2024
07836d5
Improve format
Iam-WenYi Aug 24, 2024
0464aaa
Improve format
Iam-WenYi Aug 24, 2024
ddbd27f
Improve format
Iam-WenYi Aug 24, 2024
052a5bb
Improve format
Iam-WenYi Aug 24, 2024
b01b5f6
Improve format
Iam-WenYi Aug 24, 2024
f8fa937
Improve format
Iam-WenYi Aug 24, 2024
c0ba837
Improve format
Iam-WenYi Aug 24, 2024
24e986e
Merge branch 'OpenAtomFoundation:unstable' into unstable
Iam-WenYi Aug 25, 2024
06cc3fb
Improve comment
Iam-WenYi Aug 25, 2024
ca3fa96
Improve comment
Iam-WenYi Aug 25, 2024
8fd276c
Improve comment
Iam-WenYi Aug 25, 2024
acc7d53
Improve comment
Iam-WenYi Aug 25, 2024
843aed4
Improve format
Iam-WenYi Aug 25, 2024
30ce48a
Improve comment
Iam-WenYi Aug 25, 2024
2abd531
Improve format
Iam-WenYi Aug 25, 2024
5786151
Merge branch 'OpenAtomFoundation:unstable' into unstable
Iam-WenYi Aug 25, 2024
84ecca7
Improve code
Iam-WenYi Aug 25, 2024
a973821
Merge
Iam-WenYi Aug 25, 2024
b5c2f71
Imporve code logic
Iam-WenYi Aug 25, 2024
025fdb6
Fix code bug
Iam-WenYi Aug 25, 2024
b69ee36
Fix code bug
Iam-WenYi Aug 25, 2024
accbb1c
Imporve code format
Iam-WenYi Aug 25, 2024
c232619
Fix code bug
Iam-WenYi Aug 25, 2024
cc5df28
Fix code bug
Iam-WenYi Aug 25, 2024
570acec
Improve code format
Iam-WenYi Aug 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Pikiwidb is compiled by default in release mode, which does not support debuggin
## Run

```bash
bin/pikiwidb etc/conf/pikiwidb.conf
./bin/pikiwidb ./etc/conf/pikiwidb.conf
```

## Support module for write your own extensions
Expand Down
2 changes: 1 addition & 1 deletion README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PikiwiDB 默认以 release 模式编译,不支持调试。如果需要调试
## 运行

```bash
bin/pikiwidb etc/conf/pikiwidb.conf
./bin/pikiwidb ./etc/conf/pikiwidb.conf
```

## 与 Redis 完全兼容
Expand Down
13 changes: 8 additions & 5 deletions src/base_cmd.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
Built the foundational classes for the design and expansion of commands.
*/

#include "base_cmd.h"

Expand Down Expand Up @@ -114,3 +116,4 @@ bool BaseCmdGroup::DoInitial(PClient* client) {
}

} // namespace pikiwidb
/* namespace pikiwidb */
10 changes: 6 additions & 4 deletions src/base_cmd.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined the open commands of PikiwiDB to the outside, the setting of permissions, and other aspects.
*/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/client.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Implemented a set of functions for interfacing with the client.
*/

#include "client.h"
Expand Down
11 changes: 7 additions & 4 deletions src/client.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a set of feedback codes, messages, and functions
related to handling client commands.
*/

#pragma once
Expand Down
15 changes: 11 additions & 4 deletions src/cmd_admin.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Many management-level commands are defined here.

Compared to the external commands at the user level,
the commands defined here are more focused on the overall
management of the PikiwiDB.

*/

#include "cmd_admin.h"
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_admin.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Stores the declarations of management commands.
*/

#pragma once
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_hash.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a set of functions for operating key-value pairs
in a hash table.
*/
#include "cmd_hash.h"

Expand Down
11 changes: 7 additions & 4 deletions src/cmd_hash.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Declared a set of functions for operating key-value pairs
in a hash table, which can be understood with reference to the principles of Redis HSET and other commands.
*/

#pragma once
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_keys.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
This file implements commands that focus on the keys in
key-value pairs, rather than the values.
*/

#include "cmd_keys.h"
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_keys.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
This file defines some functions and commands related
to key operations.
*/

#pragma once
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_kv.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Implemented a set of operation functions and commands
associated with key-value pairs.
*/

#include "cmd_kv.h"
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_kv.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a set of operation functions and commands related
to key-value pairs.
*/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_list.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Implemented a set of operation functions and commands related to lists.
*/

#include "cmd_list.h"
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_list.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a set of operation functions and commands related to lists.
*/

#pragma once
Expand Down
13 changes: 9 additions & 4 deletions src/cmd_raft.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
A set of instructions and functions related to Raft.

Defined a set of functions and instructions related to the
implementation of Raft, which is key to the distributed cluster implementation of PikiwiDB.
*/

#include "cmd_raft.h"
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_raft.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
The declarations of a set of instructions and functions
related to Raft are written here.
*/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_set.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
A set of instructions and functions related to set operations.
*/

#include "cmd_set.h"
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_set.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Declarations of a set of instructions and functions related
to set operations.
*/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_table_manager.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a command table for managing the commands themselves.
*/

#include "cmd_table_manager.h"
Expand Down
11 changes: 7 additions & 4 deletions src/cmd_table_manager.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Defined a command table, because PikiwiDB needs to manage
commands in an integrated way.
*/

#pragma once
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_thread_pool.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
A thread pool for managing commands has been implemented.
*/

#include "cmd_thread_pool.h"
Expand Down
13 changes: 9 additions & 4 deletions src/cmd_thread_pool.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
A thread pool for managing commands has been defined here.
*/

#pragma once
Expand All @@ -21,6 +23,9 @@ namespace pikiwidb {
// task interface
// inherit this class and implement the Run method
// then submit the task to the thread pool
/*
CmdThreadPoolTask
*/
class CmdThreadPoolTask {
public:
explicit CmdThreadPoolTask(std::shared_ptr<PClient> client) : client_(std::move(client)) {}
Expand Down
10 changes: 6 additions & 4 deletions src/cmd_thread_pool_worker.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory

/*
* Copyright (c) 2023-present, OpenAtom Foundation, Inc. All rights reserved.
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
Retrieve commands from the thread pool and execute them.
*/

#include "cmd_thread_pool_worker.h"
Expand Down
Loading
Loading