public class ListDatabasesCommand extends AbstractTableCommand
SHOW TABLES
or SHOW DATABASES
query
would return but makes it easier to query on a local machine what the Alluxio catalog
currently stores without needing to boot up a presto instance.mClient, mConf
ASYNC_OPTION, DEFAULT_ACTIVE_JOBS, mActiveJobs, mSubmittedJobAttempts
mFileSystem, mFsContext
Constructor and Description |
---|
ListDatabasesCommand(AlluxioConfiguration conf,
TableMasterClient client,
FileSystemContext fsContext)
Creates a new instance of
ListDatabasesCommand . |
Modifier and Type | Method and Description |
---|---|
String |
getCommandName()
Gets the command name as input from the shell.
|
String |
getDescription() |
String |
getUsage() |
int |
listDatabases()
Print attached databases to stdout.
|
int |
listTable(String db,
String tableName)
Print table information to stdout.
|
int |
listTables(String db)
Print list of tables stdout.
|
int |
run(org.apache.commons.cli.CommandLine cl)
Runs the command.
|
void |
validateArgs(org.apache.commons.cli.CommandLine cl)
Checks if the arguments are valid or throw InvalidArgumentException.
|
drain, getCompletedCmdCount, getCompletedCount, getFailedCmdCount, getFailedCount, getFailedFiles, postProcessing, processFailures, submit, waitForCmd, waitJob
processHeader, runPlainPath, runWildCardCmd
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getOptions, getSubCommands, hasSubCommand, parseAndValidateArgs
public ListDatabasesCommand(AlluxioConfiguration conf, TableMasterClient client, FileSystemContext fsContext)
ListDatabasesCommand
.conf
- alluxio configurationclient
- the table master clientfsContext
- the filesystem of Alluxiopublic String getCommandName()
Command
getCommandName
in interface Command
getCommandName
in class AbstractTableCommand
public String getDescription()
public String getUsage()
public void validateArgs(org.apache.commons.cli.CommandLine cl) throws InvalidArgumentException
Command
validateArgs
in interface Command
validateArgs
in class AbstractTableCommand
cl
- the parsed command line for the argumentsInvalidArgumentException
- when arguments are not validpublic int run(org.apache.commons.cli.CommandLine cl) throws AlluxioException, IOException
Command
run
in interface Command
run
in class AbstractTableCommand
cl
- the parsed command line for the argumentsAlluxioException
IOException
public int listDatabases() throws AlluxioStatusException, IOException
AlluxioStatusException
IOException
public int listTables(String db) throws AlluxioStatusException
db
- the database to list the tables ofAlluxioStatusException
public int listTable(String db, String tableName) throws AlluxioStatusException
db
- the database the table exists intableName
- the name of the table to dump information forAlluxioStatusException
Copyright © 2023. All Rights Reserved.