GigaSpaces XAP 9.7.2 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.RecoveryState
           
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 addMachineFailureFutures(MachinesSlaEnforcementState.StateKey key, FutureMachineFailure[] machineFailureFutures)
           
 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)
           
 String disableFailoverDetection(String ipAddress, String agentUid)
           
 String enableFailoverDetection(String ipAddress)
           
 void failedRecoveredStateOnEsmStart(ProcessingUnit otherPu)
           
 void fromMachinesState(MachinesState state)
           
 Object getAgentContext(String agentUid)
           
 RecoveringFailedGridServiceAgent[] getAgentsMarkedAsFailed(MachinesSlaEnforcementState.StateKey key)
           
 RecoveringFailedGridServiceAgent[] getAgentsMarkedAsFailedNotBeingRecovered(MachinesSlaEnforcementState.StateKey key)
           
 String getAgentWithDisabledFailoverDetectionForIpAddress(String ipAddress)
           
 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)
           
 FutureCleanupCloudResources getCleanupFuture(ProcessingUnit pu)
           
 Collection<org.openspaces.grid.gsm.machines.GridServiceAgentFutures> getFutureAgents(MachinesSlaEnforcementState.StateKey key)
           
 Set<ZonesConfig> getGridServiceAgentsZones(ProcessingUnit pu)
           
 Collection<FutureMachineFailure> getMachineFailureFutures(MachinesSlaEnforcementState.StateKey key)
           
 ElasticProcessingUnitMachineIsolation getMachineIsolation(MachinesSlaEnforcementState.StateKey key)
           
 Collection<FutureStoppedMachine> getMachinesGoingDown()
           
 Collection<FutureStoppedMachine> getMachinesGoingDown(MachinesSlaEnforcementState.StateKey key)
           
 int getNumberOfFutureAgents(MachinesSlaEnforcementState.StateKey key)
           
 MachinesSlaEnforcementState.RecoveryState getRecoveredStateOnEsmStart(ProcessingUnit pu)
           
 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)
           
 long getVersion()
           
 Map<GridServiceAgent,Map<ProcessingUnit,CapacityRequirements>> groupCapacityPerProcessingUnitPerAgent(MachinesSlaEnforcementState.StateKey key)
           
 boolean isAgentFailoverDisabled(String agentUid)
           
 boolean isAgentSharedWithOtherProcessingUnits(ProcessingUnit pu, String agentUid)
           
 boolean isCompletedStateRecovery(MachinesSlaEnforcementState.StateKey key)
           
 boolean isFutureAgentsOfOtherSharedServices(MachinesSlaEnforcementState.StateKey key)
           
 boolean isHoldingStateForProcessingUnit(ProcessingUnit pu)
           
 void markAgentAsFailed(MachinesSlaEnforcementState.StateKey key, String agentUid)
           
 void markAgentRestrictedForPu(MachinesSlaEnforcementState.StateKey key, String agentUid)
           
 void markCapacityForDeallocation(MachinesSlaEnforcementState.StateKey key, String agentUid, CapacityRequirements capacity)
           
 void recoveredStateOnEsmStart(ProcessingUnit otherPu)
           
 void removeFutureStoppedMachine(MachinesSlaEnforcementState.StateKey key, FutureStoppedMachine futureStoppedMachine)
           
 void removeMachineFailureFuture(MachinesSlaEnforcementState.StateKey key, FutureMachineFailure machineFailureFuture)
           
 void removeSuccesfullyStartedFutureAgents(MachinesSlaEnforcementState.StateKey key, org.openspaces.grid.gsm.machines.GridServiceAgentFutures doneFutureAgents)
           
 boolean replaceAllocatedCapacity(MachinesSlaEnforcementState.StateKey key, Admin admin)
          Changes the key.zone of the allocated capacity to match the exact zone of the agent
 void replaceAllocation(String otherAgentUid, String newAgentUid)
           
 void setCleanupFuture(ProcessingUnit pu, FutureCleanupCloudResources future)
           
 void setMachineIsolation(MachinesSlaEnforcementState.StateKey key, ElasticProcessingUnitMachineIsolation isolation)
           
 MachinesState toMachinesState()
           
 void unmarkAgentAsFailed(MachinesSlaEnforcementState.StateKey key, String agentUid)
           
 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)

addMachineFailureFutures

public void addMachineFailureFutures(MachinesSlaEnforcementState.StateKey key,
                                     FutureMachineFailure[] machineFailureFutures)

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)

getMachineFailureFutures

public Collection<FutureMachineFailure> getMachineFailureFutures(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)

markAgentAsFailed

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

markAgentRestrictedForPu

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

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.

removeSuccesfullyStartedFutureAgents

public void removeSuccesfullyStartedFutureAgents(MachinesSlaEnforcementState.StateKey key,
                                                 org.openspaces.grid.gsm.machines.GridServiceAgentFutures doneFutureAgents)

unmarkAgentAsFailed

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

getAgentContext

public Object getAgentContext(String agentUid)

removeFutureStoppedMachine

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

removeMachineFailureFuture

public void removeMachineFailureFuture(MachinesSlaEnforcementState.StateKey key,
                                       FutureMachineFailure machineFailureFuture)

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)

failedRecoveredStateOnEsmStart

public void failedRecoveredStateOnEsmStart(ProcessingUnit otherPu)

getRecoveredStateOnEsmStart

public MachinesSlaEnforcementState.RecoveryState getRecoveredStateOnEsmStart(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

getAgentsMarkedAsFailedNotBeingRecovered

public RecoveringFailedGridServiceAgent[] getAgentsMarkedAsFailedNotBeingRecovered(MachinesSlaEnforcementState.StateKey key)

getAgentsMarkedAsFailed

public RecoveringFailedGridServiceAgent[] getAgentsMarkedAsFailed(MachinesSlaEnforcementState.StateKey key)

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

getCleanupFuture

public FutureCleanupCloudResources getCleanupFuture(ProcessingUnit pu)

setCleanupFuture

public void setCleanupFuture(ProcessingUnit pu,
                             FutureCleanupCloudResources future)

disableFailoverDetection

public String disableFailoverDetection(String ipAddress,
                                       String agentUid)
Returns:
true - if was previously not disabled and now is disabled false- if already was disabled

enableFailoverDetection

public String enableFailoverDetection(String ipAddress)

isAgentFailoverDisabled

public boolean isAgentFailoverDisabled(String agentUid)

getAgentWithDisabledFailoverDetectionForIpAddress

public String getAgentWithDisabledFailoverDetectionForIpAddress(String ipAddress)

replaceAllocation

public void replaceAllocation(String otherAgentUid,
                              String newAgentUid)

toMachinesState

public MachinesState toMachinesState()
Returns:
A map that can be saved into the space. Note: If you change this method, change also #fromDocumentProperties and update #version properly.

fromMachinesState

public void fromMachinesState(MachinesState state)

getVersion

public long getVersion()

GigaSpaces XAP 9.7.2 API

Copyright © GigaSpaces.