public class

Resource

extends Object
java.lang.Object
   ↳ org.apache.helix.api.Resource

Class Overview

Represent a resource entity in helix cluster

Summary

Public Constructors
Resource(ResourceConfig resourceConfig, ResourceAssignment resourceAssignment, ExternalView externalView)
Construct a resource
Public Methods
ResourceConfig getConfig()
Get the configuration of this resource
ExternalView getExternalView()
Get the external view of the resource
ResourceId getId()
Get the resource id
IdealState getIdealState()
Get the resource ideal state
ProvisionerConfig getProvisionerConfig()
Get the properties configuring provisioning
RebalancerConfig getRebalancerConfig()
Get the resource properties configuring rebalancing
ResourceAssignment getResourceAssignment()
Get the current resource assignment
SchedulerTaskConfig getSchedulerTaskConfig()
Get the properties configuring scheduler tasks
Set<? extends PartitionId> getSubUnitSet()
Get the set of subunit ids that the resource contains
UserConfig getUserConfig()
Get user-specified configuration properties of this resource
static SchedulerTaskConfig schedulerTaskConfig(IdealState idealState)
Extract scheduler-task config from ideal-state if state-model-def is SchedulerTaskQueue
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Resource (ResourceConfig resourceConfig, ResourceAssignment resourceAssignment, ExternalView externalView)

Construct a resource

Parameters
resourceConfig full resource configuration
resourceAssignment current resource assignment of the cluster
externalView external view of the resource

Public Methods

public ResourceConfig getConfig ()

Get the configuration of this resource

Returns
  • ResourceConfig that backs this Resource

public ExternalView getExternalView ()

Get the external view of the resource

Returns
  • the external view of the resource

public ResourceId getId ()

Get the resource id

Returns
  • ResourceId

public IdealState getIdealState ()

Get the resource ideal state

Returns
  • IdealState instance

public ProvisionerConfig getProvisionerConfig ()

Get the properties configuring provisioning

Returns
  • ProvisionerConfig properties

public RebalancerConfig getRebalancerConfig ()

Get the resource properties configuring rebalancing

Returns
  • RebalancerConfig properties

public ResourceAssignment getResourceAssignment ()

Get the current resource assignment

Returns
  • ResourceAssignment, or null if no current assignment

public SchedulerTaskConfig getSchedulerTaskConfig ()

Get the properties configuring scheduler tasks

Returns
  • SchedulerTaskConfig properties

public Set<? extends PartitionId> getSubUnitSet ()

Get the set of subunit ids that the resource contains

Returns
  • subunit id set, or empty if none

public UserConfig getUserConfig ()

Get user-specified configuration properties of this resource

Returns
  • UserConfig properties

public static SchedulerTaskConfig schedulerTaskConfig (IdealState idealState)

Extract scheduler-task config from ideal-state if state-model-def is SchedulerTaskQueue

Returns
  • scheduler-task config or null if state-model-def is not SchedulerTaskQueue