Class MockInstance
- java.lang.Object
-
- org.apache.accumulo.core.client.mock.MockInstance
-
- All Implemented Interfaces:
Instance
@Deprecated public class MockInstance extends Object implements Instance
Deprecated.since 1.8.0; use MiniAccumuloCluster or a standard mock framework instead.Mock Accumulo provides an in memory implementation of the Accumulo client API. It is possible that the behavior of this implementation may differ subtly from the behavior of Accumulo. This could result in unit tests that pass on Mock Accumulo and fail on Accumulo or visa-versa. Documenting the differences would be difficult and is not done.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 Summary
Constructors Constructor Description MockInstance()
Deprecated.MockInstance(String instanceName)
Deprecated.MockInstance(String instanceName, org.apache.hadoop.fs.FileSystem fs)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AccumuloConfiguration
getConfiguration()
Deprecated.Connector
getConnector(String user, byte[] pass)
Deprecated.Connector
getConnector(String user, CharSequence pass)
Deprecated.Connector
getConnector(String user, ByteBuffer pass)
Deprecated.Connector
getConnector(String principal, AuthenticationToken token)
Deprecated.Returns a connection to this instance of accumulo.String
getInstanceID()
Deprecated.Returns a unique string that identifies this instance of accumulo.String
getInstanceName()
Deprecated.Returns the instance name given at system initialization time.List<String>
getMasterLocations()
Deprecated.Returns the location(s) of the accumulo master and any redundant servers.String
getRootTabletLocation()
Deprecated.Returns the location of the tablet server that is serving the root tablet.String
getZooKeepers()
Deprecated.Returns a comma-separated list of zookeeper servers the instance is using.int
getZooKeepersSessionTimeOut()
Deprecated.Returns the zookeeper connection timeout.void
setConfiguration(AccumuloConfiguration conf)
Deprecated.
-
-
-
Method Detail
-
getRootTabletLocation
public String getRootTabletLocation()
Deprecated.Description copied from interface:Instance
Returns the location of the tablet server that is serving the root tablet.- Specified by:
getRootTabletLocation
in interfaceInstance
- Returns:
- location in "hostname:port" form
-
getMasterLocations
public List<String> getMasterLocations()
Deprecated.Description copied from interface:Instance
Returns the location(s) of the accumulo master and any redundant servers.- Specified by:
getMasterLocations
in interfaceInstance
- Returns:
- a list of locations in "hostname:port" form
-
getInstanceID
public String getInstanceID()
Deprecated.Description copied from interface:Instance
Returns a unique string that identifies this instance of accumulo.- Specified by:
getInstanceID
in interfaceInstance
- Returns:
- a UUID
-
getInstanceName
public String getInstanceName()
Deprecated.Description copied from interface:Instance
Returns the instance name given at system initialization time.- Specified by:
getInstanceName
in interfaceInstance
- Returns:
- current instance name
-
getZooKeepers
public String getZooKeepers()
Deprecated.Description copied from interface:Instance
Returns a comma-separated list of zookeeper servers the instance is using.- Specified by:
getZooKeepers
in interfaceInstance
- Returns:
- the zookeeper servers this instance is using in "hostname:port" form
-
getZooKeepersSessionTimeOut
public int getZooKeepersSessionTimeOut()
Deprecated.Description copied from interface:Instance
Returns the zookeeper connection timeout.- Specified by:
getZooKeepersSessionTimeOut
in interfaceInstance
- Returns:
- the configured timeout to connect to zookeeper
-
getConnector
@Deprecated public Connector getConnector(String user, byte[] pass) throws AccumuloException, AccumuloSecurityException
Deprecated.Description copied from interface:Instance
Returns a connection to accumulo.- Specified by:
getConnector
in interfaceInstance
- Parameters:
user
- a valid accumulo userpass
- A UTF-8 encoded password. The password may be cleared after making this call.- Returns:
- the accumulo Connector
- Throws:
AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid
-
getConnector
@Deprecated public Connector getConnector(String user, ByteBuffer pass) throws AccumuloException, AccumuloSecurityException
Deprecated.Description copied from interface:Instance
Returns a connection to accumulo.- Specified by:
getConnector
in interfaceInstance
- Parameters:
user
- a valid accumulo userpass
- A UTF-8 encoded password. The password may be cleared after making this call.- Returns:
- the accumulo Connector
- Throws:
AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid
-
getConnector
@Deprecated public Connector getConnector(String user, CharSequence pass) throws AccumuloException, AccumuloSecurityException
Deprecated.Description copied from interface:Instance
Returns a connection to this instance of accumulo.- Specified by:
getConnector
in interfaceInstance
- Parameters:
user
- a valid accumulo userpass
- If a mutable CharSequence is passed in, it may be cleared after this call.- Returns:
- the accumulo Connector
- Throws:
AccumuloException
- when a generic exception occursAccumuloSecurityException
- when a user's credentials are invalid
-
getConfiguration
@Deprecated public AccumuloConfiguration getConfiguration()
Deprecated.Description copied from interface:Instance
Returns the AccumuloConfiguration to use when interacting with this instance.- Specified by:
getConfiguration
in interfaceInstance
- Returns:
- the AccumuloConfiguration that specifies properties related to interacting with this instance
- See Also:
for client-side reading of the server-side configuration.
-
setConfiguration
@Deprecated public void setConfiguration(AccumuloConfiguration conf)
Deprecated.Description copied from interface:Instance
Set the AccumuloConfiguration to use when interacting with this instance.- Specified by:
setConfiguration
in interfaceInstance
- Parameters:
conf
- accumulo configuration- See Also:
InstanceOperations.setProperty(String, String)
-
getConnector
public Connector getConnector(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException
Deprecated.Description copied from interface:Instance
Returns a connection to this instance of accumulo.- Specified by:
getConnector
in interfaceInstance
- Parameters:
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 usePasswordToken
- Throws:
AccumuloException
AccumuloSecurityException
-
-