Skip to content

Commit

Permalink
3
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Jan 9, 2025
1 parent 52edc39 commit 1c7c95a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions cloud/src/recycler/hdfs_accessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,14 +368,14 @@ int HdfsAccessor::init() {
return 0;
}

// Currently, the hdfs accessor deletes files on hdfs through a prefix parameter.
// The format of the prefix parameter is data/{tablet id}/{rowset_prefix},
// for example: data/492211/02000000008a012957476a3e174dfdaa71ee5f80a3abafa3_.
// Since the hdfs cpp sdk doesn't provide an interface for deleting by prefix,
// we need to extract the tablet id path from the given prefix,
// traverse all files in the tablet id path, and delete the files that match the prefix.
// This implementation is not ideal because the hdfs accessor needs to be aware of the path structure.
// We will optimize this in the future.
// Currently, the hdfs accessor deletes files on hdfs through a prefix parameter.
// The format of the prefix parameter is data/{tablet id}/{rowset_prefix},
// for example: data/492211/02000000008a012957476a3e174dfdaa71ee5f80a3abafa3_.
// Since the hdfs cpp sdk doesn't provide an interface for deleting by prefix,
// we need to extract the tablet id path from the given prefix,
// traverse all files in the tablet id path, and delete the files that match the prefix.
// This implementation is not ideal because the hdfs accessor needs to be aware of the path structure.
// We will optimize this in the future.
int HdfsAccessor::delete_prefix(const std::string& path_prefix, int64_t expiration_time) {
auto uri = to_uri(path_prefix);
LOG(INFO) << "delete prefix, uri=" << uri;
Expand Down

0 comments on commit 1c7c95a

Please sign in to comment.