public class HiveRunnerConfig extends Object
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.17</version>
<configuration>
...
<systemProperties>
<hiveconf_any.hive.conf>1000</hiveconf_any.hive.conf>
<enableTimeout>false</enableTimeout>
<timeoutSeconds>30</timeoutSeconds>
<timeoutRetries>2</timeoutRetries>
<commandShellEmulation>BEELINE</commandShellEmulation>
</systemProperties>
</configuration>
</plugin>
Properties may be overridden per test class by annotating a static HiveRunnerConfig field like:
@HiveRunnerSetup
public final static HiveRunnerConfig config = new HiveRunnerConfig(){{
setTimeoutEnabled(true);
setTimeoutSeconds(15);
setTimeoutRetries(2);
setCommandShellEmulation(CommandShellEmulation.BEELINE);
}};
See the test class<com.klarna.hiverunner.DisabledTimeoutTest for more information.| Modifier and Type | Field and Description |
|---|---|
static String |
COMMAND_SHELL_EMULATOR_DEFAULT |
static String |
COMMAND_SHELL_EMULATOR_PROPERTY_NAME
The shell's
CommandShellEmulator. |
static boolean |
ENABLE_TIMEOUT_DEFAULT |
static String |
ENABLE_TIMEOUT_PROPERTY_NAME
Enable timeout.
|
static String |
HIVECONF_SYSTEM_OVERRIDE_PREFIX
Suffix used to flag a system property to be a hiveconf setting.
|
static int |
TIMEOUT_RETRIES_DEFAULT |
static String |
TIMEOUT_RETRIES_PROPERTY_NAME
Number of retries for a test case that keep timing out.
|
static int |
TIMEOUT_SECONDS_DEFAULT |
static String |
TIMEOUT_SECONDS_PROPERTY_NAME
Seconds to wait for a query to terminate before triggering the timeout.
|
| Constructor and Description |
|---|
HiveRunnerConfig()
Construct a HiveRunnerConfig that will override hiveConf with
System properties of the format 'hiveconf_[hiveconf property name]'.
|
HiveRunnerConfig(Properties systemProperties)
Construct a HiveRunnerConfig that will override hiveConf with
the given properties of the format 'hiveconf_[hiveconf property name]'.
|
| Modifier and Type | Method and Description |
|---|---|
CommandShellEmulator |
getCommandShellEmulator()
Determines the statement parsing behaviour of the interactive shell.
|
Map<String,String> |
getHiveConfSystemOverride() |
String |
getHiveExecutionEngine()
Get the configured hive.execution.engine.
|
int |
getTimeoutRetries() |
int |
getTimeoutSeconds() |
boolean |
isTimeoutEnabled() |
void |
override(HiveRunnerConfig hiveRunnerConfig)
Copy values from the inserted config to this config.
|
void |
setCommandShellEmulator(CommandShellEmulator commandShellEmulator) |
void |
setHiveExecutionEngine(String executionEngine) |
void |
setTimeoutEnabled(boolean isEnabled) |
void |
setTimeoutRetries(int retries) |
void |
setTimeoutSeconds(int timeout) |
public static final String ENABLE_TIMEOUT_PROPERTY_NAME
public static final boolean ENABLE_TIMEOUT_DEFAULT
public static final String TIMEOUT_SECONDS_PROPERTY_NAME
public static final int TIMEOUT_SECONDS_DEFAULT
public static final String TIMEOUT_RETRIES_PROPERTY_NAME
public static final int TIMEOUT_RETRIES_DEFAULT
public static final String HIVECONF_SYSTEM_OVERRIDE_PREFIX
public static final String COMMAND_SHELL_EMULATOR_PROPERTY_NAME
CommandShellEmulator.
Defaults to HIVE_CLIpublic static final String COMMAND_SHELL_EMULATOR_DEFAULT
public HiveRunnerConfig()
public HiveRunnerConfig(Properties systemProperties)
public boolean isTimeoutEnabled()
public int getTimeoutRetries()
public int getTimeoutSeconds()
public String getHiveExecutionEngine()
public CommandShellEmulator getCommandShellEmulator()
public void setTimeoutEnabled(boolean isEnabled)
public void setTimeoutRetries(int retries)
public void setTimeoutSeconds(int timeout)
public void setHiveExecutionEngine(String executionEngine)
public void setCommandShellEmulator(CommandShellEmulator commandShellEmulator)
public void override(HiveRunnerConfig hiveRunnerConfig)
Copyright © 2013–2020. All rights reserved.