You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "HHoflittlefish777 (via GitHub)" <gi...@apache.org> on 2023/07/02 08:10:13 UTC
[GitHub] [skywalking-banyandb] HHoflittlefish777 opened a new pull request, #292: Supply Persistence Storage doc
HHoflittlefish777 opened a new pull request, #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292
- [ ] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes https://github.com/apache/skywalking/issues/<issue number>.
- [ ] Update the [`CHANGES` log](https://github.com/apache/skywalking-banyandb/blob/main/CHANGES.md).
This is a supplement to https://github.com/apache/skywalking-banyandb/pull/275
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250633715
##########
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:
The document lacks sufficient guidance on creating a file. Here are the improvements:
For flush mode: The write operation should accept bytes and permission to create the file. Once completed, it should return a File instance.
For append mode: The Open operation should be able to create the file if it doesn't already exist. Subsequently, the File.Write method should append data to the end of the File.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250643727
##########
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:
I suggest that you first open the desired file. Afterward, proceed to read the data contained within this opened file.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
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.
+
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] HHoflittlefish777 commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "HHoflittlefish777 (via GitHub)" <gi...@apache.org>.
HHoflittlefish777 commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250246545
##########
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?
writeFile(file File,data []byte) (error)
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1256285290
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(newName String) (error)`
### Get Children
Review Comment:
Could you improve the subtitle?
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(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.
+Get all lists of files or children's directories in the directory and an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.ReadDirectory() (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.
+`fd.SetDirectoryPermission(permission int) (error)`
## File
+### Create
+Create the specified file and return the file descriptor, the error will happen if the file already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateFile(name String, permission int) (int, error)`
+
+### Open
+Open the file and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenFile() (error)`
+
### 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.
+Flush mode, which flushes all data to one file. 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.
+For append mode: `fd.AppendWriteFile(data []byte) (error)`
+For flush mode: `FlushWriteFile(data []byte, permission int) (int, 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(fds List) (error)`
Review Comment:
I would like to delete only one file, not a whole list of files.
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(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.
+Get all lists of files or children's directories in the directory and an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.ReadDirectory() (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.
+`fd.SetDirectoryPermission(permission int) (error)`
Review Comment:
Could you define permission options such as read-only, read/write, and others?
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
Review Comment:
Please return a `Directory` type instead of `int`
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(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.
+Get all lists of files or children's directories in the directory and an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.ReadDirectory() (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.
+`fd.SetDirectoryPermission(permission int) (error)`
## File
+### Create
+Create the specified file and return the file descriptor, the error will happen if the file already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateFile(name String, permission int) (int, error)`
+
+### Open
+Open the file and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenFile() (error)`
+
### 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.
+Flush mode, which flushes all data to one file. 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.
+For append mode: `fd.AppendWriteFile(data []byte) (error)`
+For flush mode: `FlushWriteFile(data []byte, permission int) (int, 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(fds List) (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.
+`fd.ReadFile(offset int, data []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.
+`fd.RenameFile(newName String) (error)`
### Get size
-Get the file size and return an error if the file does not exist.
+Get the file size and return an error if the file does not exist. The unit of file size is Byte.
+The following is the pseudocode that calls the API in the go style.
+`fd.GetFileSize() (int, error)`
Review Comment:
Can you indicate the returned size represents the written data's size?
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(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.
+Get all lists of files or children's directories in the directory and an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.ReadDirectory() (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.
+`fd.SetDirectoryPermission(permission int) (error)`
## File
+### Create
+Create the specified file and return the file descriptor, the error will happen if the file already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateFile(name String, permission int) (int, error)`
+
+### Open
+Open the file and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenFile() (error)`
+
### 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.
+Flush mode, which flushes all data to one file. 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.
+For append mode: `fd.AppendWriteFile(data []byte) (error)`
+For flush mode: `FlushWriteFile(data []byte, permission int) (int, 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(fds List) (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.
Review Comment:
Could you include a `pseudocode` that demonstrates how to read from a stream?
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
+Open the directory and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenDirectory() (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.
+`fd.DeleteDirectory() (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.
+`fd.RenameDirectory(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.
+Get all lists of files or children's directories in the directory and an error if the directory does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.ReadDirectory() (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.
+`fd.SetDirectoryPermission(permission int) (error)`
## File
+### Create
+Create the specified file and return the file descriptor, the error will happen if the file already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateFile(name String, permission int) (int, error)`
+
+### Open
+Open the file and return an error if the file descriptor does not exist.
+The following is the pseudocode that calls the API in the go style.
+`fd.OpenFile() (error)`
+
### 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.
+Flush mode, which flushes all data to one file. 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.
+For append mode: `fd.AppendWriteFile(data []byte) (error)`
+For flush mode: `FlushWriteFile(data []byte, permission int) (int, 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(fds List) (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.
+`fd.ReadFile(offset int, data []byte) (error)`
Review Comment:
Could you explain the data parameter?
##########
docs/concept/persistence-storage.md:
##########
@@ -3,52 +3,91 @@ 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.
+
+If the user sets io_uring for use, the read and write requests will first be placed in the submission queue buffer when calling the operation API. When the threshold is reached, batch submissions will be made to SQ. After the kernel threads complete execution, the requests will be placed in the CQ, and the user can obtain the request results.
## Synchronous IO
The most common IO mode is Synchronous IO, but it has a relatively low throughput. BanyanDB provides a nonblocking mode that is compatible with lower Linux versions.
# Operation
## Directory
### Create
-Create the specified directory and return an error if the directory already exists.
+Create the specified directory and return the file descriptor, the error will happen if the directory already exists.
+The following is the pseudocode that calls the API in the go style.
+`CreateDirectory(name String, permission int) (int, error)`
+
+### Open
Review Comment:
Remove it
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] HHoflittlefish777 commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "HHoflittlefish777 (via GitHub)" <gi...@apache.org>.
HHoflittlefish777 commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250251954
##########
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:
Should the user be asked to pass in a specified size of memory or a specified length to return the read memory at the file system?like
`readFile(name string, int offset, []byte) (error)`
`readFile(name string, int offset, int length) ([]byte, error)`
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250637141
##########
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:
The first patter is better. Users have a chance to reuse the buffer
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] hanahmily merged pull request #292: Supply Persistence Storage doc
Posted by "hanahmily (via GitHub)" <gi...@apache.org>.
hanahmily merged PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] codecov-commenter commented on pull request #292: Supply Persistence Storage doc
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#issuecomment-1616517388
## [Codecov](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/292?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
> Merging [#292](https://app.codecov.io/gh/apache/skywalking-banyandb/pull/292?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (d7a2123) into [main](https://app.codecov.io/gh/apache/skywalking-banyandb/commit/df34a83663d66af9687ff484884ceae669c83980?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) (df34a83) will **not change** coverage.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## main #292 +/- ##
=======================================
Coverage 44.18% 44.18%
=======================================
Files 93 93
Lines 9804 9804
=======================================
Hits 4332 4332
Misses 5054 5054
Partials 418 418
```
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] HHoflittlefish777 commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "HHoflittlefish777 (via GitHub)" <gi...@apache.org>.
HHoflittlefish777 commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250248807
##########
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.
Flush data into multiple files, according to the file size specified by the user
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking-banyandb] HHoflittlefish777 commented on a diff in pull request #292: Supply Persistence Storage doc
Posted by "HHoflittlefish777 (via GitHub)" <gi...@apache.org>.
HHoflittlefish777 commented on code in PR #292:
URL: https://github.com/apache/skywalking-banyandb/pull/292#discussion_r1250246545
##########
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?
writeFile(file File,data []byte) (error)
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org