org.apache.accumulo.core.client.mock
Class MockInstance

java.lang.Object
  extended by org.apache.accumulo.core.client.mock.MockInstance
All Implemented Interfaces:
Instance

public class MockInstance
extends Object
implements Instance


Constructor Summary
MockInstance()
           
MockInstance(String instanceName)
           
MockInstance(String instanceName, org.apache.hadoop.fs.FileSystem fs)
           
 
Method Summary
 AccumuloConfiguration getConfiguration()
          Returns the AccumuloConfiguration to use when interacting with this instance.
 Connector getConnector(AuthInfo auth)
          Returns a connection to accumulo.
 Connector getConnector(String user, byte[] pass)
          Returns a connection to accumulo.
 Connector getConnector(String user, ByteBuffer pass)
          Returns a connection to accumulo.
 Connector getConnector(String user, CharSequence pass)
          Returns a connection to this instance of accumulo.
 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(AccumuloConfiguration conf)
          Set the AccumuloConfiguration to use when interacting with this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockInstance

public MockInstance()

MockInstance

public MockInstance(String instanceName)

MockInstance

public MockInstance(String instanceName,
                    org.apache.hadoop.fs.FileSystem fs)
Method Detail

getRootTabletLocation

public String getRootTabletLocation()
Description copied from interface: Instance
Returns the location of the tablet server that is serving the root tablet.

Specified by:
getRootTabletLocation in interface Instance
Returns:
location in "hostname:port" form

getMasterLocations

public List<String> getMasterLocations()
Description copied from interface: Instance
Returns the location(s) of the accumulo master and any redundant servers.

Specified by:
getMasterLocations in interface Instance
Returns:
a list of locations in "hostname:port" form

getInstanceID

public String getInstanceID()
Description copied from interface: Instance
Returns a unique string that identifies this instance of accumulo.

Specified by:
getInstanceID in interface Instance
Returns:
a UUID

getInstanceName

public String getInstanceName()
Description copied from interface: Instance
Returns the instance name given at system initialization time.

Specified by:
getInstanceName in interface Instance
Returns:
current instance name

getZooKeepers

public String getZooKeepers()
Description copied from interface: Instance
Returns a comma-separated list of zookeeper servers the instance is using.

Specified by:
getZooKeepers in interface Instance
Returns:
the zookeeper servers this instance is using in "hostname:port" form

getZooKeepersSessionTimeOut

public int getZooKeepersSessionTimeOut()
Description copied from interface: Instance
Returns the zookeeper connection timeout.

Specified by:
getZooKeepersSessionTimeOut in interface Instance
Returns:
the configured timeout to connect to zookeeper

getConnector

public Connector getConnector(String user,
                              byte[] pass)
                       throws AccumuloException,
                              AccumuloSecurityException
Description copied from interface: Instance
Returns a connection to accumulo.

Specified by:
getConnector in interface Instance
Parameters:
user - a valid accumulo user
pass - A UTF-8 encoded password. The password may be cleared after making this call.
Returns:
the accumulo Connector
Throws:
AccumuloException - when a generic exception occurs
AccumuloSecurityException - when a user's credentials are invalid

getConnector

public Connector getConnector(String user,
                              ByteBuffer pass)
                       throws AccumuloException,
                              AccumuloSecurityException
Description copied from interface: Instance
Returns a connection to accumulo.

Specified by:
getConnector in interface Instance
Parameters:
user - a valid accumulo user
pass - A UTF-8 encoded password. The password may be cleared after making this call.
Returns:
the accumulo Connector
Throws:
AccumuloException - when a generic exception occurs
AccumuloSecurityException - when a user's credentials are invalid

getConnector

public Connector getConnector(String user,
                              CharSequence pass)
                       throws AccumuloException,
                              AccumuloSecurityException
Description copied from interface: Instance
Returns a connection to this instance of accumulo.

Specified by:
getConnector in interface Instance
Parameters:
user - a valid accumulo user
pass - If a mutable CharSequence is passed in, it may be cleared after this call.
Returns:
the accumulo Connector
Throws:
AccumuloException - when a generic exception occurs
AccumuloSecurityException - when a user's credentials are invalid

getConfiguration

public AccumuloConfiguration getConfiguration()
Description copied from interface: Instance
Returns the AccumuloConfiguration to use when interacting with this instance.

Specified by:
getConfiguration in interface Instance
Returns:
the AccumuloConfiguration that specifies properties related to interacting with this instance

setConfiguration

public void setConfiguration(AccumuloConfiguration conf)
Description copied from interface: Instance
Set the AccumuloConfiguration to use when interacting with this instance.

Specified by:
setConfiguration in interface Instance
Parameters:
conf - accumulo configuration

getConnector

public Connector getConnector(AuthInfo auth)
                       throws AccumuloException,
                              AccumuloSecurityException
Description copied from interface: Instance
Returns a connection to accumulo.

Specified by:
getConnector in interface Instance
Parameters:
auth - An AuthInfo object.
Returns:
the accumulo Connector
Throws:
AccumuloException - when a generic exception occurs
AccumuloSecurityException - when a user's credentials are invalid


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.