question: MVStore ( HashMap < String , Object > config ) { Object o = config . get ( "compress" ) ; this . compressionLevel = o == null ? 0 : ( Integer ) o ; String fileName = ( String ) config . get ( "fileName" ) ; o = config . get ( "pageSplitSize" ) ; if ( o == null ) { pageSplitSize = fileName == null ? 4 * 1024 : 16 * 1024 ; } else { pageSplitSize = ( Integer ) o ; } o = config . get ( "backgroundExceptionHandler" ) ; this . backgroundExceptionHandler = ( UncaughtExceptionHandler ) o ; meta = new MVMap < String , String > ( StringDataType . INSTANCE , StringDataType . INSTANCE ) ; HashMap < String , Object > c = New . hashMap ( ) ; c . put ( "id" , 0 ) ; c . put ( "createVersion" , currentVersion ) ; meta . init ( this , c ) ; fileStore = ( FileStore ) config . get ( "fileStore" ) ; if ( fileName == null && fileStore == null ) { cache = null ; cacheChunkRef = null ; return ; } if ( fileStore == null ) { fileStoreIsProvided = false ; fileStore = new FileStore ( ) ; } else { fileStoreIsProvided = true ; } retentionTime = fileStore . getDefaultRetentionTime ( ) ; boolean readOnly = config . containsKey ( "readOnly" ) ; o = config . get ( "cacheSize" ) ; int mb = o == null ? 16 : ( Integer ) o ; if ( mb > 0 ) { CacheLongKeyLIRS . Config cc = new CacheLongKeyLIRS . Config ( ) ; cc . maxMemory = mb * 1024L * 1024L ; o = config . get ( "cacheConcurrency" ) ; if ( o != null ) { cc . segmentCount = ( Integer ) o ; } cache = new CacheLongKeyLIRS < Page > ( cc ) ; cc . maxMemory /= 4 ; cacheChunkRef = new CacheLongKeyLIRS < PageChildren > ( cc ) ; } o = config . get ( "autoCommitBufferSize" ) ; int kb = o == null ? 1024 : ( Integer ) o ; autoCommitMemory = kb * 1024 * 19 ; o = config . get ( "autoCompactFillRate" ) ; autoCompactFillRate = o == null ? 50 : ( Integer ) o ; char [ ] encryptionKey = ( char [ ] ) config . get ( "encryptionKey" ) ; try { if ( ! fileStoreIsProvided ) { fileStore . open ( fileName , readOnly , encryptionKey ) ; } if ( fileStore . size ( ) == 0 ) { creationTime = getTimeAbsolute ( ) ; lastCommitTime = creationTime ; storeHeader . put ( "H" , 2 ) ; storeHeader . put ( "blockSize" , BLOCK_SIZE ) ; storeHeader . put ( "format" , FORMAT_WRITE ) ; storeHeader . put ( "created" , creationTime ) ; writeStoreHeader ( ) ; } else { readStoreHeader ( ) ; } } catch ( IllegalStateException e ) { panic ( e ) ; } finally { if ( encryptionKey != null ) { Arrays . fill ( encryptionKey , ( char ) 0 ) ; } } lastCommitTime = getTimeSinceCreation ( ) ; o = config . get ( "autoCommitDelay" ) ; int delay = o == null ? 1000 : ( Integer ) o ; setAutoCommitDelay ( delay ) ; }
target:  Create and open the store.