@Override public void addPeer(final String name, final String replicaType) throws AccumuloException, AccumuloSecurityException { requireNonNull(name); requireNonNull(replicaType); context.instanceOperations().setProperty(Property.REPLICATION_PEERS.getKey() + name, replicaType); }
fullCommand.indexOf(property)); shellState.getAccumuloClient().instanceOperations().setProperty(property, value); Shell.log.debug("Successfully set system configuration option");
@After public void restoreConfig() throws Exception { InstanceOperations iops = getConnector().instanceOperations(); if (null != scanMaxOpenFiles) { iops.setProperty(Property.TSERV_SCAN_MAX_OPENFILES.getKey(), scanMaxOpenFiles); } if (null != majcConcurrent) { iops.setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), majcConcurrent); } if (null != majcThreadMaxOpen) { iops.setProperty(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey(), majcThreadMaxOpen); } }
@Override public void addPeer(final String name, final String replicaType) throws AccumuloException, AccumuloSecurityException, PeerExistsException { requireNonNull(name); requireNonNull(replicaType); context.getConnector().instanceOperations() .setProperty(Property.REPLICATION_PEERS.getKey() + name, replicaType); }
@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); } }
@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"); }
@After public void resetConfig() throws Exception { // We set the values.. if (null != majcThreadMaxOpen) { InstanceOperations iops = getConnector().instanceOperations(); iops.setProperty(Property.TSERV_MAJC_THREAD_MAXOPEN.getKey(), majcThreadMaxOpen); iops.setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay); iops.setProperty(Property.TSERV_MAJC_MAXCONCURRENT.getKey(), majcMaxConcurrent); getClusterControl().stopAllServers(ServerType.TABLET_SERVER); getClusterControl().startAllServers(ServerType.TABLET_SERVER); } }
@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"); }
@After public void resetMajcDelay() throws Exception { if (null != tservMajcDelay) { Connector conn = getConnector(); conn.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), tservMajcDelay); } }
@After public void resetSessionIdle() throws Exception { if (null != sessionIdle) { getConnector().instanceOperations().setProperty(Property.TSERV_SESSION_MAXIDLE.getKey(), sessionIdle); } }
@After public void resetMajcDelay() throws Exception { Connector c = getConnector(); c.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay); }
@Before public void checkProperty() throws Exception { Connector conn = getConnector(); // TABLE_VOLUME_CHOOSER is a valid property that can be updated in ZK, whereas the crypto // properties are not. // This lets us run this test more generically rather than forcibly needing to update some // property in accumulo-site.xml origPropValue = conn.instanceOperations().getSystemConfiguration() .get(Property.TABLE_VOLUME_CHOOSER.getKey()); conn.instanceOperations().setProperty(Property.TABLE_VOLUME_CHOOSER.getKey(), FairVolumeChooser.class.getName()); }
@After public void resetMajcDelay() throws Exception { Connector c = getConnector(); c.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay); }
@After public void resetProperty() throws Exception { if (null != origPropValue) { Connector conn = getConnector(); conn.instanceOperations().setProperty(Property.TABLE_VOLUME_CHOOSER.getKey(), origPropValue); } }
@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); } }
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); }
@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)); } }
@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(), "1s"); if (getClusterType() == ClusterType.STANDALONE) { // Gotta wait for the cluster to get out of the default sleep value Thread.sleep(AccumuloConfiguration.getTimeInMillis(majcDelay)); } }
@Before public void alterConfig() throws Exception { Connector conn = getConnector(); majcDelay = conn.instanceOperations().getSystemConfiguration() .get(Property.TSERV_MAJC_DELAY.getKey()); if (!"1s".equals(majcDelay)) { conn.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), "1s"); getClusterControl().stopAllServers(ServerType.TABLET_SERVER); getClusterControl().startAllServers(ServerType.TABLET_SERVER); } }
@After public void resetConfig() throws Exception { if (null != majcDelay) { Connector conn = getConnector(); conn.instanceOperations().setProperty(Property.TSERV_MAJC_DELAY.getKey(), majcDelay); getClusterControl().stopAllServers(ServerType.TABLET_SERVER); getClusterControl().startAllServers(ServerType.TABLET_SERVER); } }