You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2021/05/21 10:50:10 UTC

[ignite-3] branch ignite-14758 created (now fb265d5)

This is an automated email from the ASF dual-hosted git repository.

agura pushed a change to branch ignite-14758
in repository https://gitbox.apache.org/repos/asf/ignite-3.git.


      at fb265d5  IGNITE-14758 Added messages to asserts in meta storage server implementation.

This branch includes the following new commits:

     new fb265d5  IGNITE-14758 Added messages to asserts in meta storage server implementation.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[ignite-3] 01/01: IGNITE-14758 Added messages to asserts in meta storage server implementation.

Posted by ag...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

agura pushed a commit to branch ignite-14758
in repository https://gitbox.apache.org/repos/asf/ignite-3.git

commit fb265d5e602af3e9e9bbbc11f9f08d99c6813668
Author: Andrey Gura <ag...@apache.org>
AuthorDate: Fri May 21 13:49:34 2021 +0300

    IGNITE-14758 Added messages to asserts in meta storage server implementation.
---
 .../server/SimpleInMemoryKeyValueStorage.java            | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/modules/metastorage-server/src/main/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java b/modules/metastorage-server/src/main/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java
index 901c16b..bab95a8 100644
--- a/modules/metastorage-server/src/main/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java
+++ b/modules/metastorage-server/src/main/java/org/apache/ignite/internal/metastorage/server/SimpleInMemoryKeyValueStorage.java
@@ -285,8 +285,8 @@ public class SimpleInMemoryKeyValueStorage implements KeyValueStorage {
 
     /** {@inheritDoc} */
     @Override public Cursor<WatchEvent> watch(byte[] keyFrom, byte[] keyTo, long rev) {
-        assert keyFrom != null;
-        assert rev > 0;
+        assert keyFrom != null : "keyFrom couldn't be null.";
+        assert rev > 0 : "rev must be positive.";
 
         return new WatchCursor(rev, k ->
             CMP.compare(keyFrom, k) <= 0 && (keyTo == null || CMP.compare(k, keyTo) < 0)
@@ -295,16 +295,16 @@ public class SimpleInMemoryKeyValueStorage implements KeyValueStorage {
 
     /** {@inheritDoc} */
     @Override public Cursor<WatchEvent> watch(byte[] key, long rev) {
-        assert key != null;
-        assert rev > 0;
+        assert key != null : "key couldn't be null.";
+        assert rev > 0 : "rev must be positive.";
 
         return new WatchCursor(rev, k -> CMP.compare(k, key) == 0);
     }
 
     /** {@inheritDoc} */
     @Override public Cursor<WatchEvent> watch(Collection<byte[]> keys, long rev) {
-        assert keys != null && !keys.isEmpty();
-        assert rev > 0;
+        assert keys != null && !keys.isEmpty() : "keys couldn't be null or empty: " + keys;
+        assert rev > 0 : "rev must be positive.";
 
         TreeSet<byte[]> keySet = new TreeSet<>(CMP);
 
@@ -370,7 +370,7 @@ public class SimpleInMemoryKeyValueStorage implements KeyValueStorage {
     private Collection<Entry> doGetAll(List<byte[]> keys, long rev) {
         assert keys != null : "keys list can't be null.";
         assert !keys.isEmpty() : "keys list can't be empty.";
-        assert rev > 0 || rev == LATEST_REV : "Revision must be positive.";
+        assert rev > 0 || rev == LATEST_REV : "Revision must be positive or " + LATEST_REV + '.';
 
         Collection<Entry> res = new ArrayList<>(keys.size());
 
@@ -610,7 +610,7 @@ public class SimpleInMemoryKeyValueStorage implements KeyValueStorage {
                                 List<Long> revs = e.getValue();
 
                                 assert revs != null && !revs.isEmpty() :
-                                        "Revisions should not be empty: [revs=" + revs + ']';
+                                        "Revisions should not be empty or null: [revs=" + revs + ']';
 
                                 long lastRev = maxRevision(revs, rev);