Class MiniAccumuloClusterImpl
- java.lang.Object
-
- org.apache.accumulo.miniclusterImpl.MiniAccumuloClusterImpl
-
- All Implemented Interfaces:
AccumuloCluster
public class MiniAccumuloClusterImpl extends Object implements AccumuloCluster
This class provides the backing implementation forMiniAccumuloCluster
, and may contain features for internal testing which have not yet been promoted to the public API. It's best to useMiniAccumuloCluster
whenever possible. Use of this class risks API breakage between versions.- Since:
- 1.6.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MiniAccumuloClusterImpl.ProcessInfo
-
Constructor Summary
Constructors Constructor Description MiniAccumuloClusterImpl(File dir, String rootPassword)
MiniAccumuloClusterImpl(MiniAccumuloConfigImpl config)
-
Method Summary
-
-
-
Constructor Detail
-
MiniAccumuloClusterImpl
public MiniAccumuloClusterImpl(File dir, String rootPassword) throws IOException
- Parameters:
dir
- An empty or nonexistent temp directory that Accumulo and Zookeeper can store data in. Creating the directory is left to the user. Java 7, Guava, and Junit provide methods for creating temporary directories.rootPassword
- Initial root password for instance.- Throws:
IOException
-
MiniAccumuloClusterImpl
public MiniAccumuloClusterImpl(MiniAccumuloConfigImpl config) throws IOException
- Parameters:
config
- initial configuration- Throws:
IOException
-
-
Method Detail
-
exec
public MiniAccumuloClusterImpl.ProcessInfo exec(Class<?> clazz, String... args) throws IOException
- Throws:
IOException
-
exec
public MiniAccumuloClusterImpl.ProcessInfo exec(Class<?> clazz, List<String> jvmArgs, String... args) throws IOException
- Throws:
IOException
-
_exec
public MiniAccumuloClusterImpl.ProcessInfo _exec(KeywordExecutable server, ServerType serverType, Map<String,String> configOverrides, String... args) throws IOException
- Throws:
IOException
-
_exec
public MiniAccumuloClusterImpl.ProcessInfo _exec(Class<?> clazz, ServerType serverType, Map<String,String> configOverrides, String... args) throws IOException
- Throws:
IOException
-
start
public void start() throws IOException, InterruptedException
Starts Accumulo and Zookeeper processes. Can only be called once.- Specified by:
start
in interfaceAccumuloCluster
- Throws:
IOException
InterruptedException
-
getDebugPorts
public Set<Pair<ServerType,Integer>> getDebugPorts()
- Returns:
- generated remote debug ports if in debug mode.
- Since:
- 1.6.0
-
getProcesses
public Map<ServerType,Collection<ProcessReference>> getProcesses()
-
killProcess
public void killProcess(ServerType type, ProcessReference proc) throws ProcessNotFoundException, InterruptedException
-
getInstanceName
public String getInstanceName()
- Specified by:
getInstanceName
in interfaceAccumuloCluster
- Returns:
- Accumulo instance name
-
getZooKeepers
public String getZooKeepers()
- Specified by:
getZooKeepers
in interfaceAccumuloCluster
- Returns:
- zookeeper connection string
-
getServerContext
public ServerContext getServerContext()
- Specified by:
getServerContext
in interfaceAccumuloCluster
- Returns:
- ServerContext
-
stop
public void stop() throws IOException, InterruptedException
Stops Accumulo and Zookeeper processes. If stop is not called, there is a shutdown hook that is setup to kill the processes. However it's probably best to call stop in a finally block as soon as possible.- Specified by:
stop
in interfaceAccumuloCluster
- Throws:
IOException
InterruptedException
-
getConfig
public MiniAccumuloConfigImpl getConfig()
- Since:
- 1.6.0
-
createAccumuloClient
public AccumuloClient createAccumuloClient(String user, AuthenticationToken token)
- Specified by:
createAccumuloClient
in interfaceAccumuloCluster
- Returns:
AccumuloClient
that must be closed by user
-
getClientConfig
public ClientConfiguration getClientConfig()
Description copied from interface:AccumuloCluster
Get the client configuration for the cluster- Specified by:
getClientConfig
in interfaceAccumuloCluster
-
getClientProperties
public Properties getClientProperties()
- Specified by:
getClientProperties
in interfaceAccumuloCluster
- Returns:
- client connection info for cluster
-
getFileSystem
public org.apache.hadoop.fs.FileSystem getFileSystem()
- Specified by:
getFileSystem
in interfaceAccumuloCluster
- Returns:
- the
FileSystem
in use by this cluster
-
setShutdownExecutor
protected void setShutdownExecutor(ExecutorService svc)
-
getShutdownExecutor
protected ExecutorService getShutdownExecutor()
-
stopProcessWithTimeout
public int stopProcessWithTimeout(Process proc, long timeout, TimeUnit unit) throws InterruptedException, ExecutionException, TimeoutException
-
getManagerMonitorInfo
public ManagerMonitorInfo getManagerMonitorInfo() throws AccumuloException, AccumuloSecurityException
Get programmatic interface to information available in a normal monitor. XXX the returned structure won't contain information about the metadata table until there is data in it. e.g. if you want to see the metadata table you should create a table.- Throws:
AccumuloException
AccumuloSecurityException
- Since:
- 1.6.1
-
getMiniDfs
public org.apache.hadoop.hdfs.MiniDFSCluster getMiniDfs()
-
getClusterControl
public MiniAccumuloClusterControl getClusterControl()
Description copied from interface:AccumuloCluster
Get an object that can manage a cluster- Specified by:
getClusterControl
in interfaceAccumuloCluster
- Returns:
- Manage the state of the cluster
-
getTemporaryPath
public org.apache.hadoop.fs.Path getTemporaryPath()
- Specified by:
getTemporaryPath
in interfaceAccumuloCluster
- Returns:
- A path on
FileSystem
this cluster is running on that can be used for temporary files
-
getSiteConfiguration
public AccumuloConfiguration getSiteConfiguration()
Description copied from interface:AccumuloCluster
Get server side config derived from accumulo.properties- Specified by:
getSiteConfiguration
in interfaceAccumuloCluster
-
getAccumuloPropertiesPath
public String getAccumuloPropertiesPath()
- Specified by:
getAccumuloPropertiesPath
in interfaceAccumuloCluster
- Returns:
- Path to accumulo.properties
-
getClientPropsPath
public String getClientPropsPath()
- Specified by:
getClientPropsPath
in interfaceAccumuloCluster
- Returns:
- Path to accumulo-client.properties
-
-