dlmarion commented on code in PR #4816:
URL: https://github.com/apache/accumulo/pull/4816#discussion_r2052925525


##########
core/src/main/java/org/apache/accumulo/core/client/rfile/RFileScanner.java:
##########
@@ -335,6 +355,70 @@ public boolean isSamplingEnabled() {
     public SamplerConfiguration getSamplerConfiguration() {
       return RFileScanner.this.getSamplerConfiguration();
     }
+
+    /**
+     * This method only exists to be used as described in {@link 
IteratorEnvironment#getPluginEnv()}
+     * so the table config can be obtained. This simply returns null since a 
table id does not make
+     * sense in the context of scanning RFiles, but is needed to obtain the 
table configuration.
+     *
+     * @return null
+     */
+    @Override
+    public TableId getTableId() {
+      return null;
+    }
+
+    @Override
+    @Deprecated(since = "2.0.0")
+    public AccumuloConfiguration getConfig() {
+      return tableConf;
+    }
+
+    @Override
+    @Deprecated(since = "2.1.0")
+    public ServiceEnvironment getServiceEnv() {
+      return serviceEnvironment.get();
+    }
+
+    @Override
+    public PluginEnvironment getPluginEnv() {
+      return serviceEnvironment.get();
+    }
+
+    private ServiceEnvironment createServiceEnv() {
+      return new ServiceEnvironment() {
+        @Override
+        public <T> T instantiate(TableId tableId, String className, Class<T> 
base)
+            throws ReflectiveOperationException {
+          return instantiate(className, base);
+        }
+
+        @Override
+        public <T> T instantiate(String className, Class<T> base)
+            throws ReflectiveOperationException {
+          return 
this.getClass().getClassLoader().loadClass(className).asSubclass(base)
+              .getDeclaredConstructor().newInstance();
+        }
+
+        @Override
+        public String getTableName(TableId tableId) {
+          throw new UnsupportedOperationException(errorMsg);
+        }
+
+        @Override
+        public Configuration getConfiguration(TableId tableId) {
+          Preconditions.checkArgument(tableId == getTableId(),

Review Comment:
   `getTableId` above only returns `null`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to