chesnokoff commented on code in PR #355:
URL: https://github.com/apache/ignite-extensions/pull/355#discussion_r3466788461


##########
modules/auto-activation-ext/src/main/java/opt/apache/ignite/activation/ActivateByNodeAttribute.java:
##########
@@ -0,0 +1,48 @@
+package opt.apache.ignite.activation;
+
+import java.util.Collection;
+import java.util.LinkedHashSet;
+import java.util.Set;
+import org.apache.ignite.cluster.ClusterNode;
+import org.apache.ignite.lang.IgnitePredicate;
+
+/**
+ * Activate cluster when nodes with all specified attributes values join 
topology.
+ */
+public class ActivateByNodeAttribute implements 
IgnitePredicate<Collection<ClusterNode>> {
+    /** Node's attribute name. */
+    private final String attrName;
+
+    /** Collection of values for node's attribute. */
+    private final Set<String> requiredValues;
+
+    /**
+     * @param attributeName Node's attribute name.
+     * @param requiredValues List of values for node's attribute.
+     */
+    public ActivateByNodeAttribute(String attributeName, Set<String> 
requiredValues) {
+        if (attributeName == null || attributeName.isBlank())
+            throw new IllegalArgumentException("attributeName must be set");
+
+        if (requiredValues == null || requiredValues.isEmpty())
+            throw new IllegalArgumentException("requiredValues must be set");
+
+        this.attrName = attributeName;
+        this.requiredValues = requiredValues;
+    }
+
+    /** */

Review Comment:
   ```suggestion
       /** {@inheritDoc} */
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to