Class VariantRouter.Builder<T>
java.lang.Object
cloud.opencode.base.feature.proxy.VariantRouter.Builder<T>
- Type Parameters:
T- the variant type | 变体类型
- Enclosing class:
VariantRouter<T>
Builder for VariantRouter
VariantRouter构建器
- Since:
- JDK 25, opencode-base-feature V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the router 构建路由器defaultVariant(String variantId) Set the default variant 设置默认变体Set salt for consistent hashing 设置一致性哈希的盐Add variant from supplier 从供应器添加变体Add a variant with equal percentage distribution 添加具有平均百分比分布的变体Add a variant with specified percentage 添加具有指定百分比的变体
-
Method Details
-
variant
Add a variant with equal percentage distribution 添加具有平均百分比分布的变体- Parameters:
variantId- the variant identifier | 变体标识符implementation- the variant implementation | 变体实现- Returns:
- this builder | 此构建器
-
variant
Add a variant with specified percentage 添加具有指定百分比的变体- Parameters:
variantId- the variant identifier | 变体标识符implementation- the variant implementation | 变体实现percentage- the traffic percentage (0-100) | 流量百分比 (0-100)- Returns:
- this builder | 此构建器
-
variant
Add variant from supplier 从供应器添加变体- Parameters:
variantId- the variant identifier | 变体标识符supplier- the variant supplier | 变体供应器percentage- the traffic percentage | 流量百分比- Returns:
- this builder | 此构建器
-
defaultVariant
Set the default variant 设置默认变体- Parameters:
variantId- the default variant ID | 默认变体ID- Returns:
- this builder | 此构建器
-
salt
Set salt for consistent hashing 设置一致性哈希的盐- Parameters:
salt- the salt value | 盐值- Returns:
- this builder | 此构建器
-
build
-