public class MockInstance extends Object implements Instance
An alternative to Mock Accumulo called MiniAccumuloCluster was introduced in Accumulo 1.5. MiniAccumuloCluster spins up actual Accumulo server processes, can be used for unit testing, and its behavior should match Accumulo. The drawback of MiniAccumuloCluster is that it starts more slowly than Mock Accumulo.
Constructor and Description |
---|
MockInstance() |
MockInstance(String instanceName) |
MockInstance(String instanceName,
org.apache.hadoop.fs.FileSystem fs) |
Modifier and Type | Method and Description |
---|---|
org.apache.accumulo.core.conf.AccumuloConfiguration |
getConfiguration()
Deprecated.
|
Connector |
getConnector(String principal,
AuthenticationToken token)
Returns a connection to this instance of accumulo.
|
Connector |
getConnector(String user,
byte[] pass)
Deprecated.
|
Connector |
getConnector(String user,
ByteBuffer pass)
Deprecated.
|
Connector |
getConnector(String user,
CharSequence pass)
Deprecated.
|
String |
getInstanceID()
Returns a unique string that identifies this instance of accumulo.
|
String |
getInstanceName()
Returns the instance name given at system initialization time.
|
List<String> |
getMasterLocations()
Returns the location(s) of the accumulo master and any redundant servers.
|
String |
getRootTabletLocation()
Returns the location of the tablet server that is serving the root tablet.
|
String |
getZooKeepers()
Returns a comma-separated list of zookeeper servers the instance is using.
|
int |
getZooKeepersSessionTimeOut()
Returns the zookeeper connection timeout.
|
void |
setConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration conf)
Deprecated.
|
public MockInstance()
public MockInstance(String instanceName)
public MockInstance(String instanceName, org.apache.hadoop.fs.FileSystem fs)
public String getRootTabletLocation()
Instance
getRootTabletLocation
in interface Instance
public List<String> getMasterLocations()
Instance
getMasterLocations
in interface Instance
public String getInstanceID()
Instance
getInstanceID
in interface Instance
public String getInstanceName()
Instance
getInstanceName
in interface Instance
public String getZooKeepers()
Instance
getZooKeepers
in interface Instance
public int getZooKeepersSessionTimeOut()
Instance
getZooKeepersSessionTimeOut
in interface Instance
@Deprecated public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException
Instance
getConnector
in interface Instance
user
- a valid accumulo userpass
- A UTF-8 encoded password. The password may be cleared after making this call.AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid@Deprecated public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException
Instance
getConnector
in interface Instance
user
- a valid accumulo userpass
- A UTF-8 encoded password. The password may be cleared after making this call.AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid@Deprecated public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException
Instance
getConnector
in interface Instance
user
- a valid accumulo userpass
- If a mutable CharSequence is passed in, it may be cleared after this call.AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid@Deprecated public org.apache.accumulo.core.conf.AccumuloConfiguration getConfiguration()
Instance
getConfiguration
in interface Instance
for client-side reading of the server-side configuration.
@Deprecated public void setConfiguration(org.apache.accumulo.core.conf.AccumuloConfiguration conf)
Instance
setConfiguration
in interface Instance
conf
- accumulo configurationInstanceOperations.setProperty(String, String)
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException
Instance
getConnector
in interface Instance
principal
- a valid accumulo usertoken
- Use the token type configured for the Accumulo instance you are connecting to. An Accumulo instance with default configurations will use
PasswordToken
AccumuloException
AccumuloSecurityException
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.