Class: TungstenScriptDatasource
- Inherits:
-
Object
- Object
- TungstenScriptDatasource
show all
- Defined in:
- lib/tungsten/datasource.rb
Instance Method Summary
collapse
Constructor Details
Returns a new instance of TungstenScriptDatasource.
2
3
4
5
6
|
# File 'lib/tungsten/datasource.rb', line 2
def initialize(ti, service, is_direct = false)
@ti = ti
@service = service
@is_direct = is_direct
end
|
Instance Method Details
#_stop_server ⇒ Object
33
34
35
|
# File 'lib/tungsten/datasource.rb', line 33
def _stop_server
raise "Undefined function: #{self.class.name()}._stop_server"
end
|
#can_lock_tables? ⇒ Boolean
58
59
60
|
# File 'lib/tungsten/datasource.rb', line 58
def can_lock_tables?
false
end
|
#can_manage_service? ⇒ Boolean
8
9
10
|
# File 'lib/tungsten/datasource.rb', line 8
def can_manage_service?
false
end
|
#can_sql? ⇒ Boolean
74
75
76
|
# File 'lib/tungsten/datasource.rb', line 74
def can_sql?
@ti.can_sql?(@service, @is_direct)
end
|
#is_running? ⇒ Boolean
12
13
14
|
# File 'lib/tungsten/datasource.rb', line 12
def is_running?
raise "Undefined function: #{self.class.name()}.is_running?"
end
|
#lock_tables ⇒ Object
62
63
64
|
# File 'lib/tungsten/datasource.rb', line 62
def lock_tables
raise "Undefined function: #{self.class.name()}.lock_tables"
end
|
#snapshot_paths ⇒ Object
70
71
72
|
# File 'lib/tungsten/datasource.rb', line 70
def snapshot_paths
raise "Undefined function: #{self.class.name()}.snapshot_paths"
end
|
#sql_result(sql) ⇒ Object
82
83
84
|
# File 'lib/tungsten/datasource.rb', line 82
def sql_result(sql)
@ti.sql_result(@service, sql, @is_direct)
end
|
#sql_results(sql) ⇒ Object
78
79
80
|
# File 'lib/tungsten/datasource.rb', line 78
def sql_results(sql)
@ti.sql_results(@service, sql, @is_direct)
end
|
#start ⇒ Object
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/tungsten/datasource.rb', line 37
def start
if @is_direct == true
raise "Unable to start the direct datasource for #{@service} replication service"
end
unless can_manage_service?()
raise "Unable to start the datasource for #{@service} replication service"
end
if is_running?() == true
return
end
TU.notice("Start the #{self.class.name()} service")
_start_server()
end
|
#stop ⇒ Object
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/tungsten/datasource.rb', line 16
def stop
if @is_direct == true
raise "Unable to stop the direct datasource for #{@service} replication service"
end
unless can_manage_service?()
raise "Unable to stop the datasource for #{@service} replication service"
end
if is_running?() == false
return
end
TU.notice("Stop the #{self.class.name()} service")
_stop_server()
end
|
#unlock_tables ⇒ Object
66
67
68
|
# File 'lib/tungsten/datasource.rb', line 66
def unlock_tables
raise "Undefined function: #{self.class.name()}.unlock_tables"
end
|