HDDS-1597. Remove hdds-server-scm dependency from ozone-common (#969)
* HDDS-1597. Remove hdds-server-scm dependency from ozone-common. Contributed by Elek, Marton. * checkstyle fixes * revert the import reorder of HddsUtil * add javadoc * switch back to the commons-lang2 * fix typo * fix metrics core classpath problem (+rebase fix)
This commit is contained in:
parent
719d57bf46
commit
004207996c
@ -37,6 +37,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-hdds-server-framework</artifactId>
|
<artifactId>hadoop-hdds-server-framework</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.dropwizard.metrics</groupId>
|
||||||
|
<artifactId>metrics-core</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
@ -56,12 +60,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<version>3.0.1</version>
|
<version>3.0.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.dropwizard.metrics</groupId>
|
|
||||||
<artifactId>metrics-core</artifactId>
|
|
||||||
<scope>test</scope>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -203,4 +203,25 @@ public static void setOzoneMetaDirPath(OzoneConfiguration conf,
|
|||||||
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, path);
|
conf.set(HddsConfigKeys.OZONE_METADATA_DIRS, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns with the service specific metadata directory.
|
||||||
|
* <p>
|
||||||
|
* If the directory is missing the method tries to create it.
|
||||||
|
*
|
||||||
|
* @param conf The ozone configuration object
|
||||||
|
* @param key The configuration key which specify the directory.
|
||||||
|
* @return The path of the directory.
|
||||||
|
*/
|
||||||
|
public static File getDBPath(Configuration conf, String key) {
|
||||||
|
final File dbDirPath =
|
||||||
|
getDirectoryFromConfig(conf, key, "OM");
|
||||||
|
if (dbDirPath != null) {
|
||||||
|
return dbDirPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.warn("{} is not configured. We recommend adding this setting. "
|
||||||
|
+ "Falling back to {} instead.", key,
|
||||||
|
HddsConfigKeys.OZONE_METADATA_DIRS);
|
||||||
|
return ServerUtils.getOzoneMetaDirPath(conf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -100,6 +100,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.bouncycastle</groupId>
|
<groupId>org.bouncycastle</groupId>
|
||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.dropwizard.metrics</groupId>
|
||||||
|
<artifactId>metrics-core</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.findbugs</groupId>
|
<groupId>com.google.code.findbugs</groupId>
|
||||||
<artifactId>findbugs</artifactId>
|
<artifactId>findbugs</artifactId>
|
||||||
|
@ -18,18 +18,13 @@
|
|||||||
|
|
||||||
package org.apache.hadoop.hdds.scm;
|
package org.apache.hadoop.hdds.scm;
|
||||||
|
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
|
||||||
import org.apache.hadoop.hdds.HddsConfigKeys;
|
|
||||||
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ScmOps;
|
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.ScmOps;
|
||||||
import org.apache.hadoop.hdds.scm.safemode.Precheck;
|
|
||||||
import org.apache.hadoop.hdds.scm.exceptions.SCMException;
|
import org.apache.hadoop.hdds.scm.exceptions.SCMException;
|
||||||
import org.apache.hadoop.hdds.server.ServerUtils;
|
import org.apache.hadoop.hdds.scm.safemode.Precheck;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SCM utility class.
|
* SCM utility class.
|
||||||
*/
|
*/
|
||||||
@ -53,16 +48,4 @@ public static void preCheck(ScmOps operation, Precheck... preChecks)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static File getDBPath(Configuration conf, String dbDirectory) {
|
|
||||||
final File dbDirPath =
|
|
||||||
ServerUtils.getDirectoryFromConfig(conf, dbDirectory, "OM");
|
|
||||||
if (dbDirPath != null) {
|
|
||||||
return dbDirPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.warn("{} is not configured. We recommend adding this setting. "
|
|
||||||
+ "Falling back to {} instead.", dbDirectory,
|
|
||||||
HddsConfigKeys.OZONE_METADATA_DIRS);
|
|
||||||
return ServerUtils.getOzoneMetaDirPath(conf);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -60,10 +60,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-hdds-server-framework</artifactId>
|
<artifactId>hadoop-hdds-server-framework</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.hadoop</groupId>
|
|
||||||
<artifactId>hadoop-hdds-server-scm</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-hdds-container-service</artifactId>
|
<artifactId>hadoop-hdds-container-service</artifactId>
|
||||||
|
@ -42,8 +42,8 @@
|
|||||||
import org.apache.commons.lang3.RandomStringUtils;
|
import org.apache.commons.lang3.RandomStringUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hdds.scm.ScmUtils;
|
|
||||||
import org.apache.hadoop.hdds.scm.HddsServerUtil;
|
import org.apache.hadoop.hdds.scm.HddsServerUtil;
|
||||||
|
import org.apache.hadoop.hdds.server.ServerUtils;
|
||||||
import org.apache.hadoop.net.NetUtils;
|
import org.apache.hadoop.net.NetUtils;
|
||||||
import org.apache.hadoop.ozone.om.OMConfigKeys;
|
import org.apache.hadoop.ozone.om.OMConfigKeys;
|
||||||
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
|
import org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos;
|
||||||
@ -172,7 +172,7 @@ public static int getOmRestPort(Configuration conf) {
|
|||||||
* @return File path, after creating all the required Directories.
|
* @return File path, after creating all the required Directories.
|
||||||
*/
|
*/
|
||||||
public static File getOmDbDir(Configuration conf) {
|
public static File getOmDbDir(Configuration conf) {
|
||||||
return ScmUtils.getDBPath(conf, OMConfigKeys.OZONE_OM_DB_DIRS);
|
return ServerUtils.getDBPath(conf, OMConfigKeys.OZONE_OM_DB_DIRS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -34,6 +34,10 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-common</artifactId>
|
<artifactId>hadoop-ozone-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
<artifactId>hadoop-hdds-server-scm</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-ozone-manager</artifactId>
|
<artifactId>hadoop-ozone-ozone-manager</artifactId>
|
||||||
@ -64,6 +68,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-client</artifactId>
|
<artifactId>hadoop-ozone-client</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-ozone-manager</artifactId>
|
<artifactId>hadoop-ozone-ozone-manager</artifactId>
|
||||||
|
@ -220,6 +220,11 @@
|
|||||||
<artifactId>bcprov-jdk15on</artifactId>
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
<version>${bouncycastle.version}</version>
|
<version>${bouncycastle.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-lang</groupId>
|
||||||
|
<artifactId>commons-lang</artifactId>
|
||||||
|
<version>2.6</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
@ -37,6 +37,11 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-common</artifactId>
|
<artifactId>hadoop-ozone-common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!-- Genesis requires server side components -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.hadoop</groupId>
|
||||||
|
<artifactId>hadoop-hdds-server-scm</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.hadoop</groupId>
|
<groupId>org.apache.hadoop</groupId>
|
||||||
<artifactId>hadoop-ozone-client</artifactId>
|
<artifactId>hadoop-ozone-client</artifactId>
|
||||||
|
Loading…
Reference in New Issue
Block a user