org.apache.blur.thrift
Class TableAdmin

java.lang.Object
  extended by org.apache.blur.thrift.TableAdmin
All Implemented Interfaces:
Blur.Iface
Direct Known Subclasses:
BlurControllerServer, BlurShardServer

public abstract class TableAdmin
extends Object
implements Blur.Iface


Constructor Summary
TableAdmin()
           
 
Method Summary
 boolean addColumnDefinition(String table, ColumnDefinition columnDefinition)
          Attempts to add a column definition to the given table.
 void checkForUpdates(String table)
           
 void checkForUpdates(String cluster, String table)
           
 void checkTable(String table)
           
 void checkTable(String cluster, String table)
           
 Map<String,String> configuration()
          Fetches the Blur configuration.
 List<String> controllerServerList()
          Returns a list of all the controller servers.
 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.
 ClusterStatus getClusterStatus()
           
 int getMaxRecordsPerRowFetchRequest()
           
 boolean isInSafeMode(String cluster)
          Checks to see if the given cluster is in safemode.
 boolean isTableEnabled(boolean useCache, String cluster, String table)
           
 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 ping()
          A way to ping a server to make sure the connection is still valid.
 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 setClusterStatus(ClusterStatus clusterStatus)
           
 void setConfiguration(BlurConfiguration config)
           
 void setMaxRecordsPerRowFetchRequest(int _maxRecordsPerRowFetchRequest)
           
 void setZookeeper(org.apache.zookeeper.ZooKeeper zookeeper)
           
 List<String> shardClusterList()
          Returns a list of all the shard clusters.
 List<String> shardServerList(String cluster)
          Returns a list of all the shard servers for the given cluster.
 boolean tableExists(boolean useCache, String cluster, String table)
           
 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.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.blur.thrift.generated.Blur.Iface
cancelQuery, createSnapshot, enqueueMutate, enqueueMutateBatch, fetchRow, fetchRowBatch, listSnapshots, mutate, mutateBatch, optimize, parseQuery, query, queryStatusById, queryStatusIdList, recordFrequency, removeSnapshot, setUser, shardServerLayout, shardServerLayoutState, startTrace, tableStats, terms
 

Constructor Detail

TableAdmin

public TableAdmin()
Method Detail

metrics

public Map<String,Metric> metrics(Set<String> metrics)
                           throws BlurException,
                                  TException
Description copied from interface: Blur.Iface
Fetches the Blur metrics by name. If the metrics parameter is null all the Metrics are returned.

Specified by:
metrics in interface Blur.Iface
Parameters:
metrics - the names of the metrics to return. If null all are returned.
Returns:
Map of metric name to Metric.
Throws:
BlurException
TException

isInSafeMode

public boolean isInSafeMode(String cluster)
                     throws BlurException,
                            TException
Description copied from interface: Blur.Iface
Checks to see if the given cluster is in safemode.

Specified by:
isInSafeMode in interface Blur.Iface
Parameters:
cluster - the name of the cluster.
Returns:
boolean.
Throws:
BlurException
TException

createTable

public final void createTable(TableDescriptor tableDescriptor)
                       throws BlurException,
                              TException
Description copied from interface: Blur.Iface
Creates a table with the given TableDescriptor.

Specified by:
createTable in interface Blur.Iface
Parameters:
tableDescriptor - the TableDescriptor.
Throws:
BlurException
TException

disableTable

public final void disableTable(String table)
                        throws BlurException,
                               TException
Description copied from interface: Blur.Iface
Disables the given table, blocking until all shards are offline.

Specified by:
disableTable in interface Blur.Iface
Parameters:
table - the table name.
Throws:
BlurException
TException

enableTable

public final void enableTable(String table)
                       throws BlurException,
                              TException
Description copied from interface: Blur.Iface
Enables the given table, blocking until all shards are online.

Specified by:
enableTable in interface Blur.Iface
Parameters:
table - the table name.
Throws:
BlurException
TException

removeTable

public final void removeTable(String table,
                              boolean deleteIndexFiles)
                       throws BlurException,
                              TException
Description copied from interface: Blur.Iface
Removes the given table, with an optional to delete the underlying index storage as well.

Specified by:
removeTable in interface Blur.Iface
Parameters:
table - the table name.
deleteIndexFiles - true to remove the index storage and false if to preserve.
Throws:
BlurException
TException

isTableEnabled

public boolean isTableEnabled(boolean useCache,
                              String cluster,
                              String table)

checkTable

public void checkTable(String table)
                throws BlurException
Throws:
BlurException

checkTable

public void checkTable(String cluster,
                       String table)
                throws BlurException
Throws:
BlurException

checkForUpdates

public void checkForUpdates(String table)
                     throws BlurException
Throws:
BlurException

checkForUpdates

public void checkForUpdates(String cluster,
                            String table)
                     throws BlurException
Throws:
BlurException

controllerServerList

public final List<String> controllerServerList()
                                        throws BlurException,
                                               TException
Description copied from interface: Blur.Iface
Returns a list of all the controller servers.

Specified by:
controllerServerList in interface Blur.Iface
Returns:
list of all the controllers.
Throws:
BlurException
TException

shardServerList

public final List<String> shardServerList(String cluster)
                                   throws BlurException,
                                          TException
Description copied from interface: Blur.Iface
Returns a list of all the shard servers for the given cluster.

Specified by:
shardServerList in interface Blur.Iface
Parameters:
cluster - the cluster name.
Returns:
list of all the shard servers within the cluster.
Throws:
BlurException
TException

shardClusterList

public final List<String> shardClusterList()
                                    throws BlurException,
                                           TException
Description copied from interface: Blur.Iface
Returns a list of all the shard clusters.

Specified by:
shardClusterList in interface Blur.Iface
Returns:
list of all the shard clusters.
Throws:
BlurException
TException

describe

public final TableDescriptor describe(String table)
                               throws BlurException,
                                      TException
Description copied from interface: Blur.Iface
Returns a table descriptor for the given table.

Specified by:
describe in interface Blur.Iface
Parameters:
table - the table name.
Returns:
the TableDescriptor.
Throws:
BlurException
TException

tableListByCluster

public final List<String> tableListByCluster(String cluster)
                                      throws BlurException,
                                             TException
Description copied from interface: Blur.Iface
Returns a list of the table names for the given cluster.

Specified by:
tableListByCluster in interface Blur.Iface
Parameters:
cluster - the cluster name.
Returns:
list of all the tables within the given shard cluster.
Throws:
BlurException
TException

tableList

public final List<String> tableList()
                             throws BlurException,
                                    TException
Description copied from interface: Blur.Iface
Returns a list of the table names across all shard clusters.

Specified by:
tableList in interface Blur.Iface
Returns:
list of all tables in all shard clusters.
Throws:
BlurException
TException

addColumnDefinition

public boolean addColumnDefinition(String table,
                                   ColumnDefinition columnDefinition)
                            throws BlurException,
                                   TException
Description copied from interface: Blur.Iface
Attempts to add a column definition to the given table.

Specified by:
addColumnDefinition in interface Blur.Iface
Parameters:
table - the name of the table.
columnDefinition - the ColumnDefinition.
Returns:
true if successfully defined false if not.
Throws:
BlurException
TException

traceList

public List<String> traceList()
                       throws BlurException,
                              TException
Description copied from interface: Blur.Iface
Get a list of all the traces.

Specified by:
traceList in interface Blur.Iface
Returns:
the list of trace ids.
Throws:
BlurException
TException

traceRequestList

public List<String> traceRequestList(String traceId)
                              throws BlurException,
                                     TException
Description copied from interface: Blur.Iface
Gets a request list for the given trace.

Specified by:
traceRequestList in interface Blur.Iface
Parameters:
traceId - the trace id.
Returns:
the list of request ids for the given trace id.
Throws:
BlurException
TException

traceRequestFetch

public String traceRequestFetch(String traceId,
                                String requestId)
                         throws BlurException,
                                TException
Description copied from interface: Blur.Iface
Fetches the given trace.

Specified by:
traceRequestFetch in interface Blur.Iface
Parameters:
traceId - the trace id.
requestId - the request id.
Returns:
the json for the given trace request.
Throws:
BlurException
TException

traceRemove

public void traceRemove(String traceId)
                 throws BlurException,
                        TException
Description copied from interface: Blur.Iface
Remove the trace for the given trace id.

Specified by:
traceRemove in interface Blur.Iface
Parameters:
traceId - the trace id.
Throws:
BlurException
TException

tableExists

public boolean tableExists(boolean useCache,
                           String cluster,
                           String table)

getClusterStatus

public ClusterStatus getClusterStatus()

setClusterStatus

public void setClusterStatus(ClusterStatus clusterStatus)

setZookeeper

public void setZookeeper(org.apache.zookeeper.ZooKeeper zookeeper)

setConfiguration

public void setConfiguration(BlurConfiguration config)

configuration

public Map<String,String> configuration()
                                 throws BlurException,
                                        TException
Description copied from interface: Blur.Iface
Fetches the Blur configuration.

Specified by:
configuration in interface Blur.Iface
Returns:
Map of property name to value.
Throws:
BlurException
TException

getMaxRecordsPerRowFetchRequest

public int getMaxRecordsPerRowFetchRequest()

setMaxRecordsPerRowFetchRequest

public void setMaxRecordsPerRowFetchRequest(int _maxRecordsPerRowFetchRequest)

schema

public Schema schema(String table)
              throws BlurException,
                     TException
Description copied from interface: Blur.Iface
Gets the schema for a given table.

Specified by:
schema in interface Blur.Iface
Parameters:
table - the table name.
Returns:
Schema.
Throws:
BlurException
TException

ping

public void ping()
          throws TException
Description copied from interface: Blur.Iface
A way to ping a server to make sure the connection is still valid.

Specified by:
ping in interface Blur.Iface
Throws:
TException

logging

public void logging(String classNameOrLoggerName,
                    Level level)
             throws BlurException,
                    TException
Description copied from interface: Blur.Iface
Changes the logging level for the given instance dynamically at runtime.

Specified by:
logging in interface Blur.Iface
Parameters:
classNameOrLoggerName - the className or Logger Name of the Logger to be changed.
level - the logging level.
Throws:
BlurException
TException

resetLogging

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

Specified by:
resetLogging in interface Blur.Iface
Throws:
BlurException
TException


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