Skip to content

Commit

Permalink
Initial commit: import code from elastic/elasticsearch#2231
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Favre committed Feb 12, 2013
0 parents commit 600b20e
Show file tree
Hide file tree
Showing 23 changed files with 3,125 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/data
/work
/logs
/.idea
/target
.DS_Store
*.iml
/.project
/.settings
/.classpath
.*.swp
221 changes: 221 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
<?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>

<name>elasticsearch-action-updatebyquery</name>
<description>
The Update By Query feature, as an action plugin for ElasticSearch.
</description>
<inceptionYear>2013</inceptionYear>

<groupId>com.yakaz.elasticsearch.plugins</groupId>
<artifactId>elasticsearch-action-updatebyquery</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>jar</packaging>

<url>http://github.com/yakaz/elasticsearch-action-updatebyquery</url>
<scm>
<connection>scm:git:git@github.com:yakaz/elasticsearch-action-updatebyquery.git</connection>
<developerConnection>scm:git:git@github.com:yakaz/elasticsearch-action-updatebyquery.git</developerConnection>
<url>https://github.com/yakaz/elasticsearch-action-updatebyquery.git</url>
<tag>HEAD</tag>
</scm>

<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>

<developers>
<developer>
<id>ofavre</id>
<name>Olivier Favre</name>
<email>http://www.google.com/recaptcha/mailhide/d?k=01BFRL3yhSOUyxYhgio4AZrQ==&amp;c=MG8swJyru2wFd6B6QWz--HIx_5O38r35CjjdTzn025Q=</email>
<timezone>+1</timezone>
</developer>
</developers>

<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>

<properties>
<elasticsearch.version>0.20.0</elasticsearch.version>
<lucene.version>3.6.1</lucene.version>
</properties>

<dependencies>
<!--dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
<version>${lucene.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8</version>
<scope>test</scope>
</dependency-->
<dependency>
<groupId>org.elasticsearch</groupId>
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.9</version>
<configuration>
<nohelp>true</nohelp>
</configuration>
<executions>
<execution>
<id>attach-javadoc</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.3</version>
<configuration>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.build.directory}/releases/</outputDirectory>
<descriptors>
<descriptor>${basedir}/src/main/assemblies/plugin.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.4</version>
<configuration>
<tagNameFormat>v@{project.version}</tagNameFormat>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.11</version>
<executions>
<execution>
<!-- This is unexpectedly necessary to run both TestNG and JUnit tests... -->
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<testNGArtifactName>none:none</testNGArtifactName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.5.1</version>
</plugin>
</plugins>
</reporting>

<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
/*
* Licensed to ElasticSearch and Shay Banon under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. ElasticSearch licenses this
* file to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.elasticsearch.action.updatebyquery;

import org.elasticsearch.ElasticSearchIllegalArgumentException;

/**
* Specifies how bulk responses that have been created based on the documents that have matched with the update query
* are returned in the response.
*/
public enum BulkResponseOption {

/**
* Bulk responses aren't included in the response.
*/
NONE((byte) 0),

/**
* Only failed bulk responses are included in the response.
*/
FAILED((byte) 1),

/**
* All bulk responses are included in the response.
*/
ALL((byte) 2);

private byte id;

private BulkResponseOption(byte id) {
this.id = id;
}

/**
* The internal representation of the operation type.
*/
public byte id() {
return id;
}

/**
* Constructs the bulk response option from its internal representation.
*/
public static BulkResponseOption fromId(byte id) {
if (id == 0) {
return NONE;
} else if (id == 1) {
return FAILED;
} else if (id == 2) {
return ALL;
} else {
throw new ElasticSearchIllegalArgumentException("No type match for [" + id + "]");
}
}

/**
* Parse the bulk response option from string.
*/
public static BulkResponseOption fromString(String type) {
if ("none".equals(type)) {
return NONE;
} else if ("failed".equals(type)) {
return FAILED;
} else if ("all".equals(type)) {
return ALL;
}
throw new ElasticSearchIllegalArgumentException("no response type match for [" + type + "], should be either `none`, `failed` or `all`");
}

}

0 comments on commit 600b20e

Please sign in to comment.