Skip to content

Commit 0ec481a

Browse files
committed
Merge remote-tracking branch 'upstream/elasticity' into closeTMinGCWAL
2 parents 350d4d6 + 5f5cbd3 commit 0ec481a

File tree

129 files changed

+1925
-1422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+1925
-1422
lines changed

.github/workflows/maven-full-its.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -127,21 +127,21 @@ jobs:
127127
MAVEN_OPTS: -Djansi.force=true
128128
- name: Upload unit test results
129129
if: ${{ failure() }}
130-
uses: actions/upload-artifact@v3
130+
uses: actions/upload-artifact@v4
131131
with:
132132
name: surefire-reports-${{ matrix.profile.name }}
133133
path: ./**/target/surefire-reports/
134134
if-no-files-found: ignore
135135
- name: Upload integration test results
136136
if: ${{ failure() }}
137-
uses: actions/upload-artifact@v3
137+
uses: actions/upload-artifact@v4
138138
with:
139139
name: failsafe-reports-${{ matrix.profile.name }}
140140
path: ./**/target/failsafe-reports/
141141
if-no-files-found: ignore
142142
- name: Upload mini test logs
143143
if: ${{ failure() }}
144-
uses: actions/upload-artifact@v3
144+
uses: actions/upload-artifact@v4
145145
with:
146146
name: mini-tests-logs-${{ matrix.profile.name }}
147147
path: ./**/target/**/mini-tests/**/logs/

.github/workflows/maven-on-demand.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,21 @@ jobs:
102102
MAVEN_OPTS: -Djansi.force=true
103103
- name: Upload unit test results
104104
if: ${{ failure() }}
105-
uses: actions/upload-artifact@v3
105+
uses: actions/upload-artifact@v4
106106
with:
107107
name: surefire-reports
108108
path: ./**/target/surefire-reports/
109109
if-no-files-found: ignore
110110
- name: Upload integration test results
111111
if: ${{ failure() }}
112-
uses: actions/upload-artifact@v3
112+
uses: actions/upload-artifact@v4
113113
with:
114114
name: failsafe-reports
115115
path: ./**/target/failsafe-reports/
116116
if-no-files-found: ignore
117117
- name: Upload mini test logs
118118
if: ${{ failure() }}
119-
uses: actions/upload-artifact@v3
119+
uses: actions/upload-artifact@v4
120120
with:
121121
name: mini-tests-logs
122122
path: ./**/target/**/mini-tests/**/logs/

.github/workflows/maven.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ jobs:
111111
MAVEN_OPTS: -Djansi.force=true
112112
- name: Upload unit test results
113113
if: ${{ failure() }}
114-
uses: actions/upload-artifact@v3
114+
uses: actions/upload-artifact@v4
115115
with:
116116
name: surefire-reports-${{ matrix.profile.name }}
117117
path: ./**/target/surefire-reports/
118118
if-no-files-found: ignore
119119
- name: Upload integration test results
120120
if: ${{ failure() }}
121-
uses: actions/upload-artifact@v3
121+
uses: actions/upload-artifact@v4
122122
with:
123123
name: failsafe-reports-${{ matrix.profile.name }}
124124
path: ./**/target/failsafe-reports/
125125
if-no-files-found: ignore
126126
- name: Upload mini test logs
127127
if: ${{ failure() }}
128-
uses: actions/upload-artifact@v3
128+
uses: actions/upload-artifact@v4
129129
with:
130130
name: mini-tests-logs-${{ matrix.profile.name }}
131131
path: ./**/target/**/mini-tests/**/logs/

core/pom.xml

-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,6 @@
198198
<exclude>src/main/java/org/apache/accumulo/core/bloomfilter/*.java</exclude>
199199
<exclude>src/main/java/org/apache/accumulo/core/util/HostAndPort.java</exclude>
200200
<exclude>src/test/resources/*.jceks</exclude>
201-
<exclude>src/test/resources/org/apache/accumulo/core/file/rfile/*.rf</exclude>
202201
</excludes>
203202
</licenseSet>
204203
</licenseSets>
@@ -211,7 +210,6 @@
211210
<excludes>
212211
<exclude>src/main/java/org/apache/accumulo/core/bloomfilter/*.java</exclude>
213212
<exclude>src/test/resources/*.jceks</exclude>
214-
<exclude>src/test/resources/org/apache/accumulo/core/file/rfile/*.rf</exclude>
215213
</excludes>
216214
</configuration>
217215
</plugin>

core/src/main/java/org/apache/accumulo/core/client/admin/HostingGoalForTablet.java core/src/main/java/org/apache/accumulo/core/client/admin/AvailabilityForTablet.java

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,23 @@
2323
import org.apache.accumulo.core.data.TabletId;
2424

2525
/**
26-
* This class contains information that defines the tablet hosting data for a table. The class
27-
* contains the TabletId and associated goal for each tablet in a table or a subset of tablets if a
28-
* range is provided.
26+
* This class contains information that defines the tablet availability data for a table. The class
27+
* contains the TabletId and associated availability for each tablet in a table or a subset of
28+
* tablets if a range is provided.
2929
*
3030
* @since 4.0.0
3131
*/
32-
public class HostingGoalForTablet {
32+
public class AvailabilityForTablet {
3333
private final TabletId tabletId;
34-
private final TabletHostingGoal hostingGoal;
34+
private final TabletAvailability tabletAvailability;
3535

36-
public HostingGoalForTablet(TabletId tabletId, TabletHostingGoal hostingGoal) {
36+
public AvailabilityForTablet(TabletId tabletId, TabletAvailability tabletAvailability) {
3737
this.tabletId = tabletId;
38-
this.hostingGoal = hostingGoal;
38+
this.tabletAvailability = tabletAvailability;
3939
}
4040

41-
public TabletHostingGoal getHostingGoal() {
42-
return hostingGoal;
41+
public TabletAvailability getTabletAvailability() {
42+
return tabletAvailability;
4343
}
4444

4545
public TabletId getTabletId() {
@@ -54,12 +54,12 @@ public boolean equals(Object o) {
5454
if (o == null || getClass() != o.getClass()) {
5555
return false;
5656
}
57-
HostingGoalForTablet that = (HostingGoalForTablet) o;
58-
return Objects.equals(tabletId, that.tabletId) && hostingGoal == that.hostingGoal;
57+
AvailabilityForTablet that = (AvailabilityForTablet) o;
58+
return Objects.equals(tabletId, that.tabletId) && tabletAvailability == that.tabletAvailability;
5959
}
6060

6161
@Override
6262
public int hashCode() {
63-
return Objects.hash(tabletId, hostingGoal);
63+
return Objects.hash(tabletId, tabletAvailability);
6464
}
6565
}

core/src/main/java/org/apache/accumulo/core/client/admin/NewTableConfiguration.java

+8-7
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public class NewTableConfiguration {
7272
private Map<String,String> localityProps = Collections.emptyMap();
7373
private final Map<String,String> iteratorProps = new HashMap<>();
7474
private SortedSet<Text> splitProps = Collections.emptySortedSet();
75-
private TabletHostingGoal initialHostingGoal = TabletHostingGoal.ONDEMAND;
75+
private TabletAvailability initialTabletAvailability = TabletAvailability.ONDEMAND;
7676

7777
private void checkDisjoint(Map<String,String> props, Map<String,String> derivedProps,
7878
String kind) {
@@ -317,21 +317,22 @@ public NewTableConfiguration attachIterator(IteratorSetting setting,
317317
}
318318

319319
/**
320-
* Sets the initial tablet hosting goal for all tablets. If not set, the default is
321-
* {@link TabletHostingGoal#ONDEMAND}
320+
* Sets the initial tablet availability for all tablets. If not set, the default is
321+
* {@link TabletAvailability#ONDEMAND}
322322
*
323323
* @since 4.0.0
324324
*/
325-
public NewTableConfiguration withInitialHostingGoal(final TabletHostingGoal goal) {
326-
this.initialHostingGoal = goal;
325+
public NewTableConfiguration
326+
withInitialTabletAvailability(final TabletAvailability tabletAvailability) {
327+
this.initialTabletAvailability = tabletAvailability;
327328
return this;
328329
}
329330

330331
/**
331332
* @since 4.0.0
332333
*/
333-
public TabletHostingGoal getInitialHostingGoal() {
334-
return this.initialHostingGoal;
334+
public TabletAvailability getInitialTabletAvailability() {
335+
return this.initialTabletAvailability;
335336
}
336337

337338
/**

core/src/main/java/org/apache/accumulo/core/client/admin/TableOperations.java

+7-6
Original file line numberDiff line numberDiff line change
@@ -1009,17 +1009,18 @@ default TimeType getTimeType(String tableName) throws TableNotFoundException {
10091009
}
10101010

10111011
/**
1012-
* Sets the hosting goal for a range of Tablets in the specified table, but does not wait for the
1013-
* tablets to reach this goal state. For the Range parameter, note that the Row portion of the
1014-
* start and end Keys and the inclusivity parameters are used when determining the range of
1015-
* affected tablets. The other portions of the start and end Keys are not used.
1012+
* Sets the tablet availability for a range of Tablets in the specified table, but does not wait
1013+
* for the tablets to reach this availability state. For the Range parameter, note that the Row
1014+
* portion of the start and end Keys and the inclusivity parameters are used when determining the
1015+
* range of affected tablets. The other portions of the start and end Keys are not used.
10161016
*
10171017
* @param tableName table name
10181018
* @param range tablet range
1019-
* @param goal hosting goal
1019+
* @param tabletAvailability tablet availability
10201020
* @since 4.0.0
10211021
*/
1022-
default void setTabletHostingGoal(String tableName, Range range, TabletHostingGoal goal)
1022+
default void setTabletAvailability(String tableName, Range range,
1023+
TabletAvailability tabletAvailability)
10231024
throws AccumuloSecurityException, AccumuloException, TableNotFoundException {
10241025
throw new UnsupportedOperationException();
10251026
}

core/src/main/java/org/apache/accumulo/core/client/admin/TabletHostingGoal.java core/src/main/java/org/apache/accumulo/core/client/admin/TabletAvailability.java

+14-8
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,25 @@
1919
package org.apache.accumulo.core.client.admin;
2020

2121
/**
22-
* @see TableOperations#setTabletHostingGoal(String, org.apache.accumulo.core.data.Range,
23-
* TabletHostingGoal)
22+
* @see TableOperations#setTabletAvailability(String, org.apache.accumulo.core.data.Range,
23+
* TabletAvailability)
2424
* @since 4.0.0
2525
*/
26-
public enum TabletHostingGoal {
26+
public enum TabletAvailability {
2727

28-
// Signifies that a Tablet should always be hosted
29-
ALWAYS,
28+
/**
29+
* Signifies that a Tablet should always be hosted on a tablet server.
30+
*/
31+
HOSTED,
3032

31-
// Signifies that a Tablet should be hosted on client request
33+
/**
34+
* Signifies that a Tablet should be hosted on a tablet server when a client needs it.
35+
*/
3236
ONDEMAND,
3337

34-
// Signifies that a Tablet should never be hosted
35-
NEVER;
38+
/**
39+
* Signifies that a Tablet should never be hosted on a tablet server.
40+
*/
41+
UNHOSTED;
3642

3743
}

core/src/main/java/org/apache/accumulo/core/client/admin/TabletInformation.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ public interface TabletInformation {
6969
String getTabletDir();
7070

7171
/**
72-
* @return the tablet hosting goal.
72+
* @return the TabletAvailability object.
7373
*/
74-
TabletHostingGoal getHostingGoal();
74+
TabletAvailability getTabletAvailability();
7575

7676
}

core/src/main/java/org/apache/accumulo/core/clientImpl/ClientTabletCache.java

+20-17
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
import org.apache.accumulo.core.client.AccumuloSecurityException;
3535
import org.apache.accumulo.core.client.InvalidTabletHostingRequestException;
3636
import org.apache.accumulo.core.client.TableNotFoundException;
37-
import org.apache.accumulo.core.client.admin.TabletHostingGoal;
37+
import org.apache.accumulo.core.client.admin.TabletAvailability;
3838
import org.apache.accumulo.core.data.InstanceId;
3939
import org.apache.accumulo.core.data.Mutation;
4040
import org.apache.accumulo.core.data.Range;
@@ -52,7 +52,7 @@
5252

5353
/**
5454
* Client side cache of information about Tablets. Currently, a tablet prev end row is cached and
55-
* locations are cached if they exists.
55+
* locations are cached if they exist.
5656
*/
5757
public abstract class ClientTabletCache {
5858

@@ -308,39 +308,40 @@ public static class CachedTablet {
308308
private final KeyExtent tablet_extent;
309309
private final String tserverLocation;
310310
private final String tserverSession;
311-
private final TabletHostingGoal goal;
311+
private final TabletAvailability availability;
312312
private final boolean hostingRequested;
313313

314314
private final Long creationTime = System.nanoTime();
315315

316316
public CachedTablet(KeyExtent tablet_extent, String tablet_location, String session,
317-
TabletHostingGoal goal, boolean hostingRequested) {
317+
TabletAvailability availability, boolean hostingRequested) {
318318
checkArgument(tablet_extent != null, "tablet_extent is null");
319319
checkArgument(tablet_location != null, "tablet_location is null");
320320
checkArgument(session != null, "session is null");
321321
this.tablet_extent = tablet_extent;
322322
this.tserverLocation = interner.intern(tablet_location);
323323
this.tserverSession = interner.intern(session);
324-
this.goal = Objects.requireNonNull(goal);
324+
this.availability = Objects.requireNonNull(availability);
325325
this.hostingRequested = hostingRequested;
326326
}
327327

328328
public CachedTablet(KeyExtent tablet_extent, Optional<String> tablet_location,
329-
Optional<String> session, TabletHostingGoal goal, boolean hostingRequested) {
329+
Optional<String> session, TabletAvailability availability, boolean hostingRequested) {
330330
checkArgument(tablet_extent != null, "tablet_extent is null");
331331
this.tablet_extent = tablet_extent;
332332
this.tserverLocation = tablet_location.map(interner::intern).orElse(null);
333333
this.tserverSession = session.map(interner::intern).orElse(null);
334-
this.goal = Objects.requireNonNull(goal);
334+
this.availability = Objects.requireNonNull(availability);
335335
this.hostingRequested = hostingRequested;
336336
}
337337

338-
public CachedTablet(KeyExtent tablet_extent, TabletHostingGoal goal, boolean hostingRequested) {
338+
public CachedTablet(KeyExtent tablet_extent, TabletAvailability availability,
339+
boolean hostingRequested) {
339340
checkArgument(tablet_extent != null, "tablet_extent is null");
340341
this.tablet_extent = tablet_extent;
341342
this.tserverLocation = null;
342343
this.tserverSession = null;
343-
this.goal = Objects.requireNonNull(goal);
344+
this.availability = Objects.requireNonNull(availability);
344345
this.hostingRequested = hostingRequested;
345346
}
346347

@@ -350,21 +351,23 @@ public boolean equals(Object o) {
350351
CachedTablet otl = (CachedTablet) o;
351352
return getExtent().equals(otl.getExtent())
352353
&& getTserverLocation().equals(otl.getTserverLocation())
353-
&& getTserverSession().equals(otl.getTserverSession()) && getGoal() == otl.getGoal()
354+
&& getTserverSession().equals(otl.getTserverSession())
355+
&& getAvailability() == otl.getAvailability()
354356
&& hostingRequested == otl.hostingRequested;
355357
}
356358
return false;
357359
}
358360

359361
@Override
360362
public int hashCode() {
361-
return Objects.hash(getExtent(), tserverLocation, tserverSession, goal, hostingRequested);
363+
return Objects.hash(getExtent(), tserverLocation, tserverSession, availability,
364+
hostingRequested);
362365
}
363366

364367
@Override
365368
public String toString() {
366369
return "(" + getExtent() + "," + getTserverLocation() + "," + getTserverSession() + ","
367-
+ getGoal() + ")";
370+
+ getAvailability() + ")";
368371
}
369372

370373
public KeyExtent getExtent() {
@@ -381,12 +384,12 @@ public Optional<String> getTserverSession() {
381384

382385
/**
383386
* The ClientTabletCache will remove and replace a CachedTablet when the location is no longer
384-
* valid. However, it will not do the same when the goal is no longer valid. The goal returned
385-
* by this method may be out of date. If this information is needed to be fresh, then you may
386-
* want to consider clearing the cache first.
387+
* valid. However, it will not do the same when the availability is no longer valid. The
388+
* availability returned by this method may be out of date. If this information is needed to be
389+
* fresh, then you may want to consider clearing the cache first.
387390
*/
388-
public TabletHostingGoal getGoal() {
389-
return this.goal;
391+
public TabletAvailability getAvailability() {
392+
return this.availability;
390393
}
391394

392395
public Duration getAge() {

0 commit comments

Comments
 (0)