Skip to content

Commit ddce28a

Browse files
authored
Merge pull request #6 from data-integrations/feature/update-to-5.1.2
update to 5.1.2
2 parents 6225f04 + 8ee67a9 commit ddce28a

File tree

4 files changed

+13
-516
lines changed

4 files changed

+13
-516
lines changed

icons/icon.png

5.49 KB
Loading

pom.xml

Lines changed: 13 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>co.cask.hydrator</groupId>
88
<artifactId>elasticsearch-plugins</artifactId>
9-
<version>1.8.0</version>
9+
<version>1.8.1</version>
1010

1111
<licenses>
1212
<license>
@@ -65,22 +65,19 @@
6565

6666
<properties>
6767
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
68-
<cdap.version>4.2.0</cdap.version>
68+
<cdap.version>5.1.2</cdap.version>
6969
<hadoop.version>2.3.0</hadoop.version>
7070
<junit.version>4.11</junit.version>
71-
<hydrator.version>1.7.0</hydrator.version>
71+
<hydrator.version>2.1.2</hydrator.version>
7272
<es.version>5.4.0</es.version>
7373
<es-hadoop.version>5.4.0</es-hadoop.version>
74-
<widgets.dir>widgets</widgets.dir>
7574
<slf4j.version>1.7.5</slf4j.version>
7675
<netty.version>4.0.30.Final</netty.version>
7776
<log4j.version>2.7</log4j.version>
7877
<logback.version>1.1.7</logback.version>
7978
<commons.version>3.1</commons.version>
8079
<junit.version>4.11</junit.version>
8180
<commons-httpclient.version>3.1</commons-httpclient.version>
82-
<docs.dir>docs</docs.dir>
83-
<app.parents>system:cdap-data-pipeline[4.3.0-SNAPSHOT,5.0.0-SNAPSHOT),system:cdap-data-streams[4.3.0-SNAPSHOT,5.0.0-SNAPSHOT)</app.parents>
8481
<!-- this is here because project.basedir evaluates to null in the script build step -->
8582
<main.basedir>${project.basedir}</main.basedir>
8683
</properties>
@@ -111,12 +108,6 @@
111108
<version>${cdap.version}</version>
112109
<scope>test</scope>
113110
</dependency>
114-
<dependency>
115-
<groupId>co.cask.cdap</groupId>
116-
<artifactId>cdap-etl-realtime</artifactId>
117-
<version>${cdap.version}</version>
118-
<scope>test</scope>
119-
</dependency>
120111
<dependency>
121112
<groupId>co.cask.hydrator</groupId>
122113
<artifactId>hydrator-common</artifactId>
@@ -338,88 +329,21 @@
338329
</executions>
339330
</plugin>
340331
<plugin>
341-
<groupId>org.apache.maven.plugins</groupId>
342-
<artifactId>maven-antrun-plugin</artifactId>
343-
<version>1.7</version>
332+
<groupId>co.cask</groupId>
333+
<artifactId>cdap-maven-plugin</artifactId>
334+
<version>1.0.1</version>
335+
<configuration>
336+
<cdapArtifacts>
337+
<parent>system:cdap-data-pipeline[5.0.0,6.0.0-SNAPSHOT)</parent>
338+
<parent>system:cdap-data-streams[5.0.0,6.0.0-SNAPSHOT)</parent>
339+
</cdapArtifacts>
340+
</configuration>
344341
<executions>
345342
<execution>
346343
<id>create-artifact-config</id>
347344
<phase>prepare-package</phase>
348-
<configuration>
349-
<target>
350-
<script language="javascript"> <![CDATA[
351-
352-
// for some reason, project.basedir evaluates to null if we just get the property here.
353-
// so we set main.basedir to project.basedir in the pom properties, then main.basedir is used here
354-
// where it evaluates correctly for whatever reason
355-
var baseDir = project.getProperty("main.basedir");
356-
var targetDir = project.getProperty("project.build.directory");
357-
var artifactId = project.getProperty("project.artifactId");
358-
var version = project.getProperty("project.version");
359-
360-
var cfgFile = new java.io.File(targetDir, artifactId + "-" + version + ".json");
361-
if (!cfgFile.exists()) {
362-
cfgFile.createNewFile();
363-
}
364-
365-
var parents = project.getProperty("app.parents").split(",");
366-
var config = {
367-
"parents": [ ],
368-
"properties": {}
369-
}
370-
for (i = 0; i < parents.length; i+=2) {
371-
// because name1[lo,hi],name2[lo,hi] gets split into "name1[lo", "hi]", "name2[lo", "hi]"
372-
// so we have to combine them again
373-
config.parents.push(parents[i] + "," + parents[i+1]);
374-
}
375-
376-
// look in widgets directory for widget config for each plugin
377-
var widgetsDir = new java.io.File(baseDir, project.getProperty("widgets.dir"));
378-
if (widgetsDir.isDirectory()) {
379-
var widgetsFiles = widgetsDir.listFiles();
380-
for (i = 0; i < widgetsFiles.length; i++) {
381-
var widgetsFile = widgetsFiles[i];
382-
if (widgetsFile.isFile()) {
383-
var propertyName = "widgets." + widgetsFile.getName();
384-
// if the filename ends with .json
385-
if (propertyName.indexOf(".json", propertyName.length - 5) !== -1) {
386-
// strip the .json
387-
propertyName = propertyName.slice(0, -5);
388-
var contents = new java.lang.String(java.nio.file.Files.readAllBytes(widgetsFile.toPath()), java.nio.charset.StandardCharsets.UTF_8);
389-
var contentsAsJson = JSON.parse(contents);
390-
config.properties[propertyName] = JSON.stringify(contentsAsJson);
391-
}
392-
}
393-
}
394-
}
395-
396-
// look in the docs directory for docs for each plugin
397-
var docsDir = new java.io.File(baseDir, project.getProperty("docs.dir"));
398-
if (docsDir.isDirectory()) {
399-
var docFiles = docsDir.listFiles();
400-
for (i = 0; i < docFiles.length; i++) {
401-
var docFile = docFiles[i];
402-
if (docFile.isFile()) {
403-
var propertyName = "doc." + docFile.getName();
404-
// if the filename ends with .md
405-
if (propertyName.indexOf(".md", propertyName.length - 3) !== -1) {
406-
// strip the extension
407-
propertyName = propertyName.slice(0, -3);
408-
var contents = new java.lang.String(java.nio.file.Files.readAllBytes(docFile.toPath()), java.nio.charset.StandardCharsets.UTF_8);
409-
config.properties[propertyName] = contents + "";
410-
}
411-
}
412-
}
413-
}
414-
415-
var fw = new java.io.BufferedWriter(new java.io.FileWriter(cfgFile.getAbsoluteFile()));
416-
fw.write(JSON.stringify(config, null, 2));
417-
fw.close();
418-
]]></script>
419-
</target>
420-
</configuration>
421345
<goals>
422-
<goal>run</goal>
346+
<goal>create-plugin-json</goal>
423347
</goals>
424348
</execution>
425349
</executions>

src/main/java/co/cask/hydrator/plugin/realtime/RealtimeElasticsearchSink.java

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

0 commit comments

Comments
 (0)