org.apache.accumulo.core.client.impl
Class HdfsZooInstance

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

public class HdfsZooInstance
extends java.lang.Object
implements Instance

An implementation of Instance that looks in HDFS and ZooKeeper to find the master and root tablet location.


Nested Class Summary
static class HdfsZooInstance.AccumuloNotInitializedException
           
 
Constructor Summary
protected HdfsZooInstance()
           
 
Method Summary
 AccumuloConfiguration getConfiguration()
          get the AccumuloConfiguration to use when interacting with this instance
 Connector getConnector(java.lang.String user, byte[] pass)
           
 Connector getConnector(java.lang.String user, java.lang.CharSequence pass)
           
static Instance getInstance()
           
 java.lang.String getInstanceID()
          Get a unique string that identifies this instance of accumulo.
 java.lang.String getInstanceName()
          Returns the instance name given at system initialization time.
 java.util.List<java.lang.String> getMasterLocations()
          Get the location(s) of the accumulo master and any redundant servers.
 java.lang.String getRootTabletLocation()
          Get the location of the tablet server that is serving the root tablet.
 java.lang.String getZooKeepers()
           
 int getZooKeepersSessionTimeOut()
           
static java.lang.String lookupInstanceName(ZooCache zooCache, java.util.UUID instanceId)
           
static void main(java.lang.String[] args)
           
 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

HdfsZooInstance

protected HdfsZooInstance()
Method Detail

getInstance

public static Instance getInstance()

lookupInstanceName

public static java.lang.String lookupInstanceName(ZooCache zooCache,
                                                  java.util.UUID instanceId)

getRootTabletLocation

public java.lang.String getRootTabletLocation()
Description copied from interface: Instance
Get 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 java.util.List<java.lang.String> getMasterLocations()
Description copied from interface: Instance
Get 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 java.lang.String getInstanceID()
Description copied from interface: Instance
Get a unique string that identifies this instance of accumulo.

Specified by:
getInstanceID in interface Instance
Returns:
a UUID

getInstanceName

public java.lang.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 java.lang.String getZooKeepers()
Specified by:
getZooKeepers in interface Instance
Returns:
the zoo keepers this instance is using

getZooKeepersSessionTimeOut

public int getZooKeepersSessionTimeOut()
Specified by:
getZooKeepersSessionTimeOut in interface Instance
Returns:
the configured timeout to connect to zookeeper

getConnector

public Connector getConnector(java.lang.String user,
                              byte[] pass)
                       throws AccumuloException,
                              AccumuloSecurityException
Specified by:
getConnector in interface Instance
pass - A UTF-8 encoded password. The password may be cleared after making this call.
Returns:
Throws:
AccumuloException
AccumuloSecurityException

getConnector

public Connector getConnector(java.lang.String user,
                              java.lang.CharSequence pass)
                       throws AccumuloException,
                              AccumuloSecurityException
Specified by:
getConnector in interface Instance
pass - If a mutable CharSequence is passed in, it may be cleared after this call.
Returns:
Throws:
AccumuloException
AccumuloSecurityException

getConfiguration

public AccumuloConfiguration getConfiguration()
Description copied from interface: Instance
get 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

main

public static void main(java.lang.String[] args)


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