From 60610f37f9ed79b63737f378dcc7a17c508f8419 Mon Sep 17 00:00:00 2001 From: Seth Date: Fri, 16 Aug 2024 15:19:01 -0400 Subject: [PATCH 1/3] Replace SingletonReservation.noop() with SingletonManager.getClientReservation() --- .../core/src/main/java/datawave/mr/bulk/BulkInputFormat.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java index 1e814a23eb3..4a2affe64d3 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java @@ -54,6 +54,7 @@ import org.apache.accumulo.core.metadata.schema.MetadataSchema; import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.TablePermission; +import org.apache.accumulo.core.singletons.SingletonManager; import org.apache.accumulo.core.singletons.SingletonReservation; import org.apache.accumulo.core.util.Pair; import org.apache.accumulo.core.util.format.DefaultFormatter; @@ -1085,7 +1086,7 @@ 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)); } @@ -1126,7 +1127,7 @@ public List 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()), + ClientContext context = new ClientContext(SingletonManager.getClientReservation(), info, ClientConfConverter.toAccumuloConf(info.getProperties()), Threads.UEH); while (!tl.binRanges(context, ranges, binnedRanges).isEmpty()) { if (!(client instanceof InMemoryAccumuloClient)) { From 0eade767c5a16741fc323d53534aa1f50a6b3e3e Mon Sep 17 00:00:00 2001 From: Seth Date: Fri, 16 Aug 2024 15:38:43 -0400 Subject: [PATCH 2/3] Formatting --- .../src/main/java/datawave/mr/bulk/BulkInputFormat.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java index 4a2affe64d3..bca194c5c4f 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java @@ -1086,7 +1086,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(SingletonManager.getClientReservation(), 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)); } @@ -1127,8 +1128,8 @@ public List 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(SingletonManager.getClientReservation(), 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) From 510f921dfe9f5a41e29ba8d885b5cb5e72a7f69c Mon Sep 17 00:00:00 2001 From: Seth Date: Thu, 22 Aug 2024 14:20:29 -0400 Subject: [PATCH 3/3] Remove unused import --- .../core/src/main/java/datawave/mr/bulk/BulkInputFormat.java | 1 - 1 file changed, 1 deletion(-) diff --git a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java index bca194c5c4f..11d87b5248c 100644 --- a/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java +++ b/warehouse/core/src/main/java/datawave/mr/bulk/BulkInputFormat.java @@ -55,7 +55,6 @@ import org.apache.accumulo.core.security.Authorizations; import org.apache.accumulo.core.security.TablePermission; import org.apache.accumulo.core.singletons.SingletonManager; -import org.apache.accumulo.core.singletons.SingletonReservation; import org.apache.accumulo.core.util.Pair; import org.apache.accumulo.core.util.format.DefaultFormatter; import org.apache.accumulo.core.util.threads.Threads;