Package com.persistit

Examples of com.persistit.KeyState


    }
   
    @Test
    public void cycleString() throws IOException {
        testKey.append("abcd");
        startKey.sortKeys.add(new KeyState(testKey));
        startKey.rowValue.put("abcd");
        writer.writeEntry(startKey);
        verifyInput();
    }
View Full Code Here


    public void cycleNIntegers() throws IOException {
        for (int i = 0; i < 400; i++) {
            testKey.append(i);
            startKey.rowValue.put(i);
        }
        startKey.sortKeys.add(new KeyState(testKey));
        writer.writeEntry(startKey);
        verifyInput();
    }
View Full Code Here

   
    @Test
    public void cycle2Keys() throws IOException {
       
        testKey.append(1);
        startKey.sortKeys.add(new KeyState(testKey));
        startKey.rowValue.put(1);
        writer.writeEntry(startKey);
        writer.writeEntry(startKey);
       
        is = new ByteArrayInputStream (os.toByteArray());
View Full Code Here

        for (int i = 0; i < 100; i++) {
            SortKey newKey = new SortKey();
            newKey.rowValue.put(i);
            testKey.clear();
            testKey.append(i);
            newKey.sortKeys.add(new KeyState (testKey));
            keys.add(newKey);
        }
        verifyNKeys (keys);
    }
View Full Code Here

            SortKey newKey = new SortKey();
            String value = characters(5+random.nextInt(1000));
            newKey.rowValue.put(value);
            testKey.clear();
            testKey.append(value);
            newKey.sortKeys.add(new KeyState (testKey));
            keys.add(newKey);
        }
        verifyNKeys (keys);
    }
View Full Code Here

            newKey.rowValue.putNull();
            newKey.rowValue.put(characters(3+random.nextInt(25)));
            newKey.rowValue.put(characters(3+random.nextInt(25)));
            testKey.clear();
            testKey.append(i);
            newKey.sortKeys.add(new KeyState (testKey));
            keys.add(newKey);
        }
        verifyNKeys(keys);
    }
View Full Code Here

            int states = readLength();
            if (states < 0) {
                return null;
            }
            for (int i = 0; i < states; i++) {
                KeyState state = readKeyState();
                if (state == null) {
                    return null;
                }
                key.sortKeys.add(state);
            }
View Full Code Here

            byte[] bytes = new byte[size];
            int bytesRead = is.read(bytes);
           
            assert bytesRead == size: "Invalid byte count on key state read";
           
            return new KeyState(bytes);
        }
View Full Code Here

                        break;
                    } catch (KeyTooLongException | StorageKeySizeExceededException e) {
                        enlargeKey(sortKey);
                    }
                }
                states[i] = new KeyState(sortKey);
            }
            return Arrays.asList(states);
        }
View Full Code Here

                    break;
                } catch (KeyTooLongException | StorageKeySizeExceededException e) {
                    key.setMaximumSize(key.getMaximumSize() * 2);
                }
            }
            states[i] = new KeyState(key);
        }
        return states;
    }
View Full Code Here

TOP

Related Classes of com.persistit.KeyState

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.