public final class Util extends Object
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
static int |
autoReportPeriodMin()
Auto report self period.
|
static String |
clientVersion()
Returns the version of this client.
|
static <U> CompletableFuture<U> |
completedCf(U value)
Returns a new CompletableFuture that is already completed with the given
value.
|
static <U> CompletableFuture<U> |
errorCf(Throwable t)
Returns a new CompletableFuture that is already exceptionally with the given
error.
|
static SharedScheduledPool |
getSharedScheduledPool(String name,
int workers)
Create a shared scheduler pool with the given name.
|
static boolean |
isBulkWriteLogging()
Whether to output concise bulk write logs.
|
static boolean |
isWriteLogging()
Whether to output concise write logs.
|
static Properties |
loadProps(ClassLoader loader,
String name) |
static long |
randomInitialDelay(long delay) |
static boolean |
resetBulkWriteLogging()
See
isBulkWriteLogging()
Reset `bulkWriteLogging`, set to the opposite of the old value. |
static boolean |
resetWriteLogging()
See
isWriteLogging()
Reset `writeLogging`, set to the opposite of the old value. |
static void |
scheduleDisplaySelf(Display display,
Display.Printer printer)
Only used to schedule to display the self of client.
|
static boolean |
shouldNotRetry(Err err) |
static boolean |
shouldRetry(Err err) |
static <V> Observer<V> |
toObserver(CompletableFuture<V> future) |
public static boolean isWriteLogging()
public static boolean resetWriteLogging()
isWriteLogging()
Reset `writeLogging`, set to the opposite of the old value.public static boolean isBulkWriteLogging()
public static boolean resetBulkWriteLogging()
isBulkWriteLogging()
Reset `bulkWriteLogging`, set to the opposite of the old value.public static int autoReportPeriodMin()
public static void scheduleDisplaySelf(Display display, Display.Printer printer)
display
- displayprinter
- to print the display infopublic static SharedScheduledPool getSharedScheduledPool(String name, int workers)
name
- scheduled pool's nameworkers
- the num of workerspublic static <U> CompletableFuture<U> completedCf(U value)
CompletableFuture.completedFuture(Object)
, only
rename the method.U
- the type of the valuevalue
- the given valueCompletableFuture
public static <U> CompletableFuture<U> errorCf(Throwable t)
U
- the type of the valuet
- the given exceptionCompletableFuture
public static <V> Observer<V> toObserver(CompletableFuture<V> future)
public static long randomInitialDelay(long delay)
public static boolean shouldNotRetry(Err err)
public static boolean shouldRetry(Err err)
public static String clientVersion()
public static Properties loadProps(ClassLoader loader, String name) throws IOException
IOException
Copyright © 2025. All rights reserved.