lib/sp_store/server/hash_tree_controller.rb
# for read operation
# return the nodes that should be loaded into cache
# also return nodes that should not be replaced
for read operation
return the nodes that should be loaded into cache
also return nodes that should not be replaced
for read operation return the nodes that should be loaded into cache also return nodes that should not be replaced
def node_load_path_for_read(node_id)
    node_ids    = []
    node_needed = 1
    while node_id > 0
      if node_cache_entry node_id
        node_needed = node_id
        break
      end
      node_ids << node_id
      if node_cache_entry sibling(node_id)
        node_needed = sibling(node_id)
        break
      end 
      node_ids << sibling(node_id) 
      node_id = parent node_id
    end
    update_node_access_time node_needed
    return node_ids.reverse, ( node_ids << node_needed )
  end
def node_load_path_for_read ( node_id ) node_ids = [ ] node_needed = 1 while node_id > 0 if node_cache_entry node_id node_needed = node_id break end node_ids << node_id if node_cache_entry sibling ( node_id ) node_needed = sibling ( node_id ) break end node_ids << sibling ( node_id ) node_id = parent node_id end update_node_access_time node_needed return node_ids . reverse , ( node_ids << node_needed ) end
for read operation
return the nodes that should be loaded into cache
also return nodes that should not be replaced
for read operation return the nodes that should be loaded into cache also return nodes that should not be replaced
node_id