Class: TimeBucketStream::Paths
- Inherits:
-
Object
- Object
- TimeBucketStream::Paths
- Defined in:
- lib/time_bucket_stream/paths.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #base ⇒ Object
- #claim_lock_for(log_name) ⇒ Object
- #claim_locks ⇒ Object
-
#initialize(path:) ⇒ Paths
constructor
A new instance of Paths.
- #log_for(writer_id) ⇒ Object
- #logs ⇒ Object
- #processing ⇒ Object
- #processing_log_for(log_name) ⇒ Object
- #quarantine ⇒ Object
- #quarantine_log_for(log_name) ⇒ Object
- #quarantine_metadata_for(log_name) ⇒ Object
Constructor Details
#initialize(path:) ⇒ Paths
Returns a new instance of Paths.
7 8 9 |
# File 'lib/time_bucket_stream/paths.rb', line 7 def initialize(path:) @path = normalize_path(path) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/time_bucket_stream/paths.rb', line 5 def path @path end |
Instance Method Details
#base ⇒ Object
11 12 13 |
# File 'lib/time_bucket_stream/paths.rb', line 11 def base path end |
#claim_lock_for(log_name) ⇒ Object
47 48 49 |
# File 'lib/time_bucket_stream/paths.rb', line 47 def claim_lock_for(log_name) File.join(claim_locks, "#{log_name}.lock") end |
#claim_locks ⇒ Object
27 28 29 |
# File 'lib/time_bucket_stream/paths.rb', line 27 def claim_locks @claim_locks ||= File.join(base, "claim_locks") end |
#log_for(writer_id) ⇒ Object
31 32 33 |
# File 'lib/time_bucket_stream/paths.rb', line 31 def log_for(writer_id) File.join(logs, "#{writer_id}.jsonl") end |
#logs ⇒ Object
15 16 17 |
# File 'lib/time_bucket_stream/paths.rb', line 15 def logs @logs ||= File.join(base, "logs") end |
#processing ⇒ Object
19 20 21 |
# File 'lib/time_bucket_stream/paths.rb', line 19 def processing @processing ||= File.join(base, "processing") end |
#processing_log_for(log_name) ⇒ Object
35 36 37 |
# File 'lib/time_bucket_stream/paths.rb', line 35 def processing_log_for(log_name) File.join(processing, log_name) end |
#quarantine ⇒ Object
23 24 25 |
# File 'lib/time_bucket_stream/paths.rb', line 23 def quarantine @quarantine ||= File.join(base, "quarantine") end |
#quarantine_log_for(log_name) ⇒ Object
39 40 41 |
# File 'lib/time_bucket_stream/paths.rb', line 39 def quarantine_log_for(log_name) File.join(quarantine, log_name) end |
#quarantine_metadata_for(log_name) ⇒ Object
43 44 45 |
# File 'lib/time_bucket_stream/paths.rb', line 43 def (log_name) File.join(quarantine, "#{log_name}.meta.json") end |