def encode_request(timeout, durability, transaction_type, thread_id):
client_message = ClientMessage(payload_size=calculate_size(timeout, durability, transaction_type, thread_id))<EOL>client_message.set_message_type(REQUEST_TYPE)<EOL>client_message.set_retryable(RETRYABLE)<EOL>client_message.append_long(timeout)<EOL>client_message.append_int(durability)<EOL>client_message.append_int(transaction_type)<EOL>client_message.append_long(thread_id)<EOL>client_message.update_frame_length()<EOL>return client_message<EOL>
Encode request into client_message