@Component @UserDocumentation(title="Commands for Database Management", description="These commands provide CRUD for databases") public class LensDatabaseCommands extends LensCRUDCommand
DATE_FMT, DATE_PARSER, isConnectionActive, mapper, pp| Constructor and Description |
|---|
LensDatabaseCommands() |
| Modifier and Type | Method and Description |
|---|---|
String |
createDatabase(String database,
boolean ignoreIfExists)
Creates the database.
|
protected org.apache.lens.api.APIResult |
doCreate(String database,
boolean ignoreIfExists) |
protected org.apache.lens.api.APIResult |
doDelete(String name,
boolean cascade) |
protected Object |
doRead(String name) |
org.apache.lens.api.APIResult |
doUpdate(String name,
String path) |
String |
dropDatabase(String database,
boolean cascade)
Drop database.
|
List<String> |
getAll() |
String |
showAllDatabases()
Show all databases.
|
String |
switchDatabase(String database)
Switch database.
|
create, describe, drop, getSingleObjectName, showAll, updateafterReturningInvocation, afterThrowingInvocation, beforeInvocation, closeClientConnection, formatDate, formatJson, getClient, getClientWrapper, getOrDefaultQueryHandleString, getValidPath, removePrefixBeforeURI, setClient@CliCommand(value="show databases",
help="displays list of all databases")
public String showAllDatabases()
@CliCommand(value="use",
help="change to new database")
public String switchDatabase(@CliOption(key={"","db"},mandatory=true,help="")
String database)
database - the database@CliCommand(value="create database",
help="create a database with specified name. if is true, create will not be tried if already exists. Default is false")
public String createDatabase(@CliOption(key={"","db"},mandatory=true,help="")
String database,
@CliOption(key="ignoreIfExists",mandatory=false,unspecifiedDefaultValue="false",help="")
boolean ignoreIfExists)
database - the databaseignoreIfExists - the ignore@CliCommand(value="drop database",
help="drop a database with specified name")
public String dropDatabase(@CliOption(key={"","db"},mandatory=true,help="")
String database,
@CliOption(key="cascade",specifiedDefaultValue="true",unspecifiedDefaultValue="false")
boolean cascade)
database - the databasepublic List<String> getAll()
getAll in class LensCRUDCommandprotected org.apache.lens.api.APIResult doCreate(String database, boolean ignoreIfExists)
doCreate in class LensCRUDCommandprotected Object doRead(String name)
doRead in class LensCRUDCommandpublic org.apache.lens.api.APIResult doUpdate(String name, String path)
doUpdate in class LensCRUDCommandprotected org.apache.lens.api.APIResult doDelete(String name, boolean cascade)
doDelete in class LensCRUDCommandCopyright © 2014–2016 Apache Software Foundation. All rights reserved.