本文整理了Java中org.apache.accumulo.core.client.Connector.instanceOperations()
方法的一些代码示例,展示了Connector.instanceOperations()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Connector.instanceOperations()
方法的具体详情如下:
包路径:org.apache.accumulo.core.client.Connector
类名称:Connector
方法名:instanceOperations
[英]Retrieves an InstanceOperations object to modify instance configuration.
[中]检索InstanceOperations对象以修改实例配置。
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Override
public Boolean call() throws Exception {
c.instanceOperations().waitForBalance();
return true;
}
});
代码示例来源:origin: uk.gov.gchq.gaffer/accumulo-store
/**
* Gets the TabletServers.
*
* @return A list of Strings of TabletServers.
* @throws StoreException If failure.
*/
public List<String> getTabletServers() throws StoreException {
return getConnection().instanceOperations().getTabletServers();
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
@Override
public void removePeer(final String name)
throws AccumuloException, AccumuloSecurityException, PeerNotFoundException {
requireNonNull(name);
context.getConnector().instanceOperations()
.removeProperty(Property.REPLICATION_PEERS.getKey() + name);
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
@Override
public boolean testClassLoad(ByteBuffer login, String className, String asTypeName)
throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
try {
return getConnector(login).instanceOperations().testClassLoad(className, asTypeName);
} catch (Exception e) {
handleException(e);
return false;
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
@Override
public List<String> getTabletServers(ByteBuffer login) throws TException {
try {
return getConnector(login).instanceOperations().getTabletServers();
} catch (Exception e) {
throw new TException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
@Override
public void pingTabletServer(ByteBuffer login, String tserver)
throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
try {
getConnector(login).instanceOperations().ping(tserver);
} catch (Exception e) {
handleException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Before
public void alterConfig() throws Exception {
InstanceOperations iops = getConnector().instanceOperations();
Map<String,String> sysConfig = iops.getSystemConfiguration();
scanMaxOpenFiles = sysConfig.get(Property.TSERV_SCAN_MAX_OPENFILES.getKey());
majcConcurrent = sysConfig.get(Property.TSERV_MAJC_MAXCONCURRENT.getKey());
majcThreadMaxOpen = sysConfig.get(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey());
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
public static boolean shouldQueueOperation(State state, Environment env) throws Exception {
final ThreadPoolExecutor pool = (ThreadPoolExecutor) state.get("pool");
long queuedThreads = pool.getTaskCount() - pool.getActiveCount() - pool.getCompletedTaskCount();
final Connector conn = env.getConnector();
int numTservers = conn.instanceOperations().getTabletServers().size();
if (!shouldQueue(queuedThreads, numTservers)) {
log.info("Not queueing because of " + queuedThreads + " outstanding tasks");
return false;
}
return true;
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
@Override
public Map<String,String> getSystemConfiguration(ByteBuffer login)
throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
try {
return getConnector(login).instanceOperations().getSystemConfiguration();
} catch (Exception e) {
handleException(e);
return null;
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-proxy
@Override
public void setProperty(ByteBuffer login, String property, String value)
throws org.apache.accumulo.proxy.thrift.AccumuloException,
org.apache.accumulo.proxy.thrift.AccumuloSecurityException, TException {
try {
getConnector(login).instanceOperations().setProperty(property, value);
} catch (Exception e) {
handleException(e);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Before
public void updateMajcDelay() throws Exception {
Connector c = getConnector();
majcDelay = c.instanceOperations().getSystemConfiguration()
.get(Property.TSERV_MAJC_DELAY.getKey());
c.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), "100ms");
if (getClusterType() == ClusterType.STANDALONE) {
Thread.sleep(AccumuloConfiguration.getTimeInMillis(majcDelay));
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Before
public void reduceSessionIdle() throws Exception {
InstanceOperations ops = getConnector().instanceOperations();
sessionIdle = ops.getSystemConfiguration().get(Property.TSERV_SESSION_MAXIDLE.getKey());
ops.setProperty(Property.TSERV_SESSION_MAXIDLE.getKey(), getMaxIdleTimeString());
log.info("Waiting for existing session idle time to expire");
Thread.sleep(AccumuloConfiguration.getTimeInMillis(sessionIdle));
log.info("Finished waiting");
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Test(expected = AccumuloException.class)
public void testNoFiles() throws Exception {
Connector conn = getConnector();
// Should throw an error as this property can't be changed in ZooKeeper
conn.instanceOperations().setProperty(Property.GENERAL_RPC_TIMEOUT.getKey(), "60s");
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@After
public void resetMajcDelay() throws Exception {
if (null != tservMajcDelay) {
Connector conn = getConnector();
conn.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), tservMajcDelay);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@After
public void resetSessionIdle() throws Exception {
if (null != sessionIdle) {
getConnector().instanceOperations().setProperty(Property.TSERV_SESSION_MAXIDLE.getKey(),
sessionIdle);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
private void changeSetting(RandomDataGenerator random, State state, Environment env,
Properties props) throws Exception {
// pick a random property
int choice = random.nextInt(0, settings.length - 1);
Setting setting = settings[choice];
// generate a random value
long newValue = random.nextLong(setting.min, setting.max);
state.set(LAST_SETTING, "" + choice);
log.debug("Setting " + setting.property.getKey() + " to " + newValue);
env.getConnector().instanceOperations().setProperty(setting.property.getKey(), "" + newValue);
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@Before
public void offlineTraceTable() throws Exception {
Connector conn = getConnector();
String traceTable = conn.instanceOperations().getSystemConfiguration()
.get(Property.TRACE_TABLE.getKey());
if (conn.tableOperations().exists(traceTable)) {
conn.tableOperations().offline(traceTable, true);
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@After
public void onlineTraceTable() throws Exception {
if (null != cluster) {
Connector conn = getConnector();
String traceTable = conn.instanceOperations().getSystemConfiguration()
.get(Property.TRACE_TABLE.getKey());
if (conn.tableOperations().exists(traceTable)) {
conn.tableOperations().online(traceTable, true);
}
}
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
private long getSyncs() throws Exception {
Connector c = getConnector();
ServerConfigurationFactory confFactory = new ServerConfigurationFactory(c.getInstance());
AccumuloServerContext context = new AccumuloServerContext(confFactory);
for (String address : c.instanceOperations().getTabletServers()) {
TabletClientService.Client client = ThriftUtil
.getTServerClient(HostAndPort.fromString(address), context);
TabletServerStatus status = client.getTabletServerStatus(null, context.rpcCreds());
return status.syncs;
}
return 0;
}
代码示例来源:origin: org.apache.accumulo/accumulo-test
@After
public void resetConfig() throws Exception {
if (null != majcDelay) {
InstanceOperations iops = getConnector().instanceOperations();
iops.setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay);
iops.setProperty(Property.TSERV_MAXMEM.getKey(), maxMem);
getClusterControl().stopAllServers(ServerType.TABLET_SERVER);
getClusterControl().startAllServers(ServerType.TABLET_SERVER);
}
}
内容来源于网络,如有侵权,请联系作者删除!