'''
Created on Jan 23, 2011
Modified on Apr 23, 2011
@author: Dilum Bandara
@version: 0.21
@copyright: Copyright(c) 2011, Dilum Bandara
@license: GPL
'''

from BaseClasses.BasePeer import BasePeer

class Peer(BasePeer):
    """
    Node class. Contains node ID, key,its attribute set, & list of resources
    indexed at node
    """
    def __init__(self, id, sid, keys, num_rings):
        self._id = id
        self._sid = sid #ID of superpeer
        self._keys = keys
        self._last_att_vals = []
        if num_rings == 0: num_rings = 1
        self._idx = []
        self._max_idx_size = []
        for i in range (num_rings): 
            self._idx.append([])
            self._max_idx_size.append(0)
        self._num_updates = 0
        self._num_updates_rec = 0
        self._num_que_send = 0
        self._num_que_fwd = 0
        self._num_que_ans = 0
