org.apache.blur.thrift.generated
Interface Blur.Iface

All Known Implementing Classes:
Blur.Client, BlurControllerServer, BlurShardServer, DisableTableAdminServer, FilteredBlurServer, SafeClientGen, TableAdmin
Enclosing class:
Blur

public static interface Blur.Iface

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


Method Summary
 boolean addColumnDefinition(String table, ColumnDefinition columnDefinition)
          Attempts to add a column definition to the given table.
 void cancelQuery(String table, String uuid)
          Cancels a query that is executing against the given table with the given uuid.
 Map<String,String> configuration()
          Fetches the Blur configuration.
 List<String> controllerServerList()
          Returns a list of all the controller servers.
 void createSnapshot(String table, String name)
          Creates a snapshot for the table with the given name
 void createTable(TableDescriptor tableDescriptor)
          Creates a table with the given TableDescriptor.
 TableDescriptor describe(String table)
          Returns a table descriptor for the given table.
 void disableTable(String table)
          Disables the given table, blocking until all shards are offline.
 void enableTable(String table)
          Enables the given table, blocking until all shards are online.
 void enqueueMutate(RowMutation mutation)
          Enqueue a RowMutation.
 void enqueueMutateBatch(List<RowMutation> mutations)
          Enqueue a batch of RowMutations.
 FetchResult fetchRow(String table, Selector selector)
          Fetches a Row or a Record in the given table with the given Selector.
 List<FetchResult> fetchRowBatch(String table, List<Selector> selectors)
          Fetches a batch of Rows or Records in the given table with the given Selector list.
 boolean isInSafeMode(String cluster)
          Checks to see if the given cluster is in safemode.
 Map<String,List<String>> listSnapshots(String table)
          Returns a map where the key is the shard, and the list is the snapshots within that shard
 void logging(String classNameOrLoggerName, Level level)
          Changes the logging level for the given instance dynamically at runtime.
 Map<String,Metric> metrics(Set<String> metrics)
          Fetches the Blur metrics by name.
 void mutate(RowMutation mutation)
          Mutates a Row given the RowMutation that is provided.
 void mutateBatch(List<RowMutation> mutations)
          Mutates a group of Rows given the list of RowMutations that are provided.
 void optimize(String table, int numberOfSegmentsPerShard)
          Will perform a forced optimize on the index in the given table.
 String parseQuery(String table, Query query)
          Parses the given query and returns the string that represents the query.
 void ping()
          A way to ping a server to make sure the connection is still valid.
 BlurResults query(String table, BlurQuery blurQuery)
          Executes a query against a the given table and returns the results.
 BlurQueryStatus queryStatusById(String table, String uuid)
          Returns the query status for the given table and query uuid.
 List<String> queryStatusIdList(String table)
          Returns a list of the query ids of queries that have recently been executed for the given table.
 long recordFrequency(String table, String columnFamily, String columnName, String value)
          Gets the record frequency for the provided table, family, column and value.
 void removeSnapshot(String table, String name)
          Removes a previous snapshot(identified by name) of the table
 void removeTable(String table, boolean deleteIndexFiles)
          Removes the given table, with an optional to delete the underlying index storage as well.
 void resetLogging()
          Resets the logging for this instance to match the log4j file.
 Schema schema(String table)
          Gets the schema for a given table.
 void setUser(User user)
          Sets the User for the current session.
 List<String> shardClusterList()
          Returns a list of all the shard clusters.
 Map<String,String> shardServerLayout(String table)
          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.
 Map<String,Map<String,ShardState>> shardServerLayoutState(String table)
          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.
 List<String> shardServerList(String cluster)
          Returns a list of all the shard servers for the given cluster.
 void startTrace(String traceId, String requestId)
          Starts a trace with the given trace id.
 List<String> tableList()
          Returns a list of the table names across all shard clusters.
 List<String> tableListByCluster(String cluster)
          Returns a list of the table names for the given cluster.
 TableStats tableStats(String table)
          Gets the table stats for the given table.
 List<String> terms(String table, String columnFamily, String columnName, String startWith, short size)
          Gets the terms list from the index for the given table, family, column using the startWith value to page through the results.
 List<String> traceList()
          Get a list of all the traces.
 void traceRemove(String traceId)
          Remove the trace for the given trace id.
 String traceRequestFetch(String traceId, String requestId)
          Fetches the given trace.
 List<String> traceRequestList(String traceId)
          Gets a request list for the given trace.
 

Method Detail

createTable

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

Parameters:
tableDescriptor - the TableDescriptor.
Throws:
BlurException
TException

enableTable

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

Parameters:
table - the table name.
Throws:
BlurException
TException

disableTable

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

Parameters:
table - the table name.
Throws:
BlurException
TException

removeTable

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

Parameters:
table - the table name.
deleteIndexFiles - true to remove the index storage and false if to preserve.
Throws:
BlurException
TException

addColumnDefinition

boolean addColumnDefinition(String table,
                            ColumnDefinition columnDefinition)
                            throws BlurException,
                                   TException
Attempts to add a column definition to the given table.

Parameters:
table - the name of the table.
columnDefinition - the ColumnDefinition.
Returns:
true if successfully defined false if not.
Throws:
BlurException
TException

tableList

List<String> tableList()
                       throws BlurException,
                              TException
Returns a list of the table names across all shard clusters.

Returns:
list of all tables in all shard clusters.
Throws:
BlurException
TException

tableListByCluster

List<String> tableListByCluster(String cluster)
                                throws BlurException,
                                       TException
Returns a list of the table names for the given cluster.

Parameters:
cluster - the cluster name.
Returns:
list of all the tables within the given shard cluster.
Throws:
BlurException
TException

describe

TableDescriptor describe(String table)
                         throws BlurException,
                                TException
Returns a table descriptor for the given table.

Parameters:
table - the table name.
Returns:
the TableDescriptor.
Throws:
BlurException
TException

schema

Schema schema(String table)
              throws BlurException,
                     TException
Gets the schema for a given table.

Parameters:
table - the table name.
Returns:
Schema.
Throws:
BlurException
TException

parseQuery

String parseQuery(String table,
                  Query query)
                  throws BlurException,
                         TException
Parses the given query and returns the string that represents the query.

Parameters:
table - the table name.
query - the query to parse.
Returns:
string representation of the parsed query.
Throws:
BlurException
TException

tableStats

TableStats tableStats(String table)
                      throws BlurException,
                             TException
Gets the table stats for the given table.

Parameters:
table - the table name.
Returns:
TableStats.
Throws:
BlurException
TException

optimize

void optimize(String table,
              int numberOfSegmentsPerShard)
              throws BlurException,
                     TException
Will perform a forced optimize on the index in the given table.

Parameters:
table - table the name of the table.
numberOfSegmentsPerShard - the maximum of segments per shard index after the operation is completed.
Throws:
BlurException
TException

createSnapshot

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

Parameters:
table -
name -
Throws:
BlurException
TException

removeSnapshot

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

Parameters:
table -
name -
Throws:
BlurException
TException

listSnapshots

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

Parameters:
table -
Throws:
BlurException
TException

setUser

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

Parameters:
user - the User object.
Throws:
TException

query

BlurResults query(String table,
                  BlurQuery blurQuery)
                  throws BlurException,
                         TException
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.

Parameters:
table - the table name.
blurQuery - the query to execute.
Returns:
the BlurResults.
Throws:
BlurException
TException

fetchRow

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

Parameters:
table - the table name.
selector - the Selector to use to fetch the Row or Record.
Returns:
the FetchResult.
Throws:
BlurException
TException

fetchRowBatch

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

Parameters:
table - the table name.
selectors - the Selector to use to fetch the Row or Record.
Returns:
the FetchResult.
Throws:
BlurException
TException

mutate

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

Parameters:
mutation - the RowMutation.
Throws:
BlurException
TException

enqueueMutate

void enqueueMutate(RowMutation mutation)
                   throws BlurException,
                          TException
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:
mutation - the RowMutation.
Throws:
BlurException
TException

mutateBatch

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

Parameters:
mutations - the batch of RowMutations.
Throws:
BlurException
TException

enqueueMutateBatch

void enqueueMutateBatch(List<RowMutation> mutations)
                        throws BlurException,
                               TException
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:
mutations - the batch of RowMutations.
Throws:
BlurException
TException

cancelQuery

void cancelQuery(String table,
                 String uuid)
                 throws BlurException,
                        TException
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:
table - the table name.
uuid - the uuid of the query.
Throws:
BlurException
TException

queryStatusIdList

List<String> queryStatusIdList(String table)
                               throws BlurException,
                                      TException
Returns a list of the query ids of queries that have recently been executed for the given table.

Parameters:
table - the table name.
Returns:
list of all the uuids of the queries uuids.
Throws:
BlurException
TException

queryStatusById

BlurQueryStatus queryStatusById(String table,
                                String uuid)
                                throws BlurException,
                                       TException
Returns the query status for the given table and query uuid.

Parameters:
table - the table name.
uuid - the uuid of the query.
Returns:
fetches the BlurQueryStatus for the given table and uuid.
Throws:
BlurException
TException

terms

List<String> terms(String table,
                   String columnFamily,
                   String columnName,
                   String startWith,
                   short size)
                   throws BlurException,
                          TException
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.

Parameters:
table - the table name.
columnFamily - the column family. If the frequency requested is a system field like "rowid", "recordid", "family", etc then columnFamily can be null.
columnName - the column name.
startWith - the term to start with assuming that you are paging through the term list.
size - the number to fetch at once.
Returns:
the list of terms for the given column.
Throws:
BlurException
TException

recordFrequency

long recordFrequency(String table,
                     String columnFamily,
                     String columnName,
                     String value)
                     throws BlurException,
                            TException
Gets the record frequency for the provided table, family, column and value.

Parameters:
table - the table name.
columnFamily - the column family. If the frequency requested is a system field like "rowid", "recordid", "family", etc then columnFamily can be null.
columnName - the column name.
value - the value.
Returns:
the count for the entire table.
Throws:
BlurException
TException

shardClusterList

List<String> shardClusterList()
                              throws BlurException,
                                     TException
Returns a list of all the shard clusters.

Returns:
list of all the shard clusters.
Throws:
BlurException
TException

shardServerList

List<String> shardServerList(String cluster)
                             throws BlurException,
                                    TException
Returns a list of all the shard servers for the given cluster.

Parameters:
cluster - the cluster name.
Returns:
list of all the shard servers within the cluster.
Throws:
BlurException
TException

controllerServerList

List<String> controllerServerList()
                                  throws BlurException,
                                         TException
Returns a list of all the controller servers.

Returns:
list of all the controllers.
Throws:
BlurException
TException

shardServerLayout

Map<String,String> shardServerLayout(String table)
                                     throws BlurException,
                                            TException
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.

Parameters:
table - the table name.
Returns:
map of shards in a table to the shard servers.
Throws:
BlurException
TException

shardServerLayoutState

Map<String,Map<String,ShardState>> shardServerLayoutState(String table)
                                                          throws BlurException,
                                                                 TException
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.

Parameters:
table - the table name.
Returns:
map of shards to a map of shard servers with the state of the shard.
Throws:
BlurException
TException

isInSafeMode

boolean isInSafeMode(String cluster)
                     throws BlurException,
                            TException
Checks to see if the given cluster is in safemode.

Parameters:
cluster - the name of the cluster.
Returns:
boolean.
Throws:
BlurException
TException

configuration

Map<String,String> configuration()
                                 throws BlurException,
                                        TException
Fetches the Blur configuration.

Returns:
Map of property name to value.
Throws:
BlurException
TException

metrics

Map<String,Metric> metrics(Set<String> metrics)
                           throws BlurException,
                                  TException
Fetches the Blur metrics by name. If the metrics parameter is null all the Metrics are returned.

Parameters:
metrics - the names of the metrics to return. If null all are returned.
Returns:
Map of metric name to Metric.
Throws:
BlurException
TException

startTrace

void startTrace(String traceId,
                String requestId)
                throws TException
Starts a trace with the given trace id.

Parameters:
traceId - the trace id.
requestId - the request id, used to connected remote calls together. Client can pass null.
Throws:
TException

traceList

List<String> traceList()
                       throws BlurException,
                              TException
Get a list of all the traces.

Returns:
the list of trace ids.
Throws:
BlurException
TException

traceRequestList

List<String> traceRequestList(String traceId)
                              throws BlurException,
                                     TException
Gets a request list for the given trace.

Parameters:
traceId - the trace id.
Returns:
the list of request ids for the given trace id.
Throws:
BlurException
TException

traceRequestFetch

String traceRequestFetch(String traceId,
                         String requestId)
                         throws BlurException,
                                TException
Fetches the given trace.

Parameters:
traceId - the trace id.
requestId - the request id.
Returns:
the json for the given trace request.
Throws:
BlurException
TException

traceRemove

void traceRemove(String traceId)
                 throws BlurException,
                        TException
Remove the trace for the given trace id.

Parameters:
traceId - the trace id.
Throws:
BlurException
TException

ping

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

Throws:
TException

logging

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

Parameters:
classNameOrLoggerName - the className or Logger Name of the Logger to be changed.
level - the logging level.
Throws:
BlurException
TException

resetLogging

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

Throws:
BlurException
TException


Copyright © 2012-2014 The Apache Software Foundation. All Rights Reserved.