Features
Core
Clock abstract class is moved out of ServiceOptions. ServiceOptions.clock() is now used by RetryHelper in all service calls. This enables mocking the Clock source used for retries when testing your code.
Storage
- Refactor storage batches to use the common
BatchResult class. Sending batch requests in Storage is now as simple as in DNS. See the following example of sending a batch request:
StorageBatch batch = storage.batch();
BlobId firstBlob = BlobId.of("bucket", "blob1");
BlobId secondBlob = BlobId.of("bucket", "blob2");
BlobId thirdBlob = BlobId.of("bucket", "blob3");
// Users can either register a callback on an operation
batch.delete(firstBlob).notify(new BatchResult.Callback<Boolean, StorageException>() {
@Override
public void success(Boolean result) {
// handle delete result
}
@Override
public void error(StorageException exception) {
// handle exception
}
});
// Ignore its result
batch.update(BlobInfo.builder(secondBlob).contentType("text/plain").build());
StorageBatchResult<Blob> result = batch.get(thirdBlob);
batch.submit();
// Or get the result
Blob blob = result.get(); // returns the operation's result or throws StorageException
Fixes
Datastore
- Update datastore client to accept IP addresses for localhost (#1002).
LocalDatastoreHelper now uses https to download the emulator - thanks to @pehrs (#942).
- Add example on embedded entities to
DatastoreExample (#980).
Storage
- Fix
StorageImpl.signUrl for blob names that start with "/" - thanks to @clementdenis (#1013).
- Fix
readAllBytes permission error on Google AppEngine (#1010).