lib/sp_store/server/hash_tree_controller.rb
def node_load_path_for_write(node_id)
    nodes_needed  = []
    nodes_to_load = []
    visit_path_to_root node_id do |path_node_id|
      sibling_node   = sibling(path_node_id)
      nodes_needed  << path_node_id
      nodes_needed  << sibling_node unless path_node_id == root_node_id
      nodes_to_load << path_node_id unless node_cache_entry(path_node_id)
      nodes_to_load << sibling_node unless (path_node_id == root_node_id || node_cache_entry(sibling_node) )
    end
    return nodes_to_load.reverse, nodes_needed.to_set
  end
# for write/update operation
# return the nodes that should be loaded into cache
# also return nodes that should not be replaced
for write/update operation
return the nodes that should be loaded into cache
also return nodes that should not be replaced
for write / update operation return the nodes that should be loaded into cache also return nodes that should not be replaced
def node_load_path_for_write(node_id)
    nodes_needed  = []
    nodes_to_load = []
    visit_path_to_root node_id do |path_node_id|
      sibling_node   = sibling(path_node_id)
      nodes_needed  << path_node_id
      nodes_needed  << sibling_node unless path_node_id == root_node_id
      nodes_to_load << path_node_id unless node_cache_entry(path_node_id)
      nodes_to_load << sibling_node unless (path_node_id == root_node_id || node_cache_entry(sibling_node) )
    end
    return nodes_to_load.reverse, nodes_needed.to_set
  end
def node_load_path_for_write ( node_id ) nodes_needed = [ ] nodes_to_load = [ ] visit_path_to_root node_id do | path_node_id | sibling_node = sibling ( path_node_id ) nodes_needed << path_node_id nodes_needed << sibling_node unless path_node_id == root_node_id nodes_to_load << path_node_id unless node_cache_entry ( path_node_id ) nodes_to_load << sibling_node unless ( path_node_id == root_node_id || node_cache_entry ( sibling_node ) ) end return nodes_to_load . reverse , nodes_needed . to_set end
for write/update operation
return the nodes that should be loaded into cache
also return nodes that should not be replaced
for write / update operation return the nodes that should be loaded into cache also return nodes that should not be replaced
node_id