## Samples Overview
These samples show how to perform some basic data processing tasks using the Milan Scala DSL, and compile them into executable Flink applications using Maven.
There is also a sample of how to build a Milan application using sbt rather than Maven in [sbt](sbt/README.md).
Milan relies on code generation to produce executable applications, so there are two modules:
* `milan-sample-gen` defines the Milan applications.
* `milan-sample-exec` performs the code generation and builds the resulting generated applications.
The pom.xml file in `milan-sample-exec` demonstrates one way to invoke the code generation, using a Milan utility called `CompileApplicationInstance`.
`milan-sample-exec` invokes `CompileApplicationInstance` during the `generate-sources` phase of the Maven build to create scala files that are then compiled during the `compile` phase.
`CompileApplicationInstance` is part of `milan-tools` and relies on two interfaces, `ApplicationInstanceProvider` and `ApplicationInstanceCompiler`.
`ApplicationInstanceProvider` returns an `ApplicatonInstance` object which contain all of the information necessary to perform code generation: a Milan application and configuration.
`ApplicationInstanceProvider` must be implemented by the creator of a Milan application if they want to use Milan's build tools.
`ApplicationInstanceCompiler` is implemented by Milan code generators, such as Milan's Flink compiler.
## Building the samples
The sample jar will be built any time Maven's package phase is executed.
You can build the samples using `mvn package` from the root of the repo.
If you want to build *only* the samples you will first need to `mvn install` from the root of the repo so that the sample dependencies are available.
Building the samples produces a fat JAR in the `milan-sample-exec/target` folder which contains all of the dependencies necessary for running the samples.
There are two build profiles that can be used:
1. The default profile includes the Flink libraries in the sample JAR. Use this if you don't have a Flink cluster running on your machine.
2. The `no-package-flink` profile is triggered by including the argument `-Dpackageflink=false` when invoking `mvn package`. This prevents Flink JARs from being included in the fat JAR, which is necessary if you want to execute the samples on a Flink cluster.
## Running the samples
Run the samples by executing the following commands in the target folder.
If you built using the default profile:
```
java -cp ./milan-sample-exec-0.8-SNAPSHOT.jar com.amazon.milan.samples.exec.GroupByFlatMap
```
If you built using the no-package-flink profile:
```
flink run -c com.amazon.milan.samples.exec.GroupByFlatMap ./milan-sample-exec-0.8-SNAPSHOT.jar
```
You can execute the other samples by replacing `com.amazon.milan.samples.exec.GroupByFlatMap` with the name of the sample class.
You can find the available samples in the [pom.xml](milan-sample-gen/pom.xml) in `milan-samples-gen`.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
Milan是一个ScalaAPI和运行时基础设施,用于构建面.zip (504个子文件)
.gitignore 83B
.gitignore 83B
.gitignore 52B
.gitignore 11B
.gitignore 8B
.gitignore 8B
NamedArgument.java 461B
ParametersArgument.java 319B
cdk.json 773B
tsconfig.json 650B
package.json 515B
LICENSE 10KB
Milan Operations.md 7KB
Streams in Milan and streaming operations.md 7KB
CONTRIBUTING.md 3KB
README.md 3KB
README.md 3KB
README.md 2KB
README.md 375B
CODE_OF_CONDUCT.md 309B
README.md 295B
MANIFEST.MF 76B
NOTICE 72B
log4j2.properties 474B
log4j2.properties 474B
log4j2.properties 474B
log4j2.properties 474B
log4j.properties 395B
milan.properties 114B
build.properties 19B
application.properties 0B
application.properties 0B
build.sbt 4KB
plugins.sbt 342B
EventHandlerFunctionGenerator.scala 34KB
TestApplicationExecutor.scala 28KB
LambdaCdkGenerator.scala 26KB
StreamExpressions.scala 24KB
Expression.scala 23KB
TypeChecker.scala 18KB
ApplicationCdkGenerator.scala 18KB
GeneratorContext.scala 18KB
ScanOperationGenerator.scala 18KB
AggregateFunctionGenerator.scala 17KB
ConvertExpressionHost.scala 17KB
ScalarFunctionGenerator.scala 16KB
RuntimeEvaluator.scala 14KB
TestEventAppCommentProcessingScenario.scala 14KB
StreamMacros.scala 14KB
EventHandlerClassGenerator.scala 14KB
TreeParser.scala 13KB
GeneratorContext.scala 13KB
FlatMapGenerator.scala 12KB
TypeLifter.scala 12KB
Stream.scala 12KB
CoProcessFunctionGenerator.scala 11KB
KeyedStreamGenerator.scala 11KB
LambdaHandlerGenerator.scala 11KB
GraphTraverser.scala 11KB
AggregateFunctionTreeExtractor.scala 10KB
GroupingExpressions.scala 10KB
DiGraph.scala 10KB
EventHandlerAggregateFunctionGenerator.scala 9KB
LiftableImpls.scala 9KB
TreeExtractor.scala 9KB
ArrayRecordTypeSerializer.scala 9KB
RecordWrapper.scala 9KB
DataSinkGenerator.scala 9KB
TypeDescriptor.scala 9KB
ScalaStreamGenerator.scala 8KB
TestEventApp.scala 8KB
TestEventAppGroupBy.scala 8KB
GroupedStreamMacros.scala 8KB
TestLambdaCdkGenerator.scala 8KB
CsvDataOutputFormat.scala 8KB
SemanticVersion.scala 8KB
LeftInnerJoinKeyedCoProcessFunction.scala 8KB
ScanOperationGenerator.scala 8KB
TypeJoiner.scala 8KB
CsvDataInputFormat.scala 8KB
GeneratedStreams.scala 8KB
TypeInfoHost.scala 7KB
JoinExpressions.scala 7KB
BodaApp.scala 7KB
TestLambdaHandlerGenerator.scala 7KB
WindowedStreamsGenerator.scala 7KB
BuiltinAggregateFunctions.scala 7KB
ScalaTupleTypeInformation.scala 7KB
DataSourceGenerator.scala 7KB
TestJoin.scala 7KB
TypeDescriptorMacroHost.scala 7KB
AggregatorOutputRecord.scala 6KB
Concurrent.scala 6KB
package.scala 6KB
LastOperators.scala 6KB
AwsServerlessCompiler.scala 6KB
ApplicationConfiguration.scala 6KB
MilanDynamoDb.scala 6KB
ArgumentsBase.scala 6KB
LineageAnalyzer.scala 6KB
共 504 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
快撑死的鱼
- 粉丝: 2w+
- 资源: 9148
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 技术册投标文件的的查重
- 通信原理(第七版 樊昌信 曹丽娜)思维导图
- genad-hGridSample-test.hbm
- cvtocc-shanghai.hbm
- k8s安装ingress-nginx
- dnSpy-net-win32-222.zip
- mongoose-free-6.9
- 德普微一级代理 DP100N06MGL PDFN3.3*3.3 TRMOS N-MOSFET 60V, 8mΩ, 45A
- 【java毕业设计】SpringBoot+Vue幼儿园管理系统 源码+sql脚本+论文 完整版
- 德普微一级代理 DP021N03FGLI DFN5*6 DPMOS N-MOSFET 30V 180A 1.8mΩ
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功