Package org.apache.flink.api.common.io
Class SinkUtils
- java.lang.Object
-
- org.apache.flink.api.common.io.SinkUtils
-
- All Implemented Interfaces:
Serializable
@Experimental public class SinkUtils extends Object implements Serializable
Utility class for sinks.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SinkUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidtryAcquire(int permits, int maxConcurrentRequests, java.time.Duration maxConcurrentRequestsTimeout, Semaphore semaphore)Acquire permits on the given semaphore within a given allowed timeout and deal with errors.
-
-
-
Method Detail
-
tryAcquire
public static void tryAcquire(int permits, int maxConcurrentRequests, java.time.Duration maxConcurrentRequestsTimeout, Semaphore semaphore) throws InterruptedException, TimeoutExceptionAcquire permits on the given semaphore within a given allowed timeout and deal with errors.- Parameters:
permits- the mumber of permits to acquire.maxConcurrentRequests- the maximum number of permits the semaphore was initialized with.maxConcurrentRequestsTimeout- the timeout to acquire the permits.semaphore- the semaphore to acquire permits to.- Throws:
InterruptedException- if the current thread was interrupted.TimeoutException- if the waiting time elapsed before all permits were acquired.
-
-