Interface FlushStrategy


public interface FlushStrategy
Allows to configure a strategy for when flushes should be happening.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final FlushStrategy
    Default FlushStrategy implementation.
  • Method Summary

    Modifier and Type
    Method
    Description
    afterNumBytes(int bytes)
    Implementation that flushes after a number of bytes.
    afterNumPackets(int packets)
    Implementation that flushes after a number of packets.
    boolean
    shouldFlushNow(int numPackets, int numBytes)
    Returns true if a flush should happen now, false otherwise.
  • Field Details

  • Method Details

    • shouldFlushNow

      boolean shouldFlushNow(int numPackets, int numBytes)
      Returns true if a flush should happen now, false otherwise.
      Parameters:
      numPackets - the number of packets that were written since the last flush.
      numBytes - the number of bytes that were written since the last flush.
      Returns:
      true if a flush should be done now, false otherwise.
    • afterNumBytes

      static FlushStrategy afterNumBytes(int bytes)
      Implementation that flushes after a number of bytes.
      Parameters:
      bytes - the number of bytes after which we should issue a flush.
      Returns:
      the FlushStrategy.
    • afterNumPackets

      static FlushStrategy afterNumPackets(int packets)
      Implementation that flushes after a number of packets.
      Parameters:
      packets - the number of packets after which we should issue a flush.
      Returns:
      the FlushStrategy.