Using fastjson to deserialize MangoDB query results with numberLong as an example

The data recorded in mangodb is { "_id" : ObjectId("5d3ac7a9c7cf3e3da8343961"), "createTime" : NumberLong(1564133289504), "isPopup" : true, "level" : NumberInt(55), "type" : NumberInt(1), "uid" : NumberInt(8) } Query data using MongoTemplate Document document = new ...

Posted by rIkLuNd on Mon, 14 Oct 2019 19:37:30 +0200

Load Balancing Algorithms for Deep Resolution xxl-rpc

introduce In xxl-rpc, five load balancing algorithms are provided, including polling, randomization, LRU, LFU and consistent HASH. Package location: Source code interpretation 1. load balancing abstract class /** * Machine addresses are the same under grouping, and different JOBs are evenly scatt ...

Posted by bazza84 on Mon, 14 Oct 2019 18:36:54 +0200

Why Netty's FastThreadLocal is fast

Preface Recently, when looking at the netty source code, I found a class called FastThreadLocal. JDK itself has a ThreadLocal class, so I can roughly think of this class is faster than jdk's own, where is the main speed, and why it is faster. Here is a brief analysis. performance testing ThreadLocal is mainly used in multi-threaded environm ...

Posted by v0id on Mon, 14 Oct 2019 13:53:46 +0200

DYNAMIC PROGRAMMING-MULTIPLE-PART GRAPH PROBLEM

Multistage Graph Problem Multi-segment graph problem is one of the classical problems solved by dynamic programming, which is widely used in daily life. Problem description If there is a directed weighted graph G, and G can divide the starting point and the end point as well as the middle n stage, t ...

Posted by Toot4fun on Sun, 13 Oct 2019 20:07:15 +0200

RocketMQ Smooth Upgrade to Master-Slave Switching (Actual Chapter)

This paper mainly introduces how to upgrade RocketMQ cluster from master-slave synchronization to master-slave switching. Firstly, the core configuration attributes related to DLedger multi-replica, i.e. RocketMQ master-slave switching, are introduced. Then, an example of master-slave synchronization cluster is attempted to be built, and then t ...

Posted by johnnyblotter on Sun, 13 Oct 2019 12:55:36 +0200

JavaScript asynchronous programming _035

JavaScript asynchronous programming An interview question for(var i = 0; i < 3; i++) { setTimeout(function() { console.log('timeout' + i); }) } new Promise(function(resolve) { console.log('promise1'); for(var i = 0; i < 1000; i++) { i == 99 && resolve(); } console.log('promise2'); }).then(fun ...

Posted by npereira on Sun, 13 Oct 2019 08:11:31 +0200

Java 8 Lambda Expressions Detailed Manual and Example

If you haven't applied or even know anything about the new features of Java 8, you really need to pay attention to the public number "New View of Programs" and learn about the new features of Java 8 in a series. Lambda expressions have been commonly used in the new framework. If you don't know anything about Lambda, you really need to ...

Posted by ego0 on Sun, 13 Oct 2019 05:40:59 +0200

Spring Security OAuth2 Judges Dynamic Permissions Based on Request URI

GitHub address Code cloud address Usually we control permissions by @PreAuthorize("hasRole('ROLE_USER')) annotation, and configuring permission requirements in HttpSecurity. Here, we control access rights based on the requested URI, and we can use annotations to control access rights. Create a new resource project to allocate resources and ...

Posted by bonekrusher on Sat, 12 Oct 2019 21:21:03 +0200

Programming Literacy Day004

I. JavaScript Programming Problem Enter a year (to be verified) on the page to determine whether it is a leap year (year divisible by 4, but not by 100; leap year divisible by 400), and display the corresponding prompt information on the page. (1) Code <!doctype html> <html> <head&g ...

Posted by The_Anomaly on Sat, 12 Oct 2019 20:32:37 +0200

Introduction of data types of java prometheus

I. Introduction Prometheus saves all collected sample data in a time-series manner in a memory database and on a hard disk at regular intervals. Each sample in time series consists of three parts. Indicators (metric): metric name and labelsets describing the characteristics of current samples, such as < metric name > {label name >= ...

Posted by cleartango on Fri, 11 Oct 2019 10:00:41 +0200