records

kafka消费者偏移量提交

依然范特西╮ 提交于 2020-02-27 15:27:53
自动提交当前偏移量 如果客户端属性enable.auto.commit被设为true,那么每过5s,消费者会自动把从poll()方法接收到的最大偏移量提交上去,提交时间间隔 由auto.commit.interval.ms控制,默认为5s 假设我们使用默认的5s提交时间间隔,在上次提交的3s之后发生了再均衡,在均衡后消费者会从最后一次提交的位置开始读取消息,这时候 偏移量已经落后的3s,因此这3s内的消息会被重复处理,可以修改时间间隔来进行优化,但是这种情况无法避免. 注意: 消息重复的问题可以通过保证消息处理逻辑的幂等性来处理 同步提交当前偏移量 把auto.commit.offset设为false,方应用程序决定何时提交偏移量,使用commitSync()方法提交偏移量最简单可靠,这个api会提交 poll()方法返回的最新偏移量,提交成功后马上返回,如果提交失败,则跑出异常 注意: commitSync()方法提交的偏移量是最新的偏移量,需要在处理完所有消息之后再调用 代码示例 @Test void test() { Properties properties = new Properties() properties.put(KafkaConstants.BOOTSTRAP_SERVERS_KEY, KafkaConstants.BOOTSTRAP_SERVERS)

sql 基础知识

百般思念 提交于 2020-02-27 06:45:57
sql 基础知识 不要极至最求一条sql语句搞定一切,可合理拆分为多条语句 1. sql 变量定义与赋值 Sql 语句中,直接在 SELECT 使用 @ 定义一个变量,如: @a 。 使用 := 来给变量赋值,: @a:=123 ,则变量a的值为123。 SELECT @a := id FROM table_a 同时定义多个变量,需要在子语句中定义 SELECT @a := 1 FROM table_a,(SELECT @b := 2,@c := 3) as rcrcia 例子 根据子查询结果,将主查询结果进行排序 # 使用 find_in_set 查询ID排序位置 select id, find_in_set(id, @rank) `rank` from user, # 声明定义变量 赋值为 子查询结果 结果为 '3,1,31' (SELECT @rank := (SELECT group_concat(content_id) as content_id FROM `collect_records` WHERE user_id = 1 order by creation_time desc)) as indexRank # 查询符合子查询结果的数据 where find_in_set(id, @rank) > 0 # 根据排序值排序 order by `rank`; 2.sql

Records for Mac(个人数据库管理工具)

别等时光非礼了梦想. 提交于 2020-02-26 17:32:45
Mac上好用的个人数据库管理软件推荐用Records for Mac,这款Records Mac版下载可以创建个人数据库,可以通过个人数据库程序架构编辑器,并且还可以通过Records Mac破解版创建数据编辑器,SQL 编辑器以及查询生成器等,让您轻松管理您的数据库。 Records Mac版下载功能介绍 你的模板在几秒钟内 使用简单而智能的拖放Visual Editor,在几秒钟内构建模板。你马上就能开始跑步了。 可配置的表单字段 配置表单域以确保输入正确的数据。设置文本大小写,日期格式或图像比例等属性,以使数据显示。 快速且可扩展 Records支持具有数万条记录的数据库,使您可以立即收集,组织和搜索数据,而不会有任何妥协。 灵活的电子表格视图 在灵活的电子表格视图中显示,收集,编辑和排序数据。这个有用的视图允许您在紧凑的单一视图中显示所有数据。 语言 记录完全本地化为英语,法语,德语,意大利语,西班牙语和日语。 Records Mac特别版新功能 电子表格视图 在灵活的电子表格视图中显示,收集,编辑和排序数据。 星级评分领域 新的有用星级评级字段允许从一系列评级值中进行选择。 30 多个模板 从选择30个可用和可立即使用的模板中的一个开始使用记录。 来源: oschina 链接: https://my.oschina.net/u/4436877/blog/3175420

《Linux就该这么学》第三节课,感觉慢慢有难度了。

可紊 提交于 2020-02-26 14:44:11
1. ifconfig 用于获取网卡信息与网络状态 1) 网卡名称: eno167777728 2)IP 地址: inet后面的参数 3)MAC地址:ether参数后面 4)接受数据包大小:RX packages 5)发送数据包大小: TX packages RX与TX的数据大小是累积的,直到下次重启。 2.uname 用于查看系统内核与系统版本等信息 格式: uname - uptime 用于查看系统CPU负载 Free 用于查看系统内存负载 4.who 用于查看当前登陆主机的用户终端信息 5last 用于查看系统的所有的登陆记录。登陆记录可以被修改,所以不能以此来判断是否被入侵。 6.history(重要命令) 用于显示历史执行过的命令 格式:history 只显示最近1000条的命令记录,当1000 条不够时,可以自定义/etc/profile中的HISTSIZE的值 history -c 清空所有命令的历史记录 !某个命令记录的序号 可以反复执行该命令 历史命令会被保存到家目录的.bash_history文件中。 Linux系统中以(.)点开头的文件均代表隐藏文件,可以用cat命令查看文件内容。 8.sosresport,输入命令后,需要再按两次回车键。 用于收集系统配置及架构信息并输出诊断文档,大约70个信息,输出的文档格式为.tar.xz压缩包

F# Sorting Sequence of Records where Value isn't yet assigned to Type in Sequence

心不动则不痛 提交于 2020-01-15 10:11:18
问题 I am trying to sort a Sequence of records by the second element in each record. The problem is that these are not a value and instead are just a Type. I have a function where it returns the value based on which Type it is. This is what I have: type Suit = Spades | Clubs | Hearts | Diamonds type Rank = Ace | Two | Three | Four | Five | Six | Seven | Eight | Nine | Ten | Jack | Queen | King type Card = { suit: Suit; rank: Rank} type Hand = Card seq let cardValue(card:Card) = if (card.rank = Ace

DATA and IMAGE are populated in two rows. I want to bind them in a single row

北慕城南 提交于 2019-12-31 03:51:09
问题 I'M GOING TO ASK THIS FOR THE SECOND TIME. I'M GOING TO MAKE IT CLEAR SO YOU CAN HELP ME :) Okay let's start. I have a Registration Process. I split the process into two page. The first page is for "Personal Information" only. Then when i click the next button the next page will appear (postbackURL) This page is for "Upload Photo" page. They work fine! the data and the image are displayed on my gridview control. But my problem is here: As you can see in the figure below. The data are

DATA and IMAGE are populated in two rows. I want to bind them in a single row

偶尔善良 提交于 2019-12-31 03:51:08
问题 I'M GOING TO ASK THIS FOR THE SECOND TIME. I'M GOING TO MAKE IT CLEAR SO YOU CAN HELP ME :) Okay let's start. I have a Registration Process. I split the process into two page. The first page is for "Personal Information" only. Then when i click the next button the next page will appear (postbackURL) This page is for "Upload Photo" page. They work fine! the data and the image are displayed on my gridview control. But my problem is here: As you can see in the figure below. The data are

Kafka2.4发布——新特性介绍(附Java Api Demo代码)

感情迁移 提交于 2019-12-30 09:45:04
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 新功能 允许消费者从最近的副本进行获取 为 Consumer Rebalance Protocol 增加对增量协同重新均衡(incremental cooperative rebalancing)的支持 新增 MirrorMaker 2.0 (MM2),新的多集群跨数据中心复制引擎 引入新的 Java 授权程序接口 支持 KTable 中的非密钥连接 用于重新分配副本的 Administrative API 保护内部连接的 REST 端点 新增删除消费者偏移并通过 AdminClient 公开的 API 改进 [ KAFKA-5609 ] - 连接 log4j 会默认记录到文件 [ KAFKA-6263 ] - 为群组的元数据加载持续时间暴露指标(Metric) [ KAFKA-6883 ] - KafkaShortnamer 允许将 Kerberos 主体名称转换为大写用户名 [ KAFKA-6958 ] - 允许使用 KStreams DSL 定义自定义处理器名称 [ KAFKA-7018 ] - 持久使用 memberId 以重新启动消费者 [ KAFKA-7149 ] - 减少分配数据大小以提高 kafka 流的可伸缩性 [ KAFKA-7190 ] - 在数据传输拥挤的情况下,清除分区 topic

Machine learning for Java developers, Part 1: Algorithms for machine learning

大城市里の小女人 提交于 2019-12-27 12:32:36
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> Self-driving cars, face detection software, and voice controlled speakers all are built on machine learning technologies and frameworks--and these are just the first wave. Over the next decade, a new generation of products will transform our world, initiating new approaches to software development and the applications and products that we create and use. As a Java developer, you want to get ahead of this curve, especially because tech companies are beginning to seriously invest in machine learning. What you learn today, you can build on over the next five