Commit d3f74a0e authored by Aurel's avatar Aurel

defined admin node


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@429 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 74ebf6f2
...@@ -19,7 +19,7 @@ from time import time ...@@ -19,7 +19,7 @@ from time import time
import logging import logging
from neo.protocol import RUNNING_STATE, TEMPORARILY_DOWN_STATE, DOWN_STATE, BROKEN_STATE, \ from neo.protocol import RUNNING_STATE, TEMPORARILY_DOWN_STATE, DOWN_STATE, BROKEN_STATE, \
MASTER_NODE_TYPE, STORAGE_NODE_TYPE, CLIENT_NODE_TYPE, VALID_NODE_STATE_LIST MASTER_NODE_TYPE, STORAGE_NODE_TYPE, CLIENT_NODE_TYPE, VALID_NODE_STATE_LIST, ADMIN_NODE_TYPE
from neo.util import dump from neo.util import dump
class Node(object): class Node(object):
...@@ -98,6 +98,11 @@ class ClientNode(Node): ...@@ -98,6 +98,11 @@ class ClientNode(Node):
def getNodeType(self): def getNodeType(self):
return CLIENT_NODE_TYPE return CLIENT_NODE_TYPE
class AdminNode(Node):
"""This class represents an admin node."""
def getNodeType(self):
return ADMIN_NODE_TYPE
class NodeManager(object): class NodeManager(object):
"""This class manages node status.""" """This class manages node status."""
......
...@@ -272,8 +272,9 @@ INTERNAL_ERROR_CODE = 8 ...@@ -272,8 +272,9 @@ INTERNAL_ERROR_CODE = 8
MASTER_NODE_TYPE = 1 MASTER_NODE_TYPE = 1
STORAGE_NODE_TYPE = 2 STORAGE_NODE_TYPE = 2
CLIENT_NODE_TYPE = 3 CLIENT_NODE_TYPE = 3
ADMIN_NODE_TYPE = 4
VALID_NODE_TYPE_LIST = (MASTER_NODE_TYPE, STORAGE_NODE_TYPE, CLIENT_NODE_TYPE) VALID_NODE_TYPE_LIST = (MASTER_NODE_TYPE, STORAGE_NODE_TYPE, CLIENT_NODE_TYPE, ADMIN_NODE_TYPE)
# Node states. # Node states.
node_states = Enum({ node_states = Enum({
...@@ -307,11 +308,13 @@ INVALID_PARTITION = 0xffffffff ...@@ -307,11 +308,13 @@ INVALID_PARTITION = 0xffffffff
STORAGE_NS = 'S' STORAGE_NS = 'S'
MASTER_NS = 'M' MASTER_NS = 'M'
CLIENT_NS = 'C' CLIENT_NS = 'C'
ADMIN_NS = 'A'
UUID_NAMESPACES = { UUID_NAMESPACES = {
STORAGE_NODE_TYPE: STORAGE_NS, STORAGE_NODE_TYPE: STORAGE_NS,
MASTER_NODE_TYPE: MASTER_NS, MASTER_NODE_TYPE: MASTER_NS,
CLIENT_NODE_TYPE: CLIENT_NS, CLIENT_NODE_TYPE: CLIENT_NS,
ADMIN_NODE_TYPE: ADMIN_NS,
} }
class ProtocolError(Exception): pass class ProtocolError(Exception): pass
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment