Skip to content

Commit 2ef529a

Browse files
committed
Merging 2.1.0 features
1 parent f36c2f5 commit 2ef529a

File tree

34 files changed

+714
-4
lines changed

34 files changed

+714
-4
lines changed

build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ targetCompatibility = "1.7"
2424

2525
repositories {
2626
jcenter()
27+
mavenLocal() // Used for local development only
2728
}
2829

2930
dependencies {
@@ -66,7 +67,7 @@ if (project.hasProperty("myBintrayUser")) {
6667
licenses = ['Apache-2.0']
6768
vcsUrl = 'https://github.com/rjrudin/' + project.name + '.git'
6869
version {
69-
name = "2.0"
70+
name = "2.1.0"
7071
released = new Date()
7172
}
7273
}
@@ -85,11 +86,11 @@ pluginBundle {
8586
displayName = 'ml-gradle for MarkLogic'
8687
description = 'Gradle plugin for configuring and deploying applications to MarkLogic'
8788
tags = ['marklogic']
88-
version = "2.0"
89+
version = "2.1.0"
8990
}
9091
}
9192

9293
mavenCoordinates {
93-
version = "2.0"
94+
version = "2.1.0"
9495
}
9596
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/bin
2+
.classpath
3+
.project
4+
/build
5+
.gradle
6+
.settings
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
This project shows an example of managing both the master and replica config in the
2+
flexrep/master and flexrep/replica directories.
3+
4+
The use case for this is when you have an application that should be deployed on both the
5+
master and replica clusters in the exact way, with one exception - how flexrep is configured.
6+
7+
The property "mlFlexrepPath" can be set to specify the path name under
8+
src/main/ml-config/flexrep that contains the configuration to load, based on whether the app
9+
is being deployed to the master cluster or the replica cluster.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
buildscript {
2+
repositories {
3+
jcenter()
4+
mavenLocal()
5+
}
6+
dependencies {
7+
classpath "com.marklogic:ml-gradle:2.1.0"
8+
}
9+
}
10+
11+
apply plugin: "com.marklogic.ml-gradle"
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
mlHost=localhost
2+
mlAppName=flexrep-with-path-project
3+
mlRestPort=8130
4+
mlUsername=admin
5+
mlPassword=admin
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"database-name": "%%DATABASE%%",
3+
"triggers-database": "%%TRIGGERS_DATABASE%%"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"database-name": "%%TRIGGERS_DATABASE%%"
3+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"domain-name": "master-domain",
3+
"restart-user-name": "admin",
4+
"eval-module": "Modules",
5+
"eval-root": "/",
6+
"conversion-enabled": false,
7+
"permission": [{
8+
"role-name": "app-user",
9+
"capability": "read"
10+
}]
11+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"domain-name": "master-domain",
3+
"description": "Test domain for sample app",
4+
"scope": "directory",
5+
"uri": "/master/",
6+
"depth": "infinity",
7+
"eval-module": "Modules",
8+
"eval-root": "/",
9+
"pipeline": ["Status Change Handling", "Flexible Replication"]
10+
}
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
<pipeline-properties xmlns="http://marklogic.com/manage/pipeline/properties">
2+
<pipeline-id>6600933789859022149</pipeline-id>
3+
<pipeline-name>Flexible Replication</pipeline-name>
4+
<pipeline-description>
5+
Attempts push replication if possible, otherwise updates document properties so that push or poll will occur later.
6+
</pipeline-description>
7+
<success-action>
8+
<module>/MarkLogic/cpf/actions/success-action.xqy</module>
9+
</success-action>
10+
<failure-action>
11+
<module>/MarkLogic/cpf/actions/failure-action.xqy</module>
12+
</failure-action>
13+
<state-transition>
14+
<annotation>
15+
Replicate a document and transition to state "replicated".
16+
</annotation>
17+
<state>http://marklogic.com/states/converted</state>
18+
<on-success>http://marklogic.com/states/replicated</on-success>
19+
<on-failure>http://marklogic.com/states/error</on-failure>
20+
<priority>9100</priority>
21+
<execute>
22+
<condition>
23+
<module>
24+
/MarkLogic/conversion/actions/conversion-source-condition.xqy
25+
</module>
26+
</condition>
27+
<action>
28+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
29+
</action>
30+
</execute>
31+
</state-transition>
32+
<state-transition>
33+
<annotation>
34+
Replicate a document and transition to state "replicated".
35+
</annotation>
36+
<state>http://marklogic.com/states/structured-xhtml</state>
37+
<on-success>http://marklogic.com/states/replicated</on-success>
38+
<on-failure>http://marklogic.com/states/error</on-failure>
39+
<priority>5000</priority>
40+
<default-action>
41+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
42+
</default-action>
43+
</state-transition>
44+
<state-transition>
45+
<annotation>
46+
Replicate a document and transition to state "replicated".
47+
</annotation>
48+
<state>http://marklogic.com/states/initial</state>
49+
<on-success>http://marklogic.com/states/replicated</on-success>
50+
<on-failure>http://marklogic.com/states/error</on-failure>
51+
<priority>5000</priority>
52+
<default-action>
53+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
54+
</default-action>
55+
</state-transition>
56+
<state-transition>
57+
<annotation>
58+
Replicate a document and transition to state "replicated".
59+
</annotation>
60+
<state>http://marklogic.com/states/entities/enriched</state>
61+
<on-success>http://marklogic.com/states/replicated</on-success>
62+
<on-failure>http://marklogic.com/states/error</on-failure>
63+
<priority>5000</priority>
64+
<default-action>
65+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
66+
</default-action>
67+
</state-transition>
68+
<state-transition>
69+
<annotation>
70+
Replicate a document and transition to state "replicated".
71+
</annotation>
72+
<state>http://marklogic.com/states/xinclude/expanded</state>
73+
<on-success>http://marklogic.com/states/replicated</on-success>
74+
<on-failure>http://marklogic.com/states/error</on-failure>
75+
<priority>5000</priority>
76+
<default-action>
77+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
78+
</default-action>
79+
</state-transition>
80+
<state-transition>
81+
<annotation>
82+
Replicate a document and transition to state "replicated".
83+
</annotation>
84+
<state>http://marklogic.com/states/alerted</state>
85+
<on-success>http://marklogic.com/states/replicated</on-success>
86+
<on-failure>http://marklogic.com/states/error</on-failure>
87+
<priority>5000</priority>
88+
<default-action>
89+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
90+
</default-action>
91+
</state-transition>
92+
<state-transition>
93+
<annotation>
94+
Replicate a document and transition to state "replicated".
95+
</annotation>
96+
<state>http://marklogic.com/states/property-updated</state>
97+
<on-success>http://marklogic.com/states/replicated</on-success>
98+
<on-failure>http://marklogic.com/states/error</on-failure>
99+
<priority>5000</priority>
100+
<default-action>
101+
<module>/MarkLogic/flexrep/actions/replication-action.xqy</module>
102+
</default-action>
103+
</state-transition>
104+
<state-transition>
105+
<annotation>
106+
Document has been updated: reprocess if need be. Note: the preconditions will avoid reprocessing of active documents, so we
107+
will avoid falling into a processing loop when the processing updates a document.
108+
</annotation>
109+
<state>http://marklogic.com/states/updated</state>
110+
<on-success>http://marklogic.com/states/initial</on-success>
111+
<on-failure>http://marklogic.com/states/error</on-failure>
112+
<priority>5000</priority>
113+
</state-transition>
114+
<status-transition>
115+
<annotation>
116+
Leave a bread crumb that the document has been deleted.
117+
</annotation>
118+
<status>deleted</status>
119+
<priority>5000</priority>
120+
<always>true</always>
121+
<default-action>
122+
<module>/MarkLogic/flexrep/actions/delete-action.xqy</module>
123+
</default-action>
124+
</status-transition>
125+
<event-transition>
126+
<annotation>
127+
Pull flexrep properties from prior version of document if needed.
128+
</annotation>
129+
<event>updated</event>
130+
<priority>5000</priority>
131+
<default-action>
132+
<module>
133+
/MarkLogic/flexrep/actions/on-event-pull-properties.xqy
134+
</module>
135+
</default-action>
136+
</event-transition>
137+
<event-transition>
138+
<annotation>
139+
Pull flexrep properties from prior version of document if needed.
140+
</annotation>
141+
<event>property-updated</event>
142+
<priority>5000</priority>
143+
<default-action>
144+
<module>
145+
/MarkLogic/flexrep/actions/on-event-pull-properties.xqy
146+
</module>
147+
</default-action>
148+
</event-transition>
149+
</pipeline-properties>

0 commit comments

Comments
 (0)