mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-18 14:58:47 +00:00
#589 - ElasticSearch - DocStoreMode renamed from DocStoreEvent
This commit is contained in:
1 parent
32bcd5e853
commit
a0609b1726
15 files changed
+75
-108
No files matched your search
@@ -9,7 +9,7 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.avaje.ebean.annotation.DocStoreEvent;
|
||||
import com.avaje.ebean.annotation.DocStoreMode;
|
||||
import com.avaje.ebeanservice.docstore.api.support.DocStoreDeleteEvent;
|
||||
import com.avaje.ebeanservice.docstore.api.DocStoreUpdates;
|
||||
|
||||
@@ -79,13 +79,13 @@ public final class DeleteByIdMap {
|
||||
/**
|
||||
* Add the deletes to the DocStoreUpdates.
|
||||
*/
|
||||
public void addDocStoreUpdates(DocStoreUpdates docStoreUpdates, DocStoreEvent txnIndexMode) {
|
||||
public void addDocStoreUpdates(DocStoreUpdates docStoreUpdates, DocStoreMode txnIndexMode) {
|
||||
for (BeanPersistIds deleteIds : beanMap.values()) {
|
||||
BeanDescriptor<?> desc = deleteIds.getBeanDescriptor();
|
||||
DocStoreEvent docStoreEvent = desc.getDocStoreEvent(PersistRequest.Type.DELETE, txnIndexMode);
|
||||
if (DocStoreEvent.IGNORE != docStoreEvent) {
|
||||
DocStoreMode mode = desc.getDocStoreMode(PersistRequest.Type.DELETE, txnIndexMode);
|
||||
if (DocStoreMode.IGNORE != mode) {
|
||||
// Add to queue or bulk update entries
|
||||
boolean queue = (DocStoreEvent.QUEUE == docStoreEvent);
|
||||
boolean queue = (DocStoreMode.QUEUE == mode);
|
||||
String queueId = desc.getDocStoreQueueId();
|
||||
List<Serializable> idValues = deleteIds.getDeleteIds();
|
||||
if (idValues != null) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.avaje.ebeaninternal.server.transaction;
|
||||
|
||||
import com.avaje.ebean.TransactionCallback;
|
||||
import com.avaje.ebean.annotation.DocStoreEvent;
|
||||
import com.avaje.ebean.annotation.DocStoreMode;
|
||||
import com.avaje.ebean.bean.PersistenceContext;
|
||||
import com.avaje.ebean.config.PersistBatch;
|
||||
import com.avaje.ebean.config.dbplatform.DatabasePlatform.OnQueryOnly;
|
||||
@@ -147,7 +147,7 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
* The mode for updating doc store indexes for this transaction.
|
||||
* Only set when you want to override the default behavior.
|
||||
*/
|
||||
protected DocStoreEvent docStoreUpdateMode;
|
||||
protected DocStoreMode docStoreUpdateMode;
|
||||
|
||||
protected int docStoreBulkBatchSize;
|
||||
|
||||
@@ -291,12 +291,12 @@ public class JdbcTransaction implements SpiTransaction {
|
||||
this.docStoreBulkBatchSize = docStoreBulkBatchSize;
|
||||
}
|
||||
|
||||
public DocStoreEvent getDocStoreUpdateMode() {
|
||||
public DocStoreMode getDocStoreUpdateMode() {
|
||||
return docStoreUpdateMode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDocStoreUpdateMode(DocStoreEvent docStoreUpdateMode) {
|
||||
public void setDocStoreUpdateMode(DocStoreMode docStoreUpdateMode) {
|
||||
this.docStoreUpdateMode = docStoreUpdateMode;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.avaje.ebeaninternal.server.transaction;
|
||||
|
||||
import com.avaje.ebean.annotation.DocStoreEvent;
|
||||
import com.avaje.ebean.annotation.DocStoreMode;
|
||||
import com.avaje.ebeaninternal.api.SpiTransaction;
|
||||
import com.avaje.ebeaninternal.api.TransactionEvent;
|
||||
import com.avaje.ebeaninternal.api.TransactionEventTable;
|
||||
@@ -40,7 +40,7 @@ public final class PostCommitProcessing {
|
||||
|
||||
private final DeleteByIdMap deleteByIdMap;
|
||||
|
||||
private final DocStoreEvent txnDocStoreMode;
|
||||
private final DocStoreMode txnDocStoreMode;
|
||||
|
||||
private final int txnDocStoreBatchSize;
|
||||
|
||||
@@ -52,7 +52,7 @@ public final class PostCommitProcessing {
|
||||
this.clusterManager = clusterManager;
|
||||
this.manager = manager;
|
||||
this.serverName = manager.getServerName();
|
||||
this.txnDocStoreMode = DocStoreEvent.IGNORE;
|
||||
this.txnDocStoreMode = DocStoreMode.IGNORE;
|
||||
this.txnDocStoreBatchSize = 0;
|
||||
this.event = event;
|
||||
this.deleteByIdMap = event.getDeleteByIdMap();
|
||||
@@ -126,7 +126,7 @@ public final class PostCommitProcessing {
|
||||
* Return true if updates to the document store occur for this transaction.
|
||||
*/
|
||||
private boolean isDocStoreUpdate() {
|
||||
return manager.isDocStoreActive() && (txnDocStoreMode == null || txnDocStoreMode != DocStoreEvent.IGNORE);
|
||||
return manager.isDocStoreActive() && (txnDocStoreMode == null || txnDocStoreMode != DocStoreMode.IGNORE);
|
||||
}
|
||||
|
||||
public void notifyCluster() {
|
||||
|
||||
Reference in new issue
Block a user