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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
