-
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
1d52ffb
commit d8b024e
Showing
11 changed files
with
857 additions
and
312 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; |
Large diffs are not rendered by default.
Oops, something went wrong.
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
175 changes: 0 additions & 175 deletions
175
src/test/unit_tests/jest_tests/test_list_object.test.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.