use of org.apache.accumulo.server.client.HdfsZooInstance 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;
}
Aggregations