Skip to content

Commit dc91a58

Browse files
committed
new
1 parent cd97101 commit dc91a58

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

monitor/main.py

+9-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414

1515
sys.path.insert(1, '../utils/')
1616
from transfer import _send_msg, _recv_msg, _wait_recv_msg
17-
from monitor_gossip import heartbeat_protocol
17+
# from monitor_gossip import heartbeat_protocol
1818
from info import MDS_IPs, MDS_PORT, WRITE_ACK_PORT, OSD_INACTIVE_STATUS_PORT, CLIENT_REQ_PORT, \
1919
RECV_PRIMARY_UPDATE_PORT, MSG_SIZE
2020

21-
hashtable = {}
21+
# hashtable = {}
2222
MDS_flags = {}
2323
cluster_topology = {}
2424
MDS_IP = MDS_IPs["primary"]["ip"]
@@ -77,6 +77,7 @@ def recv_primary_update():
7777
# recv the update
7878
update = _recv_msg(c, 1024)
7979
print(update)
80+
# hashtable = _read
8081

8182
if update["update_type"] == "hash_table":
8283
for i in range(len(update["pg_or_osd_ids_list"])):
@@ -440,5 +441,11 @@ def main(argc, argv):
440441
else:
441442
recv_primary_update()
442443

444+
def _read_hash():
445+
hashtable_file = open('hashtable', 'rb')
446+
hashtable_dump = hashtable_file.read()
447+
hashtable = pickle.loads(hashtable_dump)
448+
449+
return hashtable
443450
if __name__ == '__main__':
444451
main(len(sys.argv), sys.argv)

0 commit comments

Comments
 (0)