~pbeaman/akiban-persistit/fix_1005206_infinite_loop

« back to all changes in this revision

Viewing changes to core/src/main/java/com/persistit/Persistit.java

merge pbeaman: We missed a pruning case: if long record contains multiple versions, we never pruned them, leading to "pruning incomplete" warnings, and worse, permanent blockage of the journal copier.

https://code.launchpad.net/~pbeaman/akiban-persistit/fix_945244_incomplete_pruning/+merge/106444

Show diffs side-by-side

added added

removed removed

Lines of Context:
474
474
    private volatile long _commitStallTime = DEFAULT_COMMIT_STALL_TIME;
475
475
 
476
476
    private ThreadLocal<SoftReference<int[]>> _intArrayThreadLocal = new ThreadLocal<SoftReference<int[]>>();
 
477
    
 
478
    private ThreadLocal<SoftReference<Key>> _keyThreadLocal = new ThreadLocal<SoftReference<Key>>();
 
479
    
 
480
    private ThreadLocal<SoftReference<Value>> _valueThreadLocal = new ThreadLocal<SoftReference<Value>>();
 
481
    
477
482
 
478
483
    /**
479
484
     * <p>
1793
1798
        _alertMonitors.clear();
1794
1799
        _bufferPoolTable.clear();
1795
1800
        _intArrayThreadLocal.set(null);
 
1801
        _keyThreadLocal.set(null);
 
1802
        _valueThreadLocal.set(null);
1796
1803
    }
1797
1804
 
1798
1805
    /**
2427
2434
        return ints;
2428
2435
    }
2429
2436
 
 
2437
    Key getThreadLocalKey() {
 
2438
        final SoftReference<Key> ref = _keyThreadLocal.get();
 
2439
        if (ref != null) {
 
2440
            final Key key = ref.get();
 
2441
            if (key != null) {
 
2442
                return key;
 
2443
            }
 
2444
        }
 
2445
        final Key key = new Key(this);
 
2446
        _keyThreadLocal.set(new SoftReference<Key>(key));
 
2447
        return key;
 
2448
    }
 
2449
    
 
2450
    Value getThreadLocalValue() {
 
2451
        final SoftReference<Value> ref = _valueThreadLocal.get();
 
2452
        if (ref != null) {
 
2453
            final Value value = ref.get();
 
2454
            if (value != null) {
 
2455
                return value;
 
2456
            }
 
2457
        }
 
2458
        final Value value = new Value(this);
 
2459
        _valueThreadLocal.set(new SoftReference<Value>(value));
 
2460
        return value;
 
2461
    }
 
2462
 
2430
2463
    private final static String[] ARG_TEMPLATE = { "_flag|g|Start AdminUI",
2431
2464
            "_flag|i|Perform IntegrityCheck on all volumes", "_flag|w|Wait until AdminUI exists",
2432
2465
            "_flag|c|Perform copy-back", "properties|string|Property file name",