for name, e in sorted((k, e) for k, e in vars(self).iteritems()
if isinstance(e, self.Enum))]
other = []
for k in (
'INVALID_TID',
'INVALID_OID',
'INVALID_PARTITION',
'ZERO_HASH',
'ZERO_TID',
'ZERO_OID',
'MAX_TID',
):
v = getattr(self, k)
other.append("""\
<tr>
<td>%s</td>
<td>%s</td>
</tr>
""" % (k, '0x%x' % v if type(v) is int else repr(v)))
return """
<detailsopen="">
<p>The following table lists the %s different types of messages that can be exchanged.
%s are them are requests with response packets.
1 is a generic response packet for error handling.
The remaining %s are notification packets.</p>
<p>The <em>code (#)</em> of a response packet is the same as the corresponding request one, with the highest order bit set. Using Python language, it translates as follows:</p>
<pre>response_code = request_code | 0x%x</pre>
<p>The <em>format</em> columns refer to item types,
which are described in the next table with Python literals, and in particular
<p><strong>Note:</strong> There's no UUID anymore in NEO and PUUID must renamed into PNID.</p>
</details>
<detailsopen="">
<summary>Enum Types</summary>
<divstyle="overflow: auto; height: 40ex">
<ulstyle="font-size: smaller; margin-top: 0">%s
</ul>
</div>
<pstyle="margin-left: 2em;"><strong>Naming choice</strong>: For cell states, node states and node types, names are chosen to have unambiguous initials, which is useful to produce shorter logs or have a more compact user interface. This explains for example why <em>RUNNING</em> was preferred over <em>UP</em>.</p>
</details>
<detailsopen="">
<summary>Other Constants</summary>
<table>
%s</table>
<p>MAX_TID could be bigger but in the Python implementation, TIDs are stored as integers and some storage backend may have no support for values above 2⁶³-1 (e.g. SQLite).</p>
<p>Node ID namespaces are required to prevent conflicts when the master generates new ids before it knows those of existing storage nodes. The high-order byte of node ids is one the following values:</p>
<table>
<tr><td>Storage</td><td>0x00</td></tr>
<tr><td>Master</td><td>-0x10</td></tr>
<tr><td>Client</td><td>-0x20</td></tr>
<tr><td>Admin</td><td>-0x30</td></tr>
</table>
<p>Actually, only the high order bit is really important and the 31 other bits could be random, but extra namespace information and non-randomness of 3 LOB help to read logs.</p>