Пример #1
0
 /**
  * Here we check if that partition has any expirable record or not, if no expirable record
  * exists in that partition no need to fire an expiration operation.
  *
  * @param partitionContainer corresponding partition container.
  * @return <code>true</code> if no expirable record in that partition <code>false</code>
  *     otherwise.
  */
 private boolean notAnyExpirableRecord(PartitionContainer partitionContainer) {
   boolean notExist = true;
   final ConcurrentMap<String, RecordStore> maps = partitionContainer.getMaps();
   for (RecordStore store : maps.values()) {
     if (expirable(store)) {
       notExist = false;
       break;
     }
   }
   return notExist;
 }
Пример #2
0
 private boolean isContainerEmpty(PartitionContainer container) {
   long size = 0L;
   final ConcurrentMap<String, RecordStore> maps = container.getMaps();
   for (RecordStore store : maps.values()) {
     size += store.size();
     if (size > 0L) {
       return false;
     }
   }
   return true;
 }