1479
1479
spareValue.copyTo(_spareValue);
1480
if (!_ignoreMVCCFetch) {
1481
if (MVV.isArrayMVV(_spareValue.getEncodedBytes(), 0, _spareValue.getEncodedSize())) {
1482
buffer.enqueuePruningAction(_tree.getHandle());
1483
if (mvccFetch(_spareValue, Integer.MAX_VALUE)) {
1484
fetchFixupForLongRecords(_spareValue, Integer.MAX_VALUE);
1487
if (_spareValue.isDefined() && _spareValue.isAntiValue()) {
1488
_spareValue.clear();
1480
fetchFromValueInternal(_spareValue, Integer.MAX_VALUE, buffer);
2148
2138
index = _key.getEncodedSize();
2151
matches = fetchInternal(buffer, outValue, foundAt, minimumBytes);
2141
matches = fetchFromBufferInternal(buffer, outValue, foundAt, minimumBytes);
2152
2142
if (!matches && direction != EQ) {
2153
2143
nudged = false;
2154
2144
nudgeForMVCC = (direction == GTEQ || direction == LTEQ);
2169
2159
index = _key.nextElementIndex(parentIndex);
2170
2160
if (index > 0) {
2171
boolean isVisibleMatch = fetchInternal(buffer, outValue, foundAt, minimumBytes);
2161
boolean isVisibleMatch = fetchFromBufferInternal(buffer, outValue, foundAt, minimumBytes);
2173
2163
// In any case (matching sibling, child or
2174
2164
// niece/nephew) we need to ignore this
2756
2746
* As thrown from any internal method.
2757
2747
* @return <code>true</code> if the value was visible.
2759
private boolean fetchInternal(Buffer buffer, Value value, int foundAt, int minimumBytes) throws PersistitException {
2749
private boolean fetchFromBufferInternal(Buffer buffer, Value value, int foundAt, int minimumBytes) throws PersistitException {
2750
buffer.fetch(foundAt, value);
2751
return fetchFromValueInternal(value, minimumBytes, buffer);
2755
* Helper for finalizing the value to return from a, potentially, MVV
2756
* contained in the given Value.
2759
* Value to finalize.
2760
* @param minimumBytes
2761
* Minimum amount of LONG_RECORD to fetch. If <0, the
2762
* <code>value</code> will contain just the descriptor portion.
2763
* @param bufferForPruning
2764
* If not <code>null</code> and <code>Value</code> did contain
2765
* an MVV, call {@link Buffer#enqueuePruningAction(int)}.
2766
* @throws PersistitException
2767
* As thrown from any internal method.
2768
* @return <code>true</code> if the value was visible.
2770
private boolean fetchFromValueInternal(Value value, int minimumBytes, Buffer bufferForPruning) throws PersistitException {
2760
2771
boolean visible = true;
2761
buffer.fetch(foundAt, value);
2763
2773
* We must fetch the full LONG_RECORD, if needed, while buffer is
2764
2774
* claimed from calling code so that it can't be de-allocated as we are
2772
2782
fetchFixupForLongRecords(value, Integer.MAX_VALUE);
2773
2783
if (MVV.isArrayMVV(value.getEncodedBytes(), 0, value.getEncodedSize())) {
2774
buffer.enqueuePruningAction(_tree.getHandle());
2784
if (bufferForPruning != null) {
2785
bufferForPruning.enqueuePruningAction(_tree.getHandle());
2775
2787
visible = mvccFetch(value, minimumBytes);
2776
2788
fetchFixupForLongRecords(value, minimumBytes);
2798
2810
* @throws PersistitException
2799
2811
* As thrown from {@link #search(Key, boolean)}
2801
private void fetchInternal(Value value, int minimumBytes) throws PersistitException {
2813
private void searchAndFetchInternal(Value value, int minimumBytes) throws PersistitException {
2802
2814
Buffer buffer = null;
2804
2816
int foundAt = search(_key, false);
2805
2817
LevelCache lc = _levelCache[0];
2806
2818
buffer = lc._buffer;
2807
fetchInternal(buffer, value, foundAt, minimumBytes);
2819
fetchFromBufferInternal(buffer, value, foundAt, minimumBytes);
2808
2820
_volume.getStatistics().bumpFetchCounter();
2809
2821
_tree.getStatistics().bumpFetchCounter();
3952
3964
boolean savedIgnore = _ignoreMVCCFetch;
3954
3966
_ignoreMVCCFetch = true;
3955
fetchInternal(_spareValue, -1);
3967
searchAndFetchInternal(_spareValue, -1);
3956
3968
final boolean wasLong = isLongRecord(_spareValue);
3957
3969
_spareValue.clear();
3958
3970
return wasLong;
3974
3986
boolean savedIgnore = _ignoreMVCCFetch;
3976
3988
_ignoreMVCCFetch = true;
3977
fetchInternal(_spareValue, -1);
3989
searchAndFetchInternal(_spareValue, -1);
3978
3990
final boolean wasLong = isLongMVV(_spareValue);
3979
3991
_spareValue.clear();
3980
3992
return wasLong;