Class IngestionThrottler
- java.lang.Object
-
- com.linkedin.davinci.kafka.consumer.IngestionThrottler
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
public class IngestionThrottler extends java.lang.Object implements java.io.Closeable
This throttler has the following functionality: 1. When running in DaVinci mode, if there are active current version bootstrapping with speedup mode is on, this ingestion throttler will switch to speedup throttler. 2. Otherwise, this class will switch to regular throttler. This throttler is supposed to be adaptive throttler to speed up the DaVinci bootstrapping and fall back to the regular mode when the bootstrapping is done.
-
-
Constructor Summary
Constructors Constructor Description IngestionThrottler(boolean isDaVinciClient, VeniceServerConfig serverConfig, java.util.function.Supplier<java.util.Map<java.lang.String,StoreIngestionTask>> ongoingIngestionTaskMapSupplier)
IngestionThrottler(boolean isDaVinciClient, VeniceServerConfig serverConfig, java.util.function.Supplier<java.util.Map<java.lang.String,StoreIngestionTask>> ongoingIngestionTaskMapSupplier, int checkInterval, java.util.concurrent.TimeUnit checkTimeUnit)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
isUsingSpeedupThrottler()
void
maybeThrottleBandwidth(int totalBytes)
void
maybeThrottleRecordRate(ConsumerPoolType poolType, int count)
-
-
-
Constructor Detail
-
IngestionThrottler
public IngestionThrottler(boolean isDaVinciClient, VeniceServerConfig serverConfig, java.util.function.Supplier<java.util.Map<java.lang.String,StoreIngestionTask>> ongoingIngestionTaskMapSupplier)
-
IngestionThrottler
public IngestionThrottler(boolean isDaVinciClient, VeniceServerConfig serverConfig, java.util.function.Supplier<java.util.Map<java.lang.String,StoreIngestionTask>> ongoingIngestionTaskMapSupplier, int checkInterval, java.util.concurrent.TimeUnit checkTimeUnit)
-
-
Method Detail
-
maybeThrottleRecordRate
public void maybeThrottleRecordRate(ConsumerPoolType poolType, int count)
-
maybeThrottleBandwidth
public void maybeThrottleBandwidth(int totalBytes)
-
isUsingSpeedupThrottler
public boolean isUsingSpeedupThrottler()
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-