Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Commit be2b434

Browse files
author
Scott Stafford
committed
Merge branch 'marklogic-community_dev' into marklogic-community_master
2 parents be881d2 + 3f66b7b commit be2b434

File tree

102 files changed

+321
-691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+321
-691
lines changed

README.md

Lines changed: 62 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,85 @@
1-
![GitHub version](https://img.shields.io/github/tag/marklogic-community/marklogic-spring-batch.svg)
1+
# MarkLogic Spring Batch
22

3-
| Branch | Status |
4-
| ------------- | ------------- |
5-
| master | ![master](https://circleci.com/gh/sastafford/marklogic-spring-batch/tree/master.png?circle-token=e1b8b3198d3416fcb535509f2e7d600444ef153e) |
6-
| dev | ![dev](https://circleci.com/gh/sastafford/marklogic-spring-batch/tree/dev.png?circle-token=e1b8b3198d3416fcb535509f2e7d600444ef153e) |
7-
| ml-8 | ![ml-8](https://circleci.com/gh/sastafford/marklogic-spring-batch/tree/ml-8.png?circle-token=e1b8b3198d3416fcb535509f2e7d600444ef153e) |
3+
The MarkLogic Spring Batch project is an extension of the CORE and INFRASTRUCTURE components of Spring Batch to make it easier to write batch processing programs using MarkLogic.
84

5+
Start with the [project home page](https://github.com/marklogic-community/marklogic-spring-batch/wiki) to get started.
96

10-
# What is Spring Batch?
7+
## Prerequisites
118

12-
[Spring Batch](http://docs.spring.io/spring-batch/trunk/reference/html/) is an open source framework for batch processing based on the [Spring Framework](http://projects.spring.io/spring-framework/).
9+
* MarkLogic 8+
10+
* JDK 1.8+
1311

14-
Figure 1 depicts a high-level diagram of a Spring Batch program. The green APPLICATION box represents the batch processing program that gets executed by a user. This is usually a command line based application but it could also be triggered by an external source like a user interface. Spring Batch provides two components, CORE and INFRASTRUCTURE, that enables the boilerplate code for creating an APPLICATION.
15-
16-
* CORE - contains the core runtime classes necessary to launch and control a batch job
17-
* INFRASTRUCTURE - contains common readers and writers, and services which are used by APPLICATION and CORE
18-
19-
![Spring Batch Architecture](http://docs.spring.io/spring-batch/trunk/reference/html/images/spring-batch-layers.png.pagespeed.ce.sMqaNr3V1Z.png)
12+
## Installing the Test Environment
2013

21-
*Figure 1*
14+
Open $PROJECT_ROOT/gradle.properties. Review the mlHost, mlRestPort, mlJobRepoPort properties to confirm there are no conflicts
2215

23-
Figure 2 shows the key concepts that make up the domain language of Spring Batch. The boxes in blue represent concepts from the CORE component and yellow from the INFRASTRUCTURE component. A Job has one to many steps, which has exactly one ItemReader, ItemProcessor, and ItemWriter. A job needs to be launched (JobLauncher), and meta data about the currently running process needs to be stored (JobRepository).
16+
gradlew mlDeploy
2417

25-
![Spring Batch Stereotypes](http://docs.spring.io/spring-batch/trunk/reference/html/images/spring-batch-reference-model.png.pagespeed.ce.TrtTC751hI.png)
18+
This command will set up your test database and application server.
2619

27-
*Figure 2*
20+
## Running the tests
2821

29-
# Why use Spring Batch?
22+
Review the host/port/user credentials properties for the following property files.
3023

31-
* If you need to migrate data from a relational database, mainframe, or other external source to MarkLogic.
32-
* If you have a batch processing job that is outside the scope of other batch processing tools like MLCP or CORB
33-
* If you find that you need 'boilerplate' code to provide failover capability, performance, and extensibility for a custom batch processing job.
34-
* If you are a Java shop running MarkLogic 8+
24+
* ./core/src/test/resources/job.properties
25+
* ./infrastructure/src/test/resources/job.properties
26+
* ./rdf/src/test/resources/job.properties
27+
* ./samples/src/test/resources/job.properties
28+
29+
Run the following command to execute all project tests. All tests should pass.
3530

36-
# What is MarkLogic Spring Batch?
31+
gradlew test
3732

38-
MarkLogic Spring Batch (MSB) extends the CORE and INFRASTRUCTURE components of Spring Batch to make it easier to work with data and MarkLogic. Sample code templates are included for developers getting started writing a batch processing APPLICATION.
33+
## Coding Style Tests
3934

40-
## What are the main features of MarkLogic Spring Batch?
35+
This project uses both checkstyle and PMD.
4136

42-
* Extends the [INFRASTRUCTURE]() classes to facilitate reading, writing, and processing documents for MarkLogic.
43-
* A sample [APPLICATION]() that provides a template program to create your own Spring Batch program
44-
* (Beta) MarkLogic implementation of a JobRepository
37+
gradlew check
4538

46-
# How can I get started using MarkLogic Spring Batch?
39+
## Deployment
4740

48-
Check out the [Getting Started Wiki](), review the sample application, and check out other batch processing applications using Spring Batch
41+
The product of this project are jar files that are published to [bintray](https://dl.bintray.com/sastafford/maven/). The following libraries are created.
4942

50-
* [ml-migration-starter]() - Migrate data from a relational database into MarkLogic
51-
* [Hector]() - Ingest CSV files into MarkLogic
52-
* [Penny]() - Use Apache Natural Language Processing library to perform named entity recognition over documents
43+
| Group | Artifact |
44+
| ------|----------|
45+
| com.marklogic | marklogic-spring-batch-core |
46+
| com.marklogic | marklogic-spring-batch-infrastructure |
47+
| com.marklogic | marklogic-spring-batch-test |
48+
| com.marklogic | spring-batch-http |
49+
| com.marklogic | spring-batch-rdbms |
5350

54-
# What are the goals for the MarkLogic Spring Batch project?
51+
The gradle bintray plugin is used to publish to bintray.
52+
53+
gradlew :core:bintrayUpload
54+
gradlew :infrastructure:bintrayUpload
55+
gradlew :test:bintrayUpload
56+
gradlew :http:bintrayUpload
57+
gradlew :rdbms:bintrayUpload
58+
59+
## How do I use these libraries?
60+
61+
### Gradle
62+
63+
```groovy
64+
dependencies {
65+
compile 'com.marklogic:marklogic-spring-batch-core:1.4.0'
66+
testCompile 'com.marklogic:marklogic-spring-batch-test:1.4.0'
67+
}
68+
```
69+
70+
71+
### Maven
72+
73+
```xml
74+
<dependencies>
75+
<dependency>
76+
<groupId>com.marklogic</groupId>
77+
<artifactId>marklogic-spring-batch-core</artifactId>
78+
<version>1.4.2</version>
79+
</dependency>
80+
</dependencies>
81+
```
5582

56-
* Write batch processing solutions that are reliable, robust, and high performing
57-
* Reduce the amount of time it takes to build, operate, and maintain batch processing jobs with MarkLogic
58-
* Minimize complexity of batch processing applications
5983

6084
# How can I contribute to the project?
6185

@@ -64,6 +88,3 @@ Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute
6488
# What license does MarkLogic Spring Batch use?
6589

6690
See the [LICENSE.md](LICENSE.md) file for details
67-
68-
----
69-
1. Spring Batch Introduction: http://docs.spring.io/spring-batch/trunk/reference/html/spring-batch-intro.html

build.gradle

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ buildscript {
1212
}
1313

1414
plugins {
15-
id "com.marklogic.ml-gradle" version "3.2.0"
15+
id "com.marklogic.ml-gradle" version "3.3.0"
1616
}
1717

1818
mlPostDeploy.dependsOn ":mlJobRepo:deployMarkLogicJobRepository"
1919
mlUndeploy.dependsOn "mlJobRepo:undeployMarkLogicJobRepository"
2020

2121
allprojects {
22+
apply plugin: "checkstyle"
23+
apply plugin: "pmd"
24+
2225
repositories {
2326
jcenter()
2427
mavenCentral()
@@ -27,20 +30,29 @@ allprojects {
2730
}
2831

2932
task wrapper(type: Wrapper) {
30-
gradleVersion = '4.3'
33+
gradleVersion = '4.4.1'
34+
}
35+
36+
pmd {
37+
ruleSets = ["java-basic", "java-braces", "java-unusedcode"]
3138
}
39+
40+
checkstyle {
41+
configFile = file("${project.rootDir}/config/checkstyle/checkstyle.xml")
42+
toolVersion = '7.1.2'
43+
}
44+
3245
}
3346

3447
subprojects {
3548

3649
apply plugin: "java"
3750
apply plugin: "maven-publish"
3851
apply plugin: "idea"
39-
apply plugin: "checkstyle"
4052

4153
ext {
42-
springBatchVersion = '3.0.8.RELEASE'
43-
springVersion = '4.3.9.RELEASE'
54+
springBatchVersion = '4.0.0.RELEASE'
55+
springVersion = '5.0.2.RELEASE'
4456
}
4557

4658
dependencies {
@@ -54,8 +66,9 @@ subprojects {
5466
sourceCompatibility = 1.8
5567
targetCompatibility = 1.8
5668

57-
checkstyle {
58-
configFile = file("${project.rootDir}/dev-tools/checkstyle/checkstyle.xml")
59-
toolVersion = '7.1.2'
69+
task cleanJavaDocs(type: Delete) {
70+
delete fileTree("../sastafford.github.io/marklogic-spring-batch/javadoc")
6071
}
72+
73+
javadoc.dependsOn cleanJavaDocs
6174
}
File renamed without changes.

core/README.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

core/build.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
apply plugin: "com.jfrog.bintray"
22

33
dependencies {
4-
//core doesn't depend on infrastructure but want to grab both jars when importing MSB
5-
compile project(":infrastructure")
6-
74
// For the CommandLineInterface main program
85
compile "net.sf.jopt-simple:jopt-simple:5.0.1"
96

107
compile "org.springframework.batch:spring-batch-core:$springBatchVersion"
118
compile "com.marklogic:marklogic-client-api:4.0.3"
129
compile "com.marklogic:ml-javaclient-util:3.2.0"
10+
compile "org.apache.commons:commons-lang3:3.5"
1311

1412
testCompile "org.springframework.batch:spring-batch-test:$springBatchVersion"
1513
testCompile "com.marklogic:ml-junit:3.0.0"
@@ -26,6 +24,10 @@ ext {
2624
artifact = "marklogic-spring-batch-core"
2725
}
2826

27+
javadoc {
28+
destinationDir = new File("../sastafford.github.io/marklogic-spring-batch/javadoc/core")
29+
}
30+
2931
task sourcesJar(type: Jar, dependsOn: classes) {
3032
baseName = artifactId
3133
version = project.version
-394 Bytes
Binary file not shown.

core/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-bin.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip

0 commit comments

Comments
 (0)