Class HostSet
Represents a set of hosts that perform some common work.
Primarily used for sharding work among hosts in the set.
The data is fed from the Metabase, and supports static and dynamic sets.
Static sets have a metabase-fixed number of hosts, whereas dynamic sets
may include dynamic hosts (as allocated by IaaS provider).
The dynamic sets are not supported until IaaS providers are implemented
Inheritance
System.Object
HostSet
Implements
System.IDisposable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
Assembly: Azos.Sky.dll
Syntax
public class HostSet : ApplicationComponent, IDisposable, IApplicationComponent, INamed
Constructors
HostSet(IApplication, String, String, String, IConfigSectionNode)
Declaration
protected HostSet(IApplication app, string setName, string reqPath, string path, IConfigSectionNode config)
Parameters
Fields
CONFIG_HEARTBEAT_INTERVAL_SEC
Declaration
public const string CONFIG_HEARTBEAT_INTERVAL_SEC = "heartbeat-interval-sec"
Field Value
Type |
Description |
System.String |
|
DEFAULT_HEARTBEAT_INTERVAL_SEC
Declaration
public const int DEFAULT_HEARTBEAT_INTERVAL_SEC = 180
Field Value
Type |
Description |
System.Int32 |
|
DEFAULT_LOG_LEVEL
Declaration
public const MessageType DEFAULT_LOG_LEVEL = MessageType.Warning
Field Value
MIN_HEARTBEAT_INTERVAL_SEC
Declaration
public const int MIN_HEARTBEAT_INTERVAL_SEC = 30
Field Value
Type |
Description |
System.Int32 |
|
Properties
ComponentLogTopic
Declaration
public override string ComponentLogTopic { get; }
Property Value
Type |
Description |
System.String |
|
Overrides
DeclaredHosts
The hosts that are declared in set
Declaration
public IOrderedRegistry<HostSet.Host> DeclaredHosts { get; }
Property Value
Dynamic
True to indicate that the number of hosts in the set is flexible
Declaration
public bool Dynamic { get; }
Property Value
Type |
Description |
System.Boolean |
|
Name
Declaration
public string Name { get; }
Property Value
Type |
Description |
System.String |
|
Path
Returns the actual resolved region path at which the set operates
Declaration
public string Path { get; }
Property Value
Type |
Description |
System.String |
|
RequestedPath
Returns the region path that was requested
Declaration
public string RequestedPath { get; }
Property Value
Type |
Description |
System.String |
|
Methods
AssignHost(Object)
Assigns a worker from the set for the supplied sharding key.
If key is null then a random member is assigned.
Returns null if there is no host available for assignment
Declaration
public virtual HostSet.HostPair AssignHost(object shardingKey)
Parameters
Type |
Name |
Description |
System.Object |
shardingKey |
|
Returns
BuildHostList()
Override to determine the lists of hosts in the set.
In case of dynamic hosts this method may be called many times
Declaration
protected virtual void BuildHostList()
Destructor()
Declaration
protected override void Destructor()
Overrides
DoHeartbeat()
Declaration
protected virtual void DoHeartbeat()
Refresh()
Refreshes the list of hosts in the set
Declaration
Implements
System.IDisposable
Extension Methods