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 useMiniAccumuloClusterwhenever 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 classMiniAccumuloClusterImpl.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(Class<?> clazz, ServerType serverType, Map<String,String> configOverrides, String... args) throws IOException
- Throws:
IOException
-
start
public void start() throws IOException, InterruptedExceptionStarts Accumulo and Zookeeper processes. Can only be called once.- Specified by:
startin interfaceAccumuloCluster- Throws:
IOExceptionInterruptedException
-
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:
getInstanceNamein interfaceAccumuloCluster- Returns:
- Accumulo instance name
-
getZooKeepers
public String getZooKeepers()
- Specified by:
getZooKeepersin interfaceAccumuloCluster- Returns:
- zookeeper connection string
-
getServerContext
public ServerContext getServerContext()
- Specified by:
getServerContextin interfaceAccumuloCluster- Returns:
- ServerContext
-
stop
public void stop() throws IOException, InterruptedExceptionStops 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:
stopin interfaceAccumuloCluster- Throws:
IOExceptionInterruptedException
-
getConfig
public MiniAccumuloConfigImpl getConfig()
- Since:
- 1.6.0
-
createAccumuloClient
public AccumuloClient createAccumuloClient(String user, AuthenticationToken token)
- Specified by:
createAccumuloClientin interfaceAccumuloCluster- Returns:
AccumuloClientthat must be closed by user
-
getClientConfig
public ClientConfiguration getClientConfig()
Description copied from interface:AccumuloClusterGet the client configuration for the cluster- Specified by:
getClientConfigin interfaceAccumuloCluster
-
getClientProperties
public Properties getClientProperties()
- Specified by:
getClientPropertiesin interfaceAccumuloCluster- Returns:
- client connection info for cluster
-
getFileSystem
public org.apache.hadoop.fs.FileSystem getFileSystem()
- Specified by:
getFileSystemin interfaceAccumuloCluster- Returns:
- the
FileSystemin 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:
AccumuloExceptionAccumuloSecurityException- Since:
- 1.6.1
-
getMiniDfs
public org.apache.hadoop.hdfs.MiniDFSCluster getMiniDfs()
-
getClusterControl
public MiniAccumuloClusterControl getClusterControl()
Description copied from interface:AccumuloClusterGet an object that can manage a cluster- Specified by:
getClusterControlin interfaceAccumuloCluster- Returns:
- Manage the state of the cluster
-
getTemporaryPath
public org.apache.hadoop.fs.Path getTemporaryPath()
- Specified by:
getTemporaryPathin interfaceAccumuloCluster- Returns:
- A path on
FileSystemthis cluster is running on that can be used for temporary files
-
getSiteConfiguration
public AccumuloConfiguration getSiteConfiguration()
Description copied from interface:AccumuloClusterGet server side config derived from accumulo.properties- Specified by:
getSiteConfigurationin interfaceAccumuloCluster
-
getAccumuloPropertiesPath
public String getAccumuloPropertiesPath()
- Specified by:
getAccumuloPropertiesPathin interfaceAccumuloCluster- Returns:
- Path to accumulo.properties
-
getClientPropsPath
public String getClientPropsPath()
- Specified by:
getClientPropsPathin interfaceAccumuloCluster- Returns:
- Path to accumulo-client.properties
-
-