public class

InstanceConfig

extends HelixProperty
java.lang.Object
   ↳ org.apache.helix.HelixProperty
     ↳ org.apache.helix.model.InstanceConfig

Class Overview

Instance configurations

Summary

Nested Classes
enum InstanceConfig.InstanceConfigProperty Configurable characteristics of an instance  
[Expand]
Inherited Fields
From class org.apache.helix.HelixProperty
Public Constructors
InstanceConfig(String instanceId)
Instantiate for a specific instance
InstanceConfig(ParticipantId participantId)
Instantiate for a specific instance
InstanceConfig(ZNRecord record)
Instantiate with a pre-populated record
Public Methods
void addTag(String tag)
Add a tag to this instance
boolean containsTag(String tag)
Check if an instance contains a tag
boolean equals(Object obj)
ContainerId getContainerId()
ContainerSpec getContainerSpec()
ContainerState getContainerState()
List<String> getDisabledPartitions()
Get the partitions disabled by this instance
String getHostName()
Get the host name of the instance
boolean getInstanceEnabled()
Check if this instance is enabled and able to serve replicas
boolean getInstanceEnabledForPartition(String partition)
Check if this instance is enabled for a given partition
String getInstanceName()
Get the name of this instance
ParticipantId getParticipantId()
Get the identifier of this participant
String getPort()
Get the port that the instance can be reached at
List<String> getTags()
Get arbitrary tags associated with the instance
UserConfig getUserConfig()
Get a backward-compatible participant user config
int hashCode()
boolean isValid()
Get property validity
void removeTag(String tag)
Remove a tag from this instance
void setContainerId(ContainerId containerId)
void setContainerSpec(ContainerSpec spec)
void setContainerState(ContainerState state)
void setHostName(String hostName)
Set the host name of the instance
void setInstanceEnabled(boolean enabled)
Set the enabled state of the instance
void setInstanceEnabledForPartition(String partitionName, boolean enabled)
Set the enabled state for a partition on this instance
void setParticipantEnabledForPartition(PartitionId partitionId, boolean enabled)
Set the enabled state for a partition on this instance
void setPort(String port)
Set the port that the instance can be reached at
[Expand]
Inherited Methods
From class org.apache.helix.HelixProperty
From class java.lang.Object

Public Constructors

public InstanceConfig (String instanceId)

Instantiate for a specific instance

Parameters
instanceId the instance identifier

public InstanceConfig (ParticipantId participantId)

Instantiate for a specific instance

Parameters
participantId the instance identifier

public InstanceConfig (ZNRecord record)

Instantiate with a pre-populated record

Parameters
record a ZNRecord corresponding to an instance configuration

Public Methods

public void addTag (String tag)

Add a tag to this instance

Parameters
tag an arbitrary property of the instance

public boolean containsTag (String tag)

Check if an instance contains a tag

Parameters
tag the tag to check
Returns
  • true if the instance contains the tag, false otherwise

public boolean equals (Object obj)

public ContainerId getContainerId ()

public ContainerSpec getContainerSpec ()

public ContainerState getContainerState ()

public List<String> getDisabledPartitions ()

Get the partitions disabled by this instance

Returns
  • a list of partition names

public String getHostName ()

Get the host name of the instance

Returns
  • the host name

public boolean getInstanceEnabled ()

Check if this instance is enabled and able to serve replicas

Returns
  • true if enabled, false if disabled

public boolean getInstanceEnabledForPartition (String partition)

Check if this instance is enabled for a given partition

Parameters
partition the partition name to check
Returns
  • true if the instance is enabled for the partition, false otherwise

public String getInstanceName ()

Get the name of this instance

Returns
  • the instance name

public ParticipantId getParticipantId ()

Get the identifier of this participant

Returns
  • the participant id

public String getPort ()

Get the port that the instance can be reached at

Returns
  • the port

public List<String> getTags ()

Get arbitrary tags associated with the instance

Returns
  • a list of tags

public UserConfig getUserConfig ()

Get a backward-compatible participant user config

Returns
  • UserConfig

public int hashCode ()

public boolean isValid ()

Get property validity

Returns
  • true if valid, false if invalid

public void removeTag (String tag)

Remove a tag from this instance

Parameters
tag a property of this instance

public void setContainerId (ContainerId containerId)

public void setContainerSpec (ContainerSpec spec)

public void setContainerState (ContainerState state)

public void setHostName (String hostName)

Set the host name of the instance

Parameters
hostName the host name

public void setInstanceEnabled (boolean enabled)

Set the enabled state of the instance

Parameters
enabled true to enable, false to disable

public void setInstanceEnabledForPartition (String partitionName, boolean enabled)

Set the enabled state for a partition on this instance

Parameters
partitionName the partition to set
enabled true to enable, false to disable

public void setParticipantEnabledForPartition (PartitionId partitionId, boolean enabled)

Set the enabled state for a partition on this instance

Parameters
partitionId the partition to set
enabled true to enable, false to disable

public void setPort (String port)

Set the port that the instance can be reached at

Parameters
port the port