Skip to content

Latest commit

 

History

History
791 lines (777 loc) · 24.7 KB

File metadata and controls

791 lines (777 loc) · 24.7 KB

任务描述参考手册

oss_pipe 通过 yml 格式描述需要执行的任务

yaml描述文件基本结构

描述文件概述

任务描述主要分为三个主要部分

  • type、task_id、name,用于定义任务的基本信息,type为类型描述,目前支持transfer 和compare两类任务。
  • source、targe用于描述源于目标存储信息,可以是本地存储(目录)或对象存储
  • attributes,用于描述任务属性,包括并发数、过滤器等信息

基本属性描述

  • type: 描述任务类型,目前支持transfer 和compare两类任务
  • task_id:描述任务唯一id以及任务名称,
  • name:任务名称,使用者自定义
  • source: 描述远端存储类别
  • target: 描述目标端存储类别
  • attributes: 描述任务属性

transfer yaml

type: transfer
task_id: '7322221674433220609'
name: transfer_oss2oss
source:
  provider: ALI
  access_key_id: access_key_id
  secret_access_key: secret_access_key
  endpoint: http://oss-cn-beijing.aliyuncs.com
  region: cn-north-1
  bucket: bucket_name
  prefix: test/samples/
  request_style: VirtualHostedStyle
target:
  provider: JD
  access_key_id: access_key_id
  secret_access_key: secret_access_key
  endpoint: http://s3.cn-north-1.jdcloud-oss.com
  region: cn-north-1
  bucket: bucket_name
  prefix: test/samples/
  request_style: VirtualHostedStyle
attributes:
  objects_per_batch: 64
  task_parallelism: 4
  meta_dir: /tmp/meta_dir
  target_exists_skip: false
  start_from_checkpoint: false
  large_file_size: 64m
  multi_part_chunk_size: 8m
  multi_part_chunks_per_batch: 16
  multi_part_parallelism: 8
  multi_part_max_parallelism: 12
  exclude:
  - \b[\w-]*(https?|ftp|file):\/\/\S+
  - test/t4/*
  include:
  - test/t1/*
  - test/t2/*
  transfer_type: stock
  last_modify_filter:
    filter_type: Greater
    timestamp: 1745753687
  objects_list_files_max_line: 1000000

transfer yml 参数详解

配置项 字段属性 必填 描述 示例
type String 任务类型,transfer 或 compare,详细执行类型通过:oss_pipe parameters task_type 查看 type: transfer/compare
task_id String 任务id,为空时由系统生成 task_id: '7219552894540976129'
name String 任务名称,为空时系统生成默认名称 name: transfer_oss2oss
source String 当源为本地目录时,指定本地目录 source: /tmp/source_files
source.provider String 当源为对象存储时,描述对象存储提供商。值为JD/JRSS/ALI/AWS/HUAWEI/COS/MINIO,支持的对象存储提供商通过oss_pipe parameters provider 查询 source:
    provider: AWS
source.access_key_id String 当源为对象存储时,指定对象存储的 access_key。 source:
    access_key_id: xxxx
source.secret_access_key String 当源为对象存储时,指定对象存储的 secret key source:
     secret_access_key: xxxx
source.endpoint String 当源为对象存储时,对象存储endpoint source:
    endpoint: http://oss-cn-beijing.aliyuncs.com
source.region String 当源为对象存储时,对象存储region source:
    region: cn-north-1
source.bucket String 当源为对象存储时,对象存储bucket source:
    bucket: bucket_name
source.prefix String 当源为对象存储时,指定prefix时,只对该prefix下的对象进行操作 source:
    prefix: source/test/prefix/
source.request_style String 对象存储url编码格式,取值:PathStyle/VirtualHostedStyle,默认VirtualHostedStyle source:
    request_style: VirtualHostedStyle
target String 当目标为本地目录时,指定本地目录 target: /tmp/target_files
target.provider String 当目标为对象存储时,描述对象存储提供商。值为JD/JRSS/ALI/AWS/HUAWEI/COS/MINIO,支持的对象存储提供商通过oss_pipe parameters provider 查询 target:
    provider: AWS
target.access_key_id String 当目标为对象存储时,指定对象存储的 access_key。 target:
    access_key_id: xxxx
target.secret_access_key String 当源为对象存储时,指定对象存储的 secret key target:
     secret_access_key: xxxx
target.endpoint String 当目标为对象存储时,对象存储endpoint target:
    endpoint: http://oss-cn-beijing.aliyuncs.com
target.region String 当目标为对象存储时,对象存储region target:
    region: cn-north-1
target.bucket String 当目标为对象存储时,对象存储bucket target:
    bucket: bucket_name
target.prefix String 当目标为对象存储时,指定prefix时,目标添加 prefix,例如源key为a,指定prefix 为 p/时,a在目标的key为p/a target:
    prefix: target/prefix/
target.request_style String 对象存储url编码格式,取值:PathStyle/VirtualHostedStyle,默认VirtualHostedStyle target:
    request_style: VirtualHostedStyle
attributes.objects_transfer_batch usize 任务属性,每批次执行的对象数量 attributes:
    objects_transfer_batch: 100
attributes.task_parallelism usize 任务属性,任务并行度,既同时执行任务批次的数量 attributes:
    task_parallelism: 16
attributes.objects_list_batch usize 任务属性,对象列表批次,每批次写入列表文件的数量 attributes:
    objects_list_batch: 1000
attributes.meta_dir String 任务属性,元数据存储位置,默认路径/tmp/meta_dir attributes:
    meta_dir: /root/meta_dir
attributes.target_exists_skip bool 任务属性,当target存在同名对象时不传送对象,默认值为false attributes:
    target_exists_skip: false
attributes.start_from_checkpoint bool 任务属性,是否从checkpoint开始执行任务,用于任务中断后接续执行,默认值false attributes:
    start_from_checkpoint: true
attributes.large_file_size usize 任务属性,超过该参数设置尺寸的文件,文件切片传输 attributes:
    large_file_size: 50M
attributes.multi_part_chunk_size usize 任务属性,对象分片尺寸 attributes:
    multi_part_chunk_size: 10m
attributes.multi_part_chunks_per_batch usize 任务属性,每批执行的分片数量 attributes:
     multi_part_chunks_per_batch: 20
attributes.multi_part_parallelism usize 任务属性,分片批次执行的并行度 attributes:
    multi_part_parallelism: 8
attributes.multi_part_max_parallelism usize 任务属性,分片上传的最大并行度 attributes:
    multi_part_max_parallelism: 12
attributes.exclude list 任务属性,配置排除对象的正则表达式列表,符合列表的对象将不被处理 attributes:
    oexclude:
    - test/t3/*
    - test/t4/*
attributes.include list 任务属性,配置正则表达式列表,程序只处理符合列表的对象 attributes:
    include:
    - test/t3/*
    - test/t4/*
attributes.transfer_type String 任务属性,传输类型 stock/full,目前支持存量和全量模式 attributes:
    transfer_type: stock/full
attributes.last_modify_filter usize 任务属性,根据需要筛选符合实际戳条件的对象进行传输 attributes:
    last_modify_filter:
        filter_type: Greater/Less
        timestamp: 1721284711
attributes.objects_list_batch i32 获取传输列表时,每批次获取对象的数量,默认值512,当源为对象存储时最大1000 attributes:
    objects_list_batch: 512
attributes.objects_list_file_max_line i32 列表文件容纳的最大行数,超过自动填充下一个列表文件 attributes:
    objects_list_file_max_line: 100000
attributes.objects_list_files list 任务属性,手动指定列表文件 attributes:
    objects_list_files:
    - /path/to/list1.txt
    - /path/to/list2.txt
attributes.increment_mode String 任务属性,增量模式:scan 或 notify attributes:
    increment_mode: scan

compare yaml

type: compare
task_id: '7350354445546426369'
name: default_name
source:
  provider: JD
  access_key_id: access_key_id
  secret_access_key: secret_access_key
  endpoint: http://s3.cn-north-1.jdcloud-oss.com
  region: cn-north-1
  bucket: bucket_name
  prefix: test/samples/
  request_style: VirtualHostedStyle
target:
  provider: JD
  access_key_id: access_key_id
  secret_access_key: secret_access_key
  endpoint: http://s3.cn-north-1.jdcloud-oss.com
  region: cn-north-1
  bucket: bucket_name
  prefix: test/samples/
  request_style: VirtualHostedStyle
check_option:
  check_content_length: true
  check_expires: false
  check_content: false
  check_meta_data: false
attributes:
  objects_per_batch: 64
  task_parallelism: 16
  meta_dir: /tmp/meta_dir
  start_from_checkpoint: false
  large_file_size: 64m
  multi_part_chunk: 8m
  multi_part_max_parallelism: 12
  exclude: null
  include: null
  exprirs_diff_scope: 10
  last_modify_filter: null
  objects_list_batch: 512
  objects_list_files_max_line: 1000000

compare yml 参数详解

配置项 字段属性 必填 描述 示例
type String 任务类型,transfer 或 compare,详细执行类型通过:oss_pipe parameters task_type 查看 type: transfer/compare
task_id String 任务id,为空时由系统生成 task_id: '7219552894540976129'
name String 任务名称,为空时系统生成默认名称 name: transfer_oss2oss
source String 当源为本地目录时,指定本地目录 source: /tmp/source_files
source.provider String 当源为对象存储时,描述对象存储提供商。值为JD/JRSS/ALI/AWS/HUAWEI/COS/MINIO,支持的对象存储提供商通过oss_pipe parameters provider 查询 source:
    provider: AWS
source.access_key_id String 当源为对象存储时,指定对象存储的 access_key。 source:
    access_key_id: xxxx
source.secret_access_key String 当源为对象存储时,指定对象存储的 secret key source:
     secret_access_key: xxxx
source.endpoint String 当源为对象存储时,对象存储endpoint source:
    endpoint: http://oss-cn-beijing.aliyuncs.com
source.region String 当源为对象存储时,对象存储region source:
    region: cn-north-1
source.bucket String 当源为对象存储时,对象存储bucket source:
    bucket: bucket_name
source.prefix String 当源为对象存储时,指定prefix时,只对该prefix下的对象进行操作 source:
    prefix: source/test/prefix/
source.request_style String 对象存储url编码格式,取值:PathStyle/VirtualHostedStyle,默认VirtualHostedStyle source:
    request_style: VirtualHostedStyle
target String 当目标为本地目录时,指定本地目录 target: /tmp/target_files
target.provider String 当目标为对象存储时,描述对象存储提供商。值为JD/JRSS/ALI/AWS/HUAWEI/COS/MINIO,支持的对象存储提供商通过oss_pipe parameters provider 查询 target:
    provider: AWS
target.access_key_id String 当目标为对象存储时,指定对象存储的 access_key。 target:
    access_key_id: xxxx
target.secret_access_key String 当源为对象存储时,指定对象存储的 secret key target:
     secret_access_key: xxxx
target.endpoint String 当目标为对象存储时,对象存储endpoint target:
    endpoint: http://oss-cn-beijing.aliyuncs.com
target.region String 当目标为对象存储时,对象存储region target:
    region: cn-north-1
target.bucket String 当目标为对象存储时,对象存储bucket target:
    bucket: bucket_name
target.prefix String 当目标为对象存储时,指定prefix时,目标添加 prefix,例如源key为a,指定prefix 为 p/时,a在目标的key为p/a target:
    prefix: target/prefix/
target.request_style String 对象存储url编码格式,取值:PathStyle/VirtualHostedStyle,默认VirtualHostedStyle target:
    request_style: VirtualHostedStyle
check_option.check_content_length usize 校验属性,是否校验内容长度,默认为false attributes:
    check_content_length: false
check_option.check_expire usize 校验属性,是否校验过期时间,当源和目标均为对象存储时起作用,默认为false attributes:
    check_expire: false
check_option.check_meta_data usize 是否校验meta data,当源和目标均为对象存储时生效,默认为false attributes:
    check_meta_data: false
check_option.check_content usize 是否校验文件内容,开启该配置会对文件内容按字节进行校验,流量消耗大,慎重开启,默认为false attributes:
    check_content: false
attributes.objects_per_batch usize 任务属性,每批次执行的对象数量 attributes:
    objects_per_batch: 100
attributes.task_parallelism usize 任务属性,任务并行度,既同时执行任务批次的数量 attributes:
    task_parallelism: 16
attributes.objects_list_batch usize 任务属性,对象列表批次,每批次写入列表文件的数量 attributes:
    objects_list_batch: 1000
attributes.meta_dir String 任务属性,元数据存储位置,默认路径/tmp/meta_dir attributes:
    meta_dir: /root/meta_dir
attributes.target_exists_skip bool 任务属性,当target存在同名对象时不传送对象,默认值为false attributes:
    target_exists_skip: false
attributes.start_from_checkpoint bool 任务属性,是否从checkpoint开始执行任务,用于任务中断后接续执行,默认值false attributes:
    start_from_checkpoint: true
attributes.large_file_size usize 任务属性,超过该参数设置尺寸的文件,文件切片传输 attributes:
    large_file_size: 50M
attributes.multi_part_chunk_size usize 任务属性,对象分片尺寸 attributes:
    multi_part_chunk_size: 10m
attributes.multi_part_chunks_per_batch usize 任务属性,每批执行的分片数量 attributes:
     multi_part_chunks_per_batch: 20
attributes.multi_part_parallelism usize 任务属性,分片批次执行的并行度 attributes:
    multi_part_parallelism: 8
attributes.multi_part_max_parallelism usize 任务属性,分片上传的最大并行度 attributes:
    multi_part_max_parallelism: 12
attributes.exclude list 任务属性,配置排除对象的正则表达式列表,符合列表的对象将不被处理 attributes:
    oexclude:
    - test/t3/*
    - test/t4/*
attributes.include list 任务属性,配置正则表达式列表,程序只处理符合列表的对象 attributes:
    include:
    - test/t3/*
    - test/t4/*
attributes.exprirs_diff_scope i32 当校验过期时间时由于服务器间的时间差异需要一定冗余,既相差在一定时间内既为校验成功,默认相差10秒以内 attributes:
    exprirs_diff_scope: 10
attributes.objects_list_batch i32 获取传输列表时,每批次获取对象的数量,默认值512,当源为对象存储时最大1000 attributes:
    objects_list_batch: 512
attributes.objects_list_file_max_line i32 列表文件容纳的最大行数,超过自动填充下一个列表文件 attributes:
    objects_list_file_max_line: 100000