@Test public void valid_bucket_space_stats_may_have_merges_pending() { Fixture f = Fixture.fromBucketsPending(1); assertTrue(f.mayHaveMergesPending("default", 1)); }
@Override public boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex) { if (!stats.hasUpdatesFromAllDistributors()) { return true; } ContentNodeStats nodeStats = stats.getStats().getContentNode(contentNodeIndex); if (nodeStats != null) { ContentNodeStats.BucketSpaceStats bucketSpaceStats = nodeStats.getBucketSpace(bucketSpace); return (bucketSpaceStats != null && bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)); } return true; }
AggregatedStatsMergePendingChecker implements MergePendingChecker { @Override public boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex) { if (!stats.hasUpdatesFromAllDistributors()) { return true; } ContentNodeStats nodeStats = stats.getStats().getContentNode(contentNodeIndex); if (nodeStats != null) { ContentNodeStats.BucketSpaceStats bucketSpaceStats = nodeStats.getBucketSpace(bucketSpace); return (bucketSpaceStats != null && bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)); } return true; } }
AggregatedStatsMergePendingChecker implements MergePendingChecker { @Override public boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex) { if (!stats.hasUpdatesFromAllDistributors()) { return true; } ContentNodeStats nodeStats = stats.getStats().getContentNode(contentNodeIndex); if (nodeStats != null) { ContentNodeStats.BucketSpaceStats bucketSpaceStats = nodeStats.getBucketSpace(bucketSpace); return (bucketSpaceStats != null && bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)); } return true; } AggregatedStatsMergePendingChecker(AggregatedClusterStats stats,
                                              double minMergeCompletionRatio); }
AggregatedStatsMergePendingChecker implements MergePendingChecker { @Override public boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex) { if (!stats.hasUpdatesFromAllDistributors()) { return true; } ContentNodeStats nodeStats = stats.getStats().getContentNode(contentNodeIndex); if (nodeStats != null) { ContentNodeStats.BucketSpaceStats bucketSpaceStats = nodeStats.getBucketSpace(bucketSpace); return (bucketSpaceStats != null && bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)); } return true; } AggregatedStatsMergePendingChecker(AggregatedClusterStats stats,
                                              double minMergeCompletionRatio); @Override boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex); }
AggregatedStatsMergePendingChecker implements MergePendingChecker { @Override public boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex) { if (!stats.hasUpdatesFromAllDistributors()) { return true; } ContentNodeStats nodeStats = stats.getStats().getContentNode(contentNodeIndex); if (nodeStats != null) { ContentNodeStats.BucketSpaceStats bucketSpaceStats = nodeStats.getBucketSpace(bucketSpace); return (bucketSpaceStats != null && bucketSpaceStats.mayHaveBucketsPending(minMergeCompletionRatio)); } return true; } AggregatedStatsMergePendingChecker(AggregatedClusterStats stats,
                                              double minMergeCompletionRatio); @Override boolean mayHaveMergesPending(String bucketSpace, int contentNodeIndex);  }