- 博客(197)
- 收藏
- 关注
原创 easyExcel - 读Excel
官方文档: https://easyexcel.opensource.alibaba.com/docs/current/Java解析、生成Excel比较有名的框架有Apache poi、jxl。
2023-03-29 20:52:05 154
原创 XxlJob+钉钉机器人实现天气提醒
(1).XxlJob《分布式任务调度平台XXL-JOB》源码结构:xxl-job-admin:调度中心xxl-job-core:公共依赖xxl-job-executor-samples:执行器Sample示例(选择合适的版本执行器,可直接使用,也可以参考其并将现有项目改造成执行器) :xxl-job-executor-sample-springboot:Springboot版本,通过Springboot管理执行器,推荐这种方式; :xxl-job-executor-sample-
2022-04-09 16:14:31 602
原创 MySQL基础知识
流程控制函数:#IF(test,t,f)如果test真返回t,否则返回fselect if(1=1,"hello","world") from dual;#IFNULL(arg1,arg2)如果arg1非空返回arg1,否则返回arg2select ifnull("hello","world") from dual;#NULLIF(arg1,arg2)如果arg1=arg2返回null,否则返回arg1select nullif("hello","hello") from dual;se
2022-04-01 19:56:32 533
原创 SQL优化
理论知识大SQL1. 结果集很大的SQL语句, 日常业务逻辑查询数据量很少超过万行, 某些定时统计任务可能需要大结果集, 但也不应该有百万行的查询.慢SQL1. 从执行时间来看, 在低负载时, 超过2秒就算慢SQL, 在高负载时, 超过5秒算慢SQL2. 从扫描行数来看, 不管低负载, 高负载, 超过百万行就算慢SQL慢SQL原因: 没有命中合适的索引1. 没有给查询条件加索引2. 加了索引, 但是实际执行过程中, MYSQL引擎没有使用该索引索引:这里只讨论B+Tree数据结构的
2022-03-31 10:14:20 442
原创 阿里巴巴面试题-基础
//阿里面试题:统计积分操作日志表,获得积分排行create table if not exists pointLog( uid int(10), point int(10), operator varchar(255));insert into pointLog(uid, point, operator)values (1, 100, "inc"), (1, 20, "dec"), (1, 10, "inc"),
2022-01-06 00:15:38 201
原创 JUC-CompletableFuture异步回调
1.无返回值的 runAsync 异步回调2.有返回值的 supplyAsync 异步回调public class CompletableFuture_ { public static void main(String[] args) throws Exception { //没有返回值的异步回调 runAsync() CompletableFuture<Void> completableFuture1 = CompletableFuture.ru
2021-12-28 15:36:01 223
原创 JUC-Fork/Join分支合并框架
public class TestForkJoinPool { static class MyTask extends RecursiveTask<Integer> { private static final Integer VALUE = 10; private int begin; private int end; private int result; public MyTask(Integer
2021-12-28 15:35:08 94
原创 JUC-ThreadPool线程池
1.四种线程池public class ThreadPool_ { public static void main(String[] args) { //singleTheadPoolTest(); //fixTheadPoolTest(); //cacheThreadPool(); scheduleThreadPool(); } //corePoolSize=1,maximumPoolSize=1 //k
2021-12-28 15:30:52 267
原创 JUC-BlockingQueue阻塞队列
ArrayBlockingQueue :一个由数组结构组成的有界阻塞队列LinkedBlockingQueue :一个由链表结构组成的有界阻塞队列(常用)PriorityBlockingQueue :一个支持优先级排序的无界阻塞队列DelayQueue: 一个使用优先级队列实现的无界阻塞队列SynchronousQueue: 一个不存储元素的阻塞队列(常用)LinkedTransferQueue: 一个由链表结构组成的无界阻塞队列LinkedBlockingDeque: 一个由链表结构组成的双向
2021-12-28 15:27:27 329
原创 JUC-读写锁
1.乐观锁 vs 悲观锁悲观锁:每次在拿数据的时候都会上锁乐观锁:拿数据的时候不会上锁,在更新时候判断数据是否被修改过,可以使用版本号等机制,乐观锁适用于多读的应用类型,这样可以提高吞吐量2.表锁 vs 行锁表锁:开销小,加锁快;不会出现死锁;锁定力度大,发生锁冲突概率高,并发度最低行锁:开销大,加锁慢;会出现死锁;锁定粒度小,发生锁冲突的概率低,并发度高3.共享锁 vs 排他锁排他锁:ReentrantLock和synchronized为排他锁,同一时刻只允许一个线程进行访问共享锁:可
2021-12-28 15:23:51 68
原创 JUC-JUC辅助类
1.java.util.concurrent.CountDownLatchpublic class CountDownLatch_ { @SneakyThrows public static void main(String[] args) { //the number of times must be invoked before threads can pass through CountDownLatch countDownLatch = new C
2021-12-27 15:45:10 90
原创 JUC-Callable接口
一种是通过创建Thread类,另一种是通过使用Runnable创建线程Runnable无法使线程返回结果,为了支持此功能,Java中提供了Callable接口public class FutureTask<V> implements RunnableFuture<V>public interface RunnableFuture<V> extends Runnable, Future<V>Callable是一个函数式接口,和Runnable类似,多了返
2021-12-27 15:43:05 412
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人