├── .github
└── workflows
│ ├── greetings.yml
│ └── stale.yml
├── .gitignore
├── .scalafmt.conf
├── .travis.yml
├── CONTRIBUTING.md
├── KEYS
├── LICENSE
├── NOTICE
├── README.md
├── dev
└── requirements.txt
├── griffin-doc
├── DQDiagrams.md
├── DataQualityTool.md
├── TwoTablesDiffResult.md
├── arch2.png
├── deploy
│ ├── deploy-guide.md
│ └── measure-build-guide.md
├── dev
│ ├── code-style.md
│ ├── dev-env-build.md
│ └── griffin-pip.md
├── docker
│ ├── compose
│ │ ├── docker-compose-batch.yml
│ │ └── docker-compose-streaming.yml
│ └── griffin-docker-guide.md
├── img
│ ├── arch.png
│ ├── devguide
│ │ ├── add-job.png
│ │ ├── add-measure.png
│ │ ├── call_postman.png
│ │ ├── check-run-idea.png
│ │ ├── config-addition-idea.png
│ │ ├── import_postman_conf.png
│ │ ├── revise_postman_env.png
│ │ ├── scala-intellij-idea
│ │ │ ├── 1.png
│ │ │ ├── 2.png
│ │ │ ├── 3.png
│ │ │ ├── 4.png
│ │ │ ├── 5.png
│ │ │ └── 6.png
│ │ └── style-check-plugin-idea.png
│ └── userguide
│ │ ├── Capture.PNG
│ │ ├── ac_partition.png
│ │ ├── accuracy.png
│ │ ├── asset list.png
│ │ ├── confirm job.png
│ │ ├── confirm measure.png
│ │ ├── create job.png
│ │ ├── create measure.png
│ │ ├── dashboard big.png
│ │ ├── data asset new.png
│ │ ├── dq metrics.png
│ │ ├── heatmap.png
│ │ ├── job config.png
│ │ ├── mapping.png
│ │ ├── measure info.png
│ │ ├── metrics dashboard.png
│ │ ├── right bar.png
│ │ ├── source.PNG
│ │ └── target.PNG
├── intro.md
├── measure
│ ├── dimensions.md
│ ├── dsl-guide.md
│ ├── griffin-tool.md
│ ├── measure-batch-sample.md
│ ├── measure-configuration-guide.md
│ ├── measure-configuration-guide
│ │ ├── accuracy.md
│ │ ├── completeness.md
│ │ ├── duplication.md
│ │ ├── profiling.md
│ │ ├── schema_conformance.md
│ │ └── sparksql.md
│ ├── measure-streaming-sample.md
│ ├── measures.md
│ └── predicates.md
├── roadmap.md
├── service
│ ├── api-guide.md
│ ├── hibernate_eclipselink_switch.md
│ ├── mysql_postgresql_switch.md
│ └── postman
│ │ ├── griffin.json
│ │ └── griffin_environment.json
└── ui
│ └── user-guide.md
├── measure
├── pom.xml
├── sbin
│ └── griffin-tool.sh
└── src
│ ├── main
│ ├── resources
│ │ ├── config-batch-advanced.json
│ │ ├── config-batch-all-measures.json
│ │ ├── config-batch-es.json
│ │ ├── config-batch-old.json
│ │ ├── config-batch-path.json
│ │ ├── config-batch-preproc.json
│ │ ├── config-streaming.json
│ │ ├── crime_report.csv
│ │ ├── crime_report_truth.csv
│ │ ├── env-batch.json
│ │ ├── env-streaming.json
│ │ └── log4j.properties
│ └── scala
│ │ └── org
│ │ └── apache
│ │ └── griffin
│ │ └── measure
│ │ ├── Application.scala
│ │ ├── Loggable.scala
│ │ ├── configuration
│ │ ├── dqdefinition
│ │ │ ├── DQConfig.scala
│ │ │ ├── EnvConfig.scala
│ │ │ ├── GriffinConfig.scala
│ │ │ ├── Param.scala
│ │ │ └── reader
│ │ │ │ ├── ParamFileReader.scala
│ │ │ │ ├── ParamHttpReader.scala
│ │ │ │ ├── ParamJsonReader.scala
│ │ │ │ ├── ParamReader.scala
│ │ │ │ └── ParamReaderFactory.scala
│ │ └── enums
│ │ │ ├── DqType.scala
│ │ │ ├── DslType.scala
│ │ │ ├── FlattenType.scala
│ │ │ ├── GriffinEnum.scala
│ │ │ ├── MeasureTypes.scala
│ │ │ ├── OutputType.scala
│ │ │ ├── ProcessType.scala
│ │ │ ├── SinkType.scala
│ │ │ └── WriteMode.scala
│ │ ├── context
│ │ ├── ContextId.scala
│ │ ├── DQContext.scala
│ │ ├── DataFrameCache.scala
│ │ ├── MetricWrapper.scala
│ │ ├── TableRegister.scala
│ │ ├── TimeRange.scala
│ │ └── streaming
│ │ │ ├── checkpoint
│ │ │ ├── lock
│ │ │ │ ├── CheckpointLock.scala
│ │ │ │ ├── CheckpointLockInZK.scala
│ │ │ │ └── CheckpointLockSeq.scala
│ │ │ └── offset
│ │ │ │ ├── OffsetCheckpoint.scala
│ │ │ │ ├── OffsetCheckpointClient.scala
│ │ │ │ ├── OffsetCheckpointFactory.scala
│ │ │ │ ├── OffsetCheckpointInZK.scala
│ │ │ │ └── OffsetOps.scala
│ │ │ └── metric
│ │ │ ├── AccuracyMetric.scala
│ │ │ ├── CacheResults.scala
│ │ │ └── Metric.scala
│ │ ├── datasource
│ │ ├── DataSource.scala
│ │ ├── DataSourceFactory.scala
│ │ ├── TimestampStorage.scala
│ │ ├── cache
│ │ │ ├── StreamingCacheClient.scala
│ │ │ ├── StreamingCacheClientFactory.scala
│ │ │ ├── StreamingCacheJsonClient.scala
│ │ │ ├── StreamingCacheOrcClient.scala
│ │ │ ├── StreamingCacheParquetClient.scala
│ │ │ ├── StreamingOffsetCacheable.scala
│ │ │ └── WithFanIn.scala
│ │ └── connector
│ │ │ ├── DataConnector.scala
│ │ │ ├── DataConnectorFactory.scala
│ │ │ ├── batch
│ │ │ ├── AvroBatchDataConnector.scala
│ │ │ ├── BatchDataConnector.scala
│ │ │ ├── CassandraDataConnector.scala
│ │ │ ├── ElasticSearchDataConnector.scala
│ │ │ ├── ElasticSearchGriffinDataConnector.scala
│ │ │ ├── FileBasedDataConnector.scala
│ │ │ ├── HiveBatchDataConnector.scala
│ │ │ ├── JDBCBasedDataConnector.scala
│ │ │ ├── MySqlDataConnector.scala
│ │ │ └── TextDirBatchDataConnector.scala
│ │ │ └── streaming
│ │ │ ├── KafkaStreamingDataConnector.scala
│ │ │ ├── KafkaStreamingStringDataConnector.scala
│ │ │ └── StreamingDataConnector.scala
│ │ ├── execution
│ │ ├── Measure.scala
│ │ ├── MeasureExecutor.scala
│ │ └── impl
│ │ │ ├── AccuracyMeasure.scala
│ │ │ ├── CompletenessMeasure.scala
│ │ │ ├── DuplicationMeasure.scala
│ │ │ ├── ProfilingMeasure.scala
│ │ │ ├── SchemaConformanceMeasure.scala
│ │ │ └── SparkSQLMeasure.scala
│ │ ├── job
│ │ ├── DQJob.scala
│ │ └── builder
│ │ │ └── DQJobBuilder.scala
│ │ ├── launch
│ │ ├── DQApp.scala
│ │ ├── batch
│ │ │ └── BatchDQApp.scala
│ │ └── streaming
│ │ │ └── StreamingDQApp.scala
│ │ ├── sink
│ │ ├── ConsoleSink.scala
│ │ ├── ElasticSearchSink.scala
│ │ ├── HdfsSink.scala
│ │ ├── MongoSink.scala
│ │ ├── Sink.scala
│ │ ├── SinkFactory.scala
│ │ └── SinkTaskRunner.scala
│ │ ├── step
│ │ ├── DQStep.scala
│ │ ├── SeqDQStep.scala
│ │ ├── builder
│ │ │ ├── BatchDataSourceStepBuilder.scala
│ │ │ ├── ConstantColumns.scala
│ │ │ ├── DQStepBuilder.scala
│ │ │ ├── DQStepNameGenerator.scala
│ │ │ ├── DataSourceParamStepBuilder.scala
│ │ │ ├── GriffinDslDQStepBuilder.scala
│ │ │ ├── RuleParamStepBuilder.scala
│ │ │ ├── SparkSqlDQStepBuilder.scala
│ │ │ ├── StreamingDataSourceStepBuilder.scala
│ │ │ ├── dsl
│ │ │ │ ├── expr
│ │ │ │ │ ├── AliasableExpr.scala
│ │ │ │ │ ├── ClauseExpression.scala
│ │ │ │ │ ├── Expr.scala
│ │ │ │ │ ├── ExprTag.scala
│ │ │ │ │ ├── ExtraConditionExpr.scala
│ │ │ │ │ ├── FunctionExpr.scala
│ │ │ │ │ ├── LiteralExpr.scala
│ │ │ │ │ ├── LogicalExpr.scala
│ │ │ │ │ ├── MathExpr.scala
│ │ │ │ │ ├── SelectExpr.scala
│ │ │ │ │ └── TreeNode.scala
│ │ │ │ ├── parser
│ │ │ │ │ ├── BasicParser.scala
│ │ │ │ │ └── GriffinDslParser.scala
│ │ │ │ └── transform
│ │ │ │ │ ├── AccuracyExpr2DQSteps.scala
│ │ │ │ │ ├── CompletenessExpr2DQSteps.scala
│ │ │ │ │ ├── DistinctnessExpr2DQSteps.scala
│ │ │ │ │ ├── Expr2DQSteps.scala
│ │ │ │ │ ├── ProfilingExpr2DQSteps.scala
│ │ │ │ │ ├── TimelinessExpr2DQSteps.scala
│ │ │ │ │ ├── UniquenessExpr2DQSteps.scala
│ │ │ │ │ └── analyzer
│ │ │ │ │ ├── AccuracyAnalyzer.scala
│ │ │ │ │ ├── BasicAnalyzer.scala
│ │ │ │ │ ├── CompletenessAnalyzer.scala
│ │ │ │ │ ├── DistinctnessAnalyzer.scala
│ │ │ │ │ ├── ProfilingAnalyzer.scala
│ │ │ │ │ ├── TimelinessAnalyzer.scala
│ │ │ │ │ └── UniquenessAnalyzer.scala
│ │ │ └── udf
│ │ │ │ └── GriffinUDFs.scala
│ │ ├── read
│ │ │ ├── ReadStep.scala
│ │ │ └── UnionReadStep.scala
│ │ ├── transform
│ │ │ ├── DataFrameOps.scala
│ │ │ ├── DataFrameOpsTransformStep.scala
│ │ │ ├── SparkSqlTransformStep.scala
│ │ │ └── TransformStep.scala
│ │ └── write
│ │ │ ├── DataSourceUpdateWriteStep.scala
│ │ │ ├── MetricFlushStep.scala
│ │ │ ├── MetricWriteStep.scala
│ │ │ ├── RecordWriteStep.scala
│ │ │ ├── SparkRowFormatter.scala
│ │ │ └── WriteStep.scala
│ │ └── utils
│ │ ├── CommonUtils.scala
│ │ ├── DataFrameUtil.scala
│ │ ├── FSUtil.scala
│ │ ├── HdfsUtil.scala
│ │ ├── HttpUtil.scala
│ │ ├── JsonUtil.scala
│ │ ├── ParamUtil.scala
│ │ ├── ThreadUtils.scala
│ │ └── TimeUtil.scala
│ └── test
│ ├── resources
│ ├── _accuracy-batch-griffindsl.json
│ ├── _accuracy-streaming-griffindsl.json
│ ├── _completeness-batch-griffindsl.json
│ ├── _completeness-streaming-griffindsl.json
│ ├── _completeness_errorconf-batch-griffindsl.json
│ ├── _distinctness-batch-griffindsl.json
│ ├── _distinctness-streaming-griffindsl.json
│ ├── _no_measure_or_rules_malformed.json
│ ├── _profiling-batch-griffindsl-hive.json
│ ├── _profiling-batch-griffindsl.json
│ ├── _profiling-batch-griffindsl_malformed.json
│ ├── _profiling-batch-sparksql.json
│ ├── _profiling-streaming-griffindsl.json
│ ├── _sparksql-batch-griffindsl.json
│ ├── _timeliness-batch-griffindsl.json
│ ├── _timeliness-streaming-griffindsl.json
│ ├── _uniqueness-batch-griffindsl.json
│ ├── _uniqueness-streaming-griffindsl.json
│ ├── crime_report_test.csv
│ ├── duplicates_users_info_src.csv
│ ├── elasticsearch
│ │ ├── test_data_1.json
│ │ ├── test_data_1_template.json
│ │ ├── test_data_2.json
│ │ └── test_data_2_template.json
│ ├── env-batch.json
│ ├── env-streaming-mongo.json
│ ├── env-streaming.json
│ ├── files
│ │ ├── person_table.csv
│ │ │ ├── ._SUCCESS.crc
│ │ │ ├── .part-00000-34d01e73-1818-4a16-9e72-2da15374961e-c000.csv.crc
│ │ │ ├── _SUCCESS
│ │ │ └── part-00000-34d01e73-1818-4a16-9e72-2da15374961e-c000.csv
│ │ ├── person_table.orc
│ │ │ ├── ._SUCCESS.crc
│ │ │ ├── .part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc.crc
│ │ │ ├── _SUCCESS
│ │ │ └── part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc
│ │ ├── person_table.parquet
│ │ │ ├── ._SUCCESS.crc
│ │ │ ├── .part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet.crc
│ │ │ ├── _SUCCESS
│ │ │ └── part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet
│ │ └── person_table.tsv
│ │ │ ├── ._SUCCESS.crc
│ │ │ ├── .part-00000-c3fdfa41-386d-4c4c-8a52-c690885f1569-c000.csv.crc
│ │ │ ├── _SUCCESS
│ │ │ └── part-00000-c3fdfa41-386d-4c4c-8a52-c690885f1569-c000.csv
│ ├── hive
│ │ └── person_table.csv
│ ├── invalidconfigs
│ │ ├── invalidtype_completeness_batch_griffindal.json
│ │ └── missingrule_accuracy_batch_sparksql.json
│ ├── log4j.properties
│ ├── timeliness_data.avro
│ ├── users_info_src.avro
│ ├── users_info_src.csv
│ ├── users_info_src
│ │ └── users_info_src.avro
│ ├── users_info_target.avro
│ └── users_info_target
│ │ └── users_info_target.avro
│ └── scala
│ └── org
│ └── apache
│ └── griffin
│ └── measure
│ ├── SparkSuiteBase.scala
│ ├── configuration
│ └── dqdefinition
│ │ └── reader
│ │ ├── ParamEnumReaderSpec.scala
│ │ ├── ParamFileReaderSpec.scala
│ │ └── ParamJsonReaderSpec.scala
│ ├── context
│ ├── DataFrameCacheTest.scala
│ ├── MetricWrapperTest.scala
│ └── TimeRangeTest.scala
│ ├── datasource
│ ├── TimestampStorageTest.scala
│ └── connector
│ │ ├── DataConnectorFactorySpec.scala
│ │ ├── DataConnectorPreProcTest.scala
│ │ └── batch
│ │ ├── ElasticSearchDataConnectorTest.scala
│ │ ├── FileBasedDataConnectorTest.scala
│ │ └── JDBCBasedDataConnectorTest.scala
│ ├── execution
│ └── impl
│ │ ├── AccuracyMeasureTest.scala
│ │ ├── CompletenessMeasureTest.scala
│ │ ├── DuplicationMeasureTest.scala
│ │ ├── MeasureTest.scala
│ │ ├── ProfilingMeasureTest.scala
│ │ ├── SchemaConformanceMeasureTest.scala
│ │ └── SparkSqlMeasureTest.scala
│ ├── job
│ ├── BatchDQAppTest.scala
│ └── DQAppTest.scala
│ ├── sink
│ ├── CustomSink.scala
│ ├── CustomSinkTest.scala
│ └── SinkTestBase.scala
│ ├── step
│ ├── TransformStepTest.scala
│ └── builder
│ │ └── dsl
│ │ └── transform
│ │ └── CompletenessExpr2DQStepsTest.scala
│ ├── transformations
│ └── AccuracyTransformationsIntegrationTest.scala
│ └── utils
│ └── ParamUtilTest.scala
├── merge_pr.py
├── pom.xml
├── scalastyle-config.xml
├── service
├── hibernate_mysql_pom.xml
├── pom.xml
└── src
│ ├── main
│ ├── java
│ │ └── org
│ │ │ └── apache
│ │ │ └── griffin
│ │ │ └── core
│ │ │ ├── GriffinWebApplication.java
│ │ │ ├── common
│ │ │ └── SimpleCORSFilter.java
│ │ │ ├── config
│ │ │ ├── CacheConfig.java
│ │ │ ├── EclipseLinkJpaConfig.java
│ │ │ ├── EnvConfig.java
│ │ │ ├── LoginConfig.java
│ │ │ ├── PropertiesConfig.java
│ │ │ └── SchedulerConfig.java
│ │ │ ├── event
│ │ │ ├── EventPointcutType.java
│ │ │ ├── EventSourceType.java
│ │ │ ├── EventType.java
│ │ │ ├── GriffinAbstractEvent.java
│ │ │ ├── GriffinEvent.java
│ │ │ ├── GriffinEventManager.java
│ │ │ ├── GriffinHook.java
│ │ │ ├── JobEvent.java
│ │ │ └── JobEventHook.java
│ │ │ ├── exception
│ │ │ ├── GriffinException.java
│ │ │ ├── GriffinExceptionHandler.java
│ │ │ ├── GriffinExceptionMessage.java
│ │ │ └── GriffinExceptionResponse.java
│ │ │ ├── info
│ │ │ └── GriffinInfoController.java
│ │ │ ├── job
│ │ │ ├── BatchJobOperatorImpl.java
│ │ │ ├── FileExistPredicator.java
│ │ │ ├── JobController.java
│ │ │ ├── JobInstance.java
│ │ │ ├── JobOperator.java
│ │ │ ├── JobService.java
│ │ │ ├── JobServiceImpl.java
│ │ │ ├── LivyTaskSubmitHelper.java
│ │ │ ├── Predicator.java
│ │ │ ├── SparkSubmitJob.java
│ │ │ ├── StreamingJobOperatorImpl.java
│ │ │ ├── entity
│ │ │ │ ├── AbstractJob.java
│ │ │ │ ├── BatchJob.java
│ │ │ │ ├── JobDataSegment.java
│ │ │ │ ├── JobHealth.java
│ │ │ │ ├── JobInstanceBean.java
│ │ │ │ ├── JobState.java
│ │ │ │ ├── JobType.java
│ │ │ │ ├── LivyConf.java
│ │ │ │ ├── LivySessionStates.java
│ │ │ │ ├── SegmentPredicate.java
│ │ │ │ ├── SegmentRange.java
│ │ │ │ ├── StreamingJob.java
│ │ │ │ └── VirtualJob.java
│ │ │ ├── factory
│ │ │ │ ├── AutowiringSpringBeanJobFactory.java
│ │ │ │ └── PredicatorFactory.java
│ │ │ └── repo
│ │ │ │ ├── BaseJpaRepository.java
│ │ │ │ ├── BatchJobRepo.java
│ │ │ │ ├── JobDataSegmentRepo.java
│ │ │ │ ├── JobInstanceRepo.java
│ │ │ │ ├── JobRepo.java
│ │ │ │ ├── StreamingJobRepo.java
│ │ │ │ └── VirtualJobRepo.java
│ │ │ ├── login
│ │ │ ├── LoginController.java
│ │ │ ├── LoginService.java
│ │ │ ├── LoginServiceDefaultImpl.java
│ │ │ ├── LoginServiceLdapImpl.java
│ │ │ └── ldap
│ │ │ │ └── SelfSignedSocketFactory.java
│ │ │ ├── measure
│ │ │ ├── ExternalMeasureOperatorImpl.java
│ │ │ ├── GriffinMeasureOperatorImpl.java
│ │ │ ├── MeasureController.java
│ │ │ ├── MeasureOperator.java
│ │ │ ├── MeasureOrgController.java
│ │ │ ├── MeasureOrgService.java
│ │ │ ├── MeasureOrgServiceImpl.java
│ │ │ ├── MeasureService.java
│ │ │ ├── MeasureServiceImpl.java
│ │ │ ├── entity
│ │ │ │ ├── AbstractAuditableEntity.java
│ │ │ │ ├── DataConnector.java
│ │ │ │ ├── DataSource.java
│ │ │ │ ├── DqType.java
│ │ │ │ ├── EvaluateRule.java
│ │ │ │ ├── ExternalMeasure.java
│ │ │ │ ├── GriffinMeasure.java
│ │ │ │ ├── Measure.java
│ │ │ │ ├── Rule.java
│ │ │ │ └── StreamingPreProcess.java
│ │ │ └── repo
│ │ │ │ ├── DataConnectorRepo.java
│ │ │ │ ├── EvaluateRuleRepo.java
│ │ │ │ ├── ExternalMeasureRepo.java
│ │ │ │ ├── GriffinMeasureRepo.java
│ │ │ │ └── MeasureRepo.java
│ │ │ ├── metastore
│ │ │ ├── hive
│ │ │ │ ├── HiveMetaStoreController.java
│ │ │ │ ├── HiveMetaStoreProxy.java
│ │ │ │ ├── HiveMetaStoreService.java
│ │ │ │ ├── HiveMetaStoreServiceImpl.java
│ │ │ │ └── HiveMetaStoreServiceJdbcImpl.java
│ │ │ └── kafka
│ │ │ │ ├── KafkaSchemaController.java
│ │ │ │ ├── KafkaSchemaService.java
│ │ │ │ └── KafkaSchemaServiceImpl.java
│ │ │ ├── metric
│ │ │ ├── MetricController.java
│ │ │ ├── MetricService.java
│ │ │ ├── MetricServiceImpl.java
│ │ │ ├── MetricStore.java
│ │ │ ├── MetricStoreImpl.java
│ │ │ └── model
│ │ │ │ ├── Metric.java
│ │ │ │ └── MetricValue.java
│ │ │ └── util
│ │ │ ├── FSUtil.java
│ │ │ ├── FileUtil.java
│ │ │ ├── JsonUtil.java
│ │ │ ├── MeasureUtil.java
│ │ │ ├── PropertiesUtil.java
│ │ │ ├── TimeUtil.java
│ │ │ └── YarnNetUtil.java
│ └── resources
│ │ ├── Init_quartz_derby.sql
│ │ ├── Init_quartz_derby.sql.bak
│ │ ├── Init_quartz_h2.sql
│ │ ├── Init_quartz_mysql_innodb.sql
│ │ ├── Init_quartz_postgres.sql
│ │ ├── application-dev.properties
│ │ ├── application-docker.properties
│ │ ├── application-mysql.properties
│ │ ├── application-prod.properties
│ │ ├── application.properties
│ │ ├── assembly
│ │ └── assembly.xml
│ │ ├── banner.txt
│ │ ├── env
│ │ ├── env_batch.json
│ │ └── env_streaming.json
│ │ ├── hive-site.xml
│ │ ├── hivemetastore-site.xml
│ │ ├── hiveserver2-site.xml
│ │ ├── init_quartz_mysql.sql
│ │ ├── log4j2-spring.xml
│ │ ├── quartz.properties
│ │ ├── shell
│ │ ├── griffin.sh
│ │ ├── setenv.sh
│ │ ├── start.sh
│ │ └── stop.sh
│ │ └── sparkProperties.json
│ └── test
│ ├── java
│ └── org
│ │ └── apache
│ │ └── griffin
│ │ └── core
│ │ ├── config
│ │ ├── EclipseLinkJpaConfigForTest.java
│ │ └── PropertiesConfigTest.java
│ │ ├── info
│ │ └── GriffinInfoControllerTest.java
│ │ ├── job
│ │ ├── EventServiceTest.java
│ │ ├── FileExistPredicatorTest.java
│ │ ├── JobControllerTest.java
│ │ ├── JobInstanceBeanRepoTest.java
│ │ ├── JobInstanceTest.java
│ │ ├── JobServiceImplTest.java
│ │ ├── SparkSubmitJobTest.java
│ │ ├── entity
│ │ │ └── JobScheduleTest.java
│ │ ├── factory
│ │ │ └── PredicatorFactoryTest.java
│ │ └── repo
│ │ │ ├── JobInstanceRepoTest.java
│ │ │ └── JobRepoTest.java
│ │ ├── measure
│ │ ├── ExternalMeasureOperatorImplTest.java
│ │ ├── GriffinMeasureOperatorImplTest.java
│ │ ├── MeasureControllerTest.java
│ │ ├── MeasureOrgControllerTest.java
│ │ ├── MeasureOrgServiceImplTest.java
│ │ ├── MeasureServiceImplTest.java
│ │ └── repo
│ │ │ ├── DataConnectorRepoTest.java
│ │ │ └── MeasureRepoTest.java
│ │ ├── metastore
│ │ ├── hive
│ │ │ ├── HiveMetaStoreControllerTest.java
│ │ │ ├── HiveMetaStoreServiceImplTest.java
│ │ │ └── HiveMetastoreServiceJDBCImplTest.java
│ │ └── kafka
│ │ │ ├── KafkaSchemaControllerTest.java
│ │ │ └── KafkaSchemaServiceImplTest.java
│ │ ├── metric
│ │ ├── MetricControllerTest.java
│ │ ├── MetricServiceImplTest.java
│ │ └── MetricStoreImplTest.java
│ │ └── util
│ │ ├── EntityMocksHelper.java
│ │ ├── JsonUtilTest.java
│ │ ├── PredicatorMock.java
│ │ ├── PropertiesUtilTest.java
│ │ ├── TimeUtilTest.java
│ │ └── URLHelper.java
│ └── resources
│ ├── Init_quartz_h2_test.sql
│ ├── application.properties
│ ├── metricvalue.json
│ ├── quartz-test.sql
│ ├── quartz.properties
│ ├── sparkJob.properties
│ ├── sparkProperties.json
│ └── test.sql
└── ui
├── angular
├── .angular-cli.json
├── .editorconfig
├── .gitignore
├── karma.conf.js
├── package.json
├── protractor.conf.js
├── src
│ ├── app
│ │ ├── app.component.css
│ │ ├── app.component.html
│ │ ├── app.component.js
│ │ ├── app.component.spec.ts
│ │ ├── app.component.ts
│ │ ├── app.module.js
│ │ ├── app.module.ts
│ │ ├── dataasset
│ │ │ ├── dataasset.component.css
│ │ │ ├── dataasset.component.html
│ │ │ ├── dataasset.component.spec.ts
│ │ │ └── dataasset.component.ts
│ │ ├── health
│ │ │ ├── health.component.css
│ │ │ ├── health.component.html
│ │ │ ├── health.component.spec.ts
│ │ │ └── health.component.ts
│ │ ├── job
│ │ │ ├── create-job
│ │ │ │ ├── batch
│ │ │ │ │ ├── batch.component.css
│ │ │ │ │ ├── batch.component.html
│ │ │ │ │ ├── batch.component.spec.ts
│ │ │ │ │ └── batch.component.ts
│ │ │ │ └── streaming
│ │ │ │ │ ├── streaming.component.css
│ │ │ │ │ ├── streaming.component.html
│ │ │ │ │ ├── streaming.component.spec.ts
│ │ │ │ │ └── streaming.component.ts
│ │ │ ├── job-detail
│ │ │ │ ├── job-detail.component.css
│ │ │ │ ├── job-detail.component.html
│ │ │ │ ├── job-detail.component.spec.ts
│ │ │ │ └── job-detail.component.ts
│ │ │ ├── job.component.css
│ │ │ ├── job.component.html
│ │ │ ├── job.component.spec.ts
│ │ │ └── job.component.ts
│ │ ├── loader
│ │ │ ├── loader.component.css
│ │ │ ├── loader.component.html
│ │ │ ├── loader.component.spec.ts
│ │ │ ├── loader.component.ts
│ │ │ ├── loader.service.spec.ts
│ │ │ ├── loader.service.ts
│ │ │ └── loader.state.ts
│ │ ├── login
│ │ │ ├── login.component.css
│ │ │ ├── login.component.html
│ │ │ ├── login.component.spec.ts
│ │ │ └── login.component.ts
│ │ ├── measure
│ │ │ ├── create-measure
│ │ │ │ ├── ac
│ │ │ │ │ ├── ac.component.css
│ │ │ │ │ ├── ac.component.html
│ │ │ │ │ ├── ac.component.spec.ts
│ │ │ │ │ └── ac.component.ts
│ │ │ │ ├── configuration
│ │ │ │ │ ├── configuration.component.css
│ │ │ │ │ ├── configuration.component.html
│ │ │ │ │ ├── configuration.component.spec.ts
│ │ │ │ │ └── configuration.component.ts
│ │ │ │ ├── create-measure.component.css
│ │ │ │ ├── create-measure.component.html
│ │ │ │ ├── create-measure.component.spec.ts
│ │ │ │ ├── create-measure.component.ts
│ │ │ │ ├── pr
│ │ │ │ │ ├── confirmModal
│ │ │ │ │ │ ├── confirmModal.component.css
│ │ │ │ │ │ ├── confirmModal.component.html
│ │ │ │ │ │ ├── confirmModal.component.spec.ts
│ │ │ │ │ │ └── confirmModal.component.ts
│ │ │ │ │ ├── pr.component.css
│ │ │ │ │ ├── pr.component.html
│ │ │ │ │ ├── pr.component.spec.ts
│ │ │ │ │ ├── pr.component.ts
│ │ │ │ │ ├── rule
│ │ │ │ │ │ ├── rule.component.css
│ │ │ │ │ │ ├── rule.component.html
│ │ │ │ │ │ ├── rule.component.spec.ts
│ │ │ │ │ │ └── rule.component.ts
│ │ │ │ │ ├── step1
│ │ │ │ │ │ ├── step1.component.css
│ │ │ │ │ │ ├── step1.component.html
│ │ │ │ │ │ ├── step1.component.spec.ts
│ │ │ │ │ │ └── step1.component.ts
│ │ │ │ │ ├── step2
│ │ │ │ │ │ ├── step2.component.css
│ │ │ │ │ │ ├── step2.component.html
│ │ │ │ │ │ ├── step2.component.spec.ts
│ │ │ │ │ │ └── step2.component.ts
│ │ │ │ │ ├── step3
│ │ │ │ │ │ ├── step3.component.css
│ │ │ │ │ │ ├── step3.component.html
│ │ │ │ │ │ ├── step3.component.spec.ts
│ │ │ │ │ │ └── step3.component.ts
│ │ │ │ │ └── step4
│ │ │ │ │ │ ├── step4.component.css
│ │ │ │ │ │ ├── step4.component.html
│ │ │ │ │ │ ├── step4.component.spec.ts
│ │ │ │ │ │ └── step4.component.ts
│ │ │ │ ├── pub
│ │ │ │ │ ├── pub.component.css
│ │ │ │ │ ├── pub.component.html
│ │ │ │ │ ├── pub.component.spec.ts
│ │ │ │ │ └── pub.component.ts
│ │ │ │ └── raw
│ │ │ │ │ ├── raw.component.css
│ │ │ │ │ ├── raw.component.html
│ │ │ │ │ ├── raw.component.spec.ts
│ │ │ │ │ └── raw.component.ts
│ │ │ ├── measure-detail
│ │ │ │ ├── measure-detail.component.css
│ │ │ │ ├── measure-detail.component.html
│ │ │ │ ├── measure-detail.component.spec.ts
│ │ │ │ └── measure-detail.component.ts
│ │ │ ├── measure.component.css
│ │ │ ├── measure.component.html
│ │ │ ├── measure.component.spec.ts
│ │ │ └── measure.component.ts
│ │ ├── metric
│ │ │ ├── detail-metric
│ │ │ │ ├── detail-metric.component.css
│ │ │ │ ├── detail-metric.component.html
│ │ │ │ ├── detail-metric.component.spec.ts
│ │ │ │ └── detail-metric.component.ts
│ │ │ ├── metric.component.css
│ │ │ ├── metric.component.html
│ │ │ ├── metric.component.spec.ts
│ │ │ └── metric.component.ts
│ │ ├── mydashboard
│ │ │ ├── mydashboard.component.css
│ │ │ ├── mydashboard.component.html
│ │ │ ├── mydashboard.component.spec.ts
│ │ │ └── mydashboard.component.ts
│ │ ├── service
│ │ │ ├── chart.service.spec.ts
│ │ │ ├── chart.service.ts
│ │ │ ├── http.service.spec.ts
│ │ │ ├── http.service.ts
│ │ │ ├── measure-format.service.ts
│ │ │ ├── service.service.spec.ts
│ │ │ ├── service.service.ts
│ │ │ ├── user.service.spec.ts
│ │ │ └── user.service.ts
│ │ ├── shared
│ │ │ ├── shared.module.ts
│ │ │ └── time-utils.ts
│ │ └── sidebar
│ │ │ ├── sidebar.component.css
│ │ │ ├── sidebar.component.html
│ │ │ ├── sidebar.component.spec.ts
│ │ │ ├── sidebar.component.ts
│ │ │ └── truncate.pipe.ts
│ ├── assets
│ │ ├── .gitkeep
│ │ └── img
│ │ │ ├── favicon.ico
│ │ │ ├── logo.gif
│ │ │ └── logo.png
│ ├── environments
│ │ ├── environment.js
│ │ ├── environment.prod.ts
│ │ └── environment.ts
│ ├── favicon.ico
│ ├── index.html
│ ├── main.js
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles.css
│ ├── test.html
│ ├── test.ts
│ ├── tsconfig.app.json
│ ├── tsconfig.spec.json
│ ├── typings.d.ts
│ └── vendor.ts
├── tsconfig.json
├── tslint.json
└── webpack.config.js
└── pom.xml
/.github/workflows/greetings.yml:
--------------------------------------------------------------------------------
1 | name: Greetings
2 |
3 | on: [ pull_request, issues ]
4 |
5 | jobs:
6 | greeting:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/first-interaction@v1
10 | with:
11 | repo-token: ${{ secrets.GITHUB_TOKEN }}
12 | pr-message: >
13 | Automated Message: Congratulations on raising your first Pull Request!
14 | One of the committers will review this at the earliest.
15 |
16 | Your contributions are greatly appreciated!
17 |
--------------------------------------------------------------------------------
/.github/workflows/stale.yml:
--------------------------------------------------------------------------------
1 | name: "Close stale PRs"
2 | on:
3 | schedule:
4 | - cron: "0 0 * * *"
5 |
6 | jobs:
7 | stale:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Check stale PRs
11 | uses: actions/stale@v3
12 | with:
13 | repo-token: ${{ secrets.GITHUB_TOKEN }}
14 | stale-pr-message: >
15 | Automated Message: This PR is being labelled as stale and will be closed in
16 | next 15 days due to lack of activity. To avoid this push new commits or
17 | ask the committers for a review/ resolution.
18 | close-pr-message: >
19 | Automated Message: We're closing this PR because it hasn't been updated in a while.
20 | This isn't a judgement on the merit of the PR in any way. It's just
21 | a way of keeping the PR queue manageable.
22 |
23 | If you'd like to revive this PR, please reopen it and ask a
24 | committer to remove the 'no-pr-activity' tag!
25 | days-before-stale: 30
26 | days-before-close: 15
27 | stale-pr-label: 'no-pr-activity'
28 | exempt-pr-labels: 'awaiting-approval,work-in-progress,wip'
29 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.class
2 | *.iml
3 | .idea/
4 | .DS_Store
5 | .java-version
6 | target/**
7 |
8 | # Mobile Tools for Java (J2ME)
9 | .mtj.tmp/
10 |
11 | # Package Files #
12 | *.jar
13 | *.war
14 | *.ear
15 | *.cfg
16 | target
17 | service/src/main/resources/public/
18 | ui/.tmp/
19 |
20 |
21 | .project
22 | .settings/
23 | .classpath
24 | bin
25 | **/site-packages/**
26 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
27 | hs_err_pid*
28 | # don't need binary
29 | ui/bower_components/*
30 |
31 |
32 |
33 |
34 | ui/node_modules/*
35 | ui/debug.log
36 | ui/package-lock.json
37 | ui/tmp
38 |
39 | derby.log
40 | metastore_db
41 |
42 | measure/src/test/test_scala/*
43 |
44 | .vscode
45 |
46 | environment.local.ts
47 | logs/
48 | venv
49 |
--------------------------------------------------------------------------------
/.scalafmt.conf:
--------------------------------------------------------------------------------
1 | #
2 | # Licensed to the Apache Software Foundation (ASF) under one or more
3 | # contributor license agreements. See the NOTICE file distributed with
4 | # this work for additional information regarding copyright ownership.
5 | # The ASF licenses this file to You under the Apache License, Version 2.0
6 | # (the "License"); you may not use this file except in compliance with
7 | # the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | # Unless required by applicable law or agreed to in writing, software
12 | # distributed under the License is distributed on an "AS IS" BASIS,
13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | # See the License for the specific language governing permissions and
15 | # limitations under the License.
16 | #
17 |
18 | align = none
19 | align.openParenDefnSite = false
20 | align.openParenCallSite = false
21 | align.tokens = []
22 | optIn = {
23 | configStyleArguments = false
24 | }
25 | danglingParentheses = false
26 | docstrings = JavaDoc
27 | maxColumn = 98
28 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | # Licensed to the Apache Software Foundation (ASF) under one or more contributor license
2 | # agreements. See the NOTICE file distributed with this work for additional information regarding
3 | # copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the
4 | # "License"); you may not use this file except in compliance with the License. You may obtain a
5 | # copy of the License at
6 | #
7 | # http://www.apache.org/licenses/LICENSE-2.0
8 | #
9 | # Unless required by applicable law or agreed to in writing, software distributed under the License
10 | # is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11 | # or implied. See the License for the specific language governing permissions and limitations under
12 | # the License.
13 |
14 | language: java scala node_js
15 |
16 | services:
17 | - docker
18 |
19 | env:
20 | - COMPOSE_FILE=griffin-doc/docker/compose/docker-compose-batch.yml
21 |
22 | jdk:
23 | - openjdk8
24 | scala:
25 | - 2.10.6
26 | node_js:
27 | - "6"
28 | git:
29 | quiet: true
30 | cache:
31 | directories:
32 | - $HOME/.m2
33 |
34 | install:
35 | - npm install -g bower
36 |
37 | before_script:
38 | - docker-compose up -d
39 |
40 |
41 | # keep 30, need change according to ci logs.
42 | script:
43 | - export MAVEN_SKIP_RC=true
44 | - export MAVEN_OPTS=" -Xmx1g -XX:ReservedCodeCacheSize=128m -Dorg.slf4j.simpleLogger.defaultLogLevel=warn -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
45 | - mvn -B clean test -Dlogging.level.org.springframework=WARN
46 |
47 |
--------------------------------------------------------------------------------
/NOTICE:
--------------------------------------------------------------------------------
1 | Apache Griffin
2 | Copyright 2017-2018 The Apache Software Foundation
3 |
4 | This product includes software developed at
5 | The Apache Software Foundation (http://www.apache.org/).
--------------------------------------------------------------------------------
/dev/requirements.txt:
--------------------------------------------------------------------------------
1 | certifi==2020.12.5
2 | cffi==1.14.5
3 | chardet==4.0.0
4 | cryptography==3.4.6
5 | defusedxml==0.7.1
6 | idna==3.7
7 | jira==2.0.0
8 | oauthlib==3.1.0
9 | pbr==5.5.1
10 | pycparser==2.20
11 | PyJWT==2.0.1
12 | requests==2.32.0
13 | requests-oauthlib==1.3.0
14 | requests-toolbelt==0.9.1
15 | six==1.15.0
16 | urllib3==1.26.19
17 |
--------------------------------------------------------------------------------
/griffin-doc/arch2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/arch2.png
--------------------------------------------------------------------------------
/griffin-doc/docker/compose/docker-compose-batch.yml:
--------------------------------------------------------------------------------
1 | #Licensed to the Apache Software Foundation (ASF) under one
2 | #or more contributor license agreements. See the NOTICE file
3 | #distributed with this work for additional information
4 | #regarding copyright ownership. The ASF licenses this file
5 | #to you under the Apache License, Version 2.0 (the
6 | #"License"); you may not use this file except in compliance
7 | #with the License. You may obtain a copy of the License at
8 | #
9 | # http://www.apache.org/licenses/LICENSE-2.0
10 | #
11 | #Unless required by applicable law or agreed to in writing,
12 | #software distributed under the License is distributed on an
13 | #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 | #KIND, either express or implied. See the License for the
15 | #specific language governing permissions and limitations
16 | #under the License.
17 |
18 | griffin:
19 | image: apachegriffin/griffin_spark2:0.3.0
20 | hostname: griffin
21 | links:
22 | - es
23 | environment:
24 | ES_HOSTNAME: es
25 | volumes:
26 | - /var/lib/mysql
27 | ports:
28 | - 32122:2122
29 | - 38088:8088 # yarn rm web ui
30 | - 33306:3306 # mysql
31 | - 35432:5432 # postgres
32 | - 38042:8042 # yarn nm web ui
33 | - 39083:9083 # hive-metastore
34 | - 38998:8998 # livy
35 | - 38080:8080 # griffin ui
36 | tty: true
37 | container_name: griffin
38 |
39 | es:
40 | image: apachegriffin/elasticsearch
41 | hostname: es
42 | ports:
43 | - 39200:9200
44 | - 39300:9300
45 | container_name: es
--------------------------------------------------------------------------------
/griffin-doc/img/arch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/arch.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/add-job.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/add-job.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/add-measure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/add-measure.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/call_postman.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/call_postman.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/check-run-idea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/check-run-idea.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/config-addition-idea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/config-addition-idea.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/import_postman_conf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/import_postman_conf.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/revise_postman_env.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/revise_postman_env.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/1.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/2.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/3.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/4.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/5.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/scala-intellij-idea/6.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/scala-intellij-idea/6.png
--------------------------------------------------------------------------------
/griffin-doc/img/devguide/style-check-plugin-idea.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/devguide/style-check-plugin-idea.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/Capture.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/Capture.PNG
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/ac_partition.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/ac_partition.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/accuracy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/accuracy.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/asset list.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/asset list.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/confirm job.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/confirm job.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/confirm measure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/confirm measure.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/create job.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/create job.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/create measure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/create measure.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/dashboard big.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/dashboard big.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/data asset new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/data asset new.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/dq metrics.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/dq metrics.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/heatmap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/heatmap.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/job config.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/job config.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/mapping.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/measure info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/measure info.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/metrics dashboard.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/metrics dashboard.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/right bar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/right bar.png
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/source.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/source.PNG
--------------------------------------------------------------------------------
/griffin-doc/img/userguide/target.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/griffin-doc/img/userguide/target.PNG
--------------------------------------------------------------------------------
/griffin-doc/service/postman/griffin_environment.json:
--------------------------------------------------------------------------------
1 | {
2 | "id": "b0a42a84-0418-4bb6-226d-ca9d6d5f23d7",
3 | "name": "Griffin Environment",
4 | "values": [
5 | {
6 | "enabled": true,
7 | "key": "BASE_PATH",
8 | "value": "http://localhost:8080",
9 | "type": "text"
10 | }
11 | ],
12 | "timestamp": 1508998036167,
13 | "_postman_variable_scope": "environment",
14 | "_postman_exported_at": "2017-10-30T01:58:11.275Z",
15 | "_postman_exported_using": "Postman/5.3.2"
16 | }
--------------------------------------------------------------------------------
/measure/src/main/resources/config-batch-advanced.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "accu_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "config": {
12 | "file.name": "src/test/resources/users_info_src.avro"
13 | }
14 | }
15 | },
16 | {
17 | "name": "target",
18 | "connector": {
19 | "type": "avro",
20 | "version": "1.7",
21 | "config": {
22 | "file.name": "src/test/resources/users_info_target.avro"
23 | }
24 | }
25 | }
26 | ],
27 | "evaluate.rule": {
28 | "rules": [
29 | {
30 | "dsl.type": "griffin-dsl",
31 | "dq.type": "accuracy",
32 | "out.dataframe.name": "accu",
33 | "rule": "source.user_id = target.user_id AND upper(source.first_name) = upper(target.first_name) AND source.last_name = target.last_name AND source.address = target.address AND source.email = target.email AND source.phone = target.phone AND source.post_code = target.post_code",
34 | "details": {
35 | "source": "source",
36 | "target": "target",
37 | "miss": "miss_count",
38 | "total": "total_count",
39 | "matched": "matched_count"
40 | },
41 | "out": [
42 | {
43 | "type": "metric",
44 | "name": "accu"
45 | },
46 | {
47 | "type": "record",
48 | "name": "missRecords"
49 | }
50 | ]
51 | }
52 | ]
53 | },
54 | "sinks": [
55 | "consoleSink",
56 | "elasticSink"
57 | ]
58 | }
59 |
--------------------------------------------------------------------------------
/measure/src/main/resources/config-batch-es.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "accu_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "elasticsearch",
10 | "config": {
11 | "selectionExprs": [
12 | "account_number",
13 | "city",
14 | "gender",
15 | "age > 18"
16 | ],
17 | "filterExprs": [
18 | "account_number < 10"
19 | ],
20 | "paths": [
21 | "bank",
22 | "customer"
23 | ],
24 | "options": {
25 | "es.nodes": "localhost",
26 | "es.port": 9200
27 | }
28 | }
29 | }
30 | }
31 | ],
32 | "evaluate.rule": {
33 | "rules": [
34 | {
35 | "dsl.type": "griffin-dsl",
36 | "dq.type": "completeness",
37 | "out.dataframe.name": "comp_df",
38 | "rule": "account_number, city",
39 | "out": [
40 | {
41 | "type": "metric",
42 | "name": "comp_metric",
43 | "flatten": "map"
44 | }
45 | ]
46 | }
47 | ]
48 | },
49 | "sinks": [
50 | "consoleSink"
51 | ]
52 | }
53 |
--------------------------------------------------------------------------------
/measure/src/main/resources/config-batch-old.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "accu_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "config": {
12 | "file.name": "measure/src/test/resources/users_info_src.avro"
13 | }
14 | }
15 | },
16 | {
17 | "name": "target",
18 | "connector": {
19 | "type": "avro",
20 | "version": "1.7",
21 | "config": {
22 | "file.name": "measure/src/test/resources/users_info_target.avro"
23 | }
24 | }
25 | }
26 | ],
27 | "evaluate.rule": {
28 | "rules": [
29 | {
30 | "dsl.type": "griffin-dsl",
31 | "dq.type": "accuracy",
32 | "out.dataframe.name": "accu",
33 | "rule": "source.user_id = target.user_id AND upper(source.first_name) = upper(target.first_name) AND source.last_name = target.last_name AND source.address = target.address AND source.email = target.email AND source.phone = target.phone AND source.post_code = target.post_code"
34 | }
35 | ]
36 | },
37 | "sinks": [
38 | "consoleSink",
39 | "elasticSink"
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/measure/src/main/resources/config-batch-path.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "accu_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "config": {
12 | "file.path": "measure/src/test/resources/users_info_src"
13 | }
14 | }
15 | },
16 | {
17 | "name": "target",
18 | "connector": {
19 | "type": "avro",
20 | "version": "1.7",
21 | "config": {
22 | "file.path": "measure/src/test/resources/users_info_target"
23 | }
24 | }
25 | }
26 | ],
27 | "evaluate.rule": {
28 | "rules": [
29 | {
30 | "dsl.type": "griffin-dsl",
31 | "dq.type": "accuracy",
32 | "out.dataframe.name": "accu",
33 | "rule": "source.user_id = target.user_id AND upper(source.first_name) = upper(target.first_name) AND source.last_name = target.last_name AND source.address = target.address AND source.email = target.email AND source.phone = target.phone AND source.post_code = target.post_code"
34 | }
35 | ]
36 | },
37 | "sinks": [
38 | "consoleSink",
39 | "elasticSink"
40 | ]
41 | }
42 |
--------------------------------------------------------------------------------
/measure/src/main/resources/config-batch-preproc.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "Batch-Preprocessing-Example",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "crime_report_source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "file",
10 | "config": {
11 | "format": "text",
12 | "paths": [
13 | "measure/src/main/resources/crime_report.csv"
14 | ]
15 | },
16 | "pre.proc": [
17 | "select split(value, ',') as part from this",
18 | "select part[0] as date_time, part[1] as incident, part[2] as address, part[3] as city, part[4] as zipcode from this",
19 | "select cast(date_time as timestamp) as date_time, incident, address, city, cast(zipcode as int) as zipcode from this"
20 | ]
21 | }
22 | }
23 | ],
24 | "measures": [
25 | {
26 | "name": "completeness_measure",
27 | "type": "completeness",
28 | "data.source": "crime_report_source",
29 | "config": {
30 | "expr": "zipcode is null OR city is null"
31 | },
32 | "out": [
33 | {
34 | "type": "metric",
35 | "name": "comp_metric",
36 | "flatten": "map"
37 | },
38 | {
39 | "type": "record",
40 | "name": "comp_records"
41 | }
42 | ]
43 | }
44 | ],
45 | "sinks": [
46 | "consoleSink"
47 | ]
48 | }
49 |
--------------------------------------------------------------------------------
/measure/src/main/resources/crime_report_truth.csv:
--------------------------------------------------------------------------------
1 | city_name
2 | PALO ALTO
--------------------------------------------------------------------------------
/measure/src/main/resources/env-batch.json:
--------------------------------------------------------------------------------
1 | {
2 | "spark": {
3 | "log.level": "WARN",
4 | "config": {
5 | "spark.master": "local[*]"
6 | }
7 | },
8 | "sinks": [
9 | {
10 | "name": "consoleSink",
11 | "type": "CONSOLE",
12 | "config": {
13 | "numRows": 20
14 | }
15 | },
16 | {
17 | "name": "hdfs",
18 | "type": "HDFS",
19 | "config": {
20 | "path": "hdfs://localhost/griffin/batch/persist",
21 | "max.persist.lines": 10000,
22 | "max.lines.per.file": 10000
23 | }
24 | },
25 | {
26 | "name": "elasticsearch",
27 | "type": "ELASTICSEARCH",
28 | "config": {
29 | "method": "post",
30 | "api": "http://localhost:9200/griffin/accuracy",
31 | "connection.timeout": "1m",
32 | "retry": 10
33 | }
34 | }
35 | ],
36 | "griffin.checkpoint": []
37 | }
38 |
--------------------------------------------------------------------------------
/measure/src/main/resources/log4j.properties:
--------------------------------------------------------------------------------
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 | log4j.rootLogger=INFO, stdout
20 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
21 | log4j.appender.stdout.Target=System.out
22 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
23 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%c] - %m%n
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/dqdefinition/Param.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.dqdefinition
19 |
20 | trait Param extends Serializable {
21 |
22 | /**
23 | * validate param internally
24 | */
25 | def validate(): Unit
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/dqdefinition/reader/ParamJsonReader.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.dqdefinition.reader
19 |
20 | import scala.reflect.ClassTag
21 | import scala.util.Try
22 |
23 | import org.apache.griffin.measure.configuration.dqdefinition.Param
24 | import org.apache.griffin.measure.utils.JsonUtil
25 |
26 | /**
27 | * read params from json string directly
28 | *
29 | * @param jsonString
30 | */
31 | case class ParamJsonReader(jsonString: String) extends ParamReader {
32 |
33 | def readConfig[T <: Param](implicit m: ClassTag[T]): Try[T] = {
34 | Try {
35 | val param = JsonUtil.fromJson[T](jsonString)
36 | validate(param)
37 | }
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/enums/GriffinEnum.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.enums
19 |
20 | trait GriffinEnum extends Enumeration {
21 | type GriffinEnum = Value
22 |
23 | val Unknown: Value = Value
24 |
25 | /**
26 | *
27 | * @param name Constant value in String
28 | * @return Enum constant value
29 | */
30 | def withNameWithDefault(name: String): Value =
31 | values
32 | .find(_.toString.toLowerCase == name.replace("-", "").toLowerCase())
33 | .getOrElse(Unknown)
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/enums/MeasureTypes.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.enums
19 |
20 | /**
21 | * Types of Griffin measures.
22 | *
- The completeness of data source based on user defined expressions
23 | */
24 | object MeasureTypes extends GriffinEnum {
25 |
26 | type MeasureType = Value
27 |
28 | val Completeness, Duplication, Profiling, Accuracy, SparkSQL, SchemaConformance = Value
29 |
30 | override def withNameWithDefault(name: String): MeasureType = {
31 | super.withNameWithDefault(name)
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/enums/ProcessType.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.enums
19 |
20 | import org.apache.griffin.measure.configuration.enums
21 |
22 | /**
23 | * process type enum
24 | * - Process in batch mode
25 | * - Process in streaming mode
26 | */
27 | object ProcessType extends GriffinEnum {
28 | type ProcessType = Value
29 |
30 | val BatchProcessType: enums.ProcessType.Value = Value("Batch")
31 | val StreamingProcessType: enums.ProcessType.Value = Value("Streaming")
32 | }
33 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/configuration/enums/WriteMode.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.configuration.enums
19 |
20 | /**
21 | * write mode when write metrics and records
22 | */
23 | sealed trait WriteMode {}
24 |
25 | object WriteMode {
26 | def defaultMode(procType: ProcessType.ProcessType): WriteMode = {
27 | procType match {
28 | case ProcessType.BatchProcessType => SimpleMode
29 | case ProcessType.StreamingProcessType => TimestampMode
30 | }
31 | }
32 | }
33 |
34 | /**
35 | * simple mode: write metrics and records directly
36 | */
37 | case object SimpleMode extends WriteMode {}
38 |
39 | /**
40 | * timestamp mode: write metrics and records with timestamp information
41 | */
42 | case object TimestampMode extends WriteMode {}
43 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/context/ContextId.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.context
19 |
20 | /**
21 | * context id, unique by different timestamp and tag
22 | */
23 | case class ContextId(timestamp: Long, tag: String = "") extends Serializable {
24 | def id: String = {
25 | if (tag.nonEmpty) s"${tag}_$timestamp" else s"$timestamp"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/context/streaming/checkpoint/lock/CheckpointLock.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.context.streaming.checkpoint.lock
19 |
20 | import java.util.concurrent.TimeUnit
21 |
22 | import org.apache.griffin.measure.Loggable
23 |
24 | /**
25 | * lock for checkpoint
26 | */
27 | trait CheckpointLock extends Loggable with Serializable {
28 |
29 | def lock(outtime: Long, unit: TimeUnit): Boolean
30 |
31 | def unlock(): Unit
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/context/streaming/checkpoint/lock/CheckpointLockSeq.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.context.streaming.checkpoint.lock
19 |
20 | import java.util.concurrent.TimeUnit
21 |
22 | case class CheckpointLockSeq(locks: Seq[CheckpointLock]) extends CheckpointLock {
23 |
24 | def lock(outtime: Long, unit: TimeUnit): Boolean = {
25 | locks.headOption.forall(_.lock(outtime, unit))
26 | }
27 |
28 | def unlock(): Unit = {
29 | locks.headOption.foreach(_.unlock())
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/context/streaming/checkpoint/offset/OffsetCheckpoint.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.context.streaming.checkpoint.offset
19 |
20 | import org.apache.griffin.measure.Loggable
21 | import org.apache.griffin.measure.context.streaming.checkpoint.lock.CheckpointLock
22 |
23 | trait OffsetCheckpoint extends Loggable with Serializable {
24 |
25 | def init(): Unit
26 | def available(): Boolean
27 | def close(): Unit
28 |
29 | def cache(kvs: Map[String, String]): Unit
30 | def read(keys: Iterable[String]): Map[String, String]
31 | def delete(keys: Iterable[String]): Unit
32 | def clear(): Unit
33 |
34 | def listKeys(path: String): List[String]
35 |
36 | def genLock(s: String): CheckpointLock
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/context/streaming/metric/Metric.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.context.streaming.metric
19 |
20 | trait Metric extends Serializable {
21 |
22 | type T <: Metric
23 |
24 | def isLegal: Boolean = true
25 |
26 | def update(delta: T): T
27 |
28 | def initial(): Boolean
29 |
30 | def eventual(): Boolean
31 |
32 | def differsFrom(other: T): Boolean
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/datasource/cache/StreamingCacheJsonClient.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.datasource.cache
19 |
20 | import org.apache.spark.sql._
21 |
22 | import org.apache.griffin.measure.datasource.TimestampStorage
23 |
24 | /**
25 | * data source cache in json format
26 | */
27 | case class StreamingCacheJsonClient(
28 | sparkSession: SparkSession,
29 | param: Map[String, Any],
30 | dsName: String,
31 | index: Int,
32 | timestampStorage: TimestampStorage)
33 | extends StreamingCacheClient {
34 |
35 | protected def writeDataFrame(dfw: DataFrameWriter[Row], path: String): Unit = {
36 | info(s"write path: $path")
37 | dfw.json(path)
38 | }
39 |
40 | protected def readDataFrame(dfr: DataFrameReader, path: String): DataFrame = {
41 | dfr.json(path)
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/datasource/cache/StreamingCacheOrcClient.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.datasource.cache
19 |
20 | import org.apache.spark.sql._
21 |
22 | import org.apache.griffin.measure.datasource.TimestampStorage
23 |
24 | /**
25 | * data source cache in orc format
26 | */
27 | case class StreamingCacheOrcClient(
28 | sparkSession: SparkSession,
29 | param: Map[String, Any],
30 | dsName: String,
31 | index: Int,
32 | timestampStorage: TimestampStorage)
33 | extends StreamingCacheClient {
34 |
35 | protected def writeDataFrame(dfw: DataFrameWriter[Row], path: String): Unit = {
36 | info(s"write path: $path")
37 | dfw.orc(path)
38 | }
39 |
40 | protected def readDataFrame(dfr: DataFrameReader, path: String): DataFrame = {
41 | dfr.orc(path)
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/datasource/connector/batch/BatchDataConnector.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.datasource.connector.batch
19 |
20 | import org.apache.griffin.measure.datasource.connector.DataConnector
21 |
22 | trait BatchDataConnector extends DataConnector {
23 |
24 | def init(): Unit = {}
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/job/DQJob.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.job
19 |
20 | import scala.util.{Failure, Success, Try}
21 |
22 | import org.apache.griffin.measure.context.DQContext
23 | import org.apache.griffin.measure.step.DQStep
24 |
25 | case class DQJob(dqSteps: Seq[DQStep]) extends Serializable {
26 |
27 | def execute(context: DQContext): Try[Boolean] = {
28 | dqSteps
29 | .map(_.execute(context))
30 | .foldLeft(Try(true)) { (ret, stepResult) =>
31 | (ret, stepResult) match {
32 | case (Success(_), nextResult) => nextResult
33 | case (Failure(_), _) => ret
34 | }
35 | }
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/DQStep.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step
19 |
20 | import scala.util.Try
21 |
22 | import org.apache.griffin.measure.Loggable
23 | import org.apache.griffin.measure.context.DQContext
24 |
25 | trait DQStep extends Loggable {
26 |
27 | val name: String
28 |
29 | /**
30 | * @return execution success
31 | */
32 | def execute(context: DQContext): Try[Boolean]
33 |
34 | def getNames: Seq[String] = name :: Nil
35 |
36 | }
37 |
38 | object DQStepStatus extends Enumeration {
39 | val PENDING: DQStepStatus.Value = Value
40 | val RUNNING: DQStepStatus.Value = Value
41 | val COMPLETE: DQStepStatus.Value = Value
42 | val FAILED: DQStepStatus.Value = Value
43 | }
44 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/BatchDataSourceStepBuilder.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder
19 |
20 | import org.apache.griffin.measure.configuration.dqdefinition._
21 | import org.apache.griffin.measure.context.DQContext
22 | import org.apache.griffin.measure.step.read.ReadStep
23 |
24 | case class BatchDataSourceStepBuilder() extends DataSourceParamStepBuilder {
25 |
26 | def buildReadSteps(context: DQContext, dcParam: DataConnectorParam): Option[ReadStep] = {
27 | None
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/ConstantColumns.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder
19 |
20 | /**
21 | * for griffin dsl rules, the constant columns might be used during calculation,
22 | */
23 | object ConstantColumns {
24 | val tmst = "__tmst"
25 | val metric = "__metric"
26 | val record = "__record"
27 | val empty = "__empty"
28 |
29 | val beginTs = "__begin_ts"
30 | val endTs = "__end_ts"
31 |
32 | val distinct = "__distinct"
33 |
34 | val rowNumber = "__rn"
35 |
36 | val columns: List[String] =
37 | List[String](tmst, metric, record, empty, beginTs, endTs, distinct, rowNumber)
38 | }
39 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/DQStepNameGenerator.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder
19 |
20 | import java.util.concurrent.atomic.AtomicLong
21 |
22 | object DQStepNameGenerator {
23 | private val counter: AtomicLong = new AtomicLong(0L)
24 | private val head: String = "step"
25 |
26 | def genName: String = {
27 | s"$head$increment"
28 | }
29 |
30 | private def increment: Long = {
31 | counter.incrementAndGet()
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/SparkSqlDQStepBuilder.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder
19 |
20 | import org.apache.griffin.measure.configuration.dqdefinition.RuleParam
21 | import org.apache.griffin.measure.context.DQContext
22 | import org.apache.griffin.measure.step.DQStep
23 | import org.apache.griffin.measure.step.transform.SparkSqlTransformStep
24 |
25 | case class SparkSqlDQStepBuilder() extends RuleParamStepBuilder {
26 |
27 | def buildSteps(context: DQContext, ruleParam: RuleParam): Seq[DQStep] = {
28 | val name = getStepName(ruleParam.getOutDfName())
29 | val transformStep = SparkSqlTransformStep(
30 | name,
31 | ruleParam.getRule,
32 | ruleParam.getDetails,
33 | None,
34 | ruleParam.getCache)
35 | transformStep +: buildDirectWriteSteps(ruleParam)
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/StreamingDataSourceStepBuilder.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder
19 |
20 | import org.apache.griffin.measure.configuration.dqdefinition._
21 | import org.apache.griffin.measure.context.DQContext
22 | import org.apache.griffin.measure.step.read.ReadStep
23 |
24 | case class StreamingDataSourceStepBuilder() extends DataSourceParamStepBuilder {
25 |
26 | def buildReadSteps(context: DQContext, dcParam: DataConnectorParam): Option[ReadStep] = {
27 | None
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/dsl/expr/AliasableExpr.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder.dsl.expr
19 |
20 | trait AliasableExpr extends Expr {
21 |
22 | def alias: Option[String]
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/dsl/expr/Expr.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder.dsl.expr
19 |
20 | /**
21 | * expr parsed by griffin dsl
22 | */
23 | trait Expr extends TreeNode with ExprTag with Serializable {
24 |
25 | def desc: String
26 |
27 | def coalesceDesc: String
28 |
29 | def extractSelf: Expr = this
30 |
31 | // execution
32 | def map(func: Expr => Expr): Expr = func(this)
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/dsl/expr/ExprTag.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder.dsl.expr
19 |
20 | trait ExprTag { this: Expr =>
21 | var tag: String = ""
22 | }
23 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/builder/dsl/expr/ExtraConditionExpr.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.builder.dsl.expr
19 |
20 | case class ExtraConditionExpr(cdtn: String) extends Expr {
21 |
22 | def desc: String = cdtn.toUpperCase
23 |
24 | def coalesceDesc: String = desc
25 |
26 | }
27 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/read/UnionReadStep.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.read
19 |
20 | import org.apache.spark.sql._
21 |
22 | import org.apache.griffin.measure.context.DQContext
23 | import org.apache.griffin.measure.utils.DataFrameUtil._
24 |
25 | case class UnionReadStep(name: String, readSteps: Seq[ReadStep]) extends ReadStep {
26 |
27 | val config: Map[String, Any] = Map()
28 | val cache: Boolean = false
29 |
30 | def read(context: DQContext): Option[DataFrame] = {
31 | val dfOpts = readSteps.map { readStep =>
32 | readStep.read(context)
33 | }
34 | if (dfOpts.nonEmpty) {
35 | dfOpts.reduce((a, b) => unionDfOpts(a, b))
36 | } else None
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/step/write/WriteStep.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.step.write
19 |
20 | import org.apache.griffin.measure.step.DQStep
21 |
22 | trait WriteStep extends DQStep {
23 |
24 | val inputName: String
25 |
26 | val writeTimestampOpt: Option[Long]
27 |
28 | override def getNames: Seq[String] = Nil
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/measure/src/main/scala/org/apache/griffin/measure/utils/DataFrameUtil.scala:
--------------------------------------------------------------------------------
1 | /*
2 | * Licensed to the Apache Software Foundation (ASF) under one or more
3 | * contributor license agreements. See the NOTICE file distributed with
4 | * this work for additional information regarding copyright ownership.
5 | * The ASF licenses this file to You under the Apache License, Version 2.0
6 | * (the "License"); you may not use this file except in compliance with
7 | * the License. You may obtain a copy of the License at
8 | *
9 | * http://www.apache.org/licenses/LICENSE-2.0
10 | *
11 | * Unless required by applicable law or agreed to in writing, software
12 | * distributed under the License is distributed on an "AS IS" BASIS,
13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 | * See the License for the specific language governing permissions and
15 | * limitations under the License.
16 | */
17 |
18 | package org.apache.griffin.measure.utils
19 |
20 | import org.apache.spark.sql.DataFrame
21 | import org.apache.spark.sql.functions._
22 |
23 | object DataFrameUtil {
24 |
25 | def unionDfOpts(dfOpt1: Option[DataFrame], dfOpt2: Option[DataFrame]): Option[DataFrame] = {
26 | (dfOpt1, dfOpt2) match {
27 | case (Some(df1), Some(df2)) => Some(unionByName(df1, df2))
28 | case (Some(_), _) => dfOpt1
29 | case (_, Some(_)) => dfOpt2
30 | case _ => None
31 | }
32 | }
33 |
34 | def unionByName(a: DataFrame, b: DataFrame): DataFrame = {
35 | val columns = a.columns.toSet.intersect(b.columns.toSet).map(col).toSeq
36 | a.select(columns: _*).union(b.select(columns: _*))
37 | }
38 |
39 | }
40 |
--------------------------------------------------------------------------------
/measure/src/test/resources/_completeness-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "comp_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "connector": {
8 | "type": "file",
9 | "config": {
10 | "format": "avro",
11 | "paths": [
12 | "src/test/resources/users_info_src.avro"
13 | ]
14 | }
15 | }
16 | }
17 | ],
18 | "measures": [
19 | {
20 | "name": "completeness_measure",
21 | "type": "completeness",
22 | "data.source": "source",
23 | "config": {
24 | "expr": "email is not null and post_code is not null and first_name is not null"
25 | },
26 | "out": [
27 | {
28 | "type": "metric",
29 | "name": "comp_metric",
30 | "flatten": "map"
31 | }
32 | ]
33 | }
34 | ],
35 | "sinks": [
36 | "CONSOLESINK",
37 | "customSink"
38 | ]
39 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_completeness_errorconf-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "data.sources": [
3 | {
4 | "connector": {
5 | "dataframe.name": "prof_table",
6 | "config": {
7 | "table.name": "efg",
8 | "database": "abc",
9 | "where": "`date`=\"20190825\""
10 | },
11 | "type": "hive"
12 | },
13 | "name": "source"
14 | }
15 | ],
16 | "sinks": [
17 | "CONSOLESink"
18 | ],
19 | "name": "test_griffin_complete_lizhao.bd",
20 | "evaluate.rule": {
21 | "rules": [
22 | {
23 | "rule": "user",
24 | "out.dataframe.name": "prof",
25 | "dsl.type": "griffin-dsl",
26 | "dq.type": "completeness",
27 | "error.confs": [
28 | {
29 | "column.name": "user",
30 | "type": "enumeration",
31 | "values": [
32 | "1",
33 | "2",
34 | "hive_none",
35 | ""
36 | ]
37 | },
38 | {
39 | "column.name": "name",
40 | "type": "regex",
41 | "values": [
42 | "^zhanglei.natur\\w{1}$"
43 | ]
44 | }
45 | ],
46 | "out": [
47 | {
48 | "type": "metric",
49 | "flatten": "map"
50 | }
51 | ]
52 | }
53 | ]
54 | },
55 | "process.type": "batch"
56 | }
57 |
--------------------------------------------------------------------------------
/measure/src/test/resources/_distinctness-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "dist_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "connector": {
8 | "type": "file",
9 | "config": {
10 | "format": "avro",
11 | "paths": [
12 | "src/test/resources/users_info_src.avro"
13 | ]
14 | }
15 | }
16 | }
17 | ],
18 | "measures": [
19 | {
20 | "name": "duplication_measure",
21 | "type": "duplication",
22 | "data.source": "source",
23 | "config": {
24 | "expr": "user_id",
25 | "bad.record.definition": "distinct"
26 | },
27 | "out": [
28 | {
29 | "type": "metric",
30 | "name": "duplication_metric",
31 | "flatten": "map"
32 | }
33 | ]
34 | }
35 | ],
36 | "sinks": [
37 | "CONSOLESink",
38 | "customSink"
39 | ]
40 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_no_measure_or_rules_malformed.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "timestamp": 123456,
5 | "data.sources": [
6 | {
7 | "name": "source",
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "dataframe.name": "this_table",
12 | "config": {
13 | "file.name": "src/test/resources/users_info_src.avro"
14 | },
15 | "pre.proc": [
16 | "select * from this_table where user_id < 10014"
17 | ]
18 | }
19 | }
20 | ],
21 | "sinks": [
22 | "CONSOLESink"
23 | ]
24 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_profiling-batch-griffindsl-hive.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "timestamp": 123456,
5 | "data.sources": [
6 | {
7 | "name": "source",
8 | "connector": {
9 | "type": "hive",
10 | "version": "1.2",
11 | "config": {
12 | "database": "default",
13 | "table.name": "s1"
14 | }
15 | }
16 | }
17 | ],
18 | "evaluate.rule": {
19 | "rules": [
20 | {
21 | "dsl.type": "griffin-dsl",
22 | "dq.type": "profiling",
23 | "out.dataframe.name": "prof",
24 | "rule": "name, count(*) as cnt from source group by name",
25 | "out": [
26 | {
27 | "type": "metric",
28 | "name": "name_group",
29 | "flatten": "array"
30 | }
31 | ]
32 | },
33 | {
34 | "dsl.type": "griffin-dsl",
35 | "dq.type": "profiling",
36 | "out.dataframe.name": "grp",
37 | "rule": "age, count(*) as cnt from source group by age order by cnt",
38 | "out": [
39 | {
40 | "type": "metric",
41 | "name": "age_group",
42 | "flatten": "array"
43 | }
44 | ]
45 | }
46 | ]
47 | },
48 | "sinks": [
49 | "CONSOLESink",
50 | "ELASTICSEARCHSink"
51 | ]
52 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_profiling-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "connector": {
8 | "type": "file",
9 | "config": {
10 | "format": "avro",
11 | "paths": [
12 | "src/test/resources/users_info_src.avro"
13 | ]
14 | },
15 | "pre.proc": [
16 | "select * from this where user_id < 10014"
17 | ]
18 | }
19 | }
20 | ],
21 | "measures": [
22 | {
23 | "name": "profiling_measure",
24 | "type": "profiling",
25 | "data.source": "source",
26 | "config": {
27 | "expr": "first_name, user_id",
28 | "approx.distinct.count": true,
29 | "round.scale": 2
30 | },
31 | "out": [
32 | {
33 | "type": "metric",
34 | "name": "prof_metric",
35 | "flatten": "map"
36 | }
37 | ]
38 | }
39 | ],
40 | "sinks": [
41 | "CONSOLESink",
42 | "customSink"
43 | ]
44 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_profiling-batch-griffindsl_malformed.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "timestamp": 123456,
5 | "data.sources": [
6 | {
7 | "name": "source",
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "dataframe.name": "this_table",
12 | "config": {
13 | "file.name": "src/test/resources/users_info_src.avro"
14 | },
15 | "pre.proc": [
16 | "select * from this_table where user_id < 10014"
17 | ]
18 | }
19 | }
20 | ],
21 | "evaluate.rule": {
22 | "rules": [
23 | {
24 | "dsl.type": "griffin-dsl",
25 | "dq.type": "profiling",
26 | "out.dataframe.name": "prof",
27 | "rule": "abc",
28 | "out": [
29 | {
30 | "type": "metric",
31 | "name": "prof",
32 | "flatten": "array"
33 | }
34 | ]
35 | }
36 | ]
37 | },
38 | "sinks": [
39 | "CONSOLESink"
40 | ]
41 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_profiling-batch-sparksql.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "timestamp": 123456,
5 | "data.sources": [
6 | {
7 | "name": "source",
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "config": {
12 | "file.name": "src/test/resources/users_info_src.avro"
13 | }
14 | }
15 | }
16 | ],
17 | "evaluate.rule": {
18 | "rules": [
19 | {
20 | "dsl.type": "spark-sql",
21 | "out.dataframe.name": "prof",
22 | "rule": "select count(*) as `cnt`, count(distinct `post_code`) as `dis-cnt`, max(user_id) as `max` from source",
23 | "out": [
24 | {
25 | "type": "metric",
26 | "name": "prof"
27 | }
28 | ]
29 | },
30 | {
31 | "dsl.type": "spark-sql",
32 | "out.dataframe.name": "grp",
33 | "rule": "select post_code as `pc`, count(*) as `cnt` from source group by post_code",
34 | "out": [
35 | {
36 | "type": "metric",
37 | "name": "post_group",
38 | "flatten": "array"
39 | }
40 | ]
41 | }
42 | ]
43 | },
44 | "sinks": [
45 | "CONSOLESink",
46 | "ELASTICSEARCHSink"
47 | ]
48 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_sparksql-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "prof_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "connector": {
8 | "type": "file",
9 | "config": {
10 | "format": "avro",
11 | "paths": [
12 | "src/test/resources/users_info_src.avro"
13 | ]
14 | },
15 | "pre.proc": [
16 | "select * from this where user_id < 10014"
17 | ]
18 | }
19 | }
20 | ],
21 | "measures": [
22 | {
23 | "name": "query_measure1",
24 | "type": "sparkSQL",
25 | "data.source": "source",
26 | "config": {
27 | "expr": "select user_id, count(*) as cnt from source group by user_id",
28 | "bad.record.definition": "cnt > 1"
29 | },
30 | "out": [
31 | {
32 | "type": "metric",
33 | "name": "sql_metric",
34 | "flatten": "map"
35 | }
36 | ]
37 | },
38 | {
39 | "name": "query_measure2",
40 | "type": "sparkSQL",
41 | "data.source": "source",
42 | "config": {
43 | "expr": "select post_code, count(*) as cnt from source group by post_code order by cnt desc",
44 | "bad.record.definition": "cnt > 1"
45 | },
46 | "out": [
47 | {
48 | "type": "metric",
49 | "name": "sql_metric",
50 | "flatten": "map"
51 | }
52 | ]
53 | }
54 | ],
55 | "sinks": [
56 | "CONSOLESink",
57 | "customSink"
58 | ]
59 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_timeliness-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "timeliness_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "connector": {
8 | "type": "avro",
9 | "version": "1.7",
10 | "config": {
11 | "file.name": "src/test/resources/timeliness_data.avro"
12 | }
13 | }
14 | }
15 | ],
16 | "evaluate.rule": {
17 | "rules": [
18 | {
19 | "dsl.type": "griffin-dsl",
20 | "dq.type": "timeliness",
21 | "out.dataframe.name": "timeliness",
22 | "rule": "ts, end_ts",
23 | "details": {
24 | "source": "source",
25 | "latency": "latency",
26 | "total": "total",
27 | "avg": "avg",
28 | "threshold": "3m",
29 | "step": "step",
30 | "count": "cnt",
31 | "step.size": "2m",
32 | "percentile": "percentile",
33 | "percentile.values": [
34 | 0.95
35 | ]
36 | },
37 | "out": [
38 | {
39 | "type": "metric",
40 | "name": "timeliness"
41 | },
42 | {
43 | "type": "record",
44 | "name": "lateRecords"
45 | }
46 | ]
47 | }
48 | ]
49 | },
50 | "sinks": [
51 | "CONSOLESink"
52 | ]
53 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/_uniqueness-batch-griffindsl.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "unique_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connector": {
9 | "type": "avro",
10 | "version": "1.7",
11 | "config": {
12 | "file.name": "src/test/resources/users_info_src.avro"
13 | }
14 | }
15 | },
16 | {
17 | "name": "target",
18 | "connector": {
19 | "type": "avro",
20 | "version": "1.7",
21 | "config": {
22 | "file.name": "src/test/resources/users_info_src.avro"
23 | }
24 | }
25 | }
26 | ],
27 | "evaluate.rule": {
28 | "rules": [
29 | {
30 | "dsl.type": "griffin-dsl",
31 | "dq.type": "uniqueness",
32 | "out.dataframe.name": "dup",
33 | "rule": "user_id",
34 | "details": {
35 | "source": "source",
36 | "target": "target",
37 | "total": "total",
38 | "unique": "unique",
39 | "dup": "dup",
40 | "num": "num"
41 | },
42 | "out": [
43 | {
44 | "type": "metric",
45 | "name": "unique"
46 | },
47 | {
48 | "type": "record",
49 | "name": "dupRecords"
50 | }
51 | ]
52 | }
53 | ]
54 | },
55 | "sinks": [
56 | "CONSOLESink"
57 | ]
58 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/crime_report_test.csv:
--------------------------------------------------------------------------------
1 | 2015-05-26T00:26:00Z,PENAL CODE/MISC (PENALMI),3900 Block BLOCK EL CAMINO REAL,PALO ALTO,94306
2 | 2015-05-26T00:26:00Z,DRUNK IN PUBLIC ADULT/MISC (647FA),3900 Block BLOCK EL CAMINO REAL,PALO ALTO,94306
3 | 2015-05-26T00:26:00Z,PENAL CODE/MISC (PENALMI),3900 Block BLOCK EL CAMINO REAL,PALO ALTO,94306
4 | 2015-05-26T00:26:00Z,PENAL CODE/MISC (PENALMI),3900 Block BLOCK EL CAMINO REAL,PALO ALTO,94306
5 | 2015-05-26T02:30:00Z,N&D/POSSESSION (11350),WILKIE WAY & JAMES RD,PALO ALTO,94306
6 | 2015-05-26T02:30:00Z,N&D/PARAPHERNALIA (11364),WILKIE WAY & JAMES RD,PALO ALTO,94306
7 | 2015-05-26T02:30:00Z,TRAFFIC/SUSPENDED LICENSE (14601),WILKIE WAY & JAMES RD,PALO ALTO,94306
8 | 2015-05-26T05:00:00Z,TRAFFIC/MISC (TRAFMISC),EL CAMINO REAL & UNIVERSITY AV,PALO ALTO,94301
9 | 2015-05-26T06:01:00Z,PENAL CODE/MISC (PENALMI),400 Block ALMA ST,PALO ALTO,94301
10 | 2015-05-26T06:34:00Z,B&P/MISC (B&PMISC),700 Block URBAN LN,PALO ALTO,94301
11 |
--------------------------------------------------------------------------------
/measure/src/test/resources/duplicates_users_info_src.csv:
--------------------------------------------------------------------------------
1 | 1,John Smith ,Male
2 | 2,John Smith ,Male
3 | 3,Rebecca Davis,Female
4 | 4,Paul Adams ,Male
5 |
6 |
--------------------------------------------------------------------------------
/measure/src/test/resources/elasticsearch/test_data_2.json:
--------------------------------------------------------------------------------
1 | {"index":{"_type":"_doc","_id":"1001"}}
2 | {"description":"a honda car","manufacturer":"honda","model":"accord"}
3 | {"index":{"_type":"_doc","_id":"1002"}}
4 | {"description":"a volkswagen car","manufacturer":"volkswagen","model":"polo"}
5 |
--------------------------------------------------------------------------------
/measure/src/test/resources/elasticsearch/test_data_2_template.json:
--------------------------------------------------------------------------------
1 | {
2 | "car": {
3 | "properties": {
4 | "manufacturer": {
5 | "type": "text",
6 | "index": "false"
7 | },
8 | "model": {
9 | "type": "text",
10 | "index": "true"
11 | },
12 | "description": {
13 | "type": "text"
14 | }
15 | }
16 | }
17 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/env-batch.json:
--------------------------------------------------------------------------------
1 | {
2 | "spark": {
3 | "log.level": "WARN",
4 | "config": {
5 | "spark.master": "local[*]"
6 | }
7 | },
8 | "sinks": [
9 | {
10 | "name": "consoleSink",
11 | "type": "console",
12 | "config": {
13 | "max.log.lines": 10
14 | }
15 | },
16 | {
17 | "name": "customSink",
18 | "type": "custom",
19 | "config": {
20 | "class": "org.apache.griffin.measure.sink.CustomSink"
21 | }
22 | }
23 | ],
24 | "griffin.checkpoint": []
25 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/env-streaming-mongo.json:
--------------------------------------------------------------------------------
1 | {
2 | "spark": {
3 | "log.level": "WARN",
4 | "checkpoint.dir": "hdfs://localhost/test/griffin/cp",
5 | "batch.interval": "2s",
6 | "process.interval": "10s",
7 | "init.clear": true,
8 | "config": {
9 | "spark.master": "local[*]",
10 | "spark.task.maxFailures": 5,
11 | "spark.streaming.kafkaMaxRatePerPartition": 1000,
12 | "spark.streaming.concurrentJobs": 4,
13 | "spark.yarn.maxAppAttempts": 5,
14 | "spark.yarn.am.attemptFailuresValidityInterval": "1h",
15 | "spark.yarn.max.executor.failures": 120,
16 | "spark.yarn.executor.failuresValidityInterval": "1h",
17 | "spark.hadoop.fs.hdfs.impl.disable.cache": true
18 | }
19 | },
20 | "sinks": [
21 | {
22 | "name": "consoleSink",
23 | "type": "console",
24 | "config": {
25 | "max.log.lines": 100
26 | }
27 | },
28 | {
29 | "type": "mongoSink",
30 | "config": {
31 | "url": "10.149.247.156",
32 | "database": "test",
33 | "collection": "sss"
34 | }
35 | }
36 | ],
37 | "griffin.checkpoint": [
38 | {
39 | "type": "zk",
40 | "config": {
41 | "hosts": "localhost:2181",
42 | "namespace": "griffin/infocache",
43 | "lock.path": "lock",
44 | "mode": "persist",
45 | "init.clear": true,
46 | "close.clear": false
47 | }
48 | }
49 | ]
50 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/env-streaming.json:
--------------------------------------------------------------------------------
1 | {
2 | "spark": {
3 | "log.level": "WARN",
4 | "checkpoint.dir": "hdfs://localhost/test/griffin/cp",
5 | "batch.interval": "2s",
6 | "process.interval": "10s",
7 | "init.clear": true,
8 | "config": {
9 | "spark.master": "local[*]",
10 | "spark.task.maxFailures": 5,
11 | "spark.streaming.kafkaMaxRatePerPartition": 1000,
12 | "spark.streaming.concurrentJobs": 4,
13 | "spark.yarn.maxAppAttempts": 5,
14 | "spark.yarn.am.attemptFailuresValidityInterval": "1h",
15 | "spark.yarn.max.executor.failures": 120,
16 | "spark.yarn.executor.failuresValidityInterval": "1h",
17 | "spark.hadoop.fs.hdfs.impl.disable.cache": true
18 | }
19 | },
20 | "sinks": [
21 | {
22 | "type": "consoleSink",
23 | "config": {
24 | "max.log.lines": 100
25 | }
26 | }
27 | ],
28 | "griffin.checkpoint": [
29 | {
30 | "type": "zk",
31 | "config": {
32 | "hosts": "localhost:2181",
33 | "namespace": "griffin/infocache",
34 | "lock.path": "lock",
35 | "mode": "persist",
36 | "init.clear": true,
37 | "close.clear": false
38 | }
39 | }
40 | ]
41 | }
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.csv/._SUCCESS.crc:
--------------------------------------------------------------------------------
1 | crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.csv/.part-00000-34d01e73-1818-4a16-9e72-2da15374961e-c000.csv.crc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.csv/.part-00000-34d01e73-1818-4a16-9e72-2da15374961e-c000.csv.crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.csv/_SUCCESS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.csv/_SUCCESS
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.csv/part-00000-34d01e73-1818-4a16-9e72-2da15374961e-c000.csv:
--------------------------------------------------------------------------------
1 | name,age
2 | Joey,14
3 | Ivan,32
4 |
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.orc/._SUCCESS.crc:
--------------------------------------------------------------------------------
1 | crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.orc/.part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc.crc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.orc/.part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc.crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.orc/_SUCCESS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.orc/_SUCCESS
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.orc/part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.orc/part-00000-d7c5a937-67a0-44c9-8cae-0487f2992d66-c000.snappy.orc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.parquet/._SUCCESS.crc:
--------------------------------------------------------------------------------
1 | crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.parquet/.part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet.crc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.parquet/.part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet.crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.parquet/_SUCCESS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.parquet/_SUCCESS
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.parquet/part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.parquet/part-00000-1a3fe17e-6ad2-4b92-a3bb-0ffb59b4d45e-c000.snappy.parquet
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.tsv/._SUCCESS.crc:
--------------------------------------------------------------------------------
1 | crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.tsv/.part-00000-c3fdfa41-386d-4c4c-8a52-c690885f1569-c000.csv.crc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.tsv/.part-00000-c3fdfa41-386d-4c4c-8a52-c690885f1569-c000.csv.crc
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.tsv/_SUCCESS:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/files/person_table.tsv/_SUCCESS
--------------------------------------------------------------------------------
/measure/src/test/resources/files/person_table.tsv/part-00000-c3fdfa41-386d-4c4c-8a52-c690885f1569-c000.csv:
--------------------------------------------------------------------------------
1 | name age
2 | Joey 14
3 | Ivan 32
4 |
--------------------------------------------------------------------------------
/measure/src/test/resources/hive/person_table.csv:
--------------------------------------------------------------------------------
1 | Joey,14
2 | Ivan,32
3 |
--------------------------------------------------------------------------------
/measure/src/test/resources/invalidconfigs/invalidtype_completeness_batch_griffindal.json:
--------------------------------------------------------------------------------
1 | {
2 | "data.sources": [
3 | {
4 | "connectors": [
5 | {
6 | "dataframe.name": "prof_table",
7 | "config": {
8 | "table.name": "efg",
9 | "database": "abc",
10 | "where": "`date`=\"20190825\""
11 | },
12 | "type": "hive"
13 | }
14 | ],
15 | "name": "source"
16 | }
17 | ],
18 | "sinks": [
19 | "CONSOLESink"
20 | ],
21 | "name": "test_griffin_complete",
22 | "evaluate.rule": {
23 | "rules": [
24 | {
25 | "rule": "user",
26 | "out.dataframe.name": "prof",
27 | "dsl.type": "griffin-dsl",
28 | "dq.type": "completeness",
29 | "error.confs": [
30 | {
31 | "column.name": "user",
32 | "type": "abc",
33 | "values": [
34 | "1",
35 | "2",
36 | "hive_none",
37 | ""
38 | ]
39 | }
40 | ],
41 | "out": [
42 | {
43 | "type": "metric",
44 | "flatten": "map"
45 | }
46 | ]
47 | }
48 | ]
49 | },
50 | "process.type": "batch"
51 | }
52 |
--------------------------------------------------------------------------------
/measure/src/test/resources/invalidconfigs/missingrule_accuracy_batch_sparksql.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "accu_batch",
3 | "process.type": "batch",
4 | "data.sources": [
5 | {
6 | "name": "source",
7 | "baseline": true,
8 | "connectors": [
9 | {
10 | "type": "avro",
11 | "version": "1.7",
12 | "config": {
13 | "file.name": "src/test/resources/users_info_src.avro"
14 | }
15 | }
16 | ]
17 | },
18 | {
19 | "name": "target",
20 | "connectors": [
21 | {
22 | "type": "avro",
23 | "version": "1.7",
24 | "config": {
25 | "file.name": "src/test/resources/users_info_target.avro"
26 | }
27 | }
28 | ]
29 | }
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/measure/src/test/resources/log4j.properties:
--------------------------------------------------------------------------------
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 | log4j.rootLogger=INFO, stdout
20 | log4j.logger.org.apache=ERROR
21 | log4j.logger.DataNucleus=ERROR
22 | log4j.logger.org.spark_project=ERROR
23 | log4j.logger.org.apache.griffin=INFO
24 | log4j.appender.stdout=org.apache.log4j.ConsoleAppender
25 | log4j.appender.stdout.Target=System.out
26 | log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
27 | log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss.SSS} %-5p [%c] - %m%n
28 |
--------------------------------------------------------------------------------
/measure/src/test/resources/timeliness_data.avro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/timeliness_data.avro
--------------------------------------------------------------------------------
/measure/src/test/resources/users_info_src.avro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/users_info_src.avro
--------------------------------------------------------------------------------
/measure/src/test/resources/users_info_src/users_info_src.avro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/users_info_src/users_info_src.avro
--------------------------------------------------------------------------------
/measure/src/test/resources/users_info_target.avro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/users_info_target.avro
--------------------------------------------------------------------------------
/measure/src/test/resources/users_info_target/users_info_target.avro:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/measure/src/test/resources/users_info_target/users_info_target.avro
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/config/CacheConfig.java:
--------------------------------------------------------------------------------
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 | package org.apache.griffin.core.config;
20 |
21 | import org.apache.commons.lang.StringUtils;
22 | import org.springframework.cache.annotation.EnableCaching;
23 | import org.springframework.cache.interceptor.KeyGenerator;
24 | import org.springframework.context.annotation.Bean;
25 | import org.springframework.context.annotation.Configuration;
26 |
27 | @Configuration
28 | @EnableCaching
29 | public class CacheConfig {
30 | @Bean
31 | public KeyGenerator cacheKeyGenerator() {
32 | return (o, method, objects) -> {
33 | StringBuilder sb = new StringBuilder(method.getName());
34 | String params = StringUtils.join(objects);
35 | if (!StringUtils.isEmpty(params)) {
36 | sb.append(params);
37 | }
38 | return sb.toString();
39 | };
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/event/EventPointcutType.java:
--------------------------------------------------------------------------------
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.griffin.core.event;
21 |
22 | public enum EventPointcutType {
23 | BEFORE,
24 | PENDING,
25 | AFTER
26 | }
27 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/event/EventSourceType.java:
--------------------------------------------------------------------------------
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.griffin.core.event;
21 |
22 | public enum EventSourceType {
23 | JOB,
24 | MEASURE
25 | }
26 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/event/EventType.java:
--------------------------------------------------------------------------------
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.griffin.core.event;
21 |
22 | public enum EventType {
23 | CREATION_EVENT,
24 | CHANGE_EVENT,
25 | REMOVAL_EVENT
26 | }
27 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/event/GriffinHook.java:
--------------------------------------------------------------------------------
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.griffin.core.event;
21 |
22 | import org.apache.griffin.core.exception.GriffinException;
23 |
24 | /**
25 | * The Hook interface for receiving internal events.
26 | * The class that is interested in processing an event
27 | * implements this interface, and the object created with that
28 | * class is registered to griffin, using the configuration.
29 | * When the event occurs, that object's onEvent method is
30 | * invoked.
31 | *
32 | * @author Eugene Liu
33 | * @since 0.3
34 | */
35 | public interface GriffinHook {
36 | /**
37 | * Invoked when an action occurs.
38 | *
39 | * @see GriffinEvent
40 | */
41 | void onEvent(GriffinEvent event) throws GriffinException;
42 | }
43 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/event/JobEventHook.java:
--------------------------------------------------------------------------------
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.griffin.core.event;
21 |
22 | import org.apache.griffin.core.exception.GriffinException;
23 | import org.springframework.context.annotation.Configuration;
24 |
25 | @Configuration(value = "GriffinJobEventHook")
26 | public class JobEventHook implements GriffinHook {
27 | @Override
28 | public void onEvent(GriffinEvent event) throws GriffinException {
29 | // This method needs to be reimplemented by event-consuming purpose
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/info/GriffinInfoController.java:
--------------------------------------------------------------------------------
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.griffin.core.info;
21 |
22 | import org.springframework.web.bind.annotation.RequestMapping;
23 | import org.springframework.web.bind.annotation.RequestMethod;
24 | import org.springframework.web.bind.annotation.RestController;
25 |
26 | @RestController
27 | @RequestMapping("/api/v1")
28 | public class GriffinInfoController {
29 |
30 | @RequestMapping(value = "/version", method = RequestMethod.GET)
31 | public String greeting() {
32 | return "0.5.0";
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/Predicator.java:
--------------------------------------------------------------------------------
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.griffin.core.job;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * Predicator is an object that judges if one condition is met.
26 | * This interface only has one method {@link #predicate()}
27 | */
28 | public interface Predicator {
29 | /**
30 | * predicate a condition
31 | *
32 | * @return True condition is met, otherwise False
33 | * @throws IOException
34 | */
35 | boolean predicate() throws IOException;
36 | }
37 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/entity/JobHealth.java:
--------------------------------------------------------------------------------
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 | package org.apache.griffin.core.job.entity;
20 |
21 |
22 | public class JobHealth {
23 | private int healthyJobCount;
24 | private int jobCount;
25 |
26 | public int getHealthyJobCount() {
27 | return healthyJobCount;
28 | }
29 |
30 | public void setHealthyJobCount(int healthyJobCount) {
31 | this.healthyJobCount = healthyJobCount;
32 | }
33 |
34 | public int getJobCount() {
35 | return jobCount;
36 | }
37 |
38 | public void setJobCount(int jobCount) {
39 | this.jobCount = jobCount;
40 | }
41 |
42 | public JobHealth(int healthyJobCount, int jobCount) {
43 | this.healthyJobCount = healthyJobCount;
44 | this.jobCount = jobCount;
45 | }
46 |
47 | public JobHealth() {
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/entity/JobType.java:
--------------------------------------------------------------------------------
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.griffin.core.job.entity;
21 |
22 | public enum JobType {
23 |
24 | BATCH("batch"), //
25 | STREAMING("streaming"), //
26 | VIRTUAL("virtual");
27 |
28 | private String name;
29 |
30 | private JobType(String name) {
31 | this.name = name;
32 | }
33 |
34 | public String getName() {
35 | return name;
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/entity/StreamingJob.java:
--------------------------------------------------------------------------------
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.griffin.core.job.entity;
21 |
22 | import javax.persistence.DiscriminatorValue;
23 | import javax.persistence.Entity;
24 |
25 | @Entity
26 | @DiscriminatorValue("griffinStreamingJob")
27 | public class StreamingJob extends AbstractJob {
28 | private static final long serialVersionUID = 3292253488392308505L;
29 |
30 | @Override
31 | public String getType() {
32 | return JobType.STREAMING.getName();
33 | }
34 |
35 | public StreamingJob() {
36 | }
37 |
38 | public StreamingJob(Long measureId, String jobName, String name,
39 | String group, boolean deleted) {
40 | super(measureId, jobName, name, group, deleted);
41 | this.metricName = jobName;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/entity/VirtualJob.java:
--------------------------------------------------------------------------------
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.griffin.core.job.entity;
21 |
22 | import javax.persistence.DiscriminatorValue;
23 | import javax.persistence.Entity;
24 |
25 | @Entity
26 | @DiscriminatorValue("virtualJob")
27 | public class VirtualJob extends AbstractJob {
28 | private static final long serialVersionUID = 1130038058433818835L;
29 |
30 | @Override
31 | public String getType() {
32 | return JobType.VIRTUAL.getName();
33 | }
34 |
35 | public VirtualJob() {
36 | super();
37 | }
38 |
39 | public VirtualJob(String jobName, Long measureId, String metricName) {
40 | super(jobName, measureId, metricName);
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/BaseJpaRepository.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.springframework.data.jpa.repository.JpaRepository;
23 | import org.springframework.data.repository.NoRepositoryBean;
24 |
25 | @NoRepositoryBean
26 | public interface BaseJpaRepository extends JpaRepository {
27 | /**
28 | * This method is to make findOne method from spring boot 1.5.x compatible with spring 2.x
29 | *
30 | * @param id id
31 | * @return object of specified id, return null if cannot find the id
32 | */
33 | default T findOne(ID id) {
34 | return (T) findById(id).orElse(null);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/BatchJobRepo.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.apache.griffin.core.job.entity.BatchJob;
23 |
24 | public interface BatchJobRepo extends JobRepo {
25 | }
26 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/JobDataSegmentRepo.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.apache.griffin.core.job.entity.JobDataSegment;
23 | import org.springframework.data.repository.CrudRepository;
24 |
25 | public interface JobDataSegmentRepo extends CrudRepository {
26 | }
27 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/JobRepo.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.apache.griffin.core.job.entity.AbstractJob;
23 | import org.springframework.data.jpa.repository.Query;
24 |
25 | import java.util.List;
26 |
27 | public interface JobRepo extends BaseJpaRepository {
28 |
29 | @Query("select count(j) from #{#entityName} j " +
30 | "where j.jobName = ?1 and j.deleted = ?2")
31 | int countByJobNameAndDeleted(String jobName, Boolean deleted);
32 |
33 | List findByDeleted(boolean deleted);
34 |
35 | List findByJobNameAndDeleted(String jobName, boolean deleted);
36 |
37 | List findByMeasureIdAndDeleted(Long measureId, boolean deleted);
38 |
39 | T findByIdAndDeleted(Long jobId, boolean deleted);
40 | }
41 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/StreamingJobRepo.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.apache.griffin.core.job.entity.StreamingJob;
23 |
24 | public interface StreamingJobRepo extends JobRepo {
25 | }
26 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/job/repo/VirtualJobRepo.java:
--------------------------------------------------------------------------------
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.griffin.core.job.repo;
21 |
22 | import org.apache.griffin.core.job.entity.VirtualJob;
23 |
24 | public interface VirtualJobRepo extends JobRepo {
25 | }
26 |
--------------------------------------------------------------------------------
/service/src/main/java/org/apache/griffin/core/login/LoginService.java:
--------------------------------------------------------------------------------
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.griffin.core.login;
21 |
22 | import java.util.Map;
23 |
24 | import org.springframework.http.ResponseEntity;
25 |
26 | /**
27 | * LoginService defines an abstract validation method for login action, you can implement
28 | * it to customize authentication business.
29 | *
30 | * @see org.apache.griffin.core.config.LoginConfig
31 | * @see LoginServiceDefaultImpl
32 | * @see LoginServiceLdapImpl
33 | */
34 | public interface LoginService {
35 |
36 | ResponseEntity