Class 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 void checkMinMemory​(long min)
      Exits with code -1 if maximum memory is below 90% of minimally allowed threshold.
      static boolean checkMinTopologySize​(ClusterGroup grp, int size)
      Checks minimum topology size for running a certain example.
      static boolean hasServerNodes​(Ignite ignite)
      Checks if cluster has server nodes.
      static void printQueryResults​(java.util.List<?> res)
      Convenience method for printing query results.
      static java.net.URL url​(java.lang.String path)
      Returns URL resolved by class loader for classes in examples project.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ExamplesUtils

        public ExamplesUtils()
    • Method Detail

      • checkMinMemory

        public static void checkMinMemory​(long min)
        Exits with code -1 if 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:
        True if check passed, false otherwise.
      • hasServerNodes

        public static boolean hasServerNodes​(Ignite ignite)
        Checks if cluster has server nodes.
        Parameters:
        ignite - Ignite instance.
        Returns:
        True if cluster has server nodes, false otherwise.
      • printQueryResults

        public static void printQueryResults​(java.util.List<?> res)
        Convenience method for printing query results.
        Parameters:
        res - Query results.