Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

Commit f47bf72

Browse files
Apex Devprasannapramod
authored andcommitted
Fixed Checkstyle and Log4j Properties.
1 parent 3d6bfcc commit f47bf72

36 files changed

+570
-203
lines changed

examples/JDBC/src/main/java/org/apache/apex/examples/FileToJdbcApp/FileReader.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/JDBC/src/main/java/org/apache/apex/examples/FileToJdbcApp/PojoEvent.java

Lines changed: 0 additions & 45 deletions
This file was deleted.

examples/JDBC/src/main/java/org/apache/apex/examples/JdbcIngest/PojoEvent.java

Lines changed: 0 additions & 44 deletions
This file was deleted.

examples/JDBC/src/main/java/org/apache/apex/examples/JdbcToJdbc/PojoEvent.java

Lines changed: 0 additions & 44 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

examples/JDBC/pom.xml renamed to examples/jdbc/pom.xml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Licensed to the Apache Software Foundation (ASF) under one
5+
or more contributor license agreements. See the NOTICE file
6+
distributed with this work for additional information
7+
regarding copyright ownership. The ASF licenses this file
8+
to you under the Apache License, Version 2.0 (the
9+
"License"); you may not use this file except in compliance
10+
with the License. You may obtain a copy of the License at
11+
12+
http://www.apache.org/licenses/LICENSE-2.0
13+
14+
Unless required by applicable law or agreed to in writing,
15+
software distributed under the License is distributed on an
16+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
KIND, either express or implied. See the License for the
18+
specific language governing permissions and limitations
19+
under the License.
20+
21+
-->
222
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
323
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
424
<modelVersion>4.0.0</modelVersion>
525

6-
<artifactId>malhar-examples-JDBC</artifactId>
26+
<artifactId>malhar-examples-jdbc</artifactId>
727
<packaging>jar</packaging>
828

929
<!-- change these to the appropriate values -->

examples/JDBC/src/assemble/appPackage.xml renamed to examples/jdbc/src/assemble/appPackage.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
121
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
222
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
323
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">

examples/JDBC/src/main/java/org/apache/apex/examples/FileToJdbcApp/CustomParser.java renamed to examples/jdbc/src/main/java/org/apache/apex/examples/FileToJdbcApp/CustomParser.java

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,19 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19+
1920
package org.apache.apex.examples.FileToJdbcApp;
2021

22+
import java.util.regex.Pattern;
23+
24+
import org.slf4j.Logger;
25+
import org.slf4j.LoggerFactory;
26+
2127
import com.datatorrent.api.Context.OperatorContext;
2228
import com.datatorrent.api.DefaultInputPort;
2329
import com.datatorrent.api.DefaultOutputPort;
2430
import com.datatorrent.api.annotation.OutputPortFieldAnnotation;
2531
import com.datatorrent.common.util.BaseOperator;
26-
import org.slf4j.Logger;
27-
import org.slf4j.LoggerFactory;
28-
29-
import java.util.regex.Pattern;
3032

3133
// parse input line into pojo event
3234
public class CustomParser extends BaseOperator
@@ -42,12 +44,11 @@ public class CustomParser extends BaseOperator
4244
@OutputPortFieldAnnotation(optional = false)
4345
public final transient DefaultOutputPort<PojoEvent> output = new DefaultOutputPort<>();
4446

45-
public final transient DefaultInputPort<String>
46-
input = new DefaultInputPort<String>() {
47-
48-
@Override
49-
public void process(String line)
50-
{
47+
public final transient DefaultInputPort<String> input = new DefaultInputPort<String>()
48+
{
49+
@Override
50+
public void process(String line)
51+
{
5152
// use custom regex to split line into words
5253
final String[] words = regexPattern.split(line);
5354

@@ -70,14 +71,16 @@ public void process(String line)
7071
pojo.setAmount(0);
7172
}
7273
output.emit(pojo);
73-
}
74+
}
7475
};
7576

76-
public String getRegexStr() {
77+
public String getRegexStr()
78+
{
7779
return this.regexStr;
7880
}
7981

80-
public void setRegexStr(String regex) {
82+
public void setRegexStr(String regex)
83+
{
8184
this.regexStr = regex;
8285
}
8386

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
package org.apache.apex.examples.FileToJdbcApp;
21+
22+
import org.apache.apex.malhar.lib.fs.LineByLineFileInputOperator;
23+
import com.datatorrent.api.DefaultOutputPort;
24+
25+
public class FileReader extends LineByLineFileInputOperator
26+
{
27+
/**
28+
* output in bytes to match CsvParser input type
29+
*/
30+
public final transient DefaultOutputPort<byte[]> byteOutput = new DefaultOutputPort<>();
31+
32+
@Override
33+
protected void emit(String tuple)
34+
{
35+
output.emit(tuple);
36+
byteOutput.emit(tuple.getBytes());
37+
}
38+
}
39+

0 commit comments

Comments
 (0)