1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File generated by hadoop record compiler. Do not edit.
"""
 Licensed to the Apache Software Foundation (ASF) under one
 or more contributor license agreements.  See the NOTICE file
 distributed with this work for additional information
 regarding copyright ownership.  The ASF licenses this file
 to you under the Apache License, Version 2.0 (the
 "License"); you may not use this file except in compliance
 with the License.  You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
"""

class ConnectRequest:
    def __init__(self):
        self.protocolVersion = None
        self.lastZxidSeen = None
        self.timeOut = None
        self.sessionId = None
        self.passwd = None
        self.readOnly = False

    def serialize(self, output_archive, tag):
        output_archive.start_record(tag)

        output_archive.write_int(self.protocolVersion, 'protocolVersion')
        output_archive.write_long(self.lastZxidSeen, 'lastZxidSeen')
        output_archive.write_int(self.timeOut, 'timeOut')
        output_archive.write_long(self.sessionId, 'sessionId')
        output_archive.write_buffer(self.passwd, 'passwd')
        output_archive.write_bool(self.readOnly, 'readOnly')

        output_archive.end_record(tag)

    def deserialize(self, input_archive, tag):
        input_archive.start_record(tag)
        self.protocolVersion = input_archive.read_int('protocolVersion')
        self.lastZxidSeen = input_archive.read_long('lastZxidSeen')
        self.timeOut = input_archive.read_int('timeOut')
        self.sessionId = input_archive.read_long('sessionId')
        self.passwd = input_archive.read_buffer('passwd')
        self.readOnly = input_archive.read_bool('readOnly')
        input_archive.end_record(tag)

    def __repr__(self):
        return 'ConnectRequest(%r, %r, %r, %r, %r, %r)' % (self.protocolVersion, self.lastZxidSeen, self.timeOut, self.sessionId, self.passwd, self.readOnly)

    def __eq__(self, other):
        return self.protocolVersion == other.protocolVersion \
               and self.lastZxidSeen == other.lastZxidSeen \
               and self.timeOut == other.timeOut \
               and self.sessionId == other.sessionId \
               and self.passwd == other.passwd \
               and self.readOnly == other.passwd

    def __ne__(self, other):
        return not self.__eq__(other)

    def __hash__(self):
        return hash((self.protocolVersion, self.lastZxidSeen, self.timeOut, self.sessionId, self.passwd, self.readOnly))