/** * Creates a new instance of a ValueHolder, containing the serialized values. * * @param parentBtree the parent BTree * @param valueSerializer The Value's serializer * @param raw The raw data containing the values * @param nbValues the number of stored values * @param raw the byte[] containing either the serialized array of values or the sub-btree offset */ InMemoryValueHolder( BTree<?, V> parentBtree, int nbValues ) { valueSerializer = parentBtree.getValueSerializer(); if ( nbValues <= 1 ) { valueArray = ( V[] ) Array.newInstance( valueSerializer.getType(), nbValues ); } }
/** * Creates a new instance of a ValueHolder, containing the serialized values. * * @param parentBtree the parent BTree * @param raw The raw data containing the values * @param nbValues the number of stored values * @param raw the byte[] containing either the serialized array of values or the sub-btree offset */ PersistedValueHolder( BTree<?, V> parentBtree, int nbValues, byte[] raw ) { this.parentBtree = ( PersistedBTree<V, V> ) parentBtree; this.valueSerializer = parentBtree.getValueSerializer(); this.raw = raw; isRawUpToDate = true; valueThresholdUp = PersistedBTree.valueThresholdUp; valueThresholdLow = PersistedBTree.valueThresholdLow; // We create the array of values if they fit in an array. If they are stored in a // BTree, we do nothing atm. if ( nbValues <= valueThresholdUp ) { // The values are contained into an array valueArray = ( V[] ) Array.newInstance( valueSerializer.getType(), nbValues ); } }
byte[] bytesValue = btree.getValueSerializer().serialize( value );
V value = btree.getValueSerializer().fromBytes( valueBytes ); tuple.value.add( value );
valueSerializer = parentBtree.getValueSerializer();
byte[] bytesValue = btree.getValueSerializer().serialize( value );
this.valueSerializer = parentBtree.getValueSerializer(); valueThresholdUp = PersistedBTree.valueThresholdUp; valueThresholdLow = PersistedBTree.valueThresholdLow;
int equal = bt.getValueSerializer().compare( val, valueCursor.next() );
configuration.setPageSize( btree.getPageSize() ); configuration.setKeySerializer( btree.getKeySerializer() ); configuration.setValueSerializer( btree.getValueSerializer() ); configuration.setAllowDuplicates( btree.isAllowDuplicates() ); configuration.setReadTimeOut( btree.getReadTimeOut() );