Class InstanceOperationsImpl
- java.lang.Object
-
- org.apache.accumulo.core.clientImpl.InstanceOperationsImpl
-
- All Implemented Interfaces:
InstanceOperations
public class InstanceOperationsImpl extends Object implements InstanceOperations
Provides a class for administering the accumulo instance
-
-
Constructor Summary
Constructors Constructor Description InstanceOperationsImpl(ClientContext context)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<ActiveCompaction>getActiveCompactions(String tserver)List the active compaction running on a tablet serverList<ActiveScan>getActiveScans(String tserver)List the active scans on tablet server.StringgetInstanceID()Returns a unique string that identifies this instance of accumulo.Map<String,String>getSiteConfiguration()Map<String,String>getSystemConfiguration()List<String>getTabletServers()List the currently active tablet servers participating in the accumulo instancestatic StringlookupInstanceName(ZooCache zooCache, UUID instanceId)Given a zooCache and instanceId, look up the instance name.voidping(String tserver)Throws an exception if a tablet server can not be contacted.voidremoveProperty(String property)Removes a system property from zookeeper.voidsetProperty(String property, String value)Sets an system property in zookeeper.booleantestClassLoad(String className, String asTypeName)Test to see if the instance can load the given class as the given type.voidwaitForBalance()Waits for the tablet balancer to run and return no migrations.
-
-
-
Constructor Detail
-
InstanceOperationsImpl
public InstanceOperationsImpl(ClientContext context)
-
-
Method Detail
-
setProperty
public void setProperty(String property, String value) throws AccumuloException, AccumuloSecurityException, IllegalArgumentException
Description copied from interface:InstanceOperationsSets an system property in zookeeper. Tablet servers will pull this setting and override the equivalent setting in accumulo.properties. Changes can be seen usingInstanceOperations.getSystemConfiguration().Only some properties can be changed by this method, an IllegalArgumentException will be thrown if a read-only property is set.
- Specified by:
setPropertyin interfaceInstanceOperations- Parameters:
property- the name of a per-table propertyvalue- the value to set a per-table property to- Throws:
AccumuloException- if a general error occursAccumuloSecurityException- if the user does not have permissionIllegalArgumentException
-
removeProperty
public void removeProperty(String property) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperationsRemoves a system property from zookeeper. Changes can be seen usingInstanceOperations.getSystemConfiguration()- Specified by:
removePropertyin interfaceInstanceOperations- Parameters:
property- the name of a per-table property- Throws:
AccumuloException- if a general error occursAccumuloSecurityException- if the user does not have permission
-
getSystemConfiguration
public Map<String,String> getSystemConfiguration() throws AccumuloException, AccumuloSecurityException
- Specified by:
getSystemConfigurationin interfaceInstanceOperations- Returns:
- A map of system properties set in zookeeper. If a property is not set in zookeeper, then it will return the value set in accumulo.properties on some server. If nothing is set in an accumulo.properties file it will return the default value for each property.
- Throws:
AccumuloExceptionAccumuloSecurityException
-
getSiteConfiguration
public Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException
- Specified by:
getSiteConfigurationin interfaceInstanceOperations- Returns:
- A map of system properties set in accumulo.properties on some server. If nothing is set in an accumulo.properties file it will return the default value for each property.
- Throws:
AccumuloExceptionAccumuloSecurityException
-
getTabletServers
public List<String> getTabletServers()
Description copied from interface:InstanceOperationsList the currently active tablet servers participating in the accumulo instance- Specified by:
getTabletServersin interfaceInstanceOperations- Returns:
- A list of currently active tablet servers.
-
getActiveScans
public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperationsList the active scans on tablet server.- Specified by:
getActiveScansin interfaceInstanceOperations- Parameters:
tserver- The tablet server address should be of the form<ip address>:<port>- Returns:
- A list of active scans on tablet server.
- Throws:
AccumuloExceptionAccumuloSecurityException
-
testClassLoad
public boolean testClassLoad(String className, String asTypeName) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperationsTest to see if the instance can load the given class as the given type. This check does not consider per table classpaths, seeTableOperations.testClassLoad(String, String, String)- Specified by:
testClassLoadin interfaceInstanceOperations- Returns:
- true if the instance can load the given class as the given type, false otherwise
- Throws:
AccumuloExceptionAccumuloSecurityException
-
getActiveCompactions
public List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperationsList the active compaction running on a tablet server- Specified by:
getActiveCompactionsin interfaceInstanceOperations- Parameters:
tserver- The tablet server address should be of the form<ip address>:<port>- Returns:
- the list of active compactions
- Throws:
AccumuloExceptionAccumuloSecurityException
-
ping
public void ping(String tserver) throws AccumuloException
Description copied from interface:InstanceOperationsThrows an exception if a tablet server can not be contacted.- Specified by:
pingin interfaceInstanceOperations- Parameters:
tserver- The tablet server address should be of the form<ip address>:<port>- Throws:
AccumuloException
-
waitForBalance
public void waitForBalance() throws AccumuloExceptionDescription copied from interface:InstanceOperationsWaits for the tablet balancer to run and return no migrations.- Specified by:
waitForBalancein interfaceInstanceOperations- Throws:
AccumuloException
-
lookupInstanceName
public static String lookupInstanceName(ZooCache zooCache, UUID instanceId)
Given a zooCache and instanceId, look up the instance name.
-
getInstanceID
public String getInstanceID()
Description copied from interface:InstanceOperationsReturns a unique string that identifies this instance of accumulo.- Specified by:
getInstanceIDin interfaceInstanceOperations- Returns:
- a String
-
-