h2/src/main/org/h2/mvstore/MVStore.java
/**
     * Check whether all data can be read from this version. This requires that
     * all chunks referenced by this version are still available (not
     * overwritten).
     *
     * @param version the version
     * @return true if all data can be read
     */
Check whether all data can be read from this version. This requires that
all chunks referenced by this version are still available (not
overwritten).

@param version the version
@return true if all data can be read
Check whether all data can be read from this version . This requires that all chunks referenced by this version are still available ( not overwritten ) . @param version the version @return true if all data can be read
private boolean isKnownVersion(long version) {
        if (version > currentVersion || version < 0) {
            return false;
        }
        if (version == currentVersion || chunks.size() == 0) {
            return true;
        }
        Chunk c = getChunkForVersion(version);
        if (c == null) {
            return false;
        }
        MVMap<String, String> oldMeta = getMetaMap(version);
        if (oldMeta == null) {
            return false;
        }
        for (Iterator<String> it = oldMeta.keyIterator("chunk."); it.hasNext();) {
            String chunkKey = it.next();
            if (!chunkKey.startsWith("chunk.")) {
                break;
            }
            if (!meta.containsKey(chunkKey)) {
                return false;
            }
        }
        return true;
    }
private boolean isKnownVersion ( long version ) { if ( version > currentVersion || version < 0 ) { return false ; } if ( version == currentVersion || chunks . size ( ) == 0 ) { return true ; } Chunk c = getChunkForVersion ( version ) ; if ( c == null ) { return false ; } MVMap < String , String > oldMeta = getMetaMap ( version ) ; if ( oldMeta == null ) { return false ; } for ( Iterator < String > it = oldMeta . keyIterator ( "chunk." ) ; it . hasNext ( ) ; ) { String chunkKey = it . next ( ) ; if ( ! chunkKey . startsWith ( "chunk." ) ) { break ; } if ( ! meta . containsKey ( chunkKey ) ) { return false ; } } return true ; }
Check whether all data can be read from this version.
Check whether all data can be read from this version .
// no stored data // need to check if a chunk for this version exists // also, all chunks referenced by this version // need to be available in the file