GigaSpaces XAP 9.1 API

org.openspaces.grid.gsm.machines
Class MachinesSlaEnforcementState

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

public class MachinesSlaEnforcementState
extends Object


Nested Class Summary
static class MachinesSlaEnforcementState.StateKey
           
 
Constructor Summary
MachinesSlaEnforcementState()
           
 
Method Summary
 void addFutureAgents(MachinesSlaEnforcementState.StateKey key, FutureGridServiceAgent[] futureAgents, CapacityRequirements capacityRequirements)
           
 void addFutureStoppedMachine(MachinesSlaEnforcementState.StateKey key, FutureStoppedMachine futureStoppedMachine)
           
 void afterUndeployProcessingUnit(ProcessingUnit pu)
          Removes all state related to the specified processing unit Call this method only if you are not going to call any other state method on this pu
 void allocateCapacity(MachinesSlaEnforcementState.StateKey key, String agentUid, CapacityRequirements capacity)
           
 void beforeUndeployProcessingUnit(ProcessingUnit pu)
           
 void completedStateRecovery(MachinesSlaEnforcementState.StateKey key)
           
 void deallocateAgentCapacity(MachinesSlaEnforcementState.StateKey key, String agentUid)
           
 void deallocateCapacity(MachinesSlaEnforcementState.StateKey key, String agentUid, CapacityRequirements capacity)
           
 Collection<org.openspaces.grid.gsm.machines.GridServiceAgentFutures> getAllDoneFutureAgents(MachinesSlaEnforcementState.StateKey key)
           
 CapacityRequirementsPerAgent getAllocatedCapacity(MachinesSlaEnforcementState.StateKey key)
           
 CapacityRequirementsPerAgent getAllocatedCapacity(ProcessingUnit otherPu)
           
 CapacityRequirementsPerAgent getAllocatedCapacityOfOtherKeysFromSamePu(MachinesSlaEnforcementState.StateKey key)
           
 Collection<String> getAllUsedAgentUids()
          Lists all grid service agents from all processing units including those that are marked for deallocation.
 CapacityRequirementsPerAgent getAllUsedCapacity()
          Lists all capacity from all processing units including those that are marked for deallocation.
 CapacityRequirementsPerAgent getCapacityMarkedForDeallocation(MachinesSlaEnforcementState.StateKey key)
           
 Collection<org.openspaces.grid.gsm.machines.GridServiceAgentFutures> getFutureAgents(MachinesSlaEnforcementState.StateKey key)
           
 Set<ZonesConfig> getGridServiceAgentsZones(ProcessingUnit pu)
           
 ElasticProcessingUnitMachineIsolation getMachineIsolation(MachinesSlaEnforcementState.StateKey key)
           
 Collection<FutureStoppedMachine> getMachinesGoingDown()
           
 Collection<FutureStoppedMachine> getMachinesGoingDown(MachinesSlaEnforcementState.StateKey key)
           
 int getNumberOfFutureAgents(MachinesSlaEnforcementState.StateKey key)
           
 Map<String,List<String>> getRestrictedAgentUids(MachinesSlaEnforcementState.StateKey key)
           
 Map<MachinesSlaEnforcementState.StateKey,org.openspaces.grid.gsm.machines.MachinesSlaEnforcementState.StateValue> getStateForProcessingUnit(ProcessingUnit pu)
           
 Set<ZonesConfig> getUndeployedGridServiceAgentsZones(ProcessingUnit pu)
           
 Collection<String> getUsedAgentUids(MachinesSlaEnforcementState.StateKey key)
           
 Map<GridServiceAgent,Map<ProcessingUnit,CapacityRequirements>> groupCapacityPerProcessingUnitPerAgent(MachinesSlaEnforcementState.StateKey key)
           
 boolean isAgentSharedWithOtherProcessingUnits(ProcessingUnit pu, String agentUid)
           
 boolean isCompletedStateRecovery(MachinesSlaEnforcementState.StateKey key)
           
 boolean isFutureAgentsOfOtherSharedServices(MachinesSlaEnforcementState.StateKey key)
           
 boolean isHoldingStateForProcessingUnit(ProcessingUnit pu)
           
 boolean isRecoveredStateOnEsmStart(ProcessingUnit pu)
           
 void markAgentCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key, String uid)
           
 void markCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key, String agentUid, CapacityRequirements capacity)
           
 void recoveredStateOnEsmStart(ProcessingUnit otherPu)
           
 void removeFutureAgents(MachinesSlaEnforcementState.StateKey key, org.openspaces.grid.gsm.machines.GridServiceAgentFutures futureAgents)
           
 void removeFutureStoppedMachine(MachinesSlaEnforcementState.StateKey key, FutureStoppedMachine futureStoppedMachine)
           
 boolean replaceAllocatedCapacity(MachinesSlaEnforcementState.StateKey key, Admin admin)
          Changes the key.zone of the allocated capacity to match the exact zone of the agent
 void setMachineIsolation(MachinesSlaEnforcementState.StateKey key, ElasticProcessingUnitMachineIsolation isolation)
           
 void unmarkCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key, String agentUid, CapacityRequirements capacity)
           
 void validateUndeployNotInProgress(ProcessingUnit pu)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MachinesSlaEnforcementState

public MachinesSlaEnforcementState()
Method Detail

isHoldingStateForProcessingUnit

public boolean isHoldingStateForProcessingUnit(ProcessingUnit pu)

addFutureAgents

public void addFutureAgents(MachinesSlaEnforcementState.StateKey key,
                            FutureGridServiceAgent[] futureAgents,
                            CapacityRequirements capacityRequirements)

allocateCapacity

public void allocateCapacity(MachinesSlaEnforcementState.StateKey key,
                             String agentUid,
                             CapacityRequirements capacity)

markCapacityForDeallocation

public void markCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key,
                                        String agentUid,
                                        CapacityRequirements capacity)

unmarkCapacityForDeallocation

public void unmarkCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key,
                                          String agentUid,
                                          CapacityRequirements capacity)

deallocateCapacity

public void deallocateCapacity(MachinesSlaEnforcementState.StateKey key,
                               String agentUid,
                               CapacityRequirements capacity)

getCapacityMarkedForDeallocation

public CapacityRequirementsPerAgent getCapacityMarkedForDeallocation(MachinesSlaEnforcementState.StateKey key)

getAllocatedCapacity

public CapacityRequirementsPerAgent getAllocatedCapacity(MachinesSlaEnforcementState.StateKey key)

getAllocatedCapacityOfOtherKeysFromSamePu

public CapacityRequirementsPerAgent getAllocatedCapacityOfOtherKeysFromSamePu(MachinesSlaEnforcementState.StateKey key)

getNumberOfFutureAgents

public int getNumberOfFutureAgents(MachinesSlaEnforcementState.StateKey key)

getFutureAgents

public Collection<org.openspaces.grid.gsm.machines.GridServiceAgentFutures> getFutureAgents(MachinesSlaEnforcementState.StateKey key)

getAllDoneFutureAgents

public Collection<org.openspaces.grid.gsm.machines.GridServiceAgentFutures> getAllDoneFutureAgents(MachinesSlaEnforcementState.StateKey key)

getAllUsedAgentUids

public Collection<String> getAllUsedAgentUids()
Lists all grid service agents from all processing units including those that are marked for deallocation.


getAllUsedCapacity

public CapacityRequirementsPerAgent getAllUsedCapacity()
Lists all capacity from all processing units including those that are marked for deallocation.


isAgentSharedWithOtherProcessingUnits

public boolean isAgentSharedWithOtherProcessingUnits(ProcessingUnit pu,
                                                     String agentUid)
Returns:
true if processing units other than the specified PU, also use the specified agent. false otherwise.

getMachinesGoingDown

public Collection<FutureStoppedMachine> getMachinesGoingDown(MachinesSlaEnforcementState.StateKey key)

markAgentCapacityForDeallocation

public void markAgentCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key,
                                             String uid)

deallocateAgentCapacity

public void deallocateAgentCapacity(MachinesSlaEnforcementState.StateKey key,
                                    String agentUid)

getRestrictedAgentUids

public Map<String,List<String>> getRestrictedAgentUids(MachinesSlaEnforcementState.StateKey key)
Parameters:
exactZones - - the exact zones that the grid service agent should have
Returns:
all Grid Service Agent UIDs that the specified PU cannot be deploy on due to machine isolation restrictions or due to the fact that the machine is about to be deployed by another PU that started it. The map keys contain the agent UIDs, and the map values contains the reasons for the restriction.

removeFutureAgents

public void removeFutureAgents(MachinesSlaEnforcementState.StateKey key,
                               org.openspaces.grid.gsm.machines.GridServiceAgentFutures futureAgents)

removeFutureStoppedMachine

public void removeFutureStoppedMachine(MachinesSlaEnforcementState.StateKey key,
                                       FutureStoppedMachine futureStoppedMachine)

getMachinesGoingDown

public Collection<FutureStoppedMachine> getMachinesGoingDown()

addFutureStoppedMachine

public void addFutureStoppedMachine(MachinesSlaEnforcementState.StateKey key,
                                    FutureStoppedMachine futureStoppedMachine)

getUsedAgentUids

public Collection<String> getUsedAgentUids(MachinesSlaEnforcementState.StateKey key)

setMachineIsolation

public void setMachineIsolation(MachinesSlaEnforcementState.StateKey key,
                                ElasticProcessingUnitMachineIsolation isolation)

getMachineIsolation

public ElasticProcessingUnitMachineIsolation getMachineIsolation(MachinesSlaEnforcementState.StateKey key)

isCompletedStateRecovery

public boolean isCompletedStateRecovery(MachinesSlaEnforcementState.StateKey key)

completedStateRecovery

public void completedStateRecovery(MachinesSlaEnforcementState.StateKey key)

recoveredStateOnEsmStart

public void recoveredStateOnEsmStart(ProcessingUnit otherPu)

isRecoveredStateOnEsmStart

public boolean isRecoveredStateOnEsmStart(ProcessingUnit pu)

getGridServiceAgentsZones

public Set<ZonesConfig> getGridServiceAgentsZones(ProcessingUnit pu)

getUndeployedGridServiceAgentsZones

public Set<ZonesConfig> getUndeployedGridServiceAgentsZones(ProcessingUnit pu)

groupCapacityPerProcessingUnitPerAgent

public Map<GridServiceAgent,Map<ProcessingUnit,CapacityRequirements>> groupCapacityPerProcessingUnitPerAgent(MachinesSlaEnforcementState.StateKey key)

getAllocatedCapacity

public CapacityRequirementsPerAgent getAllocatedCapacity(ProcessingUnit otherPu)

replaceAllocatedCapacity

public boolean replaceAllocatedCapacity(MachinesSlaEnforcementState.StateKey key,
                                        Admin admin)
Changes the key.zone of the allocated capacity to match the exact zone of the agent

Returns:
false if nothing changed, true if replace occurred

beforeUndeployProcessingUnit

public void beforeUndeployProcessingUnit(ProcessingUnit pu)

afterUndeployProcessingUnit

public void afterUndeployProcessingUnit(ProcessingUnit pu)
Removes all state related to the specified processing unit Call this method only if you are not going to call any other state method on this pu


getStateForProcessingUnit

public Map<MachinesSlaEnforcementState.StateKey,org.openspaces.grid.gsm.machines.MachinesSlaEnforcementState.StateValue> getStateForProcessingUnit(ProcessingUnit pu)

validateUndeployNotInProgress

public void validateUndeployNotInProgress(ProcessingUnit pu)
                                   throws UndeployInProgressException
Throws:
UndeployInProgressException

isFutureAgentsOfOtherSharedServices

public boolean isFutureAgentsOfOtherSharedServices(MachinesSlaEnforcementState.StateKey key)
Returns:
true - If there are future machines in other keys that can be shared with this key

GigaSpaces XAP 9.1 API

Copyright © GigaSpaces.