exceptionfactory commented on code in PR #104:
URL: https://github.com/apache/nifi-api/pull/104#discussion_r3705692409


##########
src/main/java/org/apache/nifi/cluster/coordination/node/NodeConnectionState.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.nifi.cluster.coordination.node;
+
+public enum NodeConnectionState {
+    /**
+     * A node has issued a connection request to the cluster, but has not yet
+     * sent a heartbeat. A connecting node can transition to DISCONNECTED or 
CONNECTED. The cluster
+     * will not accept any external requests to change the flow while any node 
is in
+     * this state.
+     */
+    CONNECTING,
+
+    /**
+     * A node that is connected to the cluster. A connecting node transitions
+     * to connected after the cluster receives the node's first heartbeat. A
+     * connected node can transition to disconnecting.
+     */
+    CONNECTED,
+
+    /**
+     * A node that is in the process of offloading its FlowFiles from the node.
+     */
+    OFFLOADING,
+
+    /**
+     * A node that is in the process of disconnecting from the cluster.
+     * A DISCONNECTING node will always transition to DISCONNECTED.
+     */
+    DISCONNECTING,
+
+    /**
+     * A node that has offloaded its FlowFiles from the node.
+     */
+    OFFLOADED,
+
+    /**
+     * A node that is not connected to the cluster.
+     * A DISCONNECTED node can transition to CONNECTING.
+     */
+    DISCONNECTED,
+
+    /**
+     * A NodeConnectionState of REMOVED indicates that the node was removed 
from the cluster
+     * and is used in order to notify other nodes in the cluster.
+     */
+    REMOVED,
+
+    /**
+     * A NiFi instance that is not configured to participate in a cluster.
+     */
+    STANDALONE
+}

Review Comment:
   A newline should be added



##########
src/test/java/org/apache/nifi/controller/NodeTypeProviderTest.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.nifi.controller;
+
+import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class NodeTypeProviderTest {

Review Comment:
   ```suggestion
   class NodeTypeProviderTest {
   ```



##########
src/test/java/org/apache/nifi/controller/NodeTypeProviderTest.java:
##########
@@ -0,0 +1,42 @@
+/*
+ * 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.nifi.controller;
+
+import org.apache.nifi.cluster.coordination.node.NodeConnectionState;
+import org.junit.jupiter.api.Test;
+
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+public class NodeTypeProviderTest {
+
+    @Test
+    void getNodeConnectionStateReturnsStandaloneForLegacyImplementations() {
+        final NodeTypeProvider nodeTypeProvider = new NodeTypeProvider() {
+            @Override
+            public boolean isClustered() {
+                return false;
+            }
+
+            @Override
+            public boolean isPrimary() {
+                return false;
+            }
+        };
+
+        assertEquals(NodeConnectionState.STANDALONE, 
nodeTypeProvider.getNodeConnectionState());
+    }
+}

Review Comment:
   A new line should be added



##########
src/main/java/org/apache/nifi/cluster/coordination/node/NodeConnectionState.java:
##########
@@ -0,0 +1,68 @@
+/*
+ * 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.nifi.cluster.coordination.node;

Review Comment:
   This conflicts with the existing `enum` in the framework, so it should be 
changed in this pull request to avoid issues when upgrading to this new version.



-- 
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