accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From els...@apache.org
Subject [07/21] git commit: ACCUMULO-2234 Replace usages of Instance.getConfiguration with the server-side configuration
Date Fri, 24 Jan 2014 02:15:40 GMT
ACCUMULO-2234 Replace usages of Instance.getConfiguration with the server-side configuration

Pull the site configuration from instanceOperations off of the Connector which gives
us access to the accumulo-site.xml file being used by that instance and alleviates the
need for us to provide it ourselves.


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

Branch: refs/heads/1.4.5-SNAPSHOT
Commit: 36cec4f33b807ccbd9c2979d886eb842aaab2d74
Parents: 66516a0
Author: Josh Elser <elserj@apache.org>
Authored: Thu Jan 23 17:54:44 2014 -0500
Committer: Josh Elser <elserj@apache.org>
Committed: Thu Jan 23 18:50:01 2014 -0500

----------------------------------------------------------------------
 .../apache/accumulo/core/client/impl/OfflineScanner.java    | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/36cec4f3/src/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
----------------------------------------------------------------------
diff --git a/src/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
b/src/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
index d1f90b3..244bfef 100644
--- a/src/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
+++ b/src/core/src/main/java/org/apache/accumulo/core/client/impl/OfflineScanner.java
@@ -22,16 +22,19 @@ import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Map;
 import java.util.Map.Entry;
 
 import org.apache.accumulo.core.Constants;
 import org.apache.accumulo.core.client.AccumuloException;
+import org.apache.accumulo.core.client.AccumuloSecurityException;
 import org.apache.accumulo.core.client.Connector;
 import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.RowIterator;
 import org.apache.accumulo.core.client.Scanner;
 import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.ConfigurationCopy;
 import org.apache.accumulo.core.conf.Property;
 import org.apache.accumulo.core.data.Column;
 import org.apache.accumulo.core.data.Key;
@@ -114,6 +117,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>>
{
   private Instance instance;
   private ScannerOptions options;
   private ArrayList<SortedKeyValueIterator<Key,Value>> readers;
+  private AccumuloConfiguration config;
 
   public OfflineIterator(ScannerOptions options, Instance instance, AuthInfo credentials,
Authorizations authorizations, Text table, Range range) {
     this.options = new ScannerOptions(options);
@@ -130,6 +134,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>>
{
 
     try {
       conn = instance.getConnector(credentials);
+      config = new ConfigurationCopy(conn.instanceOperations().getSiteConfiguration());
       nextTablet();
 
       while (iter != null && !iter.hasTop())
@@ -223,7 +228,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>>
{
     if (currentExtent != null && !extent.isPreviousExtent(currentExtent))
       throw new AccumuloException(" " + currentExtent + " is not previous extent " + extent);
 
-    String tablesDir = Constants.getTablesDir(instance.getConfiguration());
+    String tablesDir = Constants.getTablesDir(config);
     List<String> absFiles = new ArrayList<String>();
     for (String relPath : relFiles) {
       if (relPath.startsWith(".."))
@@ -285,7 +290,7 @@ class OfflineIterator implements Iterator<Entry<Key,Value>>
{
 
     Configuration conf = CachedConfiguration.getInstance();
 
-    FileSystem fs = FileUtil.getFileSystem(conf, instance.getConfiguration());
+    FileSystem fs = FileUtil.getFileSystem(conf, config);
 
     for (SortedKeyValueIterator<Key,Value> reader : readers) {
       ((FileSKVIterator) reader).close();


Mime
View raw message