private String swapStore ( String storeName , String directory ) throws VoldemortException { ReadOnlyStorageEngine store = getReadOnlyStorageEngine ( metadataStore , storeRepository , storeName ) ; if ( ! Utils . isReadableDir ( directory ) ) throw new VoldemortException ( "Store directory '" + directory + "' is not a readable directory." ) ; String currentDirPath = store . getCurrentDirPath ( ) ; logger . info ( "Swapping RO store '" + storeName + "' to version directory '" + directory + "'" ) ; store . swapFiles ( directory ) ; logger . info ( "Swapping swapped RO store '" + storeName + "' to version directory '" + directory + "'" ) ; return currentDirPath ; }
Given a read - only store name and a directory swaps it in while returning the directory path being swapped out