Class: BlobReader
- Inherits:
-
LinearReader
- Object
- LinearReader
- BlobReader
- Defined in:
- lib/logstash/inputs/azureblob.rb
Overview
class LogStash::Inputs::LogstashInputAzureblob
Instance Method Summary collapse
-
#initialize(logger, azure_blob, container, blob_name, chunk_size, blob_start_index, blob_end_index) ⇒ BlobReader
constructor
A new instance of BlobReader.
- #read ⇒ Object
Constructor Details
#initialize(logger, azure_blob, container, blob_name, chunk_size, blob_start_index, blob_end_index) ⇒ BlobReader
Returns a new instance of BlobReader.
484 485 486 487 488 489 490 491 492 |
# File 'lib/logstash/inputs/azureblob.rb', line 484 def initialize(logger, azure_blob, container, blob_name, chunk_size, blob_start_index, blob_end_index) @logger = logger @azure_blob = azure_blob @container = container @blob_name = blob_name @blob_start_index = blob_start_index @blob_end_index = blob_end_index @chunk_size = chunk_size end |
Instance Method Details
#read ⇒ Object
494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
# File 'lib/logstash/inputs/azureblob.rb', line 494 def read if @blob_end_index < @blob_start_index return nil, false end are_more_bytes_available = false if @blob_end_index >= @blob_start_index + @chunk_size end_index = @blob_start_index + @chunk_size - 1 are_more_bytes_available = true else end_index = @blob_end_index end content = read_from_blob(@blob_start_index, end_index) @blob_start_index = end_index + 1 return content, are_more_bytes_available end |