Tag: java
All the articles with the tag "java".
Locks in Java (Part 1): Lock Categories
Focusing on the object header’s Mark Word, this article explains acquisition, contention, release, and promotion of biased, lightweight, and heavyweight locks. JOL examples inspect lock flags before and after synchronized code, followed by discussion of spinning, blocking, and suitable use cases.
Analyzing the ShardingJDBC Execution Flow
Uses the MyBatis call flow to analyze how ShardingJDBC 4.1.1 integrates with JDBC through custom DataSource, Connection, and PreparedStatement implementations. It traces parameter buffering, physical connection acquisition, and result-set handling, then simulates the proxy workflow with simplified code.
Getting Started with Redis (Part 4): Monitoring and Automatic Recovery with Sentinel
Redis Sentinel configuration and logs illustrate monitoring and automatic failover, including subjective and objective down states, leader election, and selection of a new primary. The article also shows replica promotion and replication changes, and discusses deploying multiple Sentinels and configuring voting thresholds.
Getting Started with Redis (Part 3): Primary/Replica Replication
This article covers Redis RDB and AOF persistence configuration and recovery, then demonstrates primary/replica replication. It explains full, incremental, and diskless replication and describes manually promoting a replica and updating replication relationships after a primary failure.