我正在阅读有关使用 java 序列化的缺点以及使用序列化框架的必要性的文章。有很多框架,例如 avro、parquet、thrift、protobuff。
问题是哪个框架解决了什么问题以及选择序列化框架时需要考虑的所有参数是什么。
我想尝试一个实际用例,并根据需求比较/选择序列化框架。
有人可以就这个话题提供帮助吗?
我正在使用 spring-kafka 模板编写 kafka 消费者。当我实例化消费者时,Spring kafka 接受如下参数。
props.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);
props.put(ConsumerConfig.FETCH_MAX_BYTES_CONFIG, fetchMaxBytes);
props.put(ConsumerConfig.MAX_PARTITION_FETCH_BYTES_CONFIG, maxPartitionFetchBytes);
Run Code Online (Sandbox Code Playgroud)
我阅读了文档,看起来还有很多其他参数也可以作为消费者配置传递。有趣的是,每个参数都有一个默认值。我的问题是
任何指示或答案都会对澄清我的疑问有很大帮助。
我正在尝试列出给定订阅的存储帐户,并尝试拉取订阅的所有 blob 端点。
它的完成方式如下。
一种。使用 subscriptionId 与 Azure.Authenticated 对象创建缓存。这个基本上是为了复用,用于后续业务流程中的sdk api调用
湾 如果上述缓存中没有subscriptionid,则按如下方式创建Azure.Authenticated 对象,并将其放入缓存中
ApplicationTokenCredentials credentials = new ApplicationTokenCredentials(
subscription.getClientId(),
subscription.getTenantId(),
subscription.getKey(),
subscription.getEnvironmentType().getEnvironment());
Azure.Authenticated = Azure.configure()
.withLogLevel(LogLevel.NONE)
.authenticate(credentials);
Run Code Online (Sandbox Code Playgroud)
C。使用订阅 ID 获取 Azure 对象
azure = authenticatedClient.withSubscription(subscription.getSubscriptionId());
Run Code Online (Sandbox Code Playgroud)
d. 使用 storageAccounts 列表 API 对给定订阅的所有存储帐户进行分页和列出。
try {
PagedList<StorageAccount> strgAccList = azure.storageAccounts().list();
boolean hasNextPage = null != strgAccList.currentPage();
int pageCount = 0;
if (hasNextPage) {
while (hasNextPage) {
++pageCount;
Page<StorageAccount> resourcePage = strgAccList.currentPage();
Iterator<StorageAccount> it = resourcePage.items().iterator();
while (it.hasNext()) {
StorageAccount storageAccount = it.next();
storageAccounts.put(storageAccount.name(), …Run Code Online (Sandbox Code Playgroud)