valid keytab exist
package com.dtstack.flink.sql.sink.hbase;
import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.hbase.exceptions.IllegalArgumentIOException;
import org.apache.hadoop.security.UserGroupInformation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
+import java.io.File;
import java.io.IOException;
/**
@@ -69,6 +71,10 @@ public class HbaseConfigUtils {
throw new IllegalArgumentException("keytab can not be null");
}
+ if (!new File(keytab).exists()){
+ throw new IllegalArgumentIOException("keytab ["+ keytab + "] not exist");
+ }
+
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
