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.String
getInstanceID()
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 String
lookupInstanceName(ZooCache zooCache, UUID instanceId)
Given a zooCache and instanceId, look up the instance name.void
ping(String tserver)
Throws an exception if a tablet server can not be contacted.void
removeProperty(String property)
Removes a system property from zookeeper.void
setProperty(String property, String value)
Sets an system property in zookeeper.boolean
testClassLoad(String className, String asTypeName)
Test to see if the instance can load the given class as the given type.void
waitForBalance()
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:InstanceOperations
Sets 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:
setProperty
in 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:InstanceOperations
Removes a system property from zookeeper. Changes can be seen usingInstanceOperations.getSystemConfiguration()
- Specified by:
removeProperty
in 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:
getSystemConfiguration
in 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:
AccumuloException
AccumuloSecurityException
-
getSiteConfiguration
public Map<String,String> getSiteConfiguration() throws AccumuloException, AccumuloSecurityException
- Specified by:
getSiteConfiguration
in 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:
AccumuloException
AccumuloSecurityException
-
getTabletServers
public List<String> getTabletServers()
Description copied from interface:InstanceOperations
List the currently active tablet servers participating in the accumulo instance- Specified by:
getTabletServers
in interfaceInstanceOperations
- Returns:
- A list of currently active tablet servers.
-
getActiveScans
public List<ActiveScan> getActiveScans(String tserver) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperations
List the active scans on tablet server.- Specified by:
getActiveScans
in 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:
AccumuloException
AccumuloSecurityException
-
testClassLoad
public boolean testClassLoad(String className, String asTypeName) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperations
Test 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:
testClassLoad
in interfaceInstanceOperations
- Returns:
- true if the instance can load the given class as the given type, false otherwise
- Throws:
AccumuloException
AccumuloSecurityException
-
getActiveCompactions
public List<ActiveCompaction> getActiveCompactions(String tserver) throws AccumuloException, AccumuloSecurityException
Description copied from interface:InstanceOperations
List the active compaction running on a tablet server- Specified by:
getActiveCompactions
in interfaceInstanceOperations
- Parameters:
tserver
- The tablet server address should be of the form<ip address>:<port>
- Returns:
- the list of active compactions
- Throws:
AccumuloException
AccumuloSecurityException
-
ping
public void ping(String tserver) throws AccumuloException
Description copied from interface:InstanceOperations
Throws an exception if a tablet server can not be contacted.- Specified by:
ping
in interfaceInstanceOperations
- Parameters:
tserver
- The tablet server address should be of the form<ip address>:<port>
- Throws:
AccumuloException
-
waitForBalance
public void waitForBalance() throws AccumuloException
Description copied from interface:InstanceOperations
Waits for the tablet balancer to run and return no migrations.- Specified by:
waitForBalance
in 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:InstanceOperations
Returns a unique string that identifies this instance of accumulo.- Specified by:
getInstanceID
in interfaceInstanceOperations
- Returns:
- a String
-
-