Addressing comments and fixing the failing test.
This commit is contained in:
parent
48699f4812
commit
7d24bc54f8
2 changed files with 4 additions and 4 deletions
|
|
@ -137,7 +137,7 @@ public class PrefetchGetRecordsCache implements GetRecordsCache {
|
|||
return result.getRecords().stream().mapToLong(record -> record.getData().array().length).sum();
|
||||
}
|
||||
|
||||
public boolean shouldGetNewRecords() {
|
||||
public synchronized boolean shouldGetNewRecords() {
|
||||
return size < maxRecordsCount && byteSize < maxByteSize;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,11 +51,11 @@ public class BlockingGetRecordsCacheTest {
|
|||
|
||||
@Before
|
||||
public void setup() {
|
||||
when(getRecordsRetrievalStrategy.getRecords(eq(MAX_RECORDS_PER_COUNT))).thenReturn(getRecordsResult);
|
||||
when(getRecordsResult.getRecords()).thenReturn(records);
|
||||
|
||||
records = new ArrayList<>();
|
||||
blockingGetRecordsCache = new BlockingGetRecordsCache(MAX_RECORDS_PER_COUNT, getRecordsRetrievalStrategy);
|
||||
|
||||
when(getRecordsRetrievalStrategy.getRecords(eq(MAX_RECORDS_PER_COUNT))).thenReturn(getRecordsResult);
|
||||
when(getRecordsResult.getRecords()).thenReturn(records);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in a new issue