| 1058 | |
| 1059 | |
| 1060 | class ReviseRequestMessage(_MessageType): |
| 1061 | |
| 1062 | class RevisionType(object): |
| 1063 | PAGING_CANCEL = 1 |
| 1064 | PAGING_BACKPRESSURE = 2 |
| 1065 | |
| 1066 | opcode = 0xFF |
| 1067 | name = 'REVISE_REQUEST' |
| 1068 | |
| 1069 | def __init__(self, op_type, op_id, next_pages=0): |
| 1070 | self.op_type = op_type |
| 1071 | self.op_id = op_id |
| 1072 | self.next_pages = next_pages |
| 1073 | |
| 1074 | def send_body(self, f, protocol_version): |
| 1075 | write_int(f, self.op_type) |
| 1076 | write_int(f, self.op_id) |
| 1077 | if self.op_type == ReviseRequestMessage.RevisionType.PAGING_BACKPRESSURE: |
| 1078 | if self.next_pages <= 0: |
| 1079 | raise UnsupportedOperation("Continuous paging backpressure requires next_pages > 0") |
| 1080 | elif not ProtocolVersion.has_continuous_paging_next_pages(protocol_version): |
| 1081 | raise UnsupportedOperation( |
| 1082 | "Continuous paging backpressure may only be used with protocol version " |
| 1083 | "ProtocolVersion.DSE_V2 or higher. Consider setting Cluster.protocol_version to ProtocolVersion.DSE_V2.") |
| 1084 | else: |
| 1085 | write_int(f, self.next_pages) |
| 1086 | |
| 1087 | |
| 1088 | class _ProtocolHandler(object): |
no outgoing calls
no test coverage detected