{
  "aqs": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java",
    "sha256": "ab0d9fdf4cf3a6164fa52c76d7d9e5f0218c688f9d0e7a1428f980c4e472c0b5",
    "bytes": 92184,
    "line": 1185,
    "marker": "public final void acquire(int arg)",
    "excerpt": "    /**\n     * Acquires in exclusive mode, ignoring interrupts.  Implemented\n     * by invoking at least once {@link #tryAcquire},\n     * returning on success.  Otherwise the thread is queued, possibly\n     * repeatedly blocking and unblocking, invoking {@link\n     * #tryAcquire} until success.  This method can be used\n     * to implement method {@link Lock#lock}.\n     *\n     * @param arg the acquire argument.  This value is conveyed to\n     *        {@link #tryAcquire} but is otherwise uninterpreted and\n     *        can represent anything you like.\n     */\n    public final void acquire(int arg) {\n        if (!tryAcquire(arg) &&\n            acquireQueued(addWaiter(Node.EXCLUSIVE), arg))\n            selfInterrupt();\n    }\n\n",
    "verified": "2026-10-08",
    "end_line": 1202
  },
  "lock": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/locks/ReentrantLock.java",
    "sha256": "82f06401f262d43ef6d2b63ea2fa3263c75167934e5da58e2883233ac16bdcba",
    "bytes": 28814,
    "line": 125,
    "marker": "final boolean nonfairTryAcquire(int acquires)",
    "excerpt": "        /**\n         * Performs non-fair tryLock.  tryAcquire is implemented in\n         * subclasses, but both need nonfair try for trylock method.\n         */\n        final boolean nonfairTryAcquire(int acquires) {\n            final Thread current = Thread.currentThread();\n            int c = getState();\n            if (c == 0) {\n                if (compareAndSetState(0, acquires)) {\n                    setExclusiveOwnerThread(current);\n                    return true;\n                }\n            }\n            else if (current == getExclusiveOwnerThread()) {\n                int nextc = c + acquires;\n                if (nextc < 0) // overflow\n                    throw new Error(\"Maximum lock count exceeded\");\n                setState(nextc);\n                return true;\n            }\n            return false;\n        }\n\n        protected final boolean tryRelease(int releases) {\n            int c = getState() - releases;\n            if (Thread.currentThread() != getExclusiveOwnerThread())\n                throw new IllegalMonitorStateException();\n            boolean free = false;\n            if (c == 0) {\n                free = true;\n                setExclusiveOwnerThread(null);\n            }\n            setState(c);\n            return free;\n        }\n",
    "verified": "2026-10-08",
    "end_line": 159
  },
  "pool": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/ThreadPoolExecutor.java",
    "sha256": "9acddd870acf8ceca62a688853bd8e62181f4e26c489ad3c7570151ca095c492",
    "bytes": 82732,
    "line": 1328,
    "marker": "public void execute(Runnable command)",
    "excerpt": "    /**\n     * Executes the given task sometime in the future.  The task\n     * may execute in a new thread or in an existing pooled thread.\n     *\n     * If the task cannot be submitted for execution, either because this\n     * executor has been shutdown or because its capacity has been reached,\n     * the task is handled by the current {@code RejectedExecutionHandler}.\n     *\n     * @param command the task to execute\n     * @throws RejectedExecutionException at discretion of\n     *         {@code RejectedExecutionHandler}, if the task\n     *         cannot be accepted for execution\n     * @throws NullPointerException if {@code command} is null\n     */\n    public void execute(Runnable command) {\n        if (command == null)\n            throw new NullPointerException();\n        /*\n         * Proceed in 3 steps:\n         *\n         * 1. If fewer than corePoolSize threads are running, try to\n         * start a new thread with the given command as its first\n         * task.  The call to addWorker atomically checks runState and\n         * workerCount, and so prevents false alarms that would add\n         * threads when it shouldn't, by returning false.\n         *\n         * 2. If a task can be successfully queued, then we still need\n         * to double-check whether we should have added a thread\n         * (because existing ones died since last checking) or that\n         * the pool shut down since entry into this method. So we\n         * recheck state and if necessary roll back the enqueuing if\n         * stopped, or start a new thread if there are none.\n         *\n         * 3. If we cannot queue task, then we try to add a new\n         * thread.  If it fails, we know we are shut down or saturated\n         * and so reject the task.\n         */\n        int c = ctl.get();\n        if (workerCountOf(c) < corePoolSize) {\n            if (addWorker(command, true))\n                return;\n            c = ctl.get();\n        }\n        if (isRunning(c) && workQueue.offer(command)) {\n            int recheck = ctl.get();\n            if (! isRunning(recheck) && remove(command))\n                reject(command);\n            else if (workerCountOf(recheck) == 0)\n                addWorker(null, false);\n        }\n        else if (!addWorker(command, false))\n            reject(command);\n    }\n",
    "verified": "2026-10-08",
    "end_line": 1380
  },
  "hashmap": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/HashMap.java",
    "sha256": "99bc29f1b15d98f14e039a6108ccfe978044187246d5c4a2463605c2d989350a",
    "bytes": 93183,
    "line": 320,
    "marker": "static final int hash(Object key)",
    "excerpt": "    /* ---------------- Static utilities -------------- */\n\n    /**\n     * Computes key.hashCode() and spreads (XORs) higher bits of hash\n     * to lower.  Because the table uses power-of-two masking, sets of\n     * hashes that vary only in bits above the current mask will\n     * always collide. (Among known examples are sets of Float keys\n     * holding consecutive whole numbers in small tables.)  So we\n     * apply a transform that spreads the impact of higher bits\n     * downward. There is a tradeoff between speed, utility, and\n     * quality of bit-spreading. Because many common sets of hashes\n     * are already reasonably distributed (so don't benefit from\n     * spreading), and because we use trees to handle large sets of\n     * collisions in bins, we just XOR some shifted bits in the\n     * cheapest possible way to reduce systematic lossage, as well as\n     * to incorporate impact of the highest bits that would otherwise\n     * never be used in index calculations because of table bounds.\n     */\n    static final int hash(Object key) {\n        int h;\n        return (key == null) ? 0 : (h = key.hashCode()) ^ (h >>> 16);\n    }\n",
    "verified": "2026-10-08",
    "end_line": 341
  },
  "chm": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java",
    "sha256": "6d05b052b27690020aa98c0dd9943be3ebb0182e11ab2d215ff2468003e0232b",
    "bytes": 263711,
    "line": 2361,
    "marker": "private final void transfer(Node<K,V>[] tab, Node<K,V>[] nextTab)",
    "excerpt": "    /**\n     * Moves and/or copies the nodes in each bin to new table. See\n     * above for explanation.\n     */\n    private final void transfer(Node<K,V>[] tab, Node<K,V>[] nextTab) {\n        int n = tab.length, stride;\n        if ((stride = (NCPU > 1) ? (n >>> 3) / NCPU : n) < MIN_TRANSFER_STRIDE)\n            stride = MIN_TRANSFER_STRIDE; // subdivide range\n        if (nextTab == null) {            // initiating\n            try {\n                @SuppressWarnings(\"unchecked\")\n                Node<K,V>[] nt = (Node<K,V>[])new Node<?,?>[n << 1];\n                nextTab = nt;\n            } catch (Throwable ex) {      // try to cope with OOME\n                sizeCtl = Integer.MAX_VALUE;\n                return;\n            }\n            nextTable = nextTab;\n            transferIndex = n;\n        }\n        int nextn = nextTab.length;\n        ForwardingNode<K,V> fwd = new ForwardingNode<K,V>(nextTab);\n        boolean advance = true;\n        boolean finishing = false; // to ensure sweep before committing nextTab\n        for (int i = 0, bound = 0;;) {\n            Node<K,V> f; int fh;\n            while (advance) {\n                int nextIndex, nextBound;\n                if (--i >= bound || finishing)\n                    advance = false;\n                else if ((nextIndex = transferIndex) <= 0) {\n                    i = -1;\n                    advance = false;\n                }\n                else if (U.compareAndSwapInt\n                         (this, TRANSFERINDEX, nextIndex,\n                          nextBound = (nextIndex > stride ?\n                                       nextIndex - stride : 0))) {\n                    bound = nextBound;\n                    i = nextIndex - 1;\n                    advance = false;\n                }\n            }\n            if (i < 0 || i >= n || i + n >= nextn) {\n                int sc;\n                if (finishing) {\n                    nextTable = null;\n                    table = nextTab;\n                    sizeCtl = (n << 1) - (n >>> 1);\n                    return;\n                }\n                if (U.compareAndSwapInt(this, SIZECTL, sc = sizeCtl, sc - 1)) {\n                    if ((sc - 2) != resizeStamp(n) << RESIZE_STAMP_SHIFT)\n                        return;\n                    finishing = advance = true;\n                    i = n; // recheck before commit\n                }\n            }\n            else if ((f = tabAt(tab, i)) == null)\n                advance = casTabAt(tab, i, null, fwd);\n            else if ((fh = f.hash) == MOVED)\n                advance = true; // already processed\n            else {\n                synchronized (f) {\n                    if (tabAt(tab, i) == f) {\n                        Node<K,V> ln, hn;\n                        if (fh >= 0) {\n                            int runBit = fh & n;\n                            Node<K,V> lastRun = f;\n                            for (Node<K,V> p = f.next; p != null; p = p.next) {\n                                int b = p.hash & n;\n                                if (b != runBit) {\n                                    runBit = b;\n                                    lastRun = p;\n                                }\n                            }\n                            if (runBit == 0) {\n                                ln = lastRun;\n                                hn = null;\n                            }\n                            else {\n                                hn = lastRun;\n                                ln = null;\n                            }\n                            for (Node<K,V> p = f; p != lastRun; p = p.next) {\n                                int ph = p.hash; K pk = p.key; V pv = p.val;\n                                if ((ph & n) == 0)\n                                    ln = new Node<K,V>(ph, pk, pv, ln);\n                                else\n                                    hn = new Node<K,V>(ph, pk, pv, hn);\n                            }\n                            setTabAt(nextTab, i, ln);\n                            setTabAt(nextTab, i + n, hn);\n                            setTabAt(tab, i, fwd);\n                            advance = true;\n                        }\n                        else if (f instanceof TreeBin) {\n                            TreeBin<K,V> t = (TreeBin<K,V>)f;\n                            TreeNode<K,V> lo = null, loTail = null;\n                            TreeNode<K,V> hi = null, hiTail = null;\n                            int lc = 0, hc = 0;\n                            for (Node<K,V> e = t.first; e != null; e = e.next) {\n                                int h = e.hash;\n                                TreeNode<K,V> p = new TreeNode<K,V>\n                                    (h, e.key, e.val, null, null);\n                                if ((h & n) == 0) {\n                                    if ((p.prev = loTail) == null)\n                                        lo = p;\n                                    else\n                                        loTail.next = p;\n                                    loTail = p;\n                                    ++lc;\n                                }\n                                else {\n                                    if ((p.prev = hiTail) == null)\n                                        hi = p;\n                                    else\n                                        hiTail.next = p;\n                                    hiTail = p;\n                                    ++hc;\n                                }\n                            }\n                            ln = (lc <= UNTREEIFY_THRESHOLD) ? untreeify(lo) :\n                                (hc != 0) ? new TreeBin<K,V>(lo) : t;\n                            hn = (hc <= UNTREEIFY_THRESHOLD) ? untreeify(hi) :\n                                (lc != 0) ? new TreeBin<K,V>(hi) : t;\n                            setTabAt(nextTab, i, ln);\n                            setTabAt(nextTab, i + n, hn);\n                            setTabAt(tab, i, fwd);\n                            advance = true;\n                        }\n                    }\n                }\n            }\n        }\n    }\n",
    "verified": "2026-10-08",
    "end_line": 2496
  },
  "bits": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/nio/Bits.java",
    "sha256": "900e7cdf8f869294daedf1cd7323fa221ab43ea8b647f926fc2fe8dc4bbe2c7e",
    "bytes": 32998,
    "line": 705,
    "marker": "static void reserveMemory(long size, int cap)",
    "excerpt": "    private static boolean tryReserveMemory(long size, int cap) {\n\n        // -XX:MaxDirectMemorySize limits the total capacity rather than the\n        // actual memory usage, which will differ when buffers are page\n        // aligned.\n        long totalCap;\n        while (cap <= maxMemory - (totalCap = totalCapacity.get())) {\n            if (totalCapacity.compareAndSet(totalCap, totalCap + cap)) {\n                reservedMemory.addAndGet(size);\n                count.incrementAndGet();\n                return true;\n            }\n        }\n\n        return false;\n    }\n",
    "verified": "2026-10-08",
    "end_line": 720
  },
  "cms": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp",
    "sha256": "a46b19930f94d4f40ef84a6a413bcf6d69c4356887d20868f3c4d6af7ecab750",
    "bytes": 383173,
    "line": 2250,
    "marker": "void CMSCollector::collect_in_background",
    "excerpt": "// There are separate collect_in_background and collect_in_foreground because of\n// the different locking requirements of the background collector and the\n// foreground collector.  There was originally an attempt to share\n// one \"collect\" method between the background collector and the foreground\n// collector but the if-then-else required made it cleaner to have\n// separate methods.\nvoid CMSCollector::collect_in_background(bool clear_all_soft_refs, GCCause::Cause cause) {\n  assert(Thread::current()->is_ConcurrentGC_thread(),\n    \"A CMS asynchronous collection is only allowed on a CMS thread.\");\n\n  GenCollectedHeap* gch = GenCollectedHeap::heap();\n  {\n    bool safepoint_check = Mutex::_no_safepoint_check_flag;\n    MutexLockerEx hl(Heap_lock, safepoint_check);\n    FreelistLocker fll(this);\n    MutexLockerEx x(CGC_lock, safepoint_check);\n    if (_foregroundGCIsActive || !UseAsyncConcMarkSweepGC) {\n      // The foreground collector is active or we're\n      // not using asynchronous collections.  Skip this\n      // background collection.\n      assert(!_foregroundGCShouldWait, \"Should be clear\");\n      return;\n    } else {\n      assert(_collectorState == Idling, \"Should be idling before start.\");\n      _collectorState = InitialMarking;\n      register_gc_start(cause);\n      // Reset the expansion cause, now that we are about to begin\n      // a new cycle.\n      clear_expansion_cause();\n\n      // Clear the MetaspaceGC flag since a concurrent collection\n      // is starting but also clear it after the collection.\n      MetaspaceGC::set_should_concurrent_collect(false);\n    }\n    // Decide if we want to enable class unloading as part of the\n    // ensuing concurrent GC cycle.\n    update_should_unload_classes();\n    _full_gc_requested = false;           // acks all outstanding full gc requests\n    _full_gc_cause = GCCause::_no_gc;\n    // Signal that we are about to start a collection\n    gch->increment_total_full_collections();  // ... starting a collection cycle\n    _collection_count_start = gch->total_full_collections();\n  }\n\n  // Used for PrintGC\n  size_t prev_used = 0;\n  if (PrintGC && Verbose) {\n    prev_used = _cmsGen->used(); // XXXPERM\n  }\n\n  // The change of the collection state is normally done at this level;\n  // the exceptions are phases that are executed while the world is\n  // stopped.  For those phases the change of state is done while the\n  // world is stopped.  For baton passing purposes this allows the\n  // background collector to finish the phase and change state atomically.\n  // The foreground collector cannot wait on a phase that is done\n  // while the world is stopped because the foreground collector already\n  // has the world stopped and would deadlock.\n  while (_collectorState != Idling) {\n    if (TraceCMSState) {\n      gclog_or_tty->print_cr(\"Thread \" INTPTR_FORMAT \" in CMS state %d\",\n        Thread::current(), _collectorState);\n    }\n    // The foreground collector\n    //   holds the Heap_lock throughout its collection.\n    //   holds the CMS token (but not the lock)\n    //     except while it is waiting for the background collector to yield.\n    //\n    // The foreground collector should be blocked (not for long)\n    //   if the background collector is about to start a phase\n    //   executed with world stopped.  If the background\n    //   collector has already started such a phase, the\n    //   foreground collector is blocked waiting for the\n    //   Heap_lock.  The stop-world phases (InitialMarking and FinalMarking)\n    //   are executed in the VM thread.\n    //\n    // The locking order is\n    //   PendingListLock (PLL)  -- if applicable (FinalMarking)\n    //   Heap_lock  (both this & PLL locked in VM_CMS_Operation::prologue())\n    //   CMS token  (claimed in\n    //                stop_world_and_do() -->\n    //                  safepoint_synchronize() -->\n    //                    CMSThread::synchronize())\n\n    {\n      // Check if the FG collector wants us to yield.\n      CMSTokenSync x(true); // is cms thread\n      if (waitForForegroundGC()) {\n        // We yielded to a foreground GC, nothing more to be\n        // done this round.\n        assert(_foregroundGCShouldWait == false, \"We set it to false in \"\n               \"waitForForegroundGC()\");\n        if (TraceCMSState) {\n          gclog_or_tty->print_cr(\"CMS Thread \" INTPTR_FORMAT\n            \" exiting collection CMS state %d\",\n            Thread::current(), _collectorState);\n        }\n        return;\n      } else {\n        // The background collector can run but check to see if the\n        // foreground collector has done a collection while the\n        // background collector was waiting to get the CGC_lock\n        // above.  If yes, break so that _foregroundGCShouldWait\n        // is cleared before returning.\n        if (_collectorState == Idling) {\n          break;\n        }\n      }\n    }\n\n    assert(_foregroundGCShouldWait, \"Foreground collector, if active, \"\n      \"should be waiting\");\n\n    switch (_collectorState) {\n      case InitialMarking:\n        {\n          ReleaseForegroundGC x(this);\n          stats().record_cms_begin();\n          VM_CMS_Initial_Mark initial_mark_op(this);\n          VMThread::execute(&initial_mark_op);\n        }\n        // The collector state may be any legal state at this point\n        // since the background collector may have yielded to the\n        // foreground collector.\n        break;\n      case Marking:\n        // initial marking in checkpointRootsInitialWork has been completed\n        if (markFromRoots(true)) { // we were successful\n          assert(_collectorState == Precleaning, \"Collector state should \"\n            \"have changed\");\n        } else {\n          assert(_foregroundGCIsActive, \"Internal state inconsistency\");\n        }\n        break;\n      case Precleaning:\n        if (UseAdaptiveSizePolicy) {\n          size_policy()->concurrent_precleaning_begin();\n        }\n        // marking from roots in markFromRoots has been completed\n        preclean();\n        if (UseAdaptiveSizePolicy) {\n          size_policy()->concurrent_precleaning_end();\n        }\n        assert(_collectorState == AbortablePreclean ||\n               _collectorState == FinalMarking,\n               \"Collector state should have changed\");\n        break;\n      case AbortablePreclean:\n        if (UseAdaptiveSizePolicy) {\n        size_policy()->concurrent_phases_resume();\n        }\n        abortable_preclean();\n        if (UseAdaptiveSizePolicy) {\n          size_policy()->concurrent_precleaning_end();\n        }\n        assert(_collectorState == FinalMarking, \"Collector state should \"\n          \"have changed\");\n        break;\n      case FinalMarking:\n        {\n          ReleaseForegroundGC x(this);\n\n          VM_CMS_Final_Remark final_remark_op(this);\n          VMThread::execute(&final_remark_op);\n        }\n        assert(_foregroundGCShouldWait, \"block post-condition\");\n        break;\n      case Sweeping:\n        if (UseAdaptiveSizePolicy) {\n          size_policy()->concurrent_sweeping_begin();\n        }\n        // final marking in checkpointRootsFinal has been completed\n        sweep(true);\n        assert(_collectorState == Resizing, \"Collector state change \"\n          \"to Resizing must be done under the free_list_lock\");\n        _full_gcs_since_conc_gc = 0;\n\n        // Stop the timers for adaptive size policy for the concurrent phases\n        if (UseAdaptiveSizePolicy) {\n          size_policy()->concurrent_sweeping_end();\n          size_policy()->concurrent_phases_end(gch->gc_cause(),\n                                             gch->prev_gen(_cmsGen)->capacity(),\n                                             _cmsGen->free());\n        }\n\n      case Resizing: {\n        // Sweeping has been completed...\n        // At this point the background collection has completed.\n        // Don't move the call to compute_new_size() down\n        // into code that might be executed if the background\n        // collection was preempted.\n        {\n          ReleaseForegroundGC x(this);   // unblock FG collection\n          MutexLockerEx       y(Heap_lock, Mutex::_no_safepoint_check_flag);\n          CMSTokenSync        z(true);   // not strictly needed.\n          if (_collectorState == Resizing) {\n            compute_new_size();\n            save_heap_summary();\n            _collectorState = Resetting;\n          } else {\n            assert(_collectorState == Idling, \"The state should only change\"\n                   \" because the foreground collector has finished the collection\");\n          }\n        }\n        break;\n      }\n      case Resetting:\n        // CMS heap resizing has been completed\n        reset(true);\n        assert(_collectorState == Idling, \"Collector state should \"\n          \"have changed\");\n\n        MetaspaceGC::set_should_concurrent_collect(false);\n\n        stats().record_cms_end();\n        // Don't move the concurrent_phases_end() and compute_new_size()\n        // calls to here because a preempted background collection\n        // has it's state set to \"Resetting\".\n        break;\n      case Idling:\n      default:\n        ShouldNotReachHere();\n        break;\n    }\n    if (TraceCMSState) {\n      gclog_or_tty->print_cr(\"  Thread \" INTPTR_FORMAT \" done - next CMS state %d\",\n        Thread::current(), _collectorState);\n    }\n    assert(_foregroundGCShouldWait, \"block post-condition\");\n  }\n\n  // Should this be in gc_epilogue?\n  collector_policy()->counters()->update_counters();\n\n  {\n    // Clear _foregroundGCShouldWait and, in the event that the\n    // foreground collector is waiting, notify it, before\n    // returning.\n    MutexLockerEx x(CGC_lock, Mutex::_no_safepoint_check_flag);\n    _foregroundGCShouldWait = false;\n    if (_foregroundGCIsActive) {\n      CGC_lock->notify();\n    }\n    assert(!ConcurrentMarkSweepThread::cms_thread_has_cms_token(),\n           \"Possible deadlock\");\n  }\n  if (TraceCMSState) {\n    gclog_or_tty->print_cr(\"CMS Thread \" INTPTR_FORMAT\n      \" exiting collection CMS state %d\",\n      Thread::current(), _collectorState);\n  }\n  if (PrintGC && Verbose) {\n    _cmsGen->print_heap_change(prev_used);\n  }\n}\n",
    "verified": "2026-10-08",
    "end_line": 2504
  },
  "g1": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/hotspot/src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp",
    "sha256": "2a61ed03cffb556b29fb402b71aea3790727e6d29b66c90209441b3e61f5b6a7",
    "bytes": 258826,
    "line": 3972,
    "marker": "G1CollectedHeap::do_collection_pause_at_safepoint",
    "excerpt": "bool\nG1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {\n  assert_at_safepoint(true /* should_be_vm_thread */);\n  guarantee(!is_gc_active(), \"collection is not reentrant\");\n\n  if (GC_locker::check_active_before_gc()) {\n    return false;\n  }\n\n  _gc_timer_stw->register_gc_start();\n\n  _gc_tracer_stw->report_gc_start(gc_cause(), _gc_timer_stw->gc_start());\n\n  SvcGCMarker sgcm(SvcGCMarker::MINOR);\n  ResourceMark rm;\n\n  print_heap_before_gc();\n  trace_heap_before_gc(_gc_tracer_stw);\n\n  verify_region_sets_optional();\n  verify_dirty_young_regions();\n\n  // This call will decide whether this pause is an initial-mark\n  // pause. If it is, during_initial_mark_pause() will return true\n  // for the duration of this pause.\n  g1_policy()->decide_on_conc_mark_initiation();\n\n  // We do not allow initial-mark to be piggy-backed on a mixed GC.\n  assert(!g1_policy()->during_initial_mark_pause() ||\n          g1_policy()->gcs_are_young(), \"sanity\");\n\n  // We also do not allow mixed GCs during marking.\n  assert(!mark_in_progress() || g1_policy()->gcs_are_young(), \"sanity\");\n\n  // Record whether this pause is an initial mark. When the current\n  // thread has completed its logging output and it's safe to signal\n  // the CM thread, the flag's value in the policy has been reset.\n  bool should_start_conc_mark = g1_policy()->during_initial_mark_pause();\n\n  // Inner scope for scope based logging, timers, and stats collection\n  {\n    EvacuationInfo evacuation_info;\n\n    if (g1_policy()->during_initial_mark_pause()) {\n      // We are about to start a marking cycle, so we increment the\n      // full collection counter.\n      increment_old_marking_cycles_started();\n      register_concurrent_cycle_start(_gc_timer_stw->gc_start());\n    }\n\n    _gc_tracer_stw->report_yc_type(yc_type());\n\n    TraceCPUTime tcpu(G1Log::finer(), true, gclog_or_tty);\n\n    uint active_workers = AdaptiveSizePolicy::calc_active_workers(workers()->total_workers(),\n                                                                  workers()->active_workers(),\n                                                                  Threads::number_of_non_daemon_threads());\n    assert(UseDynamicNumberOfGCThreads ||\n           active_workers == workers()->total_workers(),\n           \"If not dynamic should be using all the  workers\");\n    workers()->set_active_workers(active_workers);\n\n\n    double pause_start_sec = os::elapsedTime();\n    g1_policy()->phase_times()->note_gc_start(active_workers, mark_in_progress());\n    log_gc_header();\n\n    TraceCollectorStats tcs(g1mm()->incremental_collection_counters());\n    TraceMemoryManagerStats tms(false /* fullGC */, gc_cause(),\n                                yc_type() == Mixed /* allMemoryPoolsAffected */);\n\n    // If the secondary_free_list is not empty, append it to the\n    // free_list. No need to wait for the cleanup operation to finish;\n    // the region allocation code will check the secondary_free_list\n    // and wait if necessary. If the G1StressConcRegionFreeing flag is\n    // set, skip this step so that the region allocation code has to\n    // get entries from the secondary_free_list.\n    if (!G1StressConcRegionFreeing) {\n      append_secondary_free_list_if_not_empty_with_lock();\n    }\n\n    assert(check_young_list_well_formed(), \"young list should be well formed\");\n    assert(check_heap_region_claim_values(HeapRegion::InitialClaimValue),\n           \"sanity check\");\n\n    // Don't dynamically change the number of GC threads this early.  A value of\n    // 0 is used to indicate serial work.  When parallel work is done,\n    // it will be set.\n\n    { // Call to jvmpi::post_class_unload_events must occur outside of active GC\n      IsGCActiveMark x;\n\n      gc_prologue(false);\n      increment_total_collections(false /* full gc */);\n      increment_gc_time_stamp();\n\n      if (VerifyRememberedSets) {\n        if (!VerifySilently) {\n          gclog_or_tty->print_cr(\"[Verifying RemSets before GC]\");\n        }\n        VerifyRegionRemSetClosure v_cl;\n        heap_region_iterate(&v_cl);\n      }\n\n      verify_before_gc();\n      check_bitmaps(\"GC Start\");\n\n      COMPILER2_PRESENT(DerivedPointerTable::clear());\n\n      // Please see comment in g1CollectedHeap.hpp and\n      // G1CollectedHeap::ref_processing_init() to see how\n      // reference processing currently works in G1.\n\n      // Enable discovery in the STW reference processor\n      ref_processor_stw()->enable_discovery(true /*verify_disabled*/,\n                                            true /*verify_no_refs*/);\n\n      {\n        // We want to temporarily turn off discovery by the\n        // CM ref processor, if necessary, and turn it back on\n        // on again later if we do. Using a scoped\n        // NoRefDiscovery object will do this.\n        NoRefDiscovery no_cm_discovery(ref_processor_cm());\n\n        // Forget the current alloc region (we might even choose it to be part\n        // of the collection set!).\n        _allocator->release_mutator_alloc_region();\n\n        // We should call this after we retire the mutator alloc\n        // region(s) so that all the ALLOC / RETIRE events are generated\n        // before the start GC event.\n        _hr_printer.start_gc(false /* full */, (size_t) total_collections());\n\n        // This timing is only used by the ergonomics to handle our pause target.\n        // It is unclear why this should not include the full pause. We will\n        // investigate this in CR 7178365.\n        //\n        // Preserving the old comment here if that helps the investigation:\n        //\n        // The elapsed time induced by the start time below deliberately elides\n        // the possible verification above.\n        double sample_start_time_sec = os::elapsedTime();\n\n#if YOUNG_LIST_VERBOSE\n        gclog_or_tty->print_cr(\"\\nBefore recording pause start.\\nYoung_list:\");\n        _young_list->print();\n        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);\n#endif // YOUNG_LIST_VERBOSE\n\n        g1_policy()->record_collection_pause_start(sample_start_time_sec, *_gc_tracer_stw);\n\n        double scan_wait_start = os::elapsedTime();\n        // We have to wait until the CM threads finish scanning the\n        // root regions as it's the only way to ensure that all the\n        // objects on them have been correctly scanned before we start\n        // moving them during the GC.\n        bool waited = _cm->root_regions()->wait_until_scan_finished();\n        double wait_time_ms = 0.0;\n        if (waited) {\n          double scan_wait_end = os::elapsedTime();\n          wait_time_ms = (scan_wait_end - scan_wait_start) * 1000.0;\n        }\n        g1_policy()->phase_times()->record_root_region_scan_wait_time(wait_time_ms);\n\n#if YOUNG_LIST_VERBOSE\n        gclog_or_tty->print_cr(\"\\nAfter recording pause start.\\nYoung_list:\");\n        _young_list->print();\n#endif // YOUNG_LIST_VERBOSE\n\n        if (g1_policy()->during_initial_mark_pause()) {\n          concurrent_mark()->checkpointRootsInitialPre();\n        }\n\n#if YOUNG_LIST_VERBOSE\n        gclog_or_tty->print_cr(\"\\nBefore choosing collection set.\\nYoung_list:\");\n        _young_list->print();\n        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);\n#endif // YOUNG_LIST_VERBOSE\n\n        g1_policy()->finalize_cset(target_pause_time_ms, evacuation_info);\n\n        // Make sure the remembered sets are up to date. This needs to be\n        // done before register_humongous_regions_with_cset(), because the\n        // remembered sets are used there to choose eager reclaim candidates.\n        // If the remembered sets are not up to date we might miss some\n        // entries that need to be handled.\n        g1_rem_set()->cleanupHRRS();\n\n        register_humongous_regions_with_in_cset_fast_test();\n\n        assert(check_cset_fast_test(), \"Inconsistency in the InCSetState table.\");\n\n        _cm->note_start_of_gc();\n        // We call this after finalize_cset() to\n        // ensure that the CSet has been finalized.\n        _cm->verify_no_cset_oops();\n\n        if (_hr_printer.is_active()) {\n          HeapRegion* hr = g1_policy()->collection_set();\n          while (hr != NULL) {\n            _hr_printer.cset(hr);\n            hr = hr->next_in_collection_set();\n          }\n        }\n\n#ifdef ASSERT\n        VerifyCSetClosure cl;\n        collection_set_iterate(&cl);\n#endif // ASSERT\n\n        setup_surviving_young_words();\n\n        // Initialize the GC alloc regions.\n        _allocator->init_gc_alloc_regions(evacuation_info);\n\n        // Actually do the work...\n        evacuate_collection_set(evacuation_info);\n\n        free_collection_set(g1_policy()->collection_set(), evacuation_info);\n\n        eagerly_reclaim_humongous_regions();\n\n        g1_policy()->clear_collection_set();\n\n        cleanup_surviving_young_words();\n\n        // Start a new incremental collection set for the next pause.\n        g1_policy()->start_incremental_cset_building();\n\n        clear_cset_fast_test();\n\n        _young_list->reset_sampled_info();\n\n        // Don't check the whole heap at this point as the\n        // GC alloc regions from this pause have been tagged\n        // as survivors and moved on to the survivor list.\n        // Survivor regions will fail the !is_young() check.\n        assert(check_young_list_empty(false /* check_heap */),\n          \"young list should be empty\");\n\n#if YOUNG_LIST_VERBOSE\n        gclog_or_tty->print_cr(\"Before recording survivors.\\nYoung List:\");\n        _young_list->print();\n#endif // YOUNG_LIST_VERBOSE\n\n        g1_policy()->record_survivor_regions(_young_list->survivor_length(),\n                                             _young_list->first_survivor_region(),\n                                             _young_list->last_survivor_region());\n\n        _young_list->reset_auxilary_lists();\n\n        if (evacuation_failed()) {\n          _allocator->set_used(recalculate_used());\n          uint n_queues = MAX2((int)ParallelGCThreads, 1);\n          for (uint i = 0; i < n_queues; i++) {\n            if (_evacuation_failed_info_array[i].has_failed()) {\n              _gc_tracer_stw->report_evacuation_failed(_evacuation_failed_info_array[i]);\n            }\n          }\n        } else {\n          // The \"used\" of the the collection set have already been subtracted\n          // when they were freed.  Add in the bytes evacuated.\n          _allocator->increase_used(g1_policy()->bytes_copied_during_gc());\n        }\n\n        if (g1_policy()->during_initial_mark_pause()) {\n          // We have to do this before we notify the CM threads that\n          // they can start working to make sure that all the\n          // appropriate initialization is done on the CM object.\n          concurrent_mark()->checkpointRootsInitialPost();\n          set_marking_started();\n          // Note that we don't actually trigger the CM thread at\n          // this point. We do that later when we're sure that\n          // the current thread has completed its logging output.\n        }\n\n        allocate_dummy_regions();\n\n#if YOUNG_LIST_VERBOSE\n        gclog_or_tty->print_cr(\"\\nEnd of the pause.\\nYoung_list:\");\n        _young_list->print();\n        g1_policy()->print_collection_set(g1_policy()->inc_cset_head(), gclog_or_tty);\n#endif // YOUNG_LIST_VERBOSE\n\n        _allocator->init_mutator_alloc_region();\n\n        {\n          size_t expand_bytes = g1_policy()->expansion_amount();\n          if (expand_bytes > 0) {\n            size_t bytes_before = capacity();\n            // No need for an ergo verbose message here,\n            // expansion_amount() does this when it returns a value > 0.\n            if (!expand(expand_bytes)) {\n              // We failed to expand the heap. Cannot do anything about it.\n            }\n          }\n        }\n\n        // We redo the verification but now wrt to the new CSet which\n        // has just got initialized after the previous CSet was freed.\n        _cm->verify_no_cset_oops();\n        _cm->note_end_of_gc();\n\n        // This timing is only used by the ergonomics to handle our pause target.\n        // It is unclear why this should not include the full pause. We will\n        // investigate this in CR 7178365.\n        double sample_end_time_sec = os::elapsedTime();\n        double pause_time_ms = (sample_end_time_sec - sample_start_time_sec) * MILLIUNITS;\n        g1_policy()->record_collection_pause_end(pause_time_ms, evacuation_info);\n\n        MemoryService::track_memory_usage();\n\n        // In prepare_for_verify() below we'll need to scan the deferred\n        // update buffers to bring the RSets up-to-date if\n        // G1HRRSFlushLogBuffersOnVerify has been set. While scanning\n        // the update buffers we'll probably need to scan cards on the\n        // regions we just allocated to (i.e., the GC alloc\n        // regions). However, during the last GC we called\n        // set_saved_mark() on all the GC alloc regions, so card\n        // scanning might skip the [saved_mark_word()...top()] area of\n        // those regions (i.e., the area we allocated objects into\n        // during the last GC). But it shouldn't. Given that\n        // saved_mark_word() is conditional on whether the GC time stamp\n        // on the region is current or not, by incrementing the GC time\n        // stamp here we invalidate all the GC time stamps on all the\n        // regions and saved_mark_word() will simply return top() for\n        // all the regions. This is a nicer way of ensuring this rather\n        // than iterating over the regions and fixing them. In fact, the\n        // GC time stamp increment here also ensures that\n        // saved_mark_word() will return top() between pauses, i.e.,\n        // during concurrent refinement. So we don't need the\n        // is_gc_active() check to decided which top to use when\n        // scanning cards (see CR 7039627).\n        increment_gc_time_stamp();\n\n        if (VerifyRememberedSets) {\n          if (!VerifySilently) {\n            gclog_or_tty->print_cr(\"[Verifying RemSets after GC]\");\n          }\n          VerifyRegionRemSetClosure v_cl;\n          heap_region_iterate(&v_cl);\n        }\n\n        verify_after_gc();\n        check_bitmaps(\"GC End\");\n\n        assert(!ref_processor_stw()->discovery_enabled(), \"Postcondition\");\n        ref_processor_stw()->verify_no_references_recorded();\n\n        // CM reference discovery will be re-enabled if necessary.\n      }\n\n      // We should do this after we potentially expand the heap so\n      // that all the COMMIT events are generated before the end GC\n      // event, and after we retire the GC alloc regions so that all\n      // RETIRE events are generated before the end GC event.\n      _hr_printer.end_gc(false /* full */, (size_t) total_collections());\n\n#ifdef TRACESPINNING\n      ParallelTaskTerminator::print_termination_counts();\n#endif\n\n      gc_epilogue(false);\n    }\n\n    // Print the remainder of the GC log output.\n    log_gc_footer(os::elapsedTime() - pause_start_sec);\n\n    // It is not yet to safe to tell the concurrent mark to\n    // start as we have some optional output below. We don't want the\n    // output from the concurrent mark thread interfering with this\n    // logging output either.\n\n    _hrm.verify_optional();\n    verify_region_sets_optional();\n\n    TASKQUEUE_STATS_ONLY(if (ParallelGCVerbose) print_taskqueue_stats());\n    TASKQUEUE_STATS_ONLY(reset_taskqueue_stats());\n\n    print_heap_after_gc();\n    trace_heap_after_gc(_gc_tracer_stw);\n\n    // We must call G1MonitoringSupport::update_sizes() in the same scoping level\n    // as an active TraceMemoryManagerStats object (i.e. before the destructor for the\n    // TraceMemoryManagerStats is called) so that the G1 memory pools are updated\n    // before any GC notifications are raised.\n    g1mm()->update_sizes();\n\n    _gc_tracer_stw->report_evacuation_info(&evacuation_info);\n    _gc_tracer_stw->report_tenuring_threshold(_g1_policy->tenuring_threshold());\n    _gc_timer_stw->register_gc_end();\n    _gc_tracer_stw->report_gc_end(_gc_timer_stw->gc_end(), _gc_timer_stw->time_partitions());\n  }\n  // It should now be safe to tell the concurrent mark thread to start\n  // without its logging output interfering with the logging output\n  // that came from the pause.\n\n  if (should_start_conc_mark) {\n    // CAUTION: after the doConcurrentMark() call below,\n    // the concurrent marking thread(s) could be running\n    // concurrently with us. Make sure that anything after\n    // this point does not assume that we are the only GC thread\n    // running. Note: of course, the actual marking work will\n    // not start until the safepoint itself is released in\n    // SuspendibleThreadSet::desynchronize().\n    doConcurrentMark();\n  }\n\n  return true;\n}\n",
    "verified": "2026-10-08",
    "end_line": 4381
  },
  "beans": {
    "url": "https://raw.githubusercontent.com/spring-projects/spring-framework/v5.3.31/spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.java",
    "sha256": "bda8f04958d024da8259ec65ca073a0af9e9c1e641d056c4d30ef5165924a768",
    "bytes": 23378,
    "line": 171,
    "marker": "protected Object getSingleton(String beanName, boolean allowEarlyReference)",
    "excerpt": "\t/**\n\t * Return the (raw) singleton object registered under the given name.\n\t * <p>Checks already instantiated singletons and also allows for an early\n\t * reference to a currently created singleton (resolving a circular reference).\n\t * @param beanName the name of the bean to look for\n\t * @param allowEarlyReference whether early references should be created or not\n\t * @return the registered singleton object, or {@code null} if none found\n\t */\n\t@Nullable\n\tprotected Object getSingleton(String beanName, boolean allowEarlyReference) {\n\t\t// Quick check for existing instance without full singleton lock\n\t\tObject singletonObject = this.singletonObjects.get(beanName);\n\t\tif (singletonObject == null && isSingletonCurrentlyInCreation(beanName)) {\n\t\t\tsingletonObject = this.earlySingletonObjects.get(beanName);\n\t\t\tif (singletonObject == null && allowEarlyReference) {\n\t\t\t\tsynchronized (this.singletonObjects) {\n\t\t\t\t\t// Consistent creation of early reference within full singleton lock\n\t\t\t\t\tsingletonObject = this.singletonObjects.get(beanName);\n\t\t\t\t\tif (singletonObject == null) {\n\t\t\t\t\t\tsingletonObject = this.earlySingletonObjects.get(beanName);\n\t\t\t\t\t\tif (singletonObject == null) {\n\t\t\t\t\t\t\tObjectFactory<?> singletonFactory = this.singletonFactories.get(beanName);\n\t\t\t\t\t\t\tif (singletonFactory != null) {\n\t\t\t\t\t\t\t\tsingletonObject = singletonFactory.getObject();\n\t\t\t\t\t\t\t\tthis.earlySingletonObjects.put(beanName, singletonObject);\n\t\t\t\t\t\t\t\tthis.singletonFactories.remove(beanName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn singletonObject;\n\t}\n",
    "verified": "2026-10-08",
    "end_line": 204
  },
  "tx": {
    "url": "https://raw.githubusercontent.com/spring-projects/spring-framework/v5.3.31/spring-tx/src/main/java/org/springframework/transaction/interceptor/TransactionAspectSupport.java",
    "sha256": "18a72bb6831ebcdcf3ebc3ef5c102e661253f84fed6d2a181580a8537112cfa9",
    "bytes": 41842,
    "line": 324,
    "marker": "protected Object invokeWithinTransaction",
    "excerpt": "\t/**\n\t * General delegate for around-advice-based subclasses, delegating to several other template\n\t * methods on this class. Able to handle {@link CallbackPreferringPlatformTransactionManager}\n\t * as well as regular {@link PlatformTransactionManager} implementations and\n\t * {@link ReactiveTransactionManager} implementations for reactive return types.\n\t * @param method the Method being invoked\n\t * @param targetClass the target class that we're invoking the method on\n\t * @param invocation the callback to use for proceeding with the target invocation\n\t * @return the return value of the method, if any\n\t * @throws Throwable propagated from the target invocation\n\t */\n\t@Nullable\n\tprotected Object invokeWithinTransaction(Method method, @Nullable Class<?> targetClass,\n\t\t\tfinal InvocationCallback invocation) throws Throwable {\n\n\t\t// If the transaction attribute is null, the method is non-transactional.\n\t\tTransactionAttributeSource tas = getTransactionAttributeSource();\n\t\tfinal TransactionAttribute txAttr = (tas != null ? tas.getTransactionAttribute(method, targetClass) : null);\n\t\tfinal TransactionManager tm = determineTransactionManager(txAttr);\n\n\t\tif (this.reactiveAdapterRegistry != null && tm instanceof ReactiveTransactionManager) {\n\t\t\tboolean isSuspendingFunction = KotlinDetector.isSuspendingFunction(method);\n\t\t\tboolean hasSuspendingFlowReturnType = isSuspendingFunction &&\n\t\t\t\t\tCOROUTINES_FLOW_CLASS_NAME.equals(new MethodParameter(method, -1).getParameterType().getName());\n\t\t\tif (isSuspendingFunction && !(invocation instanceof CoroutinesInvocationCallback)) {\n\t\t\t\tthrow new IllegalStateException(\"Coroutines invocation not supported: \" + method);\n\t\t\t}\n\t\t\tCoroutinesInvocationCallback corInv = (isSuspendingFunction ? (CoroutinesInvocationCallback) invocation : null);\n\n\t\t\tReactiveTransactionSupport txSupport = this.transactionSupportCache.computeIfAbsent(method, key -> {\n\t\t\t\tClass<?> reactiveType =\n\t\t\t\t\t\t(isSuspendingFunction ? (hasSuspendingFlowReturnType ? Flux.class : Mono.class) : method.getReturnType());\n\t\t\t\tReactiveAdapter adapter = this.reactiveAdapterRegistry.getAdapter(reactiveType);\n\t\t\t\tif (adapter == null) {\n\t\t\t\t\tthrow new IllegalStateException(\"Cannot apply reactive transaction to non-reactive return type: \" +\n\t\t\t\t\t\t\tmethod.getReturnType());\n\t\t\t\t}\n\t\t\t\treturn new ReactiveTransactionSupport(adapter);\n\t\t\t});\n\n\t\t\tInvocationCallback callback = invocation;\n\t\t\tif (corInv != null) {\n\t\t\t\tcallback = () -> CoroutinesUtils.invokeSuspendingFunction(method, corInv.getTarget(), corInv.getArguments());\n\t\t\t}\n\t\t\tObject result = txSupport.invokeWithinTransaction(method, targetClass, callback, txAttr, (ReactiveTransactionManager) tm);\n\t\t\tif (corInv != null) {\n\t\t\t\tPublisher<?> pr = (Publisher<?>) result;\n\t\t\t\treturn (hasSuspendingFlowReturnType ? KotlinDelegate.asFlow(pr) :\n\t\t\t\t\t\tKotlinDelegate.awaitSingleOrNull(pr, corInv.getContinuation()));\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\n\t\tPlatformTransactionManager ptm = asPlatformTransactionManager(tm);\n\t\tfinal String joinpointIdentification = methodIdentification(method, targetClass, txAttr);\n\n\t\tif (txAttr == null || !(ptm instanceof CallbackPreferringPlatformTransactionManager)) {\n\t\t\t// Standard transaction demarcation with getTransaction and commit/rollback calls.\n\t\t\tTransactionInfo txInfo = createTransactionIfNecessary(ptm, txAttr, joinpointIdentification);\n\n\t\t\tObject retVal;\n\t\t\ttry {\n\t\t\t\t// This is an around advice: Invoke the next interceptor in the chain.\n\t\t\t\t// This will normally result in a target object being invoked.\n\t\t\t\tretVal = invocation.proceedWithInvocation();\n\t\t\t}\n\t\t\tcatch (Throwable ex) {\n\t\t\t\t// target invocation exception\n\t\t\t\tcompleteTransactionAfterThrowing(txInfo, ex);\n\t\t\t\tthrow ex;\n\t\t\t}\n\t\t\tfinally {\n\t\t\t\tcleanupTransactionInfo(txInfo);\n\t\t\t}\n\n\t\t\tif (retVal != null && vavrPresent && VavrDelegate.isVavrTry(retVal)) {\n\t\t\t\t// Set rollback-only in case of Vavr failure matching our rollback rules...\n\t\t\t\tTransactionStatus status = txInfo.getTransactionStatus();\n\t\t\t\tif (status != null && txAttr != null) {\n\t\t\t\t\tretVal = VavrDelegate.evaluateTryFailure(retVal, txAttr, status);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tcommitTransactionAfterReturning(txInfo);\n\t\t\treturn retVal;\n\t\t}\n\n\t\telse {\n\t\t\tObject result;\n\t\t\tfinal ThrowableHolder throwableHolder = new ThrowableHolder();\n\n\t\t\t// It's a CallbackPreferringPlatformTransactionManager: pass a TransactionCallback in.\n\t\t\ttry {\n\t\t\t\tresult = ((CallbackPreferringPlatformTransactionManager) ptm).execute(txAttr, status -> {\n\t\t\t\t\tTransactionInfo txInfo = prepareTransactionInfo(ptm, txAttr, joinpointIdentification, status);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tObject retVal = invocation.proceedWithInvocation();\n\t\t\t\t\t\tif (retVal != null && vavrPresent && VavrDelegate.isVavrTry(retVal)) {\n\t\t\t\t\t\t\t// Set rollback-only in case of Vavr failure matching our rollback rules...\n\t\t\t\t\t\t\tretVal = VavrDelegate.evaluateTryFailure(retVal, txAttr, status);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn retVal;\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Throwable ex) {\n\t\t\t\t\t\tif (txAttr.rollbackOn(ex)) {\n\t\t\t\t\t\t\t// A RuntimeException: will lead to a rollback.\n\t\t\t\t\t\t\tif (ex instanceof RuntimeException) {\n\t\t\t\t\t\t\t\tthrow (RuntimeException) ex;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tthrow new ThrowableHolderException(ex);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t// A normal return value: will lead to a commit.\n\t\t\t\t\t\t\tthrowableHolder.throwable = ex;\n\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tfinally {\n\t\t\t\t\t\tcleanupTransactionInfo(txInfo);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tcatch (ThrowableHolderException ex) {\n\t\t\t\tthrow ex.getCause();\n\t\t\t}\n\t\t\tcatch (TransactionSystemException ex2) {\n\t\t\t\tif (throwableHolder.throwable != null) {\n\t\t\t\t\tlogger.error(\"Application exception overridden by commit exception\", throwableHolder.throwable);\n\t\t\t\t\tex2.initApplicationException(throwableHolder.throwable);\n\t\t\t\t}\n\t\t\t\tthrow ex2;\n\t\t\t}\n\t\t\tcatch (Throwable ex2) {\n\t\t\t\tif (throwableHolder.throwable != null) {\n\t\t\t\t\tlogger.error(\"Application exception overridden by commit exception\", throwableHolder.throwable);\n\t\t\t\t}\n\t\t\t\tthrow ex2;\n\t\t\t}\n\n\t\t\t// Check result state: It might indicate a Throwable to rethrow.\n\t\t\tif (throwableHolder.throwable != null) {\n\t\t\t\tthrow throwableHolder.throwable;\n\t\t\t}\n\t\t\treturn result;\n\t\t}\n\t}\n",
    "verified": "2026-10-08",
    "end_line": 471
  },
  "mvcc": {
    "url": "https://raw.githubusercontent.com/mysql/mysql-server/mysql-8.0.36/storage/innobase/include/read0types.h",
    "sha256": "32cd8c95b9277fb29c717e67d98f348655e71bb88587a0eb6c2f70c4220a4d6b",
    "bytes": 9169,
    "line": 44,
    "marker": "bool changes_visible",
    "excerpt": "/** Read view lists the trx ids of those transactions for which a consistent\nread should not see the modifications to the database. */\n\nclass ReadView {\n  /** This is similar to a std::vector but it is not a drop\n  in replacement. It is specific to ReadView. */\n  class ids_t {\n    typedef trx_ids_t::value_type value_type;\n\n    /**\n    Constructor */\n    ids_t() : m_ptr(), m_size(), m_reserved() {}\n\n    /**\n    Destructor */\n    ~ids_t() { ut::delete_arr(m_ptr); }\n\n    /** Try and increase the size of the array. Old elements are copied across.\n    It is a no-op if n is < current size.\n    @param n            Make space for n elements */\n    void reserve(ulint n);\n\n    /**\n    Resize the array, sets the current element count.\n    @param n            new size of the array, in elements */\n    void resize(ulint n) {\n      ut_ad(n <= capacity());\n\n      m_size = n;\n    }\n\n    /**\n    Reset the size to 0 */\n    void clear() { resize(0); }\n\n    /**\n    @return the capacity of the array in elements */\n    ulint capacity() const { return (m_reserved); }\n\n    /**\n    Copy and overwrite the current array contents\n\n    @param start                Source array\n    @param end          Pointer to end of array */\n    void assign(const value_type *start, const value_type *end);\n\n    /**\n    Insert the value in the correct slot, preserving the order.\n    Doesn't check for duplicates. */\n    void insert(value_type value);\n\n    /**\n    @return the value of the first element in the array */\n    value_type front() const {\n      ut_ad(!empty());\n\n      return (m_ptr[0]);\n    }\n\n    /**\n    @return the value of the last element in the array */\n    value_type back() const {\n      ut_ad(!empty());\n\n      return (m_ptr[m_size - 1]);\n    }\n\n    /**\n    Append a value to the array.\n    @param value                the value to append */\n    void push_back(value_type value);\n\n    /**\n    @return a pointer to the start of the array */\n    trx_id_t *data() { return (m_ptr); }\n\n    /**\n    @return a const pointer to the start of the array */\n    const trx_id_t *data() const { return (m_ptr); }\n\n    /**\n    @return the number of elements in the array */\n    ulint size() const { return (m_size); }\n\n    /**\n    @return true if size() == 0 */\n    bool empty() const { return (size() == 0); }\n\n   private:\n    // Prevent copying\n    ids_t(const ids_t &);\n    ids_t &operator=(const ids_t &);\n\n   private:\n    /** Memory for the array */\n    value_type *m_ptr;\n\n    /** Number of active elements in the array */\n    ulint m_size;\n\n    /** Size of m_ptr in elements */\n    ulint m_reserved;\n\n    friend class ReadView;\n  };\n\n public:\n  ReadView();\n  ~ReadView();\n  /** Check whether transaction id is valid.\n  @param[in]    id              transaction id to check\n  @param[in]    name            table name */\n  static void check_trx_id_sanity(trx_id_t id, const table_name_t &name);\n\n  /** Check whether the changes by id are visible.\n  @param[in]    id      transaction id to check against the view\n  @param[in]    name    table name\n  @return whether the view sees the modifications of id. */\n  [[nodiscard]] bool changes_visible(trx_id_t id,\n                                     const table_name_t &name) const {\n    ut_ad(id > 0);\n\n    if (id < m_up_limit_id || id == m_creator_trx_id) {\n      return (true);\n    }\n\n    check_trx_id_sanity(id, name);\n\n    if (id >= m_low_limit_id) {\n      return (false);\n\n    } else if (m_ids.empty()) {\n      return (true);\n    }\n\n    const ids_t::value_type *p = m_ids.data();\n\n    return (!std::binary_search(p, p + m_ids.size(), id));\n  }\n\n  /**\n  @param id             transaction to check\n  @return true if view sees transaction id */\n  bool sees(trx_id_t id) const { return (id < m_up_limit_id); }\n\n  /**\n  Mark the view as closed */\n  void close() {\n    ut_ad(m_creator_trx_id != TRX_ID_MAX);\n    m_creator_trx_id = TRX_ID_MAX;\n  }\n\n  /**\n  @return true if the view is closed */\n  bool is_closed() const { return (m_closed); }\n\n  /**\n  Write the limits to the file.\n  @param file           file to write to */\n  void print_limits(FILE *file) const {\n    fprintf(file,\n            \"Trx read view will not see trx with\"\n            \" id >= \" TRX_ID_FMT \", sees < \" TRX_ID_FMT \"\\n\",\n            m_low_limit_id, m_up_limit_id);\n  }\n\n  /** Check and reduce low limit number for read view. Used to\n  block purge till GTID is persisted on disk table.\n  @param[in]    trx_no  transaction number to check with */\n  void reduce_low_limit(trx_id_t trx_no) {\n    if (trx_no < m_low_limit_no) {\n      /* Save low limit number set for Read View for MVCC. */\n      ut_d(m_view_low_limit_no = m_low_limit_no);\n      m_low_limit_no = trx_no;\n    }\n  }\n\n  /**\n  @return the low limit no */\n  trx_id_t low_limit_no() const { return (m_low_limit_no); }\n\n  /**\n  @return the low limit id */\n  trx_id_t low_limit_id() const { return (m_low_limit_id); }\n\n  /**\n  @return true if there are no transaction ids in the snapshot */\n  bool empty() const { return (m_ids.empty()); }\n\n#ifdef UNIV_DEBUG\n  /**\n  @return the view low limit number */\n  trx_id_t view_low_limit_no() const { return (m_view_low_limit_no); }\n\n  /**\n  @param rhs            view to compare with\n  @return truen if this view is less than or equal rhs */\n  bool le(const ReadView *rhs) const {\n    return (m_low_limit_no <= rhs->m_low_limit_no);\n  }\n#endif /* UNIV_DEBUG */\n private:\n  /**\n  Copy the transaction ids from the source vector */\n  inline void copy_trx_ids(const trx_ids_t &trx_ids);\n\n  /**\n  Opens a read view where exactly the transactions serialized before this\n  point in time are seen in the view.\n  @param id             Creator transaction id */\n  inline void prepare(trx_id_t id);\n\n  /**\n  Copy state from another view. Must call copy_complete() to finish.\n  @param other          view to copy from */\n  inline void copy_prepare(const ReadView &other);\n\n  /**\n  Complete the copy, insert the creator transaction id into the\n  m_trx_ids too and adjust the m_up_limit_id *, if required */\n  inline void copy_complete();\n\n  /**\n  Set the creator transaction id, existing id must be 0 */\n  void creator_trx_id(trx_id_t id) {\n    ut_ad(m_creator_trx_id == 0);\n    m_creator_trx_id = id;\n  }\n\n  friend class MVCC;\n\n private:\n  // Disable copying\n  ReadView(const ReadView &);\n  ReadView &operator=(const ReadView &);\n\n private:\n  /** The read should not see any transaction with trx id >= this\n  value. In other words, this is the \"high water mark\". */\n  trx_id_t m_low_limit_id;\n\n  /** The read should see all trx ids which are strictly\n  smaller (<) than this value.  In other words, this is the\n  low water mark\". */\n  trx_id_t m_up_limit_id;\n\n  /** trx id of creating transaction, set to TRX_ID_MAX for free\n  views. */\n  trx_id_t m_creator_trx_id;\n\n  /** Set of RW transactions that was active when this snapshot\n  was taken */\n  ids_t m_ids;\n\n  /** The view does not need to see the undo logs for transactions\n  whose transaction number is strictly smaller (<) than this value:\n  they can be removed in purge if not needed by other views */\n  trx_id_t m_low_limit_no;\n\n#ifdef UNIV_DEBUG\n  /** The low limit number up to which read views don't need to access\n  undo log records for MVCC. This could be higher than m_low_limit_no\n  if purge is blocked for GTID persistence. Currently used for debug\n  variable INNODB_PURGE_VIEW_TRX_ID_AGE. */\n  trx_id_t m_view_low_limit_no;\n#endif /* UNIV_DEBUG */\n\n  /** AC-NL-RO transaction view that has been \"closed\". */\n  bool m_closed;\n\n  typedef UT_LIST_NODE_T(ReadView) node_t;\n\n  /** List of read views in trx_sys */\n  byte pad1[64 - sizeof(node_t)];\n  node_t m_view_list;\n};\n",
    "verified": "2026-10-08",
    "end_line": 319
  },
  "commitlog": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/CommitLog.java",
    "sha256": "3d6d6dd6c9e0ad947d6a1b8abe4a26bece63a74a07840f32641f476b329f9d96",
    "bytes": 78105,
    "line": 617,
    "marker": "public CompletableFuture<PutMessageResult> asyncPutMessage",
    "excerpt": "    public CompletableFuture<PutMessageResult> asyncPutMessage(final MessageExtBrokerInner msg) {\n        // Set the storage time\n        msg.setStoreTimestamp(System.currentTimeMillis());\n        // Set the message body BODY CRC (consider the most appropriate setting\n        // on the client)\n        msg.setBodyCRC(UtilAll.crc32(msg.getBody()));\n        // Back to Results\n        AppendMessageResult result = null;\n\n        StoreStatsService storeStatsService = this.defaultMessageStore.getStoreStatsService();\n\n        String topic = msg.getTopic();\n//        int queueId msg.getQueueId();\n        final int tranType = MessageSysFlag.getTransactionValue(msg.getSysFlag());\n        if (tranType == MessageSysFlag.TRANSACTION_NOT_TYPE\n                || tranType == MessageSysFlag.TRANSACTION_COMMIT_TYPE) {\n            // Delay Delivery\n            if (msg.getDelayTimeLevel() > 0) {\n                if (msg.getDelayTimeLevel() > this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel()) {\n                    msg.setDelayTimeLevel(this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel());\n                }\n\n                topic = TopicValidator.RMQ_SYS_SCHEDULE_TOPIC;\n                int queueId = ScheduleMessageService.delayLevel2QueueId(msg.getDelayTimeLevel());\n\n                // Backup real topic, queueId\n                MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_TOPIC, msg.getTopic());\n                MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_QUEUE_ID, String.valueOf(msg.getQueueId()));\n                msg.setPropertiesString(MessageDecoder.messageProperties2String(msg.getProperties()));\n\n                msg.setTopic(topic);\n                msg.setQueueId(queueId);\n            }\n        }\n\n        InetSocketAddress bornSocketAddress = (InetSocketAddress) msg.getBornHost();\n        if (bornSocketAddress.getAddress() instanceof Inet6Address) {\n            msg.setBornHostV6Flag();\n        }\n\n        InetSocketAddress storeSocketAddress = (InetSocketAddress) msg.getStoreHost();\n        if (storeSocketAddress.getAddress() instanceof Inet6Address) {\n            msg.setStoreHostAddressV6Flag();\n        }\n\n        PutMessageThreadLocal putMessageThreadLocal = this.putMessageThreadLocal.get();\n        updateMaxMessageSize(putMessageThreadLocal);\n        if (!multiDispatch.isMultiDispatchMsg(msg)) {\n            PutMessageResult encodeResult = putMessageThreadLocal.getEncoder().encode(msg);\n            if (encodeResult != null) {\n                return CompletableFuture.completedFuture(encodeResult);\n            }\n            msg.setEncodedBuff(putMessageThreadLocal.getEncoder().getEncoderBuffer());\n        }\n        PutMessageContext putMessageContext = new PutMessageContext(generateKey(putMessageThreadLocal.getKeyBuilder(), msg));\n\n        long elapsedTimeInLock = 0;\n        MappedFile unlockMappedFile = null;\n\n        putMessageLock.lock(); //spin or ReentrantLock ,depending on store config\n        try {\n            MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();\n            long beginLockTimestamp = this.defaultMessageStore.getSystemClock().now();\n            this.beginTimeInLock = beginLockTimestamp;\n\n            // Here settings are stored timestamp, in order to ensure an orderly\n            // global\n            msg.setStoreTimestamp(beginLockTimestamp);\n\n            if (null == mappedFile || mappedFile.isFull()) {\n                mappedFile = this.mappedFileQueue.getLastMappedFile(0); // Mark: NewFile may be cause noise\n            }\n            if (null == mappedFile) {\n                log.error(\"create mapped file1 error, topic: \" + msg.getTopic() + \" clientAddr: \" + msg.getBornHostString());\n                return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, null));\n            }\n\n            result = mappedFile.appendMessage(msg, this.appendMessageCallback, putMessageContext);\n            switch (result.getStatus()) {\n                case PUT_OK:\n                    break;\n                case END_OF_FILE:\n                    unlockMappedFile = mappedFile;\n                    // Create a new file, re-write the message\n                    mappedFile = this.mappedFileQueue.getLastMappedFile(0);\n                    if (null == mappedFile) {\n                        // XXX: warn and notify me\n                        log.error(\"create mapped file2 error, topic: \" + msg.getTopic() + \" clientAddr: \" + msg.getBornHostString());\n                        return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, result));\n                    }\n                    result = mappedFile.appendMessage(msg, this.appendMessageCallback, putMessageContext);\n                    break;\n                case MESSAGE_SIZE_EXCEEDED:\n                case PROPERTIES_SIZE_EXCEEDED:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));\n                case UNKNOWN_ERROR:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));\n                default:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));\n            }\n\n            elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;\n        } finally {\n            beginTimeInLock = 0;\n            putMessageLock.unlock();\n        }\n\n        if (elapsedTimeInLock > 500) {\n            log.warn(\"[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}\", elapsedTimeInLock, msg.getBody().length, result);\n        }\n\n        if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) {\n            this.defaultMessageStore.unlockMappedFile(unlockMappedFile);\n        }\n\n        PutMessageResult putMessageResult = new PutMessageResult(PutMessageStatus.PUT_OK, result);\n\n        // Statistics\n        storeStatsService.getSinglePutMessageTopicTimesTotal(msg.getTopic()).add(1);\n        storeStatsService.getSinglePutMessageTopicSizeTotal(topic).add(result.getWroteBytes());\n\n        CompletableFuture<PutMessageStatus> flushResultFuture = submitFlushRequest(result, msg);\n        CompletableFuture<PutMessageStatus> replicaResultFuture = submitReplicaRequest(result, msg);\n        return flushResultFuture.thenCombine(replicaResultFuture, (flushStatus, replicaStatus) -> {\n            if (flushStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(flushStatus);\n            }\n            if (replicaStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(replicaStatus);\n            }\n            return putMessageResult;\n        });\n    }\n\n    public CompletableFuture<PutMessageResult> asyncPutMessages(final MessageExtBatch messageExtBatch) {\n        messageExtBatch.setStoreTimestamp(System.currentTimeMillis());\n        AppendMessageResult result;\n\n        StoreStatsService storeStatsService = this.defaultMessageStore.getStoreStatsService();\n\n        final int tranType = MessageSysFlag.getTransactionValue(messageExtBatch.getSysFlag());\n\n        if (tranType != MessageSysFlag.TRANSACTION_NOT_TYPE) {\n            return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, null));\n        }\n        if (messageExtBatch.getDelayTimeLevel() > 0) {\n            return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, null));\n        }\n\n        InetSocketAddress bornSocketAddress = (InetSocketAddress) messageExtBatch.getBornHost();\n        if (bornSocketAddress.getAddress() instanceof Inet6Address) {\n            messageExtBatch.setBornHostV6Flag();\n        }\n\n        InetSocketAddress storeSocketAddress = (InetSocketAddress) messageExtBatch.getStoreHost();\n        if (storeSocketAddress.getAddress() instanceof Inet6Address) {\n            messageExtBatch.setStoreHostAddressV6Flag();\n        }\n\n        long elapsedTimeInLock = 0;\n        MappedFile unlockMappedFile = null;\n        MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();\n\n        //fine-grained lock instead of the coarse-grained\n        PutMessageThreadLocal pmThreadLocal = this.putMessageThreadLocal.get();\n        updateMaxMessageSize(pmThreadLocal);\n        MessageExtEncoder batchEncoder = pmThreadLocal.getEncoder();\n\n        PutMessageContext putMessageContext = new PutMessageContext(generateKey(pmThreadLocal.getKeyBuilder(), messageExtBatch));\n        messageExtBatch.setEncodedBuff(batchEncoder.encode(messageExtBatch, putMessageContext));\n\n        putMessageLock.lock();\n        try {\n            long beginLockTimestamp = this.defaultMessageStore.getSystemClock().now();\n            this.beginTimeInLock = beginLockTimestamp;\n\n            // Here settings are stored timestamp, in order to ensure an orderly\n            // global\n            messageExtBatch.setStoreTimestamp(beginLockTimestamp);\n\n            if (null == mappedFile || mappedFile.isFull()) {\n                mappedFile = this.mappedFileQueue.getLastMappedFile(0); // Mark: NewFile may be cause noise\n            }\n            if (null == mappedFile) {\n                log.error(\"Create mapped file1 error, topic: {} clientAddr: {}\", messageExtBatch.getTopic(), messageExtBatch.getBornHostString());\n                return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, null));\n            }\n\n            result = mappedFile.appendMessages(messageExtBatch, this.appendMessageCallback, putMessageContext);\n            switch (result.getStatus()) {\n                case PUT_OK:\n                    break;\n                case END_OF_FILE:\n                    unlockMappedFile = mappedFile;\n                    // Create a new file, re-write the message\n                    mappedFile = this.mappedFileQueue.getLastMappedFile(0);\n                    if (null == mappedFile) {\n                        // XXX: warn and notify me\n                        log.error(\"Create mapped file2 error, topic: {} clientAddr: {}\", messageExtBatch.getTopic(), messageExtBatch.getBornHostString());\n                        return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, result));\n                    }\n                    result = mappedFile.appendMessages(messageExtBatch, this.appendMessageCallback, putMessageContext);\n                    break;\n                case MESSAGE_SIZE_EXCEEDED:\n                case PROPERTIES_SIZE_EXCEEDED:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));\n                case UNKNOWN_ERROR:\n                default:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));\n            }\n\n            elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;\n        } finally {\n            beginTimeInLock = 0;\n            putMessageLock.unlock();\n        }\n\n        if (elapsedTimeInLock > 500) {\n            log.warn(\"[NOTIFYME]putMessages in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}\", elapsedTimeInLock, messageExtBatch.getBody().length, result);\n        }\n\n        if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) {\n            this.defaultMessageStore.unlockMappedFile(unlockMappedFile);\n        }\n\n        PutMessageResult putMessageResult = new PutMessageResult(PutMessageStatus.PUT_OK, result);\n\n        // Statistics\n        storeStatsService.getSinglePutMessageTopicTimesTotal(messageExtBatch.getTopic()).add(result.getMsgNum());\n        storeStatsService.getSinglePutMessageTopicSizeTotal(messageExtBatch.getTopic()).add(result.getWroteBytes());\n\n        CompletableFuture<PutMessageStatus> flushOKFuture = submitFlushRequest(result, messageExtBatch);\n        CompletableFuture<PutMessageStatus> replicaOKFuture = submitReplicaRequest(result, messageExtBatch);\n        return flushOKFuture.thenCombine(replicaOKFuture, (flushStatus, replicaStatus) -> {\n            if (flushStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(flushStatus);\n            }\n            if (replicaStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(replicaStatus);\n            }\n            return putMessageResult;\n        });\n\n    }\n",
    "verified": "2026-10-08",
    "end_line": 860
  },
  "mqtx": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageServiceImpl.java",
    "sha256": "d241b371b8f744646c488a45ccd77d1f2c70155c46101895eeb3f4293d82c6f3",
    "bytes": 22451,
    "line": 126,
    "marker": "public void check(",
    "excerpt": "    @Override\n    public void check(long transactionTimeout, int transactionCheckMax,\n        AbstractTransactionalMessageCheckListener listener) {\n        try {\n            String topic = TopicValidator.RMQ_SYS_TRANS_HALF_TOPIC;\n            Set<MessageQueue> msgQueues = transactionalMessageBridge.fetchMessageQueues(topic);\n            if (msgQueues == null || msgQueues.size() == 0) {\n                log.warn(\"The queue of topic is empty :\" + topic);\n                return;\n            }\n            log.debug(\"Check topic={}, queues={}\", topic, msgQueues);\n            for (MessageQueue messageQueue : msgQueues) {\n                long startTime = System.currentTimeMillis();\n                MessageQueue opQueue = getOpQueue(messageQueue);\n                long halfOffset = transactionalMessageBridge.fetchConsumeOffset(messageQueue);\n                long opOffset = transactionalMessageBridge.fetchConsumeOffset(opQueue);\n                log.info(\"Before check, the queue={} msgOffset={} opOffset={}\", messageQueue, halfOffset, opOffset);\n                if (halfOffset < 0 || opOffset < 0) {\n                    log.error(\"MessageQueue: {} illegal offset read: {}, op offset: {},skip this queue\", messageQueue,\n                        halfOffset, opOffset);\n                    continue;\n                }\n\n                List<Long> doneOpOffset = new ArrayList<>();\n                HashMap<Long, Long> removeMap = new HashMap<>();\n                PullResult pullResult = fillOpRemoveMap(removeMap, opQueue, opOffset, halfOffset, doneOpOffset);\n                if (null == pullResult) {\n                    log.error(\"The queue={} check msgOffset={} with opOffset={} failed, pullResult is null\",\n                        messageQueue, halfOffset, opOffset);\n                    continue;\n                }\n                // single thread\n                int getMessageNullCount = 1;\n                long newOffset = halfOffset;\n                long i = halfOffset;\n                while (true) {\n                    if (System.currentTimeMillis() - startTime > MAX_PROCESS_TIME_LIMIT) {\n                        log.info(\"Queue={} process time reach max={}\", messageQueue, MAX_PROCESS_TIME_LIMIT);\n                        break;\n                    }\n                    if (removeMap.containsKey(i)) {\n                        log.debug(\"Half offset {} has been committed/rolled back\", i);\n                        Long removedOpOffset = removeMap.remove(i);\n                        doneOpOffset.add(removedOpOffset);\n                    } else {\n                        GetResult getResult = getHalfMsg(messageQueue, i);\n                        MessageExt msgExt = getResult.getMsg();\n                        if (msgExt == null) {\n                            if (getMessageNullCount++ > MAX_RETRY_COUNT_WHEN_HALF_NULL) {\n                                break;\n                            }\n                            if (getResult.getPullResult().getPullStatus() == PullStatus.NO_NEW_MSG) {\n                                log.debug(\"No new msg, the miss offset={} in={}, continue check={}, pull result={}\", i,\n                                    messageQueue, getMessageNullCount, getResult.getPullResult());\n                                break;\n                            } else {\n                                log.info(\"Illegal offset, the miss offset={} in={}, continue check={}, pull result={}\",\n                                    i, messageQueue, getMessageNullCount, getResult.getPullResult());\n                                i = getResult.getPullResult().getNextBeginOffset();\n                                newOffset = i;\n                                continue;\n                            }\n                        }\n\n                        if (needDiscard(msgExt, transactionCheckMax) || needSkip(msgExt)) {\n                            listener.resolveDiscardMsg(msgExt);\n                            newOffset = i + 1;\n                            i++;\n                            continue;\n                        }\n                        if (msgExt.getStoreTimestamp() >= startTime) {\n                            log.debug(\"Fresh stored. the miss offset={}, check it later, store={}\", i,\n                                new Date(msgExt.getStoreTimestamp()));\n                            break;\n                        }\n\n                        long valueOfCurrentMinusBorn = System.currentTimeMillis() - msgExt.getBornTimestamp();\n                        long checkImmunityTime = transactionTimeout;\n                        String checkImmunityTimeStr = msgExt.getUserProperty(MessageConst.PROPERTY_CHECK_IMMUNITY_TIME_IN_SECONDS);\n                        if (null != checkImmunityTimeStr) {\n                            checkImmunityTime = getImmunityTime(checkImmunityTimeStr, transactionTimeout);\n                            if (valueOfCurrentMinusBorn < checkImmunityTime) {\n                                if (checkPrepareQueueOffset(removeMap, doneOpOffset, msgExt)) {\n                                    newOffset = i + 1;\n                                    i++;\n                                    continue;\n                                }\n                            }\n                        } else {\n                            if ((0 <= valueOfCurrentMinusBorn) && (valueOfCurrentMinusBorn < checkImmunityTime)) {\n                                log.debug(\"New arrived, the miss offset={}, check it later checkImmunity={}, born={}\", i,\n                                    checkImmunityTime, new Date(msgExt.getBornTimestamp()));\n                                break;\n                            }\n                        }\n                        List<MessageExt> opMsg = pullResult.getMsgFoundList();\n                        boolean isNeedCheck = (opMsg == null && valueOfCurrentMinusBorn > checkImmunityTime)\n                            || (opMsg != null && (opMsg.get(opMsg.size() - 1).getBornTimestamp() - startTime > transactionTimeout))\n                            || (valueOfCurrentMinusBorn <= -1);\n\n                        if (isNeedCheck) {\n                            if (!putBackHalfMsgQueue(msgExt, i)) {\n                                continue;\n                            }\n                            listener.resolveHalfMsg(msgExt);\n                        } else {\n                            pullResult = fillOpRemoveMap(removeMap, opQueue, pullResult.getNextBeginOffset(), halfOffset, doneOpOffset);\n                            log.debug(\"The miss offset:{} in messageQueue:{} need to get more opMsg, result is:{}\", i,\n                                messageQueue, pullResult);\n                            continue;\n                        }\n                    }\n                    newOffset = i + 1;\n                    i++;\n                }\n                if (newOffset != halfOffset) {\n                    transactionalMessageBridge.updateConsumeOffset(messageQueue, newOffset);\n                }\n                long newOpOffset = calculateOpOffset(doneOpOffset, opOffset);\n                if (newOpOffset != opOffset) {\n                    transactionalMessageBridge.updateConsumeOffset(opQueue, newOpOffset);\n                }\n            }\n        } catch (Throwable e) {\n            log.error(\"Check error\", e);\n        }\n\n    }\n",
    "verified": "2026-10-08",
    "end_line": 253
  },
  "mqsend": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/client/src/main/java/org/apache/rocketmq/client/impl/producer/DefaultMQProducerImpl.java",
    "sha256": "006b00b3463b1f25036464efb7a8c236bbaa17133dca56f933e6ed29b8397981",
    "bytes": 75851,
    "line": 1222,
    "marker": "public TransactionSendResult sendMessageInTransaction",
    "excerpt": "    public TransactionSendResult sendMessageInTransaction(final Message msg,\n        final LocalTransactionExecuter localTransactionExecuter, final Object arg)\n        throws MQClientException {\n        TransactionListener transactionListener = getCheckListener();\n        if (null == localTransactionExecuter && null == transactionListener) {\n            throw new MQClientException(\"tranExecutor is null\", null);\n        }\n\n        // ignore DelayTimeLevel parameter\n        if (msg.getDelayTimeLevel() != 0) {\n            MessageAccessor.clearProperty(msg, MessageConst.PROPERTY_DELAY_TIME_LEVEL);\n        }\n\n        Validators.checkMessage(msg, this.defaultMQProducer);\n\n        SendResult sendResult = null;\n        MessageAccessor.putProperty(msg, MessageConst.PROPERTY_TRANSACTION_PREPARED, \"true\");\n        MessageAccessor.putProperty(msg, MessageConst.PROPERTY_PRODUCER_GROUP, this.defaultMQProducer.getProducerGroup());\n        try {\n            sendResult = this.send(msg);\n        } catch (Exception e) {\n            throw new MQClientException(\"send message Exception\", e);\n        }\n\n        LocalTransactionState localTransactionState = LocalTransactionState.UNKNOW;\n        Throwable localException = null;\n        switch (sendResult.getSendStatus()) {\n            case SEND_OK: {\n                try {\n                    if (sendResult.getTransactionId() != null) {\n                        msg.putUserProperty(\"__transactionId__\", sendResult.getTransactionId());\n                    }\n                    String transactionId = msg.getProperty(MessageConst.PROPERTY_UNIQ_CLIENT_MESSAGE_ID_KEYIDX);\n                    if (null != transactionId && !\"\".equals(transactionId)) {\n                        msg.setTransactionId(transactionId);\n                    }\n                    if (null != localTransactionExecuter) {\n                        localTransactionState = localTransactionExecuter.executeLocalTransactionBranch(msg, arg);\n                    } else if (transactionListener != null) {\n                        log.debug(\"Used new transaction API\");\n                        localTransactionState = transactionListener.executeLocalTransaction(msg, arg);\n                    }\n                    if (null == localTransactionState) {\n                        localTransactionState = LocalTransactionState.UNKNOW;\n                    }\n\n                    if (localTransactionState != LocalTransactionState.COMMIT_MESSAGE) {\n                        log.info(\"executeLocalTransactionBranch return {}\", localTransactionState);\n                        log.info(msg.toString());\n                    }\n                } catch (Throwable e) {\n                    log.info(\"executeLocalTransactionBranch exception\", e);\n                    log.info(msg.toString());\n                    localException = e;\n                }\n            }\n            break;\n            case FLUSH_DISK_TIMEOUT:\n            case FLUSH_SLAVE_TIMEOUT:\n            case SLAVE_NOT_AVAILABLE:\n                localTransactionState = LocalTransactionState.ROLLBACK_MESSAGE;\n                break;\n            default:\n                break;\n        }\n\n        try {\n            this.endTransaction(msg, sendResult, localTransactionState, localException);\n        } catch (Exception e) {\n            log.warn(\"local transaction execute \" + localTransactionState + \", but end broker transaction failed\", e);\n        }\n\n        TransactionSendResult transactionSendResult = new TransactionSendResult();\n        transactionSendResult.setSendStatus(sendResult.getSendStatus());\n        transactionSendResult.setMessageQueue(sendResult.getMessageQueue());\n        transactionSendResult.setMsgId(sendResult.getMsgId());\n        transactionSendResult.setQueueOffset(sendResult.getQueueOffset());\n        transactionSendResult.setTransactionId(sendResult.getTransactionId());\n        transactionSendResult.setLocalTransactionState(localTransactionState);\n        return transactionSendResult;\n    }\n",
    "verified": "2026-10-08",
    "end_line": 1302
  },
  "redis": {
    "url": "https://raw.githubusercontent.com/redis/redis/7.2.4/src/db.c",
    "sha256": "84fd7f44d0971cfea3d2a8cca9edd5d90ef59262635c7b3bcbaedbfcfb1365d9",
    "bytes": 94055,
    "line": 401,
    "marker": "int dbDelete(",
    "excerpt": "/* This is a wrapper whose behavior depends on the Redis lazy free\n * configuration. Deletes the key synchronously or asynchronously. */\nint dbDelete(redisDb *db, robj *key) {\n    return dbGenericDelete(db, key, server.lazyfree_lazy_server_del, DB_FLAG_KEY_DELETED);\n}\n\n/* Prepare the string object stored at 'key' to be modified destructively\n * to implement commands like SETBIT or APPEND.\n *\n * An object is usually ready to be modified unless one of the two conditions\n * are true:\n *\n * 1) The object 'o' is shared (refcount > 1), we don't want to affect\n *    other users.\n * 2) The object encoding is not \"RAW\".\n *\n * If the object is found in one of the above conditions (or both) by the\n * function, an unshared / not-encoded copy of the string object is stored\n * at 'key' in the specified 'db'. Otherwise the object 'o' itself is\n * returned.\n *\n * USAGE:\n *\n * The object 'o' is what the caller already obtained by looking up 'key'\n * in 'db', the usage pattern looks like this:\n *\n * o = lookupKeyWrite(db,key);\n * if (checkType(c,o,OBJ_STRING)) return;\n * o = dbUnshareStringValue(db,key,o);\n *\n * At this point the caller is ready to modify the object, for example\n * using an sdscat() call to append some data, or anything else.\n */\n",
    "verified": "2026-10-08",
    "end_line": 433
  },
  "redislock": {
    "url": "https://raw.githubusercontent.com/redis/redis/7.2.4/src/t_string.c",
    "sha256": "9fae89d4f0c7355612fe2e5daa8fa859d4df2d8f419fffa78719b07daac60b9f",
    "bytes": 34470,
    "line": 84,
    "marker": "void setGenericCommand",
    "excerpt": "void setGenericCommand(client *c, int flags, robj *key, robj *val, robj *expire, int unit, robj *ok_reply, robj *abort_reply) {\n    long long milliseconds = 0; /* initialized to avoid any harmness warning */\n    int found = 0;\n    int setkey_flags = 0;\n\n    if (expire && getExpireMillisecondsOrReply(c, expire, flags, unit, &milliseconds) != C_OK) {\n        return;\n    }\n\n    if (flags & OBJ_SET_GET) {\n        if (getGenericCommand(c) == C_ERR) return;\n    }\n\n    found = (lookupKeyWrite(c->db,key) != NULL);\n\n    if ((flags & OBJ_SET_NX && found) ||\n        (flags & OBJ_SET_XX && !found))\n    {\n        if (!(flags & OBJ_SET_GET)) {\n            addReply(c, abort_reply ? abort_reply : shared.null[c->resp]);\n        }\n        return;\n    }\n\n    /* When expire is not NULL, we avoid deleting the TTL so it can be updated later instead of being deleted and then created again. */\n    setkey_flags |= ((flags & OBJ_KEEPTTL) || expire) ? SETKEY_KEEPTTL : 0;\n    setkey_flags |= found ? SETKEY_ALREADY_EXIST : SETKEY_DOESNT_EXIST;\n\n    setKey(c,c->db,key,val,setkey_flags);\n    server.dirty++;\n    notifyKeyspaceEvent(NOTIFY_STRING,\"set\",key,c->db->id);\n\n    if (expire) {\n        setExpire(c,c->db,key,milliseconds);\n        /* Propagate as SET Key Value PXAT millisecond-timestamp if there is\n         * EX/PX/EXAT flag. */\n        if (!(flags & OBJ_PXAT)) {\n            robj *milliseconds_obj = createStringObjectFromLongLong(milliseconds);\n            rewriteClientCommandVector(c, 5, shared.set, key, val, shared.pxat, milliseconds_obj);\n            decrRefCount(milliseconds_obj);\n        }\n        notifyKeyspaceEvent(NOTIFY_GENERIC,\"expire\",key,c->db->id);\n    }\n\n    if (!(flags & OBJ_SET_GET)) {\n        addReply(c, ok_reply ? ok_reply : shared.ok);\n    }\n\n    /* Propagate without the GET argument (Isn't needed if we had expire since in that case we completely re-written the command argv) */\n    if ((flags & OBJ_SET_GET) && !expire) {\n        int argc = 0;\n        int j;\n        robj **argv = zmalloc((c->argc-1)*sizeof(robj*));\n        for (j=0; j < c->argc; j++) {\n            char *a = c->argv[j]->ptr;\n            /* Skip GET which may be repeated multiple times. */\n            if (j >= 3 &&\n                (a[0] == 'g' || a[0] == 'G') &&\n                (a[1] == 'e' || a[1] == 'E') &&\n                (a[2] == 't' || a[2] == 'T') && a[3] == '\\0')\n                continue;\n            argv[argc++] = c->argv[j];\n            incrRefCount(c->argv[j]);\n        }\n        replaceClientCommandVector(c, argc, argv);\n    }\n}\n",
    "verified": "2026-10-08",
    "end_line": 150
  },
  "netty": {
    "url": "https://raw.githubusercontent.com/netty/netty/netty-4.1.108.Final/transport/src/main/java/io/netty/channel/nio/NioEventLoop.java",
    "sha256": "8cd749ebcb5b2c75bcef5fec4e907bd6ef68c96556eb7122813d36715926ed4e",
    "bytes": 35052,
    "line": 503,
    "marker": "protected void run()",
    "excerpt": "    @Override\n    protected void run() {\n        int selectCnt = 0;\n        for (;;) {\n            try {\n                int strategy;\n                try {\n                    strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks());\n                    switch (strategy) {\n                    case SelectStrategy.CONTINUE:\n                        continue;\n\n                    case SelectStrategy.BUSY_WAIT:\n                        // fall-through to SELECT since the busy-wait is not supported with NIO\n\n                    case SelectStrategy.SELECT:\n                        long curDeadlineNanos = nextScheduledTaskDeadlineNanos();\n                        if (curDeadlineNanos == -1L) {\n                            curDeadlineNanos = NONE; // nothing on the calendar\n                        }\n                        nextWakeupNanos.set(curDeadlineNanos);\n                        try {\n                            if (!hasTasks()) {\n                                strategy = select(curDeadlineNanos);\n                            }\n                        } finally {\n                            // This update is just to help block unnecessary selector wakeups\n                            // so use of lazySet is ok (no race condition)\n                            nextWakeupNanos.lazySet(AWAKE);\n                        }\n                        // fall through\n                    default:\n                    }\n                } catch (IOException e) {\n                    // If we receive an IOException here its because the Selector is messed up. Let's rebuild\n                    // the selector and retry. https://github.com/netty/netty/issues/8566\n                    rebuildSelector0();\n                    selectCnt = 0;\n                    handleLoopException(e);\n                    continue;\n                }\n\n                selectCnt++;\n                cancelledKeys = 0;\n                needsToSelectAgain = false;\n                final int ioRatio = this.ioRatio;\n                boolean ranTasks;\n                if (ioRatio == 100) {\n                    try {\n                        if (strategy > 0) {\n                            processSelectedKeys();\n                        }\n                    } finally {\n                        // Ensure we always run tasks.\n                        ranTasks = runAllTasks();\n                    }\n                } else if (strategy > 0) {\n                    final long ioStartTime = System.nanoTime();\n                    try {\n                        processSelectedKeys();\n                    } finally {\n                        // Ensure we always run tasks.\n                        final long ioTime = System.nanoTime() - ioStartTime;\n                        ranTasks = runAllTasks(ioTime * (100 - ioRatio) / ioRatio);\n                    }\n                } else {\n                    ranTasks = runAllTasks(0); // This will run the minimum number of tasks\n                }\n\n                if (ranTasks || strategy > 0) {\n                    if (selectCnt > MIN_PREMATURE_SELECTOR_RETURNS && logger.isDebugEnabled()) {\n                        logger.debug(\"Selector.select() returned prematurely {} times in a row for Selector {}.\",\n                                selectCnt - 1, selector);\n                    }\n                    selectCnt = 0;\n                } else if (unexpectedSelectorWakeup(selectCnt)) { // Unexpected wakeup (unusual case)\n                    selectCnt = 0;\n                }\n            } catch (CancelledKeyException e) {\n                // Harmless exception - log anyway\n                if (logger.isDebugEnabled()) {\n                    logger.debug(CancelledKeyException.class.getSimpleName() + \" raised by a Selector {} - JDK bug?\",\n                            selector, e);\n                }\n            } catch (Error e) {\n                throw e;\n            } catch (Throwable t) {\n                handleLoopException(t);\n            } finally {\n                // Always handle shutdown even if the loop processing threw an exception.\n                try {\n                    if (isShuttingDown()) {\n                        closeAll();\n                        if (confirmShutdown()) {\n                            return;\n                        }\n                    }\n                } catch (Error e) {\n                    throw e;\n                } catch (Throwable t) {\n                    handleLoopException(t);\n                }\n            }\n        }\n    }\n",
    "verified": "2026-10-08",
    "end_line": 607
  },
  "reactor": {
    "url": "https://raw.githubusercontent.com/reactor/reactor-core/v3.4.34/reactor-core/src/main/java/reactor/core/publisher/FluxPublishOn.java",
    "sha256": "415334a06b88d4a38ea94e4e5581f2273b610b650420ebe15beec85a587b83cf",
    "bytes": 28058,
    "line": 213,
    "marker": "public void onNext(T t)",
    "excerpt": "\t\t@Override\n\t\tpublic void onNext(T t) {\n\t\t\tif (sourceMode == ASYNC) {\n\t\t\t\ttrySchedule(this, null, null /* t always null */);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (done) {\n\t\t\t\tOperators.onNextDropped(t, actual.currentContext());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (cancelled) {\n\t\t\t\tOperators.onDiscard(t, actual.currentContext());\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!queue.offer(t)) {\n\t\t\t\tOperators.onDiscard(t, actual.currentContext());\n\t\t\t\terror = Operators.onOperatorError(s,\n\t\t\t\t\t\tExceptions.failWithOverflow(Exceptions.BACKPRESSURE_ERROR_QUEUE_FULL),\n\t\t\t\t\t\tt, actual.currentContext());\n\t\t\t\tdone = true;\n\t\t\t}\n\t\t\ttrySchedule(this, null, t);\n\t\t}\n",
    "verified": "2026-10-08",
    "end_line": 238
  },
  "pg": {
    "url": "https://www.postgresql.org/docs/16/transaction-iso.html",
    "sha256": "e65d2f20ab01d80d202ca76fb568d02bb74a414d712d73dd305405683694cf9e",
    "bytes": 47350,
    "line": 16,
    "marker": "Read Committed",
    "excerpt": "  <meta property=\"og:description\" content=\"13.2.&amp;nbsp;Transaction Isolation # 13.2.1. Read Committed Isolation Level 13.2.2. Repeatable Read Isolation Level 13.2.3. Serializable Isolation Level The SQL standard …\" />\n  <meta property=\"og:site_name\" content=\"PostgreSQL Documentation\" />\n  <link href=\"/media/css/fontawesome.css?8eb38fb2\" rel=\"stylesheet\">\n  <link rel=\"stylesheet\" href=\"/media/css/bootstrap-4.4.1.min.css\">\n  <link rel=\"shortcut icon\" href=\"/favicon.ico\" />\n  \n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/dyncss/base.css?8eb38fb2\">\n\n  <script src=\"/media/js/theme.js?8eb38fb2\"></script>\n\n  \n\n\n  <link rel=\"canonical\" href=\"https://www.postgresql.org/docs/current/transaction-iso.html\" />",
    "verified": "2026-10-08"
  },
  "oracle": {
    "url": "https://docs.oracle.com/en/database/oracle/oracle-database/19/cncpt/data-concurrency-and-consistency.html",
    "sha256": "3ec8a50e206f811313931b8cf7f6640735cb6179d3ace20701b670aa10d8e581",
    "bytes": 254973,
    "line": 10,
    "marker": "read consistency",
    "excerpt": "      <meta name=\"DC.subject\" content=\", multiversion read consistency, consistency, multiversioning, serializability, transactional, transactions, serializability, concurrency, definition, dirty reads, statement-level, statement-level read consistency, transaction-level, transaction-level read consistency, read consistency, Real Application Clusters, cache fusion, undo segments, system change numbers (SCN), transaction history, deferred inserts, locks, overview of, read uncommitted, isolation levels, isolation levels, transaction, fuzzy reads, transaction isolation, standards, ANSI/ISO, isolation of, phantom reads, read committed isolation, read committed, queries, implicit, read committed isolation level, updates, lost, lost updates, conflicting writes, blocking, blocking transactions, serialization, serialization isolation level, undo tablespaces, undo retention period, read-only, read-only isolation level, duration, automatic, share locks, exclusive, exclusive locks, restrictiveness, conversion, escalation, deadlocks, contention, statement-level rollback, rollback, types of, parameters, initialization, locking behavior, DML, DML (data manipulation language), instances, database, failures, row locks, rows, locks on, locking, row (TX), row locks (TX), headers, data block, storage, data blocks, locks stored in, exclusive table, share row exclusive, share table, row exclusive table, row share, table (TM), table locks (TM), foreign keys, updating tables, unindexed foreign keys and, tables with parent keys, structures, dictionary, data dictionary, DDL (data definition language), exclusive DDL, share DDL, share DDL locks, shared pool, parse locks, shared SQL areas, parse, SQL*Plus, lock and latch monitors, Enterprise Manager, system, system locks, latches, parsing, SQL, hard parse, mutexes, file management locks, log management locks, SQL, dictionary cache locks, dictionary cache, internal, internal locks, tablespaces, rollback segments, tablespace, setting, explicit locking, manual, manual locking, user-defined, packages, for locking\">\n      <meta name=\"keywords\" content=\", multiversion read consistency, consistency, multiversioning, serializability, transactional, transactions, serializability, concurrency, definition, dirty reads, statement-level, statement-level read consistency, transaction-level, transaction-level read consistency, read consistency, Real Application Clusters, cache fusion, undo segments, system change numbers (SCN), transaction history, deferred inserts, locks, overview of, read uncommitted, isolation levels, isolation levels, transaction, fuzzy reads, transaction isolation, standards, ANSI/ISO, isolation of, phantom reads, read committed isolation, read committed, queries, implicit, read committed isolation level, updates, lost, lost updates, conflicting writes, blocking, blocking transactions, serialization, serialization isolation level, undo tablespaces, undo retention period, read-only, read-only isolation level, duration, automatic, share locks, exclusive, exclusive locks, restrictiveness, conversion, escalation, deadlocks, contention, statement-level rollback, rollback, types of, parameters, initialization, locking behavior, DML, DML (data manipulation language), instances, database, failures, row locks, rows, locks on, locking, row (TX), row locks (TX), headers, data block, storage, data blocks, locks stored in, exclusive table, share row exclusive, share table, row exclusive table, row share, table (TM), table locks (TM), foreign keys, updating tables, unindexed foreign keys and, tables with parent keys, structures, dictionary, data dictionary, DDL (data definition language), exclusive DDL, share DDL, share DDL locks, shared pool, parse locks, shared SQL areas, parse, SQL*Plus, lock and latch monitors, Enterprise Manager, system, system locks, latches, parsing, SQL, hard parse, mutexes, file management locks, log management locks, SQL, dictionary cache locks, dictionary cache, internal, internal locks, tablespaces, rollback segments, tablespace, setting, explicit locking, manual, manual locking, user-defined, packages, for locking\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"oracle-transaction-management.html#GUID-3144CE4E-8120-49D9-9BDF-BE9C011E5662\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-7AD41DFA-04E5-4738-B744-C4407170411C\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-2A0FDFF0-5F72-4476-BFD2-060A20EA1685\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-AD0CEE83-2F33-4906-94E1-3D1022924C63\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-E926E638-0161-4389-887B-4A31A529478A\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-A4E54CD6-7232-489D-86A4-412EAF8A8DB7\">\n      <meta name=\"DC.Relation\" scheme=\"URI\" content=\"data-concurrency-and-consistency.html#GUID-D63FD030-44CD-4FD7-970A-C98C8CC4AC42\">\n      <meta name=\"DC.Creator\" content=\"Donna Keesling\">\n      <meta name=\"DC.Creator\" content=\"Tom Kyte\">\n      <meta name=\"DC.Creator\" content=\"Joe McCormack\">\n      <meta name=\"DC.Creator\" content=\"Drew Adams\">\n      <meta name=\"DC.Creator\" content=\"Ashish Agrawal\">",
    "verified": "2026-10-08"
  },
  "boot": {
    "url": "https://raw.githubusercontent.com/spring-projects/spring-boot/v2.7.18/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/AutoConfigurationImportSelector.java",
    "sha256": "cea98e83d85ecdf914459df00732e7c884b91ae333ea3f915ada369a6a05a82b",
    "bytes": 19362,
    "line": 170,
    "marker": "protected List<String> getCandidateConfigurations",
    "excerpt": "\t/**\n\t * Return the auto-configuration class names that should be considered. By default\n\t * this method will load candidates using {@link ImportCandidates} with\n\t * {@link #getSpringFactoriesLoaderFactoryClass()}. For backward compatible reasons it\n\t * will also consider {@link SpringFactoriesLoader} with\n\t * {@link #getSpringFactoriesLoaderFactoryClass()}.\n\t * @param metadata the source metadata\n\t * @param attributes the {@link #getAttributes(AnnotationMetadata) annotation\n\t * attributes}\n\t * @return a list of candidate configurations\n\t */\n\tprotected List<String> getCandidateConfigurations(AnnotationMetadata metadata, AnnotationAttributes attributes) {\n\t\tList<String> configurations = new ArrayList<>(\n\t\t\t\tSpringFactoriesLoader.loadFactoryNames(getSpringFactoriesLoaderFactoryClass(), getBeanClassLoader()));\n\t\tImportCandidates.load(AutoConfiguration.class, getBeanClassLoader()).forEach(configurations::add);\n\t\tAssert.notEmpty(configurations,\n\t\t\t\t\"No auto configuration classes found in META-INF/spring.factories nor in META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports. If you \"\n\t\t\t\t\t\t+ \"are using a custom packaging, make sure that file is correct.\");\n\t\treturn configurations;\n\t}\n",
    "verified": "2026-10-08",
    "end_line": 189
  },
  "gateway": {
    "url": "https://raw.githubusercontent.com/spring-cloud/spring-cloud-gateway/v3.1.8/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/handler/FilteringWebHandler.java",
    "sha256": "503e9767b35dc725b362c0c6eb65bc11921742a1a1825055c596c497991e621f",
    "bytes": 4683,
    "line": 69,
    "marker": "public Mono<Void> handle",
    "excerpt": "\t/*\n\t * TODO: relocate @EventListener(RefreshRoutesEvent.class) void handleRefresh() {\n\t * this.combinedFiltersForRoute.clear();\n\t */\n\n\t@Override\n\tpublic Mono<Void> handle(ServerWebExchange exchange) {\n\t\tRoute route = exchange.getRequiredAttribute(GATEWAY_ROUTE_ATTR);\n\t\tList<GatewayFilter> gatewayFilters = route.getFilters();\n\n\t\tList<GatewayFilter> combined = new ArrayList<>(this.globalFilters);\n\t\tcombined.addAll(gatewayFilters);\n\t\t// TODO: needed or cached?\n\t\tAnnotationAwareOrderComparator.sort(combined);\n\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tlogger.debug(\"Sorted gatewayFilterFactories: \" + combined);\n\t\t}\n\n\t\treturn new DefaultGatewayFilterChain(combined).filter(exchange);\n\t}\n",
    "verified": "2026-10-08",
    "end_line": 89
  },
  "aqsqueue": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/locks/AbstractQueuedSynchronizer.java",
    "sha256": "ab0d9fdf4cf3a6164fa52c76d7d9e5f0218c688f9d0e7a1428f980c4e472c0b5",
    "bytes": 92184,
    "line": 840,
    "marker": "public final void acquire(int arg)",
    "excerpt": "    /*\n     * Various flavors of acquire, varying in exclusive/shared and\n     * control modes.  Each is mostly the same, but annoyingly\n     * different.  Only a little bit of factoring is possible due to\n     * interactions of exception mechanics (including ensuring that we\n     * cancel if tryAcquire throws exception) and other control, at\n     * least not without hurting performance too much.\n     */\n\n    /**\n     * Acquires in exclusive uninterruptible mode for thread already in\n     * queue. Used by condition wait methods as well as acquire.\n     *\n     * @param node the node\n     * @param arg the acquire argument\n     * @return {@code true} if interrupted while waiting\n     */\n    final boolean acquireQueued(final Node node, int arg) {\n        boolean failed = true;\n        try {\n            boolean interrupted = false;\n            for (;;) {\n                final Node p = node.predecessor();\n                if (p == head && tryAcquire(arg)) {\n                    setHead(node);\n                    p.next = null; // help GC\n                    failed = false;\n                    return interrupted;\n                }\n                if (shouldParkAfterFailedAcquire(p, node) &&\n                    parkAndCheckInterrupt())\n                    interrupted = true;\n            }\n        } finally {\n            if (failed)\n                cancelAcquire(node);\n        }\n    }\n",
    "verified": "2026-10-08",
    "end_line": 877
  },
  "chmput": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/jdk8u462-b08/jdk/src/share/classes/java/util/concurrent/ConcurrentHashMap.java",
    "sha256": "6d05b052b27690020aa98c0dd9943be3ebb0182e11ab2d215ff2468003e0232b",
    "bytes": 263711,
    "line": 1008,
    "marker": "private final void transfer(Node<K,V>[] tab, Node<K,V>[] nextTab)",
    "excerpt": "\n    /** Implementation for put and putIfAbsent */\n    final V putVal(K key, V value, boolean onlyIfAbsent) {\n        if (key == null || value == null) throw new NullPointerException();\n        int hash = spread(key.hashCode());\n        int binCount = 0;\n        for (Node<K,V>[] tab = table;;) {\n            Node<K,V> f; int n, i, fh;\n            if (tab == null || (n = tab.length) == 0)\n                tab = initTable();\n            else if ((f = tabAt(tab, i = (n - 1) & hash)) == null) {\n                if (casTabAt(tab, i, null,\n                             new Node<K,V>(hash, key, value, null)))\n                    break;                   // no lock when adding to empty bin\n            }\n            else if ((fh = f.hash) == MOVED)\n                tab = helpTransfer(tab, f);\n            else {\n                V oldVal = null;\n                synchronized (f) {\n                    if (tabAt(tab, i) == f) {\n                        if (fh >= 0) {\n                            binCount = 1;\n                            for (Node<K,V> e = f;; ++binCount) {\n                                K ek;\n                                if (e.hash == hash &&\n                                    ((ek = e.key) == key ||\n                                     (ek != null && key.equals(ek)))) {\n                                    oldVal = e.val;\n                                    if (!onlyIfAbsent)\n                                        e.val = value;\n                                    break;\n                                }\n                                Node<K,V> pred = e;\n                                if ((e = e.next) == null) {\n                                    pred.next = new Node<K,V>(hash, key,\n                                                              value, null);\n                                    break;\n                                }\n                            }\n                        }\n                        else if (f instanceof TreeBin) {\n                            Node<K,V> p;\n                            binCount = 2;\n                            if ((p = ((TreeBin<K,V>)f).putTreeVal(hash, key,\n                                                           value)) != null) {\n                                oldVal = p.val;\n                                if (!onlyIfAbsent)\n                                    p.val = value;\n                            }\n                        }\n                    }\n                }\n                if (binCount != 0) {\n                    if (binCount >= TREEIFY_THRESHOLD)\n                        treeifyBin(tab, i);\n                    if (oldVal != null)\n                        return oldVal;\n                    break;\n                }\n            }\n        }\n        addCount(1L, binCount);\n        return null;\n    }\n",
    "verified": "2026-10-08",
    "end_line": 1072
  },
  "xstream": {
    "url": "https://raw.githubusercontent.com/x-stream/xstream/c4c71226515fa42809a48d9ae702756e2831f379/xstream/src/java/com/thoughtworks/xstream/converters/reflection/Sun14ReflectionProvider.java",
    "sha256": "4d34acf425e7eea521d14002821fe8b4b03fb4df4f888f7995d1b6f078111322",
    "bytes": 6673,
    "verified": "2026-10-08",
    "line": 91,
    "end_line": 101,
    "excerpt": "    private Constructor getMungedConstructor(Class type) throws NoSuchMethodException {\n        synchronized (constructorCache) {\n            Constructor ctor = (Constructor)constructorCache.get(type);\n            if (ctor == null) {\n                ctor = reflectionFactory.newConstructorForSerialization(type, Object.class.getDeclaredConstructor(new Class[0]));\n                constructorCache.put(type, ctor);\n            }\n            return ctor;\n        }\n    }\n"
  },
  "mqappend": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/CommitLog.java",
    "sha256": "3d6d6dd6c9e0ad947d6a1b8abe4a26bece63a74a07840f32641f476b329f9d96",
    "bytes": 78105,
    "line": 617,
    "end_line": 749,
    "marker": "CommitLog.asyncPutMessage",
    "excerpt": "    public CompletableFuture<PutMessageResult> asyncPutMessage(final MessageExtBrokerInner msg) {\n        // Set the storage time\n        msg.setStoreTimestamp(System.currentTimeMillis());\n        // Set the message body BODY CRC (consider the most appropriate setting\n        // on the client)\n        msg.setBodyCRC(UtilAll.crc32(msg.getBody()));\n        // Back to Results\n        AppendMessageResult result = null;\n\n        StoreStatsService storeStatsService = this.defaultMessageStore.getStoreStatsService();\n\n        String topic = msg.getTopic();\n//        int queueId msg.getQueueId();\n        final int tranType = MessageSysFlag.getTransactionValue(msg.getSysFlag());\n        if (tranType == MessageSysFlag.TRANSACTION_NOT_TYPE\n                || tranType == MessageSysFlag.TRANSACTION_COMMIT_TYPE) {\n            // Delay Delivery\n            if (msg.getDelayTimeLevel() > 0) {\n                if (msg.getDelayTimeLevel() > this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel()) {\n                    msg.setDelayTimeLevel(this.defaultMessageStore.getScheduleMessageService().getMaxDelayLevel());\n                }\n\n                topic = TopicValidator.RMQ_SYS_SCHEDULE_TOPIC;\n                int queueId = ScheduleMessageService.delayLevel2QueueId(msg.getDelayTimeLevel());\n\n                // Backup real topic, queueId\n                MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_TOPIC, msg.getTopic());\n                MessageAccessor.putProperty(msg, MessageConst.PROPERTY_REAL_QUEUE_ID, String.valueOf(msg.getQueueId()));\n                msg.setPropertiesString(MessageDecoder.messageProperties2String(msg.getProperties()));\n\n                msg.setTopic(topic);\n                msg.setQueueId(queueId);\n            }\n        }\n\n        InetSocketAddress bornSocketAddress = (InetSocketAddress) msg.getBornHost();\n        if (bornSocketAddress.getAddress() instanceof Inet6Address) {\n            msg.setBornHostV6Flag();\n        }\n\n        InetSocketAddress storeSocketAddress = (InetSocketAddress) msg.getStoreHost();\n        if (storeSocketAddress.getAddress() instanceof Inet6Address) {\n            msg.setStoreHostAddressV6Flag();\n        }\n\n        PutMessageThreadLocal putMessageThreadLocal = this.putMessageThreadLocal.get();\n        updateMaxMessageSize(putMessageThreadLocal);\n        if (!multiDispatch.isMultiDispatchMsg(msg)) {\n            PutMessageResult encodeResult = putMessageThreadLocal.getEncoder().encode(msg);\n            if (encodeResult != null) {\n                return CompletableFuture.completedFuture(encodeResult);\n            }\n            msg.setEncodedBuff(putMessageThreadLocal.getEncoder().getEncoderBuffer());\n        }\n        PutMessageContext putMessageContext = new PutMessageContext(generateKey(putMessageThreadLocal.getKeyBuilder(), msg));\n\n        long elapsedTimeInLock = 0;\n        MappedFile unlockMappedFile = null;\n\n        putMessageLock.lock(); //spin or ReentrantLock ,depending on store config\n        try {\n            MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile();\n            long beginLockTimestamp = this.defaultMessageStore.getSystemClock().now();\n            this.beginTimeInLock = beginLockTimestamp;\n\n            // Here settings are stored timestamp, in order to ensure an orderly\n            // global\n            msg.setStoreTimestamp(beginLockTimestamp);\n\n            if (null == mappedFile || mappedFile.isFull()) {\n                mappedFile = this.mappedFileQueue.getLastMappedFile(0); // Mark: NewFile may be cause noise\n            }\n            if (null == mappedFile) {\n                log.error(\"create mapped file1 error, topic: \" + msg.getTopic() + \" clientAddr: \" + msg.getBornHostString());\n                return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, null));\n            }\n\n            result = mappedFile.appendMessage(msg, this.appendMessageCallback, putMessageContext);\n            switch (result.getStatus()) {\n                case PUT_OK:\n                    break;\n                case END_OF_FILE:\n                    unlockMappedFile = mappedFile;\n                    // Create a new file, re-write the message\n                    mappedFile = this.mappedFileQueue.getLastMappedFile(0);\n                    if (null == mappedFile) {\n                        // XXX: warn and notify me\n                        log.error(\"create mapped file2 error, topic: \" + msg.getTopic() + \" clientAddr: \" + msg.getBornHostString());\n                        return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.CREATE_MAPEDFILE_FAILED, result));\n                    }\n                    result = mappedFile.appendMessage(msg, this.appendMessageCallback, putMessageContext);\n                    break;\n                case MESSAGE_SIZE_EXCEEDED:\n                case PROPERTIES_SIZE_EXCEEDED:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.MESSAGE_ILLEGAL, result));\n                case UNKNOWN_ERROR:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));\n                default:\n                    return CompletableFuture.completedFuture(new PutMessageResult(PutMessageStatus.UNKNOWN_ERROR, result));\n            }\n\n            elapsedTimeInLock = this.defaultMessageStore.getSystemClock().now() - beginLockTimestamp;\n        } finally {\n            beginTimeInLock = 0;\n            putMessageLock.unlock();\n        }\n\n        if (elapsedTimeInLock > 500) {\n            log.warn(\"[NOTIFYME]putMessage in lock cost time(ms)={}, bodyLength={} AppendMessageResult={}\", elapsedTimeInLock, msg.getBody().length, result);\n        }\n\n        if (null != unlockMappedFile && this.defaultMessageStore.getMessageStoreConfig().isWarmMapedFileEnable()) {\n            this.defaultMessageStore.unlockMappedFile(unlockMappedFile);\n        }\n\n        PutMessageResult putMessageResult = new PutMessageResult(PutMessageStatus.PUT_OK, result);\n\n        // Statistics\n        storeStatsService.getSinglePutMessageTopicTimesTotal(msg.getTopic()).add(1);\n        storeStatsService.getSinglePutMessageTopicSizeTotal(topic).add(result.getWroteBytes());\n\n        CompletableFuture<PutMessageStatus> flushResultFuture = submitFlushRequest(result, msg);\n        CompletableFuture<PutMessageStatus> replicaResultFuture = submitReplicaRequest(result, msg);\n        return flushResultFuture.thenCombine(replicaResultFuture, (flushStatus, replicaStatus) -> {\n            if (flushStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(flushStatus);\n            }\n            if (replicaStatus != PutMessageStatus.PUT_OK) {\n                putMessageResult.setPutMessageStatus(replicaStatus);\n            }\n            return putMessageResult;\n        });\n    }\n",
    "verified": "2026-10-09"
  },
  "mqqueueassign": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/CommitLog.java",
    "sha256": "3d6d6dd6c9e0ad947d6a1b8abe4a26bece63a74a07840f32641f476b329f9d96",
    "bytes": 78105,
    "line": 1309,
    "end_line": 1409,
    "marker": "CommitLog.DefaultAppendMessageCallback.doAppend",
    "excerpt": "        public AppendMessageResult doAppend(final long fileFromOffset, final ByteBuffer byteBuffer, final int maxBlank,\n            final MessageExtBrokerInner msgInner, PutMessageContext putMessageContext) {\n            // STORETIMESTAMP + STOREHOSTADDRESS + OFFSET <br>\n\n            // PHY OFFSET\n            long wroteOffset = fileFromOffset + byteBuffer.position();\n\n            Supplier<String> msgIdSupplier = () -> {\n                int sysflag = msgInner.getSysFlag();\n                int msgIdLen = (sysflag & MessageSysFlag.STOREHOSTADDRESS_V6_FLAG) == 0 ? 4 + 4 + 8 : 16 + 4 + 8;\n                ByteBuffer msgIdBuffer = ByteBuffer.allocate(msgIdLen);\n                MessageExt.socketAddress2ByteBuffer(msgInner.getStoreHost(), msgIdBuffer);\n                msgIdBuffer.clear();//because socketAddress2ByteBuffer flip the buffer\n                msgIdBuffer.putLong(msgIdLen - 8, wroteOffset);\n                return UtilAll.bytes2string(msgIdBuffer.array());\n            };\n\n            // Record ConsumeQueue information\n            String key = putMessageContext.getTopicQueueTableKey();\n            Long queueOffset = CommitLog.this.topicQueueTable.get(key);\n            if (null == queueOffset) {\n                queueOffset = 0L;\n                CommitLog.this.topicQueueTable.put(key, queueOffset);\n            }\n\n            boolean multiDispatchWrapResult = CommitLog.this.multiDispatch.wrapMultiDispatch(msgInner);\n            if (!multiDispatchWrapResult) {\n                return new AppendMessageResult(AppendMessageStatus.UNKNOWN_ERROR);\n            }\n\n            // Transaction messages that require special handling\n            final int tranType = MessageSysFlag.getTransactionValue(msgInner.getSysFlag());\n            switch (tranType) {\n                // Prepared and Rollback message is not consumed, will not enter the\n                // consumer queue\n                case MessageSysFlag.TRANSACTION_PREPARED_TYPE:\n                case MessageSysFlag.TRANSACTION_ROLLBACK_TYPE:\n                    queueOffset = 0L;\n                    break;\n                case MessageSysFlag.TRANSACTION_NOT_TYPE:\n                case MessageSysFlag.TRANSACTION_COMMIT_TYPE:\n                default:\n                    break;\n            }\n\n            ByteBuffer preEncodeBuffer = msgInner.getEncodedBuff();\n            final int msgLen = preEncodeBuffer.getInt(0);\n\n            // Determines whether there is sufficient free space\n            if ((msgLen + END_FILE_MIN_BLANK_LENGTH) > maxBlank) {\n                this.msgStoreItemMemory.clear();\n                // 1 TOTALSIZE\n                this.msgStoreItemMemory.putInt(maxBlank);\n                // 2 MAGICCODE\n                this.msgStoreItemMemory.putInt(CommitLog.BLANK_MAGIC_CODE);\n                // 3 The remaining space may be any value\n                // Here the length of the specially set maxBlank\n                final long beginTimeMills = CommitLog.this.defaultMessageStore.now();\n                byteBuffer.put(this.msgStoreItemMemory.array(), 0, 8);\n                return new AppendMessageResult(AppendMessageStatus.END_OF_FILE, wroteOffset,\n                        maxBlank, /* only wrote 8 bytes, but declare wrote maxBlank for compute write position */\n                        msgIdSupplier, msgInner.getStoreTimestamp(),\n                        queueOffset, CommitLog.this.defaultMessageStore.now() - beginTimeMills);\n            }\n\n            int pos = 4 + 4 + 4 + 4 + 4;\n            // 6 QUEUEOFFSET\n            preEncodeBuffer.putLong(pos, queueOffset);\n            pos += 8;\n            // 7 PHYSICALOFFSET\n            preEncodeBuffer.putLong(pos, fileFromOffset + byteBuffer.position());\n            int ipLen = (msgInner.getSysFlag() & MessageSysFlag.BORNHOST_V6_FLAG) == 0 ? 4 + 4 : 16 + 4;\n            // 8 SYSFLAG, 9 BORNTIMESTAMP, 10 BORNHOST, 11 STORETIMESTAMP\n            pos += 8 + 4 + 8 + ipLen;\n            // refresh store time stamp in lock\n            preEncodeBuffer.putLong(pos, msgInner.getStoreTimestamp());\n\n\n            final long beginTimeMills = CommitLog.this.defaultMessageStore.now();\n            // Write messages to the queue buffer\n            byteBuffer.put(preEncodeBuffer);\n            msgInner.setEncodedBuff(null);\n            AppendMessageResult result = new AppendMessageResult(AppendMessageStatus.PUT_OK, wroteOffset, msgLen, msgIdSupplier,\n                msgInner.getStoreTimestamp(), queueOffset, CommitLog.this.defaultMessageStore.now() - beginTimeMills);\n\n            switch (tranType) {\n                case MessageSysFlag.TRANSACTION_PREPARED_TYPE:\n                case MessageSysFlag.TRANSACTION_ROLLBACK_TYPE:\n                    break;\n                case MessageSysFlag.TRANSACTION_NOT_TYPE:\n                case MessageSysFlag.TRANSACTION_COMMIT_TYPE:\n                    // The next update ConsumeQueue information\n                    CommitLog.this.topicQueueTable.put(key, ++queueOffset);\n                    CommitLog.this.multiDispatch.updateMultiQueueOffset(msgInner);\n                    break;\n                default:\n                    break;\n            }\n            return result;\n        }\n\n",
    "verified": "2026-10-09"
  },
  "mqreput": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java",
    "sha256": "b4b55079641bdd7b9449d09ea43202b580af6f3302d1cf840933ff280e681be4",
    "bytes": 88126,
    "line": 2009,
    "end_line": 2084,
    "marker": "DefaultMessageStore.ReputMessageService.doReput",
    "excerpt": "        private void doReput() {\n            if (this.reputFromOffset < DefaultMessageStore.this.commitLog.getMinOffset()) {\n                log.warn(\"The reputFromOffset={} is smaller than minPyOffset={}, this usually indicate that the dispatch behind too much and the commitlog has expired.\",\n                    this.reputFromOffset, DefaultMessageStore.this.commitLog.getMinOffset());\n                this.reputFromOffset = DefaultMessageStore.this.commitLog.getMinOffset();\n            }\n            for (boolean doNext = true; this.isCommitLogAvailable() && doNext; ) {\n\n                if (DefaultMessageStore.this.getMessageStoreConfig().isDuplicationEnable()\n                    && this.reputFromOffset >= DefaultMessageStore.this.getConfirmOffset()) {\n                    break;\n                }\n\n                SelectMappedBufferResult result = DefaultMessageStore.this.commitLog.getData(reputFromOffset);\n                if (result != null) {\n                    try {\n                        this.reputFromOffset = result.getStartOffset();\n\n                        for (int readSize = 0; readSize < result.getSize() && doNext; ) {\n                            DispatchRequest dispatchRequest =\n                                DefaultMessageStore.this.commitLog.checkMessageAndReturnSize(result.getByteBuffer(), false, false);\n                            int size = dispatchRequest.getBufferSize() == -1 ? dispatchRequest.getMsgSize() : dispatchRequest.getBufferSize();\n\n                            if (dispatchRequest.isSuccess()) {\n                                if (size > 0) {\n                                    DefaultMessageStore.this.doDispatch(dispatchRequest);\n\n                                    if (BrokerRole.SLAVE != DefaultMessageStore.this.getMessageStoreConfig().getBrokerRole()\n                                            && DefaultMessageStore.this.brokerConfig.isLongPollingEnable()\n                                            && DefaultMessageStore.this.messageArrivingListener != null) {\n                                        DefaultMessageStore.this.messageArrivingListener.arriving(dispatchRequest.getTopic(),\n                                            dispatchRequest.getQueueId(), dispatchRequest.getConsumeQueueOffset() + 1,\n                                            dispatchRequest.getTagsCode(), dispatchRequest.getStoreTimestamp(),\n                                            dispatchRequest.getBitMap(), dispatchRequest.getPropertiesMap());\n                                        notifyMessageArrive4MultiQueue(dispatchRequest);\n                                    }\n\n                                    this.reputFromOffset += size;\n                                    readSize += size;\n                                    if (DefaultMessageStore.this.getMessageStoreConfig().getBrokerRole() == BrokerRole.SLAVE) {\n                                        DefaultMessageStore.this.storeStatsService\n                                            .getSinglePutMessageTopicTimesTotal(dispatchRequest.getTopic()).add(1);\n                                        DefaultMessageStore.this.storeStatsService\n                                            .getSinglePutMessageTopicSizeTotal(dispatchRequest.getTopic())\n                                            .add(dispatchRequest.getMsgSize());\n                                    }\n                                } else if (size == 0) {\n                                    this.reputFromOffset = DefaultMessageStore.this.commitLog.rollNextFile(this.reputFromOffset);\n                                    readSize = result.getSize();\n                                }\n                            } else if (!dispatchRequest.isSuccess()) {\n\n                                if (size > 0) {\n                                    log.error(\"[BUG]read total count not equals msg total size. reputFromOffset={}\", reputFromOffset);\n                                    this.reputFromOffset += size;\n                                } else {\n                                    doNext = false;\n                                    // If user open the dledger pattern or the broker is master node,\n                                    // it will not ignore the exception and fix the reputFromOffset variable\n                                    if (DefaultMessageStore.this.getMessageStoreConfig().isEnableDLegerCommitLog() ||\n                                        DefaultMessageStore.this.brokerConfig.getBrokerId() == MixAll.MASTER_ID) {\n                                        log.error(\"[BUG]dispatch message to consume queue error, COMMITLOG OFFSET: {}\",\n                                            this.reputFromOffset);\n                                        this.reputFromOffset += result.getSize() - readSize;\n                                    }\n                                }\n                            }\n                        }\n                    } finally {\n                        result.release();\n                    }\n                } else {\n                    doNext = false;\n                }\n            }\n        }\n",
    "verified": "2026-10-09"
  },
  "mqdispatch": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java",
    "sha256": "b4b55079641bdd7b9449d09ea43202b580af6f3302d1cf840933ff280e681be4",
    "bytes": 88126,
    "line": 1519,
    "end_line": 1523,
    "marker": "DefaultMessageStore.doDispatch",
    "excerpt": "    public void doDispatch(DispatchRequest req) {\n        for (CommitLogDispatcher dispatcher : this.dispatcherList) {\n            dispatcher.dispatch(req);\n        }\n    }\n",
    "verified": "2026-10-09"
  },
  "mqcqposition": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java",
    "sha256": "02126d4b2259da8e94d6339e7e546f0326f9dbb04ffd6786955b100d434767c8",
    "bytes": 25863,
    "line": 478,
    "end_line": 530,
    "marker": "ConsumeQueue.putMessagePositionInfo",
    "excerpt": "    private boolean putMessagePositionInfo(final long offset, final int size, final long tagsCode,\n        final long cqOffset) {\n\n        if (offset + size <= this.maxPhysicOffset) {\n            log.warn(\"Maybe try to build consume queue repeatedly maxPhysicOffset={} phyOffset={}\", maxPhysicOffset, offset);\n            return true;\n        }\n\n        this.byteBufferIndex.flip();\n        this.byteBufferIndex.limit(CQ_STORE_UNIT_SIZE);\n        this.byteBufferIndex.putLong(offset);\n        this.byteBufferIndex.putInt(size);\n        this.byteBufferIndex.putLong(tagsCode);\n\n        final long expectLogicOffset = cqOffset * CQ_STORE_UNIT_SIZE;\n\n        MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile(expectLogicOffset);\n        if (mappedFile != null) {\n\n            if (mappedFile.isFirstCreateInQueue() && cqOffset != 0 && mappedFile.getWrotePosition() == 0) {\n                this.minLogicOffset = expectLogicOffset;\n                this.mappedFileQueue.setFlushedWhere(expectLogicOffset);\n                this.mappedFileQueue.setCommittedWhere(expectLogicOffset);\n                this.fillPreBlank(mappedFile, expectLogicOffset);\n                log.info(\"fill pre blank space \" + mappedFile.getFileName() + \" \" + expectLogicOffset + \" \"\n                    + mappedFile.getWrotePosition());\n            }\n\n            if (cqOffset != 0) {\n                long currentLogicOffset = mappedFile.getWrotePosition() + mappedFile.getFileFromOffset();\n\n                if (expectLogicOffset < currentLogicOffset) {\n                    log.warn(\"Build  consume queue repeatedly, expectLogicOffset: {} currentLogicOffset: {} Topic: {} QID: {} Diff: {}\",\n                        expectLogicOffset, currentLogicOffset, this.topic, this.queueId, expectLogicOffset - currentLogicOffset);\n                    return true;\n                }\n\n                if (expectLogicOffset != currentLogicOffset) {\n                    LOG_ERROR.warn(\n                        \"[BUG]logic queue order maybe wrong, expectLogicOffset: {} currentLogicOffset: {} Topic: {} QID: {} Diff: {}\",\n                        expectLogicOffset,\n                        currentLogicOffset,\n                        this.topic,\n                        this.queueId,\n                        expectLogicOffset - currentLogicOffset\n                    );\n                }\n            }\n            this.maxPhysicOffset = offset + size;\n            return mappedFile.appendMessage(this.byteBufferIndex.array());\n        }\n        return false;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqcqorder": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/ConsumeQueue.java",
    "sha256": "02126d4b2259da8e94d6339e7e546f0326f9dbb04ffd6786955b100d434767c8",
    "bytes": 25863,
    "line": 478,
    "end_line": 530,
    "marker": "ConsumeQueue.putMessagePositionInfo",
    "excerpt": "    private boolean putMessagePositionInfo(final long offset, final int size, final long tagsCode,\n        final long cqOffset) {\n\n        if (offset + size <= this.maxPhysicOffset) {\n            log.warn(\"Maybe try to build consume queue repeatedly maxPhysicOffset={} phyOffset={}\", maxPhysicOffset, offset);\n            return true;\n        }\n\n        this.byteBufferIndex.flip();\n        this.byteBufferIndex.limit(CQ_STORE_UNIT_SIZE);\n        this.byteBufferIndex.putLong(offset);\n        this.byteBufferIndex.putInt(size);\n        this.byteBufferIndex.putLong(tagsCode);\n\n        final long expectLogicOffset = cqOffset * CQ_STORE_UNIT_SIZE;\n\n        MappedFile mappedFile = this.mappedFileQueue.getLastMappedFile(expectLogicOffset);\n        if (mappedFile != null) {\n\n            if (mappedFile.isFirstCreateInQueue() && cqOffset != 0 && mappedFile.getWrotePosition() == 0) {\n                this.minLogicOffset = expectLogicOffset;\n                this.mappedFileQueue.setFlushedWhere(expectLogicOffset);\n                this.mappedFileQueue.setCommittedWhere(expectLogicOffset);\n                this.fillPreBlank(mappedFile, expectLogicOffset);\n                log.info(\"fill pre blank space \" + mappedFile.getFileName() + \" \" + expectLogicOffset + \" \"\n                    + mappedFile.getWrotePosition());\n            }\n\n            if (cqOffset != 0) {\n                long currentLogicOffset = mappedFile.getWrotePosition() + mappedFile.getFileFromOffset();\n\n                if (expectLogicOffset < currentLogicOffset) {\n                    log.warn(\"Build  consume queue repeatedly, expectLogicOffset: {} currentLogicOffset: {} Topic: {} QID: {} Diff: {}\",\n                        expectLogicOffset, currentLogicOffset, this.topic, this.queueId, expectLogicOffset - currentLogicOffset);\n                    return true;\n                }\n\n                if (expectLogicOffset != currentLogicOffset) {\n                    LOG_ERROR.warn(\n                        \"[BUG]logic queue order maybe wrong, expectLogicOffset: {} currentLogicOffset: {} Topic: {} QID: {} Diff: {}\",\n                        expectLogicOffset,\n                        currentLogicOffset,\n                        this.topic,\n                        this.queueId,\n                        expectLogicOffset - currentLogicOffset\n                    );\n                }\n            }\n            this.maxPhysicOffset = offset + size;\n            return mappedFile.appendMessage(this.byteBufferIndex.array());\n        }\n        return false;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqread": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java",
    "sha256": "b4b55079641bdd7b9449d09ea43202b580af6f3302d1cf840933ff280e681be4",
    "bytes": 88126,
    "line": 560,
    "end_line": 735,
    "marker": "DefaultMessageStore.getMessage",
    "excerpt": "    public GetMessageResult getMessage(final String group, final String topic, final int queueId, final long offset,\n        final int maxMsgNums,\n        final MessageFilter messageFilter) {\n        if (this.shutdown) {\n            log.warn(\"message store has shutdown, so getMessage is forbidden\");\n            return null;\n        }\n\n        if (!this.runningFlags.isReadable()) {\n            log.warn(\"message store is not readable, so getMessage is forbidden \" + this.runningFlags.getFlagBits());\n            return null;\n        }\n\n        if (MixAll.isLmq(topic) && this.isLmqConsumeQueueNumExceeded()) {\n            log.warn(\"message store is not available, broker config enableLmq and enableMultiDispatch, lmq consumeQueue num exceed maxLmqConsumeQueueNum config num\");\n            return null;\n        }\n\n        long beginTime = this.getSystemClock().now();\n\n        GetMessageStatus status = GetMessageStatus.NO_MESSAGE_IN_QUEUE;\n        long nextBeginOffset = offset;\n        long minOffset = 0;\n        long maxOffset = 0;\n\n        // lazy init when find msg.\n        GetMessageResult getResult = null;\n\n        final long maxOffsetPy = this.commitLog.getMaxOffset();\n\n        ConsumeQueue consumeQueue = findConsumeQueue(topic, queueId);\n        if (consumeQueue != null) {\n            minOffset = consumeQueue.getMinOffsetInQueue();\n            maxOffset = consumeQueue.getMaxOffsetInQueue();\n\n            if (maxOffset == 0) {\n                status = GetMessageStatus.NO_MESSAGE_IN_QUEUE;\n                nextBeginOffset = nextOffsetCorrection(offset, 0);\n            } else if (offset < minOffset) {\n                status = GetMessageStatus.OFFSET_TOO_SMALL;\n                nextBeginOffset = nextOffsetCorrection(offset, minOffset);\n            } else if (offset == maxOffset) {\n                status = GetMessageStatus.OFFSET_OVERFLOW_ONE;\n                nextBeginOffset = nextOffsetCorrection(offset, offset);\n            } else if (offset > maxOffset) {\n                status = GetMessageStatus.OFFSET_OVERFLOW_BADLY;\n                nextBeginOffset = nextOffsetCorrection(offset, maxOffset);\n            } else {\n                SelectMappedBufferResult bufferConsumeQueue = consumeQueue.getIndexBuffer(offset);\n                if (bufferConsumeQueue != null) {\n                    try {\n                        status = GetMessageStatus.NO_MATCHED_MESSAGE;\n\n                        long nextPhyFileStartOffset = Long.MIN_VALUE;\n                        long maxPhyOffsetPulling = 0;\n\n                        int i = 0;\n                        final int maxFilterMessageCount = Math.max(16000, maxMsgNums * ConsumeQueue.CQ_STORE_UNIT_SIZE);\n                        final boolean diskFallRecorded = this.messageStoreConfig.isDiskFallRecorded();\n\n                        getResult = new GetMessageResult(maxMsgNums);\n\n                        ConsumeQueueExt.CqExtUnit cqExtUnit = new ConsumeQueueExt.CqExtUnit();\n                        for (; i < bufferConsumeQueue.getSize() && i < maxFilterMessageCount; i += ConsumeQueue.CQ_STORE_UNIT_SIZE) {\n                            long offsetPy = bufferConsumeQueue.getByteBuffer().getLong();\n                            int sizePy = bufferConsumeQueue.getByteBuffer().getInt();\n                            long tagsCode = bufferConsumeQueue.getByteBuffer().getLong();\n\n                            maxPhyOffsetPulling = offsetPy;\n\n                            if (nextPhyFileStartOffset != Long.MIN_VALUE) {\n                                if (offsetPy < nextPhyFileStartOffset)\n                                    continue;\n                            }\n\n                            boolean isInDisk = checkInDiskByCommitOffset(offsetPy, maxOffsetPy);\n\n                            if (this.isTheBatchFull(sizePy, maxMsgNums, getResult.getBufferTotalSize(), getResult.getMessageCount(),\n                                isInDisk)) {\n                                break;\n                            }\n\n                            boolean extRet = false, isTagsCodeLegal = true;\n                            if (consumeQueue.isExtAddr(tagsCode)) {\n                                extRet = consumeQueue.getExt(tagsCode, cqExtUnit);\n                                if (extRet) {\n                                    tagsCode = cqExtUnit.getTagsCode();\n                                } else {\n                                    // can't find ext content.Client will filter messages by tag also.\n                                    log.error(\"[BUG] can't find consume queue extend file content!addr={}, offsetPy={}, sizePy={}, topic={}, group={}\",\n                                        tagsCode, offsetPy, sizePy, topic, group);\n                                    isTagsCodeLegal = false;\n                                }\n                            }\n\n                            if (messageFilter != null\n                                && !messageFilter.isMatchedByConsumeQueue(isTagsCodeLegal ? tagsCode : null, extRet ? cqExtUnit : null)) {\n                                if (getResult.getBufferTotalSize() == 0) {\n                                    status = GetMessageStatus.NO_MATCHED_MESSAGE;\n                                }\n\n                                continue;\n                            }\n\n                            SelectMappedBufferResult selectResult = this.commitLog.getMessage(offsetPy, sizePy);\n                            if (null == selectResult) {\n                                if (getResult.getBufferTotalSize() == 0) {\n                                    status = GetMessageStatus.MESSAGE_WAS_REMOVING;\n                                }\n\n                                nextPhyFileStartOffset = this.commitLog.rollNextFile(offsetPy);\n                                continue;\n                            }\n\n                            if (messageFilter != null\n                                && !messageFilter.isMatchedByCommitLog(selectResult.getByteBuffer().slice(), null)) {\n                                if (getResult.getBufferTotalSize() == 0) {\n                                    status = GetMessageStatus.NO_MATCHED_MESSAGE;\n                                }\n                                // release...\n                                selectResult.release();\n                                continue;\n                            }\n\n                            this.storeStatsService.getGetMessageTransferedMsgCount().add(1);\n                            getResult.addMessage(selectResult);\n                            status = GetMessageStatus.FOUND;\n                            nextPhyFileStartOffset = Long.MIN_VALUE;\n                        }\n\n                        if (diskFallRecorded) {\n                            long fallBehind = maxOffsetPy - maxPhyOffsetPulling;\n                            brokerStatsManager.recordDiskFallBehindSize(group, topic, queueId, fallBehind);\n                        }\n\n                        nextBeginOffset = offset + (i / ConsumeQueue.CQ_STORE_UNIT_SIZE);\n\n                        long diff = maxOffsetPy - maxPhyOffsetPulling;\n                        long memory = (long) (StoreUtil.TOTAL_PHYSICAL_MEMORY_SIZE\n                            * (this.messageStoreConfig.getAccessMessageInMemoryMaxRatio() / 100.0));\n                        getResult.setSuggestPullingFromSlave(diff > memory);\n                    } finally {\n\n                        bufferConsumeQueue.release();\n                    }\n                } else {\n                    status = GetMessageStatus.OFFSET_FOUND_NULL;\n                    nextBeginOffset = nextOffsetCorrection(offset, consumeQueue.rollNextFile(offset));\n                    log.warn(\"consumer request topic: \" + topic + \"offset: \" + offset + \" minOffset: \" + minOffset + \" maxOffset: \"\n                        + maxOffset + \", but access logic queue failed.\");\n                }\n            }\n        } else {\n            status = GetMessageStatus.NO_MATCHED_LOGIC_QUEUE;\n            nextBeginOffset = nextOffsetCorrection(offset, 0);\n        }\n\n        if (GetMessageStatus.FOUND == status) {\n            this.storeStatsService.getGetMessageTimesTotalFound().add(1);\n        } else {\n            this.storeStatsService.getGetMessageTimesTotalMiss().add(1);\n        }\n        long elapsedTime = this.getSystemClock().now() - beginTime;\n        this.storeStatsService.setGetMessageEntireTimeMax(elapsedTime);\n\n        // lazy init no data found.\n        if (getResult == null) {\n            getResult = new GetMessageResult(0);\n        }\n\n        getResult.setStatus(status);\n        getResult.setNextBeginOffset(nextBeginOffset);\n        getResult.setMaxOffset(maxOffset);\n        getResult.setMinOffset(minOffset);\n        return getResult;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqindexput": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/index/IndexFile.java",
    "sha256": "648c4bd79afb7382e17a6dcac3a388adef54ab8b1fdaa201f62a32d61e0edec0",
    "bytes": 9359,
    "line": 88,
    "end_line": 146,
    "marker": "IndexFile.putKey",
    "excerpt": "    public boolean putKey(final String key, final long phyOffset, final long storeTimestamp) {\n        if (this.indexHeader.getIndexCount() < this.indexNum) {\n            int keyHash = indexKeyHashMethod(key);\n            int slotPos = keyHash % this.hashSlotNum;\n            int absSlotPos = IndexHeader.INDEX_HEADER_SIZE + slotPos * hashSlotSize;\n\n            try {\n\n                int slotValue = this.mappedByteBuffer.getInt(absSlotPos);\n                if (slotValue <= invalidIndex || slotValue > this.indexHeader.getIndexCount()) {\n                    slotValue = invalidIndex;\n                }\n\n                long timeDiff = storeTimestamp - this.indexHeader.getBeginTimestamp();\n\n                timeDiff = timeDiff / 1000;\n\n                if (this.indexHeader.getBeginTimestamp() <= 0) {\n                    timeDiff = 0;\n                } else if (timeDiff > Integer.MAX_VALUE) {\n                    timeDiff = Integer.MAX_VALUE;\n                } else if (timeDiff < 0) {\n                    timeDiff = 0;\n                }\n\n                int absIndexPos =\n                    IndexHeader.INDEX_HEADER_SIZE + this.hashSlotNum * hashSlotSize\n                        + this.indexHeader.getIndexCount() * indexSize;\n\n                this.mappedByteBuffer.putInt(absIndexPos, keyHash);\n                this.mappedByteBuffer.putLong(absIndexPos + 4, phyOffset);\n                this.mappedByteBuffer.putInt(absIndexPos + 4 + 8, (int) timeDiff);\n                this.mappedByteBuffer.putInt(absIndexPos + 4 + 8 + 4, slotValue);\n\n                this.mappedByteBuffer.putInt(absSlotPos, this.indexHeader.getIndexCount());\n\n                if (this.indexHeader.getIndexCount() <= 1) {\n                    this.indexHeader.setBeginPhyOffset(phyOffset);\n                    this.indexHeader.setBeginTimestamp(storeTimestamp);\n                }\n\n                if (invalidIndex == slotValue) {\n                    this.indexHeader.incHashSlotCount();\n                }\n                this.indexHeader.incIndexCount();\n                this.indexHeader.setEndPhyOffset(phyOffset);\n                this.indexHeader.setEndTimestamp(storeTimestamp);\n\n                return true;\n            } catch (Exception e) {\n                log.error(\"putKey exception, Key: \" + key + \" KeyHashCode: \" + key.hashCode(), e);\n            }\n        } else {\n            log.warn(\"Over index file capacity: index count = \" + this.indexHeader.getIndexCount()\n                + \"; index max num = \" + this.indexNum);\n        }\n\n        return false;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqkeyverify": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/client/src/main/java/org/apache/rocketmq/client/impl/MQAdminImpl.java",
    "sha256": "e8209772e23b70c14afadb6d0b33af4cb499adabb02caf80bb54622cb2f2d692",
    "bytes": 21897,
    "line": 295,
    "end_line": 449,
    "marker": "MQAdminImpl.queryMessage",
    "excerpt": "    protected QueryResult queryMessage(String topic, String key, int maxNum, long begin, long end,\n        boolean isUniqKey) throws MQClientException,\n        InterruptedException {\n        TopicRouteData topicRouteData = this.mQClientFactory.getAnExistTopicRouteData(topic);\n        if (null == topicRouteData) {\n            this.mQClientFactory.updateTopicRouteInfoFromNameServer(topic);\n            topicRouteData = this.mQClientFactory.getAnExistTopicRouteData(topic);\n        }\n\n        if (topicRouteData != null) {\n            List<String> brokerAddrs = new LinkedList<String>();\n            for (BrokerData brokerData : topicRouteData.getBrokerDatas()) {\n                String addr = brokerData.selectBrokerAddr();\n                if (addr != null) {\n                    brokerAddrs.add(addr);\n                }\n            }\n\n            if (!brokerAddrs.isEmpty()) {\n                final CountDownLatch countDownLatch = new CountDownLatch(brokerAddrs.size());\n                final List<QueryResult> queryResultList = new LinkedList<QueryResult>();\n                final ReadWriteLock lock = new ReentrantReadWriteLock(false);\n\n                for (String addr : brokerAddrs) {\n                    try {\n                        QueryMessageRequestHeader requestHeader = new QueryMessageRequestHeader();\n                        requestHeader.setTopic(topic);\n                        requestHeader.setKey(key);\n                        requestHeader.setMaxNum(maxNum);\n                        requestHeader.setBeginTimestamp(begin);\n                        requestHeader.setEndTimestamp(end);\n\n                        this.mQClientFactory.getMQClientAPIImpl().queryMessage(addr, requestHeader, timeoutMillis * 3,\n                            new InvokeCallback() {\n                                @Override\n                                public void operationComplete(ResponseFuture responseFuture) {\n                                    try {\n                                        RemotingCommand response = responseFuture.getResponseCommand();\n                                        if (response != null) {\n                                            switch (response.getCode()) {\n                                                case ResponseCode.SUCCESS: {\n                                                    QueryMessageResponseHeader responseHeader = null;\n                                                    try {\n                                                        responseHeader =\n                                                            (QueryMessageResponseHeader) response\n                                                                .decodeCommandCustomHeader(QueryMessageResponseHeader.class);\n                                                    } catch (RemotingCommandException e) {\n                                                        log.error(\"decodeCommandCustomHeader exception\", e);\n                                                        return;\n                                                    }\n\n                                                    List<MessageExt> wrappers =\n                                                        MessageDecoder.decodes(ByteBuffer.wrap(response.getBody()), true);\n\n                                                    QueryResult qr = new QueryResult(responseHeader.getIndexLastUpdateTimestamp(), wrappers);\n                                                    try {\n                                                        lock.writeLock().lock();\n                                                        queryResultList.add(qr);\n                                                    } finally {\n                                                        lock.writeLock().unlock();\n                                                    }\n                                                    break;\n                                                }\n                                                default:\n                                                    log.warn(\"getResponseCommand failed, {} {}\", response.getCode(), response.getRemark());\n                                                    break;\n                                            }\n                                        } else {\n                                            log.warn(\"getResponseCommand return null\");\n                                        }\n                                    } finally {\n                                        countDownLatch.countDown();\n                                    }\n                                }\n                            }, isUniqKey);\n                    } catch (Exception e) {\n                        log.warn(\"queryMessage exception\", e);\n                    }\n\n                }\n\n                boolean ok = countDownLatch.await(timeoutMillis * 4, TimeUnit.MILLISECONDS);\n                if (!ok) {\n                    log.warn(\"queryMessage, maybe some broker failed\");\n                }\n\n                long indexLastUpdateTimestamp = 0;\n                List<MessageExt> messageList = new LinkedList<MessageExt>();\n                for (QueryResult qr : queryResultList) {\n                    if (qr.getIndexLastUpdateTimestamp() > indexLastUpdateTimestamp) {\n                        indexLastUpdateTimestamp = qr.getIndexLastUpdateTimestamp();\n                    }\n\n                    for (MessageExt msgExt : qr.getMessageList()) {\n                        if (isUniqKey) {\n                            if (msgExt.getMsgId().equals(key)) {\n\n                                if (messageList.size() > 0) {\n\n                                    if (messageList.get(0).getStoreTimestamp() > msgExt.getStoreTimestamp()) {\n\n                                        messageList.clear();\n                                        messageList.add(msgExt);\n                                    }\n\n                                } else {\n\n                                    messageList.add(msgExt);\n                                }\n                            } else {\n                                log.warn(\"queryMessage by uniqKey, find message key not matched, maybe hash duplicate {}\", msgExt.toString());\n                            }\n                        } else {\n                            String keys = msgExt.getKeys();\n                            String msgTopic = msgExt.getTopic();\n                            if (keys != null) {\n                                boolean matched = false;\n                                String[] keyArray = keys.split(MessageConst.KEY_SEPARATOR);\n                                if (keyArray != null) {\n                                    for (String k : keyArray) {\n                                        // both topic and key must be equal at the same time\n                                        if (Objects.equals(key, k) && Objects.equals(topic, msgTopic)) {\n                                            matched = true;\n                                            break;\n                                        }\n                                    }\n                                }\n\n                                if (matched) {\n                                    messageList.add(msgExt);\n                                } else {\n                                    log.warn(\"queryMessage, find message key not matched, maybe hash duplicate {}\", msgExt.toString());\n                                }\n                            }\n                        }\n                    }\n                }\n\n                //If namespace not null , reset Topic without namespace.\n                for (MessageExt messageExt : messageList) {\n                    if (null != this.mQClientFactory.getClientConfig().getNamespace()) {\n                        messageExt.setTopic(NamespaceUtil.withoutNamespace(messageExt.getTopic(), this.mQClientFactory.getClientConfig().getNamespace()));\n                    }\n                }\n\n                if (!messageList.isEmpty()) {\n                    return new QueryResult(indexLastUpdateTimestamp, messageList);\n                } else {\n                    throw new MQClientException(ResponseCode.NO_MESSAGE, \"query message by key finished, but no message.\");\n                }\n            }\n        }\n\n        throw new MQClientException(ResponseCode.TOPIC_NOT_EXIST, \"The topic[\" + topic + \"] not matched route info\");\n    }\n",
    "verified": "2026-10-09"
  },
  "mqhalf": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/broker/src/main/java/org/apache/rocketmq/broker/transaction/queue/TransactionalMessageBridge.java",
    "sha256": "fda409624fc607dc5915ff137630388c04e35bdce17b8367c387623d329e77ab",
    "bytes": 16273,
    "line": 203,
    "end_line": 213,
    "marker": "TransactionalMessageBridge.parseHalfMessageInner",
    "excerpt": "    private MessageExtBrokerInner parseHalfMessageInner(MessageExtBrokerInner msgInner) {\n        MessageAccessor.putProperty(msgInner, MessageConst.PROPERTY_REAL_TOPIC, msgInner.getTopic());\n        MessageAccessor.putProperty(msgInner, MessageConst.PROPERTY_REAL_QUEUE_ID,\n            String.valueOf(msgInner.getQueueId()));\n        msgInner.setSysFlag(\n            MessageSysFlag.resetTransactionValue(msgInner.getSysFlag(), MessageSysFlag.TRANSACTION_NOT_TYPE));\n        msgInner.setTopic(TransactionalMessageUtil.buildHalfTopic());\n        msgInner.setQueueId(0);\n        msgInner.setPropertiesString(MessageDecoder.messageProperties2String(msgInner.getProperties()));\n        return msgInner;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqrecover": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java",
    "sha256": "b4b55079641bdd7b9449d09ea43202b580af6f3302d1cf840933ff280e681be4",
    "bytes": 88126,
    "line": 1424,
    "end_line": 1434,
    "marker": "DefaultMessageStore.recover",
    "excerpt": "    private void recover(final boolean lastExitOK) {\n        long maxPhyOffsetOfConsumeQueue = this.recoverConsumeQueue();\n\n        if (lastExitOK) {\n            this.commitLog.recoverNormally(maxPhyOffsetOfConsumeQueue);\n        } else {\n            this.commitLog.recoverAbnormally(maxPhyOffsetOfConsumeQueue);\n        }\n\n        this.recoverTopicQueueTable();\n    }\n",
    "verified": "2026-10-09"
  },
  "mqcheckpoint": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/StoreCheckpoint.java",
    "sha256": "f46115e7dac0bb311ac5cdce2e6587dd569bfe0ada2fdc0f2277c9554f868752",
    "bytes": 4587,
    "line": 78,
    "end_line": 83,
    "marker": "StoreCheckpoint.flush",
    "excerpt": "    public void flush() {\n        this.mappedByteBuffer.putLong(0, this.physicMsgTimestamp);\n        this.mappedByteBuffer.putLong(8, this.logicsMsgTimestamp);\n        this.mappedByteBuffer.putLong(16, this.indexMsgTimestamp);\n        this.mappedByteBuffer.force();\n    }\n",
    "verified": "2026-10-09"
  },
  "mqrecovertruncate": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/CommitLog.java",
    "sha256": "3d6d6dd6c9e0ad947d6a1b8abe4a26bece63a74a07840f32641f476b329f9d96",
    "bytes": 78105,
    "line": 466,
    "end_line": 550,
    "marker": "CommitLog.recoverAbnormally",
    "excerpt": "    @Deprecated\n    public void recoverAbnormally(long maxPhyOffsetOfConsumeQueue) {\n        // recover by the minimum time stamp\n        boolean checkCRCOnRecover = this.defaultMessageStore.getMessageStoreConfig().isCheckCRCOnRecover();\n        final List<MappedFile> mappedFiles = this.mappedFileQueue.getMappedFiles();\n        if (!mappedFiles.isEmpty()) {\n            // Looking beginning to recover from which file\n            int index = mappedFiles.size() - 1;\n            MappedFile mappedFile = null;\n            for (; index >= 0; index--) {\n                mappedFile = mappedFiles.get(index);\n                if (this.isMappedFileMatchedRecover(mappedFile)) {\n                    log.info(\"recover from this mapped file \" + mappedFile.getFileName());\n                    break;\n                }\n            }\n\n            if (index < 0) {\n                index = 0;\n                mappedFile = mappedFiles.get(index);\n            }\n\n            ByteBuffer byteBuffer = mappedFile.sliceByteBuffer();\n            long processOffset = mappedFile.getFileFromOffset();\n            long mappedFileOffset = 0;\n            while (true) {\n                DispatchRequest dispatchRequest = this.checkMessageAndReturnSize(byteBuffer, checkCRCOnRecover);\n                int size = dispatchRequest.getMsgSize();\n\n                if (dispatchRequest.isSuccess()) {\n                    // Normal data\n                    if (size > 0) {\n                        mappedFileOffset += size;\n\n                        if (this.defaultMessageStore.getMessageStoreConfig().isDuplicationEnable()) {\n                            if (dispatchRequest.getCommitLogOffset() < this.defaultMessageStore.getConfirmOffset()) {\n                                this.defaultMessageStore.doDispatch(dispatchRequest);\n                            }\n                        } else {\n                            this.defaultMessageStore.doDispatch(dispatchRequest);\n                        }\n                    }\n                    // Come the end of the file, switch to the next file\n                    // Since the return 0 representatives met last hole, this can\n                    // not be included in truncate offset\n                    else if (size == 0) {\n                        index++;\n                        if (index >= mappedFiles.size()) {\n                            // The current branch under normal circumstances should\n                            // not happen\n                            log.info(\"recover physics file over, last mapped file \" + mappedFile.getFileName());\n                            break;\n                        } else {\n                            mappedFile = mappedFiles.get(index);\n                            byteBuffer = mappedFile.sliceByteBuffer();\n                            processOffset = mappedFile.getFileFromOffset();\n                            mappedFileOffset = 0;\n                            log.info(\"recover next physics file, \" + mappedFile.getFileName());\n                        }\n                    }\n                } else {\n                    log.info(\"recover physics file end, \" + mappedFile.getFileName() + \" pos=\" + byteBuffer.position());\n                    break;\n                }\n            }\n\n            processOffset += mappedFileOffset;\n            this.mappedFileQueue.setFlushedWhere(processOffset);\n            this.mappedFileQueue.setCommittedWhere(processOffset);\n            this.mappedFileQueue.truncateDirtyFiles(processOffset);\n\n            // Clear ConsumeQueue redundant data\n            if (maxPhyOffsetOfConsumeQueue >= processOffset) {\n                log.warn(\"maxPhyOffsetOfConsumeQueue({}) >= processOffset({}), truncate dirty logic files\", maxPhyOffsetOfConsumeQueue, processOffset);\n                this.defaultMessageStore.truncateDirtyLogicFiles(processOffset);\n            }\n        }\n        // Commitlog case files are deleted\n        else {\n            log.warn(\"The commitlog files are deleted, and delete the consume queue files\");\n            this.mappedFileQueue.setFlushedWhere(0);\n            this.mappedFileQueue.setCommittedWhere(0);\n            this.defaultMessageStore.destroyLogics();\n        }\n    }\n",
    "verified": "2026-10-09"
  },
  "mqrestart": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java",
    "sha256": "b4b55079641bdd7b9449d09ea43202b580af6f3302d1cf840933ff280e681be4",
    "bytes": 88126,
    "line": 233,
    "end_line": 306,
    "marker": "DefaultMessageStore.start",
    "excerpt": "    /**\n     * @throws Exception\n     */\n    public void start() throws Exception {\n\n        lock = lockFile.getChannel().tryLock(0, 1, false);\n        if (lock == null || lock.isShared() || !lock.isValid()) {\n            throw new RuntimeException(\"Lock failed,MQ already started\");\n        }\n\n        lockFile.getChannel().write(ByteBuffer.wrap(\"lock\".getBytes()));\n        lockFile.getChannel().force(true);\n        {\n            /**\n             * 1. Make sure the fast-forward messages to be truncated during the recovering according to the max physical offset of the commitlog;\n             * 2. DLedger committedPos may be missing, so the maxPhysicalPosInLogicQueue maybe bigger that maxOffset returned by DLedgerCommitLog, just let it go;\n             * 3. Calculate the reput offset according to the consume queue;\n             * 4. Make sure the fall-behind messages to be dispatched before starting the commitlog, especially when the broker role are automatically changed.\n             */\n            long maxPhysicalPosInLogicQueue = commitLog.getMinOffset();\n            for (ConcurrentMap<Integer, ConsumeQueue> maps : this.consumeQueueTable.values()) {\n                for (ConsumeQueue logic : maps.values()) {\n                    if (logic.getMaxPhysicOffset() > maxPhysicalPosInLogicQueue) {\n                        maxPhysicalPosInLogicQueue = logic.getMaxPhysicOffset();\n                    }\n                }\n            }\n            if (maxPhysicalPosInLogicQueue < 0) {\n                maxPhysicalPosInLogicQueue = 0;\n            }\n            if (maxPhysicalPosInLogicQueue < this.commitLog.getMinOffset()) {\n                maxPhysicalPosInLogicQueue = this.commitLog.getMinOffset();\n                /**\n                 * This happens in following conditions:\n                 * 1. If someone removes all the consumequeue files or the disk get damaged.\n                 * 2. Launch a new broker, and copy the commitlog from other brokers.\n                 *\n                 * All the conditions has the same in common that the maxPhysicalPosInLogicQueue should be 0.\n                 * If the maxPhysicalPosInLogicQueue is gt 0, there maybe something wrong.\n                 */\n                log.warn(\"[TooSmallCqOffset] maxPhysicalPosInLogicQueue={} clMinOffset={}\", maxPhysicalPosInLogicQueue, this.commitLog.getMinOffset());\n            }\n            log.info(\"[SetReputOffset] maxPhysicalPosInLogicQueue={} clMinOffset={} clMaxOffset={} clConfirmedOffset={}\",\n                maxPhysicalPosInLogicQueue, this.commitLog.getMinOffset(), this.commitLog.getMaxOffset(), this.commitLog.getConfirmOffset());\n            this.reputMessageService.setReputFromOffset(maxPhysicalPosInLogicQueue);\n            this.reputMessageService.start();\n\n            /**\n             *  1. Finish dispatching the messages fall behind, then to start other services.\n             *  2. DLedger committedPos may be missing, so here just require dispatchBehindBytes <= 0\n             */\n            while (true) {\n                if (dispatchBehindBytes() <= 0) {\n                    break;\n                }\n                Thread.sleep(1000);\n                log.info(\"Try to finish doing reput the messages fall behind during the starting, reputOffset={} maxOffset={} behind={}\", this.reputMessageService.getReputFromOffset(), this.getMaxPhyOffset(), this.dispatchBehindBytes());\n            }\n            this.recoverTopicQueueTable();\n        }\n\n        if (!messageStoreConfig.isEnableDLegerCommitLog()) {\n            this.haService.start();\n            this.handleScheduleMessageService(messageStoreConfig.getBrokerRole());\n        }\n\n        this.flushConsumeQueueService.start();\n        this.commitLog.start();\n        this.storeStatsService.start();\n\n        this.createTempFile();\n        this.addScheduleTask();\n        this.shutdown = false;\n    }\n",
    "verified": "2026-10-09"
  },
  "mqindexload": {
    "url": "https://raw.githubusercontent.com/apache/rocketmq/rocketmq-all-4.9.8/store/src/main/java/org/apache/rocketmq/store/index/IndexService.java",
    "sha256": "fdfc64e55d6091811e9eeeb2e73741c9e08440611a8f40ac64de52fa89417009",
    "bytes": 13515,
    "line": 57,
    "end_line": 88,
    "marker": "IndexService.load",
    "excerpt": "    public boolean load(final boolean lastExitOK) {\n        File dir = new File(this.storePath);\n        File[] files = dir.listFiles();\n        if (files != null) {\n            // ascending order\n            Arrays.sort(files);\n            for (File file : files) {\n                try {\n                    IndexFile f = new IndexFile(file.getPath(), this.hashSlotNum, this.indexNum, 0, 0);\n                    f.load();\n\n                    if (!lastExitOK) {\n                        if (f.getEndTimestamp() > this.defaultMessageStore.getStoreCheckpoint()\n                            .getIndexMsgTimestamp()) {\n                            f.destroy(0);\n                            continue;\n                        }\n                    }\n\n                    log.info(\"load index file OK, \" + f.getFileName());\n                    this.indexFileList.add(f);\n                } catch (IOException e) {\n                    log.error(\"load file {} error\", file, e);\n                    return false;\n                } catch (NumberFormatException e) {\n                    log.error(\"load file {} error\", file, e);\n                }\n            }\n        }\n\n        return true;\n    }\n",
    "verified": "2026-10-09"
  },
  "jitsubmit": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/runtime/advancedThresholdPolicy.cpp",
    "sha256": "c3a055c900a4442fce1dd58757205c7065165c927cf5aa96b5894343f38dedfe",
    "bytes": 21851,
    "line": 452,
    "end_line": 458,
    "marker": "AdvancedThresholdPolicy::submit_compile",
    "excerpt": "// Update the rate and submit compile\nvoid AdvancedThresholdPolicy::submit_compile(methodHandle mh, int bci, CompLevel level, JavaThread* thread) {\n  int hot_count = (bci == InvocationEntryBci) ? mh->invocation_count() : mh->backedge_count();\n  update_rate(os::javaTimeMillis(), mh());\n  CompileBroker::compile_method(mh, bci, level, mh, hot_count, \"tiered\", thread);\n}\n\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitload": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/opto/parse3.cpp",
    "sha256": "b3c7436738e297dfdf550f5ea1b128891ee02f50513bbdb6d6b51135e21274dc",
    "bytes": 22536,
    "line": 147,
    "end_line": 280,
    "marker": "Parse::do_get_xxx / load",
    "excerpt": "void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {\n  // Does this field have a constant value?  If so, just push the value.\n  if (field->is_constant()) {\n    // final or stable field\n    const Type* stable_type = NULL;\n    if (FoldStableValues && field->is_stable()) {\n      stable_type = Type::get_const_type(field->type());\n      if (field->type()->is_array_klass()) {\n        int stable_dimension = field->type()->as_array_klass()->dimension();\n        stable_type = stable_type->is_aryptr()->cast_to_stable(true, stable_dimension);\n      }\n    }\n    if (field->is_static()) {\n      // final static field\n      if (C->eliminate_boxing()) {\n        // The pointers in the autobox arrays are always non-null.\n        ciSymbol* klass_name = field->holder()->name();\n        if (field->name() == ciSymbol::cache_field_name() &&\n            field->holder()->uses_default_loader() &&\n            (klass_name == ciSymbol::java_lang_Character_CharacterCache() ||\n             klass_name == ciSymbol::java_lang_Byte_ByteCache() ||\n             klass_name == ciSymbol::java_lang_Short_ShortCache() ||\n             klass_name == ciSymbol::java_lang_Integer_IntegerCache() ||\n             klass_name == ciSymbol::java_lang_Long_LongCache())) {\n          bool require_const = true;\n          bool autobox_cache = true;\n          if (push_constant(field->constant_value(), require_const, autobox_cache)) {\n            return;\n          }\n        }\n      }\n      if (push_constant(field->constant_value(), false, false, stable_type))\n        return;\n    } else {\n      // final or stable non-static field\n      // Treat final non-static fields of trusted classes (classes in\n      // java.lang.invoke and sun.invoke packages and subpackages) as\n      // compile time constants.\n      if (obj->is_Con()) {\n        const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();\n        ciObject* constant_oop = oop_ptr->const_oop();\n        ciConstant constant = field->constant_value_of(constant_oop);\n        if (FoldStableValues && field->is_stable() && constant.is_null_or_zero()) {\n          // fall through to field load; the field is not yet initialized\n        } else {\n          if (push_constant(constant, true, false, stable_type))\n            return;\n        }\n      }\n    }\n  }\n\n  Node* leading_membar = NULL;\n  ciType* field_klass = field->type();\n  bool is_vol = field->is_volatile();\n\n  // Compute address and memory type.\n  int offset = field->offset_in_bytes();\n  const TypePtr* adr_type = C->alias_type(field)->adr_type();\n  Node *adr = basic_plus_adr(obj, obj, offset);\n  BasicType bt = field->layout_type();\n\n  // Build the resultant type of the load\n  const Type *type;\n\n  bool must_assert_null = false;\n\n  if( bt == T_OBJECT ) {\n    if (!field->type()->is_loaded()) {\n      type = TypeInstPtr::BOTTOM;\n      must_assert_null = true;\n    } else if (field->is_constant() && field->is_static()) {\n      // This can happen if the constant oop is non-perm.\n      ciObject* con = field->constant_value().as_object();\n      // Do not \"join\" in the previous type; it doesn't add value,\n      // and may yield a vacuous result if the field is of interface type.\n      type = TypeOopPtr::make_from_constant(con)->isa_oopptr();\n      assert(type != NULL, \"field singleton type must be consistent\");\n    } else {\n      type = TypeOopPtr::make_from_klass(field_klass->as_klass());\n    }\n  } else {\n    type = Type::get_const_basic_type(bt);\n  }\n  if (support_IRIW_for_not_multiple_copy_atomic_cpu && field->is_volatile()) {\n    leading_membar = insert_mem_bar(Op_MemBarVolatile);   // StoreLoad barrier\n  }\n  // Build the load.\n  //\n  MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;\n  Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);\n\n  // Adjust Java stack\n  if (type2size[bt] == 1)\n    push(ld);\n  else\n    push_pair(ld);\n\n  if (must_assert_null) {\n    // Do not take a trap here.  It's possible that the program\n    // will never load the field's class, and will happily see\n    // null values in this field forever.  Don't stumble into a\n    // trap for such a program, or we might get a long series\n    // of useless recompilations.  (Or, we might load a class\n    // which should not be loaded.)  If we ever see a non-null\n    // value, we will then trap and recompile.  (The trap will\n    // not need to mention the class index, since the class will\n    // already have been loaded if we ever see a non-null value.)\n    // uncommon_trap(iter().get_field_signature_index());\n#ifndef PRODUCT\n    if (PrintOpto && (Verbose || WizardMode)) {\n      method()->print_name(); tty->print_cr(\" asserting nullness of field at bci: %d\", bci());\n    }\n#endif\n    if (C->log() != NULL) {\n      C->log()->elem(\"assert_null reason='field' klass='%d'\",\n                     C->log()->identify(field->type()));\n    }\n    // If there is going to be a trap, put it at the next bytecode:\n    set_bci(iter().next_bci());\n    null_assert(peek());\n    set_bci(iter().cur_bci()); // put it back\n  }\n\n  // If reference is volatile, prevent following memory ops from\n  // floating up past the volatile read.  Also prevents commoning\n  // another volatile read.\n  if (field->is_volatile()) {\n    // Memory barrier includes bogus read of value to force load BEFORE membar\n    assert(leading_membar == NULL || support_IRIW_for_not_multiple_copy_atomic_cpu, \"no leading membar expected\");\n    Node* mb = insert_mem_bar(Op_MemBarAcquire, ld);\n    mb->as_MemBar()->set_trailing_load();\n  }\n}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitacquire": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/opto/parse3.cpp",
    "sha256": "b3c7436738e297dfdf550f5ea1b128891ee02f50513bbdb6d6b51135e21274dc",
    "bytes": 22536,
    "line": 147,
    "end_line": 280,
    "marker": "Parse::do_get_xxx / acquire",
    "excerpt": "void Parse::do_get_xxx(Node* obj, ciField* field, bool is_field) {\n  // Does this field have a constant value?  If so, just push the value.\n  if (field->is_constant()) {\n    // final or stable field\n    const Type* stable_type = NULL;\n    if (FoldStableValues && field->is_stable()) {\n      stable_type = Type::get_const_type(field->type());\n      if (field->type()->is_array_klass()) {\n        int stable_dimension = field->type()->as_array_klass()->dimension();\n        stable_type = stable_type->is_aryptr()->cast_to_stable(true, stable_dimension);\n      }\n    }\n    if (field->is_static()) {\n      // final static field\n      if (C->eliminate_boxing()) {\n        // The pointers in the autobox arrays are always non-null.\n        ciSymbol* klass_name = field->holder()->name();\n        if (field->name() == ciSymbol::cache_field_name() &&\n            field->holder()->uses_default_loader() &&\n            (klass_name == ciSymbol::java_lang_Character_CharacterCache() ||\n             klass_name == ciSymbol::java_lang_Byte_ByteCache() ||\n             klass_name == ciSymbol::java_lang_Short_ShortCache() ||\n             klass_name == ciSymbol::java_lang_Integer_IntegerCache() ||\n             klass_name == ciSymbol::java_lang_Long_LongCache())) {\n          bool require_const = true;\n          bool autobox_cache = true;\n          if (push_constant(field->constant_value(), require_const, autobox_cache)) {\n            return;\n          }\n        }\n      }\n      if (push_constant(field->constant_value(), false, false, stable_type))\n        return;\n    } else {\n      // final or stable non-static field\n      // Treat final non-static fields of trusted classes (classes in\n      // java.lang.invoke and sun.invoke packages and subpackages) as\n      // compile time constants.\n      if (obj->is_Con()) {\n        const TypeOopPtr* oop_ptr = obj->bottom_type()->isa_oopptr();\n        ciObject* constant_oop = oop_ptr->const_oop();\n        ciConstant constant = field->constant_value_of(constant_oop);\n        if (FoldStableValues && field->is_stable() && constant.is_null_or_zero()) {\n          // fall through to field load; the field is not yet initialized\n        } else {\n          if (push_constant(constant, true, false, stable_type))\n            return;\n        }\n      }\n    }\n  }\n\n  Node* leading_membar = NULL;\n  ciType* field_klass = field->type();\n  bool is_vol = field->is_volatile();\n\n  // Compute address and memory type.\n  int offset = field->offset_in_bytes();\n  const TypePtr* adr_type = C->alias_type(field)->adr_type();\n  Node *adr = basic_plus_adr(obj, obj, offset);\n  BasicType bt = field->layout_type();\n\n  // Build the resultant type of the load\n  const Type *type;\n\n  bool must_assert_null = false;\n\n  if( bt == T_OBJECT ) {\n    if (!field->type()->is_loaded()) {\n      type = TypeInstPtr::BOTTOM;\n      must_assert_null = true;\n    } else if (field->is_constant() && field->is_static()) {\n      // This can happen if the constant oop is non-perm.\n      ciObject* con = field->constant_value().as_object();\n      // Do not \"join\" in the previous type; it doesn't add value,\n      // and may yield a vacuous result if the field is of interface type.\n      type = TypeOopPtr::make_from_constant(con)->isa_oopptr();\n      assert(type != NULL, \"field singleton type must be consistent\");\n    } else {\n      type = TypeOopPtr::make_from_klass(field_klass->as_klass());\n    }\n  } else {\n    type = Type::get_const_basic_type(bt);\n  }\n  if (support_IRIW_for_not_multiple_copy_atomic_cpu && field->is_volatile()) {\n    leading_membar = insert_mem_bar(Op_MemBarVolatile);   // StoreLoad barrier\n  }\n  // Build the load.\n  //\n  MemNode::MemOrd mo = is_vol ? MemNode::acquire : MemNode::unordered;\n  Node* ld = make_load(NULL, adr, type, bt, adr_type, mo, LoadNode::DependsOnlyOnTest, is_vol);\n\n  // Adjust Java stack\n  if (type2size[bt] == 1)\n    push(ld);\n  else\n    push_pair(ld);\n\n  if (must_assert_null) {\n    // Do not take a trap here.  It's possible that the program\n    // will never load the field's class, and will happily see\n    // null values in this field forever.  Don't stumble into a\n    // trap for such a program, or we might get a long series\n    // of useless recompilations.  (Or, we might load a class\n    // which should not be loaded.)  If we ever see a non-null\n    // value, we will then trap and recompile.  (The trap will\n    // not need to mention the class index, since the class will\n    // already have been loaded if we ever see a non-null value.)\n    // uncommon_trap(iter().get_field_signature_index());\n#ifndef PRODUCT\n    if (PrintOpto && (Verbose || WizardMode)) {\n      method()->print_name(); tty->print_cr(\" asserting nullness of field at bci: %d\", bci());\n    }\n#endif\n    if (C->log() != NULL) {\n      C->log()->elem(\"assert_null reason='field' klass='%d'\",\n                     C->log()->identify(field->type()));\n    }\n    // If there is going to be a trap, put it at the next bytecode:\n    set_bci(iter().next_bci());\n    null_assert(peek());\n    set_bci(iter().cur_bci()); // put it back\n  }\n\n  // If reference is volatile, prevent following memory ops from\n  // floating up past the volatile read.  Also prevents commoning\n  // another volatile read.\n  if (field->is_volatile()) {\n    // Memory barrier includes bogus read of value to force load BEFORE membar\n    assert(leading_membar == NULL || support_IRIW_for_not_multiple_copy_atomic_cpu, \"no leading membar expected\");\n    Node* mb = insert_mem_bar(Op_MemBarAcquire, ld);\n    mb->as_MemBar()->set_trailing_load();\n  }\n}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitrelease": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/opto/parse3.cpp",
    "sha256": "b3c7436738e297dfdf550f5ea1b128891ee02f50513bbdb6d6b51135e21274dc",
    "bytes": 22536,
    "line": 282,
    "end_line": 357,
    "marker": "Parse::do_put_xxx / release",
    "excerpt": "void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {\n  Node* leading_membar = NULL;\n  bool is_vol = field->is_volatile();\n  // If reference is volatile, prevent following memory ops from\n  // floating down past the volatile write.  Also prevents commoning\n  // another volatile read.\n  if (is_vol) {\n    leading_membar = insert_mem_bar(Op_MemBarRelease);\n  }\n\n  // Compute address and memory type.\n  int offset = field->offset_in_bytes();\n  const TypePtr* adr_type = C->alias_type(field)->adr_type();\n  Node* adr = basic_plus_adr(obj, obj, offset);\n  BasicType bt = field->layout_type();\n  // Value to be stored\n  Node* val = type2size[bt] == 1 ? pop() : pop_pair();\n  // Round doubles before storing\n  if (bt == T_DOUBLE)  val = dstore_rounding(val);\n\n  // Conservatively release stores of object references.\n  const MemNode::MemOrd mo =\n    is_vol ?\n    // Volatile fields need releasing stores.\n    MemNode::release :\n    // Non-volatile fields also need releasing stores if they hold an\n    // object reference, because the object reference might point to\n    // a freshly created object.\n    StoreNode::release_if_reference(bt);\n\n  // Store the value.\n  Node* store;\n  if (bt == T_OBJECT) {\n    const TypeOopPtr* field_type;\n    if (!field->type()->is_loaded()) {\n      field_type = TypeInstPtr::BOTTOM;\n    } else {\n      field_type = TypeOopPtr::make_from_klass(field->type()->as_klass());\n    }\n    store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo);\n  } else {\n    store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol);\n  }\n\n  // If reference is volatile, prevent following volatiles ops from\n  // floating up before the volatile write.\n  if (is_vol) {\n    // If not multiple copy atomic, we do the MemBarVolatile before the load.\n    if (!support_IRIW_for_not_multiple_copy_atomic_cpu) {\n      Node* mb = insert_mem_bar(Op_MemBarVolatile, store); // Use fat membar\n      MemBarNode::set_store_pair(leading_membar->as_MemBar(), mb->as_MemBar());\n    }\n    // Remember we wrote a volatile field.\n    // For not multiple copy atomic cpu (ppc64) a barrier should be issued\n    // in constructors which have such stores. See do_exits() in parse1.cpp.\n    if (is_field) {\n      set_wrote_volatile(true);\n    }\n  }\n\n  // If the field is final, the rules of Java say we are in <init> or <clinit>.\n  // Note the presence of writes to final non-static fields, so that we\n  // can insert a memory barrier later on to keep the writes from floating\n  // out of the constructor.\n  // Any method can write a @Stable field; insert memory barriers after those also.\n  if (is_field && (field->is_final() || field->is_stable())) {\n    set_wrote_final(true);\n    // Preserve allocation ptr to create precedent edge to it in membar\n    // generated on exit from constructor.\n    if (C->eliminate_boxing() &&\n        adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&\n        AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {\n      set_alloc_with_final(obj);\n    }\n  }\n}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitvolatile": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/opto/parse3.cpp",
    "sha256": "b3c7436738e297dfdf550f5ea1b128891ee02f50513bbdb6d6b51135e21274dc",
    "bytes": 22536,
    "line": 282,
    "end_line": 357,
    "marker": "Parse::do_put_xxx / volatile",
    "excerpt": "void Parse::do_put_xxx(Node* obj, ciField* field, bool is_field) {\n  Node* leading_membar = NULL;\n  bool is_vol = field->is_volatile();\n  // If reference is volatile, prevent following memory ops from\n  // floating down past the volatile write.  Also prevents commoning\n  // another volatile read.\n  if (is_vol) {\n    leading_membar = insert_mem_bar(Op_MemBarRelease);\n  }\n\n  // Compute address and memory type.\n  int offset = field->offset_in_bytes();\n  const TypePtr* adr_type = C->alias_type(field)->adr_type();\n  Node* adr = basic_plus_adr(obj, obj, offset);\n  BasicType bt = field->layout_type();\n  // Value to be stored\n  Node* val = type2size[bt] == 1 ? pop() : pop_pair();\n  // Round doubles before storing\n  if (bt == T_DOUBLE)  val = dstore_rounding(val);\n\n  // Conservatively release stores of object references.\n  const MemNode::MemOrd mo =\n    is_vol ?\n    // Volatile fields need releasing stores.\n    MemNode::release :\n    // Non-volatile fields also need releasing stores if they hold an\n    // object reference, because the object reference might point to\n    // a freshly created object.\n    StoreNode::release_if_reference(bt);\n\n  // Store the value.\n  Node* store;\n  if (bt == T_OBJECT) {\n    const TypeOopPtr* field_type;\n    if (!field->type()->is_loaded()) {\n      field_type = TypeInstPtr::BOTTOM;\n    } else {\n      field_type = TypeOopPtr::make_from_klass(field->type()->as_klass());\n    }\n    store = store_oop_to_object(control(), obj, adr, adr_type, val, field_type, bt, mo);\n  } else {\n    store = store_to_memory(control(), adr, val, bt, adr_type, mo, is_vol);\n  }\n\n  // If reference is volatile, prevent following volatiles ops from\n  // floating up before the volatile write.\n  if (is_vol) {\n    // If not multiple copy atomic, we do the MemBarVolatile before the load.\n    if (!support_IRIW_for_not_multiple_copy_atomic_cpu) {\n      Node* mb = insert_mem_bar(Op_MemBarVolatile, store); // Use fat membar\n      MemBarNode::set_store_pair(leading_membar->as_MemBar(), mb->as_MemBar());\n    }\n    // Remember we wrote a volatile field.\n    // For not multiple copy atomic cpu (ppc64) a barrier should be issued\n    // in constructors which have such stores. See do_exits() in parse1.cpp.\n    if (is_field) {\n      set_wrote_volatile(true);\n    }\n  }\n\n  // If the field is final, the rules of Java say we are in <init> or <clinit>.\n  // Note the presence of writes to final non-static fields, so that we\n  // can insert a memory barrier later on to keep the writes from floating\n  // out of the constructor.\n  // Any method can write a @Stable field; insert memory barriers after those also.\n  if (is_field && (field->is_final() || field->is_stable())) {\n    set_wrote_final(true);\n    // Preserve allocation ptr to create precedent edge to it in membar\n    // generated on exit from constructor.\n    if (C->eliminate_boxing() &&\n        adr_type->isa_oopptr() && adr_type->is_oopptr()->is_ptr_to_boxed_value() &&\n        AllocateNode::Ideal_allocation(obj, &_gvn) != NULL) {\n      set_alloc_with_final(obj);\n    }\n  }\n}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitx86": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/cpu/x86/vm/x86_64.ad",
    "sha256": "e5452cc20ea9437417ed5ea79624649ef51ef701c5d8a7cfd51672464b667bb1",
    "bytes": 333123,
    "line": 6329,
    "end_line": 6346,
    "marker": "membar_volatile",
    "excerpt": "instruct membar_volatile(rFlagsReg cr) %{\n  match(MemBarVolatile);\n  effect(KILL cr);\n  ins_cost(400);\n\n  format %{\n    $$template\n    if (os::is_MP()) {\n      $$emit$$\"lock addl [rsp + #0], 0\\t! membar_volatile\"\n    } else {\n      $$emit$$\"MEMBAR-volatile ! (empty encoding)\"\n    }\n  %}\n  ins_encode %{\n    __ membar(Assembler::StoreLoad);\n  %}\n  ins_pipe(pipe_slow);\n%}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  },
  "jitdeopt": {
    "url": "https://raw.githubusercontent.com/openjdk/jdk8u/943a5ea328fd2fc8eed0aed4ec9b1957d41f8144/hotspot/src/share/vm/runtime/deoptimization.cpp",
    "sha256": "2e2d942ac53833f8549081e3f1163bac007184de4c2b4df6d7844ec8103d746d",
    "bytes": 83152,
    "line": 1794,
    "end_line": 1802,
    "marker": "Deoptimization::uncommon_trap",
    "excerpt": "Deoptimization::UnrollBlock* Deoptimization::uncommon_trap(JavaThread* thread, jint trap_request) {\n\n  // Still in Java no safepoints\n  {\n    // This enters VM and may safepoint\n    uncommon_trap_inner(thread, trap_request);\n  }\n  return fetch_unroll_info_helper(thread);\n}\n",
    "verified": "2026-10-09",
    "commit": "943a5ea328fd2fc8eed0aed4ec9b1957d41f8144",
    "tag": "jdk8u462-b08"
  }
}
