Class KafkaAccessor

    • Field Detail

      • KAFKA_CONFIG_PREFIX

        public static final java.lang.String KAFKA_CONFIG_PREFIX
        See Also:
        Constant Field Values
      • POLL_INTERVAL_CFG

        public static final java.lang.String POLL_INTERVAL_CFG
        A poll interval in milliseconds.
        See Also:
        Constant Field Values
      • PARTITIONER_CLASS

        public static final java.lang.String PARTITIONER_CLASS
        Partitioner class for entity key-attribute pair.
        See Also:
        Constant Field Values
      • SERIALIZER_CLASS

        public static final java.lang.String SERIALIZER_CLASS
        Class performing parsing from (String, byte[]) to StreamElement. This kas to implement ElementSerializer interface.
        See Also:
        Constant Field Values
      • MAX_BYTES_PER_SEC

        public static final java.lang.String MAX_BYTES_PER_SEC
        Maximal read speed in bytes per second.
        See Also:
        Constant Field Values
      • MAX_POLL_RECORDS

        public static final java.lang.String MAX_POLL_RECORDS
        Number of records per poll()
        See Also:
        Constant Field Values
      • AUTO_COMMIT_INTERVAL_MS

        public static final java.lang.String AUTO_COMMIT_INTERVAL_MS
        Auto commit interval in milliseconds.
        See Also:
        Constant Field Values
      • LOG_STALE_COMMIT_INTERVAL_MS

        public static final java.lang.String LOG_STALE_COMMIT_INTERVAL_MS
        Log stale commit interval in milliseconds.
        See Also:
        Constant Field Values
      • ASSIGNMENT_TIMEOUT_MS

        public static final java.lang.String ASSIGNMENT_TIMEOUT_MS
        Timeout in milliseconds, that consumer should wait for group assignment before throwing an exception.
        See Also:
        Constant Field Values
      • EMPTY_POLL_TIME

        public static final java.lang.String EMPTY_POLL_TIME
        Minimal time poll() has to return empty records, before first moving watermark to processing time. This controls time needed to initialize kafka consumer.
        See Also:
        Constant Field Values
      • SEQUENCE_ID_HEADER

        public static final java.lang.String SEQUENCE_ID_HEADER
        A name for a header containing sequential ID of StreamElement (if any).
        See Also:
        Constant Field Values
    • Constructor Detail

      • KafkaAccessor

        public KafkaAccessor​(EntityDescriptor entity,
                             java.net.URI uri,
                             java.util.Map<java.lang.String,​java.lang.Object> cfg)
    • Method Detail

      • createConsumerFactory

        public <K,​V> KafkaConsumerFactory<K,​V> createConsumerFactory()
        Create kafka consumer with specific rebalance listener.
        Type Parameters:
        K - key type
        V - value type
        Returns:
        KafkaConsumerFactory for creating consumers
      • isAcceptable

        public boolean isAcceptable​(AttributeFamilyDescriptor familyDescriptor)
        Checker for kafka topics configuration
        Specified by:
        isAcceptable in interface DataAccessor
        Parameters:
        familyDescriptor - Attribute family descriptor.
        Returns:
        true if check succeeded, otherwise false
      • verifyCleanupPolicy

        public boolean verifyCleanupPolicy​(org.apache.kafka.clients.admin.ConfigEntry cleanupPolicy)
      • getCommitLogReader

        public java.util.Optional<CommitLogReader> getCommitLogReader​(Context context)
        Description copied from interface: DataAccessor
        Retrieve commit log reader (if applicable).
        Specified by:
        getCommitLogReader in interface DataAccessor
        Parameters:
        context - serializable context provided by repository
        Returns:
        optional @{link CommitLogReader} of this accessor
      • getCachedView

        public java.util.Optional<CachedView> getCachedView​(Context context)
        Description copied from interface: DataAccessor
        Retrieve cached view of the data.
        Specified by:
        getCachedView in interface DataAccessor
        Parameters:
        context - serializable context provided by repository
        Returns:
        optional CachedView of this accessor