This is an automated email from the ASF dual-hosted git repository.
dlmarion pushed a commit to branch elasticity
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/elasticity by this push:
new 77acfe3a87 Removed TabletStatistics.getSplitCreationTime SPI method
(#3959)
77acfe3a87 is described below
commit 77acfe3a878563629a097b97e97f2b00aa0b11b4
Author: Dave Marion <[email protected]>
AuthorDate: Tue Nov 21 14:51:30 2023 -0500
Removed TabletStatistics.getSplitCreationTime SPI method (#3959)
Fixes #3595
---
.../core/manager/balancer/TabletStatisticsImpl.java | 6 ------
.../core/spi/balancer/SimpleLoadBalancer.java | 21 +++------------------
.../core/spi/balancer/data/TabletStatistics.java | 2 --
3 files changed, 3 insertions(+), 26 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/manager/balancer/TabletStatisticsImpl.java
b/core/src/main/java/org/apache/accumulo/core/manager/balancer/TabletStatisticsImpl.java
index b17ce98555..442f11ba52 100644
---
a/core/src/main/java/org/apache/accumulo/core/manager/balancer/TabletStatisticsImpl.java
+++
b/core/src/main/java/org/apache/accumulo/core/manager/balancer/TabletStatisticsImpl.java
@@ -45,12 +45,6 @@ public class TabletStatisticsImpl implements
TabletStatistics {
return thriftStats.getNumEntries();
}
- @Override
- public long getSplitCreationTime() {
- // ELASTICITY_TODO look into what needs to be done to remove this from SPI
- return 0;
- }
-
@Override
public double getIngestRate() {
return thriftStats.getIngestRate();
diff --git
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancer.java
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancer.java
index 09189c0192..068e12bfcf 100644
---
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancer.java
+++
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/SimpleLoadBalancer.java
@@ -265,11 +265,11 @@ public class SimpleLoadBalancer implements TabletBalancer
{
log.error("Unable to select a tablet to move", ex);
return result;
}
- TabletId tabletId = selectTablet(onlineTabletsForTable);
- onlineTabletsForTable.remove(tabletId);
- if (tabletId == null) {
+ if (onlineTabletsForTable.isEmpty()) {
return result;
}
+ TabletId tabletId = onlineTabletsForTable.keySet().iterator().next();
+ onlineTabletsForTable.remove(tabletId);
tooMuchMap.put(table, tooMuchMap.get(table) - 1);
/*
* If a table grows from 1 tablet then tooLittleMap.get(table) can
return a null, since there
@@ -324,21 +324,6 @@ public class SimpleLoadBalancer implements TabletBalancer {
return result;
}
- static TabletId selectTablet(Map<TabletId,TabletStatistics> extents) {
- if (extents.isEmpty()) {
- return null;
- }
- TabletId mostRecentlySplit = null;
- long splitTime = 0;
- for (Entry<TabletId,TabletStatistics> entry : extents.entrySet()) {
- if (entry.getValue().getSplitCreationTime() >= splitTime) {
- splitTime = entry.getValue().getSplitCreationTime();
- mostRecentlySplit = entry.getKey();
- }
- }
- return mostRecentlySplit;
- }
-
// define what it means for a tablet to be busy
private static TableId busiest(Map<String,TableStatistics> tables) {
TableId result = null;
diff --git
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/data/TabletStatistics.java
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/data/TabletStatistics.java
index 99ac7a6251..f2265477fe 100644
---
a/core/src/main/java/org/apache/accumulo/core/spi/balancer/data/TabletStatistics.java
+++
b/core/src/main/java/org/apache/accumulo/core/spi/balancer/data/TabletStatistics.java
@@ -28,8 +28,6 @@ public interface TabletStatistics extends
Comparable<TabletStatistics> {
long getNumEntries();
- long getSplitCreationTime();
-
double getIngestRate();
double getQueryRate();