public class GuavaFlinkConnectorRateLimiter extends Object implements FlinkConnectorRateLimiter
FlinkConnectorRateLimiter
that uses Guava's RateLimiter for rate
limiting.Constructor and Description |
---|
GuavaFlinkConnectorRateLimiter() |
Modifier and Type | Method and Description |
---|---|
void |
acquire(int permits)
Acquires permits for the rate limiter.
|
void |
close() |
long |
getRate() |
void |
open(RuntimeContext runtimeContext)
Creates a rate limiter with the runtime context provided.
|
void |
setRate(long globalRate)
Set the global per consumer and per sub-task rates.
|
public void open(RuntimeContext runtimeContext)
open
in interface FlinkConnectorRateLimiter
runtimeContext
- public void setRate(long globalRate)
setRate
in interface FlinkConnectorRateLimiter
globalRate
- Value of rate in bytes per second.public void acquire(int permits)
FlinkConnectorRateLimiter
acquire
in interface FlinkConnectorRateLimiter
public long getRate()
getRate
in interface FlinkConnectorRateLimiter
public void close()
close
in interface FlinkConnectorRateLimiter
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.