private static Journal getStorage ( ServletContext context , UploadImageParam params ) throws IOException { final Journal journal = JournalNodeHttpServer . getJournalFromContextIfExists ( context , params . journalId ) ; if ( journal == null ) { throwIOException ( "Journal: " + params . journalId + " does not exist" ) ; } final JNStorage storage = journal . getImageStorage ( ) ; // check namespace metadata storage . checkConsistentNamespace ( params . getStorageInfo ( ) ) ; // check if this is the active writer if ( ! journal . checkWriterEpoch ( params . epoch ) ) { throwIOException ( "This is not the active writer" ) ; } return journal ; }
Get storage object from underlying journal node given request parameters . If yournal does not exist an exception will be thrown . If the journal metadata does not match the request metadata we also fail .