Source:
<code>public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { <START> HttpServiceResponse response = new HttpServiceResponse(); <END> if (HttpServer.Method.POST == request.getMethod() || HttpServer.Method.PUT == request.getMethod()) { ZooKeeper zk = ZooKeeperClient.newBuilder() .connectString(conf.getZkServers()) .sessionTimeoutMs(conf.getZkTimeout()) .build(); File[] ledgerDirectories = Bookie.getCurrentDirectories(conf.getLedgerDirs()); File[] journalDirectories = Bookie.getCurrentDirectories(conf.getJournalDirs()); File[] indexDirectories; if (null == conf.getIndexDirs()) { indexDirectories = ledgerDirectories; } else { indexDirectories = Bookie.getCurrentDirectories(conf.getIndexDirs()); } List<File> allLedgerDirs = Lists.newArrayList(); allLedgerDirs.addAll(Arrays.asList(ledgerDirectories)); if (indexDirectories != ledgerDirectories) { allLedgerDirs.addAll(Arrays.asList(indexDirectories)); } try { Bookie.checkEnvironmentWithStorageExpansion(conf, zk, Lists.newArrayList(journalDirectories), allLedgerDirs); } catch (BookieException | IOException e) { LOG.error( "Exception while updating cookie for storage expansion", e); response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Exception while updating cookie for storage expansion"); return response; } if (zk != null) { zk.close(); } String jsonResponse = "Success expand storage"; LOG.debug("output body:" + jsonResponse); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be POST/PUT method"); return response; } }</code><technical_language>this need reboot bookie</technical_language>

Target:
public HttpServiceResponse handle(HttpServiceRequest request) throws Exception { HttpServiceResponse response = new HttpServiceResponse(); if (HttpServer.Method.PUT == request.getMethod()) { File[] ledgerDirectories = Bookie.getCurrentDirectories(conf.getLedgerDirs()); File[] journalDirectories = Bookie.getCurrentDirectories(conf.getJournalDirs()); File[] indexDirectories; if (null == conf.getIndexDirs()) { indexDirectories = ledgerDirectories; } else { indexDirectories = Bookie.getCurrentDirectories(conf.getIndexDirs()); } List<File> allLedgerDirs = Lists.newArrayList(); allLedgerDirs.addAll(Arrays.asList(ledgerDirectories)); if (indexDirectories != ledgerDirectories) { allLedgerDirs.addAll(Arrays.asList(indexDirectories)); } try { Bookie.checkEnvironmentWithStorageExpansion(conf, zk, Lists.newArrayList(journalDirectories), allLedgerDirs); } catch (BookieException | IOException e) { LOG.error("Exception occurred while updating cookie for storage expansion", e); response.setCode(HttpServer.StatusCode.INTERNAL_ERROR); response.setBody("Exception while updating cookie for storage expansion"); return response; } String jsonResponse = "Success expand storage"; LOG.debug("output body:" + jsonResponse); response.setBody(jsonResponse); response.setCode(HttpServer.StatusCode.OK); return response; } else { response.setCode(HttpServer.StatusCode.NOT_FOUND); response.setBody("Not found method. Should be PUT method"); return response; } }