Skip to content

Commit

Permalink
转换图片路径为相对路径
Browse files Browse the repository at this point in the history
  • Loading branch information
heibaiying committed Nov 14, 2019
1 parent e266780 commit 2ffc0a3
Show file tree
Hide file tree
Showing 29 changed files with 342 additions and 89 deletions.
42 changes: 21 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,34 +22,34 @@

### MySQL

+ [MySQL 核心概念](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_基础.md)
+ [MySQL 备份详解](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_备份.md)
+ [MySQL 二进制日志复制、GTID 复制与半同步复制](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_复制.md)
+ [MySQL 高可用架构之 PXC 集群](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_PXC集群.md)
+ [MyCat 读写分离与分库分表](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_Mycat中间件.md)
+ [MySQL 查询性能分析之 Explain](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MySQL_EXPLAIN.md)
+ [MySQL 核心概念](notes/MySQL_基础.md)
+ [MySQL 备份详解](notes/MySQL_备份.md)
+ [MySQL 二进制日志复制、GTID 复制与半同步复制](notes/MySQL_复制.md)
+ [MySQL 高可用架构之 PXC 集群](notes/MySQL_PXC集群.md)
+ [MyCat 读写分离与分库分表](notes/MySQL_Mycat中间件.md)
+ [MySQL 查询性能分析之 Explain](notes/MySQL_EXPLAIN.md)

### Redis

+ [Redis 基本数据类型和常用命令](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Redis_数据类型和常用命令.md)
+ [Redis AOF 和 RDB 持久化策略原理](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Redis_持久化.md)
+ [Redis 哨兵模式](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Redis_哨兵模式.md)
+ [Reids 集群模式](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Redis_集群模式.md)
+ [Redis 基本数据类型和常用命令](notes/Redis_数据类型和常用命令.md)
+ [Redis AOF 和 RDB 持久化策略原理](notes/Redis_持久化.md)
+ [Redis 哨兵模式](notes/Redis_哨兵模式.md)
+ [Reids 集群模式](notes/Redis_集群模式.md)

### MongoDB

+ [MongoDB 基础](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MongoDB_基础.md)
+ [MongoDB 索引](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MongoDB_索引.md)
+ [MongoDB 聚合](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MongoDB_聚合.md)
+ [MongoDB 复制](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MongoDB_复制.md)
+ [MongoDB 分片](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/MongoDB_分片.md)
+ [MongoDB 基础](notes/MongoDB_基础.md)
+ [MongoDB 索引](notes/MongoDB_索引.md)
+ [MongoDB 聚合](notes/MongoDB_聚合.md)
+ [MongoDB 复制](notes/MongoDB_复制.md)
+ [MongoDB 分片](notes/MongoDB_分片.md)



## 📟 操作系统

+ [Linux 常用 Shell 命令](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Linux_常用Shell命令.md)
+ [Docker 基础](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Docker_基础.md)
+ [Linux 常用 Shell 命令](notes/Linux_常用Shell命令.md)
+ [Docker 基础](notes/Docker_基础.md)



Expand Down Expand Up @@ -91,9 +91,9 @@

### RabbitMQ

- [RabbitMQ 核心概念](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/RabbitMQ_基础.md)
- [RabbitMQ 客户端开发](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/RabbitMQ_客户端开发.md)
- [基于 HAProxy + KeepAlived 搭建 RabbitMQ 高可用集群](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/RabbitMQ_高可用集群架构.md)
- [RabbitMQ 核心概念](notes/RabbitMQ_基础.md)
- [RabbitMQ 客户端开发](notes/RabbitMQ_客户端开发.md)
- [基于 HAProxy + KeepAlived 搭建 RabbitMQ 高可用集群](notes/RabbitMQ_高可用集群架构.md)

### ZooKeeper

Expand All @@ -105,7 +105,7 @@

### Nginx

- [Nginx 基础之静态网站部署,负载均衡,动静分离](https://github.com/heibaiying/Full-Stack-Notes/blob/master/notes/Nginx_基础.md)
- [Nginx 基础之静态网站部署,负载均衡,动静分离](notes/Nginx_基础.md)



Expand Down
23 changes: 23 additions & 0 deletions code/Java/java-concurrency/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.heibaiying</groupId>
<artifactId>java-concurrency</artifactId>
<version>1.0</version>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.heibaiying.interrupt;

/**
* interrupt() 只是设置中断标志位,并不能中断线程
*/
public class J1_Interrupt {
public static void main(String[] args) throws InterruptedException {
Thread thread = new Thread(() -> {
while (true) {
System.out.println("子线程打印");
}
});
thread.start();
Thread.sleep(10);
thread.interrupt();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.heibaiying.interrupt;

/**
* isInterrupted() 用于检查当前线程是否存在中断标志位
*/
public class J2_IsInterrupted {

public static void main(String[] args) throws InterruptedException {
Thread thread = new Thread(() -> {
while (!Thread.currentThread().isInterrupted()) {
System.out.println("子线程打印");
}
});
thread.start();
Thread.sleep(10);
thread.interrupt();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.heibaiying.interrupt;

/**
* 判断当前线程的中断状态,并清除当前线程的中断标志位
*/
public class J3_Interrupted {

public static void main(String[] args) throws InterruptedException {
Thread thread = new Thread(() -> {
while (!Thread.interrupted() || !Thread.currentThread().isInterrupted()) {
System.out.println("子线程打印");
}
});
thread.start();
Thread.sleep(10);
thread.interrupt();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.heibaiying.waitAndNotify;

/**
* 正常情况下
*/
public class J1_Normal {

private static final Object object = new Object();

public static void main(String[] args) {
new Thread(() -> {
synchronized (object) {
System.out.println("线程1");
}
}).start();
new Thread(() -> {
synchronized (object) {
System.out.println("线程2");
}
}).start();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.heibaiying.waitAndNotify;

/**
* 锁住对象不释放
*/
public class J2_KeepObjectLocked {

private static final Object object = new Object();

public static void main(String[] args) {
new Thread(() -> {
synchronized (object) {
while (true) {
try {
Thread.sleep(1000);
System.out.println("线程1");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
new Thread(() -> {
synchronized (object) {
System.out.println("线程2");
}
}).start();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.heibaiying.waitAndNotify;

/**
* 等待与唤醒
*/
public class J3_WaitAndNotify {

private static final Object object = new Object();

public static void main(String[] args) {
new Thread(() -> {
synchronized (object) {
try {
System.out.println("对象object等待");
object.wait();
System.out.println("线程1后续操作");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
new Thread(() -> {
synchronized (object) {
System.out.println("对象object唤醒");
object.notify();
System.out.println("线程2后续操作");
}
}).start();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.heibaiying.waitAndNotify;

/**
* 利用 wait 和 Notify 实现交替打印
*/
public class J4_AlternatePrinting {

private static final Object object = new Object();
private volatile static boolean flag = false;
private static int i = 0;
private static int threshold = 1000000;

public static void main(String[] args) {
new Thread(() -> {
synchronized (object) {
try {
while (i <= threshold) {
if (flag) {
object.wait();
} else {
object.notify();
System.out.println("Thread 1 : " + i++);
flag = !flag;
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
new Thread(() -> {
synchronized (object) {
while (i <= threshold) {
try {
while (i <= threshold) {
if (flag) {
object.notify();
System.out.println("Thread 2 : " + i++);
flag = !flag;
} else {
object.wait();
}
}
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.heibaiying.waitAndNotify;

/**
* 全部唤醒
*/
public class J5_NotifyAll {

private static final Object object = new Object();

public static void main(String[] args) {
new Thread(() -> {
synchronized (object) {
try {
System.out.println("对象object在线程1等待");
object.wait();
System.out.println("线程1后续操作");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
new Thread(() -> {
synchronized (object) {
try {
System.out.println("对象object在线程2等待");
object.wait();
System.out.println("线程2后续操作");
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}).start();
new Thread(() -> {
synchronized (object) {
System.out.println("对象object唤醒");
// 如果是object.notify()则是随机唤醒任意一个等待
object.notifyAll();
System.out.println("线程3后续操作");
}
}).start();
}
}

8 changes: 4 additions & 4 deletions notes/Docker_基础.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ Docker 使用 Go 语言进行开发,基于 Linux 内核的 cgroup,namespace

下图体现了 Docker 和传统虚拟化方式的不同之处:传统虚拟机技术是虚拟出一套硬件后,在其上运行一个完整操作系统,再在该系统上运行所需应用进程;而 Docker 容器内的应用进程则是直接运行于宿主的内核,容器内没有自己的内核,而且也没有进行硬件虚拟,因此要比传统虚拟机更为轻便。

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/docker与虚拟机.png"/> </div>
<div align="center"> <img src="../pictures/docker与虚拟机.png"/> </div>

## 二、Docker 架构与核心概念

Docker 使用 client-server 架构, Docker 客户端将命令发送给 Docker 守护进程,后者负责构建,运行和分发 Docker 容器。 Docker客户端和守护程序使用 REST API,通过 UNIX 套接字或网络接口进行通信。核心概念如下:

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/docker架构.png"/> </div>
<div align="center"> <img src="../pictures/docker架构.png"/> </div>

### 2.1 镜像

Expand Down Expand Up @@ -61,7 +61,7 @@ Docker 客户端(docker)是用户与 Docker 交互的主要方式。当你

Docker 提供了大量命令用于管理镜像、容器和服务,命令的统一使用格式为:` docker [OPTIONS] COMMAND` ,其中 OPTIONS 代表可选参数。需要注意的是 Docker 命令的执行一般都需要获取 root 权限,这是因为 Docker 的命令行工具 docker 与 docker daemon 是同一个二进制文件,docker daemon 负责接收并执行来自 docker 的命令,它的运行需要 root 权限。所有常用命令及其使用场景如下:

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/docker常用命令.jpg"/> </div>
<div align="center"> <img src="../pictures/docker常用命令.jpg"/> </div>

### 3.1 基础命令

Expand Down Expand Up @@ -277,7 +277,7 @@ docker run -it -p 8080:8080 spring-boot-base-java

这里为了观察到启动效果,所以使用交互的方式启动,实际部署时可以使用`-d`参数来后台启动,输出如下:

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/dockerfile01.png"/> </div>
<div align="center"> <img src="../pictures/dockerfile01.png"/> </div>

### 5.2 基于 JDK 镜像部署 Spring Boot 项目

Expand Down
6 changes: 3 additions & 3 deletions notes/Linux_常用Shell命令.md
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ userdel 命令用于删除用户,格式为:userdel [选项] 用户名。常

使用 `ll` 命令可以查看到文件的详细属性,各个属性的含义如下:

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/文件属性信息.png"/> </div>
<div align="center"> <img src="../pictures/文件属性信息.png"/> </div>
- \-:普通文件。
- d:目录文件。
- l:链接文件。
Expand All @@ -610,7 +610,7 @@ userdel 命令用于删除用户,格式为:userdel [选项] 用户名。常

chmod 用于设置文件或目录的权限,格式为:chmod [参数] 权限 文件或目录名称。 权限支持字符表示和数字表示两种形式,其对应关系如下:

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/文件权限的字符与数字表示.png"/> </div>
<div align="center"> <img src="../pictures/文件权限的字符与数字表示.png"/> </div>
示例如下:

```
Expand Down Expand Up @@ -661,7 +661,7 @@ Vim编辑器有三种状态模式:
- 输入模式:正常的文本录入。
- 末行模式:保存或退出文档,以及设置编辑环境。

<div align="center"> <img src="https://github.com/heibaiying/Full-Stack-Notes/blob/master/pictures/vim不同模式间的切换.png"/> </div>
<div align="center"> <img src="../pictures/vim不同模式间的切换.png"/> </div>
命令模式中常用的命令如下:

| 命令 | 作用 |
Expand Down
Loading

0 comments on commit 2ffc0a3

Please sign in to comment.