Java multithreading - ReentrantReadWriteLock

1. Introduction to read-write lock There is such a scenario in reality: there are read and write operations on shared resources, and write operations are not as frequent as read operations. When there is no write operation, there is no problem for multiple threads to read a resource at the same tim ...

Posted by underparnv on Sun, 23 Feb 2020 03:04:35 -0800

Alibaba cloud Centos7 builds elastic search and kibana

Preface Now Elasticsearch is used by more and more companies. I have learned some simple operations of Elasticsearch before, but I haven't recorded them carefully, so I forgot them soon after I learned them. Now let's take this time to learn again. This article will mainly introduce how to build a s ...

Posted by jnerotrix on Sun, 23 Feb 2020 02:03:25 -0800

Java self study Lambda aggregation operation

Aggregation operation of java collection Step 1: traverse data in the traditional way and aggregate operation way The traditional way of traversing data is to use the for loop, then judge the conditions, and finally print out the data that meets the conditions for (Hero h : heros) { if (h.hp > 100 && h.damage < 50) System ...

Posted by rtsanderson on Sat, 22 Feb 2020 21:09:11 -0800

Chapter 2: demo code implementation (Java version)

Preface It means that I'm not quiet at night, so I'll write a blog to slow down. Embarrassed Read "Introduction to Algorithms" such a masterpiece, of course, we need to do some exercises. In addition to the theoretical thinking of practice questions and thinking questions, it is also inseparable from the practice of coding. So, in eac ...

Posted by Scriptor on Sat, 22 Feb 2020 20:42:45 -0800

Data structure and algorithm Series III (array)

1. introduction 1.1. Why study data structure and algorithm? Some people say that data structure and algorithm, computer network, and operating system are the same, away from daily development, except for the interview may not be used in this life! Some people say that I do business development. As long as I am proficient in API, framework ...

Posted by shatteredroses on Sat, 22 Feb 2020 19:54:12 -0800

AMQP Actual Warfare for Message Middleware 2

Instance Analysis Previously, we have read the documentation of AMQP, and have a general understanding of AMQP. This paper will go through the basic operation of AMQP from an example. Get ready Environmental Science RabbitMQ server 3.7.16 RabbitMQ client 5.7.3 The client code uses the RabbitMQ tutorial as follows: public static void main(String ...

Posted by klik on Sat, 22 Feb 2020 19:50:15 -0800

Pool technology -- custom thread pool

Catalog Pool technology -- custom thread pool 1. Why use thread pools? 1.1 characteristics of pool technology: 1.2 benefits of thread pool: 1.3 how to customize a thread pool 2. Three methods 2.1. Thread pool method of single thread 2.2. Fixed thread pool size method 2.3 me ...

Posted by Justin98TransAm on Sat, 22 Feb 2020 19:42:40 -0800

ElasticSearch uses RestHighLevelClient to search and query

There are four types of client connection methods in the Elasticsearch Java API: TransportClient, RestClient, Jest, and spring [data] Elasticsearch. Among them, TransportClient and RestClient are the native api of Elasticsearch. TransportClient will be deleted in version 8.0, instead of HighLevelRestCli ...

Posted by JOWP on Sat, 22 Feb 2020 19:20:16 -0800

The flexible test of array

The following is a summary of my own array programming problems LeetCode 66. Add a question import java.util.Arrays; class Solution66 { public static void main(String[] args){ int[] digits={9,8,7,6,5,4,3,2,1,0}; System.out.println(Arrays.toString(plusOne(digits))); } ...

Posted by niroshan on Sat, 22 Feb 2020 10:34:01 -0800

ElasticSearch aggregate filtering, similar to having in SQL

ElasticSearch aggregate filtering, similar to having in SQL Specific note: All content of the article is based on ElasticSerch version 5.5.3 background In real business scenarios, we encounter the need for aggregation filtering, which requires grouping, aggregation, and filtering through the results of aggregation. The ...

Posted by admun on Sat, 22 Feb 2020 09:40:38 -0800