public void storeDeviceThrottled(Device d){
  long intervalNs=syncStoreWriteIntervalMs * 1000L * 1000L;
  if (!isMaster)   return;
  if (d == null)   return;
  long now=System.nanoTime();
  Long last=lastWriteTimes.get(d.getDeviceKey());
  if (last == null || (now - last) > intervalNs) {
    writeUpdatedDeviceToStorage(d);
    lastWriteTimes.put(d.getDeviceKey(),now);
  }
 else {
    cntDeviceStoreThrottled.increment();
  }
}

public void storeDeviceThrottled ( Device d ) { long intervalNs = syncStoreWriteIntervalMs * 1000L * 1000L ; if ( ! isMaster ) return ; if ( d == null ) return ; long now = System . nanoTime ( ) ; Long last = lastWriteTimes . get ( d . getDeviceKey ( ) ) ; if ( last == null || ( now - last ) > intervalNs ) { writeUpdatedDeviceToStorage ( d ) ; lastWriteTimes . put ( d . getDeviceKey ( ) , now ) ; } else { cntDeviceStoreThrottled . increment ( ) ; } }
write the given device to storage if we are master and if the last write for the device was more than this . syncstoreintervalns time ago . use this method to updated last active times in the store .
