你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
FabricServicePartitionResolver 类
- java.
lang. Object - ServicePartitionResolver
- microsoft.
servicefabric. services. client. FabricServicePartitionResolver
- microsoft.
public class FabricServicePartitionResolver implements ServicePartitionResolver
实现有助于确定服务终结点的 类。 此类包装 FabricClient 的 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(java.net.URI) 方法,并针对该方法的错误实现退让/重试机制。
字段摘要
修饰符和类型 | 字段和描述 |
---|---|
final Duration |
defaultMaxRetryBackoffInterval
这是 ServicePartitionResolver 的 ResolveAsync 方法在未显式指定 maxRetryBackoffInterval 参数的情况下调用它时使用的默认最大重试回退间隔。 |
final Duration |
defaultResolveTimeout
这是在未显式指定 resolveTimeoutPerTry 参数的情况下调用的 ResolveAsync 方法 ServicePartitionResolver 每次尝试使用的默认解析超时。 |
构造函数摘要
构造函数 | 说明 |
---|---|
FabricServicePartitionResolver(FabricClientSettings settings, String... connectionEndpoints) |
实例化 ServicePartitionResolver,使用给定的 FabricClient 设置和 connectionEndpoints 创建 FabricClient 的新实例。 |
FabricServicePartitionResolver(String... connectionEndpoints) |
实例化 ServicePartitionResolver,使用给定的 connectionEndpoint 创建 FabricClient 的新实例。 |
FabricServicePartitionResolver(Supplier<FabricClient> createFabricClient) |
实例化 ServicePartitionResolver,调用给定的委托来实例化 FabricClient。 |
FabricServicePartitionResolver(Supplier<FabricClient> createFabricClient, Supplier<FabricClient> recreateFabricClient) |
实例化 ServicePartionResolver,调用第一个委托来实例化 FabricClient。 在分区解析期间,如果释放 FabricClient 对象并提供第二个委托,它将使用第二个委托重新创建 FabricClient。 如果释放了使用第一个委托创建的 FabricClient,则第二个委托提供了一种指定创建 FabricClient 的另一种方法。 |
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
Service |
getDefault()
获取默认的 ServicePartitionResolver |
Duration | getResolveTimeout() |
Duration | getRetryBackoffInterval() |
CompletableFuture<Resolved |
resolveAsync(ResolvedServicePartition previousRsp)
通过在可重试错误时回退/重试调用 FabricClient 的 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI) 方法,解析指定服务的分区。 这会采用通过早期调用 ResolveAsync () 方法获取的已解析服务分区。 如果客户端知道其已解析的服务分区不再有效,则使用此 api 重载。 |
CompletableFuture<Resolved |
resolveAsync(ResolvedServicePartition previousRsp, Duration resolveTimeoutPerTry, Duration maxRetryBackoffInterval)
解析指定服务的分区,并针对可重试的错误进行回退/重试。 这会采用通过早期调用 ResolveAsync () 方法获取的已解析服务分区。 如果客户端知道其已解析的服务分区不再有效,则使用此 api 重载。 |
CompletableFuture<Resolved |
resolveAsync(URI serviceUri, ServicePartitionKey partitionKey)
通过在可重试错误时回退/重试调用 FabricClient 的 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI)方法,解析指定服务的分区。 |
CompletableFuture<Resolved |
resolveAsync(URI serviceUri, ServicePartitionKey partitionKey, Duration resolveTimeoutPerTry, Duration maxRetryBackoffInterval)
通过调用 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI) 方法解决指定服务的分区,并在可重试错误时返回/重试。 |
void |
setDefault(ServicePartitionResolver defaultServiceResolver)
汇报默认 ServicePartitionResolver |
void | setResolveTimeout(Duration resolveTimeout) |
void | setRetryBackoffInterval(Duration retryBackoffInterval) |
字段详细信息
defaultMaxRetryBackoffInterval
public static final Duration defaultMaxRetryBackoffInterval= Duration.ofSeconds(5)
这是 ServicePartitionResolver 的 ResolveAsync 方法在未显式指定 maxRetryBackoffInterval 参数的情况下调用它时使用的默认最大重试回退间隔。
defaultResolveTimeout
public static final Duration defaultResolveTimeout= Duration.ofSeconds(30)
这是在未显式指定 resolveTimeoutPerTry 参数的情况下调用的 ResolveAsync 方法 ServicePartitionResolver 每次尝试使用的默认解析超时。
构造函数详细信息
FabricServicePartitionResolver
public FabricServicePartitionResolver(FabricClientSettings settings, String... connectionEndpoints)
实例化 ServicePartitionResolver,使用给定的 FabricClient 设置和 connectionEndpoints 创建 FabricClient 的新实例。
Parameters:
FabricServicePartitionResolver
public FabricServicePartitionResolver(String... connectionEndpoints)
实例化 ServicePartitionResolver,使用给定的 connectionEndpoint 创建 FabricClient 的新实例。
Parameters:
FabricServicePartitionResolver
public FabricServicePartitionResolver(Supplier
实例化 ServicePartitionResolver,调用给定的委托来实例化 FabricClient。
Parameters:
FabricServicePartitionResolver
public FabricServicePartitionResolver(Supplier
实例化 ServicePartionResolver,调用第一个委托来实例化 FabricClient。 在分区解析期间,如果释放 FabricClient 对象并提供第二个委托,它将使用第二个委托重新创建 FabricClient。 如果释放了使用第一个委托创建的 FabricClient,则第二个委托提供了一种指定创建 FabricClient 的另一种方法。
Parameters:
方法详细信息
getDefault
public static ServicePartitionResolver getDefault()
获取默认的 ServicePartitionResolver
Returns:
getResolveTimeout
public Duration getResolveTimeout()
getRetryBackoffInterval
public Duration getRetryBackoffInterval()
resolveAsync
public CompletableFuture
通过在可重试错误时回退/重试调用 FabricClient 的 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI) 方法,解析指定服务的分区。 这会采用通过早期调用 ResolveAsync () 方法获取的已解析服务分区。 如果客户端知道其已解析的服务分区不再有效,则使用此 api 重载。
Parameters:
Returns:
resolveAsync
public CompletableFuture
解析指定服务的分区,并针对可重试的错误进行回退/重试。 这会采用通过早期调用 ResolveAsync () 方法获取的已解析服务分区。 如果客户端知道其已解析的服务分区不再有效,则使用此 api 重载。
Overrides:
FabricServicePartitionResolver.resolveAsync(ResolvedServicePartition previousRsp, Duration resolveTimeoutPerTry, Duration maxRetryBackoffInterval)Parameters:
Returns:
resolveAsync
public CompletableFuture
通过在可重试错误时回退/重试调用 FabricClient 的 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI)方法,解析指定服务的分区。
Parameters:
Returns:
resolveAsync
public CompletableFuture
通过调用 system.fabric.client.ServiceManagementClient#resolveServicePartitionAsync(URI) 方法解决指定服务的分区,并在可重试错误时返回/重试。
Overrides:
FabricServicePartitionResolver.resolveAsync(URI serviceUri, ServicePartitionKey partitionKey, Duration resolveTimeoutPerTry, Duration maxRetryBackoffInterval)Parameters:
Returns:
setDefault
public static void setDefault(ServicePartitionResolver defaultServiceResolver)
汇报默认 ServicePartitionResolver
Parameters:
setResolveTimeout
public void setResolveTimeout(Duration resolveTimeout)
Parameters:
setRetryBackoffInterval
public void setRetryBackoffInterval(Duration retryBackoffInterval)
Parameters:
适用于
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈