You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/12/03 14:41:04 UTC

[GitHub] [nifi] exceptionfactory commented on a change in pull request #5563: NIFI-9430: Create initial C2 structure, add c2-protocol-api module

exceptionfactory commented on a change in pull request #5563:
URL: https://github.com/apache/nifi/pull/5563#discussion_r761977895



##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;
+
+    @NotBlank
+    private String identifier;
+    // TODO, do we also need identity. e.g., cert DN

Review comment:
       This seems like something that should be tracked elsewhere versus as a TODO.

##########
File path: c2/c2-protocol/c2-protocol-api/pom.xml
##########
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>c2-protocol</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol-api</artifactId>

Review comment:
       Should this be prefixed with `nifi`?
   ```suggestion
       <artifactId>nifi-c2-protocol-api</artifactId>
   ```

##########
File path: c2/pom.xml
##########
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>nifi</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2</artifactId>
+    <packaging>pom</packaging>
+
+    <modules>
+        <module>c2-protocol</module>
+    </modules>
+
+    <dependencyManagement>
+        <dependencies>
+            <dependency>
+                <groupId>org.apache.nifi</groupId>
+                <artifactId>nifi-api</artifactId>
+                <version>1.16.0-SNAPSHOT</version>
+                <scope>provided</scope>
+            </dependency>
+            <dependency>
+                <groupId>javax.validation</groupId>
+                <artifactId>validation-api</artifactId>
+                <version>2.0.1.Final</version>

Review comment:
       With the version defined at this level, it should be possible to remove the version from sub-modules.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/SystemInfo.java
##########
@@ -0,0 +1,137 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+import javax.validation.constraints.DecimalMax;
+import javax.validation.constraints.DecimalMin;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+import java.io.Serializable;
+import java.util.Objects;
+
+@ApiModel
+public class SystemInfo implements Serializable {
+    private static final long serialVersionUID = 830834593998474779L;
+
+    public static final int MACHINE_ARCH_MAX_SIZE = 100;
+    public static final int OS_MAX_SIZE = 100;
+
+    @Size(max = MACHINE_ARCH_MAX_SIZE)
+    @ApiModelProperty("Machine architecture of the device, e.g., ARM, x86")
+    private String machineArch;
+
+    @Size(max = OS_MAX_SIZE)
+    private String operatingSystem;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    @ApiModelProperty(value = "Size of physical memory of the device in bytes", allowableValues = "range[0, 9223372036854775807]")
+    private Long physicalMem;
+
+    @Min(0)
+    @Max(Integer.MAX_VALUE)
+    @ApiModelProperty(
+            value = "Number of virtual cores on the device",
+            name = "vCores",
+            allowableValues = "range[0, 2147483647]")
+    private Integer vCores;

Review comment:
       As mentioned elsewhere, the allowableValues seems to imply that this cannot be null.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentInfo.java
##########
@@ -0,0 +1,88 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.NotBlank;
+
+@ApiModel
+public class AgentInfo implements Serializable {
+    private static final long serialVersionUID = -8812289319080770084L;

Review comment:
       Is there a particular reason that all of these model classes implement `Serializable`?  If that is desired, what do you think about setting the initial `serialVersionUID` to `1` for easier tracking and potential incrementing when the structure changes?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface

Review comment:
       Recommen removing this TODO and tracking as a separate task if a Builder implementation is desired.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositories.java
##########
@@ -0,0 +1,51 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+
+@ApiModel
+public class AgentRepositories implements Serializable {
+    private static final long serialVersionUID = 6350263064169212602L;
+
+    private AgentRepositoryStatus flowfile;
+    private AgentRepositoryStatus provenance;

Review comment:
       Would it be worthwhile to name these properties with `status`?  Such as `provenanceStatus`?

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API

Review comment:
       This fact seems to be implied by the hidden attribute on the ApiModelProperty annotation, is this necessary here?

##########
File path: c2/c2-protocol/pom.xml
##########
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>c2</artifactId>
+        <groupId>org.apache.nifi</groupId>
+        <version>1.16.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>c2-protocol</artifactId>

Review comment:
       Should this be prefixed with `nifi`?
   ```suggestion
       <artifactId>nifi-c2-protocol</artifactId>
   ```

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/NetworkInfo.java
##########
@@ -0,0 +1,69 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Size;
+
+@ApiModel
+public class NetworkInfo implements Serializable {
+    private static final long serialVersionUID = 6574362622904811901L;
+
+    public static final int DEVICE_ID_SIZE = 200;
+    public static final int IP_ADDRESS_MAX_SIZE = 45;

Review comment:
       Is there a particular reason for making these public properties?  If they are intended to be reusable, it seems better to define them using an `enum`, although a static value would still be necessary for the annotation definition.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long sizeMax;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSize;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSizeMax;
+
+    @ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")

Review comment:
       This seems to imply that the values will not be nullable.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/C2Heartbeat.java
##########
@@ -0,0 +1,160 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.xml.bind.annotation.XmlTransient;
+import org.apache.commons.lang3.builder.EqualsBuilder;
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+
+/**
+ * TODO add Builder interface
+ */
+@ApiModel
+public class C2Heartbeat implements Serializable {
+    private static final long serialVersionUID = -1168790962754919591L;
+
+    // Internal, not part of REST API
+    private String identifier;
+    private Long created;

Review comment:
       Is there a reason for using `Long` as opposed to something like `Instant` or `OffsetDateTime`?

##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/diagnostics/bootstrap/tasks/FlowConfigurationDiagnosticTask.java
##########
@@ -52,7 +52,7 @@ public DiagnosticsDumpElement captureDump(final boolean verbose) {
         details.add("Local Input Ports: " + counts.getLocalInputPortCount());
         details.add("Local Output Ports: " + counts.getLocalOutputPortCount());
         details.add("Site-to-Site Input Ports: " + counts.getPublicInputPortCount());
-        details.add("Site-to-Site Input Ports: " + counts.getPublicOutputPortCount());
+        details.add("Site-to-Site Output Ports: " + counts.getPublicOutputPortCount());

Review comment:
       This also appears to be unrelated.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;

Review comment:
       Should these and other numeric values be nullable?  That seems to be contrary to the minimum and maximum constraints.  If they should not be nullable, then they could be changed to `long` primitives.

##########
File path: c2/c2-protocol/c2-protocol-api/src/main/java/org/apache/nifi/c2/protocol/api/AgentRepositoryStatus.java
##########
@@ -0,0 +1,112 @@
+/*
+ * Apache NiFi - MiNiFi
+ * Copyright 2014-2018 The Apache Software Foundation
+ *
+ * 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.c2.protocol.api;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import java.io.Serializable;
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.xml.bind.annotation.XmlTransient;
+
+@ApiModel
+public class AgentRepositoryStatus implements Serializable {
+    private static final long serialVersionUID = 6563881979096175411L;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long size;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long sizeMax;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSize;
+
+    @Min(0)
+    @Max(Long.MAX_VALUE)
+    private Long dataSizeMax;
+
+    @ApiModelProperty(value = "The number of items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSize() {
+        return size;
+    }
+
+    public void setSize(Long size) {
+        this.size = size;
+    }
+
+    @ApiModelProperty(value = "The maximum number of items the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getSizeMax() {
+        return sizeMax;
+    }
+
+    public void setSizeMax(Long sizeMax) {
+        this.sizeMax = sizeMax;
+    }
+
+    @ApiModelProperty(value = "The data size (in Bytes) of all items in the repository", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSize() {
+        return dataSize;
+    }
+
+    public void setDataSize(Long dataSize) {
+        this.dataSize = dataSize;
+    }
+
+    @ApiModelProperty(value = "The maximum data size (in Bytes) that the repository is capable of storing", allowableValues = "range[0, 9223372036854775807]")
+    public Long getDataSizeMax() {
+        return dataSizeMax;
+    }
+
+    public void setDataSizeMax(Long dataSizeMax) {
+        this.dataSizeMax = dataSizeMax;
+    }
+
+    /**
+     * If sizeMax is set, returns a decimal between [0, 1] indicating the ratio
+     * of size to sizeMax.
+     * <p>
+     * If size or sizeMax are null, this method return null.
+     *
+     * @return a decimal between [0, 1] representing the sizeMax utilization percentage
+     */
+    @XmlTransient

Review comment:
       This implies that these classes will be serialized using XML, is that the intent>

##########
File path: nifi-nar-bundles/nifi-extension-utils/nifi-record-utils/nifi-hadoop-record-utils/src/main/java/org/apache/nifi/processors/hadoop/AbstractPutHDFSRecord.java
##########
@@ -279,8 +279,18 @@ public void onTrigger(final ProcessContext context, final ProcessSession session
                 createDirectory(fileSystem, directoryPath, remoteOwner, remoteGroup);
 
                 // write to tempFile first and on success rename to destFile
-                final Path tempFile = new Path(directoryPath, "." + filenameValue);
-                final Path destFile = new Path(directoryPath, filenameValue);
+                final Path tempFile = new Path(directoryPath, "." + filenameValue) {

Review comment:
       This looks like an unrelated change, should it be reverted?




-- 
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: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org