@Test public void testUpdateSlotsOnReadWithIncomingActiveStateButInMemoryDirtyData() { establishCurrentState(); final long lastRollupTime = slotStateManager.getSlotStamps().get(TEST_SLOT).getLastRollupTimestamp(); final long existingLastCollectionTime = slotStateManager.getSlotStamps().get(TEST_SLOT).getTimestamp(); final long existingLastIngestTime = slotStateManager.getSlotStamps().get(TEST_SLOT).getLastIngestTimestamp(); slotStateManager.getSlotStamps().get(TEST_SLOT).setDirty(true); long lastCollectionTime = existingLastCollectionTime + 60 * 1000; long lastUpdatedTime = System.currentTimeMillis(); SlotState newUpdateForActiveSlot = createSlotState(Granularity.MIN_5, UpdateStamp.State.Active, lastCollectionTime, lastUpdatedTime); slotStateManager.updateSlotOnRead(newUpdateForActiveSlot); Map<Integer, UpdateStamp> slotStamps = slotStateManager.getSlotStamps(); UpdateStamp updateStamp = slotStamps.get(TEST_SLOT); assertEquals("Unexpected state", UpdateStamp.State.Active, updateStamp.getState()); assertEquals("Last collection timestamp is incorrect", existingLastCollectionTime, updateStamp.getTimestamp()); assertEquals("Last rollup timestamp is incorrect", lastRollupTime, updateStamp.getLastRollupTimestamp()); assertEquals("Dirty flag is incorrect", true, updateStamp.isDirty()); assertEquals("Last ingest timestamp is incorrect", existingLastIngestTime, updateStamp.getLastIngestTimestamp()); }
public void updateSlotOnRead(int shard, SlotState slotState) { getSlotStateManager(shard, slotState.getGranularity()).updateSlotOnRead(slotState); }
ShardStateManager { public void updateSlotOnRead(int shard, SlotState slotState) { getSlotStateManager(shard, slotState.getGranularity()).updateSlotOnRead(slotState); } }
ShardStateManager { public void updateSlotOnRead(int shard, SlotState slotState) { getSlotStateManager(shard, slotState.getGranularity()).updateSlotOnRead(slotState); } protected  ShardStateManager(Collection<Integer> shards, Ticker ticker); protected  ShardStateManager(Collection<Integer> shards, Ticker ticker, Clock clock); }
ShardStateManager { public void updateSlotOnRead(int shard, SlotState slotState) { getSlotStateManager(shard, slotState.getGranularity()).updateSlotOnRead(slotState); } protected  ShardStateManager(Collection<Integer> shards, Ticker ticker); protected  ShardStateManager(Collection<Integer> shards, Ticker ticker, Clock clock); SlotStateManager getSlotStateManager(int shard, Granularity granularity); void updateSlotOnRead(int shard, SlotState slotState); void setAllCoarserSlotsDirtyForSlot(SlotKey slotKey); }
ShardStateManager { public void updateSlotOnRead(int shard, SlotState slotState) { getSlotStateManager(shard, slotState.getGranularity()).updateSlotOnRead(slotState); } protected  ShardStateManager(Collection<Integer> shards, Ticker ticker); protected  ShardStateManager(Collection<Integer> shards, Ticker ticker, Clock clock); SlotStateManager getSlotStateManager(int shard, Granularity granularity); void updateSlotOnRead(int shard, SlotState slotState); void setAllCoarserSlotsDirtyForSlot(SlotKey slotKey); static final long REROLL_TIME_SPAN_ASSUMED_VALUE; }