forked from apache/nifi
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NIFI-10752: Add Couchbase 3.x components
- Loading branch information
Showing
32 changed files
with
3,400 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
nifi-extension-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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-couchbase-bundle</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>nifi-couchbase-nar</artifactId> | ||
<packaging>nar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-couchbase-services-api-nar</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
<type>nar</type> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-couchbase-processors</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
</dependencies> | ||
</project> |
30 changes: 30 additions & 0 deletions
30
...nsion-bundles/nifi-couchbase-bundle/nifi-couchbase-nar/src/main/resources/META-INF/NOTICE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
nifi-couchbase-nar | ||
Copyright 2014-2024 The Apache Software Foundation | ||
|
||
This product includes software developed at | ||
The Apache Software Foundation (http://www.apache.org/). | ||
|
||
****************** | ||
Apache Software License v2 | ||
****************** | ||
|
||
The following binary components are provided under the Apache Software License v2 | ||
|
||
(ASLv2) Couchbase Java SDK | ||
The following NOTICE information applies: | ||
Couchbase Java SDK | ||
Copyright 2014 Couchbase, Inc. | ||
|
||
(ASLv2) RxJava | ||
The following NOTICE information applies: | ||
Couchbase Java SDK | ||
Copyright 2012 Netflix, Inc. | ||
|
||
(ASLv2) Apache Commons Lang | ||
The following NOTICE information applies: | ||
Apache Commons Lang | ||
Copyright 2001-2017 The Apache Software Foundation | ||
|
||
This product includes software from the Spring Framework, | ||
under the Apache License 2.0 (see: StringUtils.containsWhitespace()) | ||
|
71 changes: 71 additions & 0 deletions
71
nifi-extension-bundles/nifi-couchbase-bundle/nifi-couchbase-processors/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<?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-couchbase-bundle</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>nifi-couchbase-processors</artifactId> | ||
<packaging>jar</packaging> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-utils</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-couchbase-services-api</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-distributed-cache-client-service-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-lang3</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-lookup-service-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-record</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-record-serialization-service-api</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-mock</artifactId> | ||
<version>2.0.0-SNAPSHOT</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
79 changes: 79 additions & 0 deletions
79
...se-processors/src/main/java/org/apache/nifi/couchbase/AbstractCouchbaseLookupService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
/* | ||
* 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.couchbase; | ||
|
||
import org.apache.nifi.annotation.lifecycle.OnEnabled; | ||
import org.apache.nifi.components.PropertyDescriptor; | ||
import org.apache.nifi.controller.AbstractControllerService; | ||
import org.apache.nifi.controller.ConfigurationContext; | ||
import org.apache.nifi.controller.ControllerServiceInitializationContext; | ||
import org.apache.nifi.reporting.InitializationException; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.Stream; | ||
|
||
import static org.apache.nifi.couchbase.CouchbaseConfigurationProperties.BUCKET_NAME; | ||
import static org.apache.nifi.couchbase.CouchbaseConfigurationProperties.COLLECTION_NAME; | ||
import static org.apache.nifi.couchbase.CouchbaseConfigurationProperties.COUCHBASE_CLUSTER_SERVICE; | ||
|
||
public class AbstractCouchbaseLookupService extends AbstractControllerService { | ||
|
||
protected static final String KEY = "key"; | ||
protected static final Set<String> REQUIRED_KEYS = Collections.unmodifiableSet(Stream.of(KEY).collect(Collectors.toSet())); | ||
|
||
protected List<PropertyDescriptor> properties; | ||
protected volatile CouchbaseClusterControllerService couchbaseClusterService; | ||
protected volatile String bucketName; | ||
protected volatile String collectionName; | ||
|
||
@Override | ||
protected void init(final ControllerServiceInitializationContext context) throws InitializationException { | ||
final List<PropertyDescriptor> properties = new ArrayList<>(); | ||
properties.add(COUCHBASE_CLUSTER_SERVICE); | ||
properties.add(BUCKET_NAME); | ||
properties.add(COLLECTION_NAME); | ||
addProperties(properties); | ||
this.properties = Collections.unmodifiableList(properties); | ||
} | ||
|
||
protected void addProperties(List<PropertyDescriptor> properties) { | ||
} | ||
|
||
@OnEnabled | ||
public void onEnabled(final ConfigurationContext context) throws InitializationException { | ||
|
||
couchbaseClusterService = context.getProperty(COUCHBASE_CLUSTER_SERVICE) | ||
.asControllerService(CouchbaseClusterControllerService.class); | ||
bucketName = context.getProperty(BUCKET_NAME).evaluateAttributeExpressions().getValue(); | ||
collectionName = context.getProperty(COLLECTION_NAME).evaluateAttributeExpressions().getValue(); | ||
} | ||
|
||
public Set<String> getRequiredKeys() { | ||
return REQUIRED_KEYS; | ||
} | ||
|
||
@Override | ||
protected List<PropertyDescriptor> getSupportedPropertyDescriptors() { | ||
return properties; | ||
} | ||
|
||
|
||
} |
Oops, something went wrong.