Class: SlateDb::Admin
- Inherits:
-
Object
- Object
- SlateDb::Admin
- Defined in:
- lib/slatedb/admin.rb
Class Method Summary collapse
-
.new(path, url: nil) ⇒ Admin
Create an admin handle for a database path/object store.
Instance Method Summary collapse
-
#create_checkpoint(lifetime: nil, source: nil, name: nil) ⇒ Hash
Create a detached checkpoint.
-
#delete_checkpoint(id) ⇒ void
Delete a checkpoint.
-
#list_checkpoints(name: nil) ⇒ Array<Hash>
List known checkpoints for the database.
-
#list_manifests(start: nil, end_id: nil) ⇒ String
List manifests within an optional [start, end) range as JSON.
-
#read_manifest(id = nil) ⇒ String?
Read the latest or a specific manifest as a JSON string.
-
#refresh_checkpoint(id, lifetime: nil) ⇒ void
Refresh a checkpoint’s lifetime.
-
#run_gc(min_age: nil) ⇒ void
Run garbage collection once.
Class Method Details
.new(path, url: nil) ⇒ Admin
Create an admin handle for a database path/object store.
16 17 18 |
# File 'lib/slatedb/admin.rb', line 16 def new(path, url: nil) _new(path, url) end |
Instance Method Details
#create_checkpoint(lifetime: nil, source: nil, name: nil) ⇒ Hash
Create a detached checkpoint.
60 61 62 63 64 65 66 |
# File 'lib/slatedb/admin.rb', line 60 def create_checkpoint(lifetime: nil, source: nil, name: nil) opts = {} opts[:lifetime] = lifetime if lifetime opts[:source] = source if source opts[:name] = name if name _create_checkpoint(opts) end |
#delete_checkpoint(id) ⇒ void
This method returns an undefined value.
Delete a checkpoint.
104 105 106 |
# File 'lib/slatedb/admin.rb', line 104 def delete_checkpoint(id) _delete_checkpoint(id) end |
#list_checkpoints(name: nil) ⇒ Array<Hash>
List known checkpoints for the database.
79 80 81 |
# File 'lib/slatedb/admin.rb', line 79 def list_checkpoints(name: nil) _list_checkpoints(name) end |
#list_manifests(start: nil, end_id: nil) ⇒ String
List manifests within an optional [start, end) range as JSON.
44 45 46 |
# File 'lib/slatedb/admin.rb', line 44 def list_manifests(start: nil, end_id: nil) _list_manifests(start, end_id) end |
#read_manifest(id = nil) ⇒ String?
Read the latest or a specific manifest as a JSON string.
30 31 32 |
# File 'lib/slatedb/admin.rb', line 30 def read_manifest(id = nil) _read_manifest(id) end |
#refresh_checkpoint(id, lifetime: nil) ⇒ void
This method returns an undefined value.
Refresh a checkpoint’s lifetime.
92 93 94 |
# File 'lib/slatedb/admin.rb', line 92 def refresh_checkpoint(id, lifetime: nil) _refresh_checkpoint(id, lifetime) end |
#run_gc(min_age: nil) ⇒ void
This method returns an undefined value.
Run garbage collection once.
116 117 118 119 120 |
# File 'lib/slatedb/admin.rb', line 116 def run_gc(min_age: nil) opts = {} opts[:min_age] = min_age if min_age _run_gc(opts) end |