Class: TimeBucketStream::Paths

Inherits:
Object
  • Object
show all
Defined in:
lib/time_bucket_stream/paths.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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

#baseObject



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_locksObject



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

#logsObject



15
16
17
# File 'lib/time_bucket_stream/paths.rb', line 15

def logs
  @logs ||= File.join(base, "logs")
end

#processingObject



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

#quarantineObject



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