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/03/10 15:50:14 UTC

[GitHub] [nifi] SebastianKenter78 opened a new pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

SebastianKenter78 opened a new pull request #4884:
URL: https://github.com/apache/nifi/pull/4884


   …e ADX cluster.
   
   Thank you for submitting a contribution to Apache NiFi.
   
   Please provide a short description of the PR here:
   
   #### Description of PR
   
   This processor and service enable NiFi to send flowfile content of different formats to an Azure ADX cluster directly.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [x ] Is there a JIRA ticket associated with this PR? Is it referenced 
        in the commit message?
   
   - [x] Does your PR title start with **NIFI-XXXX** where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
   
   - [x] Has your PR been rebased against the latest commit within the target branch (typically `main`)?
   
   - [ ] Is your initial contribution a single, squashed commit? _Additional commits in response to PR reviewer feedback should be made on this branch and pushed to allow change tracking. Do not `squash` or use `--force` when pushing to allow for clean monitoring of changes._
   
   ### For code changes:
   - [x] Have you ensured that the full suite of tests is executed via `mvn -Pcontrib-check clean install` at the root `nifi` folder?
   - [x] Have you written or updated unit tests to verify your changes?
   - [ ] Have you verified that the full build is successful on JDK 8?
   - [x] Have you verified that the full build is successful on JDK 11?
   - [x] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? 
   - [ ] If applicable, have you updated the `LICENSE` file, including the main `LICENSE` file under `nifi-assembly`?
   - [ ] If applicable, have you updated the `NOTICE` file, including the main `NOTICE` file found under `nifi-assembly`?
   - [x] If adding new Properties, have you added `.displayName` in addition to .name (programmatic access) for each of the new properties?
   
   ### For documentation related changes:
   - [x] Have you ensured that format looks appropriate for the output in which it is rendered?
   
   ### Note:
   Please ensure that once the PR is submitted, you check GitHub Actions CI for build issues and submit an update to your PR as soon as possible.


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

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



[GitHub] [nifi] cosh commented on pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
cosh commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-826859031


   Hi @sjyang18 ,
   
   may I ask what's missing for this PR to be merged? the failing Ubuntu test failed because of another component which is not related to this functionality. Please clarify. thx.
   
   Cheers,


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

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



[GitHub] [nifi] sjyang18 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591742467



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})

Review comment:
       example?

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})
+@CapabilityDescription("Example Service API.")

Review comment:
       meaningful capability description?




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

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



[GitHub] [nifi] minwal commented on pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
minwal commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-962556554


   @markap14 - can you please help to merge this long pending PR or let us know if anything is required to be fixed? Some of our(Microsoft) customers have been waiting for this change to be merged.


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



[GitHub] [nifi] github-actions[bot] closed pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] closed pull request #4884:
URL: https://github.com/apache/nifi/pull/4884


   


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



[GitHub] [nifi] sjyang18 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591742467



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})

Review comment:
       example?




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

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



[GitHub] [nifi] sjyang18 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591748533



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-processors/src/test/java/org/sebkenter/nifi/processors/adx/AzureAdxIngestProcessorTest.java
##########
@@ -0,0 +1,39 @@
+/*
+ * 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.sebkenter.nifi.processors.adx;
+
+import org.apache.nifi.util.TestRunner;
+import org.apache.nifi.util.TestRunners;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class AzureAdxIngestProcessorTest {
+
+    private TestRunner testRunner;
+
+    @Before
+    public void init() {
+        testRunner = TestRunners.newTestRunner(AzureAdxIngestProcessor.class);
+    }
+
+    @Test
+    public void testProcessor() {
+

Review comment:
       any test here?




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

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



[GitHub] [nifi] cosh commented on pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
cosh commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-837091742


   Hi @sjyang18 -> kind ping :)


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

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



[GitHub] [nifi] sjyang18 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591753383



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})
+@CapabilityDescription("Example Service API.")
+public interface AdxConnectionService extends ControllerService {

Review comment:
       meaningful capability

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
##########
@@ -0,0 +1,15 @@
+# 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.
+org.sebkenter.nifi.processors.adx.AzureAdxIngestProcessor

Review comment:
       new line at the end of a file

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})

Review comment:
       meaningful tags ?

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx/src/main/java/org/sebkenter/nifi/adx/AzureAdxConnectionService.java
##########
@@ -0,0 +1,167 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.microsoft.azure.kusto.data.ConnectionStringBuilder;
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import com.microsoft.azure.kusto.ingest.IngestClientFactory;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnDisabled;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.reporting.InitializationException;
+
+@Tags({ "Azure", "ADX", "Kusto", "ingest", "azure"})
+@CapabilityDescription("Sends batches of flowfile content to an azure adx cluster.")
+public class AzureAdxConnectionService extends AbstractControllerService implements AdxConnectionService {
+
+    public static final PropertyDescriptor INGEST_URL = new PropertyDescriptor
+            .Builder().name("INGEST_URL")
+            .displayName("Ingest URL")
+            .description("URL of the ingestion endpoint of the azure data explorer cluster.")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .addValidator(StandardValidators.URL_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_ID = new PropertyDescriptor
+            .Builder().name("APP_ID")
+            .displayName("Application ID")
+            .description("Azure application ID for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_KEY = new PropertyDescriptor
+            .Builder().name("APP_KEY")
+            .displayName("Application KEY")
+            .description("Azure application ID Key for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_TENANT = new PropertyDescriptor
+            .Builder().name("APP_TENANT")
+            .displayName("Application Tenant")
+            .description("Azure application tenant for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    private static final List<PropertyDescriptor> properties;
+
+    static {
+        final List<PropertyDescriptor> props = new ArrayList<>();
+        props.add(INGEST_URL);
+        props.add(APP_ID);
+        props.add(APP_KEY);
+        props.add(APP_TENANT);
+        properties = Collections.unmodifiableList(props);
+    }
+
+    private IngestClient _ingestClient;
+
+    @Override
+    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+        return properties;
+    }
+
+    /**
+     * @param context
+     *            the configuration context
+     * @throws InitializationException
+     *             if unable to create a database connection
+     */
+    @OnEnabled
+    public void onEnabled(final ConfigurationContext context) throws InitializationException {
+        ComponentLog log = getLogger();
+
+        log.info("Starting Azure ADX Connection Service...");
+
+        final String ingestUrl = context.getProperty(INGEST_URL).evaluateAttributeExpressions().getValue();
+        final String app_id = context.getProperty(APP_ID).evaluateAttributeExpressions().getValue();
+        final String app_key = context.getProperty(APP_KEY).evaluateAttributeExpressions().getValue();
+        final String app_tenant = context.getProperty(APP_TENANT).evaluateAttributeExpressions().getValue();
+
+        if(this._ingestClient != null) {
+            onStopped();
+        }
+
+        this._ingestClient = createAdxClient(ingestUrl, app_id, app_key, app_tenant);
+    }
+
+    @OnStopped
+    public final void onStopped() {
+        if (this._ingestClient != null) {
+            try {
+                this._ingestClient.close();
+            } catch(IOException e) {
+                getLogger().error("Closing Azure ADX Client failed with: " + e.getMessage(), e);
+            } finally {
+                this._ingestClient = null;
+            }
+        }
+    }
+
+    @OnDisabled
+    public void shutdown() {
+
+    }
+
+    @Override
+    public void execute() throws ProcessException {
+
+    }
+
+    protected IngestClient createAdxClient(String ingestUrl, String appId, String appKey, String appTenant)
+    {
+        IngestClient client;
+
+        try {
+            ConnectionStringBuilder csb =
+                    ConnectionStringBuilder.createWithAadApplicationCredentials(ingestUrl, appId, appKey, appTenant);
+
+            try {

Review comment:
       do we need a nested try clause?




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

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



[GitHub] [nifi] sjyang18 commented on pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-795818840


   any plan to move this PR under nifi-azure-bundle?


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

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



[GitHub] [nifi] SebastianKenter78 commented on pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
SebastianKenter78 commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-795838337


   @sjyang18 : Sorry for the bad documentation there - will update soon. Yeah why not move it under nifi-azure-bundle. Targets the same topic. I will commit an update later.


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

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



[GitHub] [nifi] SebastianKenter78 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
SebastianKenter78 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591783237



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx/src/main/java/org/sebkenter/nifi/adx/AzureAdxConnectionService.java
##########
@@ -0,0 +1,167 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import com.microsoft.azure.kusto.data.ConnectionStringBuilder;
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import com.microsoft.azure.kusto.ingest.IngestClientFactory;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.annotation.lifecycle.OnDisabled;
+import org.apache.nifi.annotation.lifecycle.OnEnabled;
+import org.apache.nifi.annotation.lifecycle.OnStopped;
+import org.apache.nifi.components.PropertyDescriptor;
+import org.apache.nifi.controller.AbstractControllerService;
+import org.apache.nifi.controller.ConfigurationContext;
+import org.apache.nifi.logging.ComponentLog;
+import org.apache.nifi.processor.exception.ProcessException;
+import org.apache.nifi.processor.util.StandardValidators;
+import org.apache.nifi.reporting.InitializationException;
+
+@Tags({ "Azure", "ADX", "Kusto", "ingest", "azure"})
+@CapabilityDescription("Sends batches of flowfile content to an azure adx cluster.")
+public class AzureAdxConnectionService extends AbstractControllerService implements AdxConnectionService {
+
+    public static final PropertyDescriptor INGEST_URL = new PropertyDescriptor
+            .Builder().name("INGEST_URL")
+            .displayName("Ingest URL")
+            .description("URL of the ingestion endpoint of the azure data explorer cluster.")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .addValidator(StandardValidators.URL_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_ID = new PropertyDescriptor
+            .Builder().name("APP_ID")
+            .displayName("Application ID")
+            .description("Azure application ID for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_KEY = new PropertyDescriptor
+            .Builder().name("APP_KEY")
+            .displayName("Application KEY")
+            .description("Azure application ID Key for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    public static final PropertyDescriptor APP_TENANT = new PropertyDescriptor
+            .Builder().name("APP_TENANT")
+            .displayName("Application Tenant")
+            .description("Azure application tenant for accessing the ADX-Cluster")
+            .required(true)
+            .addValidator(StandardValidators.NON_EMPTY_VALIDATOR)
+            .build();
+
+    private static final List<PropertyDescriptor> properties;
+
+    static {
+        final List<PropertyDescriptor> props = new ArrayList<>();
+        props.add(INGEST_URL);
+        props.add(APP_ID);
+        props.add(APP_KEY);
+        props.add(APP_TENANT);
+        properties = Collections.unmodifiableList(props);
+    }
+
+    private IngestClient _ingestClient;
+
+    @Override
+    protected List<PropertyDescriptor> getSupportedPropertyDescriptors() {
+        return properties;
+    }
+
+    /**
+     * @param context
+     *            the configuration context
+     * @throws InitializationException
+     *             if unable to create a database connection
+     */
+    @OnEnabled
+    public void onEnabled(final ConfigurationContext context) throws InitializationException {
+        ComponentLog log = getLogger();
+
+        log.info("Starting Azure ADX Connection Service...");
+
+        final String ingestUrl = context.getProperty(INGEST_URL).evaluateAttributeExpressions().getValue();
+        final String app_id = context.getProperty(APP_ID).evaluateAttributeExpressions().getValue();
+        final String app_key = context.getProperty(APP_KEY).evaluateAttributeExpressions().getValue();
+        final String app_tenant = context.getProperty(APP_TENANT).evaluateAttributeExpressions().getValue();
+
+        if(this._ingestClient != null) {
+            onStopped();
+        }
+
+        this._ingestClient = createAdxClient(ingestUrl, app_id, app_key, app_tenant);
+    }
+
+    @OnStopped
+    public final void onStopped() {
+        if (this._ingestClient != null) {
+            try {
+                this._ingestClient.close();
+            } catch(IOException e) {
+                getLogger().error("Closing Azure ADX Client failed with: " + e.getMessage(), e);
+            } finally {
+                this._ingestClient = null;
+            }
+        }
+    }
+
+    @OnDisabled
+    public void shutdown() {
+
+    }
+
+    @Override
+    public void execute() throws ProcessException {
+
+    }
+
+    protected IngestClient createAdxClient(String ingestUrl, String appId, String appKey, String appTenant)
+    {
+        IngestClient client;
+
+        try {
+            ConnectionStringBuilder csb =
+                    ConnectionStringBuilder.createWithAadApplicationCredentials(ingestUrl, appId, appKey, appTenant);
+
+            try {

Review comment:
       Perhaps we don't need that. I took it from the azure-kusto-java sample for file ingestions: https://github.com/Azure/azure-kusto-java/blob/master/samples/src/main/java/FileIngestion.java




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

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



[GitHub] [nifi] sjyang18 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
sjyang18 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r591742822



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})
+@CapabilityDescription("Example Service API.")

Review comment:
       meaningful capability description?




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

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



[GitHub] [nifi] vladikbr commented on a change in pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
vladikbr commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r674554228



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/pom.xml
##########
@@ -0,0 +1,72 @@
+<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <groupId>org.apache.nifi</groupId>
+        <artifactId>nifi-adx-bundle</artifactId>
+        <version>1.14.0-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>nifi-adx-api</artifactId>
+    <packaging>jar</packaging>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.nifi</groupId>
+            <artifactId>nifi-api</artifactId>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.microsoft.azure.kusto</groupId>
+            <artifactId>kusto-ingest</artifactId>
+            <version>2.4.1</version>

Review comment:
       Please update Kusto SDK to 2.8.2 (https://github.com/Azure/azure-kusto-java/releases/tag/v2.8.2)




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



[GitHub] [nifi] SebastianKenter78 commented on a change in pull request #4884: **NIFI-8294** Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
SebastianKenter78 commented on a change in pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#discussion_r592252223



##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-processors/src/main/resources/META-INF/services/org.apache.nifi.processor.Processor
##########
@@ -0,0 +1,15 @@
+# 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.
+org.sebkenter.nifi.processors.adx.AzureAdxIngestProcessor

Review comment:
       Corrected in the newest commit.

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})

Review comment:
       Corrected in the newest commit.

##########
File path: nifi-nar-bundles/nifi-adx-bundle/nifi-adx-api/src/main/java/org/sebkenter/nifi/adx/AdxConnectionService.java
##########
@@ -0,0 +1,32 @@
+/*
+ * 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.sebkenter.nifi.adx;
+
+import com.microsoft.azure.kusto.ingest.IngestClient;
+import org.apache.nifi.annotation.documentation.CapabilityDescription;
+import org.apache.nifi.annotation.documentation.Tags;
+import org.apache.nifi.controller.ControllerService;
+import org.apache.nifi.processor.exception.ProcessException;
+
+@Tags({"example"})
+@CapabilityDescription("Example Service API.")
+public interface AdxConnectionService extends ControllerService {

Review comment:
       Corrected in the newest commit.




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

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



[GitHub] [nifi] github-actions[bot] commented on pull request #4884: NIFI-8294 - Functional processor and service for sending flowfile content to Azur…

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on pull request #4884:
URL: https://github.com/apache/nifi/pull/4884#issuecomment-1062416226


   We're marking this PR as stale due to lack of updates in the past few months. If after another couple of weeks the stale label has not been removed this PR will be closed. This stale marker and eventual auto close does not indicate a judgement of the PR just lack of reviewer bandwidth and helps us keep the PR queue more manageable.  If you would like this PR re-opened you can do so and a committer can remove the stale tag.  Or you can open a new PR.  Try to help review other PRs to increase PR review bandwidth which in turn helps yours.


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