def handle(msg, handle_distributed_object_event=None):
    message_type = msg.get_message_type()
    if message_type == _EVENT_DISTRIBUTED_OBJECT_MESSAGE_TYPE and handle_distributed_object_event is not None:
        initial_frame = msg.next_frame()
        source = FixSizedTypesCodec.decode_uuid(initial_frame.buf, _EVENT_DISTRIBUTED_OBJECT_SOURCE_OFFSET)
        name = StringCodec.decode(msg)
        service_name = StringCodec.decode(msg)
        event_type = StringCodec.decode(msg)
        handle_distributed_object_event(name, service_name, event_type, source)
        return
Example #2
0
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     line_number = FixSizedTypesCodec.decode_int(
         initial_frame.buf, _LINE_NUMBER_DECODE_OFFSET)
     class_name = StringCodec.decode(msg)
     method_name = StringCodec.decode(msg)
     file_name = CodecUtil.decode_nullable(msg, StringCodec.decode)
     CodecUtil.fast_forward_to_end_frame(msg)
     return StackTraceElement(class_name, method_name, file_name,
                              line_number)
Example #3
0
 def decode(msg):
     msg.next_frame()
     type_name = StringCodec.decode(msg)
     fields_list = ListMultiFrameCodec.decode(msg,
                                              FieldDescriptorCodec.decode)
     CodecUtil.fast_forward_to_end_frame(msg)
     return Schema(type_name, fields_list)
 def test_string(self):
     self.mark_initial_frame_as_non_final()
     string = six.u("abc©☺𩸽🐶😁")
     StringCodec.encode(self.buf, string, True)
     message = self.write_and_decode()
     message.next_frame()  # initial frame
     self.assertEqual(string, StringCodec.decode(message))
Example #5
0
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     port = FixSizedTypesCodec.decode_int(initial_frame.buf, _PORT_DECODE_OFFSET)
     host = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return Address(host, port)
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     unique_key_transformation = FixSizedTypesCodec.decode_int(initial_frame.buf, _UNIQUE_KEY_TRANSFORMATION_DECODE_OFFSET)
     unique_key = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return BitmapIndexOptions(unique_key, unique_key_transformation)
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     kind = FixSizedTypesCodec.decode_int(initial_frame.buf,
                                          _KIND_DECODE_OFFSET)
     name = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return FieldDescriptor(name, kind)
Example #8
0
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     error_code = FixSizedTypesCodec.decode_int(initial_frame.buf, _ERROR_CODE_DECODE_OFFSET)
     class_name = StringCodec.decode(msg)
     message = CodecUtil.decode_nullable(msg, StringCodec.decode)
     stack_trace_elements = ListMultiFrameCodec.decode(msg, StackTraceElementCodec.decode)
     CodecUtil.fast_forward_to_end_frame(msg)
     return ErrorHolder(error_code, class_name, message, stack_trace_elements)
Example #9
0
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     seed = FixSizedTypesCodec.decode_long(initial_frame.buf,
                                           _SEED_DECODE_OFFSET)
     id = FixSizedTypesCodec.decode_long(initial_frame.buf,
                                         _ID_DECODE_OFFSET)
     name = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return RaftGroupId(name, seed, id)
Example #10
0
 def decode(msg):
     msg.next_frame()
     initial_frame = msg.next_frame()
     type = FixSizedTypesCodec.decode_int(initial_frame.buf,
                                          _TYPE_DECODE_OFFSET)
     is_nullable_exists = False
     nullable = False
     if len(initial_frame.buf
            ) >= _NULLABLE_DECODE_OFFSET + BOOLEAN_SIZE_IN_BYTES:
         nullable = FixSizedTypesCodec.decode_boolean(
             initial_frame.buf, _NULLABLE_DECODE_OFFSET)
         is_nullable_exists = True
     name = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return SqlColumnMetadata(name, type, is_nullable_exists, nullable)
Example #11
0
def decode_response(msg):
    initial_frame = msg.next_frame()
    response = dict()
    response["status"] = FixSizedTypesCodec.decode_byte(
        initial_frame.buf, _RESPONSE_STATUS_OFFSET)
    response["member_uuid"] = FixSizedTypesCodec.decode_uuid(
        initial_frame.buf, _RESPONSE_MEMBER_UUID_OFFSET)
    response["serialization_version"] = FixSizedTypesCodec.decode_byte(
        initial_frame.buf, _RESPONSE_SERIALIZATION_VERSION_OFFSET)
    response["partition_count"] = FixSizedTypesCodec.decode_int(
        initial_frame.buf, _RESPONSE_PARTITION_COUNT_OFFSET)
    response["cluster_id"] = FixSizedTypesCodec.decode_uuid(
        initial_frame.buf, _RESPONSE_CLUSTER_ID_OFFSET)
    response["failover_supported"] = FixSizedTypesCodec.decode_boolean(
        initial_frame.buf, _RESPONSE_FAILOVER_SUPPORTED_OFFSET)
    response["address"] = CodecUtil.decode_nullable(msg, AddressCodec.decode)
    response["server_hazelcast_version"] = StringCodec.decode(msg)
    return response
Example #12
0
 def decode(msg):
     msg.next_frame()
     service_name = StringCodec.decode(msg)
     name = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return DistributedObjectInfo(service_name, name)
 def decode(msg):
     msg.next_frame()
     value = StringCodec.decode(msg)
     CodecUtil.fast_forward_to_end_frame(msg)
     return HazelcastJsonValue(value)
Example #14
0
def decode_response(msg):
    msg.next_frame()
    return StringCodec.decode(msg)