Sha256: a878469a584ff6cf36cd039f5595f7413a95e4268a1d85dd51628e44502fbe27

Contents?: true

Size: 690 Bytes

Versions: 14

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8
require "logstash/util/loggable"

module LogStash
  module Inputs
    module Azure
      class LookBackPositionProvider

        java_import com.microsoft.azure.eventhubs.EventPosition
        java_import java.time.Instant

        include java.util.function.Function
        include LogStash::Util::Loggable

        def initialize(look_back_seconds)
          @logger = self.logger
          @look_back = Instant.ofEpochSecond(Instant.now.getEpochSecond - look_back_seconds.to_i)
          @logger.debug("Look back date/time: #{@look_back}")
        end

        def apply(t)
          EventPosition.fromEnqueuedTime(@look_back);
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
logstash-input-azure_event_hubs-1.5.0 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.9 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.8 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.7 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.6 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.5 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.4 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.3 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.2 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.1 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.4.0 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.3.0 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.2.3 lib/logstash/inputs/look_back_position_provider.rb
logstash-input-azure_event_hubs-1.2.2 lib/logstash/inputs/look_back_position_provider.rb