public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
private static int |
POLLING_INTERVAL |
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isDeploymentDone(SpringCloudDeployment deployment) |
private static boolean |
isInteger(double sizeInGB) |
static <T> T |
pollUntil(Callable<T> callable,
java.util.function.Predicate<T> predicate,
int timeOutInSeconds)
Get resource repeatedly until it match the predicate or timeout, will return null when meet exception
with default pollingInterval = 1s
|
static <T> T |
pollUntil(Callable<T> callable,
java.util.function.Predicate<T> predicate,
int timeOutInSeconds,
int pollingInterval)
Get resource repeatedly until it match the predicate or timeout, will return null when meet exception
|
static String |
toCpuString(double cpuCount)
Converts cpu count from double to String
|
static String |
toMemoryString(double sizeInGB)
Converts memory count from double to String
|
private static final int POLLING_INTERVAL
public static boolean isDeploymentDone(@Nullable SpringCloudDeployment deployment)
public static <T> T pollUntil(Callable<T> callable, @Nonnull java.util.function.Predicate<T> predicate, int timeOutInSeconds)
callable - callable to get resourcepredicate - function that evaluate the resourcetimeOutInSeconds - max time for the methodpublic static <T> T pollUntil(Callable<T> callable, @Nonnull java.util.function.Predicate<T> predicate, int timeOutInSeconds, int pollingInterval)
callable - callable to get resourcepredicate - function that evaluate the resourcetimeOutInSeconds - max time for the methodpollingInterval - polling intervalpublic static String toCpuString(double cpuCount)
cpuCount - cpu count, 1 core can be represented by 1 or 1000mpublic static String toMemoryString(double sizeInGB)
sizeInGB - memory in GBprivate static boolean isInteger(double sizeInGB)
Copyright © 2024. All rights reserved.