ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [01/26] ignite git commit: IGNITE-2926: WIP.
Date Wed, 20 Apr 2016 07:12:06 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-2523-1 [created] 7f993fa22


IGNITE-2926: WIP.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/9ea980a5
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/9ea980a5
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/9ea980a5

Branch: refs/heads/ignite-2523-1
Commit: 9ea980a5e5b1ada745f860c66e66017aa34fe561
Parents: b024235
Author: vozerov-gridgain <vozerov@gridgain.com>
Authored: Thu Apr 14 12:50:25 2016 +0300
Committer: vozerov-gridgain <vozerov@gridgain.com>
Committed: Thu Apr 14 12:50:25 2016 +0300

----------------------------------------------------------------------
 .../processors/cache/CacheOperationFilter.java  | 61 ++++++++++++++++++++
 1 file changed, 61 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9ea980a5/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationFilter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationFilter.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationFilter.java
new file mode 100644
index 0000000..9a92e1e
--- /dev/null
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/CacheOperationFilter.java
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.ignite.internal.processors.cache;
+
+import org.jetbrains.annotations.Nullable;
+
+/**
+ * Cache operation filter.
+ */
+public enum CacheOperationFilter {
+    /** Always pass. */
+    ALWAYS,
+
+    /** No value. */
+    NO_VAL,
+
+    /** Has value. */
+    HAS_VAL,
+
+    /** Equals to value. */
+    EQUALS_VAL;
+
+    /**
+     * Creare predicate from operation filter.
+     *
+     * @param val Optional value.
+     * @return Predicate.
+     */
+    @Nullable public CacheEntryPredicate createPredicate(@Nullable CacheObject val) {
+        switch (this) {
+            case ALWAYS:
+                return null;
+
+            case NO_VAL:
+                return new CacheEntrySerializablePredicate(new CacheEntryPredicateNoValue());
+
+            case HAS_VAL:
+                return new CacheEntrySerializablePredicate(new CacheEntryPredicateHasValue());
+
+            default:
+                assert this == EQUALS_VAL;
+
+                return new CacheEntryPredicateContainsValue(val);
+        }
+    }
+}


Mime
View raw message