package org.sonar.server.log.index;
import com.google.common.collect.ImmutableList;
+import org.elasticsearch.action.support.replication.ReplicationType;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.api.utils.KeyValueFormat;
import org.sonar.core.log.db.LogDto;
/* Creating updateRequest */
return ImmutableList.of(new UpdateRequest()
//Need to make a UUID because Key does not insure unicity
+ .replicationType(ReplicationType.ASYNC)
.doc(logDoc)
.upsert(logDoc));
}
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
+import org.elasticsearch.action.support.replication.ReplicationType;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.core.persistence.DbSession;
import org.sonar.core.qualityprofile.db.ActiveRuleDto;
/* Creating updateRequest */
return ImmutableList.of(new UpdateRequest()
+ .replicationType(ReplicationType.ASYNC)
.routing(key.ruleKey().toString())
.id(activeRuleDto.getKey().toString())
.parent(activeRuleDto.getKey().ruleKey().toString())
newParam.put(ActiveRuleParamField.VALUE.field(), param.getValue());
return ImmutableList.of(new UpdateRequest()
+ .replicationType(ReplicationType.ASYNC)
.routing(key.ruleKey().toString())
.id(key.toString())
.script(ListUpdate.NAME)
private List<UpdateRequest> nestedDelete(ActiveRuleParamDto param, ActiveRuleKey key) {
return ImmutableList.of(new UpdateRequest()
+ .replicationType(ReplicationType.ASYNC)
.routing(key.ruleKey().toString())
.id(key.toString())
.script(ListUpdate.NAME)
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Sets;
+import org.elasticsearch.action.WriteConsistencyLevel;
+import org.elasticsearch.action.support.replication.ReplicationType;
import org.elasticsearch.action.update.UpdateRequest;
import org.sonar.api.rule.RuleKey;
import org.sonar.core.persistence.DbSession;
/** Creating updateRequest */
return ImmutableList.of(new UpdateRequest()
+ .replicationType(ReplicationType.ASYNC)
+ .consistencyLevel(WriteConsistencyLevel.QUORUM)
.id(rule.getKey().toString())
.doc(update)
.upsert(upsert));
private final IndexClient indexes;
public IndexQueueWorker(IndexQueue queue, IndexClient indexes) {
- super(1, 1, 500l, TimeUnit.MILLISECONDS, queue);
+ super(1,1, 0L, TimeUnit.MILLISECONDS, queue);
this.indexes = indexes;
}