<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[风萧水寒的博客]]></title><description><![CDATA[Stay hungry stay foolish]]></description><link>https://blog.youkuaiyun.com/AbstractLiu</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; AbstractLiu]]></copyright><item><title><![CDATA[SpringBoot中引入WebSocket]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/120032317</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/120032317</guid><author>AbstractLiu</author><pubDate>Wed, 01 Sep 2021 09:20:39 +0800</pubDate><description><![CDATA[SpringBoot中引入WebSocket
1、引入依赖
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
    &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;
&lt;/dependency&gt;
&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.boot]]></description><category></category></item><item><title><![CDATA[JDBC Driver是如何自动注册的]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/119549211</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/119549211</guid><author>AbstractLiu</author><pubDate>Mon, 09 Aug 2021 23:42:44 +0800</pubDate><description><![CDATA[总结下来就是：

获取系统变量jdbc.drivers的值，该系统变量的值为java.sql.Driver实现类的权限定名称（多个实用:分隔），加载实现类（加载的时候自动将其注册到驱动管理器中）；
通过SPI机制，扫描jar包下的META-INF/services/java.sql.Driver配置文件，配置文件中为java.sql.Driver实现类的权限的名，加载该实现类（加载的时候自动将其注册到驱动管理器中）
遍历注册的驱动，使用给定的url尝试建立数据库连接并返回。

驱动管理器中被注册的驱动：

]]></description><category></category></item><item><title><![CDATA[Java8——java.util.stream.Stream类方法总结]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308553</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308553</guid><author>AbstractLiu</author><pubDate>Sun, 30 Aug 2020 17:20:07 +0800</pubDate><description><![CDATA[java.util.stream.Stream
filter
Stream&lt;T&gt; filter(Predicate&lt;? super T&gt; predicate)
按给定Predicate过滤并返回一个steam，这是一个中间操作
map
&lt;R&gt; Stream&lt;R&gt; map(Function&lt;? super T,? extends R&gt; mapper)
对每个元素都调用mapper.apply()方法，这是一个中间操作
mapToInt
IntStre]]></description><category></category></item><item><title><![CDATA[Laravel—数据库操作与Eloquent模型使用总结]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308469</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308469</guid><author>AbstractLiu</author><pubDate>Sun, 30 Aug 2020 17:14:03 +0800</pubDate><description><![CDATA[数据库操作
执行原生SQL
//查询
$emp = DB::select('select * from employees where emp_no = 1');
$emp = DB::select('select * from employees where emp_no = ? and gender = ?',[1,'M']);
$emp = DB::select('select * from employees where emp_no = :empNo and gender = :gender',[]]></description><category></category></item><item><title><![CDATA[PHP的简单介绍]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308418</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308418</guid><author>AbstractLiu</author><pubDate>Sun, 30 Aug 2020 17:11:45 +0800</pubDate><description><![CDATA[简介
全称：PHP：Hypertext Preprocessor，即"PHP：超文本预处理器"、
文件后缀为：.php，文件由HTML+CSS+PHP代码构成；
&lt;?php
    //PHP 代码
    echo "Hello World!";
?&gt;

变量
规则

变量以 $ 符号开始，后面跟着变量的名称
变量名必须以字母或者下划线字符开始
变量名只能包含字母数字字符以及下划线（A-z、0-9 和 _ ）
变量名不能包含空格
变量名是区分大小写的（$y 和 $Y 是两个不同的变量）

作用]]></description><category></category></item><item><title><![CDATA[Shiro 自定义验证和授权逻辑]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308365</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308365</guid><author>AbstractLiu</author><pubDate>Sun, 30 Aug 2020 17:07:18 +0800</pubDate><description><![CDATA[依赖
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.shiro&lt;/groupId&gt;
    &lt;artifactId&gt;shiro-spring&lt;/artifactId&gt;
    &lt;version&gt;1.5.2&lt;/version&gt;
&lt;/dependency&gt;

自定义用户验证


创建MyDBRealm类，继承org.apache.shiro.realm.AuthorizingRealm

]]></description><category></category></item><item><title><![CDATA[Shiro的简单使用]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308338</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/108308338</guid><author>AbstractLiu</author><pubDate>Sun, 30 Aug 2020 17:05:59 +0800</pubDate><description><![CDATA[快速开始
可以从官网下载一个QuickStart项目，开始使用Shiro。
shiro.ini
shiro.ini文件中定义了用户，角色，以及权限信息
[users]
# user 'root' with password 'secret' and the 'admin' role
root = secret, admin
# user 'guest' with the password 'guest' and the 'guest' role
guest = guest, guest
# user 'pr]]></description><category></category></item><item><title><![CDATA[从源码分析ThreadLocal的原理]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/107357940</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/107357940</guid><author>AbstractLiu</author><pubDate>Wed, 15 Jul 2020 12:15:57 +0800</pubDate><description><![CDATA[本文参考并摘抄自java基础教程由浅入深全面解析threadlocal

总结：
1. 线程并发：在多线程并发的场景下
2. 传递数据：我们可以通过ThreadLocal在同一线程，不同组件中传递公共变量
3. 线程隔离：每一个线程的变量都是独立的，不会相互影响

基本使用
package com.fxsh.ThreadLocal;

import lombok.extern.slf4j.Slf4j;

/*
 *       需求：线程隔离
 *           在多线程并发的场景下，每个线程中的变.]]></description><category></category></item><item><title><![CDATA[使用两阶段终止模型优雅的中断线程]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/107119170</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/107119170</guid><author>AbstractLiu</author><pubDate>Sat, 04 Jul 2020 08:09:33 +0800</pubDate><description><![CDATA[public class StopGenteelly {
    public static void main(String[] args) throws InterruptedException {
        TwoPhaseTermination tpt = new TwoPhaseTermination();
        tpt.start();
        Thread.sleep(100);
        tpt.stop();
    }
}

class TwoPhaseTe]]></description><category></category></item><item><title><![CDATA[Java并发中偏向锁、轻量级锁和重量级锁的原理]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/107119136</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/107119136</guid><author>AbstractLiu</author><pubDate>Sat, 04 Jul 2020 07:58:02 +0800</pubDate><description><![CDATA[重量级锁
Java的对象头中的MarkWord
32位操作系统：

64位操作系统：

Monitor

当使用synchronized获得锁时：

synchronized(obj){//重量级锁
    //临界区代码
}

obj对象的MarkWord中的指针（ptr_to_heavyweight_monitor）指向一个 OS提供的 Monitor对象

Monitor中的Owner记录谁是这个锁的主人。

当另一个对象也要获取obj锁时：


发现obj所指向的Monitor的所有者为Thread]]></description><category></category></item><item><title><![CDATA[JVM类加载机制简单介绍]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996112</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996112</guid><author>AbstractLiu</author><pubDate>Mon, 29 Jun 2020 07:34:47 +0800</pubDate><description><![CDATA[本文为《深入理解Java虚拟机JVM高级特效与最佳实践（第三版）》一书的摘要总结

类加载时机

Java虚拟机把描述类的数据从Class文件加载到内存，并对数据进行校验、转换解析和初始化，最终形成可以被虚拟机直接使用的Java类型，这个过程被称做虚拟机的类加载机制。


在Java语言中，类型的加载、连接和初始化过程都是在程序运行期间完成的，这种策略为Java应用提供了极高的扩展性和灵活性，Java天生可以动态扩展的语言特性就是依赖运行期间动态加载和动态连接这个特点实现的。

类的生命周期：

其中加载.]]></description><category></category></item><item><title><![CDATA[JVM 类文件结构分析]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996075</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996075</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:59:23 +0800</pubDate><description><![CDATA[本文为《深入理解Java虚拟机JVM高级特效与最佳实践（第三版）》一书的摘要总结

概念介绍
Class文件格式采用一种类似于C语言结构体的伪结构来存储数据，这种伪结构中只有两种数据类型：“无符号数”和“表”：

无符号数：属于基本数据类型，以u1,u2,u4,u8来代表1，2,4,8个字节的无符号数
表：由多个无符号数或其他表作为数据项构成的复合数据类型，为了便于区分，所有表名都习惯性地以"_info"结尾。

整体结构：

版本号
次版本号：
JDK1.2到JDK11都没有用，全部固定为0。到了JDK.]]></description><category></category></item><item><title><![CDATA[JVM经典垃圾收集器的简单介绍]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996054</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106996054</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:57:29 +0800</pubDate><description><![CDATA[本文为《深入理解Java虚拟机JVM高级特效与最佳实践（第三版）》一书的摘要总结

HotSpot虚拟机的垃圾收集器：

从JDK9开始，Serial+CMS与ParNew + CMS的组合就不再被支持
Serial 收集器
Serial收集器属于新生代收集器，他是一个单线程工作的收集器，在它进行垃圾收集时，必须暂停所有其他的工作线程，直到它收集完成。
Serial+Serial Old收集器的运行过程：

Serial收集器是HotSpot虚拟机运行在客户端模式下的默认新生代收集器，他是所有收集器里额外.]]></description><category></category></item><item><title><![CDATA[MySQL优化查询性能的常用方法]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995896</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995896</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:49:13 +0800</pubDate><description><![CDATA[本文为《高性能MySQL（第三版）》一书的摘要总结

优化数据访问

如果要优化查询，实际上是要优化其子任务，要么要出其中一些子任务，要么减少子任务的执行次数，要么让子任务运行的更快。

查询性能低下最基本的原因是访问的数据太多。对于低效的查询，下面两个步骤的分析总是很有效：

确认应用程序是否在检索大量超过需要的数据。这意味着访问了太多行后者列。
确认MySQL服务器层是否在分析大量超过需要的数据行。

是否向数据库请求了不需要的数据
查询不需要的记录
如果我们不需要展示全部记录，最好在查询后加上LIM.]]></description><category></category></item><item><title><![CDATA[MySQL怎样创建高性能的索引]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995870</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995870</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:47:58 +0800</pubDate><description><![CDATA[本文为《高性能MySQL（第三版）》一书的摘要总结

索引基础

索引优化是对查询性能优化最有效的手段。

索引可以包含多个列的值，如果索引包含多个列，列的顺序非常重要，因为MySQL只能高效使用索引的 最左前缀列。
索引类型
B-Tree索引
使用B-Tree（实际上是B+Tree）数据结构来存储数据。

可以使用B-Tree索引的查询类型：



全值匹配
和索引中的所有列进行匹配。


匹配最左列


匹配列前缀
只匹配某一列的值的前缀部分，后续查询条件将不会使用索引。


匹配范围值
匹配某一列的.]]></description><category></category></item><item><title><![CDATA[MySQL查询性能剖析]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995840</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995840</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:46:21 +0800</pubDate><description><![CDATA[本文为《高性能MySQL（第三版）》一书的摘要总结

性能剖析一般分为两步：

测量任务所花费时间
对结果进行统计和排序，将重要的任务排在前面

性能剖析工具的工作方式：

在任务开始时启动计时器
在任务结束时停止解释器
结束时间减开始时间得到 响应时间

任务剖析报告：每行记录一个任务，包括任务名称，任务的执行时间、任务的消耗时间、任务的平均执行时间以及该任务执行时间占全部时间的百分比。
剖析MySQL查询
慢查询
慢查询日志可以帮助我们剖析并找出代价高的查询。
查看是否开启慢查询日志
mysql&gt.]]></description><category></category></item><item><title><![CDATA[Spring Cloud Config 的简单使用]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995801</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995801</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:43:29 +0800</pubDate><description><![CDATA[本文为《Spring Cloud微服务实战》一书的摘要总结

快速入门
构建配置中心

创建基础的Spring Boot工程，加入依赖：

&lt;dependency&gt;
   &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
   &lt;artifactId&gt;spring-cloud-config-server&lt;/artifactId&gt;
&lt;/dependency&gt;



在主类上添加@EnableCon.]]></description><category></category></item><item><title><![CDATA[Spring Cloud Zuul 的简单使用]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995761</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995761</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:42:31 +0800</pubDate><description><![CDATA[本文为《Spring Cloud微服务实战》一书的摘要总结

快速开始
创建网关

创建一个Spring Boot应用，引入spring-cloud-starter-netflix-zuul依赖：

&lt;dependency&gt;
    &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
    &lt;artifactId&gt;spring-cloud-starter-netflix-zuul&lt;/artifactId&gt;
.]]></description><category></category></item><item><title><![CDATA[Spring Cloud Feign 的简单使用]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995707</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995707</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:39:56 +0800</pubDate><description><![CDATA[本文为《Spring Cloud微服务实战》一书的摘要总结

开始使用
Feign整合了Ribbon和Hystrix，同时还提供了一种声明式的Web服务客户端定义方式。

创建一个SpringBoot应用，加入依赖：

&lt;dependency&gt;
   &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;
   &lt;artifactId&gt;spring-cloud-starter-netflix-eureka-client&lt.]]></description><category></category></item><item><title><![CDATA[Spring Cloud Hystrix 使用与原理分析]]></title><link>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995660</link><guid>https://blog.youkuaiyun.com/AbstractLiu/article/details/106995660</guid><author>AbstractLiu</author><pubDate>Sun, 28 Jun 2020 11:38:29 +0800</pubDate><description><![CDATA[本文为《Spring Cloud微服务实战》一书的摘要总结

服务容错保护：Spring Cloud Hystrix
在分布式架构中，断路器模式 的作用是：当某个服务单元发生故障之后，通过断路器的故障监控，向调用方法返回一个错误响应，而不是长时间的等待。Spring Cloud Hystrix实现了断路器、线程隔离等一系列服务保护功能。
使用

添加依赖

&lt;dependency&gt;
   &lt;groupId&gt;org.springframework.cloud&lt;/groupId&.]]></description><category></category></item></channel></rss>