public class ClusterFixture extends BaseFixture implements AutoCloseable
| Modifier and Type | Class and Description |
|---|---|
static class |
ClusterFixture.FixtureTestServices
Shim class to allow the
TestBuilder class to work with the
cluster fixture. |
| Modifier and Type | Field and Description |
|---|---|
protected List<ClientFixture> |
clients |
static String |
DEFAULT_BIT_NAME |
static String |
EXPLAIN_PLAN_JSON |
static String |
EXPLAIN_PLAN_TEXT |
static int |
MAX_WIDTH_PER_NODE |
protected RestClientFixture |
restClientFixture |
static Properties |
TEST_CONFIGURATIONS |
allocator, config| Modifier and Type | Method and Description |
|---|---|
static ClusterFixtureBuilder |
bareBuilder(BaseDirTestWatcher dirTestWatcher)
Return a cluster builder without any of the usual defaults.
|
static ClusterFixtureBuilder |
builder(BaseDirTestWatcher dirTestWatcher) |
DrillClient |
client() |
ClientFixture |
client(String host,
int port)
Create a test client for a specific host and port.
|
ClientFixture.ClientBuilder |
clientBuilder() |
ClientFixture |
clientFixture() |
void |
close()
Close the clients, Drillbits, allocator and
Zookeeper.
|
void |
closeDrillbit(String drillbitName)
Shutdown the drillbit given the name of the drillbit.
|
void |
defineFormat(String pluginName,
String name,
FormatPluginConfig config) |
void |
defineFormats(String pluginName,
Map<String,FormatPluginConfig> formats) |
void |
defineImmutableWorkspace(String pluginName,
String schemaName,
String path,
String defaultFormat,
FormatPluginConfig format) |
void |
defineStoragePlugin(String name,
StoragePluginConfig config) |
void |
defineWorkspace(String pluginName,
String schemaName,
String path,
String defaultFormat)
Define a workspace within an existing storage plugin.
|
void |
defineWorkspace(String pluginName,
String schemaName,
String path,
String defaultFormat,
FormatPluginConfig format) |
Drillbit |
drillbit() |
Drillbit |
drillbit(String name) |
Collection<Drillbit> |
drillbits() |
Properties |
getClientProps() |
File |
getDrillTempDir() |
File |
getProfileDir()
Returns the directory that holds query profiles.
|
static String |
getResource(String resource) |
Connection |
jdbcConnection()
Return a JDBC connection to the default (first) Drillbit.
|
static String |
loadResource(String resource)
Load a resource file, returning the resource as a string.
|
File |
makeDataDir(String key,
String defaultFormat,
FormatPluginConfig formatPluginConfig)
Create a temporary data directory which will be removed when the
cluster closes, and register it as a "dfs" name space.
|
RestClientFixture.Builder |
restClientBuilder() |
RestClientFixture |
restClientFixture() |
RemoteServiceSet |
serviceSet() |
static ClusterFixture |
standardCluster(BaseDirTestWatcher dirTestWatcher)
Return a cluster fixture built with standard options.
|
StoragePluginRegistry |
storageRegistry() |
StoragePluginRegistry |
storageRegistry(String name) |
static String |
stringify(Object value)
Convert a Java object (typically a boxed scalar) to a string
for use in SQL.
|
static String |
trimSlash(String path)
Guava likes paths to resources without an initial slash, the JDK
needs a slash.
|
boolean |
usesZK() |
allocator, config, dirtyMemory, dirtyMemory, getTempDirpublic static final int MAX_WIDTH_PER_NODE
public static final Properties TEST_CONFIGURATIONS
public static final String DEFAULT_BIT_NAME
protected List<ClientFixture> clients
protected RestClientFixture restClientFixture
public static final String EXPLAIN_PLAN_TEXT
public static final String EXPLAIN_PLAN_JSON
public Properties getClientProps()
public Drillbit drillbit()
public Collection<Drillbit> drillbits()
public RemoteServiceSet serviceSet()
public ClientFixture.ClientBuilder clientBuilder()
public RestClientFixture.Builder restClientBuilder()
public ClientFixture clientFixture()
public ClientFixture client(String host, int port)
host - host, must be one of those created by this
fixtureport - post, must be one of those created by this
fixturepublic RestClientFixture restClientFixture()
public DrillClient client()
public Connection jdbcConnection()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic void closeDrillbit(String drillbitName) throws Exception
Exceptionpublic void defineStoragePlugin(String name, StoragePluginConfig config)
public void defineWorkspace(String pluginName, String schemaName, String path, String defaultFormat)
pluginName - name of the plugin like "dfs".schemaName - name of the new schemapath - directory location (usually local)defaultFormat - default format for files in the schemapublic void defineWorkspace(String pluginName, String schemaName, String path, String defaultFormat, FormatPluginConfig format)
public void defineImmutableWorkspace(String pluginName, String schemaName, String path, String defaultFormat, FormatPluginConfig format)
public void defineFormat(String pluginName, String name, FormatPluginConfig config)
public void defineFormats(String pluginName, Map<String,FormatPluginConfig> formats)
public static ClusterFixtureBuilder builder(BaseDirTestWatcher dirTestWatcher)
public static ClusterFixtureBuilder bareBuilder(BaseDirTestWatcher dirTestWatcher)
TEST_CONFIGURATIONS for details. Note that
you are often better off using the defaults, then replacing selected
properties with the values you prefer.public static ClusterFixture standardCluster(BaseDirTestWatcher dirTestWatcher)
dirTestWatcher - directory test watcherpublic static String stringify(Object value)
value - the value to encodepublic static String getResource(String resource) throws IOException
IOExceptionpublic static String loadResource(String resource)
resource - path to the resourcepublic static String trimSlash(String path)
path - resource path with optional leading slashpublic File makeDataDir(String key, String defaultFormat, FormatPluginConfig formatPluginConfig)
key - The name to use for the directory and the name space.
Access the directory as "dfs.defaultFormat - The default storage format for the workspace.formatPluginConfig - The format plugin config.public File getDrillTempDir()
public boolean usesZK()
public File getProfileDir()
public StoragePluginRegistry storageRegistry()
public StoragePluginRegistry storageRegistry(String name)
Copyright © 2021 The Apache Software Foundation. All rights reserved.