org.apache.accumulo.core.util.shell
public class Shell extends ShellOptions
Modifier and Type | Class and Description |
---|---|
static class |
Shell.Command
The Command class represents a command to be run in the shell.
|
static class |
Shell.PrintFile |
static interface |
Shell.PrintLine |
static class |
Shell.PrintShell |
Modifier and Type | Field and Description |
---|---|
static Charset |
CHARSET |
Map<String,Shell.Command> |
commandFactory |
Map<String,Shell.Command[]> |
commandGrouping |
static String |
COMMENT_PREFIX |
protected String |
execCommand |
protected File |
execFile |
protected int |
exitCode |
static String |
HISTORY_DIR_NAME |
static String |
HISTORY_FILE_NAME |
protected Instance |
instance |
Map<String,List<IteratorSetting>> |
iteratorProfiles |
static org.apache.log4j.Logger |
log |
static int |
NO_FIXED_ARG_LENGTH_CHECK |
protected jline.console.ConsoleReader |
reader |
Map<String,List<IteratorSetting>> |
scanIteratorOptions |
protected boolean |
verbose |
helpLongOption, helpOption, namespaceOption, tableOption, userOption
Constructor and Description |
---|
Shell() |
Shell(jline.console.ConsoleReader reader,
PrintWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
checkTableState() |
boolean |
config(String... args)
Configures the shell using the provided options.
|
void |
execCommand(String input,
boolean ignoreAuthTimeout,
boolean echoPrompt) |
ClassLoader |
getClassLoader(org.apache.commons.cli.CommandLine cl,
Shell shellState) |
Connector |
getConnector() |
String |
getDefaultPrompt() |
boolean |
getExit() |
int |
getExitCode() |
Class<? extends Formatter> |
getFormatter()
Return the formatter for the current table.
|
Class<? extends Formatter> |
getFormatter(String tableName)
Return the formatter for the given table.
|
Instance |
getInstance() |
String |
getPrincipal() |
jline.console.ConsoleReader |
getReader() |
String |
getTableName() |
AuthenticationToken |
getToken() |
boolean |
hasExited() |
static boolean |
isDebuggingEnabled() |
boolean |
isMasking() |
boolean |
isTabCompletion() |
boolean |
isVerbose() |
static void |
main(String[] args) |
void |
printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate) |
void |
printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate,
Shell.PrintLine outFile) |
void |
printException(Exception e) |
void |
printInfo() |
void |
printLines(Iterator<String> lines,
boolean paginate) |
void |
printLines(Iterator<String> lines,
boolean paginate,
Shell.PrintLine out) |
void |
printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate,
Class<? extends Formatter> formatterClass) |
void |
printRecords(Iterable<Map.Entry<Key,Value>> scanner,
boolean printTimestamps,
boolean paginate,
Class<? extends Formatter> formatterClass,
Shell.PrintLine outFile) |
void |
printVerboseInfo() |
String |
readMaskedLine(String prompt,
Character mask) |
static String |
repeat(String s,
int c) |
void |
resetExitCode() |
static void |
setDebugging(boolean debuggingEnabled) |
void |
setExit(boolean exit) |
protected void |
setInstance(ShellOptionsJC options)
Sets the instance used by the shell based on the given options.
|
void |
setLogErrorsToConsole() |
void |
setTableName(String tableName) |
void |
shutdown() |
int |
start() |
void |
updateUser(String principal,
AuthenticationToken token) |
public static final org.apache.log4j.Logger log
public static final Charset CHARSET
public static final int NO_FIXED_ARG_LENGTH_CHECK
public static final String COMMENT_PREFIX
public static final String HISTORY_DIR_NAME
public static final String HISTORY_FILE_NAME
protected int exitCode
protected Instance instance
protected jline.console.ConsoleReader reader
public Map<String,List<IteratorSetting>> scanIteratorOptions
public Map<String,List<IteratorSetting>> iteratorProfiles
public final Map<String,Shell.Command> commandFactory
public final Map<String,Shell.Command[]> commandGrouping
protected File execFile
protected String execCommand
protected boolean verbose
public Shell() throws IOException
IOException
public Shell(jline.console.ConsoleReader reader, PrintWriter writer)
public boolean config(String... args)
protected void setInstance(ShellOptionsJC options)
options
- shell optionspublic Connector getConnector()
public Instance getInstance()
public ClassLoader getClassLoader(org.apache.commons.cli.CommandLine cl, Shell shellState) throws AccumuloException, TableNotFoundException, AccumuloSecurityException, IOException, org.apache.commons.vfs2.FileSystemException
AccumuloException
TableNotFoundException
AccumuloSecurityException
IOException
org.apache.commons.vfs2.FileSystemException
public static void main(String[] args) throws IOException
IOException
public int start() throws IOException
IOException
public void shutdown()
public void printInfo() throws IOException
IOException
public void printVerboseInfo() throws IOException
IOException
public String getDefaultPrompt()
public void execCommand(String input, boolean ignoreAuthTimeout, boolean echoPrompt) throws IOException
IOException
public final void printLines(Iterator<String> lines, boolean paginate) throws IOException
IOException
public final void printLines(Iterator<String> lines, boolean paginate, Shell.PrintLine out) throws IOException
IOException
public final void printRecords(Iterable<Map.Entry<Key,Value>> scanner, boolean printTimestamps, boolean paginate, Class<? extends Formatter> formatterClass, Shell.PrintLine outFile) throws IOException
IOException
public final void printRecords(Iterable<Map.Entry<Key,Value>> scanner, boolean printTimestamps, boolean paginate, Class<? extends Formatter> formatterClass) throws IOException
IOException
public final void printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner, boolean printTimestamps, boolean paginate, Shell.PrintLine outFile) throws IOException
IOException
public final void printBinaryRecords(Iterable<Map.Entry<Key,Value>> scanner, boolean printTimestamps, boolean paginate) throws IOException
IOException
public void checkTableState()
public final void printException(Exception e)
public static final void setDebugging(boolean debuggingEnabled)
public static final boolean isDebuggingEnabled()
public int getExitCode()
public void resetExitCode()
public void setExit(boolean exit)
public boolean getExit()
public boolean isVerbose()
public void setTableName(String tableName)
public String getTableName()
public jline.console.ConsoleReader getReader()
public void updateUser(String principal, AuthenticationToken token) throws AccumuloException, AccumuloSecurityException
public String getPrincipal()
public AuthenticationToken getToken()
public Class<? extends Formatter> getFormatter()
public Class<? extends Formatter> getFormatter(String tableName)
tableName
- the table namepublic void setLogErrorsToConsole()
public String readMaskedLine(String prompt, Character mask) throws IOException
IOException
public boolean isMasking()
public boolean hasExited()
public boolean isTabCompletion()
Copyright © 2011–2016 The Apache Software Foundation. All rights reserved.