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
import logging
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
class Node(object):
......@@ -98,6 +98,11 @@ class ClientNode(Node):
def getNodeType(self):
return CLIENT_NODE_TYPE
class AdminNode(Node):
"""This class represents an admin node."""
def getNodeType(self):
return ADMIN_NODE_TYPE
class NodeManager(object):
"""This class manages node status."""
......
......@@ -272,8 +272,9 @@ INTERNAL_ERROR_CODE = 8
MASTER_NODE_TYPE = 1
STORAGE_NODE_TYPE = 2
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 = Enum({
......@@ -307,11 +308,13 @@ INVALID_PARTITION = 0xffffffff
STORAGE_NS = 'S'
MASTER_NS = 'M'
CLIENT_NS = 'C'
ADMIN_NS = 'A'
UUID_NAMESPACES = {
STORAGE_NODE_TYPE: STORAGE_NS,
MASTER_NODE_TYPE: MASTER_NS,
CLIENT_NODE_TYPE: CLIENT_NS,
ADMIN_NODE_TYPE: ADMIN_NS,
}
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