Skip to content
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

Replace nonpublic Accumulo SingletonReservation with suggested alternative #2527

Merged
merged 9 commits into from
Oct 21, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
import org.apache.accumulo.core.security.Authorizations;
import org.apache.accumulo.core.security.ColumnVisibility;
import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.singletons.SingletonReservation;
import org.apache.accumulo.core.singletons.SingletonManager;
import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.core.util.format.DateFormatSupplier;
import org.apache.accumulo.core.util.format.DefaultFormatter;
Expand Down Expand Up @@ -1091,7 +1091,8 @@ protected static TabletLocator getTabletLocator(Configuration conf) throws Table
Properties props = Accumulo.newClientProperties().to(conf.get(INSTANCE_NAME), conf.get(ZOOKEEPERS))
.as(getUsername(conf), new PasswordToken(getPassword(conf))).build();
ClientInfo info = ClientInfo.from(props);
ClientContext context = new ClientContext(SingletonReservation.noop(), info, ClientConfConverter.toAccumuloConf(info.getProperties()), Threads.UEH);
ClientContext context = new ClientContext(SingletonManager.getClientReservation(), info, ClientConfConverter.toAccumuloConf(info.getProperties()),
Threads.UEH);
return TabletLocator.getLocator(context, context.getTableId(tableName));
}

Expand Down Expand Up @@ -1132,8 +1133,8 @@ public List<InputSplit> getSplits(JobContext job) throws IOException {
// its possible that the cache could contain complete, but old information about a tables tablets... so clear it
tl.invalidateCache();
ClientInfo info = ClientInfo.from(cbHelper.newClientProperties());
ClientContext context = new ClientContext(SingletonReservation.noop(), info, ClientConfConverter.toAccumuloConf(info.getProperties()),
Threads.UEH);
ClientContext context = new ClientContext(SingletonManager.getClientReservation(), info,
ClientConfConverter.toAccumuloConf(info.getProperties()), Threads.UEH);
while (!tl.binRanges(context, ranges, binnedRanges).isEmpty()) {
if (!(client instanceof InMemoryAccumuloClient)) {
if (tableId == null)
Expand Down
Loading