lib/sp_store/p_chip/soft_node_cache.rb
def check_update_path(update_path)
    if @node_ids[update_path.first] < @leaf_count
      raise RuntimeError, "Update path does not start at a leaf"
    end
    if @node_ids[update_path.last] != 1
      raise RuntimeError, "Update path does not contain root node"
    end
    
    visit_update_path update_path do |hot_entry, cold_entry, parent_entry|
      unless Helpers.siblings?(@node_ids[hot_entry], @node_ids[cold_entry])
        raise RuntimeError,
              "Path contains non-siblings #{hot_entry} and #{cold_entry}"
      end
      unless Helpers.parent(@node_ids[hot_entry]) == @node_ids[parent_entry]
        raise RuntimeError,
              "Path entry #{parent_entry} is not parent for #{hot_entry}"
      end
      
      # NOTE: the checks below will not run for the root node; that's OK, the
      #       root node is always verified, as it never leaves the cache
      unless @verified[hot_entry]
        raise RuntimeError, "Unverified entry #{hot_entry}"
      end
      unless @verified[cold_entry]
        raise RuntimeError, "Unverified entry #{cold_entry}"
      end
    end
  end
# Verifies the validity of an update path.
#
# The return value is unspecified. 
#
# See update_leaf_value for a description of the path structure, verification
# process, and exceptions that can be raised.
Verifies the validity of an update path.
The return value is unspecified.

See update_leaf_value for a description of the path structure, verification
process, and exceptions that can be raised.
Verifies the validity of an update path . The return value is unspecified . See update_leaf_value for a description of the path structure verification process and exceptions that can be raised .
def check_update_path(update_path)
    if @node_ids[update_path.first] < @leaf_count
      raise RuntimeError, "Update path does not start at a leaf"
    end
    if @node_ids[update_path.last] != 1
      raise RuntimeError, "Update path does not contain root node"
    end
    visit_update_path update_path do |hot_entry, cold_entry, parent_entry|
      unless Helpers.siblings?(@node_ids[hot_entry], @node_ids[cold_entry])
        raise RuntimeError,
              "Path contains non-siblings #{hot_entry} and #{cold_entry}"
      end
      unless Helpers.parent(@node_ids[hot_entry]) == @node_ids[parent_entry]
        raise RuntimeError,
              "Path entry #{parent_entry} is not parent for #{hot_entry}"
      end
      unless @verified[hot_entry]
        raise RuntimeError, "Unverified entry #{hot_entry}"
      end
      unless @verified[cold_entry]
        raise RuntimeError, "Unverified entry #{cold_entry}"
      end
    end
  end
def check_update_path ( update_path ) if @node_ids [ update_path . first ] < @leaf_count raise RuntimeError , "Update path does not start at a leaf" end if @node_ids [ update_path . last ] != 1 raise RuntimeError , "Update path does not contain root node" end visit_update_path update_path do | hot_entry , cold_entry , parent_entry | unless Helpers . siblings? ( @node_ids [ hot_entry ] , @node_ids [ cold_entry ] ) raise RuntimeError , "Path contains non-siblings #{hot_entry} and #{cold_entry}" end unless Helpers . parent ( @node_ids [ hot_entry ] ) == @node_ids [ parent_entry ] raise RuntimeError , "Path entry #{parent_entry} is not parent for #{hot_entry}" end unless @verified [ hot_entry ] raise RuntimeError , "Unverified entry #{hot_entry}" end unless @verified [ cold_entry ] raise RuntimeError , "Unverified entry #{cold_entry}" end end end
Verifies the validity of an update path.
Verifies the validity of an update path .
# NOTE: the checks below will not run for the root node; that's OK, the #       root node is always verified, as it never leaves the cache
update_path