You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by mw...@apache.org on 2017/03/27 17:45:04 UTC
accumulo git commit: ACCUMULO-4613 Verify directories in
accumulo-env.sh
Repository: accumulo
Updated Branches:
refs/heads/master b82d7a90b -> b4f86d978
ACCUMULO-4613 Verify directories in accumulo-env.sh
* Added checks to verify that Hadoop & Zookeeper dirs
exist in accumulo-env.sh.
* Commiting Java formatter changes
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/b4f86d97
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/b4f86d97
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/b4f86d97
Branch: refs/heads/master
Commit: b4f86d978c3abb7a1f9e448f49c1598afe0d8cf9
Parents: b82d7a9
Author: Mike Walch <mw...@apache.org>
Authored: Mon Mar 27 11:06:58 2017 -0400
Committer: Mike Walch <mw...@apache.org>
Committed: Mon Mar 27 13:33:09 2017 -0400
----------------------------------------------------------------------
assemble/conf/accumulo-env.sh | 13 +++++++++++--
.../accumulo/core/conf/AccumuloConfiguration.java | 9 +++++----
.../accumulo/core/conf/AccumuloConfigurationTest.java | 5 ++---
.../accumulo/tserver/tablet/DatafileManager.java | 3 ++-
4 files changed, 20 insertions(+), 10 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b4f86d97/assemble/conf/accumulo-env.sh
----------------------------------------------------------------------
diff --git a/assemble/conf/accumulo-env.sh b/assemble/conf/accumulo-env.sh
index f9e8945..c1362c0 100644
--- a/assemble/conf/accumulo-env.sh
+++ b/assemble/conf/accumulo-env.sh
@@ -40,8 +40,17 @@ export ZOOKEEPER_HOME="${ZOOKEEPER_HOME:-/path/to/zookeeper}"
# Build CLASSPATH variable
##########################
-## Adds external Hadoop & Zookeeper dependencies to CLASSPATH. See "Vendor configuration" section of Accumulo user manual
-## for different settings if you installed vendor's distribution of Hadoop or Zookeeper.
+## Verify that Hadoop & Zookeeper installation directories exist
+if [ ! -d "$ZOOKEEPER_HOME" ]; then
+ echo "ZOOKEEPER_HOME=$ZOOKEEPER_HOME is not set to a valid directory in accumulo-env.sh"
+ exit 1
+fi
+if [ ! -d "$HADOOP_PREFIX" ]; then
+ echo "HADOOP_PREFIX=$HADOOP_PREFIX is not set to a valid directory in accumulo-env.sh"
+ exit 1
+fi
+
+## Add external Hadoop & Zookeeper dependencies to CLASSPATH.
CLASSPATH="$(find "$ZOOKEEPER_HOME"/ "$HADOOP_PREFIX"/share/hadoop/{common,common/lib,hdfs,mapreduce,yarn} -maxdepth 1 -name '*.jar' \
-and -not -name '*slf4j*' \
-and -not -name '*fatjar*' \
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b4f86d97/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
----------------------------------------------------------------------
diff --git a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
index 363a66c..a9ce195 100644
--- a/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
+++ b/core/src/main/java/org/apache/accumulo/core/conf/AccumuloConfiguration.java
@@ -165,12 +165,13 @@ public abstract class AccumuloConfiguration implements Iterable<Entry<String,Str
}
/**
- * Gets a property of type {@link PropertyType#BYTES} or {@link PropertyType#MEMORY}, interpreting
- * the value properly.
+ * Gets a property of type {@link PropertyType#BYTES} or {@link PropertyType#MEMORY}, interpreting the value properly.
*
- * @param property Property to get
+ * @param property
+ * Property to get
* @return property value
- * @throws IllegalArgumentException if the property is of the wrong type
+ * @throws IllegalArgumentException
+ * if the property is of the wrong type
*/
public long getAsBytes(Property property) {
String memString = get(property);
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b4f86d97/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
----------------------------------------------------------------------
diff --git a/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java b/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
index 0514a82..f7a37bf 100644
--- a/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
+++ b/core/src/test/java/org/apache/accumulo/core/conf/AccumuloConfigurationTest.java
@@ -29,9 +29,8 @@ public class AccumuloConfigurationTest {
@Test
public void testGetMemoryInBytes() throws Exception {
- List<Function<String,Long>> funcs = Arrays.asList(AccumuloConfiguration::getFixedMemoryAsBytes,
- AccumuloConfiguration::getMemoryAsBytes);
- for(Function<String,Long> memFunc : funcs) {
+ List<Function<String,Long>> funcs = Arrays.asList(AccumuloConfiguration::getFixedMemoryAsBytes, AccumuloConfiguration::getMemoryAsBytes);
+ for (Function<String,Long> memFunc : funcs) {
assertEquals(42l, memFunc.apply("42").longValue());
assertEquals(42l, memFunc.apply("42b").longValue());
assertEquals(42l, memFunc.apply("42B").longValue());
http://git-wip-us.apache.org/repos/asf/accumulo/blob/b4f86d97/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
index b2c917a..248e554 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/DatafileManager.java
@@ -299,7 +299,8 @@ class DatafileManager {
// find the smallest file
long maxFileSize = Long.MAX_VALUE;
- maxMergingMinorCompactionFileSize = AccumuloConfiguration.getFixedMemoryAsBytes(tablet.getTableConfiguration().get(Property.TABLE_MINC_MAX_MERGE_FILE_SIZE));
+ maxMergingMinorCompactionFileSize = AccumuloConfiguration.getFixedMemoryAsBytes(tablet.getTableConfiguration().get(
+ Property.TABLE_MINC_MAX_MERGE_FILE_SIZE));
if (maxMergingMinorCompactionFileSize > 0) {
maxFileSize = maxMergingMinorCompactionFileSize;
}