Interface ProcessingUnitInstance

All Superinterfaces:
AdminAware, DiscoverableComponent, GridComponent, Iterable<ServiceDetails>, MachineAware, OperatingSystemAware, StatisticsMonitor, TransportAware, VirtualMachineAware, ZoneAware
All Known Subinterfaces:
InternalProcessingUnitInstance
All Known Implementing Classes:
DefaultProcessingUnitInstance

public interface ProcessingUnitInstance extends GridComponent, Iterable<ServiceDetails>, StatisticsMonitor
A processing unit instance is an actual running instance of a processing unit. For example, when deploying a processing unit with 4 instance, there will be eventually 4 instances of the processing unit.
Author:
kimchy
  • Method Details

    • getId

      String getId()
      Returns the Processing unit instance Identifier
      Since:
      12.1
    • getProcessingUnitInstanceName

      String getProcessingUnitInstanceName()
      Get this processing unit instance String representation.
      If this processing unit instance represents a Space instance, this method will return a similar result to SpaceInstance.getSpaceInstanceName(), but with the processing unit name as the Space name. Otherwise, it will return: {Processing unit name} [instance id] - the name of this processing unit (see getName()) and the instance id (see getInstanceId()); for example, MyPU [3]
      Returns:
      this processing unit instance String representation.
      Since:
      8.0.5
    • destroy

      void destroy()
      Destroy the instance. If breaches the SLA, will instantiate the instance again.
    • decrement

      void decrement()
      Decrements the instance (and destroying it in the process). Will not attempt to create it again. Does not apply for partitioned nor replicated topologies.
      See Also:
    • relocate

      void relocate(GridServiceContainer gridServiceContainerToRelocateTo)
      Relocates the instance to the provided GridServiceContainer.

      Note, the current processing instance is unusable once this call has been made. If the relocated processing unit instance is needed, or waiting for the relocation is required, use relocateAndWait(org.openspaces.admin.gsc.GridServiceContainer) or relocateAndWait(org.openspaces.admin.gsc.GridServiceContainer, long, java.util.concurrent.TimeUnit).

    • relocateAndWait

      ProcessingUnitInstance relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo)
      Relocates the instance to the provided GridServiceContainer. The relocated instance will be returned waiting for it indefinitely.
    • relocateAndWait

      ProcessingUnitInstance relocateAndWait(GridServiceContainer gridServiceContainerToRelocateTo, long timeout, TimeUnit timeUnit)
      Relocates the instance to the provided GridServiceContainer. The relocated instance will be returned waiting for it for the provided timeout.
    • relocate

      void relocate()
      Relocates the instance to any suitable GridServiceContainer.

      Note, the current processing instance is unusable once this call has been made. If the relocated processing unit instance is needed, or waiting for the relocation is required, use relocateAndWait() or relocateAndWait(long, java.util.concurrent.TimeUnit) .

    • relocateAndWait

      ProcessingUnitInstance relocateAndWait()
      Relocates the any suitable GridServiceContainer. The relocated instance will be returned waiting for it indefinitely.
    • relocateAndWait

      ProcessingUnitInstance relocateAndWait(long timeout, TimeUnit timeUnit)
      Relocates the any suitable GridServiceContainer. The relocated instance will be returned waiting for it for the provided timeout.
    • restart

      void restart()
      Restarts the processing unit instance. Note, if this instance is running an embedded space instance, and the space instance is primary and there is a backup around as well, this method is handy to "turn" the backup to primary.

      Note, the current processing unit instance is unusable once this call has been made. If the restarted processing unit instance is needed, or waiting for the restart is required, use restartAndWait() or restartAndWait(long, java.util.concurrent.TimeUnit).

    • restartAndWait

      ProcessingUnitInstance restartAndWait()
      Restarts the processing unit instance and waits indefinitely for the restarted processing unit instance returning it.
      See Also:
    • restartAndWait

      ProcessingUnitInstance restartAndWait(long timeout, TimeUnit timeUnit)
      Restarts the processing unit instance and waits for the restarted processing unit instance returning it for the provided timeout.
      See Also:
    • getInstanceId

      int getInstanceId()
      Returns the instance id of the processing unit instance.
    • getBackupId

      int getBackupId()
      Returns the backup id of the processing unit instance.
    • getProcessingUnit

      ProcessingUnit getProcessingUnit()
      Returns the processing unit this processing unit instance belongs to.
    • getName

      String getName()
      Returns the name of the processing unit.
    • getClusterInfo

      ClusterInfo getClusterInfo()
      Returns the cluster info of the processing unit instance.
    • getProperties

      BeanLevelProperties getProperties()
      Return the properties the processing unit was deployed with.
    • getGridServiceContainer

      GridServiceContainer getGridServiceContainer()
      Returns the GridServiceContainer the processing unit is running on.
    • getPartition

      ProcessingUnitPartition getPartition()
      Returns the processing unit partition this processing unit instance is part of.
    • getServiceDetailsByServiceId

      ServiceDetails getServiceDetailsByServiceId(String serviceId)
      Returns the service details for a specific service id.
    • getServiceDetailsByServiceId

      Map<String,ServiceDetails> getServiceDetailsByServiceId()
      Returns a map of service details by service id.
    • getServicesDetailsByServiceType

      ServiceDetails[] getServicesDetailsByServiceType(String serviceType)
      Returns the service details by a service type ServiceDetails.getServiceType().
    • getServiceDetailsByServiceType

      Map<String,ServiceDetails[]> getServiceDetailsByServiceType()
      Returns a map of service details by service type.
    • getEventContainerDetails

      Map<String,EventContainerServiceDetails> getEventContainerDetails()
      Returns a map of EventContainerServiceDetails keyed by their ServiceDetails.getId().
    • getPollingEventContainerDetails

      Map<String,PollingEventContainerServiceDetails> getPollingEventContainerDetails()
    • getNotifyEventContainerDetails

      Map<String,NotifyEventContainerServiceDetails> getNotifyEventContainerDetails()
    • getAsyncPollingEventContainerDetails

      Map<String,AsyncPollingEventContainerServiceDetails> getAsyncPollingEventContainerDetails()
    • getRemotingDetails

      RemotingServiceDetails getRemotingDetails()
      Returns the remoting service details (the exporter) if configured within the processing unit.
    • getSpaceDetails

      SpaceServiceDetails[] getSpaceDetails()
      Returns the space service details as described by the service started within the processing unit.
    • getEmbeddedSpaceDetails

      SpaceServiceDetails getEmbeddedSpaceDetails()
      Returns the embedded space service details as described by the service started within the processing unit. null if no embedded space was started within the processing unit.
    • getEmbeddedSpacesDetails

      SpaceServiceDetails[] getEmbeddedSpacesDetails()
      Returns the embedded space service details as described by the service started within the processing unit.
    • isEmbeddedSpaces

      boolean isEmbeddedSpaces()
      Returns true if there are embedded spaces started within this processing unit.
    • getSpaceInstance

      SpaceInstance getSpaceInstance()
      Returns a space instance that was started within the processing unit instance. Will return null if no embedded space instances were started (or none has been detected yet).
    • getSpaceInstances

      SpaceInstance[] getSpaceInstances()
      Returns all the space instances that were started within the processing unit instance. Will return an empty array if no space instances were started within this processing unit (or none has been detected yet).
    • waitForSpaceInstance

      SpaceInstance waitForSpaceInstance()
    • waitForSpaceInstance

      SpaceInstance waitForSpaceInstance(long timeout, TimeUnit timeUnit)
    • isJee

      boolean isJee()
      Returns true if this processing unit is a jee processing unit.
    • getJeeDetails

      JeeServiceDetails getJeeDetails()
      Returns the jee service details of the jee container that was started within this processing unit.
    • getStatistics

      Returns the processing unit instance statistics.
    • getMemberAliveIndicatorStatus

      MemberAliveIndicatorStatus getMemberAliveIndicatorStatus()
      Returns:
      Returns the current member alive indicator status of this processing unit instance.
      Since:
      8.0.6