-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#18 - Refactor: Support Ebean 9.3.1 with ElasticSearch only support (…
…comes with move to Java8)
- Loading branch information
Showing
21 changed files
with
256 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,23 +4,19 @@ | |
|
||
<groupId>org.avaje.ebean</groupId> | ||
<artifactId>ebean-elastic</artifactId> | ||
<version>1.4.2-SNAPSHOT</version> | ||
<version>1.5.1-SNAPSHOT</version> | ||
|
||
<parent> | ||
<groupId>org.avaje</groupId> | ||
<artifactId>oss-parent</artifactId> | ||
<version>1.1</version> | ||
<artifactId>java8-parent</artifactId> | ||
<version>1.2</version> | ||
</parent> | ||
|
||
<scm> | ||
<developerConnection>scm:git:[email protected]:ebean-orm/ebean-elastic.git</developerConnection> | ||
<tag>HEAD</tag> | ||
</scm> | ||
|
||
<properties> | ||
<java.version>1.6</java.version> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<dependency> | ||
|
@@ -32,15 +28,15 @@ | |
|
||
<!-- Http to ElasticSearch --> | ||
<dependency> | ||
<groupId>com.squareup.okhttp</groupId> | ||
<groupId>com.squareup.okhttp3</groupId> | ||
<artifactId>okhttp</artifactId> | ||
<version>2.4.0</version> | ||
<version>3.4.2</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.avaje.ebean</groupId> | ||
<artifactId>ebean</artifactId> | ||
<version>9.2.1</version> | ||
<version>9.3.1-SNAPSHOT</version> | ||
</dependency> | ||
|
||
<!-- Test Dependencies --> | ||
|
@@ -85,10 +81,7 @@ | |
<extensions>true</extensions> | ||
<configuration> | ||
<tiles> | ||
<tile>org.avaje.tile:java-compile:1.1</tile> | ||
<tile>org.avaje.tile:dependency-tree:1.1</tile> | ||
<tile>org.avaje.tile:pygments-doclet:1.1</tile> | ||
<tile>org.avaje.ebean.tile:enhancement:1.1</tile> | ||
<tile>org.avaje.ebean.tile:enhancement:1.2</tile> | ||
</tiles> | ||
</configuration> | ||
</plugin> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/main/java/com/avaje/ebeanservice/elastic/bulk/BulkTransaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.avaje.ebeanservice.elastic.bulk; | ||
|
||
import com.avaje.ebeanservice.docstore.api.DocStoreTransaction; | ||
import com.avaje.ebeanservice.docstore.api.DocStoreUpdateContext; | ||
import com.avaje.ebeanservice.docstore.api.DocStoreUpdates; | ||
|
||
public class BulkTransaction implements DocStoreTransaction { | ||
|
||
private final BulkUpdate bulkUpdate; | ||
|
||
private DocStoreUpdates queueUpdates; | ||
|
||
public BulkTransaction(BulkUpdate bulkUpdate) { | ||
this.bulkUpdate = bulkUpdate; | ||
} | ||
|
||
@Override | ||
public DocStoreUpdateContext obtain() { | ||
return bulkUpdate.obtain(); | ||
} | ||
|
||
@Override | ||
public DocStoreUpdates queue() { | ||
if (queueUpdates == null) { | ||
queueUpdates = new DocStoreUpdates(); | ||
} | ||
return queueUpdates; | ||
} | ||
|
||
@Override | ||
public void flush() { | ||
bulkUpdate.flush(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.