Search in sources :

Example 1 with ConnectorImpl

use of org.apache.accumulo.core.client.impl.ConnectorImpl in project accumulo by apache.

the class AccumuloServerContext method getConnector.

// Need to override this from ClientContext to ensure that HdfsZooInstance doesn't "downcast"
// the AccumuloServerContext into a ClientContext (via the copy-constructor on ClientContext)
@Override
public Connector getConnector() throws AccumuloException, AccumuloSecurityException {
    // avoid making more connectors than necessary
    if (conn == null) {
        if (inst instanceof ZooKeeperInstance || inst instanceof HdfsZooInstance) {
            // reuse existing context
            conn = new ConnectorImpl(this);
        } else {
            Credentials c = getCredentials();
            conn = getInstance().getConnector(c.getPrincipal(), c.getToken());
        }
    }
    return conn;
}
Also used : HdfsZooInstance(org.apache.accumulo.server.client.HdfsZooInstance) ConnectorImpl(org.apache.accumulo.core.client.impl.ConnectorImpl) Credentials(org.apache.accumulo.core.client.impl.Credentials) SystemCredentials(org.apache.accumulo.server.security.SystemCredentials) ZooKeeperInstance(org.apache.accumulo.core.client.ZooKeeperInstance)

Aggregations

ZooKeeperInstance (org.apache.accumulo.core.client.ZooKeeperInstance)1 ConnectorImpl (org.apache.accumulo.core.client.impl.ConnectorImpl)1 Credentials (org.apache.accumulo.core.client.impl.Credentials)1 HdfsZooInstance (org.apache.accumulo.server.client.HdfsZooInstance)1 SystemCredentials (org.apache.accumulo.server.security.SystemCredentials)1