Class MiniAccumuloClusterImpl
- java.lang.Object
-
- org.apache.accumulo.minicluster.impl.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.LogWriter
-
Constructor Summary
Constructors Constructor Description MiniAccumuloClusterImpl(File dir, String rootPassword)
MiniAccumuloClusterImpl(MiniAccumuloConfigImpl config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Process
exec(Class<?> clazz, String... args)
Process
exec(Class<?> clazz, List<String> jvmArgs, String... args)
ClientConfiguration
getClientConfig()
Get the client configuration for the clusterMiniAccumuloClusterControl
getClusterControl()
Get an object that can manage a clusterMiniAccumuloConfigImpl
getConfig()
Connector
getConnector(String user, AuthenticationToken token)
Utility method to get a connector to the cluster.Set<Pair<ServerType,Integer>>
getDebugPorts()
org.apache.hadoop.fs.FileSystem
getFileSystem()
String
getInstanceName()
List<MiniAccumuloClusterImpl.LogWriter>
getLogWriters()
MasterMonitorInfo
getMasterMonitorInfo()
Get programmatic interface to information available in a normal monitor.org.apache.hadoop.hdfs.MiniDFSCluster
getMiniDfs()
Map<ServerType,Collection<ProcessReference>>
getProcesses()
protected ExecutorService
getShutdownExecutor()
AccumuloConfiguration
getSiteConfiguration()
Get server side config derived from accumulo-site.xmlorg.apache.hadoop.fs.Path
getTemporaryPath()
String
getZooKeepers()
void
killProcess(ServerType type, ProcessReference proc)
protected void
setShutdownExecutor(ExecutorService svc)
void
start()
Starts Accumulo and Zookeeper processes.void
stop()
Stops Accumulo and Zookeeper processes.
-
-
-
Constructor Detail
-
MiniAccumuloClusterImpl
public MiniAccumuloClusterImpl(File dir, String rootPassword) throws IOException
- Parameters:
dir
- An empty or nonexistant temp directoy 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
-
getLogWriters
public List<MiniAccumuloClusterImpl.LogWriter> getLogWriters()
-
exec
public Process exec(Class<?> clazz, String... args) throws IOException
- Throws:
IOException
-
exec
public Process exec(Class<?> clazz, List<String> jvmArgs, 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
-
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
-
getConnector
public Connector getConnector(String user, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException
Description copied from interface:AccumuloCluster
Utility method to get a connector to the cluster.- Specified by:
getConnector
in interfaceAccumuloCluster
- Throws:
AccumuloException
AccumuloSecurityException
-
getClientConfig
public ClientConfiguration getClientConfig()
Description copied from interface:AccumuloCluster
Get the client configuration for the cluster- Specified by:
getClientConfig
in interfaceAccumuloCluster
-
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()
-
getMasterMonitorInfo
public MasterMonitorInfo getMasterMonitorInfo() 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-site.xml- Specified by:
getSiteConfiguration
in interfaceAccumuloCluster
-
-