- [DEPRECATED] This library is end-of-life and no longer supported.
- [DEPRECATED] This library is now deprecated and will be EOL on Dec 31 2021.
- [IMPROVED] Record checkpoint on empty
_changes
result in pull replications. This change optimizes filtered replications when changes in remote database doesn't match the replication filter. - [UPGRADED] Upgraded to version 2.19.0 of the
cloudant-http
library.
- [NEW]
Database
methodsread
,contains
,create
, anddelete
now accept local (non-replicating documents). These documents must have their document ID prefixed with_local/
and must have their revision ID set tonull
(where applicable). - [FIXED] Fixed purge_seq to return a String object when replicating with CouchDB 2.3 databases.
- [NEW] Added API for specifying a list of document IDs in the filtered pull replicator.
- [IMPROVED] Forced a TLS1.2
SSLSocketFactory
where possible on Android API versions < 20 (it is already enabled by default on newer API levels).
- [NEW] Added API for specifying a mango selector in the filtered pull replicator
- [IMPROVED] Improved efficiency of sub-query when picking winning revisions. This improves performance when inserting revisions, including during pull replication.
- [UPGRADED] Upgraded to version 2.12.0 of the
cloudant-http
library.
- [NEW] Added API for upcoming IBM Cloud Identity and Access Management support for Cloudant on IBM Cloud. Note: IAM API key support is not yet enabled in the service.
- [IMPROVED] Updated documentation by replacing deprecated links with the latest Bluemix or CouchDB links.
- [IMPROVED] Added
seq_interval
to improveChanges
API throughput when replicating from a CouchDB 2.x endpoint. - [UPGRADED] Upgraded to version 2.11.0 of the
cloudant-http
library.
- [FIXED] Removed cloudant-sync-datastore-android project dependency on com.google.android:android. This dependency was inadvertently made a run-time dependency where it should have been a build-time dependency.
- [IMPROVED] Increased the resilience of replication to network failures.
- [FIXED] NPE when accessing indexes created in earlier versions that were migrated to version 2.
- [FIXED] Exception fetching attachments on a deleted revision.
- [FIXED] Correctly schedule periodic replications after WiFi connections have been lost.
- [BREAKING CHANGE] With the release of version 2.0 of the library, there are a large number of breaking changes to package names, classes and methods. API users will need to make changes to their existing code in order to use this version of the library. Consult the migration guide for a comprehensive list of changes and suggested strategies to migrate your code.
- [BREAKING CHANGE] The
name
field has been removed fromAttachment
. Additionally, thename
argument has been removed from theUnsavedStreamAttachment
constructors. The name of the attachment is the key used to add or retrieve the attachment to or from the attachments map. - [IMPROVED]
DocumentStore.getInstance()
will try to create all necessary sub-directories in order to construct the path represented by theFile
argument. This differs from the behaviour of the 1.x versions of the library which would only attempt to create one level of directories. - [REMOVED] The
batchLimitPerRun
property has been removed from the Pull and Push replicator builders. There is no limit to the number of batches in a replicator run - the replicator will run to completion unless an error occurs. - [IMPROVED] Removed limitation on
DocumentStore
names. Under the oldDatastore
API, the directory containing the SQLite database had to conform to the CouchDB database name restrictions. This no longer applies. - [NOTE] The "CRUD Guide" markdown document (previously located in
doc/crud.md
) has been migrated to a java source file. - [NEW]
advanced()
getter onDocumentStore
for specialist advanced use cases. Adds support for creating specific document revisions with history. - [FIXED] Issue with double encoding of restricted URL characters in credentials when using
ReplicatorBuilder
. - [FIXED] Issue where push replicating a large number of attachments could exhaust the operating system file handle limit, on some platforms.
- [FIXED] Issue querying indexed fields when combining the
$not
and$size
operators.
- [FIXED] Issue where replicator would not get the latest revision if
_bulk_get
was available.
- [FIXED] Issue performing cookie authentication in version 1.1.3.
- [FIXED] Incorrect message output from parameter
null
or empty checks. - [FIXED] Issue where replications would error if the server returned missing revisions.
- [UPGRADED] Upgraded to version 2.7.0 of the
cloudant-http
library.
- [FIXED] Issue preventing index updates from being persisted that impacted query performance
- [UPGRADED] Upgraded to version 2.6.2 of the
cloudant-http
library. - [REMOVED] Removed com.google.guava:guava:15.0 dependency. Applications may need to update their own dependency tree to include guava if they are using it directly, but were relying on this library to include it.
- [NEW] Updated to version 2.5.1 of the
cloudant-http
library. This includes optional support for handling HTTP status code 429Too Many Requests
with blocking backoff and retries. To enable the backoff add an instance of aReplay429Interceptor
with the desired number of retries and initial backoff:A default instance is available using 3 retries and starting with a 250 ms backoff:builder.addResponseInterceptors(new Replay429Interceptor(retries, initialBackoff));
Replay429Interceptor.WITH_DEFAULTS
- [DEPRECATED]
DatastoreManager
constructors. UseDatastoreManager.getInstance
factory methods instead to guarantee only a singleDatastoreManager
instance is created for a given storage directory path in the scope of theDatastoreManager
class. - [FIX] Corrected a case where two root nodes with identical revision IDs prevented selection of the correct new winning revision.
- [FIX] Added migration on
Datastore
opening to repair datastores with duplicated revisions or attachments caused by an issue when executing concurrent pull replications with the same source and target. Note that in rare circumstances for some documents this may result in a different, but corrected, winning revision after migration. - [FIX] Prevent insertion of multiple revisions with the same document
ID and revision ID. Previously this could occur when executing
concurrent pull replications with the same source and target. A
replication encountering this condition will now terminate in the
ERROR
state. - [NOTE] Due to migrations outlined above, the first time an existing
Datastore
is opened with this version of the library, users may experience a longer than usual delay before theDatastore
is ready.
- [NOTE] This library follows the Semantic Versioning 2.0.0 specification. To support this we now explicitly declare which parts of the library form the "public API" (see below). Subsequent version numbers will reflect the compatibility status of API changes.
- [IMPROVED] Javadoc output now shows "API Status" of "Public" or "Private" for each class. See the last paragraph of this section of the README for more details.
- [NEW] Added filtering for push replications.
- [BREAKING CHANGE] The
EventBus
APIs have been changed from the Google Guava (com.google.common.eventbus
) to our owncom.cloudant.sync.event
API. The new implementation has increased restrictions on visibility of@Subscribe
annotated methods. See the Event guide and javadoc for details. - [BREAKING CHANGE] The
BasicDocumentRevision
andMutableDocumentRevision
classes have been removed, in order to simplify use of API methods. All code using this library will need to be updated to use theDocumentRevision
class. See the updated CRUD guide for examples of how to use this class. - [BREAKING CHANGE] Index type is now defined as an enum. This affects
the following APIs:
Index#getInstance
IndexManger#ensureIndexed
- [BREAKING CHANGE] Creation of replication policies made easier where credentials for replicators need to be retrieved asynchronously.
- [BREAKING CHANGE] The
DatastoreExtended
interface has been removed. - [BREAKING CHANGE] Some internal classes have been renamed. Code relying on these classes will no longer compile.
- [FIXED] Issue where
java.lang.RuntimeException: Offer timed out
could be thrown 5 minutes after a replication error.
- [IMPROVED] Optimise pull replication performance. This is achieved by reducing excessive database traffic and batching up insertions in one SQL transaction.
- [FIXED] Issue where
java.lang.RuntimeException: Offer timed out
could be thrown 5 minutes after stopping a replication.
- [REVERT] Revert replication optimisations which caused updated revisions to be inserted as new documents
- [IMPROVED] Optimise pull replication performance. This is achieved by reducing excessive database traffic and batching up insertions in one SQL transaction.
- [IMPROVED] Use system
http
keepalive
default value. This was previously set tofalse
. In most circumstances, and especially withhttps
connections, this will improve replication time. The default value can be over-ridden by setting the property before making any replication requests, eg:System.setProperty("http.keepAlive", "false");
- [IMPROVED] Increase default
insertBatchSize
values for replication. Pull replications from databases which support the_bulk_get
endpoint will see an improvement in performance.
-
[BREAKING CHANGE] Removed the following classes:
- PushConfiguration
- PullConfiguration
- PushReplication
- PullReplication
- Replication
- ReplicatorFactory
These removals simplify configuration of replicators. This configuration functionality has been migrated to the
ReplicatorBuilder
class.
- [BREAKING CHANGE] Removed
setCustomHeaders
fromCouchConfig
. See Http Interceptors for a code sample which shows how to add custom request headers using an HTTP Request Interceptor. - [NEW] Added replication policies, allowing users to easily create policies such as "Replicate every 2 hours, only when on Wifi". See the Replication Policies User Guide.
- [IMPROVED] Replication reliability when transferring data over unreliable networks.
- [FIXED] Issue where HTTP Interceptors would not be executed for
_revs_diff
requests.
- [FIXED] Issue where the
ReplicatorBuilder
would not handle HTTP interceptors correctly for push replications.
- [FIXED] Issue where document IDs containing colons were not properly encoded during replication
- [FIXED] Fix issue where the
ReplictorBuilder
would crash the application when creating a pull replication ifPullFilter
isnull
.
- [BREAKING CHANGE] Moved code for encryption on Android to the
sync-android-encryption
subproject. See the instructions in the README file for how to includesync-android-encryption
in your project. - [BREAKING CHANGE] Removed Configuration options from
CouchConfig
which are not used by the HTTP Layer. See commit 815026c for details. - [FIX] Fixed issue where at least one index had to be created before a query would execute.
You can now query for documents without the existence of any indexes. - [NEW] New fields
documentsReplicated
andbatchesReplicated
added to ReplicationCompleted class - [NEW] New
ReplicatorBuilder
API. This should be used to create replications in the future. - [NEW] HTTP Interceptor API. See Http Interceptors for details.
- [DEPRECATED] Deprecated the following classes:
ReplicatorFactory
,Replication
,PullReplication
andPushReplication
.
- [FIXED] Fixed issue with the encoding of local document URIs
- [FIXED] Fixed issue where sync-android would select a different winning revision than CouchDB for the same revision tree.
- [NEW] Added query support for the
$mod
operator. - [NEW] Added query support for the
$size
operator. - [NEW] Added CachingKeyProvider, which can be used to improve performance in some situations.
- [FIXED] Fixed issue where documents with an empty array value would not be indexed
- [FIXED] Fixed issue where AES encryption keys were not created correctly on android lower than API level 19
- [FIX] Fixed issue where Base64 encoded strings for HTTP basic authentication could contain line breaks.
- [FIX] Custom headers set by overriding getCouchConfig in Replication classes were not set on HTTP requests
- [NEW] Encryption of all data is now supported using 256-bit AES: JSON documents, Query indexes and attachments. See encryption documentation for details.
- [NEW] Added query text search support. See query documentation for details.
- [NEW] Use HttpURLConnection instead of Apache HttpClient to significantly reduce dependency footprint.
- [FIX] Fix issues with database compaction.
- [FIX] Fixed encoding of
+
characters in query strings. - [REMOVED] Removed
oneway
methods from ReplicatorFactory. Users should use the method described in the replication documentation instead. - [NEW] Added query support for the
$mod
operator.
- [FIX] Using MongoDB query as the "gold" standard, query support for
NOT
has been fixed to return result sets correctly (as in MongoDB query). Previously, the result set from a query like{ "pet": { "$not" { "$eq": "dog" } } }
would include a document like{ "pet" : [ "cat", "dog" ], ... }
because the array contains an object that isn'tdog
. The new behavior is that$not
now inverts the result set, so this document will no longer be included because it has an array element that matchesdog
. - [BREAKING CHANGE] Changed local document APIs. createLocalDocument and updateLocalDocument have been removed and replaced by insertLocalDocument. The return type of getLocalDocument has been changed to LocalDocument.
- [NEW] getVersion API added to SQLDatabaseQueue
- [NEW] Datastore will not be created if the database version is not supported by the version of the library opening it.
- [REMOVED] Removed legacy indexing/query code. Users should instead use the new Cloudant Query - Mobile functionality. A migration document exists for users that need to transition from the legacy implementation to the new one.
- [FIX] Fix attachment handling error which could cause push replications to fail in some circumstances
- [NEW] Added
listAllDatastores
method toDatastoreManager
. - [BREAKING CHANGE] Introduce Checked exceptions for recoverable error conditions, these new checked exceptions are on the Datastore interface and its implementing classes. See the commit for more infomation.
- [FIX] Support CouchDB 2.0/Cloudant Local's array-based sequence number format to fix replication between the local database and these remote servers.
- [FIX] Fixed issue where the path portion for remote database URLs were incorrectly encoded if there was more than one path segment.
- [IMPROVED] SQLite connections are now reused across threads by
using a serial queue to enforce isolation. This should be more
robust and allows us to properly implement the
close()
method on a datastore. - [REMOVED] Removed username and password from
PullReplication
andPushReplication
. Users should set their password in the source or destnation URL. - [REMOVED] Removed allDbs() from Mazha CouchClient.
- [FIX] Fixed issue where slashes were disallowed for replication.
- [FIX] Fixed issue where deleted documents were returned for conflicts.
- [NEW] Added compact API.
- [FIX] Fixed a build issue with 0.9.1. The jars for 0.9.1 were built incorrectly, causing Android users to experience the error 'Error:duplicate files during packaging of APK'
- [Upgraded] Upgraded SQLite4java to version 1.0.392
- [FIX] Fixed issue where resurrected documents where handled in correctly
- [FIX] Fixed dataloss issue where conflicted document attachments were lost
- [REMOVED] Removed deprecated APIs
- [REMOVED] Removed TypedDatastore class
- [FIX] Fixed issue where some cursors were left open
- [FIX] Fixed issue where regexp for database names was too restrictive
- [FIX] Fixed indexmanager bug which prevented fields with certain names being indexed
- [FIX] Fixed issues where sqlite connections were not being closed correctly
- [NEW] Added proguard example configuration file
- [NEW] A new CRUD and Attachments API has been introduced. See doc/crud.md for details, along with a cookbook on using the new API.
- [DEPRECATED] Some existing attachments and CRUD APIs have been deprecated and marked with the @Deprecated annotation. These will be removed before version 1.0.
- [FIX] Conflict resolution has been enhanced. The revision tree is
now properly preserved, whereas previously a new revision was always
created even if this was not necessary. Additionally,
ConflictResolver
s can returnMutableDocumentRevision
s. See doc/conflicts.md for details.
- [NEW] Separate builds for Android and standard Java. The library is now distributed as 3 jars: 1 core jar, a Java SE-specific jar and an Android-specific jar.
- [FIX] Always send basic authentication instead of waiting for a 401 challenge on each request.
- [FIX] Fix possible crash when calling updateAllIndexes.
- [FIX] Fix replication of design documents.
- [BETA] Add API to Datastore for handling attachments. See javadoc and code for BasicDatastore *Attachment methods. This feature is in beta and the API will be changed in the near future.
- [FIX] Update indexes at query time. Previously indexes were updated each time a document was created or modified, which was inefficient.
- [FIX] Fix some SQLite multi-threading issues.
- [FIX] Update indexes automatically after documents in the datastore are changed, including during pull replication.
- [FIX] Fix #17 where requests were failing because we couldn't load mazha.properties.
- [FIX] Remove classes from public API which don't need to be there.
- [FIX] Update documentation around replication to account for filters.
- [NEW] Add options to pull replication (remote -> local) to support filtered
replications. This required changing the way replications are defined:
- There are new classes containing the configuration of pull and push
replications, and a new
ReplicatorFactory
method which uses them. - The
ReplicatorFactory.oneway(source,target)
methods have been deprecated in favour of a method taking a fuller suite of replication options. They will be removed in a future version.
- There are new classes containing the configuration of pull and push
replications, and a new
- Fix issue initialising datastores on certain Android versions.
- Add user-agent to the calls Cloudant Sync makes while replicating.
- Change min/max query to use inclusive ranges.
- Update gradle wrapper for sample app to require gradle 1.8.
- Add indexing and query functionality.
- Ability to find and resolve conflicts.
- Add notification events for datastore and document changes.
- Merge mazha into main codebase, as com.cloudant.mazha.
- Initial release.
- Replication.
- CRUD.