GigaSpaces XAP 9.0 API

org.openspaces.grid.gsm.machines
Class MachinesSlaUtils

java.lang.Object
  extended by org.openspaces.grid.gsm.machines.MachinesSlaUtils

public class MachinesSlaUtils
extends Object


Constructor Summary
MachinesSlaUtils()
           
 
Method Summary
static String agentToString(Admin admin, String agentUid)
           
static Collection<GridServiceAgent> convertAgentUidsToAgents(Iterable<String> agentUids, Admin admin)
          Converts the specified agent UUIDs into GridServiceAgent objects.
static Collection<GridServiceAgent> convertAgentUidsToAgentsIfDiscovered(Iterable<String> agentUids, Admin admin)
          Converts the specified agent UUIDs into GridServiceAgent objects unless these agents are not discovered.
static org.openspaces.core.internal.commons.math.fraction.Fraction convertCpuCoresFromDoubleToFraction(double cpu)
           
static Set<Long> getChildProcessesIds(GridServiceAgent agent)
           
static CapacityRequirements getMachineTotalCapacity(GridServiceAgent agent, AbstractMachinesSlaPolicy sla)
           
static long getMemoryInMB(CapacityRequirements capacity)
           
static int getNumberOfChildContainersForProcessingUnit(GridServiceAgent agent, ProcessingUnit pu)
           
static String gscToString(GridComponent container)
           
static boolean isAgentAutoShutdownEnabled(GridServiceAgent agent)
           
static boolean isAgentConformsToMachineProvisioningConfig(GridServiceAgent agent, ElasticMachineProvisioningConfig machineProvisioningConfig)
          filters grid service agents by zone, and if configuration allows management machines, place them first
static boolean isManagementRunningOnMachine(Machine machine)
           
static String machinesToString(Collection<GridServiceAgent> agents)
           
static String machineToString(Machine machine)
           
static Collection<GridServiceAgent> sortAndFilterAgents(GridServiceAgent[] agents, ElasticMachineProvisioningConfig machineProvisioningConfig, Log logger)
           
static List<GridServiceAgent> sortManagementFirst(Collection<GridServiceAgent> agents)
          Sort all agents, place management machines first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MachinesSlaUtils

public MachinesSlaUtils()
Method Detail

getChildProcessesIds

public static Set<Long> getChildProcessesIds(GridServiceAgent agent)

isManagementRunningOnMachine

public static boolean isManagementRunningOnMachine(Machine machine)

sortManagementFirst

public static List<GridServiceAgent> sortManagementFirst(Collection<GridServiceAgent> agents)
Sort all agents, place management machines first.


agentToString

public static String agentToString(Admin admin,
                                   String agentUid)

machineToString

public static String machineToString(Machine machine)

gscToString

public static String gscToString(GridComponent container)

machinesToString

public static String machinesToString(Collection<GridServiceAgent> agents)

getMachineTotalCapacity

public static CapacityRequirements getMachineTotalCapacity(GridServiceAgent agent,
                                                           AbstractMachinesSlaPolicy sla)

convertCpuCoresFromDoubleToFraction

public static org.openspaces.core.internal.commons.math.fraction.Fraction convertCpuCoresFromDoubleToFraction(double cpu)

getNumberOfChildContainersForProcessingUnit

public static int getNumberOfChildContainersForProcessingUnit(GridServiceAgent agent,
                                                              ProcessingUnit pu)

convertAgentUidsToAgents

public static Collection<GridServiceAgent> convertAgentUidsToAgents(Iterable<String> agentUids,
                                                                    Admin admin)
Converts the specified agent UUIDs into GridServiceAgent objects.

Throws:
IllegalStateException - - if Agent with the specified uid has been removed

convertAgentUidsToAgentsIfDiscovered

public static Collection<GridServiceAgent> convertAgentUidsToAgentsIfDiscovered(Iterable<String> agentUids,
                                                                                Admin admin)
Converts the specified agent UUIDs into GridServiceAgent objects unless these agents are not discovered.


isAgentConformsToMachineProvisioningConfig

public static boolean isAgentConformsToMachineProvisioningConfig(GridServiceAgent agent,
                                                                 ElasticMachineProvisioningConfig machineProvisioningConfig)
filters grid service agents by zone, and if configuration allows management machines, place them first

Parameters:
agent - - the agent to check
machineProvisioningConfig -
Returns:
true if agent meets the sla filter, or false if not (and should be excluded)

getMemoryInMB

public static long getMemoryInMB(CapacityRequirements capacity)

isAgentAutoShutdownEnabled

public static boolean isAgentAutoShutdownEnabled(GridServiceAgent agent)

sortAndFilterAgents

public static Collection<GridServiceAgent> sortAndFilterAgents(GridServiceAgent[] agents,
                                                               ElasticMachineProvisioningConfig machineProvisioningConfig,
                                                               Log logger)

GigaSpaces XAP 9.0 API

Copyright © GigaSpaces.