/** * Retrieve the configuration used to construct this context */ public AccumuloConfiguration getConfiguration() { ensureOpen(); return serverConf; }
/** * Retrieve the hadoop configuration */ public Configuration getHadoopConf() { ensureOpen(); return this.hadoopConf; }
@Override public synchronized NamespaceOperations namespaceOperations() { ensureOpen(); return namespaceops; }
public ZooCache getZooCache() { ensureOpen(); return zooCache; }
/** * Update the credentials in the current context after changing the current user's password or * other auth token */ public synchronized void setCredentials(Credentials newCredentials) { checkArgument(newCredentials != null, "newCredentials is null"); ensureOpen(); creds = newCredentials; rpcCreds = null; }
/** * Retrieve SSL/TLS configuration to initiate an RPC connection to a server */ public SslConnectionParams getClientSslParams() { ensureOpen(); return sslSupplier.get(); }
/** * Retrieve the universal RPC client timeout from the configuration */ public long getClientTimeoutInMillis() { ensureOpen(); return timeoutSupplier.get(); }
/** * Retrieve SASL configuration to initiate an RPC connection to a server */ public SaslConnectionParams getSaslParams() { ensureOpen(); return saslSupplier.get(); }
/** * Returns the instance name given at system initialization time. * * @return current instance name */ public String getInstanceName() { ensureOpen(); return info.getInstanceName(); }
/** * Returns a comma-separated list of zookeeper servers the instance is using. * * @return the zookeeper servers this instance is using in "hostname:port" form */ public String getZooKeepers() { ensureOpen(); return info.getZooKeepers(); }
/** * Returns the zookeeper connection timeout. * * @return the configured timeout to connect to zookeeper */ public int getZooKeepersSessionTimeOut() { ensureOpen(); return info.getZooKeepersSessionTimeOut(); }
@Override public synchronized ReplicationOperations replicationOperations() { ensureOpen(); if (replicationops == null) { replicationops = new ReplicationOperationsImpl(this); } return replicationops; }
@Override public synchronized SecurityOperations securityOperations() { ensureOpen(); if (secops == null) secops = new SecurityOperationsImpl(this); return secops; }
@Override public synchronized InstanceOperations instanceOperations() { ensureOpen(); if (instanceops == null) instanceops = new InstanceOperationsImpl(this); return instanceops; }
public String getZooKeeperRoot() { ensureOpen(); return ZooUtil.getRoot(getInstanceID()); }
@Override public BatchDeleter createBatchDeleter(String tableName, Authorizations authorizations, int numQueryThreads) throws TableNotFoundException { ensureOpen(); return createBatchDeleter(tableName, authorizations, numQueryThreads, new BatchWriterConfig()); }
@Override public String whoami() { ensureOpen(); return getCredentials().getPrincipal(); }
@Override public BatchScanner createBatchScanner(String tableName, Authorizations authorizations) throws TableNotFoundException { Integer numQueryThreads = ClientProperty.BATCH_SCANNER_NUM_QUERY_THREADS .getInteger(getProperties()); Objects.requireNonNull(numQueryThreads); ensureOpen(); return createBatchScanner(tableName, authorizations, numQueryThreads); }
@Override public MultiTableBatchWriter createMultiTableBatchWriter(BatchWriterConfig config) { ensureOpen(); return new MultiTableBatchWriterImpl(this, config.merge(getBatchWriterConfig())); }
@Override public BatchWriter createBatchWriter(String tableName, BatchWriterConfig config) throws TableNotFoundException { checkArgument(tableName != null, "tableName is null"); ensureOpen(); // we used to allow null inputs for bw config if (config == null) { config = new BatchWriterConfig(); } return new BatchWriterImpl(this, getTableId(tableName), config.merge(getBatchWriterConfig())); }