├── .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> login(Map map); 37 | } 38 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/MeasureOperator.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.measure; 21 | 22 | 23 | import org.apache.griffin.core.measure.entity.Measure; 24 | import org.quartz.SchedulerException; 25 | 26 | public interface MeasureOperator { 27 | 28 | Measure create(Measure measure); 29 | 30 | Measure update(Measure measure); 31 | 32 | void delete(Measure measure) throws SchedulerException; 33 | 34 | } 35 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/MeasureOrgService.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.measure; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | public interface MeasureOrgService { 26 | 27 | List getOrgs(); 28 | 29 | List getMetricNameListByOrg(String org); 30 | 31 | Map> getMeasureNamesGroupByOrg(); 32 | 33 | Map>>> 34 | getMeasureWithJobDetailsGroupByOrg(Map>> jobDetailsGroupByMeasure); 35 | } 36 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/MeasureService.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.measure; 21 | 22 | 23 | import java.util.List; 24 | 25 | import org.apache.griffin.core.measure.entity.Measure; 26 | import org.quartz.SchedulerException; 27 | 28 | public interface MeasureService { 29 | 30 | List getAllAliveMeasures(String type); 31 | 32 | Measure getMeasureById(long id); 33 | 34 | void deleteMeasureById(Long id) throws SchedulerException; 35 | 36 | void deleteMeasures() throws SchedulerException; 37 | 38 | Measure updateMeasure(Measure measure); 39 | 40 | List getAliveMeasuresByOwner(String owner); 41 | 42 | Measure createMeasure(Measure measure); 43 | } 44 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/entity/DqType.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.measure.entity; 21 | 22 | public enum DqType { 23 | /** 24 | * Currently we support six dimensions of measure. 25 | */ 26 | ACCURACY, 27 | PROFILING, 28 | TIMELINESS, 29 | UNIQUENESS, 30 | COMPLETENESS, 31 | CONSISTENCY 32 | } 33 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/repo/DataConnectorRepo.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.measure.repo; 21 | 22 | import java.util.List; 23 | 24 | import org.apache.griffin.core.measure.entity.DataConnector; 25 | import org.springframework.data.jpa.repository.Query; 26 | import org.springframework.data.repository.CrudRepository; 27 | 28 | public interface DataConnectorRepo extends CrudRepository { 29 | 30 | @Query("select dc from DataConnector dc where dc.name in ?1") 31 | List findByConnectorNames(List names); 32 | } 33 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/repo/EvaluateRuleRepo.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.measure.repo; 21 | 22 | import org.apache.griffin.core.measure.entity.EvaluateRule; 23 | import org.springframework.data.repository.CrudRepository; 24 | 25 | public interface EvaluateRuleRepo extends CrudRepository { 26 | } 27 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/repo/ExternalMeasureRepo.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.measure.repo; 21 | 22 | import org.apache.griffin.core.measure.entity.ExternalMeasure; 23 | 24 | public interface ExternalMeasureRepo extends MeasureRepo { 25 | } 26 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/measure/repo/GriffinMeasureRepo.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.measure.repo; 21 | 22 | import org.apache.griffin.core.measure.entity.GriffinMeasure; 23 | 24 | public interface GriffinMeasureRepo extends MeasureRepo { 25 | } 26 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/metastore/hive/HiveMetaStoreService.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.metastore.hive; 21 | 22 | import java.util.List; 23 | import java.util.Map; 24 | 25 | import org.apache.hadoop.hive.metastore.api.Table; 26 | 27 | public interface HiveMetaStoreService { 28 | 29 | Iterable getAllDatabases(); 30 | 31 | Iterable getAllTableNames(String dbName); 32 | 33 | Map> getAllTableNames(); 34 | 35 | List getAllTable(String db); 36 | 37 | Map> getAllTable(); 38 | 39 | Table getTable(String dbName, String tableName); 40 | 41 | void evictHiveCache(); 42 | } 43 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/metastore/kafka/KafkaSchemaService.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.metastore.kafka; 21 | 22 | import io.confluent.kafka.schemaregistry.client.rest.entities.Config; 23 | import io.confluent.kafka.schemaregistry.client.rest.entities.Schema; 24 | import io.confluent.kafka.schemaregistry.client.rest.entities.SchemaString; 25 | 26 | public interface KafkaSchemaService { 27 | SchemaString getSchemaString(Integer id); 28 | 29 | Iterable getSubjects(); 30 | 31 | Iterable getSubjectVersions(String subject); 32 | 33 | Schema getSubjectSchema(String subject, String version); 34 | 35 | Config getTopLevelConfig(); 36 | 37 | Config getSubjectLevelConfig(String subject); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/metric/MetricService.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.metric; 21 | 22 | 23 | import java.util.List; 24 | import java.util.Map; 25 | 26 | import org.apache.griffin.core.metric.model.Metric; 27 | import org.apache.griffin.core.metric.model.MetricValue; 28 | import org.springframework.http.ResponseEntity; 29 | 30 | public interface MetricService { 31 | 32 | Map> getAllMetrics(); 33 | 34 | List getMetricValues(String metricName, int offset, int size, 35 | long tmst); 36 | 37 | ResponseEntity addMetricValues(List values); 38 | 39 | ResponseEntity deleteMetricValues(String metricName); 40 | 41 | MetricValue findMetric(Long id); 42 | } 43 | -------------------------------------------------------------------------------- /service/src/main/java/org/apache/griffin/core/metric/MetricStore.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.metric; 21 | 22 | import java.io.IOException; 23 | import java.util.List; 24 | 25 | import org.apache.griffin.core.metric.model.MetricValue; 26 | import org.springframework.http.ResponseEntity; 27 | 28 | public interface MetricStore { 29 | 30 | List getMetricValues(String metricName, int from, int size, 31 | long tmst) throws IOException; 32 | 33 | ResponseEntity addMetricValues(List metricValues) 34 | throws IOException; 35 | 36 | ResponseEntity deleteMetricValues(String metricName) throws IOException; 37 | 38 | MetricValue getMetric(String applicationId) throws IOException; 39 | } 40 | -------------------------------------------------------------------------------- /service/src/main/resources/application-dev.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 | spring.datasource.url=jdbc:h2:mem:quartz;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE 20 | spring.datasource.username=griffin 21 | spring.datasource.password=123456 22 | spring.jpa.generate-ddl=true 23 | spring.datasource.driver-class-name=org.h2.Driver 24 | # Create quartz table structure 25 | spring.datasource.schema=classpath:init_quartz_h2.sql 26 | # enable h2 console, default path: http://localhost:8080/h2-console/ 27 | spring.h2.console.enabled=true 28 | spring.jpa.show-sql=true 29 | 30 | logging.file=logs/griffin-service.log -------------------------------------------------------------------------------- /service/src/main/resources/application-mysql.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 | 20 | #Data Access Properties 21 | spring.datasource.url=jdbc:mysql://localhost:3306/quartz?autoReconnect=true&useSSL=false 22 | spring.datasource.username=griffin 23 | spring.datasource.password=123456 24 | spring.jpa.generate-ddl=true 25 | spring.datasource.driver-class-name=com.mysql.jdbc.Driver 26 | spring.jpa.show-sql=true 27 | spring.jpa.hibernate.ddl-auto=update 28 | 29 | logging.file=logs/griffin-service.log -------------------------------------------------------------------------------- /service/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | _________________ _________________________________________ __ 2 | __ ____/___ __ \____ _/___ ____/___ ____/____ _/___ | / / 3 | _ / __ __ /_/ / __ / __ /_ __ /_ __ / __ |/ / 4 | / /_/ / _ _, _/ __/ / _ __/ _ __/ __/ / _ /| / 5 | \____/ /_/ |_| /___/ /_/ /_/ /___/ /_/ |_/ version: 0.5.0 6 | -------------------------------------------------------------------------------- /service/src/main/resources/env/env_batch.json: -------------------------------------------------------------------------------- 1 | { 2 | "spark": { 3 | "log.level": "WARN" 4 | }, 5 | "sinks": [ 6 | { 7 | "name": "console", 8 | "type": "CONSOLE", 9 | "config": { 10 | "max.log.lines": 10 11 | } 12 | }, 13 | { 14 | "name": "hdfs", 15 | "type": "HDFS", 16 | "config": { 17 | "path": "hdfs://localhost/griffin/persist", 18 | "max.persist.lines": 10000, 19 | "max.lines.per.file": 10000 20 | } 21 | }, 22 | { 23 | "name": "elasticsearch", 24 | "type": "ELASTICSEARCH", 25 | "config": { 26 | "method": "post", 27 | "api": "http://es:9200/griffin/accuracy", 28 | "connection.timeout": "1m", 29 | "retry": 10 30 | } 31 | } 32 | ], 33 | "griffin.checkpoint": [] 34 | } 35 | -------------------------------------------------------------------------------- /service/src/main/resources/env/env_streaming.json: -------------------------------------------------------------------------------- 1 | { 2 | "spark": { 3 | "log.level": "WARN", 4 | "checkpoint.dir": "hdfs:///griffin/checkpoint/${JOB_NAME}", 5 | "init.clear": true, 6 | "batch.interval": "1m", 7 | "process.interval": "5m", 8 | "config": { 9 | "spark.default.parallelism": 4, 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": "CONSOLE", 23 | "config": { 24 | "max.log.lines": 100 25 | } 26 | }, 27 | { 28 | "type": "HDFS", 29 | "config": { 30 | "path": "hdfs:///griffin/persist", 31 | "max.persist.lines": 10000, 32 | "max.lines.per.file": 10000 33 | } 34 | }, 35 | { 36 | "type": "ELASTICSEARCH", 37 | "config": { 38 | "method": "post", 39 | "api": "http://es:9200/griffin/accuracy" 40 | } 41 | } 42 | ], 43 | "griffin.checkpoint": [ 44 | { 45 | "type": "zk", 46 | "config": { 47 | "hosts": "zk:2181", 48 | "namespace": "griffin/infocache", 49 | "lock.path": "lock", 50 | "mode": "persist", 51 | "init.clear": true, 52 | "close.clear": false 53 | } 54 | } 55 | ] 56 | } 57 | -------------------------------------------------------------------------------- /service/src/main/resources/hive-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /service/src/main/resources/hivemetastore-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /service/src/main/resources/hiveserver2-site.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /service/src/main/resources/shell/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | PRG="$0" 22 | PRGDIR=`dirname "$PRG"` 23 | GRIFFIN_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` 24 | EXECUTABLE=griffin.sh 25 | exec "$PRGDIR"/"$EXECUTABLE" start "$@" 26 | -------------------------------------------------------------------------------- /service/src/main/resources/shell/stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Licensed to the Apache Software Foundation (ASF) under one 4 | # or more contributor license agreements. See the NOTICE file 5 | # distributed with this work for additional information 6 | # regarding copyright ownership. The ASF licenses this file 7 | # to you under the Apache License, Version 2.0 (the 8 | # "License"); you may not use this file except in compliance 9 | # with the License. You may obtain a copy of the License at 10 | # 11 | # http://www.apache.org/licenses/LICENSE-2.0 12 | # 13 | # Unless required by applicable law or agreed to in writing, 14 | # software distributed under the License is distributed on an 15 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | # KIND, either express or implied. See the License for the 17 | # specific language governing permissions and limitations 18 | # under the License. 19 | # 20 | 21 | PRG="$0" 22 | PRGDIR=`dirname "$PRG"` 23 | GRIFFIN_HOME=`cd "$PRGDIR/.." >/dev/null; pwd` 24 | EXECUTABLE=griffin.sh 25 | exec "$PRGDIR"/"$EXECUTABLE" stop "$@" 26 | -------------------------------------------------------------------------------- /service/src/main/resources/sparkProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "hdfs:///griffin/griffin-measure.jar", 3 | "className": "org.apache.griffin.measure.Application", 4 | "queue": "default", 5 | "numExecutors": 2, 6 | "executorCores": 1, 7 | "driverMemory": "1g", 8 | "executorMemory": "1g", 9 | "conf": { 10 | "spark.yarn.dist.files": "hdfs:///home/spark_conf/hive-site.xml" 11 | }, 12 | "files": [ 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /service/src/test/java/org/apache/griffin/core/job/entity/JobScheduleTest.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 JobScheduleTest { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /service/src/test/java/org/apache/griffin/core/util/PredicatorMock.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.util; 21 | 22 | import org.apache.griffin.core.job.Predicator; 23 | import org.apache.griffin.core.job.entity.SegmentPredicate; 24 | 25 | import java.io.IOException; 26 | 27 | public class PredicatorMock implements Predicator { 28 | public PredicatorMock(SegmentPredicate segmentPredicate) { 29 | } 30 | 31 | @Override 32 | public boolean predicate() throws IOException { 33 | return true; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /service/src/test/java/org/apache/griffin/core/util/URLHelper.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.util; 21 | 22 | public class URLHelper { 23 | public static final String API_VERSION_PATH = "/api/v1"; 24 | public static final String KAFKA_API_PATH = "/metadata/kafka"; 25 | } 26 | -------------------------------------------------------------------------------- /service/src/test/resources/metricvalue.json: -------------------------------------------------------------------------------- 1 | { 2 | "took": 47, 3 | "timed_out": false, 4 | "_shards": { 5 | "total": 5, 6 | "successful": 5, 7 | "skipped": 0, 8 | "failed": 0 9 | }, 10 | "hits": { 11 | "total": 17, 12 | "max_score": 3.226844, 13 | "hits": [ 14 | { 15 | "_index": "griffin", 16 | "_type": "accuracy", 17 | "_id": "RZFP4mgBkZqzqlKSwWtJ", 18 | "_score": 3.226844, 19 | "_source": { 20 | "name": "de_demo_results_comparision", 21 | "tmst": 1549985089648, 22 | "value": { 23 | "total": 74, 24 | "miss": 0, 25 | "matched": 74, 26 | "matchedFraction": 1 27 | }, 28 | "metadata": { 29 | "applicationId": "application_1549876136110_0018" 30 | } 31 | } 32 | }, 33 | { 34 | "_index": "griffin", 35 | "_type": "accuracy", 36 | "_id": "taMpvmgBfOpRJiYFj5Xg", 37 | "_score": 2.4107988, 38 | "_source": { 39 | "name": "de_demo_results_comparision", 40 | "tmst": 1549378607658, 41 | "value": { 42 | "total": 74, 43 | "miss": 0, 44 | "matched": 74, 45 | "matchedFraction": 1 46 | } 47 | } 48 | } 49 | ] 50 | } 51 | } -------------------------------------------------------------------------------- /service/src/test/resources/quartz.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 | org.quartz.scheduler.instanceName=spring-boot-quartz-test 20 | org.quartz.scheduler.instanceId=AUTO 21 | org.quartz.threadPool.threadCount=5 22 | org.quartz.jobStore.class=org.quartz.impl.jdbcjobstore.JobStoreTX 23 | # be careful to configure driver with PostgreSQLDelegate in postgresql not StdJDBCDelegate in mysql 24 | org.quartz.jobStore.driverDelegateClass=org.quartz.impl.jdbcjobstore.PostgreSQLDelegate 25 | org.quartz.jobStore.useProperties=true 26 | org.quartz.jobStore.misfireThreshold=60000 27 | org.quartz.jobStore.tablePrefix=QRTZ_ 28 | org.quartz.jobStore.isClustered=true 29 | org.quartz.jobStore.clusterCheckinInterval=20000 -------------------------------------------------------------------------------- /service/src/test/resources/sparkProperties.json: -------------------------------------------------------------------------------- 1 | { 2 | "file": "hdfs:///griffin/griffin-measure.jar", 3 | "className": "org.apache.griffin.measure.Application", 4 | "name": "test", 5 | "queue": "default", 6 | "numExecutors": 3, 7 | "executorCores": 1, 8 | "driverMemory": "1g", 9 | "executorMemory": "1g", 10 | "sparkJob.name": "testJob", 11 | "conf": { 12 | "spark.yarn.dist.files": "hdfs:///home/spark_conf/hive-site.xml" 13 | }, 14 | "files": [ 15 | ] 16 | } -------------------------------------------------------------------------------- /ui/angular/.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /ui/angular/.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | testem.log 34 | /typings 35 | yarn-error.log 36 | 37 | # e2e 38 | /e2e/*.js 39 | /e2e/*.map 40 | 41 | # System Files 42 | .DS_Store 43 | Thumbs.db 44 | 45 | # npm files 46 | /package-lock.json 47 | -------------------------------------------------------------------------------- /ui/angular/protractor.conf.js: -------------------------------------------------------------------------------- 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 | // Protractor configuration file, see link for more information 20 | // https://github.com/angular/protractor/blob/master/lib/config.ts 21 | 22 | const {SpecReporter} = require('jasmine-spec-reporter'); 23 | 24 | exports.config = { 25 | allScriptsTimeout: 11000, 26 | specs: [ 27 | './e2e/**/*.e2e-spec.ts' 28 | ], 29 | capabilities: { 30 | 'browserName': 'chrome' 31 | }, 32 | directConnect: true, 33 | baseUrl: 'http://localhost:4200/', 34 | framework: 'jasmine', 35 | jasmineNodeOpts: { 36 | showColors: true, 37 | defaultTimeoutInterval: 30000, 38 | print: function () { 39 | } 40 | }, 41 | onPrepare() { 42 | require('ts-node').register({ 43 | project: 'e2e/tsconfig.e2e.json' 44 | }); 45 | jasmine.getEnv().addReporter(new SpecReporter({spec: {displayStacktrace: true}})); 46 | } 47 | }; 48 | -------------------------------------------------------------------------------- /ui/angular/src/app/dataasset/dataasset.component.css: -------------------------------------------------------------------------------- 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 | .icon { 20 | color: #fff; 21 | position: absolute; 22 | left: 50%; 23 | top: 20%; 24 | } 25 | 26 | .co { 27 | border-collapse: separate; 28 | } 29 | 30 | .co > tbody > tr:nth-of-type(even) { 31 | background-color: #1f1f1f; 32 | } 33 | 34 | .co > tbody > tr:nth-of-type(odd) { 35 | background-color: #080808; 36 | } 37 | 38 | .table-striped > tbody > tr { 39 | background-color: #1f1f1f; 40 | border: 1px solid transparent; 41 | } 42 | 43 | .table > tbody + tbody { 44 | border: 1px solid transparent; 45 | } 46 | 47 | .reco > tbody:nth-of-type(even) > tr { 48 | background-color: #080808; 49 | } 50 | -------------------------------------------------------------------------------- /ui/angular/src/app/health/health.component.css: -------------------------------------------------------------------------------- 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 | .demo-chart { 20 | height: 400px; 21 | } -------------------------------------------------------------------------------- /ui/angular/src/app/health/health.component.html: -------------------------------------------------------------------------------- 1 | 19 |
    20 |
    21 |
    23 |
    24 |
    25 | -------------------------------------------------------------------------------- /ui/angular/src/app/job/job-detail/job-detail.component.css: -------------------------------------------------------------------------------- 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 | */ -------------------------------------------------------------------------------- /ui/angular/src/app/loader/loader.component.css: -------------------------------------------------------------------------------- 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 | .icon { 20 | color: #fff; 21 | position: absolute; 22 | left: 50%; 23 | padding-top: 20%; 24 | } 25 | -------------------------------------------------------------------------------- /ui/angular/src/app/loader/loader.component.html: -------------------------------------------------------------------------------- 1 | 19 |
    20 | 21 |
    -------------------------------------------------------------------------------- /ui/angular/src/app/loader/loader.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit, OnDestroy} from "@angular/core"; 2 | import {Subscription} from "rxjs/Subscription"; 3 | import {LoaderService} from "./loader.service"; 4 | import {LoadingState} from "./loader.state"; 5 | 6 | @Component({ 7 | selector: "app-loader", 8 | templateUrl: "./loader.component.html", 9 | styleUrls: ["./loader.component.css"] 10 | }) 11 | export class LoaderComponent implements OnInit { 12 | show = false; 13 | private subscription: Subscription; 14 | 15 | constructor( 16 | private loaderService: LoaderService 17 | ) { 18 | } 19 | 20 | ngOnInit() { 21 | this.subscription = this.loaderService.LoadingState 22 | .subscribe((state: LoadingState) => { 23 | this.show = state.show; 24 | }); 25 | } 26 | 27 | ngOnDestroy() { 28 | this.subscription.unsubscribe(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /ui/angular/src/app/loader/loader.service.ts: -------------------------------------------------------------------------------- 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 | import {Injectable} from "@angular/core"; 20 | import {Subject} from "rxjs/Subject"; 21 | import {LoadingState} from "./loader.state"; 22 | 23 | @Injectable() 24 | export class LoaderService { 25 | 26 | private loaderSubject = new Subject(); 27 | LoadingState = this.loaderSubject.asObservable(); 28 | 29 | constructor() { 30 | } 31 | 32 | show() { 33 | this.loaderSubject.next({show: true}); 34 | } 35 | 36 | hide() { 37 | this.loaderSubject.next({show: false}); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ui/angular/src/app/loader/loader.state.ts: -------------------------------------------------------------------------------- 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 | export interface LoadingState { 20 | show: boolean; 21 | } 22 | -------------------------------------------------------------------------------- /ui/angular/src/app/login/login.component.spec.ts: -------------------------------------------------------------------------------- 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 | import {async, ComponentFixture, TestBed} from '@angular/core/testing'; 20 | 21 | import { AppModule } from '../app.module'; 22 | import {LoginComponent} from './login.component'; 23 | 24 | describe('LoginComponent', () => { 25 | let component: LoginComponent; 26 | let fixture: ComponentFixture; 27 | 28 | beforeEach(async(() => { 29 | TestBed.configureTestingModule({ 30 | imports: [ AppModule ], 31 | declarations: [] 32 | }) 33 | .compileComponents(); 34 | })); 35 | 36 | beforeEach(() => { 37 | fixture = TestBed.createComponent(LoginComponent); 38 | component = fixture.componentInstance; 39 | fixture.detectChanges(); 40 | }); 41 | 42 | it('should be created', () => { 43 | expect(component).toBeTruthy(); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/configuration/configuration.component.css: -------------------------------------------------------------------------------- 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 | label.control-label { 21 | margin-top: 7px; 22 | } 23 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/confirmModal/confirmModal.component.css: -------------------------------------------------------------------------------- 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 | .viewrule-content { 21 | border: 1px solid #fff; 22 | border-radius: 4px; 23 | padding: 10px; 24 | } 25 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/pr.component.css: -------------------------------------------------------------------------------- 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 | @import url('../../../../../node_modules/angular2-toaster/toaster.css'); 20 | @import url('../../measure.component.css'); 21 | 22 | div.formStep { 23 | min-height: 65vh; 24 | margin-left: 30px; 25 | margin-right: 30px; 26 | } 27 | 28 | h5.over-title { 29 | margin-left: 30px; 30 | } 31 | 32 | label { 33 | font-weight: normal; 34 | } 35 | 36 | .container { 37 | max-height: 40vh; 38 | overflow-y: scroll; 39 | } 40 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/rule/rule.component.css: -------------------------------------------------------------------------------- 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 | .table > thead > tr.success > td { 21 | background-color: #77b300; 22 | } 23 | 24 | mark { 25 | background-color: #ff8800; 26 | padding: .2em; 27 | } 28 | 29 | h5 { 30 | font-size: 20px; 31 | } 32 | 33 | .y-scrollable::-webkit-scrollbar-track { 34 | -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); 35 | border-radius: 10px; 36 | background-color: #F5F5F5; 37 | } 38 | 39 | .y-scrollable::-webkit-scrollbar { 40 | width: 5px; 41 | border-radius: 10px; 42 | background-color: #F5F5F5; 43 | } 44 | 45 | .y-scrollable::-webkit-scrollbar-thumb { 46 | border-radius: 10px; 47 | -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3); 48 | background-color: #AAAAAA; 49 | } 50 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/rule/rule.component.spec.ts: -------------------------------------------------------------------------------- 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 | import {async, ComponentFixture, TestBed} from '@angular/core/testing'; 20 | 21 | import { AppModule } from '../../../../app.module'; 22 | import {RuleComponent} from './rule.component'; 23 | 24 | describe('RuleComponent', () => { 25 | let component: RuleComponent; 26 | let fixture: ComponentFixture; 27 | 28 | beforeEach(async(() => { 29 | TestBed.configureTestingModule({ 30 | imports: [ AppModule ], 31 | declarations: [] 32 | }) 33 | .compileComponents(); 34 | })); 35 | 36 | beforeEach(() => { 37 | fixture = TestBed.createComponent(RuleComponent); 38 | component = fixture.componentInstance; 39 | fixture.detectChanges(); 40 | }); 41 | 42 | it('should be created', () => { 43 | expect(component).toBeTruthy(); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/rule/rule.component.ts: -------------------------------------------------------------------------------- 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 | import {Component, OnInit} from '@angular/core'; 20 | 21 | @Component({ 22 | selector: 'app-rule', 23 | templateUrl: './rule.component.html', 24 | styleUrls: ['./rule.component.css'] 25 | }) 26 | export class RuleComponent implements OnInit { 27 | 28 | vaType: string; 29 | 30 | constructor() { 31 | } 32 | 33 | ngOnInit() { 34 | this.vaType = '2'; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/step2/step2.component.css: -------------------------------------------------------------------------------- 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 | @import url('../../../../../../node_modules/angular2-toaster/toaster.css'); 20 | @import url('../../../measure.component.css'); 21 | 22 | fieldset { 23 | height: 60vh; 24 | } 25 | 26 | label.stepDesc { 27 | padding-left: 30px; 28 | padding-right: 30px; 29 | } 30 | 31 | div.btn-container { 32 | width: 100%; 33 | padding-left: 15px; 34 | padding-right: 15px; 35 | clear: both; 36 | } 37 | 38 | div.btn-container > button.prev-step { 39 | float: left; 40 | } 41 | 42 | div.btn-container > button.next-step { 43 | float: right; 44 | } 45 | 46 | div.block { 47 | margin: 20px 10px; 48 | height: 26px; 49 | } 50 | 51 | div.block input { 52 | width: 50%; 53 | display: inline-block; 54 | } 55 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/step3/step3.component.css: -------------------------------------------------------------------------------- 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 | @import url('../../../../../../node_modules/angular2-toaster/toaster.css'); 20 | @import url('../../../measure.component.css'); 21 | 22 | fieldset { 23 | height: 60vh; 24 | } 25 | 26 | label.stepDesc { 27 | padding-left: 30px; 28 | padding-right: 30px; 29 | } 30 | 31 | div.btn-container { 32 | width: 100%; 33 | padding-left: 15px; 34 | padding-right: 15px; 35 | clear: both; 36 | } 37 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/pr/step4/step4.component.css: -------------------------------------------------------------------------------- 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 | @import url('../../../../../../node_modules/angular2-toaster/toaster.css'); 20 | @import url('../../../measure.component.css'); 21 | 22 | label.control-label { 23 | margin-top: 7px; 24 | } 25 | 26 | fieldset { 27 | height: 60vh; 28 | } 29 | 30 | label.stepDesc { 31 | padding-left: 30px; 32 | padding-right: 30px; 33 | } 34 | 35 | div.btn-container { 36 | width: 100%; 37 | padding-left: 15px; 38 | padding-right: 15px; 39 | clear: both; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/create-measure/raw/raw.component.spec.ts: -------------------------------------------------------------------------------- 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 | import {async, ComponentFixture, TestBed} from '@angular/core/testing'; 20 | 21 | import { AppModule } from '../../../app.module'; 22 | import {RawComponent} from './raw.component'; 23 | 24 | describe('RawComponent', () => { 25 | let component: RawComponent; 26 | let fixture: ComponentFixture; 27 | 28 | beforeEach(async(() => { 29 | TestBed.configureTestingModule({ 30 | imports: [ AppModule ], 31 | declarations: [] 32 | }) 33 | .compileComponents(); 34 | })); 35 | 36 | beforeEach(() => { 37 | fixture = TestBed.createComponent(RawComponent); 38 | component = fixture.componentInstance; 39 | fixture.detectChanges(); 40 | }); 41 | 42 | it('should be created', () => { 43 | expect(component).toBeTruthy(); 44 | }); 45 | }); 46 | -------------------------------------------------------------------------------- /ui/angular/src/app/measure/measure-detail/measure-detail.component.css: -------------------------------------------------------------------------------- 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 | .code-viewport { 21 | background-color: #333333; 22 | border: 1px solid #1d1d1d; 23 | border-radius: 4px; 24 | font-family: Menlo, Monaco, Consolas, "Courier New", monospace; 25 | font-size: 13px; 26 | line-height: 1.5; 27 | color: #e4e4e4; 28 | word-break: break-all; 29 | word-wrap: break-word; 30 | } 31 | 32 | .btn-flat { 33 | outline: none !important; 34 | } 35 | -------------------------------------------------------------------------------- /ui/angular/src/app/mydashboard/mydashboard.component.css: -------------------------------------------------------------------------------- 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 | */ -------------------------------------------------------------------------------- /ui/angular/src/app/mydashboard/mydashboard.component.html: -------------------------------------------------------------------------------- 1 | 19 | -------------------------------------------------------------------------------- /ui/angular/src/app/mydashboard/mydashboard.component.ts: -------------------------------------------------------------------------------- 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 | import {Component, OnInit} from '@angular/core'; 20 | import {Router} from '@angular/router'; 21 | 22 | @Component({ 23 | selector: 'app-mydashboard', 24 | templateUrl: './mydashboard.component.html', 25 | styleUrls: ['./mydashboard.component.css'] 26 | }) 27 | export class MydashboardComponent implements OnInit { 28 | 29 | constructor(public router: Router) { 30 | } 31 | 32 | ngOnInit() { 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/chart.service.spec.ts: -------------------------------------------------------------------------------- 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 | import {TestBed, inject} from '@angular/core/testing'; 20 | 21 | import {ChartService} from './chart.service'; 22 | import { LoaderService } from '../loader/loader.service'; 23 | 24 | describe('ChartService', () => { 25 | beforeEach(() => { 26 | TestBed.configureTestingModule({ 27 | providers: [ChartService, LoaderService] 28 | }); 29 | }); 30 | 31 | it('should be created', inject([ChartService, LoaderService], (service: ChartService, loaderService: LoaderService) => { 32 | expect(service).toBeTruthy(); 33 | })); 34 | }); 35 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/http.service.spec.ts: -------------------------------------------------------------------------------- 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 | import {TestBed, inject} from '@angular/core/testing'; 20 | 21 | import {HttpService} from './http.service'; 22 | import { LoaderService } from '../loader/loader.service'; 23 | 24 | describe('HttpService', () => { 25 | beforeEach(() => { 26 | TestBed.configureTestingModule({ 27 | providers: [HttpService, LoaderService] 28 | }); 29 | }); 30 | 31 | it('should be created', inject([HttpService], (service: HttpService) => { 32 | expect(service).toBeTruthy(); 33 | })); 34 | }); 35 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/measure-format.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from "@angular/core"; 2 | import * as yaml from "js-yaml"; 3 | 4 | @Injectable() 5 | export class MeasureFormatService { 6 | constructor() { 7 | } 8 | 9 | format(measure: any, format: Format) { 10 | switch (format) { 11 | case Format.json: 12 | return JSON.stringify(measure, null, 4); 13 | case Format.yaml: 14 | return yaml.dump(measure); 15 | 16 | } 17 | } 18 | 19 | parse(data: string, format: Format) { 20 | switch (format) { 21 | case Format.json: 22 | return JSON.parse(data); 23 | case Format.yaml: 24 | return yaml.load(data); 25 | 26 | } 27 | } 28 | 29 | determineFormat(data: string) { 30 | try { 31 | JSON.parse(data); 32 | return Format.json; 33 | } catch (e) {} 34 | try { 35 | if (yaml.load(data)) { 36 | return Format.yaml; 37 | } 38 | } catch (e) {} 39 | return null; 40 | } 41 | } 42 | 43 | export enum Format { 44 | json = 1, 45 | yaml = 2 46 | } 47 | 48 | 49 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/service.service.spec.ts: -------------------------------------------------------------------------------- 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 | import {TestBed, inject} from '@angular/core/testing'; 20 | 21 | import {ServiceService} from './service.service'; 22 | import { LoaderService } from '../loader/loader.service'; 23 | 24 | describe('ServiceService', () => { 25 | beforeEach(() => { 26 | TestBed.configureTestingModule({ 27 | providers: [ServiceService, LoaderService] 28 | }); 29 | }); 30 | 31 | it('should be created', inject([ServiceService], (service: ServiceService) => { 32 | expect(service).toBeTruthy(); 33 | })); 34 | }); 35 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/user.service.spec.ts: -------------------------------------------------------------------------------- 1 | import {TestBed, inject} from '@angular/core/testing'; 2 | 3 | import {UserService} from './user.service'; 4 | 5 | describe('UserService', () => { 6 | beforeEach(() => { 7 | TestBed.configureTestingModule({ 8 | providers: [UserService] 9 | }); 10 | }); 11 | 12 | it('should be created', inject([UserService], (service: UserService) => { 13 | expect(service).toBeTruthy(); 14 | })); 15 | }); 16 | -------------------------------------------------------------------------------- /ui/angular/src/app/service/user.service.ts: -------------------------------------------------------------------------------- 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 | import {Injectable} from "@angular/core"; 20 | 21 | @Injectable() 22 | export class UserService { 23 | ntAccount: string; 24 | timestamp: Date; 25 | 26 | setCookie(name, value, days) { 27 | let expires; 28 | if (days) { 29 | var date = new Date(); 30 | date.setTime(date.getTime() + days * 24 * 60 * 60 * 1000); 31 | expires = "; expires=" + date.toUTCString(); 32 | } else { 33 | expires = ""; 34 | } 35 | document.cookie = name + "=" + value + expires + "; path=/"; 36 | } 37 | 38 | getCookie(key) { 39 | var keyValue = document.cookie.match("(^|;) ?" + key + "=([^;]*)(;|$)"); 40 | return keyValue ? keyValue[2] : null; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /ui/angular/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 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 | import { NgModule } from '@angular/core'; 20 | import { CommonModule } from '@angular/common'; 21 | 22 | @NgModule({ 23 | imports: [ 24 | CommonModule 25 | ], 26 | declarations: [], 27 | exports: [ 28 | ] 29 | }) 30 | export class SharedModule { } 31 | -------------------------------------------------------------------------------- /ui/angular/src/app/shared/time-utils.ts: -------------------------------------------------------------------------------- 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 | export class TimeUtils { 20 | 21 | static getBrowserTimeZone() { 22 | let time = -(new Date().getTimezoneOffset() / 60); 23 | return "GMT" + (time >= 0 ? "+"+time : time) + ":00"; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /ui/angular/src/app/sidebar/truncate.pipe.ts: -------------------------------------------------------------------------------- 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 | import {Pipe, PipeTransform} from '@angular/core' 20 | 21 | @Pipe({ 22 | name: 'truncate' 23 | }) 24 | export class TruncatePipe { 25 | transform(value: string, limit: number): string { 26 | let trail = '...'; 27 | return value.length > limit ? value.substring(0, limit) + trail : value; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ui/angular/src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/ui/angular/src/assets/.gitkeep -------------------------------------------------------------------------------- /ui/angular/src/assets/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/ui/angular/src/assets/img/favicon.ico -------------------------------------------------------------------------------- /ui/angular/src/assets/img/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/ui/angular/src/assets/img/logo.gif -------------------------------------------------------------------------------- /ui/angular/src/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/ui/angular/src/assets/img/logo.png -------------------------------------------------------------------------------- /ui/angular/src/environments/environment.js: -------------------------------------------------------------------------------- 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 | "use strict"; 20 | // The file contents for the current environment will overwrite these during build. 21 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 22 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 23 | // The list of which env maps to which file can be found in `.angular-cli.json`. 24 | exports.__esModule = true; 25 | exports.environment = { 26 | production: false 27 | }; 28 | -------------------------------------------------------------------------------- /ui/angular/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 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 | export const environment = { 20 | production: true, 21 | BACKEND_SERVER: '', 22 | }; 23 | -------------------------------------------------------------------------------- /ui/angular/src/environments/environment.ts: -------------------------------------------------------------------------------- 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 | // The file contents for the current environment will overwrite these during build. 20 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 21 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 22 | // The list of which env maps to which file can be found in `.angular-cli.json`. 23 | 24 | export const environment = { 25 | production: false, 26 | BACKEND_SERVER: '', 27 | }; 28 | -------------------------------------------------------------------------------- /ui/angular/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/apache/griffin/e293406f5756a9d375a1e123f32dbbdd72934130/ui/angular/src/favicon.ico -------------------------------------------------------------------------------- /ui/angular/src/main.js: -------------------------------------------------------------------------------- 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 | "use strict"; 20 | exports.__esModule = true; 21 | var core_1 = require("@angular/core"); 22 | var platform_browser_dynamic_1 = require("@angular/platform-browser-dynamic"); 23 | var app_module_1 = require("./app/app.module"); 24 | var environment_1 = require("./environments/environment"); 25 | require("jquery"); 26 | // import 'bootstrap'; 27 | // import 'bootstrap/dist/css/bootstrap.css'; 28 | require("bootstrap/dist/css/bootstrap.css"); 29 | if (environment_1.environment.production) { 30 | core_1.enableProdMode(); 31 | } 32 | platform_browser_dynamic_1.platformBrowserDynamic().bootstrapModule(app_module_1.AppModule); 33 | -------------------------------------------------------------------------------- /ui/angular/src/main.ts: -------------------------------------------------------------------------------- 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 | import {enableProdMode} from '@angular/core'; 20 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 21 | import {AppModule} from './app/app.module'; 22 | import {environment} from './environments/environment'; 23 | import {RouterModule, Routes} from '@angular/router'; 24 | import {HttpClientModule} from '@angular/common/http'; 25 | import {BrowserAnimationsModule} from '@angular/platform-browser/animations'; 26 | 27 | import 'bootstrap/dist/css/bootstrap.css'; 28 | 29 | if (environment.production) { 30 | enableProdMode(); 31 | } 32 | 33 | platformBrowserDynamic().bootstrapModule(AppModule); 34 | 35 | -------------------------------------------------------------------------------- /ui/angular/src/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/app", 5 | "baseUrl": "./", 6 | "module": "es2015", 7 | "types": [] 8 | }, 9 | "exclude": [ 10 | "test.ts", 11 | "**/*.spec.ts" 12 | ] 13 | } 14 | -------------------------------------------------------------------------------- /ui/angular/src/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../out-tsc/spec", 5 | "baseUrl": "./", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": [ 9 | "jasmine", 10 | "node" 11 | ] 12 | }, 13 | "files": [ 14 | "test.ts" 15 | ], 16 | "include": [ 17 | "**/*.spec.ts", 18 | "**/*.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /ui/angular/src/typings.d.ts: -------------------------------------------------------------------------------- 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 | /* SystemJS module definition */ 20 | declare var module: NodeModule; 21 | 22 | interface NodeModule { 23 | id: string; 24 | } 25 | -------------------------------------------------------------------------------- /ui/angular/src/vendor.ts: -------------------------------------------------------------------------------- 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 | import '@angular/platform-browser'; 20 | import '@angular/platform-browser-dynamic'; 21 | import '@angular/core'; 22 | import '@angular/common'; 23 | import '@angular/http'; 24 | import '@angular/router'; 25 | 26 | 27 | // RxJS 28 | import 'rxjs'; 29 | 30 | import 'jquery'; 31 | import 'bootstrap/dist/js/bootstrap'; 32 | import 'bootstrap-loader'; 33 | -------------------------------------------------------------------------------- /ui/angular/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "outDir": "./dist/out-tsc", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "target": "es5", 11 | "typeRoots": [ 12 | "node_modules/@types" 13 | ], 14 | "lib": [ 15 | "es2017", 16 | "dom" 17 | ] 18 | } 19 | } 20 | --------------------------------------------------------------------------------