class FDB::Internal::Node

Attributes

path[R]
subspace[R]

Public Class Methods

new(subspace, path, target_path) click to toggle source
# File lib/fdbdirectory.rb, line 645
def initialize(subspace, path, target_path)
  @subspace = subspace
  @path = path
  @target_path = target_path
  @layer = nil
end

Public Instance Methods

exists?() click to toggle source
# File lib/fdbdirectory.rb, line 655
def exists?
  !@subspace.nil?
end
get_contents(directory_layer, tr=nil) click to toggle source
# File lib/fdbdirectory.rb, line 684
def get_contents(directory_layer, tr=nil)
  directory_layer.send(:contents_of_node, @subspace, @path, layer(tr))
end
get_partition_subpath(tr=nil) click to toggle source
# File lib/fdbdirectory.rb, line 680
def get_partition_subpath(tr=nil)
  @target_path[@path.length..-1]
end
is_in_partition?(tr=nil, include_empty_subpath=false) click to toggle source
# File lib/fdbdirectory.rb, line 674
def is_in_partition?(tr=nil, include_empty_subpath=false)
  exists? && 
    @layer == 'partition' && 
    (include_empty_subpath || @path.length < @target_path.length)
end
layer(tr=nil) click to toggle source
# File lib/fdbdirectory.rb, line 664
def layer(tr=nil)
  if tr
    @layer = tr[@subspace['layer']]
  else
    raise 'Layer has not been read' unless @layer
  end

  @layer
end
prefetch_metadata(tr) click to toggle source
# File lib/fdbdirectory.rb, line 659
def prefetch_metadata(tr)
  layer(tr) if exists?
  self
end