This is an automated email from the ASF dual-hosted git repository.
domgarguilo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/accumulo.git
The following commit(s) were added to refs/heads/main by this push:
new 8907cf11b2 Use RowRange in place of Range for tablet availability API
(#5952)
8907cf11b2 is described below
commit 8907cf11b2707cae05e870a57bd66a91fc8453ca
Author: Dom G. <[email protected]>
AuthorDate: Tue Dec 30 12:39:50 2025 -0500
Use RowRange in place of Range for tablet availability API (#5952)
* Use RowRange in place of Range for tablet availability API
---
.../core/client/admin/TableOperations.java | 9 ++--
.../core/client/admin/TabletAvailability.java | 5 +-
.../core/clientImpl/TableOperationsImpl.java | 8 +--
.../core/clientImpl/TableOperationsHelperTest.java | 2 +-
.../shell/commands/SetAvailabilityCommand.java | 13 ++---
.../apache/accumulo/test/ComprehensiveITBase.java | 2 +-
.../test/ComprehensiveTableOperationsIT.java | 2 +-
.../org/apache/accumulo/test/ImportExportIT.java | 4 +-
.../java/org/apache/accumulo/test/LocatorIT.java | 3 +-
.../org/apache/accumulo/test/ScanServerIT.java | 13 ++---
.../apache/accumulo/test/TableOperationsIT.java | 60 +++++++++++-----------
.../apache/accumulo/test/TestDualAssignment.java | 6 +--
.../apache/accumulo/test/functional/BulkNewIT.java | 6 +--
.../accumulo/test/functional/FlushNoFileIT.java | 4 +-
.../test/functional/ManagerAssignmentIT.java | 7 +--
.../test/functional/MergeTabletsITBase.java | 5 +-
.../test/functional/OnDemandTabletUnloadingIT.java | 3 +-
.../accumulo/test/functional/SplitMillionIT.java | 2 +-
.../test/functional/TabletAvailabilityIT.java | 10 ++--
19 files changed, 87 insertions(+), 77 deletions(-)
diff --git
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
index 5ab6a89e7c..8d0c3d5107 100644
---
a/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
+++
b/core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java
@@ -1063,16 +1063,15 @@ public interface TableOperations {
/**
* Sets the tablet availability for a range of Tablets in the specified
table, but does not wait
- * for the tablets to reach this availability state. For the Range
parameter, note that the Row
- * portion of the start and end Keys and the inclusivity parameters are used
when determining the
- * range of affected tablets. The other portions of the start and end Keys
are not used.
+ * for the tablets to reach this availability state. The supplied row range
is compared against
+ * the tablets' start/end rows using its lower/upper bounds and inclusivity
flags.
*
* @param tableName table name
- * @param range tablet range
+ * @param rowRange tablet row range
* @param tabletAvailability tablet availability
* @since 4.0.0
*/
- default void setTabletAvailability(String tableName, Range range,
+ default void setTabletAvailability(String tableName, RowRange rowRange,
TabletAvailability tabletAvailability)
throws AccumuloSecurityException, AccumuloException,
TableNotFoundException {
throw new UnsupportedOperationException();
diff --git
a/core/src/main/java/org/apache/accumulo/core/client/admin/TabletAvailability.java
b/core/src/main/java/org/apache/accumulo/core/client/admin/TabletAvailability.java
index 34f0ae2a25..512cba250e 100644
---
a/core/src/main/java/org/apache/accumulo/core/client/admin/TabletAvailability.java
+++
b/core/src/main/java/org/apache/accumulo/core/client/admin/TabletAvailability.java
@@ -18,9 +18,10 @@
*/
package org.apache.accumulo.core.client.admin;
+import org.apache.accumulo.core.data.RowRange;
+
/**
- * @see TableOperations#setTabletAvailability(String,
org.apache.accumulo.core.data.Range,
- * TabletAvailability)
+ * @see TableOperations#setTabletAvailability(String, RowRange,
TabletAvailability)
* @since 4.0.0
*/
public enum TabletAvailability {
diff --git
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
index 11a07f02d7..e59736a70c 100644
---
a/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
+++
b/core/src/main/java/org/apache/accumulo/core/clientImpl/TableOperationsImpl.java
@@ -2210,16 +2210,18 @@ public class TableOperationsImpl extends
TableOperationsHelper {
}
@Override
- public void setTabletAvailability(String tableName, Range range,
TabletAvailability availability)
- throws AccumuloSecurityException, AccumuloException {
+ public void setTabletAvailability(String tableName, RowRange rowRange,
+ TabletAvailability availability) throws AccumuloSecurityException,
AccumuloException {
EXISTING_TABLE_NAME.validate(tableName);
if (SystemTables.containsTableName(tableName)) {
throw new AccumuloException("Cannot set set tablet availability for
table " + tableName);
}
- checkArgument(range != null, "range is null");
+ checkArgument(rowRange != null, "rowRange is null");
checkArgument(availability != null, "tabletAvailability is null");
+ Range range = rowRange.asRange();
+
byte[] bRange;
try {
bRange = new TSerializer().serialize(range.toThrift());
diff --git
a/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
b/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
index 040d21fd0a..90329f497d 100644
---
a/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
+++
b/core/src/test/java/org/apache/accumulo/core/clientImpl/TableOperationsHelperTest.java
@@ -212,7 +212,7 @@ public class TableOperationsHelperTest {
public void online(String tableName, boolean wait) {}
@Override
- public void setTabletAvailability(String tableName, Range range,
+ public void setTabletAvailability(String tableName, RowRange rowRange,
TabletAvailability tabletAvailability)
throws AccumuloSecurityException, AccumuloException,
TableNotFoundException {}
diff --git
a/shell/src/main/java/org/apache/accumulo/shell/commands/SetAvailabilityCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/SetAvailabilityCommand.java
index e47d79ccea..36ecc19296 100644
---
a/shell/src/main/java/org/apache/accumulo/shell/commands/SetAvailabilityCommand.java
+++
b/shell/src/main/java/org/apache/accumulo/shell/commands/SetAvailabilityCommand.java
@@ -24,7 +24,7 @@ import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.AccumuloSecurityException;
import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.TabletAvailability;
-import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.shell.Shell;
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.Option;
@@ -38,7 +38,7 @@ public class SetAvailabilityCommand extends TableOperation {
private Option optEndRowExclusive;
private Option availabilityOpt;
- private Range range;
+ private RowRange rowRange;
private TabletAvailability tabletAvailability;
@Override
@@ -54,10 +54,10 @@ public class SetAvailabilityCommand extends TableOperation {
@Override
protected void doTableOp(final Shell shellState, final String tableName)
throws AccumuloException, AccumuloSecurityException,
TableNotFoundException, IOException {
-
shellState.getAccumuloClient().tableOperations().setTabletAvailability(tableName,
range,
+
shellState.getAccumuloClient().tableOperations().setTabletAvailability(tableName,
rowRange,
tabletAvailability);
Shell.log.debug("Set tablet availability: {} on table: {}, range: {}",
tabletAvailability,
- tableName, range);
+ tableName, rowRange);
}
@Override
@@ -73,13 +73,14 @@ public class SetAvailabilityCommand extends TableOperation {
}
if (cl.hasOption(optRow.getOpt())) {
- this.range = new Range(new
Text(cl.getOptionValue(optRow.getOpt()).getBytes(Shell.CHARSET)));
+ this.rowRange =
+ RowRange.closed(new
Text(cl.getOptionValue(optRow.getOpt()).getBytes(Shell.CHARSET)));
} else {
Text startRow = OptUtil.getStartRow(cl);
Text endRow = OptUtil.getEndRow(cl);
final boolean startInclusive =
!cl.hasOption(optStartRowExclusive.getOpt());
final boolean endInclusive = !cl.hasOption(optEndRowExclusive.getOpt());
- this.range = new Range(startRow, startInclusive, endRow, endInclusive);
+ this.rowRange = RowRange.range(startRow, startInclusive, endRow,
endInclusive);
}
this.tabletAvailability =
diff --git
a/test/src/main/java/org/apache/accumulo/test/ComprehensiveITBase.java
b/test/src/main/java/org/apache/accumulo/test/ComprehensiveITBase.java
index 798e33252c..a863b664fc 100644
--- a/test/src/main/java/org/apache/accumulo/test/ComprehensiveITBase.java
+++ b/test/src/main/java/org/apache/accumulo/test/ComprehensiveITBase.java
@@ -850,7 +850,7 @@ public abstract class ComprehensiveITBase extends
SharedMiniClusterBase {
// set last tablet in table to always be HOSTED, setting a tablet
availability here will test
// export and cloning tables with tablet availabilities
client.tableOperations().setTabletAvailability(everythingTable,
- new Range(everythingSplits.last(), false, null, true),
TabletAvailability.HOSTED);
+ RowRange.greaterThan(everythingSplits.last()),
TabletAvailability.HOSTED);
write(client, everythingTable, generateMutations(0, 100, tr -> true));
diff --git
a/test/src/main/java/org/apache/accumulo/test/ComprehensiveTableOperationsIT.java
b/test/src/main/java/org/apache/accumulo/test/ComprehensiveTableOperationsIT.java
index 100168f915..b3fdcbc463 100644
---
a/test/src/main/java/org/apache/accumulo/test/ComprehensiveTableOperationsIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/ComprehensiveTableOperationsIT.java
@@ -801,7 +801,7 @@ public class ComprehensiveTableOperationsIT extends
SharedMiniClusterBase {
for (var sysTable : SystemTables.tableNames()) {
// should not be able to unhost any system table
assertThrows(AccumuloException.class,
- () -> ops.setTabletAvailability(sysTable, new Range(),
TabletAvailability.UNHOSTED));
+ () -> ops.setTabletAvailability(sysTable, RowRange.all(),
TabletAvailability.UNHOSTED));
assertTrue(ops.getTabletInformation(sysTable,
List.of(RowRange.all())).findAny().isPresent());
ops.getTabletInformation(sysTable, List.of(RowRange.all()))
.forEach(ti -> assertEquals(TabletAvailability.HOSTED,
ti.getTabletAvailability()));
diff --git a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
index a017289794..23fa026d12 100644
--- a/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
@@ -367,9 +367,9 @@ public class ImportExportIT extends AccumuloClusterHarness {
// add split 'h' and 'q'. Leave first as ONDEMAND, set second to
UNHOSTED, and third to HOSTED
SortedSet<Text> splits = Sets.newTreeSet(Arrays.asList(new Text("h"),
new Text("q")));
client.tableOperations().addSplits(srcTable, splits);
- Range range = new Range(new Text("h"), false, new Text("q"), true);
+ RowRange range = RowRange.openClosed(new Text("h"), new Text("q"));
client.tableOperations().setTabletAvailability(srcTable, range,
TabletAvailability.UNHOSTED);
- range = new Range(new Text("q"), false, null, true);
+ range = RowRange.greaterThan(new Text("q"));
client.tableOperations().setTabletAvailability(srcTable, range,
TabletAvailability.HOSTED);
// verify
diff --git a/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
b/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
index ff89e81b92..eea4ee5733 100644
--- a/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/LocatorIT.java
@@ -44,6 +44,7 @@ import org.apache.accumulo.core.client.admin.TableOperations;
import org.apache.accumulo.core.client.admin.TabletAvailability;
import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.TabletId;
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -129,7 +130,7 @@ public class LocatorIT extends AccumuloClusterHarness {
ranges.clear();
- tableOps.setTabletAvailability(tableName, new Range(),
TabletAvailability.HOSTED);
+ tableOps.setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.HOSTED);
Wait.waitFor(() -> hostedAndCurrentNotNull
.test(ManagerAssignmentIT.getTabletMetadata(client, tableId, null)),
60000, 250);
diff --git a/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java
b/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java
index b4155d506a..9507dbe3fb 100644
--- a/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ScanServerIT.java
@@ -56,6 +56,7 @@ import
org.apache.accumulo.core.client.admin.TabletAvailability;
import org.apache.accumulo.core.conf.ClientProperty;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.fate.FateId;
import org.apache.accumulo.core.fate.FateInstanceType;
@@ -254,7 +255,7 @@ public class ScanServerIT extends SharedMiniClusterBase {
// Unload all tablets
TableId tid =
TableId.of(client.tableOperations().tableIdMap().get(tableName));
- client.tableOperations().setTabletAvailability(tableName, new
Range((Text) null, (Text) null),
+ client.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.ONDEMAND);
// Wait for the tablets to be unloaded
@@ -373,14 +374,14 @@ public class ScanServerIT extends SharedMiniClusterBase {
String tableId = client.tableOperations().tableIdMap().get(tableName);
// row 1 -> 3 are HOSTED
- client.tableOperations().setTabletAvailability(tableName,
- new Range(null, true, "row_0000000003", true),
TabletAvailability.HOSTED);
+ client.tableOperations().setTabletAvailability(tableName,
RowRange.atMost("row_0000000003"),
+ TabletAvailability.HOSTED);
// row 4 -> 7 are UNHOSTED
client.tableOperations().setTabletAvailability(tableName,
- new Range("row_0000000004", true, "row_0000000007", true),
TabletAvailability.UNHOSTED);
+ RowRange.closed("row_0000000004", "row_0000000007"),
TabletAvailability.UNHOSTED);
// row 8 and 9 are ondemand
- client.tableOperations().setTabletAvailability(tableName,
- new Range("row_0000000008", true, null, true),
TabletAvailability.ONDEMAND);
+ client.tableOperations().setTabletAvailability(tableName,
RowRange.atLeast("row_0000000008"),
+ TabletAvailability.ONDEMAND);
// Wait for the UNHOSTED and ONDEMAND tablets to be unloaded due to
inactivity
Wait.waitFor(() -> ScanServerIT.getNumHostedTablets(client, tableId) == 3,
30_000, 1_000);
diff --git a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
index 7414e0a7cb..cfb633f088 100644
--- a/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
@@ -67,7 +67,6 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.PartialKey;
-import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.TabletId;
@@ -614,14 +613,14 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
accumuloClient.tableOperations().create(tableName, ntc);
// set each tablet with a different availability and query to see if
they are set accordingly
- Range range = new Range(null, false, new Text("d"), true);
- accumuloClient.tableOperations().setTabletAvailability(tableName, range,
+ RowRange rowRange = RowRange.atMost(new Text("d"));
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
rowRange,
TabletAvailability.UNHOSTED);
- range = new Range(new Text("m"), false, new Text("s"), true);
- accumuloClient.tableOperations().setTabletAvailability(tableName, range,
+ rowRange = RowRange.openClosed(new Text("m"), new Text("s"));
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
rowRange,
TabletAvailability.HOSTED);
- range = new Range(new Text("s"), false, null, true);
- accumuloClient.tableOperations().setTabletAvailability(tableName, range,
+ rowRange = RowRange.greaterThan(new Text("s"));
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
rowRange,
TabletAvailability.UNHOSTED);
Map<String,String> idMap = accumuloClient.tableOperations().tableIdMap();
@@ -663,12 +662,12 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
// set each different availability for each tablet and query to see if
they are set
// accordingly
- accumuloClient.tableOperations().setTabletAvailability(tableName, new
Range(new Text("d")),
- TabletAvailability.HOSTED);
- accumuloClient.tableOperations().setTabletAvailability(tableName, new
Range(new Text("m")),
- TabletAvailability.UNHOSTED);
- accumuloClient.tableOperations().setTabletAvailability(tableName, new
Range(new Text("s")),
- TabletAvailability.HOSTED);
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
+ RowRange.closed(new Text("d")), TabletAvailability.HOSTED);
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
+ RowRange.closed(new Text("m")), TabletAvailability.UNHOSTED);
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
+ RowRange.closed(new Text("s")), TabletAvailability.HOSTED);
idMap = accumuloClient.tableOperations().tableIdMap();
tableId = idMap.get(tableName);
@@ -679,8 +678,8 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
verifyTabletAvailabilities(tableName, RowRange.closed("a"),
expectedTabletAvailability);
// test using startRowInclusive set to true
- RowRange range = RowRange.closed(new Text("c"));
- verifyTabletAvailabilities(tableName, range, expectedTabletAvailability);
+ RowRange rowRange = RowRange.closed(new Text("c"));
+ verifyTabletAvailabilities(tableName, rowRange,
expectedTabletAvailability);
expectedTabletAvailability.clear();
setExpectedTabletAvailability(expectedTabletAvailability, tableId, "m",
"d",
@@ -688,8 +687,8 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
setExpectedTabletAvailability(expectedTabletAvailability, tableId, "s",
"m",
TabletAvailability.HOSTED);
- range = RowRange.closed(new Text("m"), new Text("p"));
- verifyTabletAvailabilities(tableName, range, expectedTabletAvailability);
+ rowRange = RowRange.closed(new Text("m"), new Text("p"));
+ verifyTabletAvailabilities(tableName, rowRange,
expectedTabletAvailability);
expectedTabletAvailability.clear();
setExpectedTabletAvailability(expectedTabletAvailability, tableId, "d",
null,
@@ -701,8 +700,8 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
setExpectedTabletAvailability(expectedTabletAvailability, tableId, null,
"s",
TabletAvailability.ONDEMAND);
- range = RowRange.openClosed("b", "t");
- verifyTabletAvailabilities(tableName, range, expectedTabletAvailability);
+ rowRange = RowRange.openClosed("b", "t");
+ verifyTabletAvailabilities(tableName, rowRange,
expectedTabletAvailability);
} finally {
accumuloClient.tableOperations().delete(tableName);
@@ -722,7 +721,7 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
Map<String,String> idMap = accumuloClient.tableOperations().tableIdMap();
// set goals to HOSTED
- accumuloClient.tableOperations().setTabletAvailability(tableName, new
Range(),
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
RowRange.all(),
TabletAvailability.HOSTED);
Map<TabletId,TabletAvailability> expectedTabletAvailability = new
HashMap<>();
@@ -773,11 +772,11 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
// add split 'h' and 'q'. Leave first as ONDEMAND, set second to
UNHOSTED, and third to HOSTED
SortedSet<Text> splits = Sets.newTreeSet(Arrays.asList(new Text("h"),
new Text("q")));
accumuloClient.tableOperations().addSplits(tableName, splits);
- Range range = new Range(new Text("h"), false, new Text("q"), true);
- accumuloClient.tableOperations().setTabletAvailability(tableName, range,
+ RowRange rowRange = RowRange.openClosed(new Text("h"), new Text("q"));
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
rowRange,
TabletAvailability.UNHOSTED);
- range = new Range(new Text("q"), false, null, true);
- accumuloClient.tableOperations().setTabletAvailability(tableName, range,
+ rowRange = RowRange.greaterThan(new Text("q"));
+ accumuloClient.tableOperations().setTabletAvailability(tableName,
rowRange,
TabletAvailability.HOSTED);
// verify
@@ -869,17 +868,18 @@ public class TableOperationsIT extends
AccumuloClusterHarness {
expectedTabletAvailability);
}
- public static void verifyTabletAvailabilities(String tableName, RowRange
range,
+ public static void verifyTabletAvailabilities(String tableName, RowRange
rowRange,
Map<TabletId,TabletAvailability> expectedAvailability) throws
TableNotFoundException {
- verifyTabletAvailabilities(accumuloClient, tableName, range,
expectedAvailability);
+ verifyTabletAvailabilities(accumuloClient, tableName, rowRange,
expectedAvailability);
}
public static void verifyTabletAvailabilities(AccumuloClient client, String
tableName,
- RowRange range, Map<TabletId,TabletAvailability> expectedAvailability)
+ RowRange rowRange, Map<TabletId,TabletAvailability> expectedAvailability)
throws TableNotFoundException {
- Map<TabletId,TabletAvailability> seenAvailability =
- client.tableOperations().getTabletInformation(tableName,
List.of(range)).collect(Collectors
- .toMap(TabletInformation::getTabletId,
TabletInformation::getTabletAvailability));
+ Map<TabletId,
+ TabletAvailability> seenAvailability = client.tableOperations()
+ .getTabletInformation(tableName,
List.of(rowRange)).collect(Collectors
+ .toMap(TabletInformation::getTabletId,
TabletInformation::getTabletAvailability));
assertEquals(expectedAvailability, seenAvailability);
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/TestDualAssignment.java
b/test/src/main/java/org/apache/accumulo/test/TestDualAssignment.java
index d04ff0d68f..3c3525e7a6 100644
--- a/test/src/main/java/org/apache/accumulo/test/TestDualAssignment.java
+++ b/test/src/main/java/org/apache/accumulo/test/TestDualAssignment.java
@@ -31,7 +31,7 @@ import org.apache.accumulo.core.client.AccumuloException;
import org.apache.accumulo.core.client.admin.NewTableConfiguration;
import org.apache.accumulo.core.client.admin.TabletAvailability;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import org.apache.accumulo.miniclusterImpl.MiniAccumuloConfigImpl;
@@ -83,7 +83,7 @@ public class TestDualAssignment extends ConfigurableMacBase {
// This operation will fail when there are two locations set on a tablet
assertThrows(AccumuloException.class, () ->
c.tableOperations().setTabletAvailability(table,
- new Range(), TabletAvailability.HOSTED));
+ RowRange.all(), TabletAvailability.HOSTED));
try (var scanner = c.createScanner(table)) {
// should not be able to scan the table when a tablet has multiple
locations
@@ -116,7 +116,7 @@ public class TestDualAssignment extends ConfigurableMacBase
{
}
// this should no longer fail
- c.tableOperations().setTabletAvailability(table, new Range(),
TabletAvailability.HOSTED);
+ c.tableOperations().setTabletAvailability(table, RowRange.all(),
TabletAvailability.HOSTED);
}
}
}
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java
index 271a410246..bab8086c87 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/BulkNewIT.java
@@ -1130,11 +1130,11 @@ public class BulkNewIT extends SharedMiniClusterBase {
addSplits(c, tableName, "0100 0200 0300 0400 0500");
- c.tableOperations().setTabletAvailability(tableName, new Range("0100",
false, "0200", true),
+ c.tableOperations().setTabletAvailability(tableName,
RowRange.openClosed("0100", "0200"),
TabletAvailability.HOSTED);
- c.tableOperations().setTabletAvailability(tableName, new Range("0300",
false, "0400", true),
+ c.tableOperations().setTabletAvailability(tableName,
RowRange.openClosed("0300", "0400"),
TabletAvailability.HOSTED);
- c.tableOperations().setTabletAvailability(tableName, new Range("0400",
false, null, true),
+ c.tableOperations().setTabletAvailability(tableName,
RowRange.greaterThan("0400"),
TabletAvailability.UNHOSTED);
// verify tablet availabilities are as expected
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/FlushNoFileIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/FlushNoFileIT.java
index e6d0943a2d..b70cb831a8 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/FlushNoFileIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/FlushNoFileIT.java
@@ -42,6 +42,7 @@ import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -126,7 +127,8 @@ public class FlushNoFileIT extends AccumuloClusterHarness {
});
// Host all tablets
- c.tableOperations().setTabletAvailability(tableName, new Range(),
TabletAvailability.HOSTED);
+ c.tableOperations().setTabletAvailability(tableName, RowRange.all(),
+ TabletAvailability.HOSTED);
// Wait for all tablets to be hosted
Wait.waitFor(() -> ManagerAssignmentIT.countTabletsWithLocation(c,
tableId) == 3);
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
index d4b5d9655a..aec39e56f7 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/ManagerAssignmentIT.java
@@ -61,6 +61,7 @@ import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.ResourceGroupId;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.dataImpl.KeyExtent;
import org.apache.accumulo.core.fate.FateId;
@@ -180,7 +181,7 @@ public class ManagerAssignmentIT extends
SharedMiniClusterBase {
assertEquals(TabletAvailability.ONDEMAND, online.getTabletAvailability());
// set the tablet availability to HOSTED
- client.tableOperations().setTabletAvailability(tableName, new Range(),
+ client.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.HOSTED);
Predicate<TabletMetadata> hostedOrCurrentNotNull =
@@ -196,7 +197,7 @@ public class ManagerAssignmentIT extends
SharedMiniClusterBase {
assertEquals(TabletAvailability.HOSTED, always.getTabletAvailability());
// set the hosting availability to never
- client.tableOperations().setTabletAvailability(tableName, new Range(),
+ client.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.UNHOSTED);
Predicate<TabletMetadata> unhostedOrCurrentNull =
t -> (t.getTabletAvailability() == TabletAvailability.UNHOSTED &&
!t.hasCurrent());
@@ -210,7 +211,7 @@ public class ManagerAssignmentIT extends
SharedMiniClusterBase {
assertEquals(TabletAvailability.UNHOSTED,
unhosted.getTabletAvailability());
// set the tablet availability to ONDEMAND
- client.tableOperations().setTabletAvailability(tableName, new Range(),
+ client.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.ONDEMAND);
Predicate<TabletMetadata> ondemandHosted =
t -> t.getTabletAvailability() == TabletAvailability.ONDEMAND;
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsITBase.java
b/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsITBase.java
index 80870f43bc..5a43744bd9 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsITBase.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/MergeTabletsITBase.java
@@ -57,6 +57,7 @@ import org.apache.accumulo.core.data.Key;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
import org.apache.accumulo.core.data.ResourceGroupId;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.Value;
import org.apache.accumulo.core.dataImpl.KeyExtent;
@@ -176,9 +177,9 @@ public abstract class MergeTabletsITBase extends
SharedMiniClusterBase {
bw.addMutation(m);
}
}
- c.tableOperations().setTabletAvailability(tableName, new Range("d", "e"),
+ c.tableOperations().setTabletAvailability(tableName,
RowRange.closed("d", "e"),
TabletAvailability.HOSTED);
- c.tableOperations().setTabletAvailability(tableName, new Range("e", "f"),
+ c.tableOperations().setTabletAvailability(tableName,
RowRange.closed("e", "f"),
TabletAvailability.UNHOSTED);
c.tableOperations().flush(tableName, null, null, true);
c.tableOperations().merge(tableName, new Text("c1"), new Text("f1"));
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/OnDemandTabletUnloadingIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/OnDemandTabletUnloadingIT.java
index a8e3db0460..560583ab35 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/OnDemandTabletUnloadingIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/OnDemandTabletUnloadingIT.java
@@ -47,6 +47,7 @@ import org.apache.accumulo.core.clientImpl.ClientContext;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.data.Mutation;
import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.RowRange;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.metadata.schema.TabletMetadata;
import
org.apache.accumulo.core.spi.ondemand.LastAccessTimeOnDemandTabletUnloader;
@@ -197,7 +198,7 @@ public class OnDemandTabletUnloadingIT extends
SharedMiniClusterBase {
// transition all tablets to ondemand. Since no tablets have a hosting
requested column set
// the manager should unassign all tablets.
- c.tableOperations().setTabletAvailability(tableName, new Range(),
+ c.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.ONDEMAND);
Wait.waitFor(() -> ManagerAssignmentIT.countTabletsWithLocation(c,
TableId.of(tableId)) == 0);
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/SplitMillionIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/SplitMillionIT.java
index 4bf4a3d451..57eeb68415 100644
--- a/test/src/main/java/org/apache/accumulo/test/functional/SplitMillionIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/functional/SplitMillionIT.java
@@ -176,7 +176,7 @@ public class SplitMillionIT extends ConfigurableMacBase {
// of the tablets for the clone table will be hosted. The subsequent
merge operation
// is a metadata-only operation unless the tablet is hosted. If the
tablet is hosted
// then the tablet has to be closed making the merge operation take
longer.
- c.tableOperations().setTabletAvailability(tableName, new Range(),
+ c.tableOperations().setTabletAvailability(tableName, RowRange.all(),
TabletAvailability.UNHOSTED);
// clone the table to test cloning with lots of tablets and also to give
merge its own table
diff --git
a/test/src/main/java/org/apache/accumulo/test/functional/TabletAvailabilityIT.java
b/test/src/main/java/org/apache/accumulo/test/functional/TabletAvailabilityIT.java
index 6dbb58f21a..7d1ac7d1eb 100644
---
a/test/src/main/java/org/apache/accumulo/test/functional/TabletAvailabilityIT.java
+++
b/test/src/main/java/org/apache/accumulo/test/functional/TabletAvailabilityIT.java
@@ -57,7 +57,7 @@ public class TabletAvailabilityIT extends
AccumuloClusterHarness {
try (AccumuloClient client =
Accumulo.newClient().from(getClientProps()).build()) {
for (SystemTables t : SystemTables.values()) {
assertThrows(AccumuloException.class, () -> client.tableOperations()
- .setTabletAvailability(t.tableName(), new Range(), UNHOSTED));
+ .setTabletAvailability(t.tableName(), RowRange.all(), UNHOSTED));
}
}
}
@@ -69,7 +69,7 @@ public class TabletAvailabilityIT extends
AccumuloClusterHarness {
client.tableOperations().create(table, new
NewTableConfiguration().createOffline());
assertThrows(TableOfflineException.class,
- () -> client.tableOperations().setTabletAvailability(table, new
Range(), HOSTED));
+ () -> client.tableOperations().setTabletAvailability(table,
RowRange.all(), HOSTED));
}
}
@@ -95,9 +95,9 @@ public class TabletAvailabilityIT extends
AccumuloClusterHarness {
for (var a1 : TabletAvailability.values()) {
for (var a2 : TabletAvailability.values()) {
availabilites.put(row(r), a1);
- client.tableOperations().setTabletAvailability(table, new
Range(row(r++)), a1);
+ client.tableOperations().setTabletAvailability(table,
RowRange.closed(row(r++)), a1);
availabilites.put(row(r), a2);
- client.tableOperations().setTabletAvailability(table, new
Range(row(r++)), a2);
+ client.tableOperations().setTabletAvailability(table,
RowRange.closed(row(r++)), a2);
}
}
@@ -150,7 +150,7 @@ public class TabletAvailabilityIT extends
AccumuloClusterHarness {
}
// verify nothing was actually written to the unhosted tablets
- client.tableOperations().setTabletAvailability(table, new Range(),
HOSTED);
+ client.tableOperations().setTabletAvailability(table, RowRange.all(),
HOSTED);
for (var entry : availabilites.entrySet()) {
if (entry.getValue() == UNHOSTED) {
var row = entry.getKey();