Class RedisMemoryThreshold

java.lang.Object
io.debezium.server.redis.RedisMemoryThreshold

public class RedisMemoryThreshold extends Object
  • Field Details

    • LOGGER

      private static final org.slf4j.Logger LOGGER
    • INFO_MEMORY

      private static final String INFO_MEMORY
      See Also:
    • INFO_MEMORY_SECTION_MAXMEMORY

      private static final String INFO_MEMORY_SECTION_MAXMEMORY
      See Also:
    • INFO_MEMORY_SECTION_USEDMEMORY

      private static final String INFO_MEMORY_SECTION_USEDMEMORY
      See Also:
    • accumulatedMemory

      private static long accumulatedMemory
    • previouslyUsedMemory

      private static long previouslyUsedMemory
    • totalProcessed

      private static long totalProcessed
    • client

      private io.debezium.storage.redis.RedisClient client
    • memoryLimit

      private long memoryLimit
    • maximumMemory

      private long maximumMemory
  • Constructor Details

  • Method Details

    • setRedisClient

      public void setRedisClient(io.debezium.storage.redis.RedisClient client)
      Parameters:
      client -
    • checkMemory

      public boolean checkMemory(long extraMemory, int bufferSize, int bufferFillRate)
      Redis Enterprise samples the Redis database memory usage in an interval. Since the throughput of Redis is very big, it is impossible to rely on delayed memory usage reading to prevent OOM. In order to protect the Redis database and throttle down the sink we have created this mechanism:...
      Parameters:
      extraMemory - - Estimated size of a single record.
      bufferSize - - Number of records in a batch.
      bufferFillRate - - Rate in which memory can be filled.
      Returns:
    • memoryTuple

      private io.smallrye.mutiny.tuples.Tuple2<Long,Long> memoryTuple()
    • parseLong

      private Long parseLong(String name, String value)
    • getSizeInHumanReadableFormat

      public static String getSizeInHumanReadableFormat(Long size)
      Formats a raw file size value into a human-readable string with appropriate units (B, KB, MB, GB).
      Parameters:
      size - The size value to be formatted.
      Returns:
      A human-readable string representing the file size with units (B, KB, MB, GB).