accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [6/6] accumulo git commit: Revert "ACCUMULO-3197 Remove deprecated Instance.getConfiguration()"
Date Thu, 15 Jan 2015 22:42:05 GMT
Revert "ACCUMULO-3197 Remove deprecated Instance.getConfiguration()"

This reverts commit 8fe826dd119289165cb19e9cdf922bb4ce933324.

Conflicts:
	core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ConditionalWriterImpl.java
	core/src/main/java/org/apache/accumulo/core/client/impl/InstanceOperationsImpl.java
	core/src/main/java/org/apache/accumulo/core/client/impl/MasterClient.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ReplicationClient.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ScannerIterator.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ServerClient.java
	core/src/main/java/org/apache/accumulo/core/client/impl/ServerConfigurationUtil.java
	core/src/main/java/org/apache/accumulo/core/client/impl/TableOperationsImpl.java
	core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchReaderIterator.java
	core/src/main/java/org/apache/accumulo/core/client/impl/TabletServerBatchWriter.java
	core/src/main/java/org/apache/accumulo/core/client/impl/Writer.java
	core/src/main/java/org/apache/accumulo/core/metadata/MetadataLocationObtainer.java
	core/src/test/java/org/apache/accumulo/core/client/impl/ClientConfigurationHelperTest.java
	core/src/test/java/org/apache/accumulo/core/client/impl/ClientContextTest.java
	core/src/test/java/org/apache/accumulo/core/client/impl/ServerConfigurationUtilTest.java
	server/tserver/src/main/java/org/apache/accumulo/tserver/replication/AccumuloReplicaSystem.java
	server/tserver/src/main/java/org/apache/accumulo/tserver/replication/ReplicationServicerHandler.java
	shell/src/main/java/org/apache/accumulo/shell/Shell.java
	test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java


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

Branch: refs/heads/master
Commit: aae9e977fe5f1e078851d4c9cac46b4418519c8a
Parents: 112f5e7
Author: Christopher Tubbs <ctubbsii@apache.org>
Authored: Thu Jan 15 17:33:03 2015 -0500
Committer: Christopher Tubbs <ctubbsii@apache.org>
Committed: Thu Jan 15 17:41:35 2015 -0500

----------------------------------------------------------------------
 .../apache/accumulo/core/client/Instance.java   | 23 ++++++++++++++++++++
 .../accumulo/core/client/ZooKeeperInstance.java | 14 ++++++++++++
 .../accumulo/core/client/mock/MockInstance.java | 16 ++++++++++++++
 .../core/client/impl/TabletLocatorImplTest.java | 13 +++++++++++
 .../accumulo/server/client/HdfsZooInstance.java | 15 +++++++++++++
 .../server/security/SystemCredentialsIT.java    | 23 ++++++++++++++++++++
 6 files changed, 104 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/core/src/main/java/org/apache/accumulo/core/client/Instance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/Instance.java b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
index ff6375b..8a70d4c 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/Instance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/Instance.java
@@ -19,8 +19,10 @@ package org.apache.accumulo.core.client;
 import java.nio.ByteBuffer;
 import java.util.List;
 
+import org.apache.accumulo.core.client.admin.InstanceOperations;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
 
 /**
  * This class represents the information a client needs to know to connect to an instance
of accumulo.
@@ -121,6 +123,27 @@ public interface Instance {
   Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException;
 
   /**
+   * Returns the AccumuloConfiguration to use when interacting with this instance.
+   *
+   * @return the AccumuloConfiguration that specifies properties related to interacting with
this instance
+   * @deprecated since 1.6.0. This method makes very little sense in the context of the client
API and never should have been exposed.
+   * @see InstanceOperations#getSystemConfiguration() for client-side reading of the server-side
configuration.
+   */
+  @Deprecated
+  AccumuloConfiguration getConfiguration();
+
+  /**
+   * Set the AccumuloConfiguration to use when interacting with this instance.
+   *
+   * @param conf
+   *          accumulo configuration
+   * @deprecated since 1.6.0. This method makes very little sense in the context of the client
API and never should have been exposed.
+   * @see InstanceOperations#setProperty(String, String)
+   */
+  @Deprecated
+  void setConfiguration(AccumuloConfiguration conf);
+
+  /**
    * Returns a connection to this instance of accumulo.
    *
    * @param principal

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
index 7c8f2e2..2baa856 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/ZooKeeperInstance.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.client.impl.ConnectorImpl;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
 import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.metadata.RootTable;
 import org.apache.accumulo.core.security.Credentials;
 import org.apache.accumulo.core.util.ByteBufferUtil;
@@ -71,6 +72,7 @@ public class ZooKeeperInstance implements Instance {
 
   private final int zooKeepersSessionTimeOut;
 
+  private AccumuloConfiguration conf;
   private ClientConfiguration clientConf;
 
   /**
@@ -247,6 +249,18 @@ public class ZooKeeperInstance implements Instance {
     return getConnector(principal, new PasswordToken(pass));
   }
 
+  @Override
+  @Deprecated
+  public AccumuloConfiguration getConfiguration() {
+    return conf = conf == null ? DefaultConfiguration.getInstance() : ClientContext.convertClientConfig(clientConf);
+  }
+
+  @Override
+  @Deprecated
+  public void setConfiguration(AccumuloConfiguration conf) {
+    this.conf = conf;
+  }
+
   /**
    * Given a zooCache and instanceId, look up the instance name.
    */

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java b/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
index 67435d2..01dc91b 100644
--- a/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
+++ b/core/src/main/java/org/apache/accumulo/core/client/mock/MockInstance.java
@@ -30,6 +30,8 @@ import org.apache.accumulo.core.client.Instance;
 import org.apache.accumulo.core.client.impl.thrift.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
+import org.apache.accumulo.core.conf.DefaultConfiguration;
 import org.apache.accumulo.core.security.Credentials;
 import org.apache.accumulo.core.util.ByteBufferUtil;
 import org.apache.accumulo.core.util.CachedConfiguration;
@@ -134,6 +136,20 @@ public class MockInstance implements Instance {
     return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
   }
 
+  AccumuloConfiguration conf = null;
+
+  @Deprecated
+  @Override
+  public AccumuloConfiguration getConfiguration() {
+    return conf == null ? DefaultConfiguration.getInstance() : conf;
+  }
+
+  @Override
+  @Deprecated
+  public void setConfiguration(AccumuloConfiguration conf) {
+    this.conf = conf;
+  }
+
   @Override
   public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException,
AccumuloSecurityException {
     Connector conn = new MockConnector(new Credentials(principal, token), acu, this);

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
b/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
index 2181451..939a64c 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/impl/TabletLocatorImplTest.java
@@ -45,6 +45,7 @@ import org.apache.accumulo.core.client.impl.TabletLocator.TabletServerMutations;
 import org.apache.accumulo.core.client.impl.TabletLocatorImpl.TabletLocationObtainer;
 import org.apache.accumulo.core.client.impl.TabletLocatorImpl.TabletServerLockChecker;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.KeyExtent;
 import org.apache.accumulo.core.data.Mutation;
@@ -451,6 +452,18 @@ public class TabletLocatorImplTest {
       throw new UnsupportedOperationException();
     }
 
+    @Deprecated
+    @Override
+    public AccumuloConfiguration getConfiguration() {
+      throw new UnsupportedOperationException();
+    }
+
+    @Override
+    @Deprecated
+    public void setConfiguration(AccumuloConfiguration conf) {
+      throw new UnsupportedOperationException();
+    }
+
     @Override
     @Deprecated
     public Connector getConnector(String user, CharSequence pass) throws AccumuloException,
AccumuloSecurityException {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
index 3175fff..f64f941 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/client/HdfsZooInstance.java
@@ -46,6 +46,7 @@ import org.apache.accumulo.core.zookeeper.ZooUtil;
 import org.apache.accumulo.fate.zookeeper.ZooCache;
 import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
 import org.apache.accumulo.server.Accumulo;
+import org.apache.accumulo.server.conf.ServerConfigurationFactory;
 import org.apache.accumulo.server.fs.VolumeManager;
 import org.apache.accumulo.server.fs.VolumeManagerImpl;
 import org.apache.accumulo.server.zookeeper.ZooLock;
@@ -176,6 +177,20 @@ public class HdfsZooInstance implements Instance {
     return getConnector(user, TextUtil.getBytes(new Text(pass.toString())));
   }
 
+  private AccumuloConfiguration conf = null;
+
+  @Deprecated
+  @Override
+  public AccumuloConfiguration getConfiguration() {
+    return conf = conf == null ? new ServerConfigurationFactory(this).getConfiguration()
: conf;
+  }
+
+  @Override
+  @Deprecated
+  public void setConfiguration(AccumuloConfiguration conf) {
+    this.conf = conf;
+  }
+
   public static void main(String[] args) {
     Instance instance = HdfsZooInstance.getInstance();
     System.out.println("Instance Name: " + instance.getInstanceName());

http://git-wip-us.apache.org/repos/asf/accumulo/blob/aae9e977/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
b/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
index 3889110..216ac3e 100644
--- a/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
+++ b/test/src/test/java/org/apache/accumulo/server/security/SystemCredentialsIT.java
@@ -31,6 +31,7 @@ import org.apache.accumulo.core.client.TableNotFoundException;
 import org.apache.accumulo.core.client.security.SecurityErrorCode;
 import org.apache.accumulo.core.client.security.tokens.AuthenticationToken;
 import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.conf.AccumuloConfiguration;
 import org.apache.accumulo.core.data.Key;
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.metadata.RootTable;
@@ -63,6 +64,12 @@ public class SystemCredentialsIT extends ConfigurableMacIT {
     if (args[0].equals("bad")) {
       Instance inst = new Instance() {
 
+        @Deprecated
+        @Override
+        public void setConfiguration(AccumuloConfiguration conf) {
+          throw new UnsupportedOperationException();
+        }
+
         @Override
         public int getZooKeepersSessionTimeOut() {
           throw new UnsupportedOperationException();
@@ -116,6 +123,12 @@ public class SystemCredentialsIT extends ConfigurableMacIT {
           throw new UnsupportedOperationException();
         }
 
+        @Deprecated
+        @Override
+        public AccumuloConfiguration getConfiguration() {
+          throw new UnsupportedOperationException();
+        }
+
       };
       creds = SystemCredentials.get(inst);
     } else if (args[0].equals("good")) {
@@ -176,6 +189,16 @@ public class SystemCredentialsIT extends ConfigurableMacIT {
           throw new UnsupportedOperationException();
         }
 
+        @Override
+        public AccumuloConfiguration getConfiguration() {
+          throw new UnsupportedOperationException();
+        }
+
+        @Override
+        public void setConfiguration(AccumuloConfiguration conf) {
+          throw new UnsupportedOperationException();
+        }
+
       };
       creds = new SystemCredentials(inst, "!SYSTEM", new PasswordToken("fake"));
     }


Mime
View raw message