## 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
资源评论
快撑死的鱼
- 粉丝: 1w+
- 资源: 9149
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- apache-maven-3.6.1-bin.zip
- c593f5fc-d4a7-4b43-8ab2-51afc90f3f62
- IIR滤波器参数计算函数
- WPF树菜单拖拽功能,下级目录拖到上级目录,上级目录拖到下级目录.zip
- CDH6.3.2版本hive2.1.1修复HIVE-14706后的jar包
- 鸿蒙项目实战-天气项目(当前城市天气、温度、湿度,24h天气,未来七天天气预报,生活指数,城市选择等)
- Linux环境下oracle数据库服务器配置中文最新版本
- Linux操作系统中Oracle11g数据库安装步骤详细图解中文最新版本
- SMA中心接触件插合力量(插入力及分离力)仿真
- 变色龙记事本,有NPP功能,JSONview功能
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功