Class: GroongaDelta::ImportConfig::MySQL

Inherits:
Object
  • Object
show all
Includes:
Config::PathResolvable
Defined in:
lib/groonga-delta/import-config.rb

Instance Method Summary collapse

Constructor Details

#initialize(dir, data, secret_data) ⇒ MySQL

Returns a new instance of MySQL.



52
53
54
55
56
# File 'lib/groonga-delta/import-config.rb', line 52

def initialize(dir, data, secret_data)
  @dir = dir
  @data = data
  @secret_data = secret_data
end

Instance Method Details

#binlog_dirObject



58
59
60
# File 'lib/groonga-delta/import-config.rb', line 58

def binlog_dir
  resolve_path(@data["binlog_dir"] || "binlog")
end

#checksumObject



121
122
123
124
125
# File 'lib/groonga-delta/import-config.rb', line 121

def checksum
  _checksum = @data["checksum"]
  return nil if _checksum.nil?
  _checksum.to_sym
end

#hostObject



62
63
64
# File 'lib/groonga-delta/import-config.rb', line 62

def host
  @data["host"] || "localhost"
end

#initial_import_batch_sizeObject



127
128
129
# File 'lib/groonga-delta/import-config.rb', line 127

def initial_import_batch_size
  resolve_size(@data["initial_import_batch_size"] || 1024 * 1024)
end

#passwordObject



78
79
80
# File 'lib/groonga-delta/import-config.rb', line 78

def password
  @secret_data["password"] || @data["password"]
end

#portObject



66
67
68
# File 'lib/groonga-delta/import-config.rb', line 66

def port
  @data["port"] || 3306
end

#replication_clientObject



82
83
84
# File 'lib/groonga-delta/import-config.rb', line 82

def replication_client
  @data["replication_client"] || @data
end

#replication_client_passwordObject



90
91
92
93
# File 'lib/groonga-delta/import-config.rb', line 90

def replication_client_password
  (@secret_data["replication_client"] || @secret_data)["password"] ||
    replication_client["password"]
end

#replication_client_userObject



86
87
88
# File 'lib/groonga-delta/import-config.rb', line 86

def replication_client_user
  replication_client["user"]
end

#replication_slaveObject



95
96
97
# File 'lib/groonga-delta/import-config.rb', line 95

def replication_slave
  @data["replication_slave"] || @data
end

#replication_slave_passwordObject



103
104
105
106
# File 'lib/groonga-delta/import-config.rb', line 103

def replication_slave_password
  (@secret_data["replication_slave"] || @secret_data)["password"] ||
    replication_slave["password"]
end

#replication_slave_userObject



99
100
101
# File 'lib/groonga-delta/import-config.rb', line 99

def replication_slave_user
  replication_slave["user"]
end

#selectObject



108
109
110
# File 'lib/groonga-delta/import-config.rb', line 108

def select
  @data["select"] || @data
end

#select_passwordObject



116
117
118
119
# File 'lib/groonga-delta/import-config.rb', line 116

def select_password
  (@secret_data["select"] || @secret_data)["password"] ||
    select["password"]
end

#select_userObject



112
113
114
# File 'lib/groonga-delta/import-config.rb', line 112

def select_user
  select["user"]
end

#socketObject



70
71
72
# File 'lib/groonga-delta/import-config.rb', line 70

def socket
  @data["socket"]
end

#userObject



74
75
76
# File 'lib/groonga-delta/import-config.rb', line 74

def user
  @data["user"]
end