You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ct...@apache.org on 2014/08/23 02:37:52 UTC
[1/9] git commit: ACCUMULO-2037 Close scanner
Repository: accumulo
Updated Branches:
refs/heads/1.6.1-SNAPSHOT 705a60d19 -> 23c74cd44
refs/heads/master d4d573347 -> 21d3c88d8
ACCUMULO-2037 Close scanner
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ac2e6016
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ac2e6016
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ac2e6016
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: ac2e60164626e51e5932d0c30c6b4b68ea1414c1
Parents: 705a60d
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 19:54:50 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 19:54:50 2014 -0400
----------------------------------------------------------------------
.../accumulo/test/functional/MasterAssignmentIT.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ac2e6016/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
index 298466d..46f6b23 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.io.Text;
import org.junit.Test;
public class MasterAssignmentIT extends SimpleMacIT {
-
+
@Override
protected int defaultTimeoutSeconds() {
return 2 * 60;
@@ -55,7 +55,7 @@ public class MasterAssignmentIT extends SimpleMacIT {
} while (newTablet.current == null);
assertNull(newTablet.last);
assertNull(newTablet.future);
-
+
// put something in it
BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
Mutation m = new Mutation("a");
@@ -64,19 +64,19 @@ public class MasterAssignmentIT extends SimpleMacIT {
bw.close();
// give it a last location
c.tableOperations().flush(tableName, null, null, true);
-
+
TabletLocationState flushed = getTabletLocationState(c, tableId);
assertEquals(newTablet.current, flushed.current);
assertEquals(flushed.current, flushed.last);
assertNull(newTablet.future);
-
+
// take the tablet offline
c.tableOperations().offline(tableName, true);
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
assertEquals(flushed.current, offline.last);
-
+
// put it back online
c.tableOperations().online(tableName, true);
TabletLocationState online = getTabletLocationState(c, tableId);
@@ -88,6 +88,8 @@ public class MasterAssignmentIT extends SimpleMacIT {
private TabletLocationState getTabletLocationState(Connector c, String tableId) {
Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));
MetaDataTableScanner s = new MetaDataTableScanner(c.getInstance(), creds, new Range(KeyExtent.getMetadataEntry(new Text(tableId), null)));
- return s.next();
+ TabletLocationState tlState = s.next();
+ s.close();
+ return tlState;
}
}
[2/9] git commit: ACCUMULO-2037 Close scanner
Posted by ct...@apache.org.
ACCUMULO-2037 Close scanner
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/ac2e6016
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/ac2e6016
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/ac2e6016
Branch: refs/heads/master
Commit: ac2e60164626e51e5932d0c30c6b4b68ea1414c1
Parents: 705a60d
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 19:54:50 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 19:54:50 2014 -0400
----------------------------------------------------------------------
.../accumulo/test/functional/MasterAssignmentIT.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/ac2e6016/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
index 298466d..46f6b23 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
@@ -35,7 +35,7 @@ import org.apache.hadoop.io.Text;
import org.junit.Test;
public class MasterAssignmentIT extends SimpleMacIT {
-
+
@Override
protected int defaultTimeoutSeconds() {
return 2 * 60;
@@ -55,7 +55,7 @@ public class MasterAssignmentIT extends SimpleMacIT {
} while (newTablet.current == null);
assertNull(newTablet.last);
assertNull(newTablet.future);
-
+
// put something in it
BatchWriter bw = c.createBatchWriter(tableName, new BatchWriterConfig());
Mutation m = new Mutation("a");
@@ -64,19 +64,19 @@ public class MasterAssignmentIT extends SimpleMacIT {
bw.close();
// give it a last location
c.tableOperations().flush(tableName, null, null, true);
-
+
TabletLocationState flushed = getTabletLocationState(c, tableId);
assertEquals(newTablet.current, flushed.current);
assertEquals(flushed.current, flushed.last);
assertNull(newTablet.future);
-
+
// take the tablet offline
c.tableOperations().offline(tableName, true);
TabletLocationState offline = getTabletLocationState(c, tableId);
assertNull(offline.future);
assertNull(offline.current);
assertEquals(flushed.current, offline.last);
-
+
// put it back online
c.tableOperations().online(tableName, true);
TabletLocationState online = getTabletLocationState(c, tableId);
@@ -88,6 +88,8 @@ public class MasterAssignmentIT extends SimpleMacIT {
private TabletLocationState getTabletLocationState(Connector c, String tableId) {
Credentials creds = new Credentials("root", new PasswordToken(ROOT_PASSWORD));
MetaDataTableScanner s = new MetaDataTableScanner(c.getInstance(), creds, new Range(KeyExtent.getMetadataEntry(new Text(tableId), null)));
- return s.next();
+ TabletLocationState tlState = s.next();
+ s.close();
+ return tlState;
}
}
[5/9] git commit: ACCUMULO-3081 Removed commented-out code
Posted by ct...@apache.org.
ACCUMULO-3081 Removed commented-out code
The code looked out of date, and did not compile, so I could not leave in the
unused tests with @Ignore. The tests can be reintroduced later, if needed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d61b6944
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d61b6944
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d61b6944
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: d61b6944cccbaa5e57e9d922fd4347522dde9625
Parents: da28b8b
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 20:12:25 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 20:12:25 2014 -0400
----------------------------------------------------------------------
.../conf/ServerConfigurationFactoryTest.java | 49 +++++---------------
1 file changed, 12 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d61b6944/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
index bb89b04..7f07d94 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
@@ -16,6 +16,17 @@
*/
package org.apache.accumulo.server.conf;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.endsWith;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -23,14 +34,10 @@ import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
-
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import static org.junit.Assert.*;
-import org.easymock.Capture;
-import static org.easymock.EasyMock.*;
public class ServerConfigurationFactoryTest {
private static final String ZK_HOST = "localhost";
@@ -70,7 +77,7 @@ public class ServerConfigurationFactoryTest {
@After
public void tearDown() throws Exception {
- scf.clearCachedConfigurations();
+ ServerConfigurationFactory.clearCachedConfigurations();
}
private void mockInstanceForConfig() {
@@ -102,7 +109,6 @@ public class ServerConfigurationFactoryTest {
ready();
SiteConfiguration c = scf.getSiteConfiguration();
assertNotNull(c);
- // TBD: assertTrue(c.getParent() instanceof DefaultConfiguration);
}
@Test
@@ -111,11 +117,9 @@ public class ServerConfigurationFactoryTest {
ready();
AccumuloConfiguration c = scf.getConfiguration();
assertNotNull(c);
- // TBD: assertTrue(c.getParent() instanceof SiteConfiguration);
}
private static final String NSID = "NAMESPACE";
- private static final String TABLE = "TABLE";
@Test
public void testGetNamespaceConfiguration() {
@@ -123,37 +127,8 @@ public class ServerConfigurationFactoryTest {
ready();
NamespaceConfiguration c = scf.getNamespaceConfiguration(NSID);
assertEquals(NSID, c.getNamespaceId());
- // TBD: assertTrue(c.getParent() instanceof AccumuloConfiguration);
assertSame(c, scf.getNamespaceConfiguration(NSID));
}
- /*
- * TBD: need to work around Tables.getNamespaceId() call in constructor
- @Test
- public void testGetNamespaceConfigurationForTable() {
- mockInstanceForConfig();
- ready();
- NamespaceConfiguration c = scf.getNamespaceConfigurationForTable(TABLE);
- assertTrue(c instanceof TableParentConfiguration);
- assertEquals(TABLE, ((TableParentConfiguration) c).getTableId());
- // TBD: assertTrue(c.getParent() instanceof AccumuloConfiguration);
-
- assertSame(c, scf.getNamespaceConfigurationForTable(TABLE));
- }
- */
-
- /*
- * TBD: ditto
- @Test
- public void testGetTableConfiguration() {
- mockInstanceForConfig();
- ready();
- TableConfiguration c = scf.getTableConfiguration(TABLE);
- assertEquals(TABLE, c.getTableId());
- // TBD: assertTrue(c.getParent() instanceof TableParentConfiguration);
-
- assertSame(c, scf.getTableConfiguration(TABLE));
- }
- */
}
[9/9] git commit: Merge branch '1.6.1-SNAPSHOT'
Posted by ct...@apache.org.
Merge branch '1.6.1-SNAPSHOT'
Conflicts:
core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
test/src/test/java/org/apache/accumulo/test/functional/MasterAssignmentIT.java
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/21d3c88d
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/21d3c88d
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/21d3c88d
Branch: refs/heads/master
Commit: 21d3c88d8a2e933baae4648ac4a888e61cdc72f5
Parents: d4d5733 23c74cd
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 20:35:48 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 20:35:48 2014 -0400
----------------------------------------------------------------------
.../conf/CredentialProviderFactoryShim.java | 2 -
.../core/conf/DefaultConfiguration.java | 2 +-
.../client/mapreduce/RangeInputSplitTest.java | 31 +++++++------
.../minicluster/MiniAccumuloCluster.java | 10 ++---
.../minicluster/MiniAccumuloClusterTest.java | 1 -
.../server/conf/NamespaceConfiguration.java | 3 +-
.../server/conf/ServerConfigurationFactory.java | 13 ++++--
.../server/conf/TableConfiguration.java | 3 +-
.../server/conf/ZooCachePropertyAccessor.java | 42 +++++++++++-------
.../accumulo/server/conf/ZooConfiguration.java | 18 ++++----
.../accumulo/server/util/MetadataTableUtil.java | 1 -
.../conf/ServerConfigurationFactoryTest.java | 31 -------------
.../server/conf/TableConfigurationTest.java | 14 +++---
.../conf/ZooCachePropertyAccessorTest.java | 9 ++--
.../server/fs/VolumeManagerImplTest.java | 6 +--
.../accumulo/gc/SimpleGarbageCollector.java | 46 ++++++++++++--------
.../monitor/servlets/ReplicationServlet.java | 17 ++++----
.../test/functional/MasterAssignmentIT.java | 18 ++++----
18 files changed, 128 insertions(+), 139 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
----------------------------------------------------------------------
diff --cc mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
index 1ea0450,0000000..833e594
mode 100644,000000..100644
--- a/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
+++ b/mapreduce/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
@@@ -1,126 -1,0 +1,125 @@@
+/*
+ * 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.core.client.mapreduce;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.apache.accumulo.core.client.IteratorSetting;
+import org.apache.accumulo.core.client.security.tokens.PasswordToken;
+import org.apache.accumulo.core.data.Key;
+import org.apache.accumulo.core.data.Range;
+import org.apache.accumulo.core.iterators.user.SummingCombiner;
+import org.apache.accumulo.core.iterators.user.WholeRowIterator;
+import org.apache.accumulo.core.security.Authorizations;
+import org.apache.accumulo.core.util.Pair;
+import org.apache.hadoop.io.Text;
+import org.apache.log4j.Level;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class RangeInputSplitTest {
+
+ @Test
+ public void testSimpleWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
++ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
++
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ DataOutputStream dos = new DataOutputStream(baos);
+ split.write(dos);
-
++
+ RangeInputSplit newSplit = new RangeInputSplit();
-
++
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ DataInputStream dis = new DataInputStream(bais);
+ newSplit.readFields(dis);
-
++
+ Assert.assertEquals(split.getTableName(), newSplit.getTableName());
+ Assert.assertEquals(split.getTableId(), newSplit.getTableId());
+ Assert.assertEquals(split.getRange(), newSplit.getRange());
+ Assert.assertTrue(Arrays.equals(split.getLocations(), newSplit.getLocations()));
+ }
+
- @SuppressWarnings("deprecation")
+ @Test
+ public void testAllFieldsWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
++ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
++
+ Set<Pair<Text,Text>> fetchedColumns = new HashSet<Pair<Text,Text>>();
-
++
+ fetchedColumns.add(new Pair<Text,Text>(new Text("colf1"), new Text("colq1")));
+ fetchedColumns.add(new Pair<Text,Text>(new Text("colf2"), new Text("colq2")));
+
+ // Fake some iterators
+ ArrayList<IteratorSetting> iterators = new ArrayList<IteratorSetting>();
+ IteratorSetting setting = new IteratorSetting(50, SummingCombiner.class);
+ setting.addOption("foo", "bar");
+ iterators.add(setting);
+
+ setting = new IteratorSetting(100, WholeRowIterator.class);
+ setting.addOption("bar", "foo");
+ iterators.add(setting);
+
- split.setTable("table");
++ split.setTableName("table");
+ split.setAuths(new Authorizations("foo"));
+ split.setOffline(true);
+ split.setIsolatedScan(true);
+ split.setUsesLocalIterators(true);
+ split.setFetchedColumns(fetchedColumns);
+ split.setToken(new PasswordToken("password"));
+ split.setPrincipal("root");
+ split.setInstanceName("instance");
+ split.setMockInstance(true);
+ split.setZooKeepers("localhost");
+ split.setIterators(iterators);
+ split.setLogLevel(Level.WARN);
-
++
+ ByteArrayOutputStream baos = new ByteArrayOutputStream();
+ DataOutputStream dos = new DataOutputStream(baos);
+ split.write(dos);
-
++
+ RangeInputSplit newSplit = new RangeInputSplit();
-
++
+ ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
+ DataInputStream dis = new DataInputStream(bais);
+ newSplit.readFields(dis);
-
++
+ Assert.assertEquals(split.getRange(), newSplit.getRange());
+ Assert.assertArrayEquals(split.getLocations(), newSplit.getLocations());
+
- Assert.assertEquals(split.getTable(), newSplit.getTable());
++ Assert.assertEquals(split.getTableName(), newSplit.getTableName());
+ Assert.assertEquals(split.getAuths(), newSplit.getAuths());
+ Assert.assertEquals(split.isOffline(), newSplit.isOffline());
+ Assert.assertEquals(split.isIsolatedScan(), newSplit.isOffline());
+ Assert.assertEquals(split.usesLocalIterators(), newSplit.usesLocalIterators());
+ Assert.assertEquals(split.getFetchedColumns(), newSplit.getFetchedColumns());
+ Assert.assertEquals(split.getToken(), newSplit.getToken());
+ Assert.assertEquals(split.getPrincipal(), newSplit.getPrincipal());
+ Assert.assertEquals(split.getInstanceName(), newSplit.getInstanceName());
+ Assert.assertEquals(split.isMockInstance(), newSplit.isMockInstance());
+ Assert.assertEquals(split.getZooKeepers(), newSplit.getZooKeepers());
+ Assert.assertEquals(split.getIterators(), newSplit.getIterators());
+ Assert.assertEquals(split.getLogLevel(), newSplit.getLogLevel());
+ }
-
++
+}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
----------------------------------------------------------------------
diff --cc server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
index 09cf8df,a49ec43..0e9ee95
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
@@@ -97,10 -96,10 +97,10 @@@ public class ZooConfiguration extends A
byte[] v = propCache.get(zPath);
String value = null;
if (v != null)
- value = new String(v, Constants.UTF8);
+ value = new String(v, StandardCharsets.UTF_8);
return value;
}
-
+
@Override
public void getProperties(Map<String,String> props, PropertyFilter filter) {
parent.getProperties(props, filter);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
----------------------------------------------------------------------
diff --cc server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
index 990e82a,92580f3..12521f9
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
@@@ -84,8 -83,8 +84,8 @@@ public class TableConfigurationTest
@Test
public void testGet_InZK() {
Property p = Property.INSTANCE_SECRET;
-- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey()))
- .andReturn("sekrit".getBytes(StandardCharsets.UTF_8));
- .andReturn("sekrit".getBytes(Constants.UTF8));
++ expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey())).andReturn(
++ "sekrit".getBytes(StandardCharsets.UTF_8));
replay(zc);
assertEquals("sekrit", c.get(Property.INSTANCE_SECRET));
}
@@@ -110,8 -109,8 +110,10 @@@
children.add("foo");
children.add("ding");
expect(zc.getChildren(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF)).andReturn(children);
- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "foo")).andReturn("bar".getBytes(StandardCharsets.UTF_8));
- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "ding")).andReturn("dong".getBytes(StandardCharsets.UTF_8));
- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "foo")).andReturn("bar".getBytes(Constants.UTF8));
- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "ding")).andReturn("dong".getBytes(Constants.UTF8));
++ expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "foo"))
++ .andReturn("bar".getBytes(StandardCharsets.UTF_8));
++ expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + "ding")).andReturn(
++ "dong".getBytes(StandardCharsets.UTF_8));
replay(zc);
c.getProperties(props, filter);
assertEquals(2, props.size());
@@@ -135,8 -134,8 +137,8 @@@
public void testInvalidateCache() {
// need to do a get so the accessor is created
Property p = Property.INSTANCE_SECRET;
-- expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey()))
- .andReturn("sekrit".getBytes(StandardCharsets.UTF_8));
- .andReturn("sekrit".getBytes(Constants.UTF8));
++ expect(zc.get(ZooUtil.getRoot(iid) + Constants.ZTABLES + "/" + TID + Constants.ZTABLE_CONF + "/" + p.getKey())).andReturn(
++ "sekrit".getBytes(StandardCharsets.UTF_8));
zc.clear();
replay(zc);
c.get(Property.INSTANCE_SECRET);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
----------------------------------------------------------------------
diff --cc server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
index 446c2a1,1b9d8f7..742ccdd
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
@@@ -39,8 -39,9 +39,9 @@@ public class ZooCachePropertyAccessorTe
private static final String PATH = "/root/path/to/props";
private static final Property PROP = Property.INSTANCE_SECRET;
private static final String KEY = PROP.getKey();
+ private static final String FULL_PATH = PATH + "/" + KEY;
private static final String VALUE = "value";
- private static final byte[] VALUE_BYTES = VALUE.getBytes(Constants.UTF8);
+ private static final byte[] VALUE_BYTES = VALUE.getBytes(StandardCharsets.UTF_8);
private ZooCache zc;
private ZooCachePropertyAccessor a;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/21d3c88d/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java
----------------------------------------------------------------------
diff --cc server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java
index 7a7941a,0000000..1cb6abf
mode 100644,000000..100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/ReplicationServlet.java
@@@ -1,168 -1,0 +1,169 @@@
+/*
+ * 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.monitor.servlets;
+
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.accumulo.core.client.Connector;
+import org.apache.accumulo.core.client.Instance;
+import org.apache.accumulo.core.client.admin.TableOperations;
- import org.apache.accumulo.core.conf.Property;
+import org.apache.accumulo.core.master.thrift.MasterMonitorInfo;
+import org.apache.accumulo.core.replication.ReplicationConstants;
+import org.apache.accumulo.core.replication.ReplicationTarget;
+import org.apache.accumulo.core.security.Credentials;
+import org.apache.accumulo.core.zookeeper.ZooUtil;
+import org.apache.accumulo.monitor.Monitor;
+import org.apache.accumulo.monitor.util.Table;
+import org.apache.accumulo.monitor.util.celltypes.NumberType;
+import org.apache.accumulo.server.client.HdfsZooInstance;
+import org.apache.accumulo.server.conf.ServerConfigurationFactory;
+import org.apache.accumulo.server.replication.DistributedWorkQueueWorkAssignerHelper;
+import org.apache.accumulo.server.replication.ReplicationUtil;
+import org.apache.accumulo.server.security.SystemCredentials;
+import org.apache.accumulo.server.zookeeper.DistributedWorkQueue;
+import org.apache.zookeeper.KeeperException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
- *
++ *
+ */
+public class ReplicationServlet extends BasicServlet {
+ private static final Logger log = LoggerFactory.getLogger(ReplicationServlet.class);
+
+ private static final long serialVersionUID = 1L;
+
+ private ReplicationUtil replicationUtil;
+
+ public ReplicationServlet() {
+ replicationUtil = new ReplicationUtil();
+ }
+
+ @Override
+ protected String getTitle(HttpServletRequest req) {
+ return "Replication Overview";
+ }
-
++
+ @Override
+ protected void pageBody(HttpServletRequest req, HttpServletResponse response, StringBuilder sb) throws Exception {
+ final Instance inst = HdfsZooInstance.getInstance();
+ final Credentials creds = SystemCredentials.get();
+ final Connector conn = inst.getConnector(creds.getPrincipal(), creds.getToken());
+ final Map<String,String> systemProps = conn.instanceOperations().getSystemConfiguration();
+ final MasterMonitorInfo mmi = Monitor.getMmi();
+
+ // The total number of "slots" we have to replicate data
+ int totalWorkQueueSize = replicationUtil.getMaxReplicationThreads(systemProps, mmi);
+
+ TableOperations tops = conn.tableOperations();
+ if (!tops.exists(ReplicationConstants.TABLE_NAME)) {
+ banner(sb, "", "Replication table does not yet exist");
+ return;
+ }
+
+ Table replicationStats = new Table("replicationStats", "Replication Status");
+ replicationStats.addSortableColumn("Table");
+ replicationStats.addSortableColumn("Peer");
+ replicationStats.addSortableColumn("Remote Identifier");
+ replicationStats.addSortableColumn("ReplicaSystem Type");
+ replicationStats.addSortableColumn("Files needing replication", new NumberType<Long>(), null);
+
+ Map<String,String> peers = replicationUtil.getPeers(systemProps);
+
+ // The total set of configured targets
+ Set<ReplicationTarget> allConfiguredTargets = replicationUtil.getReplicationTargets(tops);
+
+ // Number of files per target we have to replicate
+ Map<ReplicationTarget,Long> targetCounts = replicationUtil.getPendingReplications(conn);
+
+ Map<String,String> tableNameToId = tops.tableIdMap();
+ Map<String,String> tableIdToName = replicationUtil.invert(tableNameToId);
+
+ long filesPendingOverAllTargets = 0l;
+ for (ReplicationTarget configuredTarget : allConfiguredTargets) {
+ String tableName = tableIdToName.get(configuredTarget.getSourceTableId());
+ if (null == tableName) {
+ log.trace("Could not determine table name from id {}", configuredTarget.getSourceTableId());
+ continue;
+ }
+
+ String replicaSystemClass = peers.get(configuredTarget.getPeerName());
+ if (null == replicaSystemClass) {
+ log.trace("Could not determine configured ReplicaSystem for {}", configuredTarget.getPeerName());
+ continue;
+ }
+
+ Long numFiles = targetCounts.get(configuredTarget);
+
+ if (null == numFiles) {
- replicationStats.addRow(tableName, configuredTarget.getPeerName(), configuredTarget.getRemoteIdentifier(), replicaSystemClass, 0);
++ replicationStats.addRow(tableName, configuredTarget.getPeerName(), configuredTarget.getRemoteIdentifier(), replicaSystemClass, 0);
+ } else {
+ replicationStats.addRow(tableName, configuredTarget.getPeerName(), configuredTarget.getRemoteIdentifier(), replicaSystemClass, numFiles);
+ filesPendingOverAllTargets += numFiles;
+ }
+ }
+
+ // Up to 2x the number of slots for replication available, WARN
+ // More than 2x the number of slots for replication available, ERROR
- NumberType<Long> filesPendingFormat = new NumberType<Long>(Long.valueOf(0), Long.valueOf(2 * totalWorkQueueSize), Long.valueOf(0), Long.valueOf(4 * totalWorkQueueSize));
++ NumberType<Long> filesPendingFormat = new NumberType<Long>(Long.valueOf(0), Long.valueOf(2 * totalWorkQueueSize), Long.valueOf(0),
++ Long.valueOf(4 * totalWorkQueueSize));
+
+ String utilization = filesPendingFormat.format(filesPendingOverAllTargets);
+
+ sb.append("<div><center><br/><span class=\"table-caption\">Total files pending replication: ").append(utilization).append("</span></center></div>");
+
+ replicationStats.generate(req, sb);
+
+ // Make a table for the replication data in progress
+ Table replicationInProgress = new Table("replicationInProgress", "In-Progress Replication");
+ replicationInProgress.addSortableColumn("File");
+ replicationInProgress.addSortableColumn("Peer");
+ replicationInProgress.addSortableColumn("Source Table ID");
+ replicationInProgress.addSortableColumn("Peer Identifier");
+ replicationInProgress.addUnsortableColumn("Status");
+
+ // Read the files from the workqueue in zk
+ String zkRoot = ZooUtil.getRoot(inst);
+ final String workQueuePath = zkRoot + ReplicationConstants.ZOO_WORK_QUEUE;
+
+ DistributedWorkQueue workQueue = new DistributedWorkQueue(workQueuePath, new ServerConfigurationFactory(inst).getConfiguration());
+
+ try {
+ for (String queueKey : workQueue.getWorkQueued()) {
+ Entry<String,ReplicationTarget> queueKeyPair = DistributedWorkQueueWorkAssignerHelper.fromQueueKey(queueKey);
+ String filename = queueKeyPair.getKey();
+ ReplicationTarget target = queueKeyPair.getValue();
-
++
+ String path = replicationUtil.getAbsolutePath(conn, workQueuePath, queueKey);
+ String progress = replicationUtil.getProgress(conn, path, target);
-
++
+ // Add a row in the table
- replicationInProgress.addRow(null == path ? ".../" + filename : path, target.getPeerName(), target.getSourceTableId(), target.getRemoteIdentifier(), progress);
++ replicationInProgress.addRow(null == path ? ".../" + filename : path, target.getPeerName(), target.getSourceTableId(), target.getRemoteIdentifier(),
++ progress);
+ }
+ } catch (KeeperException | InterruptedException e) {
+ log.warn("Could not calculate replication in progress", e);
+ }
+
+ replicationInProgress.generate(req, sb);
+ }
+}
[6/9] git commit: ACCUMULO-3081 Removed commented-out code
Posted by ct...@apache.org.
ACCUMULO-3081 Removed commented-out code
The code looked out of date, and did not compile, so I could not leave in the
unused tests with @Ignore. The tests can be reintroduced later, if needed.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d61b6944
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d61b6944
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d61b6944
Branch: refs/heads/master
Commit: d61b6944cccbaa5e57e9d922fd4347522dde9625
Parents: da28b8b
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 20:12:25 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 20:12:25 2014 -0400
----------------------------------------------------------------------
.../conf/ServerConfigurationFactoryTest.java | 49 +++++---------------
1 file changed, 12 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/d61b6944/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
index bb89b04..7f07d94 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/ServerConfigurationFactoryTest.java
@@ -16,6 +16,17 @@
*/
package org.apache.accumulo.server.conf;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.endsWith;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertSame;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
@@ -23,14 +34,10 @@ import org.apache.accumulo.core.conf.DefaultConfiguration;
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
-
import org.junit.After;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
-import static org.junit.Assert.*;
-import org.easymock.Capture;
-import static org.easymock.EasyMock.*;
public class ServerConfigurationFactoryTest {
private static final String ZK_HOST = "localhost";
@@ -70,7 +77,7 @@ public class ServerConfigurationFactoryTest {
@After
public void tearDown() throws Exception {
- scf.clearCachedConfigurations();
+ ServerConfigurationFactory.clearCachedConfigurations();
}
private void mockInstanceForConfig() {
@@ -102,7 +109,6 @@ public class ServerConfigurationFactoryTest {
ready();
SiteConfiguration c = scf.getSiteConfiguration();
assertNotNull(c);
- // TBD: assertTrue(c.getParent() instanceof DefaultConfiguration);
}
@Test
@@ -111,11 +117,9 @@ public class ServerConfigurationFactoryTest {
ready();
AccumuloConfiguration c = scf.getConfiguration();
assertNotNull(c);
- // TBD: assertTrue(c.getParent() instanceof SiteConfiguration);
}
private static final String NSID = "NAMESPACE";
- private static final String TABLE = "TABLE";
@Test
public void testGetNamespaceConfiguration() {
@@ -123,37 +127,8 @@ public class ServerConfigurationFactoryTest {
ready();
NamespaceConfiguration c = scf.getNamespaceConfiguration(NSID);
assertEquals(NSID, c.getNamespaceId());
- // TBD: assertTrue(c.getParent() instanceof AccumuloConfiguration);
assertSame(c, scf.getNamespaceConfiguration(NSID));
}
- /*
- * TBD: need to work around Tables.getNamespaceId() call in constructor
- @Test
- public void testGetNamespaceConfigurationForTable() {
- mockInstanceForConfig();
- ready();
- NamespaceConfiguration c = scf.getNamespaceConfigurationForTable(TABLE);
- assertTrue(c instanceof TableParentConfiguration);
- assertEquals(TABLE, ((TableParentConfiguration) c).getTableId());
- // TBD: assertTrue(c.getParent() instanceof AccumuloConfiguration);
-
- assertSame(c, scf.getNamespaceConfigurationForTable(TABLE));
- }
- */
-
- /*
- * TBD: ditto
- @Test
- public void testGetTableConfiguration() {
- mockInstanceForConfig();
- ready();
- TableConfiguration c = scf.getTableConfiguration(TABLE);
- assertEquals(TABLE, c.getTableId());
- // TBD: assertTrue(c.getParent() instanceof TableParentConfiguration);
-
- assertSame(c, scf.getTableConfiguration(TABLE));
- }
- */
}
[8/9] git commit: ACCUMULO-2615 and others - cleanup warnings
Posted by ct...@apache.org.
ACCUMULO-2615 and others - cleanup warnings
Cleanup unused imports/fields, and deprecation warnings leftover from 2615, as
well as ACCUMULO-2694, ACCUMULO-2988, ACCUMULO-3017, and ACCUMULO-3055
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/23c74cd4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/23c74cd4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/23c74cd4
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: 23c74cd4446e75db4367f6d0587fb84190d68d19
Parents: d61b694
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 20:23:51 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 20:23:51 2014 -0400
----------------------------------------------------------------------
.../core/conf/DefaultConfiguration.java | 4 +-
.../client/mapreduce/RangeInputSplitTest.java | 30 ++++++-------
.../minicluster/MiniAccumuloCluster.java | 10 ++---
.../minicluster/MiniAccumuloClusterTest.java | 1 -
.../server/conf/NamespaceConfiguration.java | 6 +--
.../server/conf/ServerConfigurationFactory.java | 14 ++++---
.../accumulo/server/conf/TableConfWatcher.java | 2 -
.../server/conf/TableConfiguration.java | 4 +-
.../server/conf/ZooCachePropertyAccessor.java | 44 ++++++++++++--------
.../accumulo/server/conf/ZooConfiguration.java | 25 ++++-------
.../accumulo/server/util/MetadataTableUtil.java | 2 -
.../server/conf/TableConfigurationTest.java | 23 +++++-----
.../conf/ZooCachePropertyAccessorTest.java | 28 ++++++-------
.../server/fs/VolumeManagerImplTest.java | 7 ++--
.../BalanceInPresenceOfOfflineTableIT.java | 1 -
15 files changed, 95 insertions(+), 106 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
index 6e1b779..d0b512b 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
@@ -21,12 +21,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.accumulo.core.Constants;
-
public class DefaultConfiguration extends AccumuloConfiguration {
private final static Map<String,String> resolvedProps;
static {
- Map<String, String> m = new HashMap<String,String>();
+ Map<String,String> m = new HashMap<String,String>();
for (Property prop : Property.values()) {
if (!prop.getType().equals(PropertyType.PREFIX)) {
m.put(prop.getKey(), prop.getDefaultValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
index 5115bf7..833e594 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
@@ -43,18 +43,18 @@ public class RangeInputSplitTest {
@Test
public void testSimpleWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
+ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
split.write(dos);
-
+
RangeInputSplit newSplit = new RangeInputSplit();
-
+
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DataInputStream dis = new DataInputStream(bais);
newSplit.readFields(dis);
-
+
Assert.assertEquals(split.getTableName(), newSplit.getTableName());
Assert.assertEquals(split.getTableId(), newSplit.getTableId());
Assert.assertEquals(split.getRange(), newSplit.getRange());
@@ -63,10 +63,10 @@ public class RangeInputSplitTest {
@Test
public void testAllFieldsWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
+ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
+
Set<Pair<Text,Text>> fetchedColumns = new HashSet<Pair<Text,Text>>();
-
+
fetchedColumns.add(new Pair<Text,Text>(new Text("colf1"), new Text("colq1")));
fetchedColumns.add(new Pair<Text,Text>(new Text("colf2"), new Text("colq2")));
@@ -80,7 +80,7 @@ public class RangeInputSplitTest {
setting.addOption("bar", "foo");
iterators.add(setting);
- split.setTable("table");
+ split.setTableName("table");
split.setAuths(new Authorizations("foo"));
split.setOffline(true);
split.setIsolatedScan(true);
@@ -93,21 +93,21 @@ public class RangeInputSplitTest {
split.setZooKeepers("localhost");
split.setIterators(iterators);
split.setLogLevel(Level.WARN);
-
+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
split.write(dos);
-
+
RangeInputSplit newSplit = new RangeInputSplit();
-
+
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DataInputStream dis = new DataInputStream(bais);
newSplit.readFields(dis);
-
+
Assert.assertEquals(split.getRange(), newSplit.getRange());
Assert.assertArrayEquals(split.getLocations(), newSplit.getLocations());
- Assert.assertEquals(split.getTable(), newSplit.getTable());
+ Assert.assertEquals(split.getTableName(), newSplit.getTableName());
Assert.assertEquals(split.getAuths(), newSplit.getAuths());
Assert.assertEquals(split.isOffline(), newSplit.isOffline());
Assert.assertEquals(split.isIsolatedScan(), newSplit.isOffline());
@@ -121,5 +121,5 @@ public class RangeInputSplitTest {
Assert.assertEquals(split.getIterators(), newSplit.getIterators());
Assert.assertEquals(split.getLogLevel(), newSplit.getLogLevel());
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 4763eaa..3e8c5a0 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -28,12 +28,10 @@ import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
-import com.google.common.base.Preconditions;
-
/**
* A utility class that will create Zookeeper and Accumulo processes that write all of their data to a single local directory. This class makes it easy to test
* code against a real Accumulo instance. Its much more accurate for testing than {@link org.apache.accumulo.core.client.mock.MockAccumulo}, but much slower.
- *
+ *
* @since 1.5.0
*/
public class MiniAccumuloCluster {
@@ -45,7 +43,7 @@ public class MiniAccumuloCluster {
}
/**
- *
+ *
* @param dir
* An empty or nonexistant temp directoy that Accumulo and Zookeeper can store data in. Creating the directory is left to the user. Java 7, Guava,
* and Junit provide methods for creating temporary directories.
@@ -66,7 +64,7 @@ public class MiniAccumuloCluster {
/**
* Starts Accumulo and Zookeeper processes. Can only be called once.
- *
+ *
* @throws IllegalStateException
* if already started
*/
@@ -113,7 +111,7 @@ public class MiniAccumuloCluster {
/**
* Utility method to get a connector to the MAC.
- *
+ *
* @since 1.6.0
*/
public Connector getConnector(String user, String passwd) throws AccumuloException, AccumuloSecurityException {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
index 2cbb4b3..ec228af 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
@@ -43,7 +43,6 @@ import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.util.Pair;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.hdfs.DFSConfigKeys;
-import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
index cadbd8e..30cffb7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.server.conf;
-import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
@@ -90,7 +89,7 @@ public class NamespaceConfiguration extends ObservableConfiguration {
public String get(Property property) {
String key = property.getKey();
AccumuloConfiguration getParent;
- if (!(namespaceId.equals(Namespaces.ACCUMULO_NAMESPACE_ID) && isIteratorOrConstraint(property.getKey()))) {
+ if (!(namespaceId.equals(Namespaces.ACCUMULO_NAMESPACE_ID) && isIteratorOrConstraint(key))) {
getParent = parent;
} else {
// ignore iterators from parent if system namespace
@@ -157,8 +156,7 @@ public class NamespaceConfiguration extends ObservableConfiguration {
}
/**
- * Invalidates the <code>ZooCache</code> used for storage and quick retrieval
- * of properties for this namespace configuration.
+ * Invalidates the <code>ZooCache</code> used for storage and quick retrieval of properties for this namespace configuration.
*/
@Override
public synchronized void invalidateCache() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
index 3bc349f..8e62a87 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.server.conf;
import java.security.SecurityPermission;
import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.impl.Tables;
@@ -43,23 +42,25 @@ public class ServerConfigurationFactory {
namespaceConfigs = new HashMap<String,Map<String,NamespaceConfiguration>>(1);
tableParentConfigs = new HashMap<String,Map<String,NamespaceConfiguration>>(1);
}
+
private static void addInstanceToCaches(String iid) {
- synchronized(tableConfigs) {
+ synchronized (tableConfigs) {
if (!tableConfigs.containsKey(iid)) {
tableConfigs.put(iid, new HashMap<String,TableConfiguration>());
}
}
- synchronized(namespaceConfigs) {
+ synchronized (namespaceConfigs) {
if (!namespaceConfigs.containsKey(iid)) {
namespaceConfigs.put(iid, new HashMap<String,NamespaceConfiguration>());
}
}
- synchronized(tableParentConfigs) {
+ synchronized (tableParentConfigs) {
if (!tableParentConfigs.containsKey(iid)) {
tableParentConfigs.put(iid, new HashMap<String,NamespaceConfiguration>());
}
}
}
+
private static final SecurityPermission CONFIGURATION_PERMISSION = new SecurityPermission("configurationPermission");
private static final SecurityManager SM = System.getSecurityManager();
@@ -74,11 +75,13 @@ public class ServerConfigurationFactory {
return tableConfigs.get(instanceId).remove(tableId) != null;
}
}
+
static boolean removeCachedNamespaceConfiguration(String instanceId, String namespaceId) {
synchronized (namespaceConfigs) {
return namespaceConfigs.get(instanceId).remove(namespaceId) != null;
}
}
+
static void clearCachedConfigurations() {
synchronized (tableConfigs) {
tableConfigs.clear();
@@ -90,6 +93,7 @@ public class ServerConfigurationFactory {
tableParentConfigs.clear();
}
}
+
static void expireAllTableObservers() {
synchronized (tableConfigs) {
for (Map<String,TableConfiguration> instanceMap : tableConfigs.values()) {
@@ -109,6 +113,7 @@ public class ServerConfigurationFactory {
instanceID = instance.getInstanceID();
addInstanceToCaches(instanceID);
}
+
void setZooCacheFactory(ZooCacheFactory zcf) {
this.zcf = zcf;
}
@@ -141,7 +146,6 @@ public class ServerConfigurationFactory {
return systemConfig;
}
-
public TableConfiguration getTableConfiguration(String tableId) {
checkPermissions();
synchronized (tableConfigs) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
index 4709b85..b657056 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
@@ -33,13 +33,11 @@ class TableConfWatcher implements Watcher {
private static final Logger log = Logger.getLogger(TableConfWatcher.class);
private final Instance instance;
private final String tablesPrefix;
- private final int tablesPrefixLength;
private ServerConfigurationFactory scf;
TableConfWatcher(Instance instance) {
this.instance = instance;
tablesPrefix = ZooUtil.getRoot(instance) + Constants.ZTABLES + "/";
- tablesPrefixLength = tablesPrefix.length();
scf = new ServerConfigurationFactory(instance);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index 1936484..8cf46c7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.server.conf;
-import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
@@ -131,8 +130,7 @@ public class TableConfiguration extends ObservableConfiguration {
}
/**
- * Invalidates the <code>ZooCache</code> used for storage and quick retrieval
- * of properties for this table configuration.
+ * Invalidates the <code>ZooCache</code> used for storage and quick retrieval of properties for this table configuration.
*/
@Override
public synchronized void invalidateCache() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
index ac30008..df1be50 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
@@ -18,11 +18,11 @@ package org.apache.accumulo.server.conf;
import java.util.List;
import java.util.Map;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.log4j.Logger;
@@ -35,10 +35,12 @@ public class ZooCachePropertyAccessor {
static class PropCacheKey {
final String instanceId;
final String scope;
+
PropCacheKey(String iid, String s) {
instanceId = iid;
scope = s;
}
+
@Override
public boolean equals(Object other) {
if (this == other) {
@@ -50,6 +52,7 @@ public class ZooCachePropertyAccessor {
PropCacheKey o = (PropCacheKey) other;
return (instanceId.equals(o.instanceId) && scope.equals(o.scope));
}
+
@Override
public int hashCode() {
int c = 17;
@@ -64,11 +67,13 @@ public class ZooCachePropertyAccessor {
/**
* Creates a new accessor.
*
- * @param propCache property cache
+ * @param propCache
+ * property cache
*/
ZooCachePropertyAccessor(ZooCache propCache) {
this.propCache = propCache;
}
+
/**
* Gets the property cache accessed by this object.
*
@@ -79,13 +84,15 @@ public class ZooCachePropertyAccessor {
}
/**
- * Gets a property. If the property is not in ZooKeeper or is present but an
- * invalid format for the property type, the parent configuration is consulted
- * (if provided).
+ * Gets a property. If the property is not in ZooKeeper or is present but an invalid format for the property type, the parent configuration is consulted (if
+ * provided).
*
- * @param property property to get
- * @param path ZooKeeper path where properties lie
- * @param parent parent configuration (optional)
+ * @param property
+ * property to get
+ * @param path
+ * ZooKeeper path where properties lie
+ * @param parent
+ * parent configuration (optional)
* @return property value, or null if not found
*/
String get(Property property, String path, AccumuloConfiguration parent) {
@@ -113,16 +120,19 @@ public class ZooCachePropertyAccessor {
}
/**
- * Gets all properties into the given map. Properties are filtered using the
- * given filter. Properties from a parent configuration are also added to the
- * map and filtered, either using a separate filter or, if not specified, the
- * other filter.
+ * Gets all properties into the given map. Properties are filtered using the given filter. Properties from a parent configuration are also added to the map
+ * and filtered, either using a separate filter or, if not specified, the other filter.
*
- * @param props map to populate with properties
- * @param path ZooKeeper path where properties lie
- * @param filter property filter (required)
- * @param parent parent configuration (required)
- * @param parentFilter separate filter for parent properties (optional)
+ * @param props
+ * map to populate with properties
+ * @param path
+ * ZooKeeper path where properties lie
+ * @param filter
+ * property filter (required)
+ * @param parent
+ * parent configuration (required)
+ * @param parentFilter
+ * separate filter for parent properties (optional)
*/
void getProperties(Map<String,String> props, String path, PropertyFilter filter, AccumuloConfiguration parent, PropertyFilter parentFilter) {
parent.getProperties(props, parentFilter != null ? parentFilter : filter);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
index e2bf5f5..a49ec43 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
@@ -16,39 +16,32 @@
*/
package org.apache.accumulo.server.conf;
-import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
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.fs.VolumeManager;
-import org.apache.accumulo.server.fs.VolumeManagerImpl;
-import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
public class ZooConfiguration extends AccumuloConfiguration {
private static final Logger log = Logger.getLogger(ZooConfiguration.class);
-
+
private final String instanceId;
private final ZooCache propCache;
private final AccumuloConfiguration parent;
private final Map<String,String> fixedProps = Collections.synchronizedMap(new HashMap<String,String>());
-
+
protected ZooConfiguration(String instanceId, ZooCache propCache, AccumuloConfiguration parent) {
this.instanceId = instanceId;
this.propCache = propCache;
this.parent = parent;
}
-
+
@Override
public void invalidateCache() {
if (propCache != null)
@@ -67,11 +60,11 @@ public class ZooConfiguration extends AccumuloConfiguration {
private String _get(Property property) {
String key = property.getKey();
String value = null;
-
+
if (Property.isValidZooPropertyKey(key)) {
value = get(key);
}
-
+
if (value == null || !property.getType().isValidFormat(value)) {
if (value != null)
log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
@@ -79,7 +72,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
}
return value;
}
-
+
@Override
public String get(Property property) {
if (Property.isFixedZooPropertyKey(property)) {
@@ -91,13 +84,13 @@ public class ZooConfiguration extends AccumuloConfiguration {
fixedProps.put(property.getKey(), val);
return val;
}
-
+
}
} else {
return _get(property);
}
}
-
+
private String get(String key) {
String zPath = ZooUtil.getRoot(instanceId) + Constants.ZCONFIG + "/" + key;
byte[] v = propCache.get(zPath);
@@ -106,7 +99,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
value = new String(v, Constants.UTF8);
return value;
}
-
+
@Override
public void getProperties(Map<String,String> props, PropertyFilter filter) {
parent.getProperties(props, filter);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index e702af4..463ca57 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.server.util;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -984,7 +983,6 @@ public class MetadataTableUtil {
}
-
public static void moveMetaDeleteMarkersFrom14(Instance instance, Credentials creds) {
// new KeyExtent is only added to force update to write to the metadata table, not the root table
KeyExtent notMetadata = new KeyExtent(new Text("anythingNotMetadata"), null, null);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
index b7f27cc..92580f3 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
@@ -16,14 +16,23 @@
*/
package org.apache.accumulo.server.conf;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.impl.Namespaces;
-import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.AllFilter;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.ConfigurationObserver;
@@ -33,16 +42,6 @@ import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
public class TableConfigurationTest {
private static final String TID = "table";
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
index 77e88b1..1b9d8f7 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
@@ -16,26 +16,24 @@
*/
package org.apache.accumulo.server.conf;
-import java.nio.charset.Charset;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+
import java.util.List;
import java.util.Map;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.conf.PropertyType;
import org.apache.accumulo.fate.zookeeper.ZooCache;
-
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import org.easymock.Capture;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
public class ZooCachePropertyAccessorTest {
private static final String PATH = "/root/path/to/props";
@@ -61,7 +59,7 @@ public class ZooCachePropertyAccessorTest {
@Test
public void testGet_Valid() {
- expect(zc.get(PATH + "/" + KEY)).andReturn(VALUE_BYTES);
+ expect(zc.get(FULL_PATH)).andReturn(VALUE_BYTES);
replay(zc);
assertEquals(VALUE, a.get(PROP, PATH, null));
}
@@ -71,7 +69,7 @@ public class ZooCachePropertyAccessorTest {
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
expect(parent.get(PROP)).andReturn(VALUE);
replay(parent);
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertEquals(VALUE, a.get(PROP, PATH, parent));
}
@@ -81,14 +79,14 @@ public class ZooCachePropertyAccessorTest {
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
expect(parent.get(PROP)).andReturn(null);
replay(parent);
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertNull(a.get(PROP, PATH, parent));
}
@Test
public void testGet_Null_NoParent() {
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertNull(a.get(PROP, PATH, null));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
index 5f97bf6..582822a 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.server.fs;
import java.util.Arrays;
import java.util.List;
-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.server.fs.VolumeManager.FileType;
@@ -29,7 +28,7 @@ import org.junit.Before;
import org.junit.Test;
/**
- *
+ *
*/
public class VolumeManagerImplTest {
@@ -65,7 +64,7 @@ public class VolumeManagerImplTest {
String basePath = fs.getDefaultVolume().getBasePath();
String scheme = fs.getDefaultVolume().getFileSystem().getUri().toURL().getProtocol();
System.out.println(basePath);
- Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
+ Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
List<String> pathsToTest = Arrays.asList("1/default_tablet", "1/default_tablet/", "1/t-0000001");
for (String pathToTest : pathsToTest) {
Path fullPath = fs.getFullPath(FileType.TABLE, pathToTest);
@@ -78,7 +77,7 @@ public class VolumeManagerImplTest {
String basePath = fs.getDefaultVolume().getBasePath();
String scheme = fs.getDefaultVolume().getFileSystem().getUri().toURL().getProtocol();
System.out.println(basePath);
- Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
+ Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
List<String> pathsToTest = Arrays.asList("1/default_tablet/C0000001.rf", "1/t-0000001/C0000001.rf");
for (String pathToTest : pathsToTest) {
Path fullPath = fs.getFullPath(FileType.TABLE, pathToTest);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
index 37aa8a1..887aee4 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
@@ -126,7 +126,6 @@ public class BalanceInPresenceOfOfflineTableIT extends ConfigurableMacIT {
continue;
}
- int numTablets = 0;
long[] tabletsPerServer = new long[stats.getTServerInfoSize()];
Arrays.fill(tabletsPerServer, 0l);
for (int i = 0; i < stats.getTServerInfoSize(); i++) {
[4/9] git commit: ACCUMULO-3068 ACCUMULO-2558 Fix
incorrect/incomplete javadocs
Posted by ct...@apache.org.
ACCUMULO-3068 ACCUMULO-2558 Fix incorrect/incomplete javadocs
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/da28b8b1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/da28b8b1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/da28b8b1
Branch: refs/heads/master
Commit: da28b8b15ecd091e51840ed1655afc5a264f2a8e
Parents: ac2e601
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 19:57:40 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 19:57:40 2014 -0400
----------------------------------------------------------------------
.../conf/CredentialProviderFactoryShim.java | 2 -
.../accumulo/gc/SimpleGarbageCollector.java | 46 ++++++++++++--------
2 files changed, 29 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/da28b8b1/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
index 91dcc54..aa3d195 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
@@ -368,7 +368,6 @@ public class CredentialProviderFactoryShim {
* CredentialEntry name (alias)
* @param credential
* The credential
- * @throws IOException
*/
public static void createEntry(Configuration conf, String name, char[] credential) throws IOException {
Preconditions.checkNotNull(conf);
@@ -403,7 +402,6 @@ public class CredentialProviderFactoryShim {
* CredentialEntry name (alias)
* @param credential
* The credential to store
- * @throws IOException
*/
public static void createEntryInProvider(Object credentialProvider, String name, char[] credential) throws IOException {
Preconditions.checkNotNull(credentialProvider);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/da28b8b1/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 64db1db..a1c9673 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -119,8 +119,7 @@ public class SimpleGarbageCollector implements Iface {
}
/**
- * A fraction representing how much of the JVM's available memory should be
- * used for gathering candidates.
+ * A fraction representing how much of the JVM's available memory should be used for gathering candidates.
*/
static final float CANDIDATE_MEMORY_PERCENTAGE = 0.75f;
@@ -155,7 +154,8 @@ public class SimpleGarbageCollector implements Iface {
/**
* Creates a new garbage collector.
*
- * @param opts options
+ * @param opts
+ * options
*/
public SimpleGarbageCollector(Opts opts) {
this.opts = opts;
@@ -169,6 +169,7 @@ public class SimpleGarbageCollector implements Iface {
Credentials getCredentials() {
return credentials;
}
+
/**
* Gets the delay before the first collection.
*
@@ -177,6 +178,7 @@ public class SimpleGarbageCollector implements Iface {
long getStartDelay() {
return config.getTimeInMillis(Property.GC_CYCLE_START);
}
+
/**
* Gets the volume manager used by this GC.
*
@@ -185,21 +187,23 @@ public class SimpleGarbageCollector implements Iface {
VolumeManager getVolumeManager() {
return fs;
}
+
/**
- * Checks if the volume manager should move files to the trash rather than
- * delete them.
+ * Checks if the volume manager should move files to the trash rather than delete them.
*
* @return true if trash is used
*/
boolean isUsingTrash() {
return !config.getBoolean(Property.GC_TRASH_IGNORE);
}
+
/**
* Gets the options for this garbage collector.
*/
Opts getOpts() {
return opts;
}
+
/**
* Gets the number of threads used for deleting files.
*
@@ -208,6 +212,7 @@ public class SimpleGarbageCollector implements Iface {
int getNumDeleteThreads() {
return config.getCount(Property.GC_DELETE_THREADS);
}
+
/**
* Gets the instance used by this GC.
*
@@ -220,11 +225,14 @@ public class SimpleGarbageCollector implements Iface {
/**
* Initializes this garbage collector.
*
- * @param fs volume manager
- * @param instance instance
- * @param credentials credentials
- * @param noTrash true to not move files to trash instead of deleting
- * @param systemConfig system configuration
+ * @param fs
+ * volume manager
+ * @param instance
+ * instance
+ * @param credentials
+ * credentials
+ * @param config
+ * system configuration
*/
public void init(VolumeManager fs, Instance instance, Credentials credentials, AccumuloConfiguration config) {
this.fs = fs;
@@ -579,13 +587,13 @@ public class SimpleGarbageCollector implements Iface {
}
/**
- * Moves a file to trash. If this garbage collector is not using trash, this
- * method returns false and leaves the file alone. If the file is missing,
- * this method returns false as opposed to throwing an exception.
+ * Moves a file to trash. If this garbage collector is not using trash, this method returns false and leaves the file alone. If the file is missing, this
+ * method returns false as opposed to throwing an exception.
*
* @param path
* @return true if the file was moved to trash
- * @throws IOException if the volume manager encountered a problem
+ * @throws IOException
+ * if the volume manager encountered a problem
*/
boolean moveToTrash(Path path) throws IOException {
if (!isUsingTrash())
@@ -646,7 +654,8 @@ public class SimpleGarbageCollector implements Iface {
/**
* Checks if the system is almost out of memory.
*
- * @param runtime Java runtime
+ * @param runtime
+ * Java runtime
* @return true if system is almost out of memory
* @see #CANDIDATE_MEMORY_PERCENTAGE
*/
@@ -665,11 +674,14 @@ public class SimpleGarbageCollector implements Iface {
/**
* Checks if the given string is a directory.
*
- * @param delete possible directory
+ * @param delete
+ * possible directory
* @return true if string is a directory
*/
static boolean isDir(String delete) {
- if (delete == null) { return false; }
+ if (delete == null) {
+ return false;
+ }
int slashCount = 0;
for (int i = 0; i < delete.length(); i++)
if (delete.charAt(i) == '/')
[3/9] git commit: ACCUMULO-3068 ACCUMULO-2558 Fix
incorrect/incomplete javadocs
Posted by ct...@apache.org.
ACCUMULO-3068 ACCUMULO-2558 Fix incorrect/incomplete javadocs
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/da28b8b1
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/da28b8b1
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/da28b8b1
Branch: refs/heads/1.6.1-SNAPSHOT
Commit: da28b8b15ecd091e51840ed1655afc5a264f2a8e
Parents: ac2e601
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 19:57:40 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 19:57:40 2014 -0400
----------------------------------------------------------------------
.../conf/CredentialProviderFactoryShim.java | 2 -
.../accumulo/gc/SimpleGarbageCollector.java | 46 ++++++++++++--------
2 files changed, 29 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/da28b8b1/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
index 91dcc54..aa3d195 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/CredentialProviderFactoryShim.java
@@ -368,7 +368,6 @@ public class CredentialProviderFactoryShim {
* CredentialEntry name (alias)
* @param credential
* The credential
- * @throws IOException
*/
public static void createEntry(Configuration conf, String name, char[] credential) throws IOException {
Preconditions.checkNotNull(conf);
@@ -403,7 +402,6 @@ public class CredentialProviderFactoryShim {
* CredentialEntry name (alias)
* @param credential
* The credential to store
- * @throws IOException
*/
public static void createEntryInProvider(Object credentialProvider, String name, char[] credential) throws IOException {
Preconditions.checkNotNull(credentialProvider);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/da28b8b1/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
----------------------------------------------------------------------
diff --git a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
index 64db1db..a1c9673 100644
--- a/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
+++ b/server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
@@ -119,8 +119,7 @@ public class SimpleGarbageCollector implements Iface {
}
/**
- * A fraction representing how much of the JVM's available memory should be
- * used for gathering candidates.
+ * A fraction representing how much of the JVM's available memory should be used for gathering candidates.
*/
static final float CANDIDATE_MEMORY_PERCENTAGE = 0.75f;
@@ -155,7 +154,8 @@ public class SimpleGarbageCollector implements Iface {
/**
* Creates a new garbage collector.
*
- * @param opts options
+ * @param opts
+ * options
*/
public SimpleGarbageCollector(Opts opts) {
this.opts = opts;
@@ -169,6 +169,7 @@ public class SimpleGarbageCollector implements Iface {
Credentials getCredentials() {
return credentials;
}
+
/**
* Gets the delay before the first collection.
*
@@ -177,6 +178,7 @@ public class SimpleGarbageCollector implements Iface {
long getStartDelay() {
return config.getTimeInMillis(Property.GC_CYCLE_START);
}
+
/**
* Gets the volume manager used by this GC.
*
@@ -185,21 +187,23 @@ public class SimpleGarbageCollector implements Iface {
VolumeManager getVolumeManager() {
return fs;
}
+
/**
- * Checks if the volume manager should move files to the trash rather than
- * delete them.
+ * Checks if the volume manager should move files to the trash rather than delete them.
*
* @return true if trash is used
*/
boolean isUsingTrash() {
return !config.getBoolean(Property.GC_TRASH_IGNORE);
}
+
/**
* Gets the options for this garbage collector.
*/
Opts getOpts() {
return opts;
}
+
/**
* Gets the number of threads used for deleting files.
*
@@ -208,6 +212,7 @@ public class SimpleGarbageCollector implements Iface {
int getNumDeleteThreads() {
return config.getCount(Property.GC_DELETE_THREADS);
}
+
/**
* Gets the instance used by this GC.
*
@@ -220,11 +225,14 @@ public class SimpleGarbageCollector implements Iface {
/**
* Initializes this garbage collector.
*
- * @param fs volume manager
- * @param instance instance
- * @param credentials credentials
- * @param noTrash true to not move files to trash instead of deleting
- * @param systemConfig system configuration
+ * @param fs
+ * volume manager
+ * @param instance
+ * instance
+ * @param credentials
+ * credentials
+ * @param config
+ * system configuration
*/
public void init(VolumeManager fs, Instance instance, Credentials credentials, AccumuloConfiguration config) {
this.fs = fs;
@@ -579,13 +587,13 @@ public class SimpleGarbageCollector implements Iface {
}
/**
- * Moves a file to trash. If this garbage collector is not using trash, this
- * method returns false and leaves the file alone. If the file is missing,
- * this method returns false as opposed to throwing an exception.
+ * Moves a file to trash. If this garbage collector is not using trash, this method returns false and leaves the file alone. If the file is missing, this
+ * method returns false as opposed to throwing an exception.
*
* @param path
* @return true if the file was moved to trash
- * @throws IOException if the volume manager encountered a problem
+ * @throws IOException
+ * if the volume manager encountered a problem
*/
boolean moveToTrash(Path path) throws IOException {
if (!isUsingTrash())
@@ -646,7 +654,8 @@ public class SimpleGarbageCollector implements Iface {
/**
* Checks if the system is almost out of memory.
*
- * @param runtime Java runtime
+ * @param runtime
+ * Java runtime
* @return true if system is almost out of memory
* @see #CANDIDATE_MEMORY_PERCENTAGE
*/
@@ -665,11 +674,14 @@ public class SimpleGarbageCollector implements Iface {
/**
* Checks if the given string is a directory.
*
- * @param delete possible directory
+ * @param delete
+ * possible directory
* @return true if string is a directory
*/
static boolean isDir(String delete) {
- if (delete == null) { return false; }
+ if (delete == null) {
+ return false;
+ }
int slashCount = 0;
for (int i = 0; i < delete.length(); i++)
if (delete.charAt(i) == '/')
[7/9] git commit: ACCUMULO-2615 and others - cleanup warnings
Posted by ct...@apache.org.
ACCUMULO-2615 and others - cleanup warnings
Cleanup unused imports/fields, and deprecation warnings leftover from 2615, as
well as ACCUMULO-2694, ACCUMULO-2988, ACCUMULO-3017, and ACCUMULO-3055
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/23c74cd4
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/23c74cd4
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/23c74cd4
Branch: refs/heads/master
Commit: 23c74cd4446e75db4367f6d0587fb84190d68d19
Parents: d61b694
Author: Christopher Tubbs <ct...@apache.org>
Authored: Fri Aug 22 20:23:51 2014 -0400
Committer: Christopher Tubbs <ct...@apache.org>
Committed: Fri Aug 22 20:23:51 2014 -0400
----------------------------------------------------------------------
.../core/conf/DefaultConfiguration.java | 4 +-
.../client/mapreduce/RangeInputSplitTest.java | 30 ++++++-------
.../minicluster/MiniAccumuloCluster.java | 10 ++---
.../minicluster/MiniAccumuloClusterTest.java | 1 -
.../server/conf/NamespaceConfiguration.java | 6 +--
.../server/conf/ServerConfigurationFactory.java | 14 ++++---
.../accumulo/server/conf/TableConfWatcher.java | 2 -
.../server/conf/TableConfiguration.java | 4 +-
.../server/conf/ZooCachePropertyAccessor.java | 44 ++++++++++++--------
.../accumulo/server/conf/ZooConfiguration.java | 25 ++++-------
.../accumulo/server/util/MetadataTableUtil.java | 2 -
.../server/conf/TableConfigurationTest.java | 23 +++++-----
.../conf/ZooCachePropertyAccessorTest.java | 28 ++++++-------
.../server/fs/VolumeManagerImplTest.java | 7 ++--
.../BalanceInPresenceOfOfflineTableIT.java | 1 -
15 files changed, 95 insertions(+), 106 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
index 6e1b779..d0b512b 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/DefaultConfiguration.java
@@ -21,12 +21,10 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import org.apache.accumulo.core.Constants;
-
public class DefaultConfiguration extends AccumuloConfiguration {
private final static Map<String,String> resolvedProps;
static {
- Map<String, String> m = new HashMap<String,String>();
+ Map<String,String> m = new HashMap<String,String>();
for (Property prop : Property.values()) {
if (!prop.getType().equals(PropertyType.PREFIX)) {
m.put(prop.getKey(), prop.getDefaultValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
index 5115bf7..833e594 100644
--- a/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/client/mapreduce/RangeInputSplitTest.java
@@ -43,18 +43,18 @@ public class RangeInputSplitTest {
@Test
public void testSimpleWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
+ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
split.write(dos);
-
+
RangeInputSplit newSplit = new RangeInputSplit();
-
+
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DataInputStream dis = new DataInputStream(bais);
newSplit.readFields(dis);
-
+
Assert.assertEquals(split.getTableName(), newSplit.getTableName());
Assert.assertEquals(split.getTableId(), newSplit.getTableId());
Assert.assertEquals(split.getRange(), newSplit.getRange());
@@ -63,10 +63,10 @@ public class RangeInputSplitTest {
@Test
public void testAllFieldsWritable() throws IOException {
- RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
-
+ RangeInputSplit split = new RangeInputSplit("table", "1", new Range(new Key("a"), new Key("b")), new String[] {"localhost"});
+
Set<Pair<Text,Text>> fetchedColumns = new HashSet<Pair<Text,Text>>();
-
+
fetchedColumns.add(new Pair<Text,Text>(new Text("colf1"), new Text("colq1")));
fetchedColumns.add(new Pair<Text,Text>(new Text("colf2"), new Text("colq2")));
@@ -80,7 +80,7 @@ public class RangeInputSplitTest {
setting.addOption("bar", "foo");
iterators.add(setting);
- split.setTable("table");
+ split.setTableName("table");
split.setAuths(new Authorizations("foo"));
split.setOffline(true);
split.setIsolatedScan(true);
@@ -93,21 +93,21 @@ public class RangeInputSplitTest {
split.setZooKeepers("localhost");
split.setIterators(iterators);
split.setLogLevel(Level.WARN);
-
+
ByteArrayOutputStream baos = new ByteArrayOutputStream();
DataOutputStream dos = new DataOutputStream(baos);
split.write(dos);
-
+
RangeInputSplit newSplit = new RangeInputSplit();
-
+
ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
DataInputStream dis = new DataInputStream(bais);
newSplit.readFields(dis);
-
+
Assert.assertEquals(split.getRange(), newSplit.getRange());
Assert.assertArrayEquals(split.getLocations(), newSplit.getLocations());
- Assert.assertEquals(split.getTable(), newSplit.getTable());
+ Assert.assertEquals(split.getTableName(), newSplit.getTableName());
Assert.assertEquals(split.getAuths(), newSplit.getAuths());
Assert.assertEquals(split.isOffline(), newSplit.isOffline());
Assert.assertEquals(split.isIsolatedScan(), newSplit.isOffline());
@@ -121,5 +121,5 @@ public class RangeInputSplitTest {
Assert.assertEquals(split.getIterators(), newSplit.getIterators());
Assert.assertEquals(split.getLogLevel(), newSplit.getLogLevel());
}
-
+
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
----------------------------------------------------------------------
diff --git a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
index 4763eaa..3e8c5a0 100644
--- a/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
+++ b/minicluster/src/main/java/org/apache/accumulo/minicluster/MiniAccumuloCluster.java
@@ -28,12 +28,10 @@ import org.apache.accumulo.core.util.Pair;
import org.apache.accumulo.minicluster.impl.MiniAccumuloClusterImpl;
import org.apache.accumulo.minicluster.impl.MiniAccumuloConfigImpl;
-import com.google.common.base.Preconditions;
-
/**
* A utility class that will create Zookeeper and Accumulo processes that write all of their data to a single local directory. This class makes it easy to test
* code against a real Accumulo instance. Its much more accurate for testing than {@link org.apache.accumulo.core.client.mock.MockAccumulo}, but much slower.
- *
+ *
* @since 1.5.0
*/
public class MiniAccumuloCluster {
@@ -45,7 +43,7 @@ public class MiniAccumuloCluster {
}
/**
- *
+ *
* @param dir
* An empty or nonexistant temp directoy that Accumulo and Zookeeper can store data in. Creating the directory is left to the user. Java 7, Guava,
* and Junit provide methods for creating temporary directories.
@@ -66,7 +64,7 @@ public class MiniAccumuloCluster {
/**
* Starts Accumulo and Zookeeper processes. Can only be called once.
- *
+ *
* @throws IllegalStateException
* if already started
*/
@@ -113,7 +111,7 @@ public class MiniAccumuloCluster {
/**
* Utility method to get a connector to the MAC.
- *
+ *
* @since 1.6.0
*/
public Connector getConnector(String user, String passwd) throws AccumuloException, AccumuloSecurityException {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
----------------------------------------------------------------------
diff --git a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
index 2cbb4b3..ec228af 100644
--- a/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
+++ b/minicluster/src/test/java/org/apache/accumulo/minicluster/MiniAccumuloClusterTest.java
@@ -43,7 +43,6 @@ import org.apache.accumulo.core.security.TablePermission;
import org.apache.accumulo.core.util.Pair;
import org.apache.commons.io.FileUtils;
import org.apache.hadoop.hdfs.DFSConfigKeys;
-import org.apache.log4j.Logger;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
index cadbd8e..30cffb7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/NamespaceConfiguration.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.server.conf;
-import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
@@ -90,7 +89,7 @@ public class NamespaceConfiguration extends ObservableConfiguration {
public String get(Property property) {
String key = property.getKey();
AccumuloConfiguration getParent;
- if (!(namespaceId.equals(Namespaces.ACCUMULO_NAMESPACE_ID) && isIteratorOrConstraint(property.getKey()))) {
+ if (!(namespaceId.equals(Namespaces.ACCUMULO_NAMESPACE_ID) && isIteratorOrConstraint(key))) {
getParent = parent;
} else {
// ignore iterators from parent if system namespace
@@ -157,8 +156,7 @@ public class NamespaceConfiguration extends ObservableConfiguration {
}
/**
- * Invalidates the <code>ZooCache</code> used for storage and quick retrieval
- * of properties for this namespace configuration.
+ * Invalidates the <code>ZooCache</code> used for storage and quick retrieval of properties for this namespace configuration.
*/
@Override
public synchronized void invalidateCache() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
index 3bc349f..8e62a87 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ServerConfigurationFactory.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.server.conf;
import java.security.SecurityPermission;
import java.util.HashMap;
import java.util.Map;
-import java.util.Map.Entry;
import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.client.impl.Tables;
@@ -43,23 +42,25 @@ public class ServerConfigurationFactory {
namespaceConfigs = new HashMap<String,Map<String,NamespaceConfiguration>>(1);
tableParentConfigs = new HashMap<String,Map<String,NamespaceConfiguration>>(1);
}
+
private static void addInstanceToCaches(String iid) {
- synchronized(tableConfigs) {
+ synchronized (tableConfigs) {
if (!tableConfigs.containsKey(iid)) {
tableConfigs.put(iid, new HashMap<String,TableConfiguration>());
}
}
- synchronized(namespaceConfigs) {
+ synchronized (namespaceConfigs) {
if (!namespaceConfigs.containsKey(iid)) {
namespaceConfigs.put(iid, new HashMap<String,NamespaceConfiguration>());
}
}
- synchronized(tableParentConfigs) {
+ synchronized (tableParentConfigs) {
if (!tableParentConfigs.containsKey(iid)) {
tableParentConfigs.put(iid, new HashMap<String,NamespaceConfiguration>());
}
}
}
+
private static final SecurityPermission CONFIGURATION_PERMISSION = new SecurityPermission("configurationPermission");
private static final SecurityManager SM = System.getSecurityManager();
@@ -74,11 +75,13 @@ public class ServerConfigurationFactory {
return tableConfigs.get(instanceId).remove(tableId) != null;
}
}
+
static boolean removeCachedNamespaceConfiguration(String instanceId, String namespaceId) {
synchronized (namespaceConfigs) {
return namespaceConfigs.get(instanceId).remove(namespaceId) != null;
}
}
+
static void clearCachedConfigurations() {
synchronized (tableConfigs) {
tableConfigs.clear();
@@ -90,6 +93,7 @@ public class ServerConfigurationFactory {
tableParentConfigs.clear();
}
}
+
static void expireAllTableObservers() {
synchronized (tableConfigs) {
for (Map<String,TableConfiguration> instanceMap : tableConfigs.values()) {
@@ -109,6 +113,7 @@ public class ServerConfigurationFactory {
instanceID = instance.getInstanceID();
addInstanceToCaches(instanceID);
}
+
void setZooCacheFactory(ZooCacheFactory zcf) {
this.zcf = zcf;
}
@@ -141,7 +146,6 @@ public class ServerConfigurationFactory {
return systemConfig;
}
-
public TableConfiguration getTableConfiguration(String tableId) {
checkPermissions();
synchronized (tableConfigs) {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
index 4709b85..b657056 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfWatcher.java
@@ -33,13 +33,11 @@ class TableConfWatcher implements Watcher {
private static final Logger log = Logger.getLogger(TableConfWatcher.class);
private final Instance instance;
private final String tablesPrefix;
- private final int tablesPrefixLength;
private ServerConfigurationFactory scf;
TableConfWatcher(Instance instance) {
this.instance = instance;
tablesPrefix = ZooUtil.getRoot(instance) + Constants.ZTABLES + "/";
- tablesPrefixLength = tablesPrefix.length();
scf = new ServerConfigurationFactory(instance);
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
index 1936484..8cf46c7 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/TableConfiguration.java
@@ -16,7 +16,6 @@
*/
package org.apache.accumulo.server.conf;
-import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
@@ -131,8 +130,7 @@ public class TableConfiguration extends ObservableConfiguration {
}
/**
- * Invalidates the <code>ZooCache</code> used for storage and quick retrieval
- * of properties for this table configuration.
+ * Invalidates the <code>ZooCache</code> used for storage and quick retrieval of properties for this table configuration.
*/
@Override
public synchronized void invalidateCache() {
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
index ac30008..df1be50 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessor.java
@@ -18,11 +18,11 @@ package org.apache.accumulo.server.conf;
import java.util.List;
import java.util.Map;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.zookeeper.ZooUtil;
import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.log4j.Logger;
@@ -35,10 +35,12 @@ public class ZooCachePropertyAccessor {
static class PropCacheKey {
final String instanceId;
final String scope;
+
PropCacheKey(String iid, String s) {
instanceId = iid;
scope = s;
}
+
@Override
public boolean equals(Object other) {
if (this == other) {
@@ -50,6 +52,7 @@ public class ZooCachePropertyAccessor {
PropCacheKey o = (PropCacheKey) other;
return (instanceId.equals(o.instanceId) && scope.equals(o.scope));
}
+
@Override
public int hashCode() {
int c = 17;
@@ -64,11 +67,13 @@ public class ZooCachePropertyAccessor {
/**
* Creates a new accessor.
*
- * @param propCache property cache
+ * @param propCache
+ * property cache
*/
ZooCachePropertyAccessor(ZooCache propCache) {
this.propCache = propCache;
}
+
/**
* Gets the property cache accessed by this object.
*
@@ -79,13 +84,15 @@ public class ZooCachePropertyAccessor {
}
/**
- * Gets a property. If the property is not in ZooKeeper or is present but an
- * invalid format for the property type, the parent configuration is consulted
- * (if provided).
+ * Gets a property. If the property is not in ZooKeeper or is present but an invalid format for the property type, the parent configuration is consulted (if
+ * provided).
*
- * @param property property to get
- * @param path ZooKeeper path where properties lie
- * @param parent parent configuration (optional)
+ * @param property
+ * property to get
+ * @param path
+ * ZooKeeper path where properties lie
+ * @param parent
+ * parent configuration (optional)
* @return property value, or null if not found
*/
String get(Property property, String path, AccumuloConfiguration parent) {
@@ -113,16 +120,19 @@ public class ZooCachePropertyAccessor {
}
/**
- * Gets all properties into the given map. Properties are filtered using the
- * given filter. Properties from a parent configuration are also added to the
- * map and filtered, either using a separate filter or, if not specified, the
- * other filter.
+ * Gets all properties into the given map. Properties are filtered using the given filter. Properties from a parent configuration are also added to the map
+ * and filtered, either using a separate filter or, if not specified, the other filter.
*
- * @param props map to populate with properties
- * @param path ZooKeeper path where properties lie
- * @param filter property filter (required)
- * @param parent parent configuration (required)
- * @param parentFilter separate filter for parent properties (optional)
+ * @param props
+ * map to populate with properties
+ * @param path
+ * ZooKeeper path where properties lie
+ * @param filter
+ * property filter (required)
+ * @param parent
+ * parent configuration (required)
+ * @param parentFilter
+ * separate filter for parent properties (optional)
*/
void getProperties(Map<String,String> props, String path, PropertyFilter filter, AccumuloConfiguration parent, PropertyFilter parentFilter) {
parent.getProperties(props, parentFilter != null ? parentFilter : filter);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
index e2bf5f5..a49ec43 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/conf/ZooConfiguration.java
@@ -16,39 +16,32 @@
*/
package org.apache.accumulo.server.conf;
-import java.io.IOException;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.accumulo.core.Constants;
-import org.apache.accumulo.core.client.Instance;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
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.fs.VolumeManager;
-import org.apache.accumulo.server.fs.VolumeManagerImpl;
-import org.apache.hadoop.fs.Path;
import org.apache.log4j.Logger;
public class ZooConfiguration extends AccumuloConfiguration {
private static final Logger log = Logger.getLogger(ZooConfiguration.class);
-
+
private final String instanceId;
private final ZooCache propCache;
private final AccumuloConfiguration parent;
private final Map<String,String> fixedProps = Collections.synchronizedMap(new HashMap<String,String>());
-
+
protected ZooConfiguration(String instanceId, ZooCache propCache, AccumuloConfiguration parent) {
this.instanceId = instanceId;
this.propCache = propCache;
this.parent = parent;
}
-
+
@Override
public void invalidateCache() {
if (propCache != null)
@@ -67,11 +60,11 @@ public class ZooConfiguration extends AccumuloConfiguration {
private String _get(Property property) {
String key = property.getKey();
String value = null;
-
+
if (Property.isValidZooPropertyKey(key)) {
value = get(key);
}
-
+
if (value == null || !property.getType().isValidFormat(value)) {
if (value != null)
log.error("Using parent value for " + key + " due to improperly formatted " + property.getType() + ": " + value);
@@ -79,7 +72,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
}
return value;
}
-
+
@Override
public String get(Property property) {
if (Property.isFixedZooPropertyKey(property)) {
@@ -91,13 +84,13 @@ public class ZooConfiguration extends AccumuloConfiguration {
fixedProps.put(property.getKey(), val);
return val;
}
-
+
}
} else {
return _get(property);
}
}
-
+
private String get(String key) {
String zPath = ZooUtil.getRoot(instanceId) + Constants.ZCONFIG + "/" + key;
byte[] v = propCache.get(zPath);
@@ -106,7 +99,7 @@ public class ZooConfiguration extends AccumuloConfiguration {
value = new String(v, Constants.UTF8);
return value;
}
-
+
@Override
public void getProperties(Map<String,String> props, PropertyFilter filter) {
parent.getProperties(props, filter);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
----------------------------------------------------------------------
diff --git a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
index e702af4..463ca57 100644
--- a/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
+++ b/server/base/src/main/java/org/apache/accumulo/server/util/MetadataTableUtil.java
@@ -18,7 +18,6 @@ package org.apache.accumulo.server.util;
import java.io.IOException;
import java.util.ArrayList;
-import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
@@ -984,7 +983,6 @@ public class MetadataTableUtil {
}
-
public static void moveMetaDeleteMarkersFrom14(Instance instance, Credentials creds) {
// new KeyExtent is only added to force update to write to the metadata table, not the root table
KeyExtent notMetadata = new KeyExtent(new Text("anythingNotMetadata"), null, null);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
index b7f27cc..92580f3 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/TableConfigurationTest.java
@@ -16,14 +16,23 @@
*/
package org.apache.accumulo.server.conf;
+import static org.easymock.EasyMock.anyObject;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.eq;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.expectLastCall;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
import java.util.Collection;
import java.util.List;
import java.util.Map;
import java.util.UUID;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.client.Instance;
-import org.apache.accumulo.core.client.impl.Namespaces;
-import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.AllFilter;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.ConfigurationObserver;
@@ -33,16 +42,6 @@ import org.apache.accumulo.fate.zookeeper.ZooCache;
import org.apache.accumulo.fate.zookeeper.ZooCacheFactory;
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.easymock.EasyMock.anyObject;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.eq;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.expectLastCall;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
public class TableConfigurationTest {
private static final String TID = "table";
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java b/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
index 77e88b1..1b9d8f7 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/conf/ZooCachePropertyAccessorTest.java
@@ -16,26 +16,24 @@
*/
package org.apache.accumulo.server.conf;
-import java.nio.charset.Charset;
+import static org.easymock.EasyMock.createMock;
+import static org.easymock.EasyMock.expect;
+import static org.easymock.EasyMock.replay;
+import static org.easymock.EasyMock.verify;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+
import java.util.List;
import java.util.Map;
+
import org.apache.accumulo.core.Constants;
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.AccumuloConfiguration.PropertyFilter;
import org.apache.accumulo.core.conf.Property;
-import org.apache.accumulo.core.conf.PropertyType;
import org.apache.accumulo.fate.zookeeper.ZooCache;
-
import org.junit.Before;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
-import org.easymock.Capture;
-import static org.easymock.EasyMock.createMock;
-import static org.easymock.EasyMock.expect;
-import static org.easymock.EasyMock.replay;
-import static org.easymock.EasyMock.verify;
public class ZooCachePropertyAccessorTest {
private static final String PATH = "/root/path/to/props";
@@ -61,7 +59,7 @@ public class ZooCachePropertyAccessorTest {
@Test
public void testGet_Valid() {
- expect(zc.get(PATH + "/" + KEY)).andReturn(VALUE_BYTES);
+ expect(zc.get(FULL_PATH)).andReturn(VALUE_BYTES);
replay(zc);
assertEquals(VALUE, a.get(PROP, PATH, null));
}
@@ -71,7 +69,7 @@ public class ZooCachePropertyAccessorTest {
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
expect(parent.get(PROP)).andReturn(VALUE);
replay(parent);
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertEquals(VALUE, a.get(PROP, PATH, parent));
}
@@ -81,14 +79,14 @@ public class ZooCachePropertyAccessorTest {
AccumuloConfiguration parent = createMock(AccumuloConfiguration.class);
expect(parent.get(PROP)).andReturn(null);
replay(parent);
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertNull(a.get(PROP, PATH, parent));
}
@Test
public void testGet_Null_NoParent() {
- expect(zc.get(PATH + "/" + KEY)).andReturn(null);
+ expect(zc.get(FULL_PATH)).andReturn(null);
replay(zc);
assertNull(a.get(PROP, PATH, null));
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
index 5f97bf6..582822a 100644
--- a/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
+++ b/server/base/src/test/java/org/apache/accumulo/server/fs/VolumeManagerImplTest.java
@@ -19,7 +19,6 @@ package org.apache.accumulo.server.fs;
import java.util.Arrays;
import java.util.List;
-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.server.fs.VolumeManager.FileType;
@@ -29,7 +28,7 @@ import org.junit.Before;
import org.junit.Test;
/**
- *
+ *
*/
public class VolumeManagerImplTest {
@@ -65,7 +64,7 @@ public class VolumeManagerImplTest {
String basePath = fs.getDefaultVolume().getBasePath();
String scheme = fs.getDefaultVolume().getFileSystem().getUri().toURL().getProtocol();
System.out.println(basePath);
- Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
+ Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
List<String> pathsToTest = Arrays.asList("1/default_tablet", "1/default_tablet/", "1/t-0000001");
for (String pathToTest : pathsToTest) {
Path fullPath = fs.getFullPath(FileType.TABLE, pathToTest);
@@ -78,7 +77,7 @@ public class VolumeManagerImplTest {
String basePath = fs.getDefaultVolume().getBasePath();
String scheme = fs.getDefaultVolume().getFileSystem().getUri().toURL().getProtocol();
System.out.println(basePath);
- Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
+ Path expectedBase = new Path(scheme + ":" + basePath, FileType.TABLE.getDirectory());
List<String> pathsToTest = Arrays.asList("1/default_tablet/C0000001.rf", "1/t-0000001/C0000001.rf");
for (String pathToTest : pathsToTest) {
Path fullPath = fs.getFullPath(FileType.TABLE, pathToTest);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/23c74cd4/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
index 37aa8a1..887aee4 100644
--- a/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/functional/BalanceInPresenceOfOfflineTableIT.java
@@ -126,7 +126,6 @@ public class BalanceInPresenceOfOfflineTableIT extends ConfigurableMacIT {
continue;
}
- int numTablets = 0;
long[] tabletsPerServer = new long[stats.getTServerInfoSize()];
Arrays.fill(tabletsPerServer, 0l);
for (int i = 0; i < stats.getTServerInfoSize(); i++) {