org.apache.accumulo.core.util.shell
Class Shell
java.lang.Object
org.apache.accumulo.core.util.shell.Shell
public class Shell
- extends Object
A convenient console interface to perform basic accumulo functions Includes auto-complete, help, and quoted strings with escape sequences
Constructor Summary |
Shell()
|
Method Summary |
void |
checkTableState()
|
void |
config(String... args)
|
void |
execCommand(String input,
boolean ignoreAuthTimeout,
boolean echoPrompt)
|
Connector |
getConnector()
|
AuthInfo |
getCredentials()
|
Class<? extends Formatter> |
getFormatter()
Return the formatter for the current table. |
Class<? extends Formatter> |
getFormatter(String tableName)
Return the formatter for the given table. |
jline.ConsoleReader |
getReader()
|
String |
getTableName()
|
static boolean |
isDebuggingEnabled()
|
boolean |
isVerbose()
|
static void |
main(String[] args)
|
void |
printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate)
|
static void |
printException(Exception e)
|
void |
printInfo()
|
void |
printLines(Iterator<String> lines,
boolean paginate)
|
void |
printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate)
|
void |
printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate,
Class<? extends Formatter> formatterClass)
|
void |
printVerboseInfo()
|
static String |
repeat(String s,
int c)
|
static void |
setDebugging(boolean debuggingEnabled)
|
void |
setExit(boolean exit)
|
void |
setTableName(String tableName)
|
int |
start()
|
void |
updateUser(AuthInfo authInfo)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
public static final org.apache.log4j.Logger log
NO_FIXED_ARG_LENGTH_CHECK
public static final int NO_FIXED_ARG_LENGTH_CHECK
- See Also:
- Constant Field Values
scanIteratorOptions
public Map<String,List<IteratorSetting>> scanIteratorOptions
commandFactory
public final Map<String,Shell.Command> commandFactory
userOption
public static final String userOption
- See Also:
- Constant Field Values
tableOption
public static final String tableOption
- See Also:
- Constant Field Values
helpOption
public static final String helpOption
- See Also:
- Constant Field Values
helpLongOption
public static final String helpLongOption
- See Also:
- Constant Field Values
Shell
public Shell()
config
public void config(String... args)
getConnector
public Connector getConnector()
main
public static void main(String[] args)
throws IOException
- Throws:
IOException
start
public int start()
throws IOException
- Throws:
IOException
printInfo
public void printInfo()
throws IOException
- Throws:
IOException
printVerboseInfo
public void printVerboseInfo()
throws IOException
- Throws:
IOException
execCommand
public void execCommand(String input,
boolean ignoreAuthTimeout,
boolean echoPrompt)
throws IOException
- Throws:
IOException
printLines
public final void printLines(Iterator<String> lines,
boolean paginate)
throws IOException
- Throws:
IOException
printRecords
public final void printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate)
throws IOException
- Throws:
IOException
printRecords
public final void printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate,
Class<? extends Formatter> formatterClass)
throws IOException
- Throws:
IOException
printBinaryRecords
public final void printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate)
throws IOException
- Throws:
IOException
repeat
public static String repeat(String s,
int c)
checkTableState
public void checkTableState()
printException
public static final void printException(Exception e)
setDebugging
public static final void setDebugging(boolean debuggingEnabled)
isDebuggingEnabled
public static final boolean isDebuggingEnabled()
setExit
public void setExit(boolean exit)
isVerbose
public boolean isVerbose()
setTableName
public void setTableName(String tableName)
getTableName
public String getTableName()
getReader
public jline.ConsoleReader getReader()
updateUser
public void updateUser(AuthInfo authInfo)
throws AccumuloException,
AccumuloSecurityException
- Throws:
AccumuloException
AccumuloSecurityException
getCredentials
public AuthInfo getCredentials()
getFormatter
public Class<? extends Formatter> getFormatter()
- Return the formatter for the current table.
- Returns:
- the formatter class for the current table
getFormatter
public Class<? extends Formatter> getFormatter(String tableName)
- Return the formatter for the given table.
- Parameters:
tableName
- the table name
- Returns:
- the formatter class for the given table
Copyright © 2012 The Apache Software Foundation. All Rights Reserved.