Class: Distem::Resource::FileSystem

Inherits:
Object
  • Object
show all
Defined in:
lib/distem/resource/filesystem.rb

Overview

Abstract description of the filesystem used on a VNode

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (FileSystem) initialize(vnode, image, shared = false, cow = false, disk_throttling = {})

Create a new FileSystem



25
26
27
28
29
30
31
32
33
# File 'lib/distem/resource/filesystem.rb', line 25

def initialize(vnode,image,shared = false,cow = false, disk_throttling = {})
  @vnode = vnode
  @image = CGI.escape(image)
  @shared = shared
  @cow = cow
  @path = nil
  @sharedpath = nil
  @disk_throttling = disk_throttling
end

Instance Attribute Details

- (Object) cow (readonly)

Is the filesystem use an underline COW filesystem ?



15
16
17
# File 'lib/distem/resource/filesystem.rb', line 15

def cow
  @cow
end

- (Object) disk_throttling

Disk throttling properties



21
22
23
# File 'lib/distem/resource/filesystem.rb', line 21

def disk_throttling
  @disk_throttling
end

- (Object) image

The URI to the -bootstrapped and compressed- image file



11
12
13
# File 'lib/distem/resource/filesystem.rb', line 11

def image
  @image
end

- (Object) path

The path to the filesystem on the physical machine



17
18
19
# File 'lib/distem/resource/filesystem.rb', line 17

def path
  @path
end

- (Object) shared (readonly)

Is the file system shared between several nodes ?



13
14
15
# File 'lib/distem/resource/filesystem.rb', line 13

def shared
  @shared
end

- (Object) sharedpath

The path to shared parts of the filesystem on the physical machine (if there is one)



19
20
21
# File 'lib/distem/resource/filesystem.rb', line 19

def sharedpath
  @sharedpath
end

- (Object) vnode

The VNode associated to this FileSystem



9
10
11
# File 'lib/distem/resource/filesystem.rb', line 9

def vnode
  @vnode
end

Instance Method Details

- (Object) to_s



35
36
37
# File 'lib/distem/resource/filesystem.rb', line 35

def to_s
  return "vnode: #{@vnode.name}, image: #{CGI.unescape(@image)}, path: #{@path}, sharedpath: #{@sharedpath}, shared #{@shared}, cow #{@cow}, disk_throttling: #{@disk_throttling ? @disk_throttling.to_s : nil}"
end