public Set getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { PartitionedRegion pr = (PartitionedRegion)localRegion; /* * txtodo: what does this mean for c/s */ return pr.getBucketKeys(bucketId, allowTombstones); }
/** * Fetch the keys for the given bucket identifier, if the bucket is local or * remote. * * @param bucketNum * @return A set of keys from bucketNum or {@link Collections#EMPTY_SET}if no * keys can be found. */ public Set getBucketKeys(int bucketNum) { return getBucketKeys(bucketNum, false); }
public Set<?> getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { final PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getBucketKeys(bucketId, allowTombstones); }
/** * Fetch the keys for the given bucket identifier, if the bucket is local or * remote. * * @param bucketNum * @return A set of keys from bucketNum or {@link Collections#EMPTY_SET}if no * keys can be found. */ public Set getBucketKeys(int bucketNum) { return getBucketKeys(bucketNum, false); }
@Override public Set<?> getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getBucketKeys(bucketId, allowTombstones); }
public final Set<?> getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { // nothing to add here; PR's getBucketKeys will automatically fetch from // remote with TX context if required final PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getBucketKeys(bucketId, allowTombstones); }
@Override public Set getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getBucketKeys(bucketId, allowTombstones); } @Override
public Set getBucketKeys(LocalRegion localRegion, int bucketId, boolean allowTombstones) { PartitionedRegion pr = (PartitionedRegion)localRegion; return pr.getBucketKeys(bucketId, allowTombstones); }
/** * Fetch the keys for the given bucket identifier, if the bucket is local or * remote. This version of the method allows you to retrieve Tombstone entries * as well as undestroyed entries. * * @param bucketNum * @param allowTombstones whether to include destroyed entries in the result * @return A set of keys from bucketNum or {@link Collections#EMPTY_SET}if no * keys can be found. */ public Set getBucketKeys(int bucketNum, boolean allowTombstones) { return getBucketKeys(bucketNum, null, allowTombstones, getTXState()); }
public void verifyEmptyRecreatedBuckets(PartitionedRegion aRegion, Set<Integer> recreatedBucketIdsSet) { for (Integer bucketId : recreatedBucketIdsSet) { Set keySetOfBucket; try { keySetOfBucket = aRegion.getBucketKeys(bucketId); } catch (Exception e) { throw new TestException("Caught the exception during getBucketKeys ", e); } if (keySetOfBucket.size() != 0) { throw new TestException("Expected the bucket " + bucketId + " (which is recreated) to be empty but has the size of " + keySetOfBucket.size()); } } }
/** * Search the entires PartitionedRegion for the key, to validate that indeed * it doesn't exist * * @returns true if it does exist * @param par * @param key */ public static boolean searchForKey(PartitionedRegion par, Date key) { // Check to make super sure that the key exists boolean foundIt = false; final int numBucks = par.getTotalNumberOfBuckets(); for (int b = 0; b < numBucks; b++) { if (par.getBucketKeys(b).contains(key)) { foundIt = true; //getLogWriter().info("Key " + key + " found in bucket " + b); break; } } if (!foundIt) { getLogWriter().severe("Key " + key + " not found in any bucket"); } return foundIt; }
assertTrue(pr.getBucketKeys(bid).size() > 0);
assertTrue(pr.getBucketKeys(bid).size() > 0);
assertTrue(pr.getBucketKeys(bid).size() > 0);
assertTrue(pr.getBucketKeys(bid).size() > 0);
assertTrue(pr.getBucketKeys(bid).size() > 0);
public static void validateEmptyBuckets(PartitionedRegion aRegion, Set recreatedBucketSet) { hydra.Log.getLogWriter().info( "Recreated bucket set is " + recreatedBucketSet); for (Object bucketId : recreatedBucketSet) { try { Set bucketKeys = aRegion.getBucketKeys((Integer)bucketId); if (bucketKeys.size() != 0) { throw new TestException("For the bucketId " + bucketId + " of region " + aRegion.getName() + " bucket is not empty as expected"); } } catch (Exception e) { throw new TestException("Caught Exception ", e); } } }
assertTrue(pr.getBucketKeys(bid).size() > 0);
/** * Search the entires PartitionedRegion for the key, to validate that indeed * it doesn't exist * * @returns true if it does exist * @param par * @param key */ public static boolean searchForKey(PartitionedRegion par, Object key) { // Check to make super sure that the key doesn't exist ANYWHERE // TODO use keys() when it is properly implemented boolean foundIt = false; final int numBucks = par.getTotalNumberOfBuckets(); for (int b = 0; b < numBucks; b++) { if (par.getBucketKeys(b).contains(key)) { foundIt = true; getLogWriter().severe("Key " + key + " found in bucket " + b); break; } } if (!foundIt) { getLogWriter().severe("Key " + key + " not found in any bucket"); } return foundIt; }
/** * Search the entires PartitionedRegion for the key, to validate that indeed * it doesn't exist * * @returns true if it does exist * @param par * @param key */ public static boolean searchForKey(PartitionedRegion par, Date key) { // Check to make super sure that the key exists boolean foundIt = false; final int numBucks = par.getTotalNumberOfBuckets(); for (int b = 0; b < numBucks; b++) { if (par.getBucketKeys(b).contains(key)) { foundIt = true; getLogWriter().info("Key " + key + " found in bucket " + b); break; } } if (!foundIt) { getLogWriter().severe("Key " + key + " not found in any bucket"); } return foundIt; }