forked from apache/storm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request apache#3065 from krichter722/checkstyle-autocreds
STORM-3449: autocreds: fix all checkstyle warnings
- Loading branch information
Showing
17 changed files
with
312 additions
and
287 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,49 +15,50 @@ | |
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.storm.hbase.security; | ||
|
||
import org.apache.storm.Config; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import static org.apache.storm.hbase.security.HBaseSecurityUtil.HBASE_KEYTAB_FILE_KEY; | ||
import static org.apache.storm.hbase.security.HBaseSecurityUtil.HBASE_PRINCIPAL_KEY; | ||
|
||
import javax.security.auth.Subject; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import javax.security.auth.Subject; | ||
|
||
import static org.apache.storm.hbase.security.HBaseSecurityUtil.HBASE_KEYTAB_FILE_KEY; | ||
import static org.apache.storm.hbase.security.HBaseSecurityUtil.HBASE_PRINCIPAL_KEY; | ||
import org.apache.storm.Config; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* Command tool of Hive credential renewer | ||
* Command tool of Hive credential renewer. | ||
*/ | ||
public final class AutoHBaseCommand { | ||
private static final Logger LOG = LoggerFactory.getLogger(AutoHBaseCommand.class); | ||
|
||
private AutoHBaseCommand() { | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static void main(String[] args) throws Exception { | ||
Map<String, Object> conf = new HashMap<>(); | ||
conf.put(HBASE_PRINCIPAL_KEY, args[1]); // hbase principal [email protected] | ||
conf.put(HBASE_KEYTAB_FILE_KEY, | ||
args[2]); // storm hbase keytab /etc/security/keytabs/storm-hbase.keytab | ||
|
||
AutoHBase autoHBase = new AutoHBase(); | ||
autoHBase.prepare(conf); | ||
AutoHBaseNimbus autoHBaseNimbus = new AutoHBaseNimbus(); | ||
autoHBaseNimbus.prepare(conf); | ||
|
||
Map<String, String> creds = new HashMap<>(); | ||
autoHBaseNimbus.populateCredentials(creds, conf, args[0]); //with realm e.g. [email protected] | ||
LOG.info("Got HBase credentials" + autoHBase.getCredentials(creds)); | ||
|
||
Subject s = new Subject(); | ||
autoHBase.populateSubject(s, creds); | ||
LOG.info("Got a Subject " + s); | ||
|
||
autoHBaseNimbus.renew(creds, conf, args[0]); | ||
LOG.info("renewed credentials" + autoHBase.getCredentials(creds)); | ||
} | ||
private static final Logger LOG = LoggerFactory.getLogger(AutoHBaseCommand.class); | ||
|
||
private AutoHBaseCommand() { | ||
} | ||
|
||
@SuppressWarnings("unchecked") | ||
public static void main(String[] args) throws Exception { | ||
Map<String, Object> conf = new HashMap<>(); | ||
conf.put(HBASE_PRINCIPAL_KEY, args[1]); // hbase principal [email protected] | ||
conf.put(HBASE_KEYTAB_FILE_KEY, | ||
args[2]); // storm hbase keytab /etc/security/keytabs/storm-hbase.keytab | ||
|
||
AutoHBase autoHBase = new AutoHBase(); | ||
autoHBase.prepare(conf); | ||
AutoHBaseNimbus autoHBaseNimbus = new AutoHBaseNimbus(); | ||
autoHBaseNimbus.prepare(conf); | ||
|
||
Map<String, String> creds = new HashMap<>(); | ||
autoHBaseNimbus.populateCredentials(creds, conf, args[0]); //with realm e.g. [email protected] | ||
LOG.info("Got HBase credentials" + autoHBase.getCredentials(creds)); | ||
|
||
Subject s = new Subject(); | ||
autoHBase.populateSubject(s, creds); | ||
LOG.info("Got a Subject " + s); | ||
|
||
autoHBaseNimbus.renew(creds, conf, args[0]); | ||
LOG.info("renewed credentials" + autoHBase.getCredentials(creds)); | ||
} | ||
} |
Oops, something went wrong.