Peer-to-Peer Storage Systems

Questions for lecture 10

Exercises to be handed-in marked with a star. Hand-in friday morning.

XML Store basics:

  1. What are the pros and cons of the value oriented approach?
  2. What are the inherent problems with destructive updates?
  3. How does sharing work? What enables sharing in XML Store?
  4. *What are the differences between a value reference and a locator?

XML Store and Garbage Collection:

  1. * Does garbage collection and leasing / expiry-based data deletion accomplish the same thing? Why / why not?
  2. What is the purpose of the close() method?
  3. Why must a reference count be associated with a value occurrence?
  4. Why is reference listing more fault tolerant than reference counting?
  5. How does the value oriented paradigm affect garbage collection?

Programming:

  1. Consider DOM (Document Object Model). Each DOM node (corresponding to a node in an XML tree/info set) has, amongst others, the following instance fields and methods:
    Document ownerDocument // the XML document root node of current node 
    Node parentNode // parent node of current node
    Node insertBefore(Node newChild, Node refChild) 
         // inserts newChild before refChild of current node,
         // returns inserted node
         // ... more child manipulation methods like insertBefore
         Node cloneNode(boolean deep) // clones a node shallow or deep
    

    A node can be thought of as containing: a pointer to its root node, a pointer to its immediate parent, and a pointer to its children. The children can be thought of implemented using a doubly-linked list connecting the children.

    The newChild argument node in the insertBefore method is unlinked from its parent before being inserted into the list of children of the current node. Why?

    If we want to a DOM node n to occur twice in the list of children of another node p, how can this be programmed in DOM?

    In the latter case, how do you program an update of the node n; e.g., changing its chardata from "blib" to "blob"?

  2. * Program a method that changes the content of a char data node from one piece of text to another. The method should have the following signature:
    Node changeCharData(String old, String new, Node node)
    where node is the node to traverse recursively looking for old-strings, and the return value is the new node. Hint: Think of the example from class where we changed one speaker from Hamlet to Ophelia.