Commit 2d947098 authored by Daniel Gerhardt's avatar Daniel Gerhardt

Rename caches

* skillquestions -> contentlists
* lecturequestions -> lecturecontentlists
* preparationquestions -> preparationcontentlists
* flashcardquestions -> flashcardcontentlists
* questions -> contents
* answers -> answerlists
* learningprogress -> score
parent a78eb7fe
......@@ -51,7 +51,7 @@ public class CacheBusterImpl implements CacheBuster, ArsnovaEventVisitor {
@Override
public void visit(LockQuestionsEvent lockQuestionsEvent) { }
@CacheEvict(value = "answers", key = "#event.content.id")
@CacheEvict(value = "answerlists", key = "#event.content.id")
@Override
public void visit(NewAnswerEvent event) { }
......
......@@ -38,31 +38,31 @@ public class ScheduledCacheBuster {
@Scheduled(initialDelay = 1000 * 25, fixedRate = 1000 * 60 * 60 * 6)
private void clearSessionCache() { }
@CacheEvict(value = "questions", allEntries = true)
@CacheEvict(value = "contents", allEntries = true)
@Scheduled(initialDelay = 1000 * 50, fixedRate = 1000 * 60 * 30)
private void clearQuestionCache() { }
@CacheEvict(value = "skillquestions", allEntries = true)
@CacheEvict(value = "contentlists", allEntries = true)
@Scheduled(initialDelay = 1000 * 75, fixedRate = 1000 * 60 * 30)
private void clearSkillQuestionCache() { }
@CacheEvict(value = "lecturequestions", allEntries = true)
@CacheEvict(value = "lecturecontentlists", allEntries = true)
@Scheduled(initialDelay = 1000 * 100, fixedRate = 1000 * 60 * 30)
private void clearLectureQuestionCache() { }
@CacheEvict(value = "preparationquestions", allEntries = true)
@CacheEvict(value = "preparationcontentlists", allEntries = true)
@Scheduled(initialDelay = 1000 * 125, fixedRate = 1000 * 60 * 30)
private void clearPreparationQuestionCache() { }
@CacheEvict(value = "flashcardquestions", allEntries = true)
@CacheEvict(value = "flashcardcontentlists", allEntries = true)
@Scheduled(initialDelay = 1000 * 150, fixedRate = 1000 * 60 * 30)
private void clearFlashcardQuestionCache() { }
@CacheEvict(value = "answers", allEntries = true)
@CacheEvict(value = "answerlists", allEntries = true)
@Scheduled(initialDelay = 1000 * 175, fixedRate = 1000 * 60 * 15)
private void clearAnswerCache() { }
@CacheEvict(value = "learningprogress", allEntries = true)
@CacheEvict(value = "score", allEntries = true)
@Scheduled(initialDelay = 1000 * 200, fixedRate = 1000 * 60 * 15)
private void clearLearningProgressCache() { }
......
......@@ -56,79 +56,79 @@ public class ScoreCalculatorFactoryImpl implements ArsnovaEventVisitor, ScoreCal
@Override
public void visit(DeleteCommentEvent deleteCommentEvent) { }
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(NewQuestionEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(UnlockQuestionEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(UnlockQuestionsEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(LockQuestionEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(LockQuestionsEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(NewAnswerEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteAnswerEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteQuestionEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteAllQuestionsEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteAllQuestionsAnswersEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteAllPreparationAnswersEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(DeleteAllLectureAnswersEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
}
@CacheEvict(value = "learningprogress", key = "#event.Session")
@CacheEvict(value = "score", key = "#event.Session")
@Override
public void visit(PiRoundResetEvent event) {
this.publisher.publishEvent(new ChangeScoreEvent(this, event.getSession()));
......
......@@ -38,7 +38,7 @@ abstract class VariantScoreCalculator implements ScoreCalculator {
this.sessionStatisticsRepository = sessionStatisticsRepository;
}
@Cacheable("learningprogress")
@Cacheable("score")
private Score loadProgress(final Session session) {
return sessionStatisticsRepository.getLearningProgress(session);
}
......
......@@ -19,7 +19,7 @@ Caching should only be used with domain objects, where the `hashCode` and `equal
public ResultObject notVeryCacheable(String sessionId, String questionVariant, String subject) { ... }
```
Therefore, you should always work with domain objects like `Session`, `Question`, or even your own, newly defined objects:
Therefore, you should always work with domain objects like `Session`, `Content`, or even your own, newly defined objects:
```java
@Cacheable("verycacheable")
......@@ -46,14 +46,14 @@ Here is a list of all caches, their keys, and a short description.
Cache name | Key | Description
-----------|-----|------------
`skillquestions`| database id of session | Contains all questions for the specified session irrespective of their variant.
`lecturequestions` | database id of session | Contains all "lecture" variant questions for the specified session.
`preparationquestions` | database id of session | Contains all "preparation" variant questions for the specified session.
`flashcardquestions` | database id of session | Contains all "flashcard" variant questions for the specified session.
`questions` | `Question` entity | Contains single question objects.
`questions` | database id of question | Although it shares the name of the previously mentioned cache, it is in essence a different cache because the keys are different. This means that the same `Question` object might be associated with two different keys.
`answers`| database id of question | Contains single answer objects.
`learningprogress` | `Session` entity | Contains `CourseScore` objects to calculate the learning progress values for the specified session.
`contentlists`| database id of session | Contains all contents for the specified session irrespective of their variant.
`lecturecontentlists` | database id of session | Contains all "lecture" variant contents for the specified session.
`preparationcontentlists` | database id of session | Contains all "preparation" variant contents for the specified session.
`flashcardcontentlists` | database id of session | Contains all "flashcard" variant contents for the specified session.
`contents` | `Content` entity | Contains single content objects.
`contents` | database id of content | Although it shares the name of the previously mentioned cache, it is in essence a different cache because the keys are different. This means that the same `Content` object might be associated with two different keys.
`answerlists`| database id of content | Contains single answer objects.
`score` | `Session` entity | Contains `CourseScore` objects to calculate the score values for the specified session.
`sessions` | keyword of session | Contains sessions identified by their keywords.
`sessions` | database id of session | Although it shares the name of the previously mentioned cache, it is in essence a different cache because the keys are different. This means that the same `Session` object might be associated with two different keys.
`statistics` | -- | Contains a single, global statistics object.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment