/** * Set the required parameters for uploading image * * @param storage colon separated storageInfo string * @param txid txid of the image * @param imageFileSize size of the imagefile to be uploaded * @param nnf NameNodeFile Type * @return Returns map of parameters to be used with PUT request. */ static Map<String, String> getParamsForPutImage(Storage storage, long txid, long imageFileSize, NameNodeFile nnf) { Map<String, String> params = new HashMap<String, String>(); params.put(TXID_PARAM, Long.toString(txid)); params.put(STORAGEINFO_PARAM, storage.toColonSeparatedString()); // setting the length of the file to be uploaded in separate property as // Content-Length only supports up to 2GB params.put(Util.FILE_LENGTH, Long.toString(imageFileSize)); params.put(IMAGE_FILE_TYPE, nnf.name()); return params; }
/** * Set the required parameters for uploading image * * @param httpMethod instance of method to set the parameters * @param storage colon separated storageInfo string * @param txid txid of the image * @param imageFileSize size of the imagefile to be uploaded * @param nnf NameNodeFile Type * @return Returns map of parameters to be used with PUT request. */ static Map<String, String> getParamsForPutImage(Storage storage, long txid, long imageFileSize, NameNodeFile nnf) { Map<String, String> params = new HashMap<String, String>(); params.put(TXID_PARAM, Long.toString(txid)); params.put(STORAGEINFO_PARAM, storage.toColonSeparatedString()); // setting the length of the file to be uploaded in separate property as // Content-Length only supports up to 2GB params.put(TransferFsImage.FILE_LENGTH, Long.toString(imageFileSize)); params.put(IMAGE_FILE_TYPE, nnf.name()); return params; }
/** * Set the required parameters for uploading image * * @param httpMethod instance of method to set the parameters * @param storage colon separated storageInfo string * @param txid txid of the image * @param imageFileSize size of the imagefile to be uploaded * @param nnf NameNodeFile Type * @return Returns map of parameters to be used with PUT request. */ static Map<String, String> getParamsForPutImage(Storage storage, long txid, long imageFileSize, NameNodeFile nnf) { Map<String, String> params = new HashMap<String, String>(); params.put(TXID_PARAM, Long.toString(txid)); params.put(STORAGEINFO_PARAM, storage.toColonSeparatedString()); // setting the length of the file to be uploaded in separate property as // Content-Length only supports up to 2GB params.put(TransferFsImage.FILE_LENGTH, Long.toString(imageFileSize)); params.put(IMAGE_FILE_TYPE, nnf.name()); return params; }