After studying this advanced java notes, I know why there must be a reason why dozens of major manufacturers can get offers together.

 

I wonder if you programmers have a habit of taking notes? However, I think everyone still likes to collect notes, hehe, me too.

I happened to see an article a few days ago, which listed all the knowledge points about Java in detail. Looking at the catalog, it starts with Jvm, then talks about collections, multi-threaded concurrency, and then talks about the basics of Java, and then goes to Spring principles, microservices, Netty and RPC, etc. The catalog alone is 18 pages long. In my opinion, collections never look at series again.

The content below is longer. If you need any documents, please send a private message to [data] to get a free way to receive it!

How detailed is the level?

For example, the memory of the JVM runtime separately talks about the new generation, the old generation, and the permanent generation . The new generation is also divided into the process of Eden area, SerivvorFrom, SerivorTo, and MinorGC (copy -> empty -> swap).

There are four Java reference types: strong reference, soft reference, weak reference, and phantom reference.

API gateway: request forwarding, response merging, protocol conversion, data conversion, security authentication.

and many more.

Directly above:

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

......

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

When I saw this catalog, I was very excited. I can have such a set of notes. Whether it’s the usual check-ups and leaks, or an interview raid, I can have a perfect set of reference materials, and truly master a knowledge point. Draw a circle and no longer need to flip through a dozen books.

Through searching, under my soft and hard bubble ( in fact, the free method is very simple, the background private message [data] is just fine! ), finally came this great god-level note.

Since the content is too long, let’s share some of the content for everyone!

JVM

(1) Basic concepts:

JVM is a hypothetical computer that can run Java code, including a bytecode instruction set, a set of registers, a stack, a garbage collection, a heap and a storage method domain. JVM runs on the operating system, it has no direct interaction with the hardware.

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

(2) Operation process:

We all know that Java source files, through a compiler, can produce corresponding .Class files, which are bytecode files, and the bytecode files are compiled into machine code on a specific machine through the interpreter in the Java virtual machine.

That is as follows:

① Java source file—-> compiler—-> bytecode file

② Bytecode file—->JVM—->machine code

The interpreter of each platform is different, but the virtual machine implemented is the same. This is why Java can cross-platform. When a program runs from the beginning, the virtual machine starts to be instantiated. There will be multiple virtual machine instances when a program starts. When the program exits or closes, the virtual machine instance dies, and data cannot be shared among multiple virtual machine instances.

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

2.1. Thread

The thread mentioned here refers to a thread entity during program execution. JVM allows an application to execute multiple threads concurrently.

Java threads in Hotspot JVM have a direct mapping relationship with native operating system threads.

 

When thread local storage, buffer allocation, synchronization objects, stacks, program counters, etc. are ready, an operating system native thread is created. The Java thread ends, and the native thread is recycled. The operating system is responsible for scheduling all threads and assigning them to any available CPU. When the native thread is initialized, the run() method of the Java thread will be called. When the thread ends, all resources of the native thread and Java thread will be released.

The system threads running in the background of Hotspot JVM mainly include the following:

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

2.2. JVM memory area

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

The JVM memory area is mainly divided into thread private area [program counter, virtual machine stack, local method area], thread shared area [JAVA heap, method area], and direct memory.

......

Spring principle

...

6.1.10 Spring boot principle

Spring Boot is a new framework provided by the Pivotal team. Its design purpose is to simplify the initial setup and development process of new Spring applications. The framework uses a specific way to configure, so that developers no longer need to define a boilerplate configuration. In this way, Spring Boot is committed to becoming a leader in the booming field of rapid application development (rapid application development). Its characteristics are as follows:

1. Create a standalone Spring application

2. Embedded Tomcat, no need to deploy WAR file

3. Simplify Maven configuration

4. Automatically configure Spring

5. Provide production-ready functions such as indicators, health checks and external configuration

6. Absolutely no code generation and no configuration requirements for XML [1]

 

...

6.1.11.1 Distributed Transaction

Java Transaction Programming Interface (JTA: Java Transaction API) and Java Transaction Service (JTS; Java Transaction Service) provide distributed transaction services for the J2EE platform. Distributed Transaction includes transaction manager (Transaction Manager) and one or more resource managers (Resource Manager) supporting XA protocol. We can regard the resource manager as any type of persistent data storage; the transaction manager is responsible for the coordination and control of all transaction participating units.

public void transferAccount()
{    UserTransaction userTx = null;
    Connection connA = null;
    Statement stmtA = null;
    Connection connB = null;
    Statement stmtB = null;
    try
    {        // 获得 Transaction 管理对象
        userTx = (UserTransaction) getContext().lookup("java:comp/UserTransaction");
        connA = getDataSourceA().getConnection(); // 从数据库 A 中取得数据库连接
        connB = getDataSourceB().getConnection(); // 从数据库 B 中取得数据库连接
        userTx.begin(); // 启动事务
        stmtA = connA.createStatement(); // 将 A 账户中的金额减少 500
        stmtA.execute("update t_account set amount = amount - 500 where account_id = 'A'");
        // 将 B 账户中的金额增加 500
        stmtB = connB.createStatement();
        stmtB.execute("update t_account set amount = amount + 500 where account_id = 'B'");
        userTx.commit(); // 提交事务
        // 事务提交:转账的两步操作同时成功(数据库 A 和数据库 B 中的数据被同时更新)
    }
    catch(SQLException sqle)
    {
        // 发生异常,回滚在本事务中的操纵
        userTx.rollback(); // 事务回滚:数据库 A 和数据库 B 中的数据更新被同时撤销
    }
    catch(Exception ne)
    {}
}

......

Microservice

7.1.1 Service registration discovery

Service registration is to maintain a register, which manages all service addresses in the system. When the new service is started, it will give its address information to the register. The relying party of the service directly requests the address of the Service Provider from the register. There are many tools currently used for service registration, such as ZooKeeper, Consul, Etcd, and eureka from Netflix. There are two forms of service registration: client registration and third-party registration.

...

7.1.6 Service Fuse (Hystrix)

In the microservice architecture, there are usually multiple service layer calls. The failure of basic services may cause cascading failures, which in turn will cause the entire system to be unavailable. This phenomenon is called the service avalanche effect. Service avalanche effect is a process in which "service consumers" become unavailable due to the unavailability of "service providers", and the unavailability is gradually enlarged.

The principle of the fuse is very simple, just like an electrical overload protector. It can achieve rapid failure. If it detects many similar errors within a period of time, it will force multiple subsequent calls to fail quickly and no longer access the remote server, thus preventing the application from constantly trying to perform operations that may fail , So that the application can continue to execute without waiting to fix the error, or waste CPU time to wait until a long timeout occurs. The fuse can also enable the application to diagnose whether the error has been corrected, and if it has been corrected, the application will try to call the operation again.

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

......

Etc., etc...

In order to avoid being too long, I didn't put too many chapters on it. Let me show you a few catalogs here! When you have time to make a full version of the mind map and send it out!

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

 

Making a mind map is just the beginning, like it, forward it, private message (learn) to get information and encourage it!

After reading this set of Java notes, I realized that there was a reason why the author got 7 offers from major manufacturers at the same time!

Guess you like

Origin blog.csdn.net/x275920/article/details/108739557