Class: TencentCloud::Dts::V20211206::DistributeRule

Inherits:
Common::AbstractModel
  • Object
show all
Defined in:
lib/v20211206/models.rb

Overview

订阅任务的kafka分区规则。符合库名和表名正则表达式的数据将按照RuleType计算该条数据将被投递的kafka分区。如果配置了多个规则,将按照配置的顺序,第一条命中的规则生效。

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(ruletype = nil, dbpattern = nil, tablepattern = nil, columns = nil) ⇒ DistributeRule

Returns a new instance of DistributeRule.



3964
3965
3966
3967
3968
3969
# File 'lib/v20211206/models.rb', line 3964

def initialize(ruletype=nil, dbpattern=nil, tablepattern=nil, columns=nil)
  @RuleType = ruletype
  @DbPattern = dbpattern
  @TablePattern = tablepattern
  @Columns = columns
end

Instance Attribute Details

#ColumnsObject

Parameters:

  • RuleType:

    规则类型。非mongo产品的枚举值为: table-按表名分区,pk-按表名+主键分区,cols-按列名分区。mongo的枚举值为:collection-按集合名分区、collectionAndObjectId-按集合+主键分区。

  • DbPattern:

    库名匹配规则,请填写正则表达式

  • TablePattern:

    表名匹配规则,如果 DatabaseType 为 mongodb,则匹配集合名

  • Columns:

    列名。如果 RuleType 为 cols,此项必填。订阅任务会用该列的值计算分区。mongo没有按列分区,因此也不用传这个字段。



3962
3963
3964
# File 'lib/v20211206/models.rb', line 3962

def Columns
  @Columns
end

#DbPatternObject

Parameters:

  • RuleType:

    规则类型。非mongo产品的枚举值为: table-按表名分区,pk-按表名+主键分区,cols-按列名分区。mongo的枚举值为:collection-按集合名分区、collectionAndObjectId-按集合+主键分区。

  • DbPattern:

    库名匹配规则,请填写正则表达式

  • TablePattern:

    表名匹配规则,如果 DatabaseType 为 mongodb,则匹配集合名

  • Columns:

    列名。如果 RuleType 为 cols,此项必填。订阅任务会用该列的值计算分区。mongo没有按列分区,因此也不用传这个字段。



3962
3963
3964
# File 'lib/v20211206/models.rb', line 3962

def DbPattern
  @DbPattern
end

#RuleTypeObject

Parameters:

  • RuleType:

    规则类型。非mongo产品的枚举值为: table-按表名分区,pk-按表名+主键分区,cols-按列名分区。mongo的枚举值为:collection-按集合名分区、collectionAndObjectId-按集合+主键分区。

  • DbPattern:

    库名匹配规则,请填写正则表达式

  • TablePattern:

    表名匹配规则,如果 DatabaseType 为 mongodb,则匹配集合名

  • Columns:

    列名。如果 RuleType 为 cols,此项必填。订阅任务会用该列的值计算分区。mongo没有按列分区,因此也不用传这个字段。



3962
3963
3964
# File 'lib/v20211206/models.rb', line 3962

def RuleType
  @RuleType
end

#TablePatternObject

Parameters:

  • RuleType:

    规则类型。非mongo产品的枚举值为: table-按表名分区,pk-按表名+主键分区,cols-按列名分区。mongo的枚举值为:collection-按集合名分区、collectionAndObjectId-按集合+主键分区。

  • DbPattern:

    库名匹配规则,请填写正则表达式

  • TablePattern:

    表名匹配规则,如果 DatabaseType 为 mongodb,则匹配集合名

  • Columns:

    列名。如果 RuleType 为 cols,此项必填。订阅任务会用该列的值计算分区。mongo没有按列分区,因此也不用传这个字段。



3962
3963
3964
# File 'lib/v20211206/models.rb', line 3962

def TablePattern
  @TablePattern
end

Instance Method Details

#deserialize(params) ⇒ Object



3971
3972
3973
3974
3975
3976
# File 'lib/v20211206/models.rb', line 3971

def deserialize(params)
  @RuleType = params['RuleType']
  @DbPattern = params['DbPattern']
  @TablePattern = params['TablePattern']
  @Columns = params['Columns']
end