public class AnalyticsWebService
extends org.wso2.carbon.core.AbstractAdmin
| Constructor and Description |
|---|
AnalyticsWebService() |
| Modifier and Type | Method and Description |
|---|---|
String |
addStreamDefinition(StreamDefinitionBean streamDefinitionBean)
Add a stream definition using the Event stream publisher.
|
void |
clearIndices(String tableName)
Clears all the indices for the given table.
|
void |
createTable(String recordStoreName,
String tableName)
Creates a table, if not already there, where the columns are not defined here, but can contain any arbitrary number
of columns when data is added.
|
void |
deleteByIds(String tableName,
String[] ids)
Delete data in a table with given ids.
|
void |
destroy()
Destroys and frees any resources taken up by the analytics data service implementation.
|
SubCategoriesBean |
drillDownCategories(CategoryDrillDownRequestBean drillDownRequest)
Returns the subcategories of a facet field, given CategoryDrillDownRequestBean
|
RecordBean[] |
drillDownSearch(AnalyticsDrillDownRequestBean drillDownRequest)
Returns the drill down results of a search query, given AnalyticsDrillDownRequestBean
|
double |
drillDownSearchCount(AnalyticsDrillDownRequestBean drillDownRequest)
Returns the count of results of a search query, given AnalyticsDrillDownRequestBean
|
RecordBean[] |
getById(String tableName,
int numPartitionsHint,
String[] columns,
String[] ids)
Retrieves data from a table with given ids.
|
RecordBean[] |
getByRange(String tableName,
int numPartitionsHint,
String[] columns,
long timeFrom,
long timeTo,
int recordsFrom,
int recordsCount)
Retrieves data from a table, with a given range.
|
long |
getRecordCount(String tableName,
long timeFrom,
long timeTo)
Returns the number of records in the table with the given category and name.
|
String |
getRecordStoreNameByTable(String tableName)
Returns the record store name given the table information.
|
StreamDefinitionBean |
getStreamDefinition(String name,
String version)
get the stream definition using the Event stream publisher.
|
AnalyticsSchemaBean |
getTableSchema(String tableName)
Retrieves the table schema for the given table.
|
protected String |
getUsername()
This method is use to get logged in username with tenant domain
|
RecordBean[] |
getWithKeyValues(String tableName,
int numPartitionsHint,
String[] columns,
ValuesBatchBean[] valuesBatchBeans)
Retrieves data from a table, which matches the primary key values batch.
|
boolean |
isPaginationSupported(String recordStoreName)
Check whether under laying data layer implementation support for pagination or not.
|
boolean |
isRecordCountSupported(String recordStoreName)
Check whether under laying data layer implementation support for get total record count operation or not.
|
List<String> |
listRecordStoreNames()
Lists all the record stores available in the system.
|
String[] |
listTables()
Lists all the current tables with the given category.
|
void |
publishEvent(EventBean eventBean)
Publishes events to a given stream represented by stream id.
|
void |
reIndex(String tableName,
long startTime,
long endTime)
Given the start time and end time, this method will re-index the records of a table.
|
void |
removeStreamDefinition(String name,
String version)
This method can use to remove existing stream definition from system using the Event stream publisher.
|
RecordBean[] |
search(String tableName,
String query,
int start,
int count)
Searches the data with a given search query.
|
int |
searchCount(String tableName,
String query)
Returns the search count of results of a given search query.
|
AggregateResponse[] |
searchMultiTablesWithAggregates(AnalyticsAggregateRequest[] requests)
Returns a list of records containing the aggregate values computed over the given fields map
, grouped by a predefined FACET field for multiple tables.
|
RecordBean[] |
searchWithAggregates(AnalyticsAggregateRequest request)
Returns a list of records containing the aggregate values computed over the given fields map
, grouped by a predefined FACET field.
|
RecordBean[] |
searchWithSorting(String tableName,
String query,
int start,
int count,
String[] columns,
SortByFieldBean[] sortByFields)
Searches the data with a given search query.
|
void |
setTableSchema(String tableName,
AnalyticsSchemaBean schemaBean)
Sets the table schema for a table
|
boolean |
tableExists(String tableName)
Checks if the specified table with the given category and name exists.
|
void |
waitForIndexing(long maxWait)
This method waits until the current indexing operations for the system is done.
|
void |
waitForIndexingForTable(String tableName,
long maxWait)
This method waits until the current indexing operations for a given table is done.
|
getAxisConfig, getConfigContext, getConfigSystemRegistry, getConfigUserRegistry, getGovernanceRegistry, getGovernanceSystemRegistry, getGovernanceUserRegistry, getHttpSession, getLocalRepo, getRegistry, getTenantDomain, getUserRealm, setConfigurationContext, setPermissionUpdateTimestampprotected String getUsername()
getUsername in class org.wso2.carbon.core.AbstractAdminpublic String addStreamDefinition(StreamDefinitionBean streamDefinitionBean) throws AnalyticsWebServiceException, org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException
streamDefinitionBean - The stream definition bean class.AnalyticsWebServiceExceptionorg.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionExceptionpublic StreamDefinitionBean getStreamDefinition(String name, String version) throws AnalyticsWebServiceException
name - The name of the stream.version - The version of the streamAnalyticsWebServiceExceptionpublic void removeStreamDefinition(String name, String version) throws AnalyticsWebServiceException
name - The name of the stream.version - The version of the streamAnalyticsWebServiceExceptionpublic void publishEvent(EventBean eventBean) throws AnalyticsWebServiceException
eventBean - The event bean representing the event data.AnalyticsWebServiceExceptionpublic void setTableSchema(String tableName, AnalyticsSchemaBean schemaBean) throws AnalyticsWebServiceException
schemaBean - The schema bean representing the schemaAnalyticsWebServiceExceptionpublic RecordBean[] searchWithAggregates(AnalyticsAggregateRequest request) throws AnalyticsWebServiceException
request - The inputs required for performing aggregation.
groupByField is used to group the records. It should be a facet field created by the grouping fields.
fields attribute represents the record fields and the respective aggregate function.
aliases represents the output field names for aggregated values over the fields.AnalyticsWebServiceExceptionpublic AggregateResponse[] searchMultiTablesWithAggregates(AnalyticsAggregateRequest[] requests) throws AnalyticsWebServiceException
requests - The Array of AnalyticsAggregateRequests representing multiple tables
groupByField is used to group the records. It should be a facet field created by the grouping fields.
fields attribute represents the record fields and the respective aggregate function.
aliases represents the output field names for aggregated values over the fields.AnalyticsWebServiceExceptionpublic AnalyticsSchemaBean getTableSchema(String tableName) throws AnalyticsWebServiceException
tableName - The table nameAnalyticsWebServiceExceptionpublic boolean tableExists(String tableName) throws AnalyticsWebServiceException
tableName - The table nameAnalyticsWebServiceExceptionpublic String[] listTables() throws AnalyticsWebServiceException
AnalyticsWebServiceExceptionpublic long getRecordCount(String tableName, long timeFrom, long timeTo) throws AnalyticsWebServiceException
tableName - The name of the table to get the count fromtimeFrom - The starting time to consider the count from, inclusive, relatively to epoch,
Long.MIN_VALUE should signal, this restriction to be disregardedtimeTo - The ending time to consider the count to, non-inclusive, relatively to epoch,
Long.MAX_VALUE should signal, this restriction to be disregardedAnalyticsWebServiceExceptionpublic RecordBean[] getByRange(String tableName, int numPartitionsHint, String[] columns, long timeFrom, long timeTo, int recordsFrom, int recordsCount) throws AnalyticsWebServiceException
tableName - The name of the table to search onnumPartitionsHint - The best effort number of splits this should returncolumns - The list of columns to required in results, null if all needs to be returnedtimeFrom - The starting time to get records from, inclusive, relatively to epoch,
Long.MIN_VALUE should signal, this restriction to be disregardedtimeTo - The ending time to get records to, non-inclusive, relatively to epoch,
Long.MAX_VALUE should signal, this restriction to be disregardedrecordsFrom - The paginated index from value, zero based, inclusiverecordsCount - The paginated records count to be read, -getUsername() for infinityRecordBean objects, which represents individual data sets in their local locationAnalyticsWebServiceExceptionpublic RecordBean[] getWithKeyValues(String tableName, int numPartitionsHint, String[] columns, ValuesBatchBean[] valuesBatchBeans) throws AnalyticsWebServiceException
tableName - The name of the table to search onnumPartitionsHint - The best effort number of splits this should returncolumns - The list of columns to required in results, null if all needs to be returnedvaluesBatchBeans - The values batch containing the key values of primary keys to matchRecordBean objects, which represents individual data sets in their local locationAnalyticsWebServiceExceptionpublic RecordBean[] getById(String tableName, int numPartitionsHint, String[] columns, String[] ids) throws AnalyticsWebServiceException
tableName - The name of the table to search onnumPartitionsHint - The best effort number of splits this should returncolumns - The list of columns to required in results, null if all needs to be returnedids - The list of ids of the records to be readRecordBean objects, which contains individual data sets in their local locationAnalyticsWebServiceExceptionpublic void deleteByIds(String tableName, String[] ids) throws AnalyticsWebServiceException
tableName - The name of the table to search onids - The list of ids of the records to be deletedAnalyticsWebServiceExceptionpublic void clearIndices(String tableName) throws AnalyticsWebServiceException
tableName - The table nameAnalyticsWebServiceExceptionpublic RecordBean[] searchWithSorting(String tableName, String query, int start, int count, String[] columns, SortByFieldBean[] sortByFields) throws AnalyticsWebServiceException
tableName - The table namequery - The search querystart - The start location of the result, 0 basedcount - The maximum number of result entries to be returnedcolumns - The columns needed from each recordsortByFields - The fields by which the records needs to be sortedRecordBeansAnalyticsWebServiceExceptionpublic RecordBean[] search(String tableName, String query, int start, int count) throws AnalyticsWebServiceException
tableName - The table namequery - The search querystart - The start location of the result, 0 basedcount - The maximum number of result entries to be returnedRecordBeansAnalyticsWebServiceExceptionpublic int searchCount(String tableName, String query) throws AnalyticsWebServiceException
tableName - The table namequery - The search queryAnalyticsWebServiceExceptionpublic void waitForIndexing(long maxWait)
throws AnalyticsWebServiceException
maxWait - Maximum amount of time in milliseconds, -getUsername() for infinityAnalyticsWebServiceExceptionpublic void waitForIndexingForTable(String tableName, long maxWait) throws AnalyticsWebServiceException
tableName - table being checkedmaxWait - Maximum amount of time in milliseconds, -getUsername() for infinityAnalyticsWebServiceExceptionpublic void reIndex(String tableName, long startTime, long endTime) throws AnalyticsWebServiceException
tableName - the table name of which the records are being re-indexed.startTime - lowerbound of the timestamp range of recordsendTime - upperbound of the timestamp range of recordsAnalyticsWebServiceExceptionpublic void destroy()
throws AnalyticsWebServiceException
AnalyticsWebServiceExceptionpublic boolean isPaginationSupported(String recordStoreName) throws AnalyticsWebServiceException
AnalyticsWebServiceExceptionpublic boolean isRecordCountSupported(String recordStoreName) throws AnalyticsWebServiceException
recordStoreName - Record store nameAnalyticsWebServiceExceptionpublic SubCategoriesBean drillDownCategories(CategoryDrillDownRequestBean drillDownRequest) throws AnalyticsWebServiceException
drillDownRequest - The category drilldown object which contains the category drilldown informationAnalyticsWebServiceExceptionpublic RecordBean[] drillDownSearch(AnalyticsDrillDownRequestBean drillDownRequest) throws AnalyticsWebServiceException
drillDownRequest - The drilldown object which contains the drilldown informationRecordBeansAnalyticsWebServiceExceptionpublic double drillDownSearchCount(AnalyticsDrillDownRequestBean drillDownRequest) throws AnalyticsWebServiceException
drillDownRequest - The drilldown object which contains the drilldown informationAnalyticsWebServiceExceptionpublic List<String> listRecordStoreNames() throws AnalyticsWebServiceException
AnalyticsWebServiceExceptionpublic void createTable(String recordStoreName, String tableName) throws AnalyticsWebServiceException
recordStoreName - The name of the target record store to store the table attableName - The name of the table to be createdAnalyticsWebServiceExceptionpublic String getRecordStoreNameByTable(String tableName) throws AnalyticsWebServiceException
tableName - The table nameAnalyticsWebServiceExceptionCopyright © 2016 WSO2. All rights reserved.