com.bigdata.service.jini.util
Class DumpFederation

java.lang.Object
  extended by com.bigdata.service.jini.util.DumpFederation

public class DumpFederation
extends Object

A client utility that connects to and dumps various interesting aspects of a live federation.

Version:
$Id$
Author:
Bryan Thompson
See Also:
DumpJournal
TODO:
debug logic to dump only within the namespace (its hacked in ListIndicesTask).

Nested Class Summary
static interface DumpFederation.ConfigurationOptions
          Configuration options for this class.
static class DumpFederation.FetchIndexPartitionByteCountRecordTask
          Helper task returns various byte counts for an index partition and the data service on which it resides.
static class DumpFederation.FormatCSVTable
          Comma separated value delimited tabular output.
static interface DumpFederation.FormatRecord
          Interface responsible for formatting the output.
static class DumpFederation.FormatTabTable
          Tab-delimited tabular output.
static class DumpFederation.IndexPartitionDetailRecord
          Encapsulates several different kinds of byte counts for the index partition and the data service on which it resides.
static class DumpFederation.IndexPartitionRecord
          Container for a bunch of metadata extracted for an index partition together with the methods required to extract that data.
static class DumpFederation.ScheduledDumpTask
          A task that produces dumps of the indices in the federation on a scheduled basis.
static class DumpFederation.ServiceMetadata
          Service metadata extracted by DumpFederation.
static class DumpFederation.SourceDetailRecord
          A record detailing various things counted on a per-source basis.
 
Field Summary
static String COMPONENT
          The component name for this class (for use with the DumpFederation.ConfigurationOptions).
protected static org.apache.log4j.Logger log
           
 
Constructor Summary
DumpFederation(JiniFederation<?> fed, long tx, DumpFederation.FormatRecord formatter)
           
 
Method Summary
 void dumpIndex(String indexName)
          Generates the dump record for the specified scale-out index.
protected  void dumpIndexLocators(String indexName, IMetadataIndex metadataIndex)
          Dumps useful information about the index partition in the context of the data service on which it resides.
 void dumpIndices(String namespace)
          Generates the dump record for all scale-out indices having the specified namespace prefix.
 String[] getIndexNames(String namespace)
          The names of all registered scale-out indices having the specified namespace prefix.
static void main(String[] args)
          Dumps interesting things about the federation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Logger log

COMPONENT

public static final String COMPONENT
The component name for this class (for use with the DumpFederation.ConfigurationOptions).

Constructor Detail

DumpFederation

public DumpFederation(JiniFederation<?> fed,
                      long tx,
                      DumpFederation.FormatRecord formatter)
Parameters:
fed - The federation whose indices will be dump.
tx - The timestamp that will be used to dump the database. This SHOULD be a read-historical transaction since that will put a read-lock into place on the data during any operations by this class.
formatter - Object used to format the output.
Method Detail

main

public static void main(String[] args)
                 throws InterruptedException,
                        ExecutionException,
                        IOException,
                        TimeoutException,
                        net.jini.config.ConfigurationException
Dumps interesting things about the federation.

Jini MUST be running

You MUST specify a sufficiently lax security policy, e.g., using -Djava.security.policy=policy.all, where policy.all is the name of a policy file.

Parameters:
args - The name of the configuration file for the jini client that will be used to connect to the federation.
Throws:
InterruptedException
ExecutionException
IOException
TimeoutException - if no DataService can be discovered.
net.jini.config.ConfigurationException

getIndexNames

public String[] getIndexNames(String namespace)
                       throws InterruptedException,
                              ExecutionException,
                              IOException
The names of all registered scale-out indices having the specified namespace prefix.

Parameters:
namespace - The namespace prefix.
Throws:
IOException
ExecutionException
InterruptedException

dumpIndices

public void dumpIndices(String namespace)
                 throws InterruptedException,
                        ExecutionException,
                        IOException
Generates the dump record for all scale-out indices having the specified namespace prefix.

Parameters:
namespace - The namespace prefix (may be an empty string to dump all indices).
Throws:
IOException
ExecutionException
InterruptedException

dumpIndex

public void dumpIndex(String indexName)
               throws InterruptedException
Generates the dump record for the specified scale-out index.

Parameters:
indexName - The name of a scale-out index.
Throws:
InterruptedException

dumpIndexLocators

protected void dumpIndexLocators(String indexName,
                                 IMetadataIndex metadataIndex)
                          throws InterruptedException
Dumps useful information about the index partition in the context of the data service on which it resides. The information is collected in parallel in order to minimize the total latency. This is especially important when there are a large #of index partitions.

Parameters:
indexName - The name of the scale-out index.
metadataIndex - The scale-out index.
Throws:
InterruptedException


Copyright © 2006-2011 SYSTAP, LLC. All Rights Reserved.