Skip to content
Permalink
Browse files

Add LIBHDFS_CLASSPATH so we could define specific classpath for libhdfs

This will avoid impacting all containers exposing a non glob classpath
for libhdfs on another env variables than CLASSPATH
  • Loading branch information...
ashangit committed Oct 25, 2018
1 parent cec5f6f commit 874203d6c026ba99d2e4a213dac895b0581b7d4b
Showing with 7 additions and 4 deletions.
  1. +7 −4 hadoop-hdfs-project/hadoop-hdfs/src/main/native/libhdfs/jni_helper.c
@@ -393,11 +393,14 @@ static JNIEnv* getGlobalJNIEnv(void)

if (noVMs == 0) {
//Get the environment variables for initializing the JVM
hadoopClassPath = getenv("CLASSPATH");
hadoopClassPath = getenv("LIBHDFS_CLASSPATH");
if (hadoopClassPath == NULL) {
fprintf(stderr, "Environment variable CLASSPATH not set!\n");
return NULL;
}
hadoopClassPath = getenv("CLASSPATH");
if (hadoopClassPath == NULL) {
fprintf(stderr, "Environment variables LIBHDFS_CLASSPATH or CLASSPATH not set!\n");
return NULL;
}
}
optHadoopClassPathLen = strlen(hadoopClassPath) +
strlen(hadoopClassPathVMArg) + 1;
optHadoopClassPath = malloc(sizeof(char)*optHadoopClassPathLen);

0 comments on commit 874203d

Please sign in to comment.
You can’t perform that action at this time.