@Test public void testReset() { Random rand = new Random(); int partitionId = rand.nextInt(Integer.MAX_VALUE); long transactionId = (long) rand.nextInt(Integer.MAX_VALUE); int header = rand.nextInt(); ReqId reqId = TestUtils.reqId(); FeedCacheBlock block = new FeedCacheBlock(); assertFalse(block.add(transactionId, reqId, header)); FeedCacheBlockKey key = FeedCacheBlockKey.get(partitionId, transactionId); block.reset(key); assertTrue(block.add(transactionId, reqId, header)); FeedData feedData = block.get(transactionId); FeedData expectedFeedData = new FeedData(reqId, transactionId, header); assertEquals(expectedFeedData, feedData); block.reset(key); assertNull(block.get(transactionId)); }
public void reset(FeedCacheBlockKey key) { this.firstTransactionId = key.firstTransactionId(); this.usage = 0L; }
FeedCacheBlock { public void reset(FeedCacheBlockKey key) { this.firstTransactionId = key.firstTransactionId(); this.usage = 0L; } }
FeedCacheBlock { public void reset(FeedCacheBlockKey key) { this.firstTransactionId = key.firstTransactionId(); this.usage = 0L; } FeedCacheBlock(); }
FeedCacheBlock { public void reset(FeedCacheBlockKey key) { this.firstTransactionId = key.firstTransactionId(); this.usage = 0L; } FeedCacheBlock(); void reset(FeedCacheBlockKey key); boolean add(long transactionId, ReqId reqId, int header); FeedData get(long transactionId); }
FeedCacheBlock { public void reset(FeedCacheBlockKey key) { this.firstTransactionId = key.firstTransactionId(); this.usage = 0L; } FeedCacheBlock(); void reset(FeedCacheBlockKey key); boolean add(long transactionId, ReqId reqId, int header); FeedData get(long transactionId);  }