'Call master to commit rebalance transaction.'

def HandleRebalanceCommit(self):

    if (not self.MASTER):
        self._EmptyResponse(constants.RESPONSE_NOT_MASTER_SERVER)
        return
    reb = rdf_data_server.DataServerRebalance.FromSerializedString(self.post_data)
    current = self.MASTER.IsRebalancing()
    if ((not current) or (current.id != reb.id)):
        self._EmptyResponse(constants.RESPONSE_WRONG_TRANSACTION)
        return
    new_mapping = self.MASTER.RebalanceCommit()
    if (not new_mapping):
        self._EmptyResponse(constants.RESPONSE_NOT_COMMITED)
        return
    self._Response(constants.RESPONSE_OK, self.MAPPING.SerializeToString())
