Node State#

class smoothcrawler_cluster.model.metadata.NodeState[source]#

Meta-Data for one specific crawler’s state in cluster

GroupState is a state info for multiple nodes which also in same group. NodeState is the state info for one specific crawler instance. It would save some more detail info of the crawler instance of the cluster.

  • Zookeeper node path:

/smoothcrawler/node/<crawler name>/state/

  • Example data:

{
    "role": "runner",
    "group": "sc-crawler-cluster"
}
to_readable_object() dict[source]#

Converse the instance’s current data to be dict type value. Its target is let data converse as JSON format value for deserializing conveniently.

Returns:

A dict type value keeps the current instance’s data.

Return type:

dict

property group: str#

Properties with both a getter and setter for the group name which is the current crawler instance in.

Setter would block the data which type is NOT str.

Type:

str

property role: CrawlerRole#

Properties with both a getter and setter for the crawler role what current crawler instance is. It recommends that use enum object CrawlerStateRole to configure this property. But it still could use string type value (‘runner’, ‘backup-runner’, ‘dead-runner’, ‘dead-backup-runner’) to do it.

Setter only accepts the enum object CrawlerStateRole or string type value.

Type:

str