Comments (3)
I think, the way you upload files is the right way.
Because instances of Blob and BlobInfo classes are immutable objects, you cannot modify Crc32 value of an existing object. So, to enable data validation you need to provide CRC32hash before you open a WriteChannel. The hash calculated after WriteChannel is opened can't be used for validation.
To speed up crc32 hash calculating for your local files I would recommend you to increase the buffer size. 1k seems to be very small size. On my local machine resizing from 1k to 128k reduced hash calculation time from 50 seconds to 4. With the buffer of 1M size calculation took 3 seconds. Experimenting with the size will allow you to figure out the most optimal value.
I hope my answer will help.
Thanks
from java-storage.
I also noticed a bug in your code of CRC calculation:
Instead of:
hasher = hasher.putBytes(ByteBuffer.wrap(buffer, 0, limit-1));
should be:
hasher = hasher.putBytes(ByteBuffer.wrap(buffer, 0, limit));
Otherwise, the last byte in each chunk will be ignored.
from java-storage.
@Tiozi I hope the question is answered, if you need more details please provide more info.
from java-storage.
Related Issues (20)
- RemoteStorageHelper possibility to provide own Credentials
- samples: audit precondition comments in samples
- Handle generation numbers in BlobId#{to,from}GsUtilUri HOT 5
- test: update signed url conformance test cases HOT 3
- Improve the example of setClientEndpoint adding how to change oauth endpoint
- google-cloud-storage: auto-value is included in published version of dependencies HOT 1
- Storage: com.google.storage.v2.Bucket: getAclList() and getDefaultObjectAclList() always return empty lists HOT 4
- GCS Streaming upload does not respect host in StorageOption HOT 1
- Download an object's last n bytes HOT 2
- Search: java.net.MalformedURLException when using Blob WriteChannel HOT 3
- com.example.storage.ITBucketSnippets: testChangeDefaultStorageClass failed HOT 1
- com.example.storage.ITBucketSnippets: testDisableLifecycleManagement failed HOT 1
- com.example.storage.ITBucketSnippets: testDefaultKMSKey failed HOT 1
- com.example.storage.ITBucketSnippets: testBucketRetention failed HOT 1
- Java-Storage: GCS object larger than 129 GB not downloading to local system HOT 4
- replace usages of the word Apiary with Json
- Re-enable conformance tests for resumable uploads when testbench is fixed
- Cloud strorage v2 API, writeObject missing header x-goog-request-params for client streaming call HOT 9
- Cloud storage v2 API, add support for batch operations HOT 2
- Retrying idempotent requests that return 503 backendError HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from java-storage.