Class: Higgs::StorageManager

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/higgs/sman.rb

Overview

storage manager

the front end of these classes.

  • Higgs::Storage

  • Higgs::TransactionManager

  • Higgs::RemoteServices

these methods are delegated to Higgs::Storage.

  • Higgs::Storage#name

  • Higgs::Storage#number_of_read_io

  • Higgs::Storage#data_hash_type

  • Higgs::Storage#jlog_sync

  • Higgs::Storage#jlog_hash_type

  • Higgs::Storage#jlog_rotate_size

  • Higgs::Storage#jlog_rotate_max

  • Higgs::Storage#shutdown?

  • Higgs::Storage#alive?

  • Higgs::Storage#change_number

  • Higgs::Storage#rotate_journal_log

these methods are delegated to Higgs::TransactionManager.

  • Higgs::TransactionManager#read_only

  • Higgs::TransactionManager#transaction

  • Higgs::TransactionManager#apply_journal_log

  • Higgs::TransactionManager#switch_to_write

these methods are delegated to Higgs::RemoteServices.

  • Higgs::RemoteServices#remote_services_uri

Direct Known Subclasses

DBM, Store

Constant Summary collapse

CVS_ID =

for ident(1)

'$Id: sman.rb 841 2008-12-24 09:23:20Z toki $'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, options = {}) ⇒ StorageManager

name is a storage name and see Higgs::Storage.new for detail. see Higgs::Storage::InitOptions, Higgs::TransactionManager::InitOptions and Higgs::RemoteServices.new for options.



55
56
57
58
59
60
61
62
# File 'lib/higgs/sman.rb', line 55

def initialize(name, options={})
  @storage = Storage.new(name, options)
  @tman = TransactionManager.new(@storage, options)
  options = options.dup
  options[:storage] = @storage
  options[:transaction_manager] = @tman
  @services = RemoteServices.new(options)
end

Class Method Details

.open(*args) ⇒ Object



87
88
89
90
91
92
93
94
95
# File 'lib/higgs/sman.rb', line 87

def self.open(*args)
  sman = new(*args)
  begin
    r = yield(sman)
  ensure
    sman.shutdown
  end
  r
end

Instance Method Details

#shutdownObject



81
82
83
84
85
# File 'lib/higgs/sman.rb', line 81

def shutdown
  @storage.shutdown
  @services.shutdown
  nil
end