Target poll DB performance improvements (#613)
* Async update on last target query. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * 10 seconds Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Completed batch and optimzed schema. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Cleanup and test. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * readibility. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Batch update. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Sonar issue fixed. Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
import org.eclipse.hawkbit.repository.event.remote.TargetPollEvent;
|
||||
import org.eclipse.hawkbit.repository.model.ActionStatus;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -34,6 +36,45 @@ public class RepositoryProperties {
|
||||
*/
|
||||
private boolean publishTargetPollEvent = true;
|
||||
|
||||
/**
|
||||
* Maximum number of poll operations queued before flush.
|
||||
*/
|
||||
private int pollPersistenceQueueSize = 10_000;
|
||||
|
||||
/**
|
||||
* Maximum time before queue is flushed in {@link TimeUnit#MILLISECONDS}.
|
||||
*/
|
||||
private long pollPersistenceFlushTime = TimeUnit.SECONDS.toMillis(10);
|
||||
|
||||
/**
|
||||
* Set to true to persist polls immediately.
|
||||
*/
|
||||
private boolean eagerPollPersistence;
|
||||
|
||||
public boolean isEagerPollPersistence() {
|
||||
return eagerPollPersistence;
|
||||
}
|
||||
|
||||
public void setEagerPollPersistence(final boolean eagerPollPersistence) {
|
||||
this.eagerPollPersistence = eagerPollPersistence;
|
||||
}
|
||||
|
||||
public long getPollPersistenceFlushTime() {
|
||||
return pollPersistenceFlushTime;
|
||||
}
|
||||
|
||||
public void setPollPersistenceFlushTime(final long pollPersistenceFlushTime) {
|
||||
this.pollPersistenceFlushTime = pollPersistenceFlushTime;
|
||||
}
|
||||
|
||||
public int getPollPersistenceQueueSize() {
|
||||
return pollPersistenceQueueSize;
|
||||
}
|
||||
|
||||
public void setPollPersistenceQueueSize(final int pollPersistenceQueueSize) {
|
||||
this.pollPersistenceQueueSize = pollPersistenceQueueSize;
|
||||
}
|
||||
|
||||
public boolean isRejectActionStatusForClosedAction() {
|
||||
return rejectActionStatusForClosedAction;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ public class TargetPollEvent extends RemoteTenantAwareEvent {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
public TargetPollEvent(final String controllerId, final String tenant, final String applicationId) {
|
||||
super(controllerId, tenant, applicationId);
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
|
||||
public TargetPollEvent(final Target target, final String applicationId) {
|
||||
super(target.getControllerId(), target.getTenant(), applicationId);
|
||||
this.controllerId = target.getControllerId();
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface ActionStatus extends TenantAwareBaseEntity {
|
||||
* @return time in {@link TimeUnit#MILLISECONDS} when the status was
|
||||
* reported.
|
||||
*/
|
||||
Long getOccurredAt();
|
||||
long getOccurredAt();
|
||||
|
||||
/**
|
||||
* @return {@link Action} this {@link ActionStatus} belongs to.
|
||||
|
||||
Reference in New Issue
Block a user