-
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.
Merge pull request #239 from netgrif/dev
Release 6.3.3
- Loading branch information
Showing
23 changed files
with
616 additions
and
108 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
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
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
29 changes: 29 additions & 0 deletions
29
...n/java/com/netgrif/application/engine/configuration/ElasticTaskExecutorConfiguration.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,29 @@ | ||
package com.netgrif.application.engine.configuration; | ||
|
||
import com.netgrif.application.engine.configuration.properties.ElasticTaskExecutorProperties; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; | ||
|
||
@Configuration | ||
public class ElasticTaskExecutorConfiguration { | ||
|
||
protected final ElasticTaskExecutorProperties elasticTaskExecutorProperties; | ||
|
||
public ElasticTaskExecutorConfiguration(ElasticTaskExecutorProperties elasticTaskExecutorProperties) { | ||
this.elasticTaskExecutorProperties = elasticTaskExecutorProperties; | ||
} | ||
|
||
@Bean("elasticTaskExecutor") | ||
public ThreadPoolTaskExecutor taskExecutor() { | ||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); | ||
executor.setCorePoolSize(elasticTaskExecutorProperties.getSize()); | ||
executor.setMaxPoolSize(elasticTaskExecutorProperties.getMaxPoolSize()); | ||
executor.setAllowCoreThreadTimeOut(elasticTaskExecutorProperties.isAllowCoreThreadTimeOut()); | ||
executor.setKeepAliveSeconds(elasticTaskExecutorProperties.getKeepAliveSeconds()); | ||
executor.setThreadNamePrefix(elasticTaskExecutorProperties.getThreadNamePrefix()); | ||
executor.initialize(); | ||
return executor; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...om/netgrif/application/engine/configuration/properties/ElasticTaskExecutorProperties.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,17 @@ | ||
package com.netgrif.application.engine.configuration.properties; | ||
|
||
import lombok.Data; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Data | ||
@Configuration | ||
@ConfigurationProperties(prefix = "spring.data.elasticsearch.task.executors") | ||
public class ElasticTaskExecutorProperties { | ||
|
||
private int size = 50; | ||
private int maxPoolSize = size*10; | ||
private boolean allowCoreThreadTimeOut = true; | ||
private int keepAliveSeconds = 30; | ||
private String threadNamePrefix = "ElasticTaskExecutor-"; | ||
} |
6 changes: 6 additions & 0 deletions
6
src/main/java/com/netgrif/application/engine/elastic/domain/ElasticJob.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,6 @@ | ||
package com.netgrif.application.engine.elastic.domain; | ||
|
||
public enum ElasticJob { | ||
INDEX, | ||
REMOVE, | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/com/netgrif/application/engine/elastic/domain/ElasticTaskJob.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,23 @@ | ||
package com.netgrif.application.engine.elastic.domain; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ElasticTaskJob { | ||
|
||
private ElasticJob jobType; | ||
|
||
private ElasticTask task; | ||
|
||
public String getTaskId() { | ||
return getTask().getTaskId(); | ||
} | ||
} | ||
|
||
|
||
|
||
|
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.