You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by dl...@apache.org on 2015/11/17 19:33:56 UTC

[1/3] accumulo git commit: ACCUMULO-3948: Add ability to set contextClassLoader on Scanners and BatchScanners

Repository: accumulo
Updated Branches:
  refs/heads/master 3521b35a1 -> 0e1da5a58


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
index 83d87b3..7e87c99 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/SessionManager.java
@@ -279,7 +279,7 @@ public class SessionManager {
 
         ActiveScan activeScan = new ActiveScan(ss.client, ss.getUser(), ss.extent.getTableId().toString(), ct - ss.startTime, ct - ss.lastAccessTime,
             ScanType.SINGLE, state, ss.extent.toThrift(), Translator.translate(ss.columnSet, Translators.CT), ss.ssiList, ss.ssio,
-            ss.auths.getAuthorizationsBB());
+            ss.auths.getAuthorizationsBB(), ss.context);
 
         // scanId added by ACCUMULO-2641 is an optional thrift argument and not available in ActiveScan constructor
         activeScan.setScanId(entry.getKey());
@@ -310,7 +310,7 @@ public class SessionManager {
 
         activeScans.add(new ActiveScan(mss.client, mss.getUser(), mss.threadPoolExtent.getTableId().toString(), ct - mss.startTime, ct - mss.lastAccessTime,
             ScanType.BATCH, state, mss.threadPoolExtent.toThrift(), Translator.translate(mss.columnSet, Translators.CT), mss.ssiList, mss.ssio, mss.auths
-                .getAuthorizationsBB()));
+                .getAuthorizationsBB(), mss.context));
       }
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
index 72c289c..8f61b9d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanDataSource.java
@@ -69,10 +69,10 @@ class ScanDataSource implements DataSource {
   private final ScanOptions options;
 
   ScanDataSource(Tablet tablet, Authorizations authorizations, byte[] defaultLabels, HashSet<Column> columnSet, List<IterInfo> ssiList,
-      Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut) {
+      Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut, String context) {
     this.tablet = tablet;
     expectedDeletionCount = tablet.getDataSourceDeletions();
-    this.options = new ScanOptions(-1, authorizations, defaultLabels, columnSet, ssiList, ssio, interruptFlag, false, samplerConfig, batchTimeOut);
+    this.options = new ScanOptions(-1, authorizations, defaultLabels, columnSet, ssiList, ssio, interruptFlag, false, samplerConfig, batchTimeOut, context);
     this.interruptFlag = interruptFlag;
   }
 
@@ -178,8 +178,13 @@ class ScanDataSource implements DataSource {
 
     VisibilityFilter visFilter = new VisibilityFilter(colFilter, options.getAuthorizations(), options.getDefaultLabels());
 
-    return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
-        options.getSsiList(), options.getSsio(), iterEnv));
+    if (null == options.getClassLoaderContext()) {
+      return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
+          options.getSsiList(), options.getSsio(), iterEnv));
+    } else {
+      return iterEnv.getTopLevelIterator(IteratorUtil.loadIterators(IteratorScope.scan, visFilter, tablet.getExtent(), tablet.getTableConfiguration(),
+          options.getSsiList(), options.getSsio(), iterEnv, true, options.getClassLoaderContext()));
+    }
   }
 
   void close(boolean sawErrors) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
index c97f3ac..2e2445a 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/ScanOptions.java
@@ -39,9 +39,10 @@ final class ScanOptions {
   private final boolean isolated;
   private SamplerConfiguration samplerConfig;
   private final long batchTimeOut;
+  private String classLoaderContext;
 
   ScanOptions(int num, Authorizations authorizations, byte[] defaultLabels, Set<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
-      AtomicBoolean interruptFlag, boolean isolated, SamplerConfiguration samplerConfig, long batchTimeOut) {
+      AtomicBoolean interruptFlag, boolean isolated, SamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) {
     this.num = num;
     this.authorizations = authorizations;
     this.defaultLabels = defaultLabels;
@@ -52,6 +53,7 @@ final class ScanOptions {
     this.isolated = isolated;
     this.samplerConfig = samplerConfig;
     this.batchTimeOut = batchTimeOut;
+    this.classLoaderContext = classLoaderContext;
   }
 
   public Authorizations getAuthorizations() {
@@ -99,4 +101,12 @@ final class ScanOptions {
   public long getBatchTimeOut() {
     return batchTimeOut;
   }
+
+  public String getClassLoaderContext() {
+    return classLoaderContext;
+  }
+
+  public void setClassLoaderContext(String context) {
+    this.classLoaderContext = context;
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
index 1f66302..de3bfd3 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Tablet.java
@@ -633,8 +633,8 @@ public class Tablet implements TabletCommitter {
   }
 
   public LookupResult lookup(List<Range> ranges, HashSet<Column> columns, Authorizations authorizations, List<KVEntry> results, long maxResultSize,
-      List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut)
-      throws IOException {
+      List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut,
+      String classLoaderContext) throws IOException {
 
     if (ranges.size() == 0) {
       return new LookupResult();
@@ -653,7 +653,7 @@ public class Tablet implements TabletCommitter {
     }
 
     ScanDataSource dataSource = new ScanDataSource(this, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, samplerConfig,
-        batchTimeOut);
+        batchTimeOut, classLoaderContext);
 
     LookupResult result = null;
 
@@ -757,13 +757,14 @@ public class Tablet implements TabletCommitter {
   }
 
   public Scanner createScanner(Range range, int num, Set<Column> columns, Authorizations authorizations, List<IterInfo> ssiList,
-      Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut) {
+      Map<String,Map<String,String>> ssio, boolean isolated, AtomicBoolean interruptFlag, SamplerConfiguration samplerConfig, long batchTimeOut,
+      String classLoaderContext) {
     // do a test to see if this range falls within the tablet, if it does not
     // then clip will throw an exception
     extent.toDataRange().clip(range);
 
     ScanOptions opts = new ScanOptions(num, authorizations, this.defaultSecurityLabel, columns, ssiList, ssio, interruptFlag, isolated, samplerConfig,
-        batchTimeOut);
+        batchTimeOut, classLoaderContext);
     return new Scanner(this, range, opts);
   }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
index 595829b..c7ab1ff 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ScanCommand.java
@@ -63,6 +63,7 @@ public class ScanCommand extends Command {
   private Option timeoutOption;
   private Option profileOpt;
   private Option sampleOpt;
+  private Option contextOpt;
 
   protected void setupSampling(final String tableName, final CommandLine cl, final Shell shellState, ScannerBase scanner) throws TableNotFoundException,
       AccumuloException, AccumuloSecurityException {
@@ -84,11 +85,17 @@ public class ScanCommand extends Command {
     final Class<? extends Formatter> formatter = getFormatter(cl, tableName, shellState);
     final ScanInterpreter interpeter = getInterpreter(cl, tableName, shellState);
 
+    String classLoaderContext = null;
+    if (cl.hasOption(contextOpt.getOpt())) {
+      classLoaderContext = cl.getOptionValue(contextOpt.getOpt());
+    }
     // handle first argument, if present, the authorizations list to
     // scan with
     final Authorizations auths = getAuths(cl, shellState);
     final Scanner scanner = shellState.getConnector().createScanner(tableName, auths);
-
+    if (null != classLoaderContext) {
+      scanner.setClassLoaderContext(classLoaderContext);
+    }
     // handle session-specific scan iterators
     addScanIterators(shellState, cl, scanner, tableName);
 
@@ -316,6 +323,7 @@ public class ScanCommand extends Command {
         "time before scan should fail if no data is returned. If no unit is given assumes seconds.  Units d,h,m,s,and ms are supported.  e.g. 30s or 100ms");
     outputFileOpt = new Option("o", "output", true, "local file to write the scan output to");
     sampleOpt = new Option(null, "sample", false, "Show sample");
+    contextOpt = new Option("cc", "context", true, "name of the classloader context");
 
     scanOptAuths.setArgName("comma-separated-authorizations");
     scanOptRow.setArgName("row");
@@ -325,6 +333,7 @@ public class ScanCommand extends Command {
     formatterOpt.setArgName("className");
     timeoutOption.setArgName("timeout");
     outputFileOpt.setArgName("file");
+    contextOpt.setArgName("context");
 
     profileOpt = new Option("pn", "profile", true, "iterator profile name");
     profileOpt.setArgName("profile");
@@ -347,6 +356,7 @@ public class ScanCommand extends Command {
     o.addOption(outputFileOpt);
     o.addOption(profileOpt);
     o.addOption(sampleOpt);
+    o.addOption(contextOpt);
 
     return o;
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/pom.xml
----------------------------------------------------------------------
diff --git a/test/pom.xml b/test/pom.xml
index e88bcfb..01b27da 100644
--- a/test/pom.xml
+++ b/test/pom.xml
@@ -226,6 +226,25 @@
             </systemPropertyVariables>
           </configuration>
         </plugin>
+        <plugin>
+          <groupId>org.apache.maven.plugins</groupId>
+          <artifactId>maven-jar-plugin</artifactId>
+          <executions>
+            <execution>
+              <goals>
+                <goal>test-jar</goal>
+              </goals>
+              <phase>pre-integration-test</phase>
+              <configuration>
+                <finalName>TestIterators</finalName>
+                <classifier />
+                <includes>
+                  <include>org/apache/accumulo/test/functional/ValueReversingIterator.class</include>
+                </includes>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
       </plugins>
     </pluginManagement>
   </build>

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
index 60f802b..1b100f2 100644
--- a/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
+++ b/test/src/main/java/org/apache/accumulo/test/ShellServerIT.java
@@ -1723,6 +1723,97 @@ public class ShellServerIT extends SharedMiniClusterBase {
   }
 
   @Test
+  public void scansWithClassLoaderContext() throws Exception {
+    try {
+      Class.forName("org.apache.accumulo.test.functional.ValueReversingIterator");
+      fail("ValueReversingIterator already on the classpath");
+    } catch (Exception e) {
+      // Do nothing here, This is success. The following line is here
+      // so that findbugs doesn't have a stroke.
+      assertTrue(true);
+    }
+    ts.exec("createtable t");
+    make10();
+    setupFakeContextPath();
+    // Add the context to the table so that setscaniter works. After setscaniter succeeds, then
+    // remove the property from the table.
+    String output = ts.exec("config -s " + Property.VFS_CONTEXT_CLASSPATH_PROPERTY + FAKE_CONTEXT + "=" + FAKE_CONTEXT_CLASSPATH);
+    output = ts.exec("config -t t -s table.classpath.context=" + FAKE_CONTEXT);
+    output = ts.exec("setscaniter -n reverse -t t -p 21 -class org.apache.accumulo.test.functional.ValueReversingIterator");
+    String result = ts.exec("scan -np -b row1 -e row1");
+    assertEquals(2, result.split("\n").length);
+    log.error(result);
+    assertTrue(result.contains("value"));
+    result = ts.exec("scan -np -b row3 -e row5");
+    assertEquals(4, result.split("\n").length);
+    assertTrue(result.contains("value"));
+    result = ts.exec("scan -np -r row3");
+    assertEquals(2, result.split("\n").length);
+    assertTrue(result.contains("value"));
+    result = ts.exec("scan -np -b row:");
+    assertEquals(1, result.split("\n").length);
+    result = ts.exec("scan -np -b row");
+    assertEquals(11, result.split("\n").length);
+    assertTrue(result.contains("value"));
+    result = ts.exec("scan -np -e row:");
+    assertEquals(11, result.split("\n").length);
+    assertTrue(result.contains("value"));
+
+    setupRealContextPath();
+    output = ts.exec("config -s " + Property.VFS_CONTEXT_CLASSPATH_PROPERTY + REAL_CONTEXT + "=" + REAL_CONTEXT_CLASSPATH);
+    result = ts.exec("scan -np -b row1 -e row1 -cc " + REAL_CONTEXT);
+    log.error(result);
+    assertEquals(2, result.split("\n").length);
+    assertTrue(result.contains("eulav"));
+    assertFalse(result.contains("value"));
+    result = ts.exec("scan -np -b row3 -e row5 -cc " + REAL_CONTEXT);
+    assertEquals(4, result.split("\n").length);
+    assertTrue(result.contains("eulav"));
+    assertFalse(result.contains("value"));
+    result = ts.exec("scan -np -r row3 -cc " + REAL_CONTEXT);
+    assertEquals(2, result.split("\n").length);
+    assertTrue(result.contains("eulav"));
+    assertFalse(result.contains("value"));
+    result = ts.exec("scan -np -b row: -cc " + REAL_CONTEXT);
+    assertEquals(1, result.split("\n").length);
+    result = ts.exec("scan -np -b row -cc " + REAL_CONTEXT);
+    assertEquals(11, result.split("\n").length);
+    assertTrue(result.contains("eulav"));
+    assertFalse(result.contains("value"));
+    result = ts.exec("scan -np -e row: -cc " + REAL_CONTEXT);
+    assertEquals(11, result.split("\n").length);
+    assertTrue(result.contains("eulav"));
+    assertFalse(result.contains("value"));
+    ts.exec("deletetable -f t");
+  }
+
+  private static final String FAKE_CONTEXT = "FAKE";
+  private static final String FAKE_CONTEXT_CLASSPATH = "file:///tmp/ShellServerIT-iterators.jar";
+  private static final String REAL_CONTEXT = "REAL";
+  private static final String REAL_CONTEXT_CLASSPATH = "file:///tmp/TestIterators-tests.jar";
+
+  private void setupRealContextPath() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path jarPath = new Path(targetDir, "TestIterators-tests.jar");
+    Path dstPath = new Path(REAL_CONTEXT_CLASSPATH);
+    FileSystem fs = SharedMiniClusterBase.getCluster().getFileSystem();
+    fs.copyFromLocalFile(jarPath, dstPath);
+  }
+
+  private void setupFakeContextPath() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path classesDir = new Path(targetDir, "classes");
+    Path jarPath = new Path(classesDir, "ShellServerIT-iterators.jar");
+    Path dstPath = new Path(FAKE_CONTEXT_CLASSPATH);
+    FileSystem fs = SharedMiniClusterBase.getCluster().getFileSystem();
+    fs.copyFromLocalFile(jarPath, dstPath);
+  }
+
+  @Test
   public void whoami() throws Exception {
     AuthenticationToken token = getToken();
     assertTrue(ts.exec("whoami", true).contains(getPrincipal()));

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/src/main/java/org/apache/accumulo/test/functional/ScannerContextIT.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/functional/ScannerContextIT.java b/test/src/main/java/org/apache/accumulo/test/functional/ScannerContextIT.java
new file mode 100644
index 0000000..cc581f8
--- /dev/null
+++ b/test/src/main/java/org/apache/accumulo/test/functional/ScannerContextIT.java
@@ -0,0 +1,341 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.test.functional;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.Map.Entry;
+
+import org.apache.accumulo.core.client.BatchScanner;
+import org.apache.accumulo.core.client.BatchWriter;
+import org.apache.accumulo.core.client.BatchWriterConfig;
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.Scanner;
+import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Mutation;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.util.CachedConfiguration;
+import org.apache.accumulo.fate.util.UtilWaitThread;
+import org.apache.accumulo.harness.AccumuloClusterHarness;
+import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.hamcrest.CoreMatchers;
+import org.junit.Assume;
+import org.junit.Before;
+import org.junit.Test;
+
+public class ScannerContextIT extends AccumuloClusterHarness {
+
+  private static final String CONTEXT = ScannerContextIT.class.getSimpleName();
+  private static final String CONTEXT_PROPERTY = Property.VFS_CONTEXT_CLASSPATH_PROPERTY + CONTEXT;
+  private static final String CONTEXT_DIR = "file:///tmp";
+  private static final String CONTEXT_CLASSPATH = CONTEXT_DIR + "/Test.jar";
+  private static int ITERATIONS = 10;
+  private static final long WAIT = 7000;
+
+  private FileSystem fs;
+
+  @Override
+  protected int defaultTimeoutSeconds() {
+    return 2 * 60;
+  }
+
+  @Before
+  public void checkCluster() throws Exception {
+    Assume.assumeThat(getClusterType(), CoreMatchers.is(ClusterType.MINI));
+    MiniAccumuloClusterImpl mac = (MiniAccumuloClusterImpl) getCluster();
+    fs = FileSystem.get(CachedConfiguration.getInstance());
+  }
+
+  @Test
+  public void test() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path jarPath = new Path(targetDir, "TestIterators-tests.jar");
+    Path dstPath = new Path(CONTEXT_DIR + "/Test.jar");
+    fs.copyFromLocalFile(jarPath, dstPath);
+    // Sleep to ensure jar change gets picked up
+    UtilWaitThread.sleep(WAIT);
+
+    try {
+      Connector c = getConnector();
+      // Set the classloader context property on the table to point to the TestIterators jar file.
+      c.instanceOperations().setProperty(CONTEXT_PROPERTY, CONTEXT_CLASSPATH);
+
+      // Insert rows with the word "Test" in the value.
+      String tableName = getUniqueNames(1)[0];
+      c.tableOperations().create(tableName);
+      BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
+      for (int i = 0; i < ITERATIONS; i++) {
+        Mutation m = new Mutation("row" + i);
+        m.put("cf", "col1", "Test");
+        bw.addMutation(m);
+      }
+      bw.close();
+      // Ensure that we can get the data back
+      scanCheck(c, tableName, null, null, "Test");
+      batchCheck(c, tableName, null, null, "Test");
+
+      // This iterator is in the TestIterators jar file
+      IteratorSetting cfg = new IteratorSetting(21, "reverse", "org.apache.accumulo.test.functional.ValueReversingIterator");
+
+      // Check that ValueReversingIterator is not already on the classpath by not setting the context. This should fail.
+      try {
+        scanCheck(c, tableName, cfg, null, "tseT");
+        fail("This should have failed because context was not set");
+      } catch (Exception e) {
+        // Do nothing, this should fail as the classloader context is not set.
+      }
+      try {
+        batchCheck(c, tableName, cfg, null, "tseT");
+        fail("This should have failed because context was not set");
+      } catch (Exception e) {
+        // Do nothing, this should fail as the classloader context is not set.
+      }
+
+      // Ensure that the value is reversed using the iterator config and classloader context
+      scanCheck(c, tableName, cfg, CONTEXT, "tseT");
+      batchCheck(c, tableName, cfg, CONTEXT, "tseT");
+    } finally {
+      // Delete file in tmp
+      fs.delete(dstPath, true);
+    }
+  }
+
+  @Test
+  public void testScanContextOverridesTableContext() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path jarPath = new Path(targetDir, "TestIterators-tests.jar");
+    Path dstPath = new Path(CONTEXT_DIR + "/Test.jar");
+    fs.copyFromLocalFile(jarPath, dstPath);
+    // Sleep to ensure jar change gets picked up
+    UtilWaitThread.sleep(WAIT);
+
+    try {
+      Connector c = getConnector();
+      // Create two contexts FOO and ScanContextIT. The FOO context will point to a classpath
+      // that contains nothing. The ScanContextIT context will point to the TestIterators.jar
+      String tableContext = "FOO";
+      String tableContextProperty = Property.VFS_CONTEXT_CLASSPATH_PROPERTY + tableContext;
+      String tableContextDir = "file:///tmp";
+      String tableContextClasspath = tableContextDir + "/TestFoo.jar";
+      // Define both contexts
+      c.instanceOperations().setProperty(tableContextProperty, tableContextClasspath);
+      c.instanceOperations().setProperty(CONTEXT_PROPERTY, CONTEXT_CLASSPATH);
+
+      String tableName = getUniqueNames(1)[0];
+      c.tableOperations().create(tableName);
+      // Set the FOO context on the table
+      c.tableOperations().setProperty(tableName, Property.TABLE_CLASSPATH.getKey(), tableContext);
+      BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
+      for (int i = 0; i < ITERATIONS; i++) {
+        Mutation m = new Mutation("row" + i);
+        m.put("cf", "col1", "Test");
+        bw.addMutation(m);
+      }
+      bw.close();
+      scanCheck(c, tableName, null, null, "Test");
+      batchCheck(c, tableName, null, null, "Test");
+      // This iterator is in the TestIterators jar file
+      IteratorSetting cfg = new IteratorSetting(21, "reverse", "org.apache.accumulo.test.functional.ValueReversingIterator");
+
+      // Check that ValueReversingIterator is not already on the classpath by not setting the context. This should fail.
+      try {
+        scanCheck(c, tableName, cfg, null, "tseT");
+        fail("This should have failed because context was not set");
+      } catch (Exception e) {
+        // Do nothing, this should fail as the classloader context is not set.
+      }
+      try {
+        batchCheck(c, tableName, cfg, null, "tseT");
+        fail("This should have failed because context was not set");
+      } catch (Exception e) {
+        // Do nothing, this should fail as the classloader context is not set.
+      }
+
+      // Ensure that the value is reversed using the iterator config and classloader context
+      scanCheck(c, tableName, cfg, CONTEXT, "tseT");
+      batchCheck(c, tableName, cfg, CONTEXT, "tseT");
+    } finally {
+      // Delete file in tmp
+      fs.delete(dstPath, true);
+    }
+
+  }
+
+  @Test
+  public void testOneScannerDoesntInterfereWithAnother() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path jarPath = new Path(targetDir, "TestIterators-tests.jar");
+    Path dstPath = new Path(CONTEXT_DIR + "/Test.jar");
+    fs.copyFromLocalFile(jarPath, dstPath);
+    // Sleep to ensure jar change gets picked up
+    UtilWaitThread.sleep(WAIT);
+
+    try {
+      Connector c = getConnector();
+      // Set the classloader context property on the table to point to the TestIterators jar file.
+      c.instanceOperations().setProperty(CONTEXT_PROPERTY, CONTEXT_CLASSPATH);
+
+      // Insert rows with the word "Test" in the value.
+      String tableName = getUniqueNames(1)[0];
+      c.tableOperations().create(tableName);
+      BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
+      for (int i = 0; i < ITERATIONS; i++) {
+        Mutation m = new Mutation("row" + i);
+        m.put("cf", "col1", "Test");
+        bw.addMutation(m);
+      }
+      bw.close();
+
+      Scanner one = c.createScanner(tableName, Authorizations.EMPTY);
+
+      Scanner two = c.createScanner(tableName, Authorizations.EMPTY);
+
+      IteratorSetting cfg = new IteratorSetting(21, "reverse", "org.apache.accumulo.test.functional.ValueReversingIterator");
+      one.addScanIterator(cfg);
+      one.setClassLoaderContext(CONTEXT);
+
+      Iterator<Entry<Key,Value>> iterator = one.iterator();
+      for (int i = 0; i < ITERATIONS; i++) {
+        assertTrue(iterator.hasNext());
+        Entry<Key,Value> next = iterator.next();
+        assertEquals("tseT", next.getValue().toString());
+      }
+
+      Iterator<Entry<Key,Value>> iterator2 = two.iterator();
+      for (int i = 0; i < ITERATIONS; i++) {
+        assertTrue(iterator2.hasNext());
+        Entry<Key,Value> next = iterator2.next();
+        assertEquals("Test", next.getValue().toString());
+      }
+
+    } finally {
+      // Delete file in tmp
+      fs.delete(dstPath, true);
+    }
+  }
+
+  @Test
+  public void testClearContext() throws Exception {
+    // Copy the TestIterators jar to tmp
+    Path baseDir = new Path(System.getProperty("user.dir"));
+    Path targetDir = new Path(baseDir, "target");
+    Path jarPath = new Path(targetDir, "TestIterators-tests.jar");
+    Path dstPath = new Path(CONTEXT_DIR + "/Test.jar");
+    fs.copyFromLocalFile(jarPath, dstPath);
+    // Sleep to ensure jar change gets picked up
+    UtilWaitThread.sleep(WAIT);
+
+    try {
+      Connector c = getConnector();
+      // Set the classloader context property on the table to point to the TestIterators jar file.
+      c.instanceOperations().setProperty(CONTEXT_PROPERTY, CONTEXT_CLASSPATH);
+
+      // Insert rows with the word "Test" in the value.
+      String tableName = getUniqueNames(1)[0];
+      c.tableOperations().create(tableName);
+      BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
+      for (int i = 0; i < ITERATIONS; i++) {
+        Mutation m = new Mutation("row" + i);
+        m.put("cf", "col1", "Test");
+        bw.addMutation(m);
+      }
+      bw.close();
+
+      Scanner one = c.createScanner(tableName, Authorizations.EMPTY);
+      IteratorSetting cfg = new IteratorSetting(21, "reverse", "org.apache.accumulo.test.functional.ValueReversingIterator");
+      one.addScanIterator(cfg);
+      one.setClassLoaderContext(CONTEXT);
+
+      Iterator<Entry<Key,Value>> iterator = one.iterator();
+      for (int i = 0; i < ITERATIONS; i++) {
+        assertTrue(iterator.hasNext());
+        Entry<Key,Value> next = iterator.next();
+        assertEquals("tseT", next.getValue().toString());
+      }
+
+      one.removeScanIterator("reverse");
+      one.clearClassLoaderContext();
+      iterator = one.iterator();
+      for (int i = 0; i < ITERATIONS; i++) {
+        assertTrue(iterator.hasNext());
+        Entry<Key,Value> next = iterator.next();
+        assertEquals("Test", next.getValue().toString());
+      }
+
+    } finally {
+      // Delete file in tmp
+      fs.delete(dstPath, true);
+    }
+  }
+
+  private void scanCheck(Connector c, String tableName, IteratorSetting cfg, String context, String expected) throws Exception {
+    Scanner bs = c.createScanner(tableName, Authorizations.EMPTY);
+    if (null != context) {
+      bs.setClassLoaderContext(context);
+    }
+    if (null != cfg) {
+      bs.addScanIterator(cfg);
+    }
+    Iterator<Entry<Key,Value>> iterator = bs.iterator();
+    for (int i = 0; i < ITERATIONS; i++) {
+      assertTrue(iterator.hasNext());
+      Entry<Key,Value> next = iterator.next();
+      assertEquals(expected, next.getValue().toString());
+    }
+    assertFalse(iterator.hasNext());
+  }
+
+  private void batchCheck(Connector c, String tableName, IteratorSetting cfg, String context, String expected) throws Exception {
+    BatchScanner bs = c.createBatchScanner(tableName, Authorizations.EMPTY, 1);
+    bs.setRanges(Collections.singleton(new Range()));
+    try {
+      if (null != context) {
+        bs.setClassLoaderContext(context);
+      }
+      if (null != cfg) {
+        bs.addScanIterator(cfg);
+      }
+      Iterator<Entry<Key,Value>> iterator = bs.iterator();
+      for (int i = 0; i < ITERATIONS; i++) {
+        assertTrue(iterator.hasNext());
+        Entry<Key,Value> next = iterator.next();
+        assertEquals(expected, next.getValue().toString());
+      }
+      assertFalse(iterator.hasNext());
+    } finally {
+      bs.close();
+    }
+  }
+
+}

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
----------------------------------------------------------------------
diff --git a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
index 559703f..618d720 100644
--- a/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
+++ b/test/src/main/java/org/apache/accumulo/test/performance/thrift/NullTserver.java
@@ -138,14 +138,15 @@ public class NullTserver {
 
     @Override
     public InitialMultiScan startMultiScan(TInfo tinfo, TCredentials credentials, Map<TKeyExtent,List<TRange>> batch, List<TColumn> columns,
-        List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration tsc, long batchTimeOut) {
+        List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration tsc, long batchTimeOut,
+        String context) {
       return null;
     }
 
     @Override
     public InitialScan startScan(TInfo tinfo, TCredentials credentials, TKeyExtent extent, TRange range, List<TColumn> columns, int batchSize,
         List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated,
-        long readaheadThreshold, TSamplerConfiguration tsc, long batchTimeOut) {
+        long readaheadThreshold, TSamplerConfiguration tsc, long batchTimeOut, String classLoaderContext) {
       return null;
     }
 
@@ -211,7 +212,7 @@ public class NullTserver {
 
     @Override
     public TConditionalSession startConditionalUpdate(TInfo tinfo, TCredentials credentials, List<ByteBuffer> authorizations, String tableID,
-        TDurability durability) throws ThriftSecurityException, TException {
+        TDurability durability, String classLoaderContext) throws ThriftSecurityException, TException {
       return null;
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/src/main/resources/ShellServerIT-iterators.jar
----------------------------------------------------------------------
diff --git a/test/src/main/resources/ShellServerIT-iterators.jar b/test/src/main/resources/ShellServerIT-iterators.jar
new file mode 100644
index 0000000..7a67f21
Binary files /dev/null and b/test/src/main/resources/ShellServerIT-iterators.jar differ

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/test/src/test/java/org/apache/accumulo/test/functional/ValueReversingIterator.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/ValueReversingIterator.java b/test/src/test/java/org/apache/accumulo/test/functional/ValueReversingIterator.java
new file mode 100644
index 0000000..e606f5a
--- /dev/null
+++ b/test/src/test/java/org/apache/accumulo/test/functional/ValueReversingIterator.java
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.accumulo.test.functional;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+
+import org.apache.accumulo.core.data.ByteSequence;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.data.Value;
+import org.apache.accumulo.core.iterators.IteratorEnvironment;
+import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
+import org.apache.commons.lang3.ArrayUtils;
+
+/**
+ * Iterator used in ScannerContextIT that reverses the bytes of the value
+ *
+ */
+public class ValueReversingIterator implements SortedKeyValueIterator<Key,Value> {
+
+  protected SortedKeyValueIterator<Key,Value> source;
+
+  public ValueReversingIterator deepCopy(IteratorEnvironment env) {
+    throw new UnsupportedOperationException();
+  }
+
+  public Key getTopKey() {
+    return source.getTopKey();
+  }
+
+  public Value getTopValue() {
+    byte[] buf = source.getTopValue().get();
+    ArrayUtils.reverse(buf);
+    return new Value(buf);
+  }
+
+  public boolean hasTop() {
+    return source.hasTop();
+  }
+
+  public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
+    this.source = source;
+  }
+
+  public void next() throws IOException {
+    source.next();
+  }
+
+  public void seek(Range range, Collection<ByteSequence> columnFamilies, boolean inclusive) throws IOException {
+    source.seek(range, columnFamilies, inclusive);
+  }
+}


[3/3] accumulo git commit: ACCUMULO-3948: Add ability to set contextClassLoader on Scanners and BatchScanners

Posted by dl...@apache.org.
ACCUMULO-3948: Add ability to set contextClassLoader on Scanners and BatchScanners


Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/0e1da5a5
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/0e1da5a5
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/0e1da5a5

Branch: refs/heads/master
Commit: 0e1da5a58b57a491fc3c468edacdc4b53fc64010
Parents: 3521b35
Author: Dave Marion <dl...@apache.org>
Authored: Tue Nov 17 13:32:19 2015 -0500
Committer: Dave Marion <dl...@apache.org>
Committed: Tue Nov 17 13:32:19 2015 -0500

----------------------------------------------------------------------
 .../core/client/ConditionalWriterConfig.java    |  39 ++
 .../accumulo/core/client/ScannerBase.java       |  27 ++
 .../core/client/impl/ConditionalWriterImpl.java |   4 +-
 .../core/client/impl/ScannerIterator.java       |   2 +-
 .../core/client/impl/ScannerOptions.java        |  20 +
 .../impl/TabletServerBatchReaderIterator.java   |   2 +-
 .../core/client/impl/ThriftScanner.java         |  15 +-
 .../core/client/mapred/AbstractInputFormat.java |  30 +-
 .../client/mapreduce/AbstractInputFormat.java   |  30 +-
 .../mapreduce/lib/impl/InputConfigurator.java   |  32 +-
 .../core/client/mock/MockScannerBase.java       |   5 +
 .../accumulo/core/iterators/IteratorUtil.java   |  24 +-
 .../core/metadata/MetadataLocationObtainer.java |   4 +-
 .../core/tabletserver/thrift/ActiveScan.java    | 108 ++++-
 .../thrift/TabletClientService.java             | 396 +++++++++++++++++--
 core/src/main/thrift/tabletserver.thrift        |   9 +-
 .../main/asciidoc/chapters/administration.txt   |  43 ++
 .../server/util/VerifyTabletAssignments.java    |   2 +-
 .../monitor/servlets/trace/NullScanner.java     |  11 +
 .../apache/accumulo/tserver/TabletServer.java   |  19 +-
 .../accumulo/tserver/scan/LookupTask.java       |   2 +-
 .../tserver/session/ConditionalSession.java     |   4 +-
 .../tserver/session/MultiScanSession.java       |   4 +-
 .../accumulo/tserver/session/ScanSession.java   |   4 +-
 .../tserver/session/SessionManager.java         |   4 +-
 .../accumulo/tserver/tablet/ScanDataSource.java |  13 +-
 .../accumulo/tserver/tablet/ScanOptions.java    |  12 +-
 .../apache/accumulo/tserver/tablet/Tablet.java  |  11 +-
 .../accumulo/shell/commands/ScanCommand.java    |  12 +-
 test/pom.xml                                    |  19 +
 .../org/apache/accumulo/test/ShellServerIT.java |  91 +++++
 .../test/functional/ScannerContextIT.java       | 341 ++++++++++++++++
 .../test/performance/thrift/NullTserver.java    |   7 +-
 .../main/resources/ShellServerIT-iterators.jar  | Bin 0 -> 3148 bytes
 .../test/functional/ValueReversingIterator.java |  68 ++++
 35 files changed, 1316 insertions(+), 98 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
index b5cb474..cb9f6fb 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ConditionalWriterConfig.java
@@ -22,6 +22,8 @@ import java.util.concurrent.TimeUnit;
 
 import org.apache.accumulo.core.security.Authorizations;
 
+import com.google.common.base.Preconditions;
+
 /**
  *
  * @since 1.6.0
@@ -38,6 +40,8 @@ public class ConditionalWriterConfig {
 
   private Durability durability = Durability.DEFAULT;
 
+  private String classLoaderContext = null;
+
   /**
    * A set of authorization labels that will be checked against the column visibility of each key in order to filter data. The authorizations passed in must be
    * a subset of the accumulo user's set of authorizations. If the accumulo user has authorizations (A1, A2) and authorizations (A2, A3) are passed, then an
@@ -133,4 +137,39 @@ public class ConditionalWriterConfig {
   public Durability getDurability() {
     return durability;
   }
+
+  /**
+   * Sets the name of the classloader context on this scanner. See the administration chapter of the user manual for details on how to configure and use
+   * classloader contexts.
+   *
+   * @param classLoaderContext
+   *          name of the classloader context
+   * @throws NullPointerException
+   *           if context is null
+   * @since 1.8.0
+   */
+  public void setClassLoaderContext(String classLoaderContext) {
+    Preconditions.checkNotNull(classLoaderContext, "context name cannot be null");
+    this.classLoaderContext = classLoaderContext;
+  }
+
+  /**
+   * Clears the current classloader context set on this scanner
+   *
+   * @since 1.8.0
+   */
+  public void clearClassLoaderContext() {
+    this.classLoaderContext = null;
+  }
+
+  /**
+   * Returns the name of the current classloader context set on this scanner
+   *
+   * @return name of the current context
+   * @since 1.8.0
+   */
+  public String getClassLoaderContext() {
+    return this.classLoaderContext;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
index 5642785..aed67bc 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ScannerBase.java
@@ -242,4 +242,31 @@ public interface ScannerBase extends Iterable<Entry<Key,Value>> {
    * @since 1.8.0
    */
   long getBatchTimeout(TimeUnit timeUnit);
+
+  /**
+   * Sets the name of the classloader context on this scanner. See the administration chapter of the user manual for details on how to configure and use
+   * classloader contexts.
+   *
+   * @param classLoaderContext
+   *          name of the classloader context
+   * @throws NullPointerException
+   *           if context is null
+   * @since 1.8.0
+   */
+  void setClassLoaderContext(String classLoaderContext);
+
+  /**
+   * Clears the current classloader context set on this scanner
+   *
+   * @since 1.8.0
+   */
+  void clearClassLoaderContext();
+
+  /**
+   * Returns the name of the current classloader context set on this scanner
+   *
+   * @return name of the current context
+   * @since 1.8.0
+   */
+  String getClassLoaderContext();
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
index 6c6a551..546de9c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
@@ -113,6 +113,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
   private String tableId;
   private long timeout;
   private final Durability durability;
+  private final String classLoaderContext;
 
   private static class ServerQueue {
     BlockingQueue<TabletServerMutations<QCMutation>> queue = new LinkedBlockingQueue<TabletServerMutations<QCMutation>>();
@@ -389,6 +390,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
     this.tableId = tableId;
     this.timeout = config.getTimeout(TimeUnit.MILLISECONDS);
     this.durability = config.getDurability();
+    this.classLoaderContext = config.getClassLoaderContext();
 
     Runnable failureHandler = new Runnable() {
 
@@ -506,7 +508,7 @@ class ConditionalWriterImpl implements ConditionalWriter {
     }
 
     TConditionalSession tcs = client.startConditionalUpdate(tinfo, context.rpcCreds(), ByteBufferUtil.toByteBuffers(auths.getAuthorizations()), tableId,
-        DurabilityImpl.toThrift(durability));
+        DurabilityImpl.toThrift(durability), this.classLoaderContext);
 
     synchronized (cachedSessionIDs) {
       SessionID sid = new SessionID();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
index 55b0a85..d6512f0 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
@@ -121,7 +121,7 @@ public class ScannerIterator implements Iterator<Entry<Key,Value>> {
     }
 
     scanState = new ScanState(context, tableId, authorizations, new Range(range), options.fetchedColumns, size, options.serverSideIteratorList,
-        options.serverSideIteratorOptions, isolated, readaheadThreshold, options.getSamplerConfiguration(), options.batchTimeOut);
+        options.serverSideIteratorOptions, isolated, readaheadThreshold, options.getSamplerConfiguration(), options.batchTimeOut, options.classLoaderContext);
 
     // If we want to start readahead immediately, don't wait for hasNext to be called
     if (0l == readaheadThreshold) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java
index 8d96464..0782a7f 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ScannerOptions.java
@@ -58,6 +58,8 @@ public class ScannerOptions implements ScannerBase {
 
   private SamplerConfiguration samplerConfig = null;
 
+  protected String classLoaderContext = null;
+
   protected ScannerOptions() {}
 
   public ScannerOptions(ScannerOptions so) {
@@ -168,6 +170,7 @@ public class ScannerOptions implements ScannerBase {
         dst.regexIterName = src.regexIterName;
         dst.fetchedColumns = new TreeSet<Column>(src.fetchedColumns);
         dst.serverSideIteratorList = new ArrayList<IterInfo>(src.serverSideIteratorList);
+        dst.classLoaderContext = src.classLoaderContext;
 
         dst.serverSideIteratorOptions = new HashMap<String,Map<String,String>>();
         Set<Entry<String,Map<String,String>>> es = src.serverSideIteratorOptions.entrySet();
@@ -244,4 +247,21 @@ public class ScannerOptions implements ScannerBase {
   public long getBatchTimeout(TimeUnit timeUnit) {
     return timeUnit.convert(batchTimeOut, TimeUnit.MILLISECONDS);
   }
+
+  @Override
+  public void setClassLoaderContext(String classLoaderContext) {
+    Preconditions.checkNotNull(classLoaderContext, "classloader context name cannot be null");
+    this.classLoaderContext = classLoaderContext;
+  }
+
+  @Override
+  public void clearClassLoaderContext() {
+    this.classLoaderContext = null;
+  }
+
+  @Override
+  public String getClassLoaderContext() {
+    return this.classLoaderContext;
+  }
+
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
index 1ff56b9..814e71b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
@@ -649,7 +649,7 @@ public class TabletServerBatchReaderIterator implements Iterator<Entry<Key,Value
         InitialMultiScan imsr = client.startMultiScan(Tracer.traceInfo(), context.rpcCreds(), thriftTabletRanges,
             Translator.translate(columns, Translators.CT), options.serverSideIteratorList, options.serverSideIteratorOptions,
             ByteBufferUtil.toByteBuffers(authorizations.getAuthorizations()), waitForWrites,
-            SamplerConfigurationImpl.toThrift(options.getSamplerConfiguration()), options.batchTimeOut);
+            SamplerConfigurationImpl.toThrift(options.getSamplerConfiguration()), options.batchTimeOut, options.classLoaderContext);
         if (waitForWrites)
           ThriftScanner.serversWaitedForWrites.get(ttype).add(server.toString());
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftScanner.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftScanner.java b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftScanner.java
index 52f3330..57f5102 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftScanner.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/impl/ThriftScanner.java
@@ -85,7 +85,8 @@ public class ThriftScanner {
 
   public static boolean getBatchFromServer(ClientContext context, Range range, KeyExtent extent, String server, SortedMap<Key,Value> results,
       SortedSet<Column> fetchedColumns, List<IterInfo> serverSideIteratorList, Map<String,Map<String,String>> serverSideIteratorOptions, int size,
-      Authorizations authorizations, boolean retry, long batchTimeOut) throws AccumuloException, AccumuloSecurityException, NotServingTabletException {
+      Authorizations authorizations, boolean retry, long batchTimeOut, String classLoaderContext) throws AccumuloException, AccumuloSecurityException,
+      NotServingTabletException {
     if (server == null)
       throw new AccumuloException(new IOException());
 
@@ -96,13 +97,14 @@ public class ThriftScanner {
       try {
         // not reading whole rows (or stopping on row boundries) so there is no need to enable isolation below
         ScanState scanState = new ScanState(context, extent.getTableId(), authorizations, range, fetchedColumns, size, serverSideIteratorList,
-            serverSideIteratorOptions, false, Constants.SCANNER_DEFAULT_READAHEAD_THRESHOLD, null, batchTimeOut);
+            serverSideIteratorOptions, false, Constants.SCANNER_DEFAULT_READAHEAD_THRESHOLD, null, batchTimeOut, classLoaderContext);
 
         TabletType ttype = TabletType.type(extent);
         boolean waitForWrites = !serversWaitedForWrites.get(ttype).contains(server);
         InitialScan isr = client.startScan(tinfo, scanState.context.rpcCreds(), extent.toThrift(), scanState.range.toThrift(),
             Translator.translate(scanState.columns, Translators.CT), scanState.size, scanState.serverSideIteratorList, scanState.serverSideIteratorOptions,
-            scanState.authorizations.getAuthorizationsBB(), waitForWrites, scanState.isolated, scanState.readaheadThreshold, null, scanState.batchTimeOut);
+            scanState.authorizations.getAuthorizationsBB(), waitForWrites, scanState.isolated, scanState.readaheadThreshold, null, scanState.batchTimeOut,
+            classLoaderContext);
         if (waitForWrites)
           serversWaitedForWrites.get(ttype).add(server);
 
@@ -151,6 +153,8 @@ public class ThriftScanner {
     TabletLocation prevLoc;
     Long scanID;
 
+    String classLoaderContext;
+
     boolean finished = false;
 
     List<IterInfo> serverSideIteratorList;
@@ -161,10 +165,11 @@ public class ThriftScanner {
 
     public ScanState(ClientContext context, Text tableId, Authorizations authorizations, Range range, SortedSet<Column> fetchedColumns, int size,
         List<IterInfo> serverSideIteratorList, Map<String,Map<String,String>> serverSideIteratorOptions, boolean isolated, long readaheadThreshold,
-        SamplerConfiguration samplerConfig, long batchTimeOut) {
+        SamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) {
       this.context = context;
 
       this.authorizations = authorizations;
+      this.classLoaderContext = classLoaderContext;
 
       columns = new ArrayList<Column>(fetchedColumns.size());
       for (Column column : fetchedColumns) {
@@ -425,7 +430,7 @@ public class ThriftScanner {
         InitialScan is = client.startScan(tinfo, scanState.context.rpcCreds(), loc.tablet_extent.toThrift(), scanState.range.toThrift(),
             Translator.translate(scanState.columns, Translators.CT), scanState.size, scanState.serverSideIteratorList, scanState.serverSideIteratorOptions,
             scanState.authorizations.getAuthorizationsBB(), waitForWrites, scanState.isolated, scanState.readaheadThreshold,
-            SamplerConfigurationImpl.toThrift(scanState.samplerConfig), scanState.batchTimeOut);
+            SamplerConfigurationImpl.toThrift(scanState.samplerConfig), scanState.batchTimeOut, scanState.classLoaderContext);
         if (waitForWrites)
           serversWaitedForWrites.get(ttype).add(loc.tablet_location);
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
index b581deb..794500e 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapred/AbstractInputFormat.java
@@ -90,6 +90,31 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
   protected static final Logger log = Logger.getLogger(CLASS);
 
   /**
+   * Sets the name of the classloader context on this scanner
+   *
+   * @param job
+   *          the Hadoop job instance to be configured
+   * @param context
+   *          name of the classloader context
+   * @since 1.8.0
+   */
+  public static void setClassLoaderContext(JobConf job, String context) {
+    InputConfigurator.setClassLoaderContext(CLASS, job, context);
+  }
+
+  /**
+   * Returns the name of the current classloader context set on this scanner
+   *
+   * @param job
+   *          the Hadoop job instance to be configured
+   * @return name of the current context
+   * @since 1.8.0
+   */
+  public static String getClassLoaderContext(JobConf job) {
+    return InputConfigurator.getClassLoaderContext(CLASS, job);
+  }
+
+  /**
    * Sets the connector information needed to communicate with Accumulo in this job.
    *
    * <p>
@@ -484,7 +509,7 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
       if (null == authorizations) {
         authorizations = getScanAuthorizations(job);
       }
-
+      String classLoaderContext = getClassLoaderContext(job);
       String table = baseSplit.getTableName();
 
       // in case the table name changed, we can still use the previous name for terms of configuration,
@@ -504,6 +529,9 @@ public abstract class AbstractInputFormat<K,V> implements InputFormat<K,V> {
           int scanThreads = 1;
           scanner = instance.getConnector(principal, token).createBatchScanner(baseSplit.getTableName(), authorizations, scanThreads);
           setupIterators(job, scanner, baseSplit.getTableName(), baseSplit);
+          if (null != classLoaderContext) {
+            scanner.setClassLoaderContext(classLoaderContext);
+          }
         } catch (Exception e) {
           throw new IOException(e);
         }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
index 0e51f03..cf168cd 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/AbstractInputFormat.java
@@ -93,6 +93,31 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
   protected static final Logger log = Logger.getLogger(CLASS);
 
   /**
+   * Sets the name of the classloader context on this scanner
+   *
+   * @param job
+   *          the Hadoop job instance to be configured
+   * @param context
+   *          name of the classloader context
+   * @since 1.8.0
+   */
+  public static void setClassLoaderContext(Job job, String context) {
+    InputConfigurator.setClassLoaderContext(CLASS, job.getConfiguration(), context);
+  }
+
+  /**
+   * Returns the name of the current classloader context set on this scanner
+   *
+   * @param job
+   *          the Hadoop job instance to be configured
+   * @return name of the current context
+   * @since 1.8.0
+   */
+  public static String getClassLoaderContext(JobContext job) {
+    return InputConfigurator.getClassLoaderContext(CLASS, job.getConfiguration());
+  }
+
+  /**
    * Sets the connector information needed to communicate with Accumulo in this job.
    *
    * <p>
@@ -515,7 +540,7 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
       if (null == authorizations) {
         authorizations = getScanAuthorizations(attempt);
       }
-
+      String classLoaderContext = getClassLoaderContext(attempt);
       String table = split.getTableName();
 
       // in case the table name changed, we can still use the previous name for terms of configuration,
@@ -535,6 +560,9 @@ public abstract class AbstractInputFormat<K,V> extends InputFormat<K,V> {
           int scanThreads = 1;
           scanner = instance.getConnector(principal, token).createBatchScanner(split.getTableName(), authorizations, scanThreads);
           setupIterators(attempt, scanner, split.getTableName(), split);
+          if (null != classLoaderContext) {
+            scanner.setClassLoaderContext(classLoaderContext);
+          }
         } catch (Exception e) {
           e.printStackTrace();
           throw new IOException(e);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
index 6ba34af..43a776a 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mapreduce/lib/impl/InputConfigurator.java
@@ -90,7 +90,7 @@ public class InputConfigurator extends ConfiguratorBase {
    * @since 1.6.0
    */
   public static enum ScanOpts {
-    TABLE_NAME, AUTHORIZATIONS, RANGES, COLUMNS, ITERATORS, TABLE_CONFIGS, SAMPLER_CONFIG
+    TABLE_NAME, AUTHORIZATIONS, RANGES, COLUMNS, ITERATORS, TABLE_CONFIGS, SAMPLER_CONFIG, CLASSLOADER_CONTEXT
   }
 
   /**
@@ -103,6 +103,36 @@ public class InputConfigurator extends ConfiguratorBase {
   }
 
   /**
+   * Sets the name of the context classloader to use for scans
+   *
+   * @param implementingClass
+   *          the class whose name will be used as a prefix for the property configuration key
+   * @param conf
+   *          the Hadoop configuration object to configure
+   * @param context
+   *          the name of the context classloader
+   * @since 1.8.0
+   */
+  public static void setClassLoaderContext(Class<?> implementingClass, Configuration conf, String context) {
+    checkArgument(context != null, "context is null");
+    conf.set(enumToConfKey(implementingClass, ScanOpts.CLASSLOADER_CONTEXT), context);
+  }
+
+  /**
+   * Gets the name of the context classloader to use for scans
+   *
+   * @param implementingClass
+   *          the class whose name will be used as a prefix for the property configuration key
+   * @param conf
+   *          the Hadoop configuration object to configure
+   * @return the classloader context name
+   * @since 1.8.0
+   */
+  public static String getClassLoaderContext(Class<?> implementingClass, Configuration conf) {
+    return conf.get(enumToConfKey(implementingClass, ScanOpts.CLASSLOADER_CONTEXT), null);
+  }
+
+  /**
    * Sets the name of the input table, over which this job will scan.
    *
    * @param implementingClass

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
index 45b65e9..9302fc9 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockScannerBase.java
@@ -151,4 +151,9 @@ public class MockScannerBase extends ScannerOptions implements ScannerBase {
   public Authorizations getAuthorizations() {
     return auths;
   }
+
+  @Override
+  public void setClassLoaderContext(String context) {
+    throw new UnsupportedOperationException();
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java b/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
index 81f3c08..6523367 100644
--- a/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
+++ b/core/src/main/java/org/apache/accumulo/core/iterators/IteratorUtil.java
@@ -217,12 +217,8 @@ public class IteratorUtil {
     return loadIterators(scope, source, extent, conf, ssiList, ssio, env, true);
   }
 
-  public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators(IteratorScope scope,
-      SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
-      IteratorEnvironment env, boolean useAccumuloClassLoader) throws IOException {
-    List<IterInfo> iters = new ArrayList<IterInfo>(ssiList);
-    Map<String,Map<String,String>> allOptions = new HashMap<String,Map<String,String>>();
-
+  private static void parseIteratorConfiguration(IteratorScope scope, List<IterInfo> iters, Map<String,Map<String,String>> ssio,
+      Map<String,Map<String,String>> allOptions, AccumuloConfiguration conf) {
     parseIterConf(scope, iters, allOptions, conf);
 
     for (Entry<String,Map<String,String>> entry : ssio.entrySet()) {
@@ -235,10 +231,26 @@ public class IteratorUtil {
         options.putAll(entry.getValue());
       }
     }
+  }
 
+  public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators(IteratorScope scope,
+      SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
+      IteratorEnvironment env, boolean useAccumuloClassLoader) throws IOException {
+    List<IterInfo> iters = new ArrayList<IterInfo>(ssiList);
+    Map<String,Map<String,String>> allOptions = new HashMap<String,Map<String,String>>();
+    parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
     return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, conf.get(Property.TABLE_CLASSPATH));
   }
 
+  public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators(IteratorScope scope,
+      SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
+      IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException {
+    List<IterInfo> iters = new ArrayList<IterInfo>(ssiList);
+    Map<String,Map<String,String>> allOptions = new HashMap<String,Map<String,String>>();
+    parseIteratorConfiguration(scope, iters, ssio, allOptions, conf);
+    return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext);
+  }
+
   @SuppressWarnings("unchecked")
   public static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIterators(SortedKeyValueIterator<K,V> source,
       Collection<IterInfo> iters, Map<String,Map<String,String>> iterOpts, IteratorEnvironment env, boolean useAccumuloClassLoader, String context)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
index 42dd881..c59fab2 100644
--- a/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
+++ b/core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
@@ -99,7 +99,7 @@ public class MetadataLocationObtainer implements TabletLocationObtainer {
       serverSideIteratorList.add(new IterInfo(10000, WholeRowIterator.class.getName(), "WRI"));
       Map<String,Map<String,String>> serverSideIteratorOptions = Collections.emptyMap();
       boolean more = ThriftScanner.getBatchFromServer(context, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, serverSideIteratorList,
-          serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L);
+          serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L, null);
 
       decodeRows(encodedResults, results);
 
@@ -107,7 +107,7 @@ public class MetadataLocationObtainer implements TabletLocationObtainer {
         range = new Range(results.lastKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL_COLVIS_TIME), true, new Key(stopRow).followingKey(PartialKey.ROW), false);
         encodedResults.clear();
         more = ThriftScanner.getBatchFromServer(context, range, src.tablet_extent, src.tablet_location, encodedResults, locCols, serverSideIteratorList,
-            serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L);
+            serverSideIteratorOptions, Constants.SCAN_BATCH_SIZE, Authorizations.EMPTY, false, 0L, null);
 
         decodeRows(encodedResults, results);
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java
index fe389e4..e46c397 100644
--- a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java
+++ b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/ActiveScan.java
@@ -64,6 +64,7 @@ import org.slf4j.LoggerFactory;
   private static final org.apache.thrift.protocol.TField SSIO_FIELD_DESC = new org.apache.thrift.protocol.TField("ssio", org.apache.thrift.protocol.TType.MAP, (short)12);
   private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.LIST, (short)13);
   private static final org.apache.thrift.protocol.TField SCAN_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("scanId", org.apache.thrift.protocol.TType.I64, (short)14);
+  private static final org.apache.thrift.protocol.TField CLASS_LOADER_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("classLoaderContext", org.apache.thrift.protocol.TType.STRING, (short)15);
 
   private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
   static {
@@ -92,6 +93,7 @@ import org.slf4j.LoggerFactory;
   public Map<String,Map<String,String>> ssio; // required
   public List<ByteBuffer> authorizations; // required
   public long scanId; // optional
+  public String classLoaderContext; // required
 
   /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
   public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -115,7 +117,8 @@ import org.slf4j.LoggerFactory;
     SSI_LIST((short)11, "ssiList"),
     SSIO((short)12, "ssio"),
     AUTHORIZATIONS((short)13, "authorizations"),
-    SCAN_ID((short)14, "scanId");
+    SCAN_ID((short)14, "scanId"),
+    CLASS_LOADER_CONTEXT((short)15, "classLoaderContext");
 
     private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -156,6 +159,8 @@ import org.slf4j.LoggerFactory;
           return AUTHORIZATIONS;
         case 14: // SCAN_ID
           return SCAN_ID;
+        case 15: // CLASS_LOADER_CONTEXT
+          return CLASS_LOADER_CONTEXT;
         default:
           return null;
       }
@@ -237,6 +242,8 @@ import org.slf4j.LoggerFactory;
             new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING            , true))));
     tmpMap.put(_Fields.SCAN_ID, new org.apache.thrift.meta_data.FieldMetaData("scanId", org.apache.thrift.TFieldRequirementType.OPTIONAL, 
         new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+    tmpMap.put(_Fields.CLASS_LOADER_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("classLoaderContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+        new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
     metaDataMap = Collections.unmodifiableMap(tmpMap);
     org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ActiveScan.class, metaDataMap);
   }
@@ -256,7 +263,8 @@ import org.slf4j.LoggerFactory;
     List<org.apache.accumulo.core.data.thrift.TColumn> columns,
     List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList,
     Map<String,Map<String,String>> ssio,
-    List<ByteBuffer> authorizations)
+    List<ByteBuffer> authorizations,
+    String classLoaderContext)
   {
     this();
     this.client = client;
@@ -273,6 +281,7 @@ import org.slf4j.LoggerFactory;
     this.ssiList = ssiList;
     this.ssio = ssio;
     this.authorizations = authorizations;
+    this.classLoaderContext = classLoaderContext;
   }
 
   /**
@@ -334,6 +343,9 @@ import org.slf4j.LoggerFactory;
       this.authorizations = __this__authorizations;
     }
     this.scanId = other.scanId;
+    if (other.isSetClassLoaderContext()) {
+      this.classLoaderContext = other.classLoaderContext;
+    }
   }
 
   public ActiveScan deepCopy() {
@@ -358,6 +370,7 @@ import org.slf4j.LoggerFactory;
     this.authorizations = null;
     setScanIdIsSet(false);
     this.scanId = 0;
+    this.classLoaderContext = null;
   }
 
   public String getClient() {
@@ -741,6 +754,30 @@ import org.slf4j.LoggerFactory;
     __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SCANID_ISSET_ID, value);
   }
 
+  public String getClassLoaderContext() {
+    return this.classLoaderContext;
+  }
+
+  public ActiveScan setClassLoaderContext(String classLoaderContext) {
+    this.classLoaderContext = classLoaderContext;
+    return this;
+  }
+
+  public void unsetClassLoaderContext() {
+    this.classLoaderContext = null;
+  }
+
+  /** Returns true if field classLoaderContext is set (has been assigned a value) and false otherwise */
+  public boolean isSetClassLoaderContext() {
+    return this.classLoaderContext != null;
+  }
+
+  public void setClassLoaderContextIsSet(boolean value) {
+    if (!value) {
+      this.classLoaderContext = null;
+    }
+  }
+
   public void setFieldValue(_Fields field, Object value) {
     switch (field) {
     case CLIENT:
@@ -847,6 +884,14 @@ import org.slf4j.LoggerFactory;
       }
       break;
 
+    case CLASS_LOADER_CONTEXT:
+      if (value == null) {
+        unsetClassLoaderContext();
+      } else {
+        setClassLoaderContext((String)value);
+      }
+      break;
+
     }
   }
 
@@ -891,6 +936,9 @@ import org.slf4j.LoggerFactory;
     case SCAN_ID:
       return Long.valueOf(getScanId());
 
+    case CLASS_LOADER_CONTEXT:
+      return getClassLoaderContext();
+
     }
     throw new IllegalStateException();
   }
@@ -928,6 +976,8 @@ import org.slf4j.LoggerFactory;
       return isSetAuthorizations();
     case SCAN_ID:
       return isSetScanId();
+    case CLASS_LOADER_CONTEXT:
+      return isSetClassLoaderContext();
     }
     throw new IllegalStateException();
   }
@@ -1062,6 +1112,15 @@ import org.slf4j.LoggerFactory;
         return false;
     }
 
+    boolean this_present_classLoaderContext = true && this.isSetClassLoaderContext();
+    boolean that_present_classLoaderContext = true && that.isSetClassLoaderContext();
+    if (this_present_classLoaderContext || that_present_classLoaderContext) {
+      if (!(this_present_classLoaderContext && that_present_classLoaderContext))
+        return false;
+      if (!this.classLoaderContext.equals(that.classLoaderContext))
+        return false;
+    }
+
     return true;
   }
 
@@ -1208,6 +1267,16 @@ import org.slf4j.LoggerFactory;
         return lastComparison;
       }
     }
+    lastComparison = Boolean.valueOf(isSetClassLoaderContext()).compareTo(other.isSetClassLoaderContext());
+    if (lastComparison != 0) {
+      return lastComparison;
+    }
+    if (isSetClassLoaderContext()) {
+      lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.classLoaderContext, other.classLoaderContext);
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+    }
     return 0;
   }
 
@@ -1321,6 +1390,14 @@ import org.slf4j.LoggerFactory;
       sb.append(this.scanId);
       first = false;
     }
+    if (!first) sb.append(", ");
+    sb.append("classLoaderContext:");
+    if (this.classLoaderContext == null) {
+      sb.append("null");
+    } else {
+      sb.append(this.classLoaderContext);
+    }
+    first = false;
     sb.append(")");
     return sb.toString();
   }
@@ -1530,6 +1607,14 @@ import org.slf4j.LoggerFactory;
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
             }
             break;
+          case 15: // CLASS_LOADER_CONTEXT
+            if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+              struct.classLoaderContext = iprot.readString();
+              struct.setClassLoaderContextIsSet(true);
+            } else { 
+              org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+            }
+            break;
           default:
             org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
         }
@@ -1643,6 +1728,11 @@ import org.slf4j.LoggerFactory;
         oprot.writeI64(struct.scanId);
         oprot.writeFieldEnd();
       }
+      if (struct.classLoaderContext != null) {
+        oprot.writeFieldBegin(CLASS_LOADER_CONTEXT_FIELD_DESC);
+        oprot.writeString(struct.classLoaderContext);
+        oprot.writeFieldEnd();
+      }
       oprot.writeFieldStop();
       oprot.writeStructEnd();
     }
@@ -1700,7 +1790,10 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetScanId()) {
         optionals.set(12);
       }
-      oprot.writeBitSet(optionals, 13);
+      if (struct.isSetClassLoaderContext()) {
+        optionals.set(13);
+      }
+      oprot.writeBitSet(optionals, 14);
       if (struct.isSetClient()) {
         oprot.writeString(struct.client);
       }
@@ -1772,12 +1865,15 @@ import org.slf4j.LoggerFactory;
       if (struct.isSetScanId()) {
         oprot.writeI64(struct.scanId);
       }
+      if (struct.isSetClassLoaderContext()) {
+        oprot.writeString(struct.classLoaderContext);
+      }
     }
 
     @Override
     public void read(org.apache.thrift.protocol.TProtocol prot, ActiveScan struct) throws org.apache.thrift.TException {
       TTupleProtocol iprot = (TTupleProtocol) prot;
-      BitSet incoming = iprot.readBitSet(13);
+      BitSet incoming = iprot.readBitSet(14);
       if (incoming.get(0)) {
         struct.client = iprot.readString();
         struct.setClientIsSet(true);
@@ -1882,6 +1978,10 @@ import org.slf4j.LoggerFactory;
         struct.scanId = iprot.readI64();
         struct.setScanIdIsSet(true);
       }
+      if (incoming.get(13)) {
+        struct.classLoaderContext = iprot.readString();
+        struct.setClassLoaderContextIsSet(true);
+      }
     }
   }
 


[2/3] accumulo git commit: ACCUMULO-3948: Add ability to set contextClassLoader on Scanners and BatchScanners

Posted by dl...@apache.org.
http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
index f453788..dc964b9 100644
--- a/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
+++ b/core/src/main/java/org/apache/accumulo/core/tabletserver/thrift/TabletClientService.java
@@ -52,13 +52,13 @@ import org.slf4j.LoggerFactory;
 
   public interface Iface extends org.apache.accumulo.core.client.impl.thrift.ClientService.Iface {
 
-    public org.apache.accumulo.core.data.thrift.InitialScan startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, NotServingTabletException, TooManyFilesException, TSampleNotPresentException, org.apache.thrift.TException;
+    public org.apache.accumulo.core.data.thrift.InitialScan startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, NotServingTabletException, TooManyFilesException, TSampleNotPresentException, org.apache.thrift.TException;
 
     public org.apache.accumulo.core.data.thrift.ScanResult continueScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID) throws NoSuchScanIDException, NotServingTabletException, TooManyFilesException, TSampleNotPresentException, org.apache.thrift.TException;
 
     public void closeScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID) throws org.apache.thrift.TException;
 
-    public org.apache.accumulo.core.data.thrift.InitialMultiScan startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, TSampleNotPresentException, org.apache.thrift.TException;
+    public org.apache.accumulo.core.data.thrift.InitialMultiScan startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, TSampleNotPresentException, org.apache.thrift.TException;
 
     public org.apache.accumulo.core.data.thrift.MultiScanResult continueMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID) throws NoSuchScanIDException, TSampleNotPresentException, org.apache.thrift.TException;
 
@@ -72,7 +72,7 @@ import org.slf4j.LoggerFactory;
 
     public void update(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent keyExtent, org.apache.accumulo.core.data.thrift.TMutation mutation, TDurability durability) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, NotServingTabletException, ConstraintViolationException, org.apache.thrift.TException;
 
-    public org.apache.accumulo.core.data.thrift.TConditionalSession startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, org.apache.thrift.TException;
+    public org.apache.accumulo.core.data.thrift.TConditionalSession startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, org.apache.thrift.TException;
 
     public List<org.apache.accumulo.core.data.thrift.TCMResult> conditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long sessID, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TConditionalMutation>> mutations, List<String> symbols) throws NoSuchScanIDException, org.apache.thrift.TException;
 
@@ -118,13 +118,13 @@ import org.slf4j.LoggerFactory;
 
   public interface AsyncIface extends org.apache.accumulo.core.client.impl.thrift.ClientService .AsyncIface {
 
-    public void startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void continueScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void closeScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void continueMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long scanID, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -138,7 +138,7 @@ import org.slf4j.LoggerFactory;
 
     public void update(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent keyExtent, org.apache.accumulo.core.data.thrift.TMutation mutation, TDurability durability, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
-    public void startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
+    public void startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
     public void conditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, long sessID, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TConditionalMutation>> mutations, List<String> symbols, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
 
@@ -202,13 +202,13 @@ import org.slf4j.LoggerFactory;
       super(iprot, oprot);
     }
 
-    public org.apache.accumulo.core.data.thrift.InitialScan startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, NotServingTabletException, TooManyFilesException, TSampleNotPresentException, org.apache.thrift.TException
+    public org.apache.accumulo.core.data.thrift.InitialScan startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, NotServingTabletException, TooManyFilesException, TSampleNotPresentException, org.apache.thrift.TException
     {
-      send_startScan(tinfo, credentials, extent, range, columns, batchSize, ssiList, ssio, authorizations, waitForWrites, isolated, readaheadThreshold, samplerConfig, batchTimeOut);
+      send_startScan(tinfo, credentials, extent, range, columns, batchSize, ssiList, ssio, authorizations, waitForWrites, isolated, readaheadThreshold, samplerConfig, batchTimeOut, classLoaderContext);
       return recv_startScan();
     }
 
-    public void send_startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.thrift.TException
+    public void send_startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.thrift.TException
     {
       startScan_args args = new startScan_args();
       args.setTinfo(tinfo);
@@ -225,6 +225,7 @@ import org.slf4j.LoggerFactory;
       args.setReadaheadThreshold(readaheadThreshold);
       args.setSamplerConfig(samplerConfig);
       args.setBatchTimeOut(batchTimeOut);
+      args.setClassLoaderContext(classLoaderContext);
       sendBase("startScan", args);
     }
 
@@ -299,13 +300,13 @@ import org.slf4j.LoggerFactory;
       sendBase("closeScan", args);
     }
 
-    public org.apache.accumulo.core.data.thrift.InitialMultiScan startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, TSampleNotPresentException, org.apache.thrift.TException
+    public org.apache.accumulo.core.data.thrift.InitialMultiScan startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, TSampleNotPresentException, org.apache.thrift.TException
     {
-      send_startMultiScan(tinfo, credentials, batch, columns, ssiList, ssio, authorizations, waitForWrites, samplerConfig, batchTimeOut);
+      send_startMultiScan(tinfo, credentials, batch, columns, ssiList, ssio, authorizations, waitForWrites, samplerConfig, batchTimeOut, classLoaderContext);
       return recv_startMultiScan();
     }
 
-    public void send_startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut) throws org.apache.thrift.TException
+    public void send_startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext) throws org.apache.thrift.TException
     {
       startMultiScan_args args = new startMultiScan_args();
       args.setTinfo(tinfo);
@@ -318,6 +319,7 @@ import org.slf4j.LoggerFactory;
       args.setWaitForWrites(waitForWrites);
       args.setSamplerConfig(samplerConfig);
       args.setBatchTimeOut(batchTimeOut);
+      args.setClassLoaderContext(classLoaderContext);
       sendBase("startMultiScan", args);
     }
 
@@ -494,13 +496,13 @@ import org.slf4j.LoggerFactory;
       return;
     }
 
-    public org.apache.accumulo.core.data.thrift.TConditionalSession startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, org.apache.thrift.TException
+    public org.apache.accumulo.core.data.thrift.TConditionalSession startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext) throws org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException, org.apache.thrift.TException
     {
-      send_startConditionalUpdate(tinfo, credentials, authorizations, tableID, durability);
+      send_startConditionalUpdate(tinfo, credentials, authorizations, tableID, durability, classLoaderContext);
       return recv_startConditionalUpdate();
     }
 
-    public void send_startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability) throws org.apache.thrift.TException
+    public void send_startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext) throws org.apache.thrift.TException
     {
       startConditionalUpdate_args args = new startConditionalUpdate_args();
       args.setTinfo(tinfo);
@@ -508,6 +510,7 @@ import org.slf4j.LoggerFactory;
       args.setAuthorizations(authorizations);
       args.setTableID(tableID);
       args.setDurability(durability);
+      args.setClassLoaderContext(classLoaderContext);
       sendBase("startConditionalUpdate", args);
     }
 
@@ -972,9 +975,9 @@ import org.slf4j.LoggerFactory;
       super(protocolFactory, clientManager, transport);
     }
 
-    public void startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void startScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      startScan_call method_call = new startScan_call(tinfo, credentials, extent, range, columns, batchSize, ssiList, ssio, authorizations, waitForWrites, isolated, readaheadThreshold, samplerConfig, batchTimeOut, resultHandler, this, ___protocolFactory, ___transport);
+      startScan_call method_call = new startScan_call(tinfo, credentials, extent, range, columns, batchSize, ssiList, ssio, authorizations, waitForWrites, isolated, readaheadThreshold, samplerConfig, batchTimeOut, classLoaderContext, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
@@ -994,7 +997,8 @@ import org.slf4j.LoggerFactory;
       private long readaheadThreshold;
       private TSamplerConfiguration samplerConfig;
       private long batchTimeOut;
-      public startScan_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private String classLoaderContext;
+      public startScan_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, org.apache.accumulo.core.data.thrift.TKeyExtent extent, org.apache.accumulo.core.data.thrift.TRange range, List<org.apache.accumulo.core.data.thrift.TColumn> columns, int batchSize, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated, long readaheadThreshold, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.tinfo = tinfo;
         this.credentials = credentials;
@@ -1010,6 +1014,7 @@ import org.slf4j.LoggerFactory;
         this.readaheadThreshold = readaheadThreshold;
         this.samplerConfig = samplerConfig;
         this.batchTimeOut = batchTimeOut;
+        this.classLoaderContext = classLoaderContext;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -1029,6 +1034,7 @@ import org.slf4j.LoggerFactory;
         args.setReadaheadThreshold(readaheadThreshold);
         args.setSamplerConfig(samplerConfig);
         args.setBatchTimeOut(batchTimeOut);
+        args.setClassLoaderContext(classLoaderContext);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -1112,9 +1118,9 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public void startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void startMultiScan(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      startMultiScan_call method_call = new startMultiScan_call(tinfo, credentials, batch, columns, ssiList, ssio, authorizations, waitForWrites, samplerConfig, batchTimeOut, resultHandler, this, ___protocolFactory, ___transport);
+      startMultiScan_call method_call = new startMultiScan_call(tinfo, credentials, batch, columns, ssiList, ssio, authorizations, waitForWrites, samplerConfig, batchTimeOut, classLoaderContext, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
@@ -1130,7 +1136,8 @@ import org.slf4j.LoggerFactory;
       private boolean waitForWrites;
       private TSamplerConfiguration samplerConfig;
       private long batchTimeOut;
-      public startMultiScan_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private String classLoaderContext;
+      public startMultiScan_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, Map<org.apache.accumulo.core.data.thrift.TKeyExtent,List<org.apache.accumulo.core.data.thrift.TRange>> batch, List<org.apache.accumulo.core.data.thrift.TColumn> columns, List<org.apache.accumulo.core.data.thrift.IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, TSamplerConfiguration samplerConfig, long batchTimeOut, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.tinfo = tinfo;
         this.credentials = credentials;
@@ -1142,6 +1149,7 @@ import org.slf4j.LoggerFactory;
         this.waitForWrites = waitForWrites;
         this.samplerConfig = samplerConfig;
         this.batchTimeOut = batchTimeOut;
+        this.classLoaderContext = classLoaderContext;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -1157,6 +1165,7 @@ import org.slf4j.LoggerFactory;
         args.setWaitForWrites(waitForWrites);
         args.setSamplerConfig(samplerConfig);
         args.setBatchTimeOut(batchTimeOut);
+        args.setClassLoaderContext(classLoaderContext);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -1398,9 +1407,9 @@ import org.slf4j.LoggerFactory;
       }
     }
 
-    public void startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
+    public void startConditionalUpdate(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
       checkReady();
-      startConditionalUpdate_call method_call = new startConditionalUpdate_call(tinfo, credentials, authorizations, tableID, durability, resultHandler, this, ___protocolFactory, ___transport);
+      startConditionalUpdate_call method_call = new startConditionalUpdate_call(tinfo, credentials, authorizations, tableID, durability, classLoaderContext, resultHandler, this, ___protocolFactory, ___transport);
       this.___currentMethod = method_call;
       ___manager.call(method_call);
     }
@@ -1411,13 +1420,15 @@ import org.slf4j.LoggerFactory;
       private List<ByteBuffer> authorizations;
       private String tableID;
       private TDurability durability;
-      public startConditionalUpdate_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
+      private String classLoaderContext;
+      public startConditionalUpdate_call(org.apache.accumulo.core.trace.thrift.TInfo tinfo, org.apache.accumulo.core.security.thrift.TCredentials credentials, List<ByteBuffer> authorizations, String tableID, TDurability durability, String classLoaderContext, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
         super(client, protocolFactory, transport, resultHandler, false);
         this.tinfo = tinfo;
         this.credentials = credentials;
         this.authorizations = authorizations;
         this.tableID = tableID;
         this.durability = durability;
+        this.classLoaderContext = classLoaderContext;
       }
 
       public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
@@ -1428,6 +1439,7 @@ import org.slf4j.LoggerFactory;
         args.setAuthorizations(authorizations);
         args.setTableID(tableID);
         args.setDurability(durability);
+        args.setClassLoaderContext(classLoaderContext);
         args.write(prot);
         prot.writeMessageEnd();
       }
@@ -2280,7 +2292,7 @@ import org.slf4j.LoggerFactory;
       public startScan_result getResult(I iface, startScan_args args) throws org.apache.thrift.TException {
         startScan_result result = new startScan_result();
         try {
-          result.success = iface.startScan(args.tinfo, args.credentials, args.extent, args.range, args.columns, args.batchSize, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.isolated, args.readaheadThreshold, args.samplerConfig, args.batchTimeOut);
+          result.success = iface.startScan(args.tinfo, args.credentials, args.extent, args.range, args.columns, args.batchSize, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.isolated, args.readaheadThreshold, args.samplerConfig, args.batchTimeOut, args.classLoaderContext);
         } catch (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) {
           result.sec = sec;
         } catch (NotServingTabletException nste) {
@@ -2359,7 +2371,7 @@ import org.slf4j.LoggerFactory;
       public startMultiScan_result getResult(I iface, startMultiScan_args args) throws org.apache.thrift.TException {
         startMultiScan_result result = new startMultiScan_result();
         try {
-          result.success = iface.startMultiScan(args.tinfo, args.credentials, args.batch, args.columns, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.samplerConfig, args.batchTimeOut);
+          result.success = iface.startMultiScan(args.tinfo, args.credentials, args.batch, args.columns, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.samplerConfig, args.batchTimeOut, args.classLoaderContext);
         } catch (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) {
           result.sec = sec;
         } catch (TSampleNotPresentException tsnpe) {
@@ -2531,7 +2543,7 @@ import org.slf4j.LoggerFactory;
       public startConditionalUpdate_result getResult(I iface, startConditionalUpdate_args args) throws org.apache.thrift.TException {
         startConditionalUpdate_result result = new startConditionalUpdate_result();
         try {
-          result.success = iface.startConditionalUpdate(args.tinfo, args.credentials, args.authorizations, args.tableID, args.durability);
+          result.success = iface.startConditionalUpdate(args.tinfo, args.credentials, args.authorizations, args.tableID, args.durability, args.classLoaderContext);
         } catch (org.apache.accumulo.core.client.impl.thrift.ThriftSecurityException sec) {
           result.sec = sec;
         }
@@ -3083,7 +3095,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, startScan_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.accumulo.core.data.thrift.InitialScan> resultHandler) throws TException {
-        iface.startScan(args.tinfo, args.credentials, args.extent, args.range, args.columns, args.batchSize, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.isolated, args.readaheadThreshold, args.samplerConfig, args.batchTimeOut,resultHandler);
+        iface.startScan(args.tinfo, args.credentials, args.extent, args.range, args.columns, args.batchSize, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.isolated, args.readaheadThreshold, args.samplerConfig, args.batchTimeOut, args.classLoaderContext,resultHandler);
       }
     }
 
@@ -3245,7 +3257,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, startMultiScan_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.accumulo.core.data.thrift.InitialMultiScan> resultHandler) throws TException {
-        iface.startMultiScan(args.tinfo, args.credentials, args.batch, args.columns, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.samplerConfig, args.batchTimeOut,resultHandler);
+        iface.startMultiScan(args.tinfo, args.credentials, args.batch, args.columns, args.ssiList, args.ssio, args.authorizations, args.waitForWrites, args.samplerConfig, args.batchTimeOut, args.classLoaderContext,resultHandler);
       }
     }
 
@@ -3629,7 +3641,7 @@ import org.slf4j.LoggerFactory;
       }
 
       public void start(I iface, startConditionalUpdate_args args, org.apache.thrift.async.AsyncMethodCallback<org.apache.accumulo.core.data.thrift.TConditionalSession> resultHandler) throws TException {
-        iface.startConditionalUpdate(args.tinfo, args.credentials, args.authorizations, args.tableID, args.durability,resultHandler);
+        iface.startConditionalUpdate(args.tinfo, args.credentials, args.authorizations, args.tableID, args.durability, args.classLoaderContext,resultHandler);
       }
     }
 
@@ -4521,6 +4533,7 @@ import org.slf4j.LoggerFactory;
     private static final org.apache.thrift.protocol.TField READAHEAD_THRESHOLD_FIELD_DESC = new org.apache.thrift.protocol.TField("readaheadThreshold", org.apache.thrift.protocol.TType.I64, (short)12);
     private static final org.apache.thrift.protocol.TField SAMPLER_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("samplerConfig", org.apache.thrift.protocol.TType.STRUCT, (short)13);
     private static final org.apache.thrift.protocol.TField BATCH_TIME_OUT_FIELD_DESC = new org.apache.thrift.protocol.TField("batchTimeOut", org.apache.thrift.protocol.TType.I64, (short)14);
+    private static final org.apache.thrift.protocol.TField CLASS_LOADER_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("classLoaderContext", org.apache.thrift.protocol.TType.STRING, (short)15);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -4542,6 +4555,7 @@ import org.slf4j.LoggerFactory;
     public long readaheadThreshold; // required
     public TSamplerConfiguration samplerConfig; // required
     public long batchTimeOut; // required
+    public String classLoaderContext; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -4558,7 +4572,8 @@ import org.slf4j.LoggerFactory;
       ISOLATED((short)10, "isolated"),
       READAHEAD_THRESHOLD((short)12, "readaheadThreshold"),
       SAMPLER_CONFIG((short)13, "samplerConfig"),
-      BATCH_TIME_OUT((short)14, "batchTimeOut");
+      BATCH_TIME_OUT((short)14, "batchTimeOut"),
+      CLASS_LOADER_CONTEXT((short)15, "classLoaderContext");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -4601,6 +4616,8 @@ import org.slf4j.LoggerFactory;
             return SAMPLER_CONFIG;
           case 14: // BATCH_TIME_OUT
             return BATCH_TIME_OUT;
+          case 15: // CLASS_LOADER_CONTEXT
+            return CLASS_LOADER_CONTEXT;
           default:
             return null;
         }
@@ -4685,6 +4702,8 @@ import org.slf4j.LoggerFactory;
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSamplerConfiguration.class)));
       tmpMap.put(_Fields.BATCH_TIME_OUT, new org.apache.thrift.meta_data.FieldMetaData("batchTimeOut", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+      tmpMap.put(_Fields.CLASS_LOADER_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("classLoaderContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startScan_args.class, metaDataMap);
     }
@@ -4706,7 +4725,8 @@ import org.slf4j.LoggerFactory;
       boolean isolated,
       long readaheadThreshold,
       TSamplerConfiguration samplerConfig,
-      long batchTimeOut)
+      long batchTimeOut,
+      String classLoaderContext)
     {
       this();
       this.tinfo = tinfo;
@@ -4728,6 +4748,7 @@ import org.slf4j.LoggerFactory;
       this.samplerConfig = samplerConfig;
       this.batchTimeOut = batchTimeOut;
       setBatchTimeOutIsSet(true);
+      this.classLoaderContext = classLoaderContext;
     }
 
     /**
@@ -4788,6 +4809,9 @@ import org.slf4j.LoggerFactory;
         this.samplerConfig = new TSamplerConfiguration(other.samplerConfig);
       }
       this.batchTimeOut = other.batchTimeOut;
+      if (other.isSetClassLoaderContext()) {
+        this.classLoaderContext = other.classLoaderContext;
+      }
     }
 
     public startScan_args deepCopy() {
@@ -4815,6 +4839,7 @@ import org.slf4j.LoggerFactory;
       this.samplerConfig = null;
       setBatchTimeOutIsSet(false);
       this.batchTimeOut = 0;
+      this.classLoaderContext = null;
     }
 
     public org.apache.accumulo.core.trace.thrift.TInfo getTinfo() {
@@ -5204,6 +5229,30 @@ import org.slf4j.LoggerFactory;
       __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BATCHTIMEOUT_ISSET_ID, value);
     }
 
+    public String getClassLoaderContext() {
+      return this.classLoaderContext;
+    }
+
+    public startScan_args setClassLoaderContext(String classLoaderContext) {
+      this.classLoaderContext = classLoaderContext;
+      return this;
+    }
+
+    public void unsetClassLoaderContext() {
+      this.classLoaderContext = null;
+    }
+
+    /** Returns true if field classLoaderContext is set (has been assigned a value) and false otherwise */
+    public boolean isSetClassLoaderContext() {
+      return this.classLoaderContext != null;
+    }
+
+    public void setClassLoaderContextIsSet(boolean value) {
+      if (!value) {
+        this.classLoaderContext = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case TINFO:
@@ -5318,6 +5367,14 @@ import org.slf4j.LoggerFactory;
         }
         break;
 
+      case CLASS_LOADER_CONTEXT:
+        if (value == null) {
+          unsetClassLoaderContext();
+        } else {
+          setClassLoaderContext((String)value);
+        }
+        break;
+
       }
     }
 
@@ -5365,6 +5422,9 @@ import org.slf4j.LoggerFactory;
       case BATCH_TIME_OUT:
         return Long.valueOf(getBatchTimeOut());
 
+      case CLASS_LOADER_CONTEXT:
+        return getClassLoaderContext();
+
       }
       throw new IllegalStateException();
     }
@@ -5404,6 +5464,8 @@ import org.slf4j.LoggerFactory;
         return isSetSamplerConfig();
       case BATCH_TIME_OUT:
         return isSetBatchTimeOut();
+      case CLASS_LOADER_CONTEXT:
+        return isSetClassLoaderContext();
       }
       throw new IllegalStateException();
     }
@@ -5547,6 +5609,15 @@ import org.slf4j.LoggerFactory;
           return false;
       }
 
+      boolean this_present_classLoaderContext = true && this.isSetClassLoaderContext();
+      boolean that_present_classLoaderContext = true && that.isSetClassLoaderContext();
+      if (this_present_classLoaderContext || that_present_classLoaderContext) {
+        if (!(this_present_classLoaderContext && that_present_classLoaderContext))
+          return false;
+        if (!this.classLoaderContext.equals(that.classLoaderContext))
+          return false;
+      }
+
       return true;
     }
 
@@ -5703,6 +5774,16 @@ import org.slf4j.LoggerFactory;
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetClassLoaderContext()).compareTo(other.isSetClassLoaderContext());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetClassLoaderContext()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.classLoaderContext, other.classLoaderContext);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -5814,6 +5895,14 @@ import org.slf4j.LoggerFactory;
       sb.append("batchTimeOut:");
       sb.append(this.batchTimeOut);
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("classLoaderContext:");
+      if (this.classLoaderContext == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.classLoaderContext);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -6047,6 +6136,14 @@ import org.slf4j.LoggerFactory;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 15: // CLASS_LOADER_CONTEXT
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.classLoaderContext = iprot.readString();
+                struct.setClassLoaderContextIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -6159,6 +6256,11 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(BATCH_TIME_OUT_FIELD_DESC);
         oprot.writeI64(struct.batchTimeOut);
         oprot.writeFieldEnd();
+        if (struct.classLoaderContext != null) {
+          oprot.writeFieldBegin(CLASS_LOADER_CONTEXT_FIELD_DESC);
+          oprot.writeString(struct.classLoaderContext);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -6219,7 +6321,10 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetBatchTimeOut()) {
           optionals.set(13);
         }
-        oprot.writeBitSet(optionals, 14);
+        if (struct.isSetClassLoaderContext()) {
+          optionals.set(14);
+        }
+        oprot.writeBitSet(optionals, 15);
         if (struct.isSetTinfo()) {
           struct.tinfo.write(oprot);
         }
@@ -6294,12 +6399,15 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetBatchTimeOut()) {
           oprot.writeI64(struct.batchTimeOut);
         }
+        if (struct.isSetClassLoaderContext()) {
+          oprot.writeString(struct.classLoaderContext);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, startScan_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(14);
+        BitSet incoming = iprot.readBitSet(15);
         if (incoming.get(0)) {
           struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();
           struct.tinfo.read(iprot);
@@ -6412,6 +6520,10 @@ import org.slf4j.LoggerFactory;
           struct.batchTimeOut = iprot.readI64();
           struct.setBatchTimeOutIsSet(true);
         }
+        if (incoming.get(14)) {
+          struct.classLoaderContext = iprot.readString();
+          struct.setClassLoaderContextIsSet(true);
+        }
       }
     }
 
@@ -8878,6 +8990,7 @@ import org.slf4j.LoggerFactory;
     private static final org.apache.thrift.protocol.TField WAIT_FOR_WRITES_FIELD_DESC = new org.apache.thrift.protocol.TField("waitForWrites", org.apache.thrift.protocol.TType.BOOL, (short)7);
     private static final org.apache.thrift.protocol.TField SAMPLER_CONFIG_FIELD_DESC = new org.apache.thrift.protocol.TField("samplerConfig", org.apache.thrift.protocol.TType.STRUCT, (short)9);
     private static final org.apache.thrift.protocol.TField BATCH_TIME_OUT_FIELD_DESC = new org.apache.thrift.protocol.TField("batchTimeOut", org.apache.thrift.protocol.TType.I64, (short)10);
+    private static final org.apache.thrift.protocol.TField CLASS_LOADER_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("classLoaderContext", org.apache.thrift.protocol.TType.STRING, (short)11);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -8895,6 +9008,7 @@ import org.slf4j.LoggerFactory;
     public boolean waitForWrites; // required
     public TSamplerConfiguration samplerConfig; // required
     public long batchTimeOut; // required
+    public String classLoaderContext; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -8907,7 +9021,8 @@ import org.slf4j.LoggerFactory;
       AUTHORIZATIONS((short)6, "authorizations"),
       WAIT_FOR_WRITES((short)7, "waitForWrites"),
       SAMPLER_CONFIG((short)9, "samplerConfig"),
-      BATCH_TIME_OUT((short)10, "batchTimeOut");
+      BATCH_TIME_OUT((short)10, "batchTimeOut"),
+      CLASS_LOADER_CONTEXT((short)11, "classLoaderContext");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -8942,6 +9057,8 @@ import org.slf4j.LoggerFactory;
             return SAMPLER_CONFIG;
           case 10: // BATCH_TIME_OUT
             return BATCH_TIME_OUT;
+          case 11: // CLASS_LOADER_CONTEXT
+            return CLASS_LOADER_CONTEXT;
           default:
             return null;
         }
@@ -9015,6 +9132,8 @@ import org.slf4j.LoggerFactory;
           new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, TSamplerConfiguration.class)));
       tmpMap.put(_Fields.BATCH_TIME_OUT, new org.apache.thrift.meta_data.FieldMetaData("batchTimeOut", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)));
+      tmpMap.put(_Fields.CLASS_LOADER_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("classLoaderContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startMultiScan_args.class, metaDataMap);
     }
@@ -9032,7 +9151,8 @@ import org.slf4j.LoggerFactory;
       List<ByteBuffer> authorizations,
       boolean waitForWrites,
       TSamplerConfiguration samplerConfig,
-      long batchTimeOut)
+      long batchTimeOut,
+      String classLoaderContext)
     {
       this();
       this.tinfo = tinfo;
@@ -9047,6 +9167,7 @@ import org.slf4j.LoggerFactory;
       this.samplerConfig = samplerConfig;
       this.batchTimeOut = batchTimeOut;
       setBatchTimeOutIsSet(true);
+      this.classLoaderContext = classLoaderContext;
     }
 
     /**
@@ -9101,6 +9222,9 @@ import org.slf4j.LoggerFactory;
         this.samplerConfig = new TSamplerConfiguration(other.samplerConfig);
       }
       this.batchTimeOut = other.batchTimeOut;
+      if (other.isSetClassLoaderContext()) {
+        this.classLoaderContext = other.classLoaderContext;
+      }
     }
 
     public startMultiScan_args deepCopy() {
@@ -9121,6 +9245,7 @@ import org.slf4j.LoggerFactory;
       this.samplerConfig = null;
       setBatchTimeOutIsSet(false);
       this.batchTimeOut = 0;
+      this.classLoaderContext = null;
     }
 
     public org.apache.accumulo.core.trace.thrift.TInfo getTinfo() {
@@ -9428,6 +9553,30 @@ import org.slf4j.LoggerFactory;
       __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BATCHTIMEOUT_ISSET_ID, value);
     }
 
+    public String getClassLoaderContext() {
+      return this.classLoaderContext;
+    }
+
+    public startMultiScan_args setClassLoaderContext(String classLoaderContext) {
+      this.classLoaderContext = classLoaderContext;
+      return this;
+    }
+
+    public void unsetClassLoaderContext() {
+      this.classLoaderContext = null;
+    }
+
+    /** Returns true if field classLoaderContext is set (has been assigned a value) and false otherwise */
+    public boolean isSetClassLoaderContext() {
+      return this.classLoaderContext != null;
+    }
+
+    public void setClassLoaderContextIsSet(boolean value) {
+      if (!value) {
+        this.classLoaderContext = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case TINFO:
@@ -9510,6 +9659,14 @@ import org.slf4j.LoggerFactory;
         }
         break;
 
+      case CLASS_LOADER_CONTEXT:
+        if (value == null) {
+          unsetClassLoaderContext();
+        } else {
+          setClassLoaderContext((String)value);
+        }
+        break;
+
       }
     }
 
@@ -9545,6 +9702,9 @@ import org.slf4j.LoggerFactory;
       case BATCH_TIME_OUT:
         return Long.valueOf(getBatchTimeOut());
 
+      case CLASS_LOADER_CONTEXT:
+        return getClassLoaderContext();
+
       }
       throw new IllegalStateException();
     }
@@ -9576,6 +9736,8 @@ import org.slf4j.LoggerFactory;
         return isSetSamplerConfig();
       case BATCH_TIME_OUT:
         return isSetBatchTimeOut();
+      case CLASS_LOADER_CONTEXT:
+        return isSetClassLoaderContext();
       }
       throw new IllegalStateException();
     }
@@ -9683,6 +9845,15 @@ import org.slf4j.LoggerFactory;
           return false;
       }
 
+      boolean this_present_classLoaderContext = true && this.isSetClassLoaderContext();
+      boolean that_present_classLoaderContext = true && that.isSetClassLoaderContext();
+      if (this_present_classLoaderContext || that_present_classLoaderContext) {
+        if (!(this_present_classLoaderContext && that_present_classLoaderContext))
+          return false;
+        if (!this.classLoaderContext.equals(that.classLoaderContext))
+          return false;
+      }
+
       return true;
     }
 
@@ -9799,6 +9970,16 @@ import org.slf4j.LoggerFactory;
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetClassLoaderContext()).compareTo(other.isSetClassLoaderContext());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetClassLoaderContext()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.classLoaderContext, other.classLoaderContext);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -9890,6 +10071,14 @@ import org.slf4j.LoggerFactory;
       sb.append("batchTimeOut:");
       sb.append(this.batchTimeOut);
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("classLoaderContext:");
+      if (this.classLoaderContext == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.classLoaderContext);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -10107,6 +10296,14 @@ import org.slf4j.LoggerFactory;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 11: // CLASS_LOADER_CONTEXT
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.classLoaderContext = iprot.readString();
+                struct.setClassLoaderContextIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -10220,6 +10417,11 @@ import org.slf4j.LoggerFactory;
         oprot.writeFieldBegin(BATCH_TIME_OUT_FIELD_DESC);
         oprot.writeI64(struct.batchTimeOut);
         oprot.writeFieldEnd();
+        if (struct.classLoaderContext != null) {
+          oprot.writeFieldBegin(CLASS_LOADER_CONTEXT_FIELD_DESC);
+          oprot.writeString(struct.classLoaderContext);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -10268,7 +10470,10 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetBatchTimeOut()) {
           optionals.set(9);
         }
-        oprot.writeBitSet(optionals, 10);
+        if (struct.isSetClassLoaderContext()) {
+          optionals.set(10);
+        }
+        oprot.writeBitSet(optionals, 11);
         if (struct.isSetTinfo()) {
           struct.tinfo.write(oprot);
         }
@@ -10344,12 +10549,15 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetBatchTimeOut()) {
           oprot.writeI64(struct.batchTimeOut);
         }
+        if (struct.isSetClassLoaderContext()) {
+          oprot.writeString(struct.classLoaderContext);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, startMultiScan_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(10);
+        BitSet incoming = iprot.readBitSet(11);
         if (incoming.get(0)) {
           struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();
           struct.tinfo.read(iprot);
@@ -10466,6 +10674,10 @@ import org.slf4j.LoggerFactory;
           struct.batchTimeOut = iprot.readI64();
           struct.setBatchTimeOutIsSet(true);
         }
+        if (incoming.get(10)) {
+          struct.classLoaderContext = iprot.readString();
+          struct.setClassLoaderContextIsSet(true);
+        }
       }
     }
 
@@ -16895,6 +17107,7 @@ import org.slf4j.LoggerFactory;
     private static final org.apache.thrift.protocol.TField AUTHORIZATIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("authorizations", org.apache.thrift.protocol.TType.LIST, (short)3);
     private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableID", org.apache.thrift.protocol.TType.STRING, (short)4);
     private static final org.apache.thrift.protocol.TField DURABILITY_FIELD_DESC = new org.apache.thrift.protocol.TField("durability", org.apache.thrift.protocol.TType.I32, (short)5);
+    private static final org.apache.thrift.protocol.TField CLASS_LOADER_CONTEXT_FIELD_DESC = new org.apache.thrift.protocol.TField("classLoaderContext", org.apache.thrift.protocol.TType.STRING, (short)6);
 
     private static final Map<Class<? extends IScheme>, SchemeFactory> schemes = new HashMap<Class<? extends IScheme>, SchemeFactory>();
     static {
@@ -16911,6 +17124,7 @@ import org.slf4j.LoggerFactory;
      * @see TDurability
      */
     public TDurability durability; // required
+    public String classLoaderContext; // required
 
     /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
     public enum _Fields implements org.apache.thrift.TFieldIdEnum {
@@ -16922,7 +17136,8 @@ import org.slf4j.LoggerFactory;
        * 
        * @see TDurability
        */
-      DURABILITY((short)5, "durability");
+      DURABILITY((short)5, "durability"),
+      CLASS_LOADER_CONTEXT((short)6, "classLoaderContext");
 
       private static final Map<String, _Fields> byName = new HashMap<String, _Fields>();
 
@@ -16947,6 +17162,8 @@ import org.slf4j.LoggerFactory;
             return TABLE_ID;
           case 5: // DURABILITY
             return DURABILITY;
+          case 6: // CLASS_LOADER_CONTEXT
+            return CLASS_LOADER_CONTEXT;
           default:
             return null;
         }
@@ -17001,6 +17218,8 @@ import org.slf4j.LoggerFactory;
           new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       tmpMap.put(_Fields.DURABILITY, new org.apache.thrift.meta_data.FieldMetaData("durability", org.apache.thrift.TFieldRequirementType.DEFAULT, 
           new org.apache.thrift.meta_data.EnumMetaData(org.apache.thrift.protocol.TType.ENUM, TDurability.class)));
+      tmpMap.put(_Fields.CLASS_LOADER_CONTEXT, new org.apache.thrift.meta_data.FieldMetaData("classLoaderContext", org.apache.thrift.TFieldRequirementType.DEFAULT, 
+          new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
       metaDataMap = Collections.unmodifiableMap(tmpMap);
       org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(startConditionalUpdate_args.class, metaDataMap);
     }
@@ -17013,7 +17232,8 @@ import org.slf4j.LoggerFactory;
       org.apache.accumulo.core.security.thrift.TCredentials credentials,
       List<ByteBuffer> authorizations,
       String tableID,
-      TDurability durability)
+      TDurability durability,
+      String classLoaderContext)
     {
       this();
       this.tinfo = tinfo;
@@ -17021,6 +17241,7 @@ import org.slf4j.LoggerFactory;
       this.authorizations = authorizations;
       this.tableID = tableID;
       this.durability = durability;
+      this.classLoaderContext = classLoaderContext;
     }
 
     /**
@@ -17043,6 +17264,9 @@ import org.slf4j.LoggerFactory;
       if (other.isSetDurability()) {
         this.durability = other.durability;
       }
+      if (other.isSetClassLoaderContext()) {
+        this.classLoaderContext = other.classLoaderContext;
+      }
     }
 
     public startConditionalUpdate_args deepCopy() {
@@ -17056,6 +17280,7 @@ import org.slf4j.LoggerFactory;
       this.authorizations = null;
       this.tableID = null;
       this.durability = null;
+      this.classLoaderContext = null;
     }
 
     public org.apache.accumulo.core.trace.thrift.TInfo getTinfo() {
@@ -17201,6 +17426,30 @@ import org.slf4j.LoggerFactory;
       }
     }
 
+    public String getClassLoaderContext() {
+      return this.classLoaderContext;
+    }
+
+    public startConditionalUpdate_args setClassLoaderContext(String classLoaderContext) {
+      this.classLoaderContext = classLoaderContext;
+      return this;
+    }
+
+    public void unsetClassLoaderContext() {
+      this.classLoaderContext = null;
+    }
+
+    /** Returns true if field classLoaderContext is set (has been assigned a value) and false otherwise */
+    public boolean isSetClassLoaderContext() {
+      return this.classLoaderContext != null;
+    }
+
+    public void setClassLoaderContextIsSet(boolean value) {
+      if (!value) {
+        this.classLoaderContext = null;
+      }
+    }
+
     public void setFieldValue(_Fields field, Object value) {
       switch (field) {
       case TINFO:
@@ -17243,6 +17492,14 @@ import org.slf4j.LoggerFactory;
         }
         break;
 
+      case CLASS_LOADER_CONTEXT:
+        if (value == null) {
+          unsetClassLoaderContext();
+        } else {
+          setClassLoaderContext((String)value);
+        }
+        break;
+
       }
     }
 
@@ -17263,6 +17520,9 @@ import org.slf4j.LoggerFactory;
       case DURABILITY:
         return getDurability();
 
+      case CLASS_LOADER_CONTEXT:
+        return getClassLoaderContext();
+
       }
       throw new IllegalStateException();
     }
@@ -17284,6 +17544,8 @@ import org.slf4j.LoggerFactory;
         return isSetTableID();
       case DURABILITY:
         return isSetDurability();
+      case CLASS_LOADER_CONTEXT:
+        return isSetClassLoaderContext();
       }
       throw new IllegalStateException();
     }
@@ -17346,6 +17608,15 @@ import org.slf4j.LoggerFactory;
           return false;
       }
 
+      boolean this_present_classLoaderContext = true && this.isSetClassLoaderContext();
+      boolean that_present_classLoaderContext = true && that.isSetClassLoaderContext();
+      if (this_present_classLoaderContext || that_present_classLoaderContext) {
+        if (!(this_present_classLoaderContext && that_present_classLoaderContext))
+          return false;
+        if (!this.classLoaderContext.equals(that.classLoaderContext))
+          return false;
+      }
+
       return true;
     }
 
@@ -17412,6 +17683,16 @@ import org.slf4j.LoggerFactory;
           return lastComparison;
         }
       }
+      lastComparison = Boolean.valueOf(isSetClassLoaderContext()).compareTo(other.isSetClassLoaderContext());
+      if (lastComparison != 0) {
+        return lastComparison;
+      }
+      if (isSetClassLoaderContext()) {
+        lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.classLoaderContext, other.classLoaderContext);
+        if (lastComparison != 0) {
+          return lastComparison;
+        }
+      }
       return 0;
     }
 
@@ -17471,6 +17752,14 @@ import org.slf4j.LoggerFactory;
         sb.append(this.durability);
       }
       first = false;
+      if (!first) sb.append(", ");
+      sb.append("classLoaderContext:");
+      if (this.classLoaderContext == null) {
+        sb.append("null");
+      } else {
+        sb.append(this.classLoaderContext);
+      }
+      first = false;
       sb.append(")");
       return sb.toString();
     }
@@ -17572,6 +17861,14 @@ import org.slf4j.LoggerFactory;
                 org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
               }
               break;
+            case 6: // CLASS_LOADER_CONTEXT
+              if (schemeField.type == org.apache.thrift.protocol.TType.STRING) {
+                struct.classLoaderContext = iprot.readString();
+                struct.setClassLoaderContextIsSet(true);
+              } else { 
+                org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
+              }
+              break;
             default:
               org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type);
           }
@@ -17619,6 +17916,11 @@ import org.slf4j.LoggerFactory;
           oprot.writeI32(struct.durability.getValue());
           oprot.writeFieldEnd();
         }
+        if (struct.classLoaderContext != null) {
+          oprot.writeFieldBegin(CLASS_LOADER_CONTEXT_FIELD_DESC);
+          oprot.writeString(struct.classLoaderContext);
+          oprot.writeFieldEnd();
+        }
         oprot.writeFieldStop();
         oprot.writeStructEnd();
       }
@@ -17652,7 +17954,10 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetDurability()) {
           optionals.set(4);
         }
-        oprot.writeBitSet(optionals, 5);
+        if (struct.isSetClassLoaderContext()) {
+          optionals.set(5);
+        }
+        oprot.writeBitSet(optionals, 6);
         if (struct.isSetTinfo()) {
           struct.tinfo.write(oprot);
         }
@@ -17674,12 +17979,15 @@ import org.slf4j.LoggerFactory;
         if (struct.isSetDurability()) {
           oprot.writeI32(struct.durability.getValue());
         }
+        if (struct.isSetClassLoaderContext()) {
+          oprot.writeString(struct.classLoaderContext);
+        }
       }
 
       @Override
       public void read(org.apache.thrift.protocol.TProtocol prot, startConditionalUpdate_args struct) throws org.apache.thrift.TException {
         TTupleProtocol iprot = (TTupleProtocol) prot;
-        BitSet incoming = iprot.readBitSet(5);
+        BitSet incoming = iprot.readBitSet(6);
         if (incoming.get(0)) {
           struct.tinfo = new org.apache.accumulo.core.trace.thrift.TInfo();
           struct.tinfo.read(iprot);
@@ -17711,6 +18019,10 @@ import org.slf4j.LoggerFactory;
           struct.durability = TDurability.findByValue(iprot.readI32());
           struct.setDurabilityIsSet(true);
         }
+        if (incoming.get(5)) {
+          struct.classLoaderContext = iprot.readString();
+          struct.setClassLoaderContextIsSet(true);
+        }
       }
     }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/core/src/main/thrift/tabletserver.thrift
----------------------------------------------------------------------
diff --git a/core/src/main/thrift/tabletserver.thrift b/core/src/main/thrift/tabletserver.thrift
index 27b72f2..6a45562 100644
--- a/core/src/main/thrift/tabletserver.thrift
+++ b/core/src/main/thrift/tabletserver.thrift
@@ -90,6 +90,7 @@ struct ActiveScan {
     12:map<string, map<string, string>> ssio  /* Server Side Iterator Options */
     13:list<binary> authorizations
     14:optional i64 scanId
+    15:string classLoaderContext /* name of the classloader context */
 }
 
 enum CompactionType {
@@ -160,7 +161,8 @@ service TabletClientService extends client.ClientService {
                              10:bool isolated,
                              12:i64 readaheadThreshold,
                              13:TSamplerConfiguration samplerConfig,
-                             14:i64 batchTimeOut)  throws (1:client.ThriftSecurityException sec, 2:NotServingTabletException nste, 3:TooManyFilesException tmfe, 4:TSampleNotPresentException tsnpe),
+                             14:i64 batchTimeOut,
+                             15:string classLoaderContext /* name of the classloader context */)  throws (1:client.ThriftSecurityException sec, 2:NotServingTabletException nste, 3:TooManyFilesException tmfe, 4:TSampleNotPresentException tsnpe),
                              
   data.ScanResult continueScan(2:trace.TInfo tinfo, 1:data.ScanID scanID)  throws (1:NoSuchScanIDException nssi, 2:NotServingTabletException nste, 3:TooManyFilesException tmfe, 4:TSampleNotPresentException tsnpe),
   oneway void closeScan(2:trace.TInfo tinfo, 1:data.ScanID scanID),
@@ -175,7 +177,8 @@ service TabletClientService extends client.ClientService {
                                   6:list<binary> authorizations,
                                   7:bool waitForWrites,
                                   9:TSamplerConfiguration samplerConfig,
-                                  10:i64 batchTimeOut)  throws (1:client.ThriftSecurityException sec, 2:TSampleNotPresentException tsnpe),
+                                  10:i64 batchTimeOut,
+                                  11:string classLoaderContext /* name of the classloader context */)  throws (1:client.ThriftSecurityException sec, 2:TSampleNotPresentException tsnpe),
   data.MultiScanResult continueMultiScan(2:trace.TInfo tinfo, 1:data.ScanID scanID) throws (1:NoSuchScanIDException nssi, 2:TSampleNotPresentException tsnpe),
   void closeMultiScan(2:trace.TInfo tinfo, 1:data.ScanID scanID) throws (1:NoSuchScanIDException nssi),
   
@@ -190,7 +193,7 @@ service TabletClientService extends client.ClientService {
             2:NotServingTabletException nste, 
             3:ConstraintViolationException cve),
 
-  data.TConditionalSession startConditionalUpdate(1:trace.TInfo tinfo, 2:security.TCredentials credentials, 3:list<binary> authorizations, 4:string tableID, 5:TDurability durability)
+  data.TConditionalSession startConditionalUpdate(1:trace.TInfo tinfo, 2:security.TCredentials credentials, 3:list<binary> authorizations, 4:string tableID, 5:TDurability durability, 6:string classLoaderContext)
      throws (1:client.ThriftSecurityException sec);
   
   list<data.TCMResult> conditionalUpdate(1:trace.TInfo tinfo, 2:data.UpdateID sessID, 3:data.CMBatch mutations, 4:list<string> symbols)

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/docs/src/main/asciidoc/chapters/administration.txt
----------------------------------------------------------------------
diff --git a/docs/src/main/asciidoc/chapters/administration.txt b/docs/src/main/asciidoc/chapters/administration.txt
index f15c416..01c5c5c 100644
--- a/docs/src/main/asciidoc/chapters/administration.txt
+++ b/docs/src/main/asciidoc/chapters/administration.txt
@@ -344,6 +344,49 @@ very sensitive to an excessive number of nodes and the sizes of the nodes. Appli
 which leverage the user of custom properties should take these warnings into
 consideration. There is no enforcement of these warnings via the API.
 
+==== Configuring the ClassLoader
+
+Accumulo loads classes from the locations specified in the +general.classpaths+ property. Additionally, Accumulo will load classes
+from the locations specified in the +general.dynamic.classpaths+ property and will monitor and reload them if they change. The reloading 
+feature is useful during the development and testing of iterators as new or modified iterator classes can be deployed to Accumulo without
+having to restart the database.
+
+Accumulo also has an alternate configuration for the classloader which will allow it to load classes from remote locations. This mechanism
+uses Apache Commons VFS which enables locations such as http and hdfs to be used. This alternate configuration also uses the
++general.classpaths+ property in the same manner described above. It differs in that you need to configure the
++general.vfs.classpaths+ property instead of the +general.dynamic.classpath+ property. As in the default configuration, this alternate
+configuration will also monitor the vfs locations for changes and reload if necessary.
+
+===== ClassLoader Contexts
+
+With the addition of the VFS based classloader, we introduced the notion of classloader contexts. A context is identified
+by a name and references a set of locations from which to load classes and can be specified in the accumulo-site.xml file or added
+using the +config+ command in the shell. Below is an example for specify the app1 context in the accumulo-site.xml file:
+
+[source,xml]
+<property>
+  <name>general.vfs.context.classpath.app1</name>
+  <value>hdfs://localhost:8020/applicationA/classpath/.*.jar,file:///opt/applicationA/lib/.*.jar</value>
+  <description>Application A classpath, loads jars from HDFS and local file system</description>
+</property>
+
+The default behavior follows the Java ClassLoader contract in that classes, if they exists, are loaded from the parent classloader first.
+You can override this behavior by delegating to the parent classloader after looking in this classloader first. An example of this
+configuration is:
+
+[source,xml]
+<property>
+  <name>general.vfs.context.classpath.app1.delegation=post</name>
+  <value>hdfs://localhost:8020/applicationA/classpath/.*.jar,file:///opt/applicationA/lib/.*.jar</value>
+  <description>Application A classpath, loads jars from HDFS and local file system</description>
+</property>
+
+To use contexts in your application you can set the +table.classpath.context+ on your tables or use the +setClassLoaderContext()+ method on Scanner
+and BatchScanner passing in the name of the context, app1 in the example above. Setting the property on the table allows your minc, majc, and scan 
+iterators to load classes from the locations defined by the context. Passing the context name to the scanners allows you to override the table setting
+to load only scan time iterators from a different location. 
+
+
 === Initialization
 
 Accumulo must be initialized to create the structures it uses internally to locate

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
index d2d6664..87c781a 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/VerifyTabletAssignments.java
@@ -189,7 +189,7 @@ public class VerifyTabletAssignments {
     List<IterInfo> emptyListIterInfo = Collections.emptyList();
     List<TColumn> emptyListColumn = Collections.emptyList();
     InitialMultiScan is = client.startMultiScan(tinfo, context.rpcCreds(), batch, emptyListColumn, emptyListIterInfo, emptyMapSMapSS,
-        Authorizations.EMPTY.getAuthorizationsBB(), false, null, 0L);
+        Authorizations.EMPTY.getAuthorizationsBB(), false, null, 0L, null);
     if (is.result.more) {
       MultiScanResult result = client.continueMultiScan(tinfo, is.scanID);
       checkFailures(entry.getKey(), failures, result);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/NullScanner.java
----------------------------------------------------------------------
diff --git a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/NullScanner.java b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/NullScanner.java
index 2c46835..a935948 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/NullScanner.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/trace/NullScanner.java
@@ -145,4 +145,15 @@ public class NullScanner implements Scanner {
 
   @Override
   public void clearSamplerConfiguration() {}
+
+  @Override
+  public void setClassLoaderContext(String context) {}
+
+  @Override
+  public void clearClassLoaderContext() {}
+
+  @Override
+  public String getClassLoaderContext() {
+    return null;
+  }
 }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 4bea838..72d21c2 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -459,8 +459,8 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
     @Override
     public InitialScan startScan(TInfo tinfo, TCredentials credentials, TKeyExtent textent, TRange range, List<TColumn> columns, int batchSize,
         List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites, boolean isolated,
-        long readaheadThreshold, TSamplerConfiguration tSamplerConfig, long batchTimeOut) throws NotServingTabletException, ThriftSecurityException,
-        org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException, TSampleNotPresentException {
+        long readaheadThreshold, TSamplerConfiguration tSamplerConfig, long batchTimeOut, String context) throws NotServingTabletException,
+        ThriftSecurityException, org.apache.accumulo.core.tabletserver.thrift.TooManyFilesException, TSampleNotPresentException {
 
       String tableId = new String(textent.getTable(), UTF_8);
       if (!security.canScan(credentials, tableId, Tables.getNamespaceId(getInstance(), tableId), range, columns, ssiList, ssio, authorizations))
@@ -494,9 +494,9 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
       }
 
       final ScanSession scanSession = new ScanSession(credentials, extent, columnSet, ssiList, ssio, new Authorizations(authorizations), readaheadThreshold,
-          batchTimeOut);
+          batchTimeOut, context);
       scanSession.scanner = tablet.createScanner(new Range(range), batchSize, scanSession.columnSet, scanSession.auths, ssiList, ssio, isolated,
-          scanSession.interruptFlag, SamplerConfigurationImpl.fromThrift(tSamplerConfig), scanSession.batchTimeOut);
+          scanSession.interruptFlag, SamplerConfigurationImpl.fromThrift(tSamplerConfig), scanSession.batchTimeOut, scanSession.context);
 
       long sid = sessionManager.createSession(scanSession, true);
 
@@ -611,7 +611,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
     @Override
     public InitialMultiScan startMultiScan(TInfo tinfo, TCredentials credentials, Map<TKeyExtent,List<TRange>> tbatch, List<TColumn> tcolumns,
         List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, List<ByteBuffer> authorizations, boolean waitForWrites,
-        TSamplerConfiguration tSamplerConfig, long batchTimeOut) throws ThriftSecurityException, TSampleNotPresentException {
+        TSamplerConfiguration tSamplerConfig, long batchTimeOut, String context) throws ThriftSecurityException, TSampleNotPresentException {
       // find all of the tables that need to be scanned
       final HashSet<String> tables = new HashSet<String>();
       for (TKeyExtent keyExtent : tbatch.keySet()) {
@@ -643,7 +643,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
         writeTracker.waitForWrites(TabletType.type(batch.keySet()));
 
       final MultiScanSession mss = new MultiScanSession(credentials, threadPoolExtent, batch, ssiList, ssio, new Authorizations(authorizations),
-          SamplerConfigurationImpl.fromThrift(tSamplerConfig), batchTimeOut);
+          SamplerConfigurationImpl.fromThrift(tSamplerConfig), batchTimeOut, context);
 
       mss.numTablets = batch.size();
       for (List<Range> ranges : batch.values()) {
@@ -1140,7 +1140,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
 
         IterConfig ic = compressedIters.decompress(tc.iterators);
 
-        Scanner scanner = tablet.createScanner(range, 1, EMPTY_COLUMNS, cs.auths, ic.ssiList, ic.ssio, false, cs.interruptFlag, null, 0);
+        Scanner scanner = tablet.createScanner(range, 1, EMPTY_COLUMNS, cs.auths, ic.ssiList, ic.ssio, false, cs.interruptFlag, null, 0, cs.classLoaderContext);
 
         try {
           ScanBatch batch = scanner.read();
@@ -1301,7 +1301,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
 
     @Override
     public TConditionalSession startConditionalUpdate(TInfo tinfo, TCredentials credentials, List<ByteBuffer> authorizations, String tableId,
-        TDurability tdurabilty) throws ThriftSecurityException, TException {
+        TDurability tdurabilty, String classLoaderContext) throws ThriftSecurityException, TException {
 
       Authorizations userauths = null;
       if (!security.canConditionallyUpdate(credentials, tableId, Tables.getNamespaceId(getInstance(), tableId), authorizations))
@@ -1312,7 +1312,8 @@ public class TabletServer extends AccumuloServerContext implements Runnable {
         if (!userauths.contains(ByteBufferUtil.toBytes(auth)))
           throw new ThriftSecurityException(credentials.getPrincipal(), SecurityErrorCode.BAD_AUTHORIZATIONS);
 
-      ConditionalSession cs = new ConditionalSession(credentials, new Authorizations(authorizations), tableId, DurabilityImpl.fromThrift(tdurabilty));
+      ConditionalSession cs = new ConditionalSession(credentials, new Authorizations(authorizations), tableId, DurabilityImpl.fromThrift(tdurabilty),
+          classLoaderContext);
 
       long sid = sessionManager.createSession(cs, false);
       return new TConditionalSession(sid, lockID, sessionManager.getMaxIdleTime());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
index 2d745cb..378e98d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/scan/LookupTask.java
@@ -112,7 +112,7 @@ public class LookupTask extends ScanTask<MultiScanResult> {
             interruptFlag.set(true);
 
           lookupResult = tablet.lookup(entry.getValue(), session.columnSet, session.auths, results, maxResultsSize - bytesAdded, session.ssiList, session.ssio,
-              interruptFlag, session.samplerConfig, session.batchTimeOut);
+              interruptFlag, session.samplerConfig, session.batchTimeOut, session.context);
 
           // if the tablet was closed it it possible that the
           // interrupt flag was set.... do not want it set for

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
index cd5e617..3068f14 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ConditionalSession.java
@@ -28,13 +28,15 @@ public class ConditionalSession extends Session {
   public final String tableId;
   public final AtomicBoolean interruptFlag = new AtomicBoolean();
   public final Durability durability;
+  public final String classLoaderContext;
 
-  public ConditionalSession(TCredentials credentials, Authorizations authorizations, String tableId, Durability durability) {
+  public ConditionalSession(TCredentials credentials, Authorizations authorizations, String tableId, Durability durability, String classLoaderContext) {
     super(credentials);
     this.credentials = credentials;
     this.auths = authorizations;
     this.tableId = tableId;
     this.durability = durability;
+    this.classLoaderContext = classLoaderContext;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
index 16fc218..9b06ec1 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/MultiScanSession.java
@@ -39,6 +39,7 @@ public class MultiScanSession extends Session {
   public final Authorizations auths;
   public final SamplerConfiguration samplerConfig;
   public final long batchTimeOut;
+  public final String context;
 
   // stats
   public int numRanges;
@@ -49,7 +50,7 @@ public class MultiScanSession extends Session {
   public volatile ScanTask<MultiScanResult> lookupTask;
 
   public MultiScanSession(TCredentials credentials, KeyExtent threadPoolExtent, Map<KeyExtent,List<Range>> queries, List<IterInfo> ssiList,
-      Map<String,Map<String,String>> ssio, Authorizations authorizations, SamplerConfiguration samplerConfig, long batchTimeOut) {
+      Map<String,Map<String,String>> ssio, Authorizations authorizations, SamplerConfiguration samplerConfig, long batchTimeOut, String context) {
     super(credentials);
     this.queries = queries;
     this.ssiList = ssiList;
@@ -58,6 +59,7 @@ public class MultiScanSession extends Session {
     this.threadPoolExtent = threadPoolExtent;
     this.samplerConfig = samplerConfig;
     this.batchTimeOut = batchTimeOut;
+    this.context = context;
   }
 
   @Override

http://git-wip-us.apache.org/repos/asf/accumulo/blob/0e1da5a5/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
index 7a1d400..3b14ad1 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/session/ScanSession.java
@@ -45,9 +45,10 @@ public class ScanSession extends Session {
   public Scanner scanner;
   public final long readaheadThreshold;
   public final long batchTimeOut;
+  public final String context;
 
   public ScanSession(TCredentials credentials, KeyExtent extent, Set<Column> columnSet, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio,
-      Authorizations authorizations, long readaheadThreshold, long batchTimeOut) {
+      Authorizations authorizations, long readaheadThreshold, long batchTimeOut, String context) {
     super(credentials);
     this.extent = extent;
     this.columnSet = columnSet;
@@ -56,6 +57,7 @@ public class ScanSession extends Session {
     this.auths = authorizations;
     this.readaheadThreshold = readaheadThreshold;
     this.batchTimeOut = batchTimeOut;
+    this.context = context;
   }
 
   @Override