Skip to content

Commit

Permalink
Replace nonpublic Accumulo SingletonReservation with suggested altern…
Browse files Browse the repository at this point in the history
…ative (#2527)

* Replace SingletonReservation.noop() with SingletonManager.getClientReservation()

---------

Co-authored-by: Ivan Bella <ivan@bella.name>
  • Loading branch information
SethSmucker and ivakegg authored Oct 21, 2024
1 parent ddd9be0 commit 9587b6c
Showing 1 changed file with 5 additions and 4 deletions.
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

0 comments on commit 9587b6c

Please sign in to comment.