Package com.persistit

Examples of com.persistit.Value$Version


            try {
                Exchange ex = setupExchange();
                if (ex.getKey().getEncodedSize() == 0)
                    return "";
                ex.fetch();
                Value value = ex.getValue();
                if (value.getEncodedSize() > 50000) {
                    return "Too long to display: " + value.getEncodedSize();
                } else {
                    return value.toString();
                }
            } catch (PersistitException de) {
                return de.toString();
            }
        }
View Full Code Here


            try {
                final Exchange ex = setupExchange();
                if (ex.getKey().getEncodedSize() == 0)
                    return "";
                ex.fetch();
                final Value value = ex.getValue();
                if (!value.isDefined())
                    return "undefined";
                return value.getType().getName();
            } catch (final PersistitException de) {
                return de.toString();
            }
        }
View Full Code Here

            try {
                final Exchange ex = setupExchange();
                if (ex.getKey().getEncodedSize() == 0)
                    return "";
                ex.fetch();
                final Value value = ex.getValue();
                if (value.getEncodedSize() > 50000) {
                    return "Too long to display: " + value.getEncodedSize();
                } else {
                    return value.toString();
                }
            } catch (final PersistitException de) {
                return de.toString();
            }
        }
View Full Code Here

    class ValueStateRenderer extends AlignedCellRenderer {
        private final Value _value;

        public ValueStateRenderer() {
            super(SwingConstants.LEFT);
            _value = new Value((Persistit) null);
        }
View Full Code Here

        public List<KeyState> sortKeys;
        public Value rowValue;
    
        public SortKey () {
            this.sortKeys = new ArrayList<>();
            this.rowValue = new Value((Persistit)null);
            rowValue.clear();
        }
View Full Code Here

        }
       
        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

TOP

Related Classes of com.persistit.Value$Version

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.