public class

ResourceConfig

extends Object
java.lang.Object
   ↳ org.apache.helix.api.config.ResourceConfig

Class Overview

Full configuration of a Helix resource. Typically used to add or modify resources on a cluster

Summary

Nested Classes
class ResourceConfig.Builder Assembles a ResourceConfig  
class ResourceConfig.Delta Update context for a ResourceConfig  
enum ResourceConfig.ResourceType Type of a resource. 
Public Constructors
ResourceConfig(ResourceId id, ResourceConfig.ResourceType resourceType, SchedulerTaskConfig schedulerTaskConfig, RebalancerConfig rebalancerConfig, UserConfig userConfig, int bucketSize, boolean batchMessageMode)
Instantiate a configuration.
Public Methods
boolean getBatchMessageMode()
Get the batch message mode
int getBucketSize()
Get the bucket size for this resource
ResourceId getId()
Get the resource id
RebalancerConfig getRebalancerConfig()
Get the resource properties configuring rebalancing
SchedulerTaskConfig getSchedulerTaskConfig()
Get the properties configuring scheduler tasks
Partition getSubUnit(PartitionId subUnitId)
Get a subunit that the resource contains
Map<? extends PartitionId, ? extends Partition> getSubUnitMap()
Get the subunits of the resource
Set<? extends PartitionId> getSubUnitSet()
Get the set of subunit ids that the resource contains
ResourceConfig.ResourceType getType()
Get the resource type
UserConfig getUserConfig()
Get user-specified configuration properties of this resource
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ResourceConfig (ResourceId id, ResourceConfig.ResourceType resourceType, SchedulerTaskConfig schedulerTaskConfig, RebalancerConfig rebalancerConfig, UserConfig userConfig, int bucketSize, boolean batchMessageMode)

Instantiate a configuration. Consider using ResourceConfig.Builder

Parameters
id resource id
schedulerTaskConfig configuration for scheduler tasks associated with the resource
rebalancerConfig configuration for rebalancing the resource
userConfig user-defined resource properties
bucketSize bucket size for this resource
batchMessageMode whether or not batch messaging is allowed

Public Methods

public boolean getBatchMessageMode ()

Get the batch message mode

Returns
  • true if enabled, false if disabled

public int getBucketSize ()

Get the bucket size for this resource

Returns
  • bucket size

public ResourceId getId ()

Get the resource id

Returns
  • ResourceId

public RebalancerConfig getRebalancerConfig ()

Get the resource properties configuring rebalancing

Returns
  • RebalancerConfig properties

public SchedulerTaskConfig getSchedulerTaskConfig ()

Get the properties configuring scheduler tasks

Returns
  • SchedulerTaskConfig properties

public Partition getSubUnit (PartitionId subUnitId)

Get a subunit that the resource contains

Parameters
subUnitId the subunit id to look up
Returns
  • Partition or null if none is present with the given id

public Map<? extends PartitionId, ? extends Partition> getSubUnitMap ()

Get the subunits of the resource

Returns
  • map of subunit id to subunit or empty map if none

public Set<? extends PartitionId> getSubUnitSet ()

Get the set of subunit ids that the resource contains

Returns
  • subunit id set, or empty if none

public ResourceConfig.ResourceType getType ()

Get the resource type

Returns
  • ResourceType

public UserConfig getUserConfig ()

Get user-specified configuration properties of this resource

Returns
  • UserConfig properties

public String toString ()