コード例 #1
0
 /**
  * Randomly select one of the SnapshotFilters (Key, Value or ValueType) Returns instance of
  * SnapshotFilter.
  */
 private static SnapshotFilter getSnapshotFilter() {
   int i = TestConfig.tab().getRandGen().nextInt(0, 2);
   SnapshotFilter filter = new KeySnapshotFilter();
   if (i == 2) {
     filter = new ValueSnapshotFilter();
   } else if (i == 3) {
     filter = new ValueTypeSnapshotFilter();
   }
   Log.getLogWriter()
       .info("getSnapshotFilter returning instance of " + filter.getClass().getName());
   return filter;
 }
コード例 #2
0
 /**
  * Determines whether the following Map Entry is accepted by this composed SnapshotFilter
  * implementation.
  *
  * @param entry the Map.Entry to evaluate.
  * @return a boolean value indicating whether this composed SnapshotFilter accepts the Map Entry.
  * @see ComposableSnapshotFilter.Operator
  * @see com.gemstone.gemfire.cache.snapshot.SnapshotFilter#accept(Map.Entry)
  * @see java.util.Map.Entry
  */
 @Override
 public boolean accept(final Map.Entry<K, V> entry) {
   return operator.operate(leftOperand.accept(entry), rightOperand.accept(entry));
 }