You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "zentol (via GitHub)" <gi...@apache.org> on 2024/02/01 11:03:43 UTC
Re: [PR] [FLINK-34324][test] Makes all s3 related operations being declared and called in a single location [flink]
zentol commented on code in PR #24244:
URL: https://github.com/apache/flink/pull/24244#discussion_r1474255709
##########
flink-end-to-end-tests/test-scripts/test_file_sink.sh:
##########
@@ -96,13 +51,54 @@ function get_complete_result {
# line number in part files
###################################
function get_total_number_of_valid_lines {
- if [ "${OUT_TYPE}" == "local" ]; then
- get_complete_result | wc -l | tr -d '[:space:]'
- elif [ "${OUT_TYPE}" == "s3" ]; then
- s3_get_number_of_lines_by_prefix "${S3_PREFIX}" "part-"
- fi
+ get_complete_result | wc -l | tr -d '[:space:]'
}
+if [ "${OUT_TYPE}" == "s3" ]; then
+ source "$(dirname "$0")"/common_s3.sh
+ s3_setup hadoop
+
+ JOB_OUTPUT_PATH="s3://$IT_CASE_S3_BUCKET/$S3_PREFIX"
+ set_config_key "state.checkpoints.dir" "s3://$IT_CASE_S3_BUCKET/$S3_PREFIX-chk"
+ mkdir -p "$OUTPUT_PATH-chk"
+
+ # overwrites implementation for local runs
+ function get_complete_result {
+ s3_get_by_full_path_and_filename_prefix "$OUTPUT_PATH" "$S3_PREFIX" "part-" true
+ }
+
+ # overwrites implementation for local runs
+ function get_total_number_of_valid_lines {
+ s3_get_number_of_lines_by_prefix "${S3_PREFIX}" "part-"
+ }
+
+ # make sure we delete the file at the end
+ function out_cleanup {
+ s3_delete_by_full_path_prefix "$S3_PREFIX"
+ s3_delete_by_full_path_prefix "${S3_PREFIX}-chk"
+ rollback_openssl_lib
+ }
+
+ on_exit out_cleanup
+elif [ "${OUT_TYPE}" == "local" ]; then
Review Comment:
How about we use this in the top-most branch so that the local setup is closer together?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org