Java xdx97 Technical Blog

website·Indexed 31 days ago

https://java.xdx97.com

A technical knowledge base focusing on Java development, featuring guides and tutorials on Spring Boot, AOP, MyBatis, Redis, MySQL, JVM, and microservices architectures including Dubbo, Nacos, SkyWalking, and Kubernetes.

Tokens
140.9K
Snippets
475
Records
728
Agent score
48%

What's inside java.xdx97.com

  1. Overview of Markdown enhancements in VuePress Theme Hope

    VuePress generates pages from Markdown files using markdown-it. Theme Hope extends this functionality through two primary layers: standard VuePress enhancements and additional theme-specific enhancements provided by the vuepress-plugin-md-enhance plugin. These extensions allow for richer content including interactive components, charts, and advanced layout options.
  2. Overview of Model Context Protocol (MCP)

    Model Context Protocol (MCP) is an open standard that allows AI applications to connect to various data sources and tools in a standardized way, similar to how USB-C works for hardware peripherals. It enables LLMs to interact with remote tool plugins (e.g., weather services, trending news, or database operators) and chain them together to complete complex tasks.
  3. Overview of the lnglat2Geo SDK

    The lnglat2Geo SDK is a lightweight, open-source Java library for address parsing (converting addresses to coordinates) and reverse geocoding (converting coordinates to addresses). It is positioned as a simpler alternative to OpenStreetMap (OSM) for developers who only require city-level precision and want to avoid the overhead of massive OSM datasets.
    GitHub: https://github.com/deng0515001/lnglat2Geo
    Documentation: https://blog.csdn.net/deng0515001/article/details/99606156
  4. Overview of Common Sorting Algorithm Complexities and Stability

    Sorting algorithms are categorized by their time complexity, space complexity, and stability. A sorting algorithm is 'stable' if two elements with equal values maintain their relative order after sorting.

    • Unstable Algorithms: Heap Sort, Quick Sort, Shell Sort, Direct Selection Sort.
    • O(n log n) Algorithms: Quick Sort, Heap Sort, Merge Sort (Quick Sort is generally the fastest).
    • Initial Order Independence: Heap Sort is not affected by the initial order of the sequence.
  5. Overview of VuePress theme-hope layout components

    The VuePress theme-hope layout consists of global elements and page-specific components that can be customized via theme options and page frontmatter.

    Global Layout Elements:

    • Navbar
    • Sidebar
    • Footer

    Page-Specific Elements:

    • Breadcrumbs
    • Page Title and information
    • Table of Contents (TOC)
    • Meta information (update time and contributors)
    • Comments section

    Interface Elements:

    • Dark Mode toggle button
    • Back to top button
    • Print button
  6. Overview of BeetlSQL ORM Framework

    BeetlSQL is a Java-based ORM framework designed to replace traditional tools like Hibernate, JPA, and MyBatis. Its primary goal is to provide a unified data access layer that works across various storage types, including traditional relational databases, big data systems, query engines, time-series databases, and in-memory databases. It aims to offer a developer experience similar to Spring Data, focusing on agile development, easy maintenance, and high execution speed.
  7. Overview of Nominatim for Geocoding

    Nominatim is an open-source geocoding engine designed to extract geographic information from OpenStreetMap (OSM) data. It provides two primary capabilities:

    1. Geocoding: Converting a named address or place into longitude and latitude coordinates.
    2. Reverse Geocoding: Converting longitude and latitude coordinates back into a human-readable address.
  8. Understand ReentrantLock core concepts

    ReentrantLock is a mutual exclusion lock with the following key characteristics:

    • Reentrancy: A thread that already holds the lock can acquire it again without deadlocking. The lock must be released as many times as it was acquired.
    • CAS (Compare-And-Swap): Used for optimistic locking to atomically update the lock state.
    • Fairness:
      • Non-fair Lock: A thread attempting to acquire the lock may 'barge' and take it even if other threads are already waiting in the queue. This generally offers better performance by avoiding the overhead of waking up waiting threads.
      • Fair Lock: Ensures that threads acquire the lock in the order they requested it (FIFO), preventing 'thread starvation'.
  9. Understand the LRU (Least Recently Used) Algorithm

    LRU (Least Recently Used) is a cache eviction strategy used when storage space is limited. It operates on the principle that the data least recently accessed is the most likely to be unnecessary in the future. When the cache reaches its maximum capacity, the algorithm removes the item that has not been used for the longest period to make room for new data.
  10. Understand MyBatis Second-Level Cache Architecture

    MyBatis implements its second-level cache using the Decorator pattern to allow flexible caching strategies. The architecture consists of:

    1. Cache Interface: The standard definition for cache operations (putObject, getObject, removeObject, clear, getSize).
    2. PerpetualCache: The base implementation using a HashMap to store data, where the key is a CacheKey and the value is the cached object.
    3. Decorators: Specialized implementations in the decorators package (e.g., ScheduledCache, LruCache) that wrap the base cache to add features like time-based expiration or size limits.
    public interface Cache {
        String getId();
        void putObject(Object key, Object value);
        Object getObject(Object key);
        Object removeObject(Object key);
        void clear();
        int getSize();
        default ReadWriteLock getReadWriteLock() { return null; }
    }
  11. Understand HashMap underlying data structure and expansion variables

    Java's HashMap uses a combination of an Array, LinkedList, and Red-Black Tree as its underlying data structure. Two key variables control its expansion behavior:

    1. loadFactor: The load factor, which defaults to 0.75. This value is used to determine when the map should resize to maintain performance.
    2. threshold: The capacity threshold. When the number of elements in the map exceeds this value, the map triggers a resize operation.