def process_request(self, server_state):
kv_store = server_state.kv_store
if kv_store.part_policy.__contains__(self.name) is False:
raise RuntimeError("KVServer cannot find partition policy with name: %s" % self.name)
if kv_store.data_store.__contains__(self.name) is False:
raise RuntimeError("KVServer Cannot find data tensor with name: %s" % self.name)
local_id = kv_store.part_policy[self.name].to_local(self.id_tensor)
After Change
kv_store = server_state.kv_store
if self.name not in kv_store.part_policy:
raise RuntimeError("KVServer cannot find partition policy with name: %s" % self.name)
if self.name not in kv_store.data_store:
raise RuntimeError("KVServer Cannot find data tensor with name: %s" % self.name)
local_id = kv_store.part_policy[self.name].to_local(self.id_tensor)
kv_store.push_handlers[self.name](kv_store.data_store, self.name,