@Component @UserDocumentation(title="Commands for Facts Management", description="These command provide CRUD for facts, associated storages, and fact partitions") public class LensFactCommands extends LogicalTableCrudCommand<XFactTable>
DATE_FMT, DATE_PARSER
Constructor and Description |
---|
LensFactCommands() |
Modifier and Type | Method and Description |
---|---|
String |
addNewFactStorage(String tableName,
File path)
Adds the new fact storage.
|
String |
addPartitionsToFact(String tableName,
String storageName,
File path) |
String |
addPartitionToFact(String tableName,
String storageName,
File path)
Adds the partition to fact.
|
String |
createFact(File path)
Creates the fact.
|
String |
describeFactTable(String name)
Describe fact table.
|
APIResult |
doAddStorage(String name,
String path) |
APIResult |
doDropAllStorages(String name) |
APIResult |
doDropStorage(String tableName,
String storageName) |
APIResult |
doUpdate(String name,
String path) |
String |
dropAllFactStorages(String name)
Drop all fact storages.
|
String |
dropAllPartitionsOfFact(String tableName,
String storageName,
String filter)
Drop all partitions of fact.
|
String |
dropFact(String fact,
boolean cascade)
Drop fact.
|
String |
dropStorageFromFact(String tableName,
String storageName)
Drop storage from fact.
|
List<String> |
getAll() |
List<String> |
getAll(String cubeName) |
String |
getAllPartitionsOfFact(String tableName,
String storageName,
String filter)
Gets the all partitions of fact.
|
List<String> |
getAllStorages(String name) |
String |
getFactStorages(String tableName)
Gets the fact storages.
|
String |
getStorageFromFact(String tableName,
String storage)
Gets the storage from fact.
|
List<String> |
getTimelines(String factName,
String storageName,
String updatePeriod,
String timeDimension) |
String |
showFacts(String cubeName)
Show facts.
|
String |
updateFactTable(String name,
File specPath)
Update fact table.
|
String |
updatePartitionOfFact(String tableName,
String storageName,
File path)
updates the partition in the fact.
|
String |
updatePartitionsOfFact(String tableName,
String storageName,
String path) |
addPartition, addPartitions, addStorage, dropAllStorages, dropPartitions, dropStorage, getAllPartitions, getStorage, showAll, showAllStorages, updatePartition, updatePartitions
create, describe, drop, getSingleObjectName, showAll, update
afterReturningInvocation, afterThrowingInvocation, beforeInvocation, formatDate, formatJson, getClient, getClientWrapper, getValidPath, removePrefixBeforeURI, setClient
@CliCommand(value="show facts", help="display list of fact tables in current database. If optionalis supplied, only facts belonging to cube will be displayed") public String showFacts(@CliOption(key={"","cube_name"},mandatory=false,help=" ") String cubeName)
@CliCommand(value="create fact", help="create a fact table with spec from") public String createFact(@CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File path)
path
- Path to fact spec@CliCommand(value="describe fact", help="describe fact") public String describeFactTable(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String name)
name
- the fact@CliCommand(value="update fact", help="update facttaking spec from ") public String updateFactTable(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String name, @CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File specPath)
name
- fact name to be updatedspecPath
- path to the file containing new spec of the fact@CliCommand(value="drop fact", help="drops fact. If is true, all the storage tables associated with the fact are also dropped. By default is false") public String dropFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String fact, @CliOption(key="cascade",mandatory=false,unspecifiedDefaultValue="false",help=" ") boolean cascade)
fact
- the factcascade
- the cascade@CliCommand(value="fact list storage", help="display list of storages associated to fact") public String getFactStorages(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName)
tableName
- the fact@CliCommand(value="fact add storage", help="adds a new storage to fact, taking storage spec from ") public String addNewFactStorage(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File path)
tableName
- the fact namepath
- the path to storage spec@CliCommand(value="fact get storage", help="describe storageof fact ") public String getStorageFromFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storage)
tableName
- fact table namestorage
- storage spec path@CliCommand(value="fact drop storage", help="drop storagefrom fact ") public String dropStorageFromFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName)
tableName
- the table namestorageName
- the storage name@CliCommand(value="fact drop all storages", help="drop all storages associated to fact") public String dropAllFactStorages(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String name)
name
- the table@CliCommand(value="fact list partitions", help="get all partitions associated with fact, storage filtered by ") public String getAllPartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","filter"},mandatory=false,help=" ") String filter)
tableName
- fact namestorageName
- storage namefilter
- partition filter@CliCommand(value="fact drop partitions", help="drop all partitions associated with fact, storage filtered by ") public String dropAllPartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","filter"},mandatory=false,help=" ") String filter)
tableName
- fact namestorageName
- storage namefilter
- partition query filter@CliCommand(value="fact add single-partition", help="add single partition to fact\'s storage , reading spec from ") public String addPartitionToFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File path)
tableName
- fact namestorageName
- storage namepath
- partition spec path@CliCommand(value="fact update single-partition", help="update single partition to fact\'s storage , reading spec from The partition has to exist to be eligible for updation.") public String updatePartitionOfFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File path)
tableName
- fact namestorageName
- storage namepath
- partition spec path@CliCommand(value="fact add partitions", help="add multiple partition to fact\'s storage , reading partition list spec from ") public String addPartitionsToFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","path"},mandatory=true,help=" ")@NonNull File path)
@CliCommand(value="fact update partitions", help="update multiple partition of fact\'s storage , reading partition list spec from The partitions have to exist to be eligible for updation.") public String updatePartitionsOfFact(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String tableName, @CliOption(key={"","storage_name"},mandatory=true,help=" ") String storageName, @CliOption(key={"","path"},mandatory=true,help=" ") String path)
@CliCommand(value="fact timelines", help="get timelines for fact. Can optionally specify storage, update period and time dimension to filter by. Instead of time dimension, partition column can be directly passed as") public List<String> getTimelines(@CliOption(key={"","fact_name"},mandatory=true,help=" ") String factName, @CliOption(key="storage_name",mandatory=false,help=" ") String storageName, @CliOption(key="update_period",mandatory=false,help=" ") String updatePeriod, @CliOption(key="time_dimension",mandatory=false,help=" ") String timeDimension)
public APIResult doDropStorage(String tableName, String storageName)
doDropStorage
in class LogicalTableCrudCommand<XFactTable>
public List<String> getAllStorages(String name)
getAllStorages
in class LogicalTableCrudCommand<XFactTable>
public APIResult doAddStorage(String name, String path)
doAddStorage
in class LogicalTableCrudCommand<XFactTable>
public APIResult doDropAllStorages(String name)
doDropAllStorages
in class LogicalTableCrudCommand<XFactTable>
public List<String> getAll()
getAll
in class LensCRUDCommand<XFactTable>
public APIResult doUpdate(String name, String path)
doUpdate
in class LensCRUDCommand<XFactTable>
Copyright © 2014–2015 Apache Software Foundation. All rights reserved.