This repository has been archived by the owner on Apr 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Use worker cleanup task instead of direct jedis cleanup #89
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
70332de
Use worker task instead of jedis cleanup
rajatparida86 395fd41
Use appropriate UUID, Constructor injection, Formatting
rajatparida86 694d3e1
Separate interface method for batch entity cleanup
rajatparida86 cd656a9
Batch entity cleanup
rajatparida86 3ef0d03
Add timelimit to redis payload
rajatparida86 9341fb7
Only cleanup if there is something to cleanup
rajatparida86 de70fb8
Use TR as the prefix of task ID
rajatparida86 d0fd7e0
Review comments
rajatparida86 4228868
Only execute batch cleanup in remote schedulers
rajatparida86 886ba7b
Log entity counts
rajatparida86 6f5c0a7
Differentiate between Global and Local scheduler
rajatparida86 ea90f38
unit tests for cleanup and global scheduler
rajatparida86 8537001
Fix test method name to camel case
rajatparida86 5802283
Fix camel case for missed method
rajatparida86 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
|
||
import com.fasterxml.jackson.core.type.TypeReference; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import de.zalando.zmon.scheduler.ng.scheduler.Scheduler; | ||
import io.opentracing.Tracer; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
@@ -24,6 +25,9 @@ | |
@Component | ||
public class EntityRepository extends CachedRepository<String, EntityAdapterRegistry, Entity> { | ||
|
||
@Autowired | ||
Scheduler scheduler; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Best practice is to use constructor injection over field or setter injection (e.g. https://www.vojtechruzicka.com/field-dependency-injection-considered-harmful/) |
||
|
||
private static final Logger LOG = LoggerFactory.getLogger(EntityRepository.class); | ||
|
||
private List<Map<String, String>> baseFilter = null; | ||
|
@@ -192,6 +196,8 @@ public synchronized void fill() { | |
} | ||
} | ||
|
||
scheduler.scheduleEntityCleanUp(removedIds); | ||
|
||
for (String k : changedFilterProperties) { | ||
for (EntityChangeListener l : currentListeners) { | ||
l.notifyEntityChange(this, oldUnfiltered.get(k), unfilteredEntities.get(k)); | ||
|
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that we don't have a linter for java projects yet, but what do you think if we'll try to follow some basic formatting rules, common for most languages? Like spaces before and after
=
and+
for example.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed