Package com.persistit

Examples of com.persistit.Value$OldValueInputStream


        }
       
        private Value readValue() throws IOException {
            int size = readLength();
            if (size < 1) { return null; }
            Value value = new Value ((Persistit)null);
            value.setMaximumSize(size);
            value.ensureFit(size);
            int bytesRead = is.read(value.getEncodedBytes(), 0, size);
            assert bytesRead == size : "Invalid byte count on value read";
            value.setEncodedSize(size);
            return value;
        }
View Full Code Here


                }
            }
            size = ((size  + SIZE_GRANULARITY - 1) / SIZE_GRANULARITY) * SIZE_GRANULARITY;
           
            // Create a new conversion value
            Value convertValue =  new Value ((Persistit)null,
                        Math.max(size, Value.INITIAL_SIZE),
                        Math.max(size, Value.DEFAULT_MAXIMUM_SIZE));
            valueTarget.attach(convertValue);           
            // Covert the row to the Value for storage in the SortKey
            while(true) {
                try {
                    convertValue.clear();
                    convertValue.setStreamMode(true);
                    for (int i = 0; i < rowFields; i++) {
                        ValueSource field = row.value(i);
                        if (field.isNull()) {
                            valueTarget.putNull();
                        } else {
                            tFieldTypes[i].writeCanonical(field, valueTarget);
                        }
                    }
                    break;
                } catch (ConversionException e) {
                    enlargeValue(convertValue);
                }
            }
            // reset some more un-needed internal state. But this requires
            // making a copy of the internal data, again.
            return new Value(convertValue);
        }
View Full Code Here

    public FDBIterationHelper(FDBAdapter adapter, IndexRowType rowType) {
        this.adapter = adapter;
        this.rowType = rowType.physicalRowType();
        this.storeData = adapter.getUnderlyingStore().createStoreData(adapter.getSession(), rowType.index());
        this.storeData.persistitValue = new Value((Persistit)null);
    }
View Full Code Here

    }

    @Override
    void resetForWrite(FDBStoreData storeData, Index index, WriteIndexRow indexRowBuffer) {
        if(storeData.persistitValue == null) {
            storeData.persistitValue = new Value((Persistit) null);
        }
        indexRowBuffer.resetForWrite(index, storeData.persistitKey, storeData.persistitValue);
    }
View Full Code Here

    }

    @Override
    public <V extends IndexVisitor<Key, Value>> V traverse(Session session, Index index, V visitor, long scanTimeLimit, long sleepTime) {
        FDBStoreData storeData = createStoreData(session, index);
        storeData.persistitValue = new Value((Persistit)null);
        TransactionState txn = txnService.getTransaction(session);
        long nextCommitTime = 0;
        if (scanTimeLimit >= 0) {
            nextCommitTime = txn.getStartTime() + scanTimeLimit;
        }
View Full Code Here

            assertEquals("source UnderlyingType", underlying, ValueSources.tClass(source));
        }
    }

    private PersistitValueValueSource createSource(ValueInit values) {
        Value value = new Value((Persistit)null);
        value.setStreamMode(true);

        values.putValues(value);

        value.setStreamMode(false); // need to reset the Value before reading
        value.setStreamMode(true);

        PersistitValueValueSource source = new PersistitValueValueSource();
        source.attach(value);
        return source;
    }
View Full Code Here

TOP

Related Classes of com.persistit.Value$OldValueInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.