Commit 18760615 authored by Alok Joshi's avatar Alok Joshi
Browse files

fix list api cache not updating upon creation and deletion

parent 70835dc1
Pipeline #20985 failed with stage
in 40 seconds
......@@ -50,6 +50,7 @@ public class CachedPartitionServiceImpl implements IPartitionService {
if (pi != null) {
partitionServiceCache.put(partitionId, partitionInfo);
partitionListCache.clearAll();
}
return pi;
......@@ -86,6 +87,7 @@ public class CachedPartitionServiceImpl implements IPartitionService {
if (partitionService.deletePartition(partitionId)) {
if (partitionServiceCache.get(partitionId) != null) {
partitionServiceCache.delete(partitionId);
partitionListCache.clearAll();
}
return true;
......
......@@ -57,6 +57,7 @@ public class CachedPartitionServiceImplTest {
verify(partitionServiceImpl, times(1)).createPartition(partId, newPi);
verify(partitionServiceCache, times(1)).put(partId, retPi);
verify(partitionListCache, times(1)).clearAll();
}
@Test
......@@ -71,6 +72,7 @@ public class CachedPartitionServiceImplTest {
verify(partitionServiceImpl, times(1)).createPartition(partId, newPi);
verify(partitionServiceCache, times(0)).put(any(), any());
verify(partitionListCache, times(0)).clearAll();
verify(partitionServiceCache, times(1)).get(any());
}
......@@ -131,6 +133,7 @@ public class CachedPartitionServiceImplTest {
verify(partitionServiceImpl, times(1)).deletePartition(partId);
verify(partitionServiceCache, times(1)).delete(partId);
verify(partitionServiceCache, times(1)).get(partId);
verify(partitionListCache, times(1)).clearAll();
}
@Test
......
Supports Markdown
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