diff --git a/hbase0.98/hbase-common-0.98/src/main/java/com/kakao/hbase/common/HBaseClient.java b/hbase0.98/hbase-common-0.98/src/main/java/com/kakao/hbase/common/HBaseClient.java index 3460f8c..02f48bc 100644 --- a/hbase0.98/hbase-common-0.98/src/main/java/com/kakao/hbase/common/HBaseClient.java +++ b/hbase0.98/hbase-common-0.98/src/main/java/com/kakao/hbase/common/HBaseClient.java @@ -44,6 +44,11 @@ private HBaseClient() { } private static String createJaasConfigFile(Args args) throws FileNotFoundException, UnsupportedEncodingException { + // fixme hash collision may occur in args.hashStr() + final String authConfFileName = "/tmp/" + "hbase-client-" + args.hashStr() + ".jaas"; + File file = new File(authConfFileName); + if (file.exists()) return authConfFileName; + StringBuilder sb = new StringBuilder(); sb.append("Client {\n"); sb.append("com.sun.security.auth.module.Krb5LoginModule required\n"); @@ -60,7 +65,6 @@ private static String createJaasConfigFile(Args args) throws FileNotFoundExcepti } sb.append(";};"); - String authConfFileName = "/tmp/" + "hbase-client-" + args.hashStr() + ".jaas"; try (PrintWriter writer = new PrintWriter(authConfFileName, Constant.CHARSET.name())) { writer.print(sb); }