-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NSFS | Improve list objects performance on top of NS FS
Signed-off-by: naveenpaul1 <[email protected]>
- Loading branch information
1 parent
6639c90
commit de2f83b
Showing
13 changed files
with
1,750 additions
and
1,058 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* Copyright (C) 2020 NooBaa */ | ||
'use strict'; | ||
|
||
class KeyMarkerFS { | ||
constructor({ marker, marker_pos, pre_dir, pre_dir_pos }, is_unsorted = false) { | ||
this.marker = marker; | ||
this.marker_pos = marker_pos.toString(); | ||
this.pre_dir = pre_dir; | ||
this.pre_dir_pos = pre_dir_pos; | ||
this.key_marker_value = marker; | ||
this.current_dir = ''; | ||
this.is_unsorted = is_unsorted; | ||
this.last_pre_dir = ''; | ||
this.last_pre_dir_position = ''; | ||
if (is_unsorted) { | ||
this.current_dir = pre_dir.length > 0 && marker.includes('/') ? | ||
marker.substring(0, marker.lastIndexOf('/') + 1) : ''; | ||
} | ||
} | ||
|
||
async update_key_marker(marker, marker_pos) { | ||
this.marker = marker; | ||
this.marker_pos = marker_pos; | ||
this.key_marker_value = marker; | ||
} | ||
|
||
async get_previour_dir_length() { | ||
return this.pre_dir.length; | ||
} | ||
|
||
async get_previour_dir_info() { | ||
return { | ||
pre_dir_path: this.pre_dir.pop(), | ||
pre_dir_position: this.pre_dir_pos.pop(), | ||
}; | ||
} | ||
|
||
async add_previour_dir(pre_dir, pre_dir_pos) { | ||
this.pre_dir.push(pre_dir); | ||
this.pre_dir_pos.push(pre_dir_pos.toString()); | ||
} | ||
|
||
async update_last_previour_dir(last_pre_dir, last_pre_dir_position) { | ||
this.last_pre_dir = last_pre_dir; | ||
this.last_pre_dir_position = last_pre_dir_position; | ||
} | ||
} | ||
|
||
// EXPORTS | ||
module.exports = KeyMarkerFS; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* Copyright (C) 2020 NooBaa */ | ||
'use strict'; | ||
|
||
|
||
class ListObjectFS { | ||
constructor({fs_context, list_versions, keymarker, prefix_dir_key, is_truncated, delimiter, prefix, | ||
version_id_marker, list_type, results, limit, skip_list, key_marker}) { | ||
this.fs_context = fs_context; | ||
this.keymarker = keymarker; | ||
this.prefix_dir_key = prefix_dir_key; | ||
this.is_truncated = is_truncated; | ||
this.delimiter = delimiter; | ||
this.prefix = prefix; | ||
this.version_id_marker = version_id_marker; | ||
this.list_type = list_type; | ||
this.results = results; | ||
this.limit = limit; | ||
this.skip_list = skip_list; | ||
this.prefix_ent = ''; | ||
this.marker_dir = ''; | ||
this.param_key_marker = key_marker; | ||
this.list_versions = list_versions; | ||
} | ||
|
||
async update_process_dir_properties(prefix_ent, marker_curr, dir_path) { | ||
this.prefix_ent = prefix_ent; | ||
this.dir_path = dir_path; | ||
} | ||
|
||
async update_is_truncated(is_truncated) { | ||
this.is_truncated = is_truncated; | ||
} | ||
|
||
async get_is_truncated() { | ||
return this.is_truncated; | ||
} | ||
|
||
async update_keymarker(keymarker) { | ||
this.keymarker = keymarker; | ||
} | ||
|
||
async get_keymarker() { | ||
return this.keymarker; | ||
} | ||
} | ||
|
||
// EXPORTS | ||
module.exports = ListObjectFS; |
Oops, something went wrong.