Skip to content

Commit a8aa610

Browse files
author
ShiShusheng
committed
实时处理应用Scala开发之代码重构
0 parents  commit a8aa610

12 files changed

Lines changed: 575 additions & 0 deletions

File tree

.idea/compiler.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/dictionaries/sss.xml

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 36 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/scala_compiler.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pom.xml

Lines changed: 276 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,276 @@
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+
<project xmlns="http://maven.apache.org/POM/4.0.0"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
22+
<modelVersion>4.0.0</modelVersion>
23+
24+
<groupId>com.javaedge.scala</groupId>
25+
<artifactId>flink-train-scala</artifactId>
26+
<version>1.0</version>
27+
<packaging>jar</packaging>
28+
29+
<name>Flink Quickstart Job</name>
30+
<url>http://www.myorganization.org</url>
31+
32+
<repositories>
33+
<repository>
34+
<id>apache.snapshots</id>
35+
<name>Apache Development Snapshot Repository</name>
36+
<url>https://repository.apache.org/content/repositories/snapshots/</url>
37+
<releases>
38+
<enabled>false</enabled>
39+
</releases>
40+
<snapshots>
41+
<enabled>true</enabled>
42+
</snapshots>
43+
</repository>
44+
</repositories>
45+
46+
<properties>
47+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
48+
<flink.version>1.8.0</flink.version>
49+
<scala.binary.version>2.11</scala.binary.version>
50+
<scala.version>2.11.12</scala.version>
51+
</properties>
52+
53+
<dependencies>
54+
<!-- Apache Flink dependencies -->
55+
<!-- These dependencies are provided, because they should not be packaged into the JAR file. -->
56+
<dependency>
57+
<groupId>org.apache.flink</groupId>
58+
<artifactId>flink-scala_${scala.binary.version}</artifactId>
59+
<version>${flink.version}</version>
60+
<scope>provided</scope>
61+
</dependency>
62+
<dependency>
63+
<groupId>org.apache.flink</groupId>
64+
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
65+
<version>${flink.version}</version>
66+
<scope>provided</scope>
67+
</dependency>
68+
69+
<!-- Scala Library, provided by Flink as well. -->
70+
<dependency>
71+
<groupId>org.scala-lang</groupId>
72+
<artifactId>scala-library</artifactId>
73+
<version>${scala.version}</version>
74+
<scope>provided</scope>
75+
</dependency>
76+
77+
<!-- Add connector dependencies here. They must be in the default scope (compile). -->
78+
79+
<!-- Example:
80+
81+
<dependency>
82+
<groupId>org.apache.flink</groupId>
83+
<artifactId>flink-connector-kafka-0.10_${scala.binary.version}</artifactId>
84+
<version>${flink.version}</version>
85+
</dependency>
86+
-->
87+
88+
<!-- Add logging framework, to produce console output when running in the IDE. -->
89+
<!-- These dependencies are excluded from the application JAR by default. -->
90+
<dependency>
91+
<groupId>org.slf4j</groupId>
92+
<artifactId>slf4j-log4j12</artifactId>
93+
<version>1.7.7</version>
94+
<scope>runtime</scope>
95+
</dependency>
96+
<dependency>
97+
<groupId>log4j</groupId>
98+
<artifactId>log4j</artifactId>
99+
<version>1.2.17</version>
100+
<scope>runtime</scope>
101+
</dependency>
102+
</dependencies>
103+
104+
<build>
105+
<plugins>
106+
<!-- We use the maven-shade plugin to create a fat jar that contains all necessary dependencies. -->
107+
<!-- Change the value of <mainClass>...</mainClass> if your program entry point changes. -->
108+
<plugin>
109+
<groupId>org.apache.maven.plugins</groupId>
110+
<artifactId>maven-shade-plugin</artifactId>
111+
<version>3.0.0</version>
112+
<executions>
113+
<!-- Run shade goal on package phase -->
114+
<execution>
115+
<phase>package</phase>
116+
<goals>
117+
<goal>shade</goal>
118+
</goals>
119+
<configuration>
120+
<artifactSet>
121+
<excludes>
122+
<exclude>org.apache.flink:force-shading</exclude>
123+
<exclude>com.google.code.findbugs:jsr305</exclude>
124+
<exclude>org.slf4j:*</exclude>
125+
<exclude>log4j:*</exclude>
126+
</excludes>
127+
</artifactSet>
128+
<filters>
129+
<filter>
130+
<!-- Do not copy the signatures in the META-INF folder.
131+
Otherwise, this might cause SecurityExceptions when using the JAR. -->
132+
<artifact>*:*</artifact>
133+
<excludes>
134+
<exclude>META-INF/*.SF</exclude>
135+
<exclude>META-INF/*.DSA</exclude>
136+
<exclude>META-INF/*.RSA</exclude>
137+
</excludes>
138+
</filter>
139+
</filters>
140+
<transformers>
141+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
142+
<mainClass>com.javaedge.scala.StreamingJob</mainClass>
143+
</transformer>
144+
</transformers>
145+
</configuration>
146+
</execution>
147+
</executions>
148+
</plugin>
149+
150+
<!-- Java Compiler -->
151+
<plugin>
152+
<groupId>org.apache.maven.plugins</groupId>
153+
<artifactId>maven-compiler-plugin</artifactId>
154+
<version>3.1</version>
155+
<configuration>
156+
<source>1.8</source>
157+
<target>1.8</target>
158+
</configuration>
159+
</plugin>
160+
161+
<!-- Scala Compiler -->
162+
<plugin>
163+
<groupId>net.alchim31.maven</groupId>
164+
<artifactId>scala-maven-plugin</artifactId>
165+
<version>3.2.2</version>
166+
<executions>
167+
<execution>
168+
<goals>
169+
<goal>compile</goal>
170+
<goal>testCompile</goal>
171+
</goals>
172+
</execution>
173+
</executions>
174+
</plugin>
175+
176+
<!-- Eclipse Scala Integration -->
177+
<plugin>
178+
<groupId>org.apache.maven.plugins</groupId>
179+
<artifactId>maven-eclipse-plugin</artifactId>
180+
<version>2.8</version>
181+
<configuration>
182+
<downloadSources>true</downloadSources>
183+
<projectnatures>
184+
<projectnature>org.scala-ide.sdt.core.scalanature</projectnature>
185+
<projectnature>org.eclipse.jdt.core.javanature</projectnature>
186+
</projectnatures>
187+
<buildcommands>
188+
<buildcommand>org.scala-ide.sdt.core.scalabuilder</buildcommand>
189+
</buildcommands>
190+
<classpathContainers>
191+
<classpathContainer>org.scala-ide.sdt.launching.SCALA_CONTAINER</classpathContainer>
192+
<classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER</classpathContainer>
193+
</classpathContainers>
194+
<excludes>
195+
<exclude>org.scala-lang:scala-library</exclude>
196+
<exclude>org.scala-lang:scala-compiler</exclude>
197+
</excludes>
198+
<sourceIncludes>
199+
<sourceInclude>**/*.scala</sourceInclude>
200+
<sourceInclude>**/*.java</sourceInclude>
201+
</sourceIncludes>
202+
</configuration>
203+
</plugin>
204+
<plugin>
205+
<groupId>org.codehaus.mojo</groupId>
206+
<artifactId>build-helper-maven-plugin</artifactId>
207+
<version>1.7</version>
208+
<executions>
209+
<!-- Add src/main/scala to eclipse build path -->
210+
<execution>
211+
<id>add-source</id>
212+
<phase>generate-sources</phase>
213+
<goals>
214+
<goal>add-source</goal>
215+
</goals>
216+
<configuration>
217+
<sources>
218+
<source>src/main/scala</source>
219+
</sources>
220+
</configuration>
221+
</execution>
222+
<!-- Add src/test/scala to eclipse build path -->
223+
<execution>
224+
<id>add-test-source</id>
225+
<phase>generate-test-sources</phase>
226+
<goals>
227+
<goal>add-test-source</goal>
228+
</goals>
229+
<configuration>
230+
<sources>
231+
<source>src/test/scala</source>
232+
</sources>
233+
</configuration>
234+
</execution>
235+
</executions>
236+
</plugin>
237+
</plugins>
238+
</build>
239+
240+
<!-- This profile helps to make things run out of the box in IntelliJ -->
241+
<!-- Its adds Flink's core classes to the runtime class path. -->
242+
<!-- Otherwise they are missing in IntelliJ, because the dependency is 'provided' -->
243+
<profiles>
244+
<profile>
245+
<id>add-dependencies-for-IDEA</id>
246+
247+
<activation>
248+
<property>
249+
<name>idea.version</name>
250+
</property>
251+
</activation>
252+
253+
<dependencies>
254+
<dependency>
255+
<groupId>org.apache.flink</groupId>
256+
<artifactId>flink-scala_${scala.binary.version}</artifactId>
257+
<version>${flink.version}</version>
258+
<scope>compile</scope>
259+
</dependency>
260+
<dependency>
261+
<groupId>org.apache.flink</groupId>
262+
<artifactId>flink-streaming-scala_${scala.binary.version}</artifactId>
263+
<version>${flink.version}</version>
264+
<scope>compile</scope>
265+
</dependency>
266+
<dependency>
267+
<groupId>org.scala-lang</groupId>
268+
<artifactId>scala-library</artifactId>
269+
<version>${scala.version}</version>
270+
<scope>compile</scope>
271+
</dependency>
272+
</dependencies>
273+
</profile>
274+
</profiles>
275+
276+
</project>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
################################################################################
18+
19+
log4j.rootLogger=INFO, console
20+
21+
log4j.appender.console=org.apache.log4j.ConsoleAppender
22+
log4j.appender.console.layout=org.apache.log4j.PatternLayout
23+
log4j.appender.console.layout.ConversionPattern=%d{HH:mm:ss,SSS} %-5p %-60c %x - %m%n

0 commit comments

Comments
 (0)