Package org.apache.hadoop.hbase.util
Class SimpleKdcServerUtil
java.lang.Object
org.apache.hadoop.hbase.util.SimpleKdcServerUtil
Utility for running
SimpleKdcServer
. Kerby KDC server is favored over Hadoop
org.apache.hadoop.minikdc server which has support in the HBaseTestingUtility at #setupMiniKdc.
The Kerby KDC Server came in with HBASE-5291. Its preferred. Less baggage.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.kerby.kerberos.kerb.server.SimpleKdcServer
getRunningSimpleKdcServer
(File testDir, Supplier<Integer> randomPortGenerator) Returns a running kdc server.(package private) static org.apache.kerby.kerberos.kerb.server.SimpleKdcServer
getRunningSimpleKdcServer
(File testDir, Supplier<Integer> randomPortGenerator, boolean portClash) Internal method for testing.
-
Field Details
-
LOG
-
-
Constructor Details
-
SimpleKdcServerUtil
private SimpleKdcServerUtil()
-
-
Method Details
-
getRunningSimpleKdcServer
public static org.apache.kerby.kerberos.kerb.server.SimpleKdcServer getRunningSimpleKdcServer(File testDir, Supplier<Integer> randomPortGenerator) throws org.apache.kerby.kerberos.kerb.KrbException, IOException Returns a running kdc server. Use this method rather than start the SimpleKdcServer yourself because it takes care of BindExceptions which can happen even though port-picking is random (between the choice of port number and bind, it could have been used elsewhere).- Returns:
- A SimpleKdcServer on which 'start' has been called; be sure to call stop on this instance when done.
- Throws:
org.apache.kerby.kerberos.kerb.KrbException
IOException
-
getRunningSimpleKdcServer
static org.apache.kerby.kerberos.kerb.server.SimpleKdcServer getRunningSimpleKdcServer(File testDir, Supplier<Integer> randomPortGenerator, boolean portClash) throws org.apache.kerby.kerberos.kerb.KrbException, IOException Internal method for testing.- Parameters:
portClash
- True if we want to generate BindException (for testing).- Returns:
- A running SimpleKdcServer on loopback/'localhost' on a random port
- Throws:
org.apache.kerby.kerberos.kerb.KrbException
IOException
- See Also:
-