-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 551d708
Showing
7 changed files
with
642 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# Directories # | ||
/build/ | ||
/bin/ | ||
**/bin/ | ||
target/ | ||
# OS Files # | ||
.DS_Store | ||
*.class | ||
# Package Files # | ||
*.war | ||
*.ear | ||
*.db | ||
###################### | ||
# Windows | ||
###################### | ||
# Windows image file caches | ||
Thumbs.db | ||
# Folder config file | ||
Desktop.ini | ||
###################### | ||
# OSX | ||
###################### | ||
.DS_Store | ||
.svn | ||
# Thumbnails | ||
._* | ||
# Files that might appear on external disk | ||
.Spotlight-V100 | ||
.Trashes | ||
###################### | ||
# Eclipse | ||
###################### | ||
.project | ||
.metadata | ||
.classpath | ||
.settings/ | ||
.loadpath | ||
*.pydevproject | ||
bin/** | ||
tmp/** | ||
tmp/**/* | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
/src/main/resources/rebel.xml | ||
# External tool builders | ||
.externalToolBuilders/ | ||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
# CDT-specific | ||
.cproject | ||
.project | ||
# PDT-specific | ||
.buildpath | ||
#liferay sdk | ||
build-common-theme.xml | ||
build-common-portlet.xml | ||
create.bat | ||
create.sh | ||
merge.bat | ||
/build.xml | ||
readme.txt | ||
.tern-project | ||
###################### | ||
# IntelliJ | ||
###################### | ||
.idea | ||
*.iml |
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,46 @@ | ||
<?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>net.zylklab.bigdata.nifi</groupId> | ||
<artifactId>record_converter</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>nifi-RecordConverter-nar</artifactId> | ||
<packaging>nar</packaging> | ||
<properties> | ||
<maven.javadoc.skip>true</maven.javadoc.skip> | ||
<source.skip>true</source.skip> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>net.zylklab.bigdata.nifi</groupId> | ||
<artifactId>nifi-record-converter-processors</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-standard-nar</artifactId> | ||
<version>${nifi.version}</version> | ||
<type>nar</type> | ||
</dependency> | ||
|
||
</dependencies> | ||
|
||
</project> |
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,78 @@ | ||
<?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>net.zylklab.bigdata.nifi</groupId> | ||
<artifactId>record_converter</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>nifi-record-converter-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>${nifi.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-standard-processors</artifactId> | ||
<version>${nifi.version}</version> | ||
</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-avro-record-utils</artifactId> | ||
<version>1.13.0</version> | ||
</dependency> | ||
|
||
|
||
|
||
<dependency> | ||
<groupId>org.apache.nifi</groupId> | ||
<artifactId>nifi-mock</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
29 changes: 29 additions & 0 deletions
29
...Converter-processors/src/main/java/net/zylklab/bigdata/nifi/record_converter/SandBox.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,29 @@ | ||
package net.zylklab.bigdata.nifi.record_converter; | ||
|
||
import java.io.IOException; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import com.fasterxml.jackson.core.JsonParseException; | ||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.JsonMappingException; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
public class SandBox { | ||
public static void main(String[] args) throws JsonParseException, JsonMappingException, IOException { | ||
String s = "{\"geoip_iso_country_code\": \"MX\",\"rrr\": \"QQQ\",\"kkkk\": \"hhhh\"}"; | ||
ObjectMapper objectMapper = new ObjectMapper(); | ||
TypeReference<HashMap<String,String>> typeRef = new TypeReference<HashMap<String,String>>() {}; | ||
Map<String, String> a = objectMapper.readValue(s, typeRef); | ||
|
||
System.out.println(a.size()); | ||
|
||
HashMap<String, String> b = new HashMap<>(); | ||
b.put("kkk", "cccc"); | ||
b.put("kkk1", "cccc2"); | ||
String kkk = objectMapper.writeValueAsString(b); | ||
System.out.println(kkk); | ||
|
||
|
||
} | ||
} |
Oops, something went wrong.