Skip to content

Commit

Permalink
Update release notes for 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
pilgr committed Oct 21, 2017
1 parent 2acb1bc commit 682398d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,20 @@
Change Log
==========

Version 2.6 *(2017-10-21)*
----------------------------

New API:
* `Paper.bookOn(path)` to set custom storage location;
* `book.getPath()` or `book.getPath(key)` to get path for content of book or key.

Improvements:
* simultaneous read/write for different keys, up to 97% performance gain per thread.
* name change: use `book.contains(key)` instead of deprecated `book.exist(key)`

Thanks [@hiperioncn](https://github.com/hiperioncn) and [cezar-carneiro](https://github.com/cezar-carneiro) for your contribution!


Version 2.5 *(2017-09-21)*
----------------------------

Expand Down
29 changes: 16 additions & 13 deletions README.md
Expand Up @@ -5,18 +5,21 @@ Paper is a [fast](#benchmark-results) NoSQL-like storage for Java/Kotlin objects

![Paper icon](/paper_icon.png)

### What's [new](/CHANGELOG.md) in 2.5
*
Thanks [@hiperioncn](https://github.com/hiperioncn) for your contribution!

### What's [new](/CHANGELOG.md) in 2.5
(!) This update contains critical fixes, please update your project ASAP!
* Fixed crash on reading data saved with Paper 1.x.
* Fixed potential data loss on failed read attempt.
### What's [new](/CHANGELOG.md) in 2.6

New API:
* `Paper.bookOn(path)` to set custom storage location;
* `book.getPath()` or `book.getPath(key)` to get path for content of book or key.

Improvements:
* simultaneous read/write for different keys, up to 97% performance gain per thread.
* name change: use `book.contains(key)` instead of deprecated `book.exist(key)`

Thanks [@hiperioncn](https://github.com/hiperioncn) and [cezar-carneiro](https://github.com/cezar-carneiro) for your contribution!

### Add dependency
```groovy
compile 'io.paperdb:paperdb:2.5'
compile 'io.paperdb:paperdb:2.6'
```

### Initialize Paper
Expand All @@ -28,23 +31,23 @@ Paper.init(context);

### Threading
* `Paper.init()` should be called in UI thread;
* All other APIs (`write`, `read` etc.) are thread-safe and obviously must be called outside of UI thread. Since of v2.6 simultaneous reading/writing for different `key`s significantly improves the performance (up to 97% per thread).
* All other APIs (`write`, `read` etc.) are thread-safe and obviously must be called outside of UI thread. Beginning of v2.6 reading/writing for different `key`s done simultaneously.

### Save
Save any object, Map, List, HashMap etc. including all internal objects.
Paper creates separate data file for each key.
Save any object, Map, List, HashMap etc. including all internal objects. Use your existing data classes as is.

```java
List<Person> contacts = ...
Paper.book().write("contacts", contacts);
```

### Read
Read data objects, the instantiated class is exactly the one used to save data. Limited changes to the class structure are handled automatically. See [Handle data class changes](#handle-data-structure-changes).
Read data objects is as easy as

```java
List<Person> = Paper.book().read("contacts");
```
the instantiated class is exactly the one used to save data. Limited changes to the class structure are handled automatically. See [Handle data class changes](#handle-data-structure-changes).

Use default values if object doesn't exist in the storage.

Expand Down

0 comments on commit 682398d

Please sign in to comment.