|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvoldemort.tools.admin.AdminToolUtils
public class AdminToolUtils
Utility class for AdminCommand
Constructor Summary | |
---|---|
AdminToolUtils()
|
Method Summary | ||
---|---|---|
static java.lang.Boolean |
askConfirm(java.lang.Boolean confirm,
java.lang.String opDesc)
Utility function that pauses and asks for confirmation on dangerous operations. |
|
static void |
assertServerInNormalState(AdminClient adminClient)
Utility function that checks the execution state of the server by checking the state of MetadataStore.VoldemortState This function checks if all nodes of the cluster are in normal state ( MetadataStore.VoldemortState.NORMAL_SERVER ). |
|
static void |
assertServerInNormalState(AdminClient adminClient,
java.util.Collection<java.lang.Integer> nodeIds)
Utility function that checks the execution state of the server by checking the state of MetadataStore.VoldemortState This function checks if the nodes are in normal state ( MetadataStore.VoldemortState.NORMAL_SERVER ). |
|
static void |
assertServerInNormalState(AdminClient adminClient,
java.lang.Integer nodeId)
Utility function that checks the execution state of the server by checking the state of MetadataStore.VoldemortState This function checks if a node is in normal state ( MetadataStore.VoldemortState.NORMAL_SERVER ). |
|
static
|
convertListToMap(java.util.List<V> list)
Utility function that converts a list to a map. |
|
static java.lang.String[] |
copyArrayAddFirst(java.lang.String[] arr,
java.lang.String add)
Utility function that copies a string array and add another string to first |
|
static java.lang.String[] |
copyArrayCutFirst(java.lang.String[] arr)
Utility function that copies a string array except for the first element |
|
static java.io.File |
createDir(java.lang.String dir)
Utility function that creates directory. |
|
static AdminClient |
getAdminClient(java.lang.String url)
Utility function that constructs AdminClient. |
|
static java.util.List<java.lang.Integer> |
getAllNodeIds(AdminClient adminClient)
Utility function that fetches node ids. |
|
static java.util.List<java.lang.Integer> |
getAllPartitions(AdminClient adminClient)
Utility function that fetches partitions. |
|
static java.util.List<java.lang.String> |
getAllUserStoreNamesOnNode(AdminClient adminClient,
java.lang.Integer nodeId)
Utility function that fetches all stores on a node. |
|
static java.util.List<java.lang.String> |
getQuotaTypes(java.util.List<java.lang.String> quotaTypes)
Utility function that fetches quota types. |
|
static java.util.Map<java.lang.String,StoreDefinition> |
getSystemStoreDefMap()
Utility function that fetches system store definitions |
|
static java.util.Map<java.lang.String,StoreDefinition> |
getUserStoreDefMapOnNode(AdminClient adminClient,
java.lang.Integer nodeId)
Utility function that fetches user defined store definitions |
|
static java.util.List<java.lang.String> |
getValueList(java.util.List<java.lang.String> valuePairs,
java.lang.String delim)
Utility function that gives list of values from list of value-pair strings. |
|
static void |
validateUserStoreNamesOnNode(AdminClient adminClient,
java.lang.Integer nodeId,
java.util.List<java.lang.String> storeNames)
Utility function that checks if store names are valid on a node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AdminToolUtils()
Method Detail |
---|
public static java.lang.String[] copyArrayCutFirst(java.lang.String[] arr)
arr
- Original array of strings
public static java.lang.String[] copyArrayAddFirst(java.lang.String[] arr, java.lang.String add)
arr
- Original array of stringsadd
-
public static java.lang.Boolean askConfirm(java.lang.Boolean confirm, java.lang.String opDesc) throws java.io.IOException
confirm
- User has already confirmed in command-line inputopDesc
- Description of the dangerous operation
java.io.IOException
public static java.util.List<java.lang.String> getValueList(java.util.List<java.lang.String> valuePairs, java.lang.String delim)
valueList
- List of value-pair stringsdelim
- Delimiter that separates the value pairpublic static <V> java.util.Map<V,V> convertListToMap(java.util.List<V> list)
list
- The list in which even elements are keys and odd elements are
values.public static AdminClient getAdminClient(java.lang.String url)
url
- URL pointing to the bootstrap node
public static java.util.List<java.lang.Integer> getAllNodeIds(AdminClient adminClient)
adminClient
- An instance of AdminClient points to given cluster
public static java.util.List<java.lang.String> getAllUserStoreNamesOnNode(AdminClient adminClient, java.lang.Integer nodeId)
adminClient
- An instance of AdminClient points to given clusternodeId
- Node id to fetch stores from
public static void validateUserStoreNamesOnNode(AdminClient adminClient, java.lang.Integer nodeId, java.util.List<java.lang.String> storeNames)
adminClient
- An instance of AdminClient points to given clusternodeId
- Node id to fetch stores fromstoreNames
- Store names to checkpublic static java.util.List<java.lang.Integer> getAllPartitions(AdminClient adminClient)
adminClient
- An instance of AdminClient points to given cluster
public static java.util.List<java.lang.String> getQuotaTypes(java.util.List<java.lang.String> quotaTypes)
nodeIds
- List of IDs of nodes parsed from command-line inputallNodes
- Tells if all nodes are selected
public static java.io.File createDir(java.lang.String dir)
dir
- Directory path
public static java.util.Map<java.lang.String,StoreDefinition> getSystemStoreDefMap()
public static java.util.Map<java.lang.String,StoreDefinition> getUserStoreDefMapOnNode(AdminClient adminClient, java.lang.Integer nodeId)
adminClient
- An instance of AdminClient points to given clusternodeId
- Node id to fetch store definitions from
public static void assertServerInNormalState(AdminClient adminClient)
MetadataStore.VoldemortState
MetadataStore.VoldemortState.NORMAL_SERVER
).
adminClient
- An instance of AdminClient points to given cluster
VoldemortException
- if any node is not in normal statepublic static void assertServerInNormalState(AdminClient adminClient, java.lang.Integer nodeId)
MetadataStore.VoldemortState
MetadataStore.VoldemortState.NORMAL_SERVER
).
adminClient
- An instance of AdminClient points to given clusternodeId
- Node id to be checked
VoldemortException
- if any node is not in normal statepublic static void assertServerInNormalState(AdminClient adminClient, java.util.Collection<java.lang.Integer> nodeIds)
MetadataStore.VoldemortState
MetadataStore.VoldemortState.NORMAL_SERVER
).
adminClient
- An instance of AdminClient points to given clusternodeIds
- List of node ids to be checked
VoldemortException
- if any node is not in normal state
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |