Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Felix Seibert
xtreemfs_client
Commits
62b2626c
Commit
62b2626c
authored
Dec 07, 2018
by
Felix Seibert
Browse files
print total size of moved folder size when rebalancing in debug mode
parent
815341e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
xtreemfs_client/OSDManager.py
View file @
62b2626c
...
...
@@ -233,6 +233,12 @@ class OSDManager(object):
print
(
"movements:"
)
print
(
str
(
movements
))
total_movement_size
=
0
for
folder_id
in
movements
:
total_movement_size
+=
self
.
distribution
.
get_folder_size
(
folder_id
)
print
(
"total movement size: "
+
str
(
total_movement_size
))
print
(
"rebalanced osd manager:
\n
"
+
str
(
self
))
new_assignments
=
list
(
map
(
lambda
key
,
value
:
(
key
,
value
[
1
]),
list
(
movements
.
items
())))
...
...
xtreemfs_client/dataDistribution.py
View file @
62b2626c
...
...
@@ -97,6 +97,11 @@ class DataDistribution(object):
return
checked_osd
return
None
def
get_folder_size
(
self
,
folder_id
):
containing_osd
=
self
.
get_containing_osd
(
folder_id
)
assert
containing_osd
is
not
None
return
containing_osd
.
get_folder_size
(
folder_id
)
def
assign_new_osd
(
self
,
folder_id
,
new_osd
):
"""
assign folder_id to new_osd. if folder_id already is assigned to an OSD, this old assignment is deleted.
...
...
xtreemfs_client/osd.py
View file @
62b2626c
...
...
@@ -56,6 +56,10 @@ class OSD(object):
def
get_processing_time
(
self
):
return
self
.
total_folder_size
/
self
.
bandwidth
def
get_folder_size
(
self
,
folder_id
):
assert
folder_id
in
self
.
folders
return
self
.
folders
[
folder_id
]
def
__str__
(
self
):
return
"osd: '"
+
self
.
uuid
\
+
"' totalFolderSize: "
+
str
(
self
.
total_folder_size
)
\
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment