public class

Resource

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

Class Overview

A resource contains a set of partitions and its replicas are managed by a state model

Summary

Public Constructors
Resource(String resourceName)
Instantiate a resource by its name
Public Methods
void addPartition(String partitionName)
Add a partition to this resource
boolean getBatchMessageMode()
Get the batch message processing mode
int getBucketSize()
Get the bucket size of this resource
Partition getPartition(String partitionName)
Get a resource partition by name
Collection<Partition> getPartitions()
Get the partitions of this resource
String getResourceName()
Get the resource name
String getStateModelDefRef()
Get the state model definition managing this resource
String getStateModelFactoryname()
Get the state model factory for this resource
void setBatchMessageMode(boolean mode)
Set whether or not messages for this resource should be batch processed
void setBucketSize(int bucketSize)
Set the bucket size of this resource
void setStateModelDefRef(String stateModelDefRef)
Set the state model definition managing this resource
void setStateModelFactoryName(String factoryName)
Set the state model factory for this resource
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public Resource (String resourceName)

Instantiate a resource by its name

Parameters
resourceName the name of the resource that identifies it

Public Methods

public void addPartition (String partitionName)

Add a partition to this resource

Parameters
partitionName the name of the partition

public boolean getBatchMessageMode ()

Get the batch message processing mode

Returns
  • true if enabled, false if disabled

public int getBucketSize ()

Get the bucket size of this resource

Returns
  • the bucket size, or 0 if not specified

public Partition getPartition (String partitionName)

Get a resource partition by name

Parameters
partitionName partition name
Returns
  • the partition, or the name is not present

public Collection<Partition> getPartitions ()

Get the partitions of this resource

Returns

public String getResourceName ()

Get the resource name

Returns
  • the name of the resource, should be unique

public String getStateModelDefRef ()

Get the state model definition managing this resource

Returns
  • a reference to the state model definition

public String getStateModelFactoryname ()

Get the state model factory for this resource

Returns
  • the state model factory name

public void setBatchMessageMode (boolean mode)

Set whether or not messages for this resource should be batch processed

Parameters
mode true to batch process, false to disable batch processing

public void setBucketSize (int bucketSize)

Set the bucket size of this resource

Parameters
bucketSize the bucket size, or 0 to disable bucketizing

public void setStateModelDefRef (String stateModelDefRef)

Set the state model definition managing this resource

Parameters
stateModelDefRef a reference to the state model definition

public void setStateModelFactoryName (String factoryName)

Set the state model factory for this resource

Parameters
factoryName the name of the state model factory

public String toString ()