Class: Spark::StorageLevel

Inherits:
Object
  • Object
show all
Defined in:
lib/spark/storage_level.rb

Class Method Summary collapse

Class Method Details

.java_get(arg) ⇒ Object



28
29
30
31
32
33
34
35
36
# File 'lib/spark/storage_level.rb', line 28

def self.java_get(arg)
  reload

  if arg.is_a?(String)
    const_get(arg.upcase)
  else
    arg
  end
end

.reloadObject



7
8
9
10
11
# File 'lib/spark/storage_level.rb', line 7

def self.reload
  return if @reloaded
  reload!
  @reloaded = true
end

.reload!Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/spark/storage_level.rb', line 13

def self.reload!
  self.const_set(:NONE,                  JStorageLevel.NONE)
  self.const_set(:DISK_ONLY,             JStorageLevel.DISK_ONLY)
  self.const_set(:DISK_ONLY_2,           JStorageLevel.DISK_ONLY_2)
  self.const_set(:MEMORY_ONLY,           JStorageLevel.MEMORY_ONLY)
  self.const_set(:MEMORY_ONLY_SER,       JStorageLevel.MEMORY_ONLY_SER)
  self.const_set(:MEMORY_ONLY_2,         JStorageLevel.MEMORY_ONLY_2)
  self.const_set(:MEMORY_ONLY_SER_2,     JStorageLevel.MEMORY_ONLY_SER_2)
  self.const_set(:MEMORY_AND_DISK,       JStorageLevel.MEMORY_AND_DISK)
  self.const_set(:MEMORY_AND_DISK_2,     JStorageLevel.MEMORY_AND_DISK_2)
  self.const_set(:MEMORY_AND_DISK_SER,   JStorageLevel.MEMORY_AND_DISK_SER)
  self.const_set(:MEMORY_AND_DISK_SER_2, JStorageLevel.MEMORY_AND_DISK_SER_2)
  self.const_set(:OFF_HEAP,              JStorageLevel.OFF_HEAP)
end