GigaSpaces XAP 9.7.2 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 agentsToString(Collection<GridServiceAgent> agents)
           
static String agentToString(Admin admin, String agentUid)
           
static String agentToString(GridServiceAgent agent)
           
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 String failedAgentUidsToString(FutureGridServiceAgent[] futureAgents)
           
static String getAgentIpAddress(GridServiceAgent agent)
           
static Set<Long> getChildProcessesIds(GridServiceAgent agent)
           
static MachineCapacityRequirements getMachineCapacity(GridServiceAgent agent)
           
static CapacityRequirements getMachineTotalCapacity(GridServiceAgent agent, AbstractMachinesSlaPolicy sla)
           
static long getMemoryInMB(CapacityRequirements capacity)
           
static int getNumberOfChildContainersForProcessingUnit(GridServiceAgent agent, ProcessingUnit pu)
           
static CapacityRequirements getReservedCapacity(AbstractMachinesSlaPolicy sla, GridServiceAgent agent)
           
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 String reservationIdsToString(FutureGridServiceAgent[] futureAgents)
           
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)

agentToString

public static String agentToString(GridServiceAgent agent)

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)

getMachineCapacity

public static MachineCapacityRequirements getMachineCapacity(GridServiceAgent agent)

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)

getReservedCapacity

public static CapacityRequirements getReservedCapacity(AbstractMachinesSlaPolicy sla,
                                                       GridServiceAgent agent)

getAgentIpAddress

public static String getAgentIpAddress(GridServiceAgent agent)

agentsToString

public static String agentsToString(Collection<GridServiceAgent> agents)

reservationIdsToString

public static String reservationIdsToString(FutureGridServiceAgent[] futureAgents)

failedAgentUidsToString

public static String failedAgentUidsToString(FutureGridServiceAgent[] futureAgents)

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.