Class: Flydata::Source::Sync

Inherits:
Component show all
Defined in:
lib/flydata/source/sync.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Component

#initialize

Constructor Details

This class inherits a constructor from Flydata::Source::Component

Class Method Details

.inherited(child_class) ⇒ Object



9
10
11
# File 'lib/flydata/source/sync.rb', line 9

def self.inherited(child_class)
  Source.register(child_class, self)
end

Instance Method Details

#data_serversObject

Public Interface: Data Servers

Returns a comma separated list of data servers to which the agent sends data



43
44
45
# File 'lib/flydata/source/sync.rb', line 43

def data_servers
  raise UnsupportedSourceError, "subclass must implement"
end

#forwarderObject

Public Interface: Forwarder

Returns a forwarder type in string. Values are ‘tcpforwarder’ or ‘sslforwarder’.



50
51
52
# File 'lib/flydata/source/sync.rb', line 50

def forwarder
  raise UnsupportedSourceError, "subclass must implement"
end

#setupObject

Public Interface: Set up data source

Called right after the source instance is created. Perform one-time setup which is necessary to initialize the source for sync (and sync only)

Raises exception when the source does not support sync



19
20
21
# File 'lib/flydata/source/sync.rb', line 19

def setup
  raise UnsupportedSourceError,"subclass must implement"
end

#supported?Boolean

Public Interface: Tells if the source support sync or not

Returns true if the source supports sync. No otherwise.

Returns:

  • (Boolean)

Raises:



26
27
28
# File 'lib/flydata/source/sync.rb', line 26

def supported?
  raise UnsupportedSourceError, "subclass must implement"
end

#table_listsObject

Public Interface: Table lists

Returns lists of tables in a hash. The following lists will be returned

"tables" : An array of tables currently in sync
"new_tables" : An array of tables for which no generate_table_ddl has been run yet
"invalid_tables" : An array of tables that had an issue starting sync


36
37
38
# File 'lib/flydata/source/sync.rb', line 36

def table_lists
  raise UnsupportedSourceError, "subclass must implement"
end