Thrift module: Blur

ModuleServicesData typesConstants
BlurBlur
ArgumentDescriptor
Arguments
BlurException
BlurObjectType
BlurPackedObject
BlurQuery
BlurQueryStatus
BlurResult
BlurResults
Column
ColumnDefinition
CommandDescriptor
CommandStatus
CommandStatusState
CpuTime
ErrorType
Facet
FetchRecordResult
FetchResult
FetchRowResult
HighlightOptions
Level
Metric
Query
QueryState
Record
RecordMutation
RecordMutationType
Response
Row
RowMutation
RowMutationType
Schema
ScoreType
Selector
Server
Shard
ShardState
SortField
SortFieldResult
Status
TableDescriptor
TableStats
TimeoutException
User
Value
ValueObject

Enumerations

Enumeration: ErrorType

The error type of a BlurException.
UNKNOWNUnknown error.
QUERY_CANCELQuery has been cancel.
QUERY_TIMEOUTQuery has timed out.
BACK_PRESSUREServer has run out of memory and is trying to prevent a failure.
REQUEST_TIMEOUTThe TCP connection has timed out.


UNKNOWN0
QUERY_CANCEL1
QUERY_TIMEOUT2
BACK_PRESSURE3
REQUEST_TIMEOUT4

Enumeration: ScoreType

The scoring type used during a SuperQuery to score multi Record hits within a ColumnFamily.
SUPERDuring a multi Record match, a calculation of the best match Record plus how often it occurs within the match Row produces the score that is used in the scoring of the SuperQuery.
AGGREGATEDuring a multi Record match, the aggregate score of all the Records within a ColumnFamily is used in the scoring of the SuperQuery.
BESTDuring a multi Record match, the best score of all the Records within a ColumnFamily is used in the scoring of the SuperQuery.
CONSTANTA constant score of 1 is used in the scoring of the SuperQuery.


SUPER0
AGGREGATE1
BEST2
CONSTANT3

Enumeration: QueryState

The state of a query.
RUNNINGQuery is running.
INTERRUPTEDQuery has been interrupted.
COMPLETEQuery is complete.


RUNNING0
INTERRUPTED1
COMPLETE2
BACK_PRESSURE_INTERRUPTED3

Enumeration: Status

NOT_FOUNDBlur status UUID is not found.
FOUNDBlur status UUID is present.


NOT_FOUND0
FOUND1

Enumeration: RowMutationType

Specifies the type of Row mutation that should occur during a mutation of a given Row.
DELETE_ROWIndicates that the entire Row is to be deleted. No changes are made if the specified row does not exist.
REPLACE_ROWIndicates that the entire Row is to be deleted, and then a new Row with the same id is to be added. If the specified row does not exist, the new row will still be created.
UPDATE_ROWIndicates that mutations of the underlying Records will be processed individually. Mutation will result in a BlurException if the specified row does not exist.


DELETE_ROW0
REPLACE_ROW1
UPDATE_ROW2

Enumeration: RecordMutationType

Specifies the type of Record mutation that should occur during a mutation of a given Record.
DELETE_ENTIRE_RECORDIndicates the Record with the given recordId in the given Row is to be deleted. If the target record does not exist, then no changes are made.
REPLACE_ENTIRE_RECORDIndicates the Record with the given recordId in the given Row is to be deleted, and a new Record with the same id is to be added. If the specified record does not exist the new record is still added.
REPLACE_COLUMNSReplace the columns that are specified in the Record mutation. If the target record does not exist then this mutation will result in a BlurException.
APPEND_COLUMN_VALUESAppend the columns in the Record mutation to the Record that could already exist. If the target record does not exist then this mutation will result in a BlurException.


DELETE_ENTIRE_RECORD0
REPLACE_ENTIRE_RECORD1
REPLACE_COLUMNS2
APPEND_COLUMN_VALUES3

Enumeration: ShardState

The shard state, see shardServerLayoutOptions method in the Blur service for details.
OPENINGThe shard is opening.
OPENThe shard is open.
OPENING_ERRORAn error during the opening of the shard.
CLOSINGIn the process of closing.
CLOSEDThe shard is closed.
CLOSING_ERRORAn error during the closing of the shard.


OPENING0
OPEN1
OPENING_ERROR2
CLOSING3
CLOSED4
CLOSING_ERROR5

Enumeration: Level

Logging level enum used to change the logging levels at runtime.

OFF0
FATAL1
ERROR2
WARN3
INFO4
DEBUG5
TRACE6
ALL7

Enumeration: BlurObjectType


MAP0
LIST1
NAME2
VALUE3

Enumeration: CommandStatusState


RUNNING0
INTERRUPTED1
COMPLETE2

Data structures

Exception: BlurException

KeyFieldTypeDescriptionRequirednessDefault value
1messagestringThe message in the exception. default
2stackTraceStrstringThe original stack trace (if any). default
3errorTypeErrorTypedefault

BlurException that carries a message plus the original stack trace (if any).

Exception: TimeoutException

KeyFieldTypeDescriptionRequirednessDefault value
1instanceExecutionIdi64default

TimeoutException occurs before the network connection timeout happens so that the client can reconnect.

Struct: User

KeyFieldTypeDescriptionRequirednessDefault value
1usernamestringusername. default
2attributesmap<string, string>map of user attributes. default

The user object is used to pass user context to server side session.

Struct: Column

KeyFieldTypeDescriptionRequirednessDefault value
1namestringThe name of the column. default
2valuestringThe value to be indexed and stored. default

Column is the lowest storage element in Blur, it stores a single name and value pair.

Struct: Record

KeyFieldTypeDescriptionRequirednessDefault value
1recordIdstringRecord id uniquely identifies a record within a single row. default
2familystringThe family in which this record resides. default
3columnslist<Column>A list of columns, multiple columns with the same name are allowed. default

Records contain a list of columns, multiple columns with the same name are allowed.

Struct: Row

KeyFieldTypeDescriptionRequirednessDefault value
1idstringThe row id. default
2recordslist<Record>The list records within the row. If paging is used this list will only reflect the paged records from the selector. default

Rows contain a list of records.

Struct: Query

KeyFieldTypeDescriptionRequirednessDefault value
1querystringA Lucene syntax based query. default
2rowQueryboolIf the Row query is on, meaning the query will be perform against all the Records (joining records in some cases) and the result will be Rows (groupings of Record). default1
3scoreTypeScoreTypeThe scoring type, see the document on ScoreType for explanation of each score type. defaultUNKNOWN
4rowFilterstringThe Row filter (normal Lucene syntax), is a filter performed after the join to filter out entire Rows from the results. This field is ignored when rowQuery is false. default
5recordFilterstringThe Record filter (normal Lucene syntax), is a filter performed before the join to filter out Records from the results. default

The Query object holds the query string (normal Lucene syntax), filters and type of scoring (used when super query is on).

Struct: HighlightOptions

KeyFieldTypeDescriptionRequirednessDefault value
1queryQueryThe original query is required if used in the Blur.fetchRow call. If the highlightOptions is used in a call to Blur.query then the Query passed into the call via the BlurQuery will be used if this query is null. So that means if you use highlighting from the query call you can leave this attribute null and it will default to the normal behavior. default
2preTagstringThe pre tag is the tag that marks the beginning of the highlighting. default"<<<"
3postTagstringThe post tag is the tag that marks the end of the highlighting. default">>>"

The HighlightOptions controls how the data is fetched and returned.

Struct: Selector

KeyFieldTypeDescriptionRequirednessDefault value
1recordOnlyboolFetch the Record only, not the entire Row. default
2locationIdstringWARNING: This is an internal only attribute and is not intended for use by clients. The location id of the Record or Row to be fetched. default
3rowIdstringThe row id of the Row to be fetched, not to be used with location id. default
4recordIdstringThe record id of the Record to be fetched, not to be used with location id. However the row id needs to be provided to locate the correct Row with the requested Record. default
5columnFamiliesToFetchset<string>The column families to fetch. If null, fetch all. If empty, fetch none. default
6columnsToFetchmap<string, set<string>>The columns in the families to fetch. If null, fetch all. If empty, fetch none. default
8startRecordi32Only valid for Row fetches, the record in the row to start fetching. If the row contains 1000 records and you want the first 100, then this value is 0. If you want records 300-400 then this value would be 300. If startRecord is beyond the end of the row, the row will be null in the FetchResult. Used in conjunction with maxRecordsToFetch. default0
9maxRecordsToFetchi32Only valid for Row fetches, the number of records to fetch. If the row contains 1000 records and you want the first 100, then this value is 100. If you want records 300-400 then this value would be 100. Used in conjunction with startRecord. By default this will fetch the first 1000 records of the row. default1000
10highlightOptionsHighlightOptionsThe HighlightOptions object controls how the data is highlighted. If null no highlighting will occur. default
11orderOfFamiliesToFetchlist<string>Can be null, if provided the provided family order will be the order in which the families are returned. default

Select carries the request for information to be retrieved from the stored columns.

Struct: FetchRowResult

KeyFieldTypeDescriptionRequirednessDefault value
1rowRowThe row fetched. default
2startRecordi32See Selector startRecord. default-1
3maxRecordsToFetchi32See Selector maxRecordsToFetch. default-1
4moreRecordsToFetchboolAre there more Records to fetch based on the Selector provided. default0
5totalRecordsi32The total number of records the Selector found. default

FetchRowResult contains row result from a fetch.

Struct: FetchRecordResult

KeyFieldTypeDescriptionRequirednessDefault value
1rowidstringThe row id of the record being fetched. default
2recordRecordThe record fetched. default

FetchRecordResult contains rowid of the record and the record result from a fetch.

Struct: FetchResult

KeyFieldTypeDescriptionRequirednessDefault value
1existsboolTrue if the result exists, false if it doesn't. default
2deletedboolIf the row was marked as deleted. default
3tablestringThe table the fetch result came from. default
4rowResultFetchRowResultThe row result if a row was selected form the Selector. default
5recordResultFetchRecordResultThe record result if a record was selected form the Selector. default

FetchResult contains the row or record fetch result based if the Selector was going to fetch the entire row or a single record.

Struct: Facet

KeyFieldTypeDescriptionRequirednessDefault value
1queryStrstringThe facet query. default
2minimumNumberOfBlurResultsi64The minimum number of results before no longer processing the facet. This is a good way to decrease the strain on the system while using many facets. For example if you set this attribute to 1000, then the shard server will stop processing the facet at the 1000 mark. However because this is processed at the shard server level the controller will likely return more than the minimum because it sums the answers from the shard servers. default9223372036854775807

Blur facet.

Struct: SortField

KeyFieldTypeDescriptionRequirednessDefault value
1familystringdefault
2columnstringdefault
3reversebooldefault

Struct: BlurQuery

KeyFieldTypeDescriptionRequirednessDefault value
1queryQueryThe query information. default
3facetslist<Facet>A list of Facets to execute with the given query. default
4selectorSelectorSelector is used to fetch data in the search results, if null only location ids will be fetched. default
6useCacheIfPresentboolEnabled by default to use a cached result if the query matches a previous run query with the configured amount of time. default1
7starti64The starting result position, 0 by default. default0
8fetchi32The number of fetched results, 10 by default. default10
9minimumNumberOfResultsi64The minimum number of results to find before returning. default9223372036854775807
10maxQueryTimei64The maximum amount of time the query should execute before timing out. default9223372036854775807
11uuidstringSets the uuid of this query, this is normal set by the client so that the status of a running query can be found or the query can be canceled. default
12userContextstringSets a user context, only used for logging at this point. @Deprecated use setUser method on Blur service. default
13cacheResultboolEnabled by default to cache this result. False would not cache the result. default1
14startTimei64Sets the start time, if 0 the controller sets the time. default0
15sortFieldslist<SortField>The sortfields are applied in order to sort the results. default
16rowIdstringOptional optimization for record queries to run against a single row. This will allow the query to be executed on one and only one shard in the cluster. default

The Blur Query object that contains the query that needs to be executed along with the query options.

Struct: SortFieldResult

KeyFieldTypeDescriptionRequirednessDefault value
1nullValueboolCarries the null boolean incase the field is null. default
2stringValuestringThe string value. default
3intValuei32The integer value. default
4longValuei64The long value. default
5doubleValuedoubleThe double value. default
6binaryValuebinaryThe binary value. default

Carries the one value from the sort that allows the merging of results.

Struct: BlurResult

KeyFieldTypeDescriptionRequirednessDefault value
1locationIdstringWARNING: This is an internal only attribute and is not intended for use by clients. default
2scoredoubleThe score for the hit in the query. default
3fetchResultFetchResultThe fetched result if any. default
4sortFieldResultslist<SortFieldResult>The fields used for sorting. default

The BlurResult carries the score, the location id and the fetched result (if any) form each query.

Struct: BlurResults

KeyFieldTypeDescriptionRequirednessDefault value
1totalResultsi64The total number of hits in the query. default0
2shardInfomap<string, i64>Hit counts from each shard in the table. default
3resultslist<BlurResult>The query results. default
4facetCountslist<i64>The faceted count. default
5exceptionslist<BlurException>Not currently used, a future feature could allow for partial results with errors. default
6queryBlurQueryThe original query. default

BlurResults holds all information resulting from a query.

Struct: RecordMutation

KeyFieldTypeDescriptionRequirednessDefault value
1recordMutationTypeRecordMutationTypeDefine how to mutate the given Record. defaultUNKNOWN
2recordRecordThe Record to mutate. default

The RowMutation defines how the given Record is to be mutated.

Struct: RowMutation

KeyFieldTypeDescriptionRequirednessDefault value
1tablestringThe table that the row mutation is to act upon. default
2rowIdstringThe row id that the row mutation is to act upon. default
4rowMutationTypeRowMutationTypeThe RowMutationType to define how to mutate the given Row. defaultUNKNOWN
5recordMutationslist<RecordMutation>The RecordMutations if any for this Row. default

The RowMutation defines how the given Row is to be mutated.

Struct: CpuTime

KeyFieldTypeDescriptionRequirednessDefault value
1cpuTimei64The total cpu time for the query on the given shard. default
2realTimei64The real time of the query execution for a given shard. default

Holds the cpu time for a query executing on a single shard in a table.

Struct: BlurQueryStatus

KeyFieldTypeDescriptionRequirednessDefault value
1queryBlurQueryThe original query. default
2cpuTimesmap<string, CpuTime>A map of shard names to CpuTime, one for each shard in the table. default
3completeShardsi32The number of completed shards. The shard server will respond with how many are complete on that server, while the controller will aggregate all the shard server completed totals together. default
4totalShardsi32The total number of shards that the query is executing against. The shard server will respond with how many shards are being queried on that server, while the controller will aggregate all the shard server totals together. default
5stateQueryStateThe state of the query. e.g. RUNNING, INTERRUPTED, COMPLETE default
6uuidstringThe uuid of the query. default
7statusStatusThe status of the query NOT_FOUND if uuid is not found else FOUND default
8userUserThe user executing the given query. default

The BlurQueryStatus object hold the status of BlurQueries. The state of the query (QueryState), the number of shards the query is executing against, the number of shards that are complete, etc.

Struct: TableStats

KeyFieldTypeDescriptionRequirednessDefault value
1tableNamestringThe table name. default
2bytesi64The size in bytes. default
3recordCounti64The record count. default
4rowCounti64The row count. default
5segmentImportPendingCounti64The number of pending segment imports for this table. default0
6segmentImportInProgressCounti64The number of segment imports in progress for this table. default0

TableStats holds the statistics for a given table.

Struct: ColumnDefinition

KeyFieldTypeDescriptionRequirednessDefault value
1familystringRequired. The family that this column exists within. default
2columnNamestringRequired. The column name. default
3subColumnNamestringIf this column definition is for a sub column then provide the sub column name. Otherwise leave this field null. default
4fieldLessIndexedboolIf this column should be searchable without having to specify the name of the column in the query. NOTE: This will index the column as a full text field in a default field, so that means it's going to be indexed twice. default
5fieldTypestringThe field type for the column. The built in types are:
  • text - Full text indexing.
  • string - Indexed string literal
  • int - Converted to an integer and indexed numerically.
  • long - Converted to an long and indexed numerically.
  • float - Converted to an float and indexed numerically.
  • double - Converted to an double and indexed numerically.
  • stored - Not indexed, only stored.
default
6propertiesmap<string, string>For any custom field types, you can pass in configuration properties. default
7sortableboolThis will attempt to enable sorting for this column, if the type does not support sorting then an exception will be thrown. default
8multiValueFieldboolThis will attempt to enable the ability for multiple values per column name in a single Record. optional1

The ColumnDefinition defines how a given Column should be interpreted (indexed/stored)

Struct: Schema

KeyFieldTypeDescriptionRequirednessDefault value
1tablestringThe table name. default
2familiesmap<string, map<string, ColumnDefinition>>Families and the column definitions within them. default

The current schema of the table.

Struct: TableDescriptor

KeyFieldTypeDescriptionRequirednessDefault value
1enabledboolIs the table enabled or not, enabled by default. default1
3shardCounti32The number of shards within the given table. default1
4tableUristringThe location where the table should be stored this can be "file:///" for a local instance of Blur or "hdfs://" for a distributed installation of Blur. default
7clusterstringThe cluster where this table should be created. default"default"
8namestringThe table name. default
9similarityClassstringSets the similarity class in Lucene. default
10blockCachingboolShould block cache be enable or disabled for this table. default1
11blockCachingFileTypesset<string>The files extensions that you would like to allow block cache to cache. If null (default) everything is cached. default
12readOnlyboolIf a table is set to be readonly, that means that mutates through Thrift are NOT allowed. However updates through MapReduce are allowed and in fact they are only allowed if the table is in readOnly mode. default0
13preCacheColslist<string>This is a list of fields to prefetch into the blockcache. The format of the entries should be family dot column, "family.column". default
14tablePropertiesmap<string, string>The table properties that can modify the default behavior of the table. TODO: Document all options. default
15strictTypesboolWhether strict types are enabled or not (default). If they are enabled no column can be added without first having it's type defined. default0
16defaultMissingFieldTypestringIf strict is not enabled, the default field type. default"text"
17defaultMissingFieldLessIndexingboolIf strict is not enabled, defines whether or not field less indexing is enabled on the newly created fields. default1
18defaultMissingFieldPropsmap<string, string>If strict is not enabled, defines the properties to be used in the new field creation. default

The table descriptor defines the base structure of the table as well as properties need for setup.

Struct: Metric

KeyFieldTypeDescriptionRequirednessDefault value
1namestringmetric name. default
2strMapmap<string, string>map of string values emitted by the Metric. default
3longMapmap<string, i64>map of long values emitted by the Metric. default
4doubleMapmap<string, double>map of double values emitted by the Metric. default

The Metric will hold all the information for a given Metric.

Struct: Value

KeyFieldTypeDescriptionRequirednessDefault value
1stringValuestringdefault
2intValuei32default
3shortValuei16default
4longValuei64default
5doubleValuedoubledefault
6floatValuedoubledefault
7binaryValuebinarydefault
8booleanValuebooldefault
9nullValuebooldefault

Struct: Shard

KeyFieldTypeDescriptionRequirednessDefault value
1tablestringdefault
2shardstringdefault

Struct: Server

KeyFieldTypeDescriptionRequirednessDefault value
1serverstringdefault

Struct: BlurPackedObject

KeyFieldTypeDescriptionRequirednessDefault value
1parentIdi32default
2typeBlurObjectTypedefault
3valueValuedefault

Struct: ValueObject

KeyFieldTypeDescriptionRequirednessDefault value
1valueValuedefault
2blurObjectlist<BlurPackedObject>default

Struct: Response

KeyFieldTypeDescriptionRequirednessDefault value
1shardToValuemap<Shard, ValueObject>default
2serverToValuemap<Server, ValueObject>default
3valueValueObjectdefault

Struct: Arguments

KeyFieldTypeDescriptionRequirednessDefault value
1valuesmap<string, ValueObject>default

Struct: CommandStatus

KeyFieldTypeDescriptionRequirednessDefault value
1executionIdstringdefault
2commandNamestringdefault
3argumentsArgumentsdefault
4serverStateMapmap<string, map<CommandStatusState, i64>>default
5userUserdefault

Struct: ArgumentDescriptor

KeyFieldTypeDescriptionRequirednessDefault value
1namestringdefault
2typestringdefault
3descriptionstringdefault

Struct: CommandDescriptor

KeyFieldTypeDescriptionRequirednessDefault value
1commandNamestringdefault
2descriptionstringdefault
3requiredArgumentsmap<string, ArgumentDescriptor>default
4optionalArgumentsmap<string, ArgumentDescriptor>default
5returnTypestringdefault
6versionstringdefault


Services

Service: Blur

The Blur service API. This API is the same for both controller servers as well as shards servers. Each of the methods are documented.

Function: Blur.listInstalledCommands

list<CommandDescriptor> listInstalledCommands()
    throws BlurException
List the currently installed commands in the server process.

Function: Blur.execute

Response execute(string commandName,
                 Arguments arguments)
    throws BlurException, TimeoutException
Executes the given command by name on the table with the provided arguments.

Function: Blur.reconnect

Response reconnect(i64 instanceExecutionId)
    throws BlurException, TimeoutException
If the execute command times out due to command taking longer than the configured network tcp timeout this method allows the client to reconnect to the already executing command.

Function: Blur.commandStatusList

list<string> commandStatusList(i32 startingAt,
                               i16 fetch)
    throws BlurException
Fetches the command status ids in the order they were submitted.

Function: Blur.commandStatus

CommandStatus commandStatus(string commandExecutionId)
    throws BlurException
Retrieves the command status by the given command execution id.

Function: Blur.commandCancel

void commandCancel(string commandExecutionId)
    throws BlurException
Cancels the command with the given command execution id.

Function: Blur.refresh

void refresh()
Releases and refreshes the read snapshots of the indexes in the session for the current connection.

Function: Blur.createTable

void createTable(TableDescriptor tableDescriptor)
    throws BlurException
Creates a table with the given TableDescriptor.

Parameters

NameDescription
tableDescriptorthe TableDescriptor.

Function: Blur.enableTable

void enableTable(string table)
    throws BlurException
Enables the given table, blocking until all shards are online.

Parameters

NameDescription
tablethe table name.

Function: Blur.disableTable

void disableTable(string table)
    throws BlurException
Disables the given table, blocking until all shards are offline.

Parameters

NameDescription
tablethe table name.

Function: Blur.removeTable

void removeTable(string table,
                 bool deleteIndexFiles)
    throws BlurException
Removes the given table, with an optional to delete the underlying index storage as well.

Parameters

NameDescription
tablethe table name.
deleteIndexFilestrue to remove the index storage and false if to preserve.

Function: Blur.addColumnDefinition

bool addColumnDefinition(string table,
                         ColumnDefinition columnDefinition)
    throws BlurException
Attempts to add a column definition to the given table. @return true if successfully defined false if not.

Parameters

NameDescription
tablethe name of the table.
columnDefinitionthe ColumnDefinition.

Function: Blur.tableList

list<string> tableList()
    throws BlurException
Returns a list of the table names across all shard clusters. @return list of all tables in all shard clusters.

Function: Blur.tableListByCluster

list<string> tableListByCluster(string cluster)
    throws BlurException
Returns a list of the table names for the given cluster. @return list of all the tables within the given shard cluster.

Parameters

NameDescription
clusterthe cluster name.

Function: Blur.describe

TableDescriptor describe(string table)
    throws BlurException
Returns a table descriptor for the given table. @return the TableDescriptor.

Parameters

NameDescription
tablethe table name.

Function: Blur.schema

Schema schema(string table)
    throws BlurException
Gets the schema for a given table. @return Schema.

Parameters

NameDescription
tablethe table name.

Function: Blur.parseQuery

string parseQuery(string table,
                  Query query)
    throws BlurException
Parses the given query and returns the string that represents the query. @return string representation of the parsed query.

Parameters

NameDescription
tablethe table name.
querythe query to parse.

Function: Blur.tableStats

TableStats tableStats(string table)
    throws BlurException
Gets the table stats for the given table. @return TableStats.

Parameters

NameDescription
tablethe table name.

Function: Blur.optimize

void optimize(string table,
              i32 numberOfSegmentsPerShard)
    throws BlurException
Will perform a forced optimize on the index in the given table.

Parameters

NameDescription
tabletable the name of the table.
numberOfSegmentsPerShardthe maximum of segments per shard index after the operation is completed.

Function: Blur.createSnapshot

void createSnapshot(string table,
                    string name)
    throws BlurException
Creates a snapshot for the table with the given name

Function: Blur.removeSnapshot

void removeSnapshot(string table,
                    string name)
    throws BlurException
Removes a previous snapshot(identified by name) of the table

Function: Blur.listSnapshots

map<string, list<string>> listSnapshots(string table)
    throws BlurException
Returns a map where the key is the shard, and the list is the snapshots within that shard

Function: Blur.setUser

void setUser(User user)
Sets the User for the current session.

Parameters

NameDescription
userthe User object.

Function: Blur.query

BlurResults query(string table,
                  BlurQuery blurQuery)
    throws BlurException
Executes a query against a the given table and returns the results. If this method is executed against a controller the results will contain the aggregated results from all the shards. If this method is executed against a shard server the results will only contain aggregated results from the shards of the given table that are being served on the shard server, if any. @return the BlurResults.

Parameters

NameDescription
tablethe table name.
blurQuerythe query to execute.

Function: Blur.fetchRow

FetchResult fetchRow(string table,
                     Selector selector)
    throws BlurException
Fetches a Row or a Record in the given table with the given Selector. @return the FetchResult.

Parameters

NameDescription
tablethe table name.
selectorthe Selector to use to fetch the Row or Record.

Function: Blur.fetchRowBatch

list<FetchResult> fetchRowBatch(string table,
                                list<Selector> selectors)
    throws BlurException
Fetches a batch of Rows or Records in the given table with the given Selector list. @return the FetchResult.

Parameters

NameDescription
tablethe table name.
selectorsthe Selector to use to fetch the Row or Record.

Function: Blur.loadData

void loadData(string table,
              string location)
    throws BlurException
Loads data from external location.

Parameters

NameDescription
tableThe table name.
locationLocation of bulk data load.

Function: Blur.validateIndex

void validateIndex(string table,
                   list<string> externalIndexPaths)
    throws BlurException

Function: Blur.loadIndex

void loadIndex(string table,
               list<string> externalIndexPaths)
    throws BlurException

Function: Blur.mutate

void mutate(RowMutation mutation)
    throws BlurException
Mutates a Row given the RowMutation that is provided.

Parameters

NameDescription
mutationthe RowMutation.

Function: Blur.enqueueMutate

void enqueueMutate(RowMutation mutation)
    throws BlurException
Enqueue a RowMutation. Note that the effect of the RowMutation will occur at some point in the future, volume and load will play a role in how much time will pass before the mutation goes into effect.

Parameters

NameDescription
mutationthe RowMutation.

Function: Blur.mutateBatch

void mutateBatch(list<RowMutation> mutations)
    throws BlurException
Mutates a group of Rows given the list of RowMutations that are provided. Note: This is not an atomic operation.

Parameters

NameDescription
mutationsthe batch of RowMutations.

Function: Blur.enqueueMutateBatch

void enqueueMutateBatch(list<RowMutation> mutations)
    throws BlurException
Enqueue a batch of RowMutations. Note that the effect of the RowMutation will occur at some point in the future, volume and load will play a role in how much time will pass before the mutation goes into effect.

Parameters

NameDescription
mutationsthe batch of RowMutations.

Function: Blur.bulkMutateStart

void bulkMutateStart(string bulkId)
    throws BlurException
Starts a transaction for update (e.g. Mutate). Returns a transaction id.

Parameters

NameDescription
bulkIdThe bulk id.

Function: Blur.bulkMutateAdd

void bulkMutateAdd(string bulkId,
                   RowMutation rowMutation)
    throws BlurException
Adds to the specified transaction.

Parameters

NameDescription
bulkIdThe bulk id.
rowMutationThe row mutation.

Function: Blur.bulkMutateAddMultiple

void bulkMutateAddMultiple(string bulkId,
                           list<RowMutation> rowMutations)
    throws BlurException
Adds to the specified transaction.

Parameters

NameDescription
bulkIdThe bulk id.
rowMutationsThe row mutation.

Function: Blur.bulkMutateFinish

void bulkMutateFinish(string bulkId,
                      bool apply,
                      bool blockUntilComplete)
    throws BlurException
Finishes the bulk mutate. If apply is true the mutations are applied and committed. If false the bulk mutate is deleted and not applied.

Parameters

NameDescription
bulkIdThe bulk id.
applyApply the bulk mutate flag.
blockUntilCompleteIf true this call will not block on bulk completion. This may be required for loader bulk loads.

Function: Blur.cancelQuery

void cancelQuery(string table,
                 string uuid)
    throws BlurException
Cancels a query that is executing against the given table with the given uuid. Note, the cancel call maybe take some time for the query actually stops executing.

Parameters

NameDescription
tablethe table name.
uuidthe uuid of the query.

Function: Blur.queryStatusIdList

list<string> queryStatusIdList(string table)
    throws BlurException
Returns a list of the query ids of queries that have recently been executed for the given table. @return list of all the uuids of the queries uuids.

Parameters

NameDescription
tablethe table name.

Function: Blur.queryStatusById

BlurQueryStatus queryStatusById(string table,
                                string uuid)
    throws BlurException
Returns the query status for the given table and query uuid. @return fetches the BlurQueryStatus for the given table and uuid.

Parameters

NameDescription
tablethe table name.
uuidthe uuid of the query.

Function: Blur.terms

list<string> terms(string table,
                   string columnFamily,
                   string columnName,
                   string startWith,
                   i16 size)
    throws BlurException
Gets the terms list from the index for the given table, family, column using the startWith value to page through the results. This method only makes sense to use with string and text field types. @return the list of terms for the given column.

Parameters

NameDescription
tablethe table name.
columnFamilythe column family. If the frequency requested is a system field like "rowid", "recordid", "family", etc then columnFamily can be null.
columnNamethe column name.
startWiththe term to start with assuming that you are paging through the term list.
sizethe number to fetch at once.

Function: Blur.recordFrequency

i64 recordFrequency(string table,
                    string columnFamily,
                    string columnName,
                    string value)
    throws BlurException
Gets the record frequency for the provided table, family, column and value. @return the count for the entire table.

Parameters

NameDescription
tablethe table name.
columnFamilythe column family. If the frequency requested is a system field like "rowid", "recordid", "family", etc then columnFamily can be null.
columnNamethe column name.
valuethe value.

Function: Blur.shardClusterList

list<string> shardClusterList()
    throws BlurException
Returns a list of all the shard clusters. @return list of all the shard clusters.

Function: Blur.shardServerList

list<string> shardServerList(string cluster)
    throws BlurException
Returns a list of all the shard servers for the given cluster. @return list of all the shard servers within the cluster.

Parameters

NameDescription
clusterthe cluster name.

Function: Blur.controllerServerList

list<string> controllerServerList()
    throws BlurException
Returns a list of all the controller servers. @return list of all the controllers.

Function: Blur.shardServerLayout

map<string, string> shardServerLayout(string table)
    throws BlurException
Returns a map of the layout of the given table, where the key is the shard name and the value is the shard server.

This method will return the "correct" layout for the given shard, or the "correct" layout of cluster if called on a controller.

The meaning of correct:
Given the current state of the shard cluster with failures taken into account, the correct layout is what the layout should be given the current state. In other words, what the shard server should be serving. The act of calling the shard server layout method with the NORMAL option will block until the layout shard server matches the correct layout. Meaning it will block until indexes that should be open are open and ready for queries. However indexes are lazily closed, so if a table is being disabled then the call will return immediately with an empty map, but the indexes may not be close yet.

@return map of shards in a table to the shard servers.

Parameters

NameDescription
tablethe table name.

Function: Blur.shardServerLayoutState

map<string, map<string, ShardState>> shardServerLayoutState(string table)
    throws BlurException
Returns a map of the layout of the given table, where the key is the shard name and the value is the shard server.

This method will return immediately with what shards are currently open in the shard server. So if a shard is being moved to another server and is being closed by this server it WILL be returned in the map. The shardServerLayout method would not return the shard given the same situation. @return map of shards to a map of shard servers with the state of the shard.

Parameters

NameDescription
tablethe table name.

Function: Blur.isInSafeMode

bool isInSafeMode(string cluster)
    throws BlurException
Checks to see if the given cluster is in safemode. @return boolean.

Parameters

NameDescription
clusterthe name of the cluster.

Function: Blur.configuration

map<string, string> configuration()
    throws BlurException
Fetches the Blur configuration. @return Map of property name to value.

Function: Blur.configurationPerServer

string configurationPerServer(string thriftServerPlusPort,
                              string configName)
    throws BlurException
Fetches the Blur configuration. @return Map of property name to value.

Function: Blur.metrics

map<string, Metric> metrics(set<string> metrics)
    throws BlurException
Fetches the Blur metrics by name. If the metrics parameter is null all the Metrics are returned. @return Map of metric name to Metric.

Parameters

NameDescription
metricsthe names of the metrics to return. If null all are returned.

Function: Blur.startTrace

void startTrace(string traceId,
                string requestId)
Starts a trace with the given trace id.

Parameters

NameDescription
traceIdthe trace id.
requestIdthe request id, used to connected remote calls together. Client can pass null.

Function: Blur.traceList

list<string> traceList()
    throws BlurException
Get a list of all the traces. @return the list of trace ids.

Function: Blur.traceRequestList

list<string> traceRequestList(string traceId)
    throws BlurException
Gets a request list for the given trace. @return the list of request ids for the given trace id.

Parameters

NameDescription
traceIdthe trace id.

Function: Blur.traceRequestFetch

string traceRequestFetch(string traceId,
                         string requestId)
    throws BlurException
Fetches the given trace. @return the json for the given trace request.

Parameters

NameDescription
traceIdthe trace id.
requestIdthe request id.

Function: Blur.traceRemove

void traceRemove(string traceId)
    throws BlurException
Remove the trace for the given trace id.

Parameters

NameDescription
traceIdthe trace id.

Function: Blur.ping

void ping()
A way to ping a server to make sure the connection is still valid.

Function: Blur.logging

void logging(string classNameOrLoggerName,
             Level level)
    throws BlurException
Changes the logging level for the given instance dynamically at runtime.

Parameters

NameDescription
classNameOrLoggerNamethe className or Logger Name of the Logger to be changed.
levelthe logging level.

Function: Blur.resetLogging

void resetLogging()
    throws BlurException
Resets the logging for this instance to match the log4j file. NOTE: This will allow for dynamically changing to logging file at runtime.