ServicePartition Interface
public interface ServicePartition
Provides information to the service about the partition to which it belongs and provides methods for the service to interact with the system during runtime.
Method Summary
Modifier and Type | Method and Description |
---|---|
Service |
getPartitionInfo()
Provides access to the ServicePartitionInformation of the service, which contains the partition type and ID. |
void |
reportFault(FaultType faultType)
Reports the load for a set of load balancing metrics. The load can be reported at any time via the java.util.Collection of LoadMetric method and provides one or more properties of the LoadMetric method.
Remarks:A fault is typically reported when the service code encounters some issue from which it cannot recover. |
void |
reportLoad(Collection<LoadMetric> metrics)
Reports the load for a set of load balancing metrics. The load can be reported at any time via the java.util.Collection of LoadMetric method and provides one or more properties of the LoadMetric method.
Remarks:The reported metrics should correspond to those that are provided in the service load metric description as a part of the service description that is used to create the service. Load metrics that are not present in the description are ignored. Reporting custom metrics allows Service Fabric to balance services that are based on additional custom information. |
void |
reportMoveCost(MoveCost moveCost)
Reports the move cost for a replica.
Remarks:Services can report move cost of a replica using this method. While the Service Fabric Resource Balances searches for the best balance in the cluster, it examines both load information and move cost of each replica. Resource balances will prefer to move replicas with lower cost in order to achieve balance. |
void |
reportPartitionHealth(HealthInformation healthInfo)
Reports current partition health. |
Method Details
getPartitionInfo
public ServicePartitionInformation getPartitionInfo()
Provides access to the ServicePartitionInformation of the service, which contains the partition type and ID.
Returns:
Throws:
reportFault
public void reportFault(FaultType faultType)
Reports the load for a set of load balancing metrics. The load can be reported at any time via the java.util.Collection of LoadMetric method and provides one or more properties of the LoadMetric method.
Remarks:A fault is typically reported when the service code encounters some issue from which it cannot recover.
Parameters:
Throws:
reportLoad
public void reportLoad(Collection
Reports the load for a set of load balancing metrics. The load can be reported at any time via the java.util.Collection of LoadMetric method and provides one or more properties of the LoadMetric method.
Remarks:The reported metrics should correspond to those that are provided in the service load metric description as a part of the service description that is used to create the service. Load metrics that are not present in the description are ignored. Reporting custom metrics allows Service Fabric to balance services that are based on additional custom information.
Parameters:
Throws:
reportMoveCost
public void reportMoveCost(MoveCost moveCost)
Reports the move cost for a replica.
Remarks:Services can report move cost of a replica using this method. While the Service Fabric Resource Balances searches for the best balance in the cluster, it examines both load information and move cost of each replica. Resource balances will prefer to move replicas with lower cost in order to achieve balance.
Parameters:
Throws:
reportPartitionHealth
public void reportPartitionHealth(HealthInformation healthInfo)
Reports current partition health.
Parameters:
Throws:
Applies to
Azure SDK for Java