@Component public class TableCommands extends ShellCommands
session_| Constructor and Description |
|---|
TableCommands() |
| Modifier and Type | Method and Description |
|---|---|
String |
create(String tablePath) |
String |
delete(String tablePath,
String id) |
String |
desc(String tablePath) |
String |
drop(String tablePath) |
String |
exists(String path) |
String |
find(String tablePath,
String _id,
String fromId,
String toId,
String limit) |
String |
get(String tablePath,
String _id) |
String |
insert(String tablePath,
String _id,
String jsonStr) |
boolean |
isDMLAvailable() |
String |
list(String patternOrPath) |
String |
update(String tablePath,
String _id,
String kvs) |
afterReturningInvocation, afterThrowingInvocation, beforeInvocationpublic TableCommands()
throws IOException
IOException@CliAvailabilityIndicator(value={"find","insert","delete","exists","create","drop","list","desc"})
public boolean isDMLAvailable()
@CliCommand(value="exists",
help="Returns true if the table exists.")
public String exists(@CliOption(key={"","path","p"},mandatory=true,help="Table Path.")
String path)
throws IOException
IOException@CliCommand(value="list",
help="Lists all tables in a folder or matching the specified pattern.")
public String list(@CliOption(key={"","p","patternOrPath"},help="A path and/or a file pattern.")
String patternOrPath)
throws IOException
IOException@CliCommand(value="desc",
help="Describes the properties of a table.")
public String desc(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath)
throws IOException
IOException@CliCommand(value="create",
help="Create a json table at the given path.")
public String create(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath)
throws IOException
IOException@CliCommand(value="drop",
help="Deletes a json table.")
public String drop(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath)
throws IOException
IOException@CliCommand(value="insert",
help="Inserts or replaces a document into the table.\nExample: insert /idsTable --value \'{\"_id\":\"001\" , \"first_name\":\"John\", \"last_name\":\"Doe\"}\'\n insert /idsTable --id 002 --value \'{\"first_name\":\"Jane\", \"last_name\":\"Dane\"}\'\n")
public String insert(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath,
@CliOption(key="id",help="Document Id.")
String _id,
@CliOption(key={"v","value"},mandatory=true,help="Json document to insert or replace.")
String jsonStr)
throws IOException
IOException@CliCommand(value="findbyid",
help="Retrieves a single document from the table.\nExample: findbyid /idsTable --id 001")
public String get(@CliOption(key={"","table","t"},mandatory=true,help="Table Path.")
String tablePath,
@CliOption(key="id",mandatory=true,help="Document Id.")
String _id)
throws IOException
IOException@CliCommand(value="find",
help="Retrieves one or more documents from the table.\nExample: find /idsTable\n find /idsTable --fromid 001 --toid 00a --limit 32")
public String find(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath,
@CliOption(key="id",help="Document Id.")
String _id,
@CliOption(key="fromid",help="Document Id to start from (inclusive)")
String fromId,
@CliOption(key="toid",help="Document Id to stop at (exclusive)")
String toId,
@CliOption(key="limit",help="Maximum number of documents to return.")
String limit)
throws IOException
IOException@CliCommand(value="delete",
help="Delete a document from the table.")
public String delete(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath,
@CliOption(key="id",mandatory=true,help="Document Id.")
String id)
throws IOException
IOException@CliCommand(value="update",
help="Update field in a single document.")
public String update(@CliOption(key={"","t","table"},mandatory=true,help="Table Path.")
String tablePath,
@CliOption(key="id",mandatory=true,help="Document Id.")
String _id,
@CliOption(key={"v","value"},mandatory=true,help="Json document containing field and their values.")
String kvs)
throws IOException
IOExceptionCopyright © 2015 Mapr Technologies, Inc.. All rights reserved.