exceptionfactory commented on code in PR #8210:
URL: https://github.com/apache/nifi/pull/8210#discussion_r1446192700
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/shared/azure/eventhubs/AzureEventHubTransportType.java:
##########
@@ -16,23 +16,24 @@
*/
package org.apache.nifi.shared.azure.eventhubs;
+import com.azure.core.amqp.AmqpTransportType;
import org.apache.nifi.components.DescribedValue;
/**
* Azure Event Hubs Transport Type allowable values based on AmqpTransportType
values from the Azure SDK
*/
public enum AzureEventHubTransportType implements DescribedValue {
- AMQP("Amqp", "AMQP over TCP on ports 5671 and 5672"),
-
- AMQP_WEB_SOCKETS("AmqpWebSockets", "AMQP over HTTPS with WebSockets on
port 443");
+ AMQP("Amqp", "AMQP over TCP on ports 5671 and 5672",
AmqpTransportType.AMQP),
+ AMQP_WEB_SOCKETS("AmqpWebSockets", "AMQP over HTTPS with WebSockets on
port 443", AmqpTransportType.AMQP_WEB_SOCKETS);
private final String value;
-
private final String description;
+ private final AmqpTransportType azureType;
Review Comment:
This should be renamed to match the type `amqpTransportType`.
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/shared/azure/eventhubs/AzureEventHubTransportType.java:
##########
@@ -16,23 +16,24 @@
*/
package org.apache.nifi.shared.azure.eventhubs;
+import com.azure.core.amqp.AmqpTransportType;
import org.apache.nifi.components.DescribedValue;
/**
* Azure Event Hubs Transport Type allowable values based on AmqpTransportType
values from the Azure SDK
*/
public enum AzureEventHubTransportType implements DescribedValue {
- AMQP("Amqp", "AMQP over TCP on ports 5671 and 5672"),
-
- AMQP_WEB_SOCKETS("AmqpWebSockets", "AMQP over HTTPS with WebSockets on
port 443");
+ AMQP("Amqp", "AMQP over TCP on ports 5671 and 5672",
AmqpTransportType.AMQP),
+ AMQP_WEB_SOCKETS("AmqpWebSockets", "AMQP over HTTPS with WebSockets on
port 443", AmqpTransportType.AMQP_WEB_SOCKETS);
private final String value;
-
private final String description;
+ private final AmqpTransportType azureType;
- AzureEventHubTransportType(final String value, final String description) {
+ AzureEventHubTransportType(final String value, final String description,
final AmqpTransportType azureType) {
Review Comment:
This enum is intentionally loosely associated to the `AmqpTransportType`,
but introducing this direct connection seems useful, I would just recommend
changing the property name to match the type name.
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/MetricsBuilder.java:
##########
@@ -191,5 +154,20 @@ public String getTags() {
return this.tags;
}
-
+ private Metric buildMetric(String metricName) {
+ final Metric metric;
+ if(isProcessorMetric) {
Review Comment:
Spacing:
```suggestion
if (isProcessorMetric) {
```
##########
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-reporting-task/src/main/java/org/apache/nifi/reporting/azure/loganalytics/MetricsBuilder.java:
##########
@@ -191,5 +154,20 @@ public String getTags() {
return this.tags;
}
-
+ private Metric buildMetric(String metricName) {
+ final Metric metric;
+ if(isProcessorMetric) {
+ metric = new Metric(this.computer, this.processGroupId,
this.processGroupName);
+ metric.setProcessorId(this.processorId);
+ metric.setProcessorName(this.processorName);
+ } else {
+ metric = new Metric(this.computer, this.processGroupId,
this.processGroupName);
+ }
+ metric.setCategoryName(this.categoryName);
+ metric.setName(metricName);
+ if(this.tags != null) {
Review Comment:
```suggestion
if (this.tags != null) {
```
--
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]