hanahmily commented on code in PR #292:
URL: 
https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250169014


##########
docs/concept/persistence-storage.md:
##########
@@ -15,40 +16,63 @@ The most common IO mode is Synchronous IO, but it has a 
relatively low throughpu
 ## Directory
 ### Create
 Create the specified directory and return an error if the directory already 
exists.
+The following is the pseudocode that calls the API in the go style.
+`createDirectory(name string) (error)`
 
 ### Delete
 Delete the directory and all files and return an error if the directory does 
not exist or the directory not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteDirectory(name string) (error)`
 
 ### Rename
 Rename the directory and return an error if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`renameDirectory(oldName string, newName string) (error)`
 
 ### Get Children
 Get all lists of files or children's directories in the directory and return 
an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`readDirectory(name string) (fileList, error)`
 
 ### Permission
 When creating a file, the default owner is the user who created the directory. 
The owner can specify read and write permissions of the directory. If not 
specified, the default is read and write permissions, which include permissions 
for all files in the directory.
+The following is the pseudocode that calls the API in the go style.
+`setDirectoryPermission(name string, permission string) (error)`
 
 ## File
 ### Write
 BanyanDB provides two methods for writing files.
 Append mode, which adds new data to the end of a file. This mode is typically 
used for WAL.
 Flush mode, which flushes all data to one or more files and can specify the 
size of each file to write to.
 It will return an error when writing a directory, the file does not exist or 
there is not enough space, and the incomplete file will be discarded.
+The following is the pseudocode that calls the API in the go style.
+`writeFile(file File,data []byte) (error)`
+`writeFile(files list,data []byte, int filesize) (error)`

Review Comment:
   Which is for the append mode?



##########
docs/concept/persistence-storage.md:
##########
@@ -15,40 +16,63 @@ The most common IO mode is Synchronous IO, but it has a 
relatively low throughpu
 ## Directory
 ### Create
 Create the specified directory and return an error if the directory already 
exists.
+The following is the pseudocode that calls the API in the go style.
+`createDirectory(name string) (error)`
 
 ### Delete
 Delete the directory and all files and return an error if the directory does 
not exist or the directory not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteDirectory(name string) (error)`
 
 ### Rename
 Rename the directory and return an error if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`renameDirectory(oldName string, newName string) (error)`
 
 ### Get Children
 Get all lists of files or children's directories in the directory and return 
an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`readDirectory(name string) (fileList, error)`
 
 ### Permission
 When creating a file, the default owner is the user who created the directory. 
The owner can specify read and write permissions of the directory. If not 
specified, the default is read and write permissions, which include permissions 
for all files in the directory.
+The following is the pseudocode that calls the API in the go style.
+`setDirectoryPermission(name string, permission string) (error)`
 
 ## File
 ### Write
 BanyanDB provides two methods for writing files.
 Append mode, which adds new data to the end of a file. This mode is typically 
used for WAL.
 Flush mode, which flushes all data to one or more files and can specify the 
size of each file to write to.
 It will return an error when writing a directory, the file does not exist or 
there is not enough space, and the incomplete file will be discarded.
+The following is the pseudocode that calls the API in the go style.
+`writeFile(file File,data []byte) (error)`
+`writeFile(files list,data []byte, int filesize) (error)`
 
 ### Delete
 BanyanDB provides a batch-deleting operation, which can delete several files 
at once. it will return an error if the directory does not exist or the file 
not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteFile(list fileList) (error)`
 
 ### Read
 For reading operation, two read methods are provided:
 Reading a specified location of data, which relies on a specified offset and a 
buffer.
 Read the entire file, BanyanDB provides stream reading, which can use when the 
file is too large, the size gets each time can be set when using stream reading.
 If entering incorrect parameters such as incorrect offset or non-existent 
file, it will return an error.
+The following is the pseudocode that calls the API in the go style.
+`readFile(name string, int offset) ([]byte, error)`

Review Comment:
   You should have specified the reading length. 



##########
docs/concept/persistence-storage.md:
##########
@@ -15,40 +16,63 @@ The most common IO mode is Synchronous IO, but it has a 
relatively low throughpu
 ## Directory
 ### Create
 Create the specified directory and return an error if the directory already 
exists.
+The following is the pseudocode that calls the API in the go style.
+`createDirectory(name string) (error)`
 
 ### Delete
 Delete the directory and all files and return an error if the directory does 
not exist or the directory not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteDirectory(name string) (error)`
 
 ### Rename
 Rename the directory and return an error if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`renameDirectory(oldName string, newName string) (error)`
 
 ### Get Children
 Get all lists of files or children's directories in the directory and return 
an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`readDirectory(name string) (fileList, error)`
 
 ### Permission
 When creating a file, the default owner is the user who created the directory. 
The owner can specify read and write permissions of the directory. If not 
specified, the default is read and write permissions, which include permissions 
for all files in the directory.
+The following is the pseudocode that calls the API in the go style.
+`setDirectoryPermission(name string, permission string) (error)`
 
 ## File
 ### Write
 BanyanDB provides two methods for writing files.
 Append mode, which adds new data to the end of a file. This mode is typically 
used for WAL.
 Flush mode, which flushes all data to one or more files and can specify the 
size of each file to write to.
 It will return an error when writing a directory, the file does not exist or 
there is not enough space, and the incomplete file will be discarded.
+The following is the pseudocode that calls the API in the go style.
+`writeFile(file File,data []byte) (error)`
+`writeFile(files list,data []byte, int filesize) (error)`

Review Comment:
   What is the purpose of the `list`? As the type is unexported, API users do 
not have the opportunity to provide this parameter.



##########
docs/concept/persistence-storage.md:
##########
@@ -15,40 +16,63 @@ The most common IO mode is Synchronous IO, but it has a 
relatively low throughpu
 ## Directory
 ### Create
 Create the specified directory and return an error if the directory already 
exists.
+The following is the pseudocode that calls the API in the go style.
+`createDirectory(name string) (error)`
 
 ### Delete
 Delete the directory and all files and return an error if the directory does 
not exist or the directory not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteDirectory(name string) (error)`
 
 ### Rename
 Rename the directory and return an error if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`renameDirectory(oldName string, newName string) (error)`
 
 ### Get Children
 Get all lists of files or children's directories in the directory and return 
an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`readDirectory(name string) (fileList, error)`
 
 ### Permission
 When creating a file, the default owner is the user who created the directory. 
The owner can specify read and write permissions of the directory. If not 
specified, the default is read and write permissions, which include permissions 
for all files in the directory.
+The following is the pseudocode that calls the API in the go style.
+`setDirectoryPermission(name string, permission string) (error)`
 
 ## File
 ### Write
 BanyanDB provides two methods for writing files.
 Append mode, which adds new data to the end of a file. This mode is typically 
used for WAL.
 Flush mode, which flushes all data to one or more files and can specify the 
size of each file to write to.
 It will return an error when writing a directory, the file does not exist or 
there is not enough space, and the incomplete file will be discarded.
+The following is the pseudocode that calls the API in the go style.
+`writeFile(file File,data []byte) (error)`
+`writeFile(files list,data []byte, int filesize) (error)`
 
 ### Delete
 BanyanDB provides a batch-deleting operation, which can delete several files 
at once. it will return an error if the directory does not exist or the file 
not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteFile(list fileList) (error)`
 
 ### Read
 For reading operation, two read methods are provided:
 Reading a specified location of data, which relies on a specified offset and a 
buffer.
 Read the entire file, BanyanDB provides stream reading, which can use when the 
file is too large, the size gets each time can be set when using stream reading.
 If entering incorrect parameters such as incorrect offset or non-existent 
file, it will return an error.
+The following is the pseudocode that calls the API in the go style.
+`readFile(name string, int offset) ([]byte, error)`
 
 ### Rename
 Rename the file and return an error if the directory exists in this directory.
+The following is the pseudocode that calls the API in the go style.
+`renameFile(oldName string, newName string) (error)`
 
 ### Get size
 Get the file size and return an error if the file does not exist.
+The following is the pseudocode that calls the API in the go style.
+`getFileSize(name string) (int, error)`

Review Comment:
   What's the unit of the file size? 



##########
docs/concept/persistence-storage.md:
##########
@@ -15,40 +16,63 @@ The most common IO mode is Synchronous IO, but it has a 
relatively low throughpu
 ## Directory
 ### Create
 Create the specified directory and return an error if the directory already 
exists.
+The following is the pseudocode that calls the API in the go style.
+`createDirectory(name string) (error)`
 
 ### Delete
 Delete the directory and all files and return an error if the directory does 
not exist or the directory not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteDirectory(name string) (error)`
 
 ### Rename
 Rename the directory and return an error if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`renameDirectory(oldName string, newName string) (error)`
 
 ### Get Children
 Get all lists of files or children's directories in the directory and return 
an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`readDirectory(name string) (fileList, error)`
 
 ### Permission
 When creating a file, the default owner is the user who created the directory. 
The owner can specify read and write permissions of the directory. If not 
specified, the default is read and write permissions, which include permissions 
for all files in the directory.
+The following is the pseudocode that calls the API in the go style.
+`setDirectoryPermission(name string, permission string) (error)`
 
 ## File
 ### Write
 BanyanDB provides two methods for writing files.
 Append mode, which adds new data to the end of a file. This mode is typically 
used for WAL.
 Flush mode, which flushes all data to one or more files and can specify the 
size of each file to write to.
 It will return an error when writing a directory, the file does not exist or 
there is not enough space, and the incomplete file will be discarded.
+The following is the pseudocode that calls the API in the go style.
+`writeFile(file File,data []byte) (error)`
+`writeFile(files list,data []byte, int filesize) (error)`
 
 ### Delete
 BanyanDB provides a batch-deleting operation, which can delete several files 
at once. it will return an error if the directory does not exist or the file 
not reading or writing.
+The following is the pseudocode that calls the API in the go style.
+`deleteFile(list fileList) (error)`
 
 ### Read
 For reading operation, two read methods are provided:
 Reading a specified location of data, which relies on a specified offset and a 
buffer.
 Read the entire file, BanyanDB provides stream reading, which can use when the 
file is too large, the size gets each time can be set when using stream reading.
 If entering incorrect parameters such as incorrect offset or non-existent 
file, it will return an error.
+The following is the pseudocode that calls the API in the go style.
+`readFile(name string, int offset) ([]byte, error)`
 
 ### Rename
 Rename the file and return an error if the directory exists in this directory.
+The following is the pseudocode that calls the API in the go style.
+`renameFile(oldName string, newName string) (error)`
 
 ### Get size
 Get the file size and return an error if the file does not exist.
+The following is the pseudocode that calls the API in the go style.
+`getFileSize(name string) (int, error)`
 
 ### Permission
-When creating a file, the default owner is the user who created the file. The 
owner can specify the read and write permissions of the file. If not specified, 
the default is read and write permissions.
\ No newline at end of file
+When creating a file, the default owner is the user who created the file. The 
owner can specify the read and write permissions of the file. If not specified, 
the default is read and write permissions.
+The following is the pseudocode that calls the API in the go style.
+`setFilePermission(fileName string, permission string) (error)`

Review Comment:
   How to set a file's permission while creating it?



##########
docs/concept/persistence-storage.md:
##########
@@ -3,10 +3,11 @@ Persistence storage is used for unifying data of BanyanDB 
persistence, including
 BanyanDB provides a concise interface that shields the complexity of the 
implementation from the upper layer. By exposing necessary interfaces, upper 
components do not need to care how persistence is implemented and avoid dealing 
with differences between different operating systems.
 
 # IO Mode
-Persistence storage offers a range of IO modes to cater to various throughput 
requirements. The interface can be accessed by developers and can be configured 
through settings.
+Persistence storage offers a range of IO modes to cater to various throughput 
requirements. The interface can be accessed by developers and can be configured 
through settings, which can be set in the configuration file.
 
 ## Io_uring
-Io_uring is a new feature in Linux 5.1, which is fully asynchronous and offers 
high throughput. In the scene of massive storage, io_uring can bring 
significant benefits.
+Io_uring is a new feature in Linux 5.1, which is fully asynchronous and offers 
high throughput. In the scene of massive storage, io_uring can bring 
significant benefits.The following is the diagram about how io_uring works.
+![](/assets/io_uring.jpg)

Review Comment:
   Can you provide a brief explanation of the workflow for io_uring?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to