随笔分类 -  guava

摘要:# 前置检查 ## 1.checkArgument ```java Preconditions.checkArgument(1 > 0 ,"error msg"); ``` 底层实现 ```java public static void checkArgument(boolean expressio 阅读全文
posted @ 2023-07-10 17:42 SpecialSpeculator 阅读(46) 评论(0) 推荐(0) 编辑
摘要:创建map的同时赋值 Map<Boolean, Consumer<ProcessContext<NotificationModel>>> actionMap = new ImmutableMap.Builder<Boolean, Consumer<ProcessContext<Notificatio 阅读全文
posted @ 2023-01-11 14:18 SpecialSpeculator 阅读(41) 评论(0) 推荐(0) 编辑
摘要:1.引用guava中的重试类 <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>30.1.1-jre</version> </dependency> 2.定义Boolean 阅读全文
posted @ 2022-12-08 10:48 SpecialSpeculator 阅读(180) 评论(0) 推荐(0) 编辑
摘要:依赖guava中的table数据结构 使用 Table<Long, String, Set<Metric>> table = Tables.synchronizedTable(HashBasedTable.create()); # table的三段结构rowKey,columnKey,value # 阅读全文
posted @ 2022-11-11 17:34 SpecialSpeculator 阅读(131) 评论(0) 推荐(0) 编辑
摘要:列表分片,及并行执行样例 Set<String> ips = Stream.of("1","2","3","4","5","6","7","8","9","10") // 按照2个为一组,进行切片操作 List<List<String>> partition = Lists.partition(Li 阅读全文
posted @ 2021-01-05 11:30 SpecialSpeculator 阅读(164) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示