MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / recv_schema_change

Method recv_schema_change

cassandra/protocol.py:1035–1057  ·  view source on GitHub ↗
(cls, f, protocol_version)

Source from the content-addressed store, hash-verified

1033
1034 @classmethod
1035 def recv_schema_change(cls, f, protocol_version):
1036 # "CREATED", "DROPPED", or "UPDATED"
1037 change_type = read_string(f)
1038 if protocol_version >= 3:
1039 target = read_string(f)
1040 keyspace = read_string(f)
1041 event = {'target_type': target, 'change_type': change_type, 'keyspace': keyspace}
1042 if target != SchemaTargetType.KEYSPACE:
1043 target_name = read_string(f)
1044 if target == SchemaTargetType.FUNCTION:
1045 event['function'] = UserFunctionDescriptor(target_name, [read_string(f) for _ in range(read_short(f))])
1046 elif target == SchemaTargetType.AGGREGATE:
1047 event['aggregate'] = UserAggregateDescriptor(target_name, [read_string(f) for _ in range(read_short(f))])
1048 else:
1049 event[target.lower()] = target_name
1050 else:
1051 keyspace = read_string(f)
1052 table = read_string(f)
1053 if table:
1054 event = {'target_type': SchemaTargetType.TABLE, 'change_type': change_type, 'keyspace': keyspace, 'table': table}
1055 else:
1056 event = {'target_type': SchemaTargetType.KEYSPACE, 'change_type': change_type, 'keyspace': keyspace}
1057 return event
1058
1059
1060class ReviseRequestMessage(_MessageType):

Callers 1

Calls 4

read_stringFunction · 0.85
read_shortFunction · 0.85

Tested by

no test coverage detected