Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
target/
*.class

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.ear

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
.idea
87 changes: 87 additions & 0 deletions CloudwatchPlugin.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="EclipseModuleManager">
<conelement value="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" />
<src_description expected_position="0">
<src_folder value="file://$MODULE_DIR$/src/main/java" expected_position="0" />
<src_folder value="file://$MODULE_DIR$/src/main/resources" expected_position="1" />
<src_folder value="file://$MODULE_DIR$/src/test/java" expected_position="2" />
</src_description>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/target/dev-tools/rest-api-spec" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/dev-tools/shared-test-resources" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/target/metadata-test-resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/target/antrun" />
<excludeFolder url="file://$MODULE_DIR$/target/apidocs" />
<excludeFolder url="file://$MODULE_DIR$/target/archive-tmp" />
<excludeFolder url="file://$MODULE_DIR$/target/classes" />
<excludeFolder url="file://$MODULE_DIR$/target/heapdump" />
<excludeFolder url="file://$MODULE_DIR$/target/javadoc-bundle-options" />
<excludeFolder url="file://$MODULE_DIR$/target/maven-archiver" />
<excludeFolder url="file://$MODULE_DIR$/target/releases" />
<excludeFolder url="file://$MODULE_DIR$/target/test-classes" />
</content>
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="inheritedJdk" />
<orderEntry type="library" name="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER" level="application" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-cloudwatch:1.10.69" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-core:1.10.69" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.1.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.5.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.5.0" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.2" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.4" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-all:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.lucene:lucene-test-framework:5.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apache.lucene:lucene-codecs:5.5.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: com.carrotsearch.randomizedtesting:randomizedtesting-runner:2.3.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.elasticsearch:elasticsearch:test-jar:tests:2.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.elasticsearch:securesm:1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.hdrhistogram:HdrHistogram:2.1.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.twitter:jsr166e:1.1.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.elasticsearch:elasticsearch:2.3.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-core:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-backward-codecs:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-analyzers-common:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-queries:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-memory:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-highlighter:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-queryparser:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-sandbox:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-suggest:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-misc:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-join:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-grouping:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-spatial:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.apache.lucene:lucene-spatial3d:5.5.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.spatial4j:spatial4j:0.5" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.vividsolutions:jts:1.13" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.github.spullara.mustache.java:compiler:0.8.13" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.google.guava:guava:18.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.carrotsearch:hppc:0.7.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: joda-time:joda-time:2.9.4" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.joda:joda-convert:1.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.core:jackson-core:2.6.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.6.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.6.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.yaml:snakeyaml:1.15" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: io.netty:netty:3.10.5.Final" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.ning:compress-lzf:1.0.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.tdunning:t-digest:3.0" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: commons-cli:commons-cli:1.3.1" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: log4j:apache-log4j-extras:1.2.17" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: org.slf4j:slf4j-api:1.6.2" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: net.java.dev.jna:jna:4.1.0" level="project" />
</component>
</module>
29 changes: 0 additions & 29 deletions assembly/release.xml

This file was deleted.

171 changes: 58 additions & 113 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,114 +1,59 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>net.nineapps.elasticsearch.plugin.cloudwatch</groupId>
<artifactId>CloudwatchPlugin</artifactId>
<packaging>jar</packaging>
<version>1.1</version>
<name>CloudwatchPlugin</name>
<url>http://maven.apache.org</url>
<build>
<plugins>
<!-- Add/Edit items in META-INF/MANIFEST.MF -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3</version>
<configuration>
<finalName>elasticsearch-${project.name}-${elasticsearch.version}</finalName>
</configuration>
</plugin>
<!-- Copy dependencies into lib folder -->
<!-- To see full classpath use mvn dependency:build-classpath -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.2</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/lib</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<!-- Skip Surefire tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.8</version>
<configuration>
<skipTests>true</skipTests>
<additionalClasspathElements>
<additionalClasspathElement>${project.build.directory}/classes/conf</additionalClasspathElement>
<additionalClasspathElement>${project.build.directory}/lib</additionalClasspathElement>
</additionalClasspathElements>
</configuration>
</plugin>
<!-- Generate the release zip file (run during package step) -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2.1</version>
<configuration>
<finalName>elasticsearch-${project.name}-${elasticsearch.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}/release/</outputDirectory>
<descriptors>
<descriptor>assembly/release.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<id>generate-release-plugin</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
<includes>
<include>**/*.properties</include>
</includes>
</resource>
</resources>
</build>
<properties>
<elasticsearch.version>1.6.0</elasticsearch.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
</dependency>
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk</artifactId>
<version>1.10.2</version>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype</id>
<name>Sonatype Groups</name>
<url>https://oss.sonatype.org/content/groups/public/</url>
</repository>
</repositories>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>2.3.5</version>
<parent>
<groupId>org.elasticsearch.plugin</groupId>
<artifactId>plugins</artifactId>
<version>2.3.5</version>
</parent>
<artifactId>cloudwatch</artifactId>
<name>Cloudwatch Metrics Sender</name>
<description>Sends elasticsearch metrics to AWS CloudWatch</description>
<properties>
<license.skip>true</license.skip>
<elasticsearch.plugin.classname>com.elasticsearch.plugin.cloudwatch.CloudwatchPlugin</elasticsearch.plugin.classname>
<elasticsearch.version>2.3.5</elasticsearch.version>
<elasticsearch.plugin.isolated>true</elasticsearch.plugin.isolated>
<tests.rest.suite>cloudwatch</tests.rest.suite>
<tests.rest.load_packaged>false</tests.rest.load_packaged>
<skip.unit.tests>true</skip.unit.tests>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
<amazonaws.version>1.10.69</amazonaws.version>
<httpcomponents.httpclient.version>4.5.2</httpcomponents.httpclient.version>
</properties>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-cloudwatch</artifactId>
<version>${amazonaws.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-core</artifactId>
<version>${amazonaws.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpcomponents.httpclient.version}</version>
</dependency>


</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<!-- This plugin bundles a config so it can't use the standard assembly for plugins. -->
<configuration>
<descriptors>
<descriptor>src/main/assemblies/plugin.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
</project>
37 changes: 37 additions & 0 deletions src/main/assemblies/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<assembly>
<id>plugin</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<files>
<file>
<source>${elasticsearch.tools.directory}/plugin-metadata/plugin-descriptor.properties</source>
<outputDirectory></outputDirectory>
<filtered>true</filtered>
</file>
<file>
<source>${project.basedir}/src/main/plugin-metadata/plugin-security.policy</source>
<outputDirectory>/</outputDirectory>
</file>
</files>
<fileSets>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
</fileSet>
<fileSet>
<directory>src/main/bin</directory>
<outputDirectory>bin</outputDirectory>
</fileSet>
</fileSets>
<dependencySets>
<dependencySet>
<outputDirectory>/</outputDirectory>
<useProjectArtifact>true</useProjectArtifact>
<useTransitiveFiltering>true</useTransitiveFiltering>
<useTransitiveDependencies>true</useTransitiveDependencies>
</dependencySet>
</dependencySets>
</assembly>
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
package net.nineapps.elasticsearch.plugin.cloudwatch;

import static org.elasticsearch.common.collect.Lists.newArrayList;

import java.util.Collection;
package com.elasticsearch.plugin.cloudwatch;

import org.elasticsearch.common.component.LifecycleComponent;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.plugins.AbstractPlugin;
import org.elasticsearch.plugins.Plugin;

import java.util.ArrayList;
import java.util.Collection;

public class CloudwatchPlugin extends AbstractPlugin {
public class CloudwatchPlugin extends Plugin {

private final Settings settings;

Expand All @@ -18,17 +17,19 @@ public CloudwatchPlugin(Settings settings) {

public String name() {
return "cloudwatch-plugin";
}
}

public String description() {
public String description() {
return "Plugin which stores cluster state stats in Cloudwatch";
}

}


@Override
public Collection<Class<? extends LifecycleComponent>> services() {
Collection<Class<? extends LifecycleComponent>> services = newArrayList();
public Collection<Class<? extends LifecycleComponent>> nodeServices() {
Collection<Class<? extends LifecycleComponent>> services = new ArrayList<Class<? extends LifecycleComponent>>();
if (settings.getAsBoolean("metrics.cloudwatch.enabled", true)) {
services.add(CloudwatchPluginService.class);
}
return services;
}}
}
}
Loading