Repository: storm Updated Branches: refs/heads/master 7f49cba37 -> c7cb25d99
added backward compatibility method for File Download long line, moving it to next line indentation auth exception Project: http://git-wip-us.apache.org/repos/asf/storm/repo Commit: http://git-wip-us.apache.org/repos/asf/storm/commit/547ad08d Tree: http://git-wip-us.apache.org/repos/asf/storm/tree/547ad08d Diff: http://git-wip-us.apache.org/repos/asf/storm/diff/547ad08d Branch: refs/heads/master Commit: 547ad08d34ea5c0dbd9cc339c1a4a9d4803ed763 Parents: 5689085 Author: Sanket <schintap@untilservice-lm> Authored: Wed Dec 16 17:07:12 2015 -0600 Committer: Sanket <schintap@untilservice-lm> Committed: Fri Dec 18 13:24:38 2015 -0600 ---------------------------------------------------------------------- storm-core/src/clj/backtype/storm/daemon/nimbus.clj | 12 ++++++------ .../src/jvm/backtype/storm/blobstore/BlobStore.java | 4 ++-- storm-core/src/storm.thrift | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/storm/blob/547ad08d/storm-core/src/clj/backtype/storm/daemon/nimbus.clj ---------------------------------------------------------------------- diff --git a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj index f97d386..8f4c730 100644 --- a/storm-core/src/clj/backtype/storm/daemon/nimbus.clj +++ b/storm-core/src/clj/backtype/storm/daemon/nimbus.clj @@ -1716,15 +1716,15 @@ (.remove uploaders location) )) - (^String beginFileDownload [this ^String file] - (mark! nimbus:num-beginFileDownload-calls) + (^String beginFileDownload + [this ^String file] (check-authorization! nimbus nil nil "fileDownload") - (check-file-access (:conf nimbus) file) - (let [is (BufferFileInputStream. file) + (let [is (BufferInputStream. (.getBlob (:blob-store nimbus) file nil) + ^Integer (Utils/getInt (conf STORM-BLOBSTORE-INPUTSTREAM-BUFFER-SIZE-BYTES) + (int 65536))) id (uuid)] (.put (:downloaders nimbus) id is) - id - )) + id)) (^ByteBuffer downloadChunk [this ^String id] (mark! nimbus:num-downloadChunk-calls) http://git-wip-us.apache.org/repos/asf/storm/blob/547ad08d/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java ---------------------------------------------------------------------- diff --git a/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java b/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java index 2eba1d9..16a408e 100644 --- a/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java +++ b/storm-core/src/jvm/backtype/storm/blobstore/BlobStore.java @@ -193,10 +193,10 @@ public abstract class BlobStore implements Shutdownable { * Validates key checking for potentially harmful patterns * @param key Key for the blob. */ - public static final void validateKey(String key) { + public static final void validateKey(String key) throws AuthorizationException { if (StringUtils.isEmpty(key) || "..".equals(key) || ".".equals(key) || !KEY_PATTERN.matcher(key).matches()) { LOG.error("'{}' does not appear to be valid {}", key, KEY_PATTERN); - throw new IllegalArgumentException(key+" does not appear to be a valid blob key"); + throw new AuthorizationException(key+" does not appear to be a valid blob key"); } } http://git-wip-us.apache.org/repos/asf/storm/blob/547ad08d/storm-core/src/storm.thrift ---------------------------------------------------------------------- diff --git a/storm-core/src/storm.thrift b/storm-core/src/storm.thrift index 08be005..849ae74 100644 --- a/storm-core/src/storm.thrift +++ b/storm-core/src/storm.thrift @@ -629,7 +629,8 @@ service Nimbus { string beginFileUpload() throws (1: AuthorizationException aze); void uploadChunk(1: string location, 2: binary chunk) throws (1: AuthorizationException aze); void finishFileUpload(1: string location) throws (1: AuthorizationException aze); - + + //@deprecated beginBlobDownload does that string beginFileDownload(1: string file) throws (1: AuthorizationException aze); //can stop downloading chunks when receive 0-length byte array back binary downloadChunk(1: string id) throws (1: AuthorizationException aze);
