Class WebsocketReader

    • Constructor Detail

      • WebsocketReader

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

      • getPartitions

        public java.util.List<Partition> getPartitions()
        Description copied from interface: CommitLogReader
        Retrieve list of partitions of this commit log.
        Specified by:
        getPartitions in interface CommitLogReader
        Returns:
        list of partitions of this reader
      • observe

        public ObserveHandle observe​(java.lang.String name,
                                     Position position,
                                     CommitLogObserver observer)
        Description copied from interface: CommitLogReader
        Subscribe observer by name to the commit log. Each observer maintains its own position in the commit log, so that the observers with different names do not interfere If multiple observers share the same name, then the ingests are load-balanced between them (in an undefined manner). This is a non blocking call.
        Specified by:
        observe in interface CommitLogReader
        Parameters:
        name - identifier of the consumer
        position - the position to seek for in the commit log
        observer - the observer to subscribe to the commit log
        Returns:
        ObserveHandle to asynchronously cancel the observation
      • observePartitions

        public ObserveHandle observePartitions​(java.lang.String name,
                                               java.util.Collection<Partition> partitions,
                                               Position position,
                                               boolean stopAtCurrent,
                                               CommitLogObserver observer)
        Description copied from interface: CommitLogReader
        Subscribe to given set of partitions. If you use this call then the reader stops being automatically load balanced and the set of partitions can only be changed by call to this method again.
        Specified by:
        observePartitions in interface CommitLogReader
        Parameters:
        name - name of the observer
        partitions - the list of partitions to subscribe to
        position - the position to seek to in the partitions
        stopAtCurrent - when true then stop the observer as soon as it reaches most recent record
        observer - the observer to subscribe to the partitions
        Returns:
        ObserveHandle to asynchronously cancel the observation
      • observeBulk

        public ObserveHandle observeBulk​(java.lang.String name,
                                         Position position,
                                         boolean stopAtCurrent,
                                         CommitLogObserver observer)
        Description copied from interface: CommitLogReader
        Subscribe to the commit log in a bulk fashion. That implies that elements are not committed one-by-one, but in a bulks, where all elements in a bulk are committed at once. This is useful for micro-batching approach of data processing.
        Specified by:
        observeBulk in interface CommitLogReader
        Parameters:
        name - name of the observer
        position - the position to seek to in the partitions
        stopAtCurrent - when true then stop the observer as soon as it reaches most recent record
        observer - the observer to subscribe
        Returns:
        ObserveHandle to asynchronously cancel the observation
      • observeBulkPartitions

        public ObserveHandle observeBulkPartitions​(java.lang.String name,
                                                   java.util.Collection<Partition> partitions,
                                                   Position position,
                                                   boolean stopAtCurrent,
                                                   CommitLogObserver observer)
        Description copied from interface: CommitLogReader
        Subscribe to given partitions in a bulk fashion.
        Specified by:
        observeBulkPartitions in interface CommitLogReader
        Parameters:
        name - name of the observer
        partitions - the partitions to subscribe to
        position - the position to seek to in the partitions
        stopAtCurrent - when true then stop the observer as soon as it reaches most recent record
        observer - the observer to subscribe to the partitions
        Returns:
        ObserveHandle to asynchronously cancel the observation