Package org.apache.ignite.examples
Class ExamplesUtils
- java.lang.Object
-
- org.apache.ignite.examples.ExamplesUtils
-
public class ExamplesUtils extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ExamplesUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcheckMinMemory(long min)Exits with code-1if maximum memory is below 90% of minimally allowed threshold.static booleancheckMinTopologySize(ClusterGroup grp, int size)Checks minimum topology size for running a certain example.static booleanhasServerNodes(Ignite ignite)Checks if cluster has server nodes.static voidprintQueryResults(java.util.List<?> res)Convenience method for printing query results.static java.net.URLurl(java.lang.String path)Returns URL resolved by class loader for classes in examples project.
-
-
-
Method Detail
-
checkMinMemory
public static void checkMinMemory(long min)
Exits with code-1if maximum memory is below 90% of minimally allowed threshold.- Parameters:
min- Minimum memory threshold.
-
url
public static java.net.URL url(java.lang.String path)
Returns URL resolved by class loader for classes in examples project.- Parameters:
path- Path to the resource.- Returns:
- Resolved URL.
-
checkMinTopologySize
public static boolean checkMinTopologySize(ClusterGroup grp, int size)
Checks minimum topology size for running a certain example.- Parameters:
grp- Cluster to check size for.size- Minimum number of nodes required to run a certain example.- Returns:
Trueif check passed,falseotherwise.
-
hasServerNodes
public static boolean hasServerNodes(Ignite ignite)
Checks if cluster has server nodes.- Parameters:
ignite- Ignite instance.- Returns:
Trueif cluster has server nodes,falseotherwise.
-
printQueryResults
public static void printQueryResults(java.util.List<?> res)
Convenience method for printing query results.- Parameters:
res- Query results.
-
-