Esempio n. 1
0
    def tuple_request(self, req, msgid, message, data):
        ts, template = str(data[0]), data[1]

        if local_ts.has_key(ts):
            r = local_ts[ts].tuple_request(msgid[1], interserver_types.getTypesFromServer(msgid[1], template))
        else:
            r = []
        # we ignore the original representation and only pass on the converted format.
        req.send(msgid, ("RESULT_TUPLE", tuple(r)))
Esempio n. 2
0
    def tuple_request(self, req, msgid, message, data):
        ts, template = str(data[0]), data[1]

        if local_ts.has_key(ts):
            r = local_ts[ts].tuple_request(
                msgid[1],
                interserver_types.getTypesFromServer(msgid[1], template))
        else:
            r = []
        # we ignore the original representation and only pass on the converted format.
        req.send(msgid, ("RESULT_TUPLE", tuple(r)))
Esempio n. 3
0
    def register(self):
        try:
            broadcast_message(register_partition, self._id, server.node_id)

            ps = broadcast_firstreplyonly(get_partitions, self._id)
            if ps != dont_know:
                self.partitions.extend([str(p) for p in ps[1] if str(p) != server.node_id])

            r = broadcast_tonodes(self.partitions, True, get_requests, self._id)
            if r != dont_know:
                r = r[1]
                for i in range(len(r)):
                    nid, template = r[i][0], interserver_types.getTypesFromServer(nid, r[i][1])
                    self.requests.append((str(nid), tuple(template)))
        finally:
            self.lock.release(msg=("end start", self._id))
Esempio n. 4
0
    def register(self):
        try:
            broadcast_message(register_partition, self._id, server.node_id)

            ps = broadcast_firstreplyonly(get_partitions, self._id)
            if ps != dont_know:
                self.partitions.extend(
                    [str(p) for p in ps[1] if str(p) != server.node_id])

            r = broadcast_tonodes(self.partitions, True, get_requests,
                                  self._id)
            if r != dont_know:
                r = r[1]
                for i in range(len(r)):
                    nid, template = r[i][
                        0], interserver_types.getTypesFromServer(nid, r[i][1])
                    self.requests.append((str(nid), tuple(template)))
        finally:
            self.lock.release(msg=("end start", self._id))