-
Notifications
You must be signed in to change notification settings - Fork 444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove AvailabilityForTablet #4728
Remove AvailabilityForTablet #4728
Conversation
- Delete AvailabiltyForTablet class. It is only being used in 2 tests: ImportExportIT and TableOperationsIT. - In both ImportExportIT and TableOperationsIT, replace List<AvailabilityForTablet> objects with Map<TabletId, TabletAvailability>. - Fix typo in TableOperationsIT: verifyTabletAvailabilites -> verifyTabletAvailabilities. Resolves: apache#4706 "Remove AvailabilityForTablet from public API"
List<AvailabilityForTablet> expectedAvailability) throws TableNotFoundException { | ||
public static void verifyTabletAvailabilities(AccumuloClient client, String tableName, | ||
Range range, Map<TabletId,TabletAvailability> expectedAvailability) | ||
throws TableNotFoundException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this new map, may be able to simplify the body of this method to the following.
Map<TabletId, TabletAvailability> seenAvailability = client.tableOperations()
.getTabletInformation(tableName, range).collect(Collectors.toMap(TabletInformation::getTabletId, TabletInformation::getTabletAvailability));
assertEquals(expectedAvailability, seenAvailability);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense, just updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes look good. I like using the map to replace List<AvailabilityForTablet>
. Made one comment about further simplification that could be done using the new map, but that does not have to be done.
- Streamline verifyTabletAvailabilities method in TableOperationsIT class by comparing two Maps instead of a Map and a List. Cut previous two Assertions down to one Assertion. Resolves: apache#4706 "Remove AvailabilityForTablet from public API"
- Correct formatting in TableOperationsIT which was previously causing workflow build to fail. Resolves: apache#4706 "Remove AvailabilityForTablet from public API"
@meatballspaghetti if this your first PR to Accumulo then feel free to make a PR to add yourself as a contributor on the People page. |
This PR is meant to delete the
AvailabilityForTablet
class which was located in public API and only used by 2 integration tests:ImportExportIT
andTableOperationsIT
. Upon deleting the class, its usages were replaced which maintained the original functionality. This PR also fixes a typo inTableOperationsIT
.The following files have been modified:
core/src/main/java/org/apache/accumulo/core/client/admin/AvailabilityForTablet.java
: Deleted.test/src/main/java/org/apache/accumulo/test/ImportExportIT.java
: Replace usages ofList<AvailabilityForTablet>
objects withMap<TabletId, TabletAvailability>
.test/src/main/java/org/apache/accumulo/test/TableOperationsIT.java
: Replace usages ofList<AvailabilityForTablet>
objects withMap<TabletId, TabletAvailability>
. In doing so, changed the assertion on line 742: previously, was anassertEquals
assertion that compared theTabletId
field of objects in expected/actual Lists; now, is anassertTrue
assertion that checks if the (expected)Map<TabletId, TabletAvailability> expectedAvailability
contains the sameTabletId
's as those in the (actual)List<TabletInformation> tabletInfo
. Since there is an assertion (line 740) for checking that both structures have the same size, this change can serve the same purpose as the original assertion and ensures thatexpectedAvailability
andtabletInfo
contain equal values.verifyTabletAvailabilities
on line 735 ofTableOperationsIT
has been simplified to compare two Maps instead of a Map and a List, resulting in only one Assertion needed.verifyTabletAvailabilites
->verifyTabletAvailabilities
in bothImportExportIT
andTableOperationsIT
.Resolves: #4706 "Remove AvailabilityForTablet from public API"