Class FeedProducer.Builder

  • Enclosing interface:
    FeedProducer

    public static class FeedProducer.Builder
    extends java.lang.Object
    • Method Detail

      • clock

        @NonNull
        public @NonNull FeedProducer.Builder clock​(@NonNull
                                                   @NonNull java.time.Clock clock)
        Use the given Clock when generating timestamps for new entities.
        Parameters:
        clock - the clock to use for timestamps
        Returns:
        this builder
      • assignPagesLimitPerRun

        @NonNull
        public @NonNull FeedProducer.Builder assignPagesLimitPerRun​(int limit)
        Set the maximum number of entities to load and assign in a single FeedProducer.assignPages() call.

        This setting exists to prevent out-of-memory errors if a large amount of unassigned entities have accumulated. It defaults to Integer.MAX_VALUE, i.e. in practice unlimited.

        Parameters:
        limit - the maximum number of entities to load and assign per run
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the argument is < 1
      • maxBytesPerPage

        @NonNull
        public @NonNull FeedProducer.Builder maxBytesPerPage​(long maxBytesPerPage)
        Set the maximum bytes per page. When a page is composed, a new page will be created if the current page gets too big. Defaults to 1 MB.
        Parameters:
        maxBytesPerPage - the maximum bytes per page. Must be equal or greater than 1.
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the argument is < 1
      • maxEntitiesPerPage

        @NonNull
        public @NonNull FeedProducer.Builder maxEntitiesPerPage​(long maxEntitiesPerPage)
        Set the maximum entities per page. When a page is composed, a new page will be created if the current page has too many entities. Defaults to Long.MAX_VALUE (meaning no limit).
        Parameters:
        maxEntitiesPerPage - the maximum number of entities per page. Must be equal or greater than 1.
        Returns:
        this builder
        Throws:
        java.lang.IllegalArgumentException - if the argument is < 1