jclouds-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Zack Shoylev <notificati...@github.com>
Subject Re: [jclouds-labs] JCLOUDS-826: Add blob operations (#176)
Date Wed, 10 Jun 2015 12:43:40 GMT
> +      String key = blob.getMetadata().getName();
> +      Date creationDate = null;
> +      BlobEntity oldBlobEntity = findBlobById(containerName, key);
> +      if (oldBlobEntity != null) {
> +         creationDate = oldBlobEntity.getCreationDate();
> +         deleteBlob(containerName, key);
> +      }
> +      BlobEntity blobEntity = blobToBlobEntity.apply(blob);
> +      blobEntity.getPayload().setChunks(storeData(blob.getPayload().openStream()));
> +      blobEntity.setContainerEntity(containerRepository.findContainerByName(containerName));
> +      blobEntity.setKey(key);
> +      blobEntity.setBlobAccess(blobAccess);
> +      blobEntity.setCreationDate(creationDate);
> +
> +
> +      HashCode hash = ByteStreams2.hashAndClose(blob.getPayload().openStream(), Hashing.md5());

Somewhat of a small problem with this.
In a lot of cases, the user has already checked the hash of the stream they are trying to
upload to a cloud/jdbc/etc. Which means that by having us to it again, performance is reduced
overall. That is really the point of returning the hash.
I am mostly OK with keeping it this way, but maybe explicitly document that the check happens
here too? Either that or remove the integrity check. Removing it might be better. WDYT?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/176/files#r32112760
Mime
View raw message