org.apache.accumulo.core.client.mock
Class MockScannerBase

java.lang.Object
  extended by org.apache.accumulo.core.client.mock.MockScannerBase
All Implemented Interfaces:
ScannerBase
Direct Known Subclasses:
MockBatchScanner, MockScanner

public class MockScannerBase
extends java.lang.Object
implements ScannerBase


Field Summary
protected  Authorizations auths
           
protected  MockTable table
           
 
Method Summary
 void clearColumns()
          Clears the columns to be fetched (useful for resetting the scanner for reuse)
 void clearScanIterators()
          Clears scan iterators prior to returning a scanner to the pool.
 SortedKeyValueIterator<Key,Value> createFilter(SortedKeyValueIterator<Key,Value> inner)
           
 void fetchColumn(org.apache.hadoop.io.Text colFam, org.apache.hadoop.io.Text colQual)
          Limits the scan to only this column, identified by family and qualifier.
 void fetchColumnFamily(org.apache.hadoop.io.Text col)
           
 void setColumnFamilyRegex(java.lang.String regex)
          Set a column family regular expression that filters non matching entries server side.
 void setColumnQualifierRegex(java.lang.String regex)
          Set a column qualifier regular expression that filters non matching entries server side.
 void setRowRegex(java.lang.String regex)
          Set a row regular expression that filters non matching entries server side.
 void setScanIteratorOption(java.lang.String iteratorName, java.lang.String key, java.lang.String value)
          Sets options for server side scan iterators.
 void setScanIterators(int priority, java.lang.String iteratorClass, java.lang.String iteratorName)
          Sets server side scan iterators.
 void setupRegex(java.lang.String iteratorName, int iteratorPriority)
          Call this method to initialize regular expressions on a scanner.
 void setValueRegex(java.lang.String regex)
          Set a value regular expression that filters non matching entries server side.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected final MockTable table

auths

protected final Authorizations auths
Method Detail

setScanIterators

public void setScanIterators(int priority,
                             java.lang.String iteratorClass,
                             java.lang.String iteratorName)
                      throws java.io.IOException
Description copied from interface: ScannerBase
Sets server side scan iterators.

Specified by:
setScanIterators in interface ScannerBase
Parameters:
priority - determines the order in which iterators are applied (system iterators are always applied first, then per-table and scan-time, lowest first)
iteratorClass - the fully qualified class name of the iterator to be applied at scan time
iteratorName - a nickname for the iterator
Throws:
java.io.IOException - if an exception occurs reading from the iterator stack

setScanIteratorOption

public void setScanIteratorOption(java.lang.String iteratorName,
                                  java.lang.String key,
                                  java.lang.String value)
Description copied from interface: ScannerBase
Sets options for server side scan iterators.

Specified by:
setScanIteratorOption in interface ScannerBase
Parameters:
iteratorName - a nickname for the iterator
key - option name (depends on specific iterator)
value - option value (depends on specific iterator)

fetchColumnFamily

public void fetchColumnFamily(org.apache.hadoop.io.Text col)
Specified by:
fetchColumnFamily in interface ScannerBase
Parameters:
col - limit the scan to only this column family (multiple calls appends to the list of column families to limit)

fetchColumn

public void fetchColumn(org.apache.hadoop.io.Text colFam,
                        org.apache.hadoop.io.Text colQual)
Description copied from interface: ScannerBase
Limits the scan to only this column, identified by family and qualifier. Multiple calls appends to the list of columns to be fetched.

Specified by:
fetchColumn in interface ScannerBase
Parameters:
colFam - the column family of the column to be fetched
colQual - the column qualifier of the column to be fetched

clearColumns

public void clearColumns()
Description copied from interface: ScannerBase
Clears the columns to be fetched (useful for resetting the scanner for reuse)

Specified by:
clearColumns in interface ScannerBase

clearScanIterators

public void clearScanIterators()
Description copied from interface: ScannerBase
Clears scan iterators prior to returning a scanner to the pool.

Specified by:
clearScanIterators in interface ScannerBase

createFilter

public SortedKeyValueIterator<Key,Value> createFilter(SortedKeyValueIterator<Key,Value> inner)
                                               throws java.io.IOException
Throws:
java.io.IOException

setupRegex

public void setupRegex(java.lang.String iteratorName,
                       int iteratorPriority)
                throws java.io.IOException
Description copied from interface: ScannerBase
Call this method to initialize regular expressions on a scanner. If it is not called, reasonable defaults will be used.

Specified by:
setupRegex in interface ScannerBase
Parameters:
iteratorName - a nickname for the iterator
iteratorPriority - determines the order in which iterators are applied (system iterators are always applied first, then per-table and scan-time, lowest first)
Throws:
java.io.IOException - if an exception occurs reading from the iterator stack

setRowRegex

public void setRowRegex(java.lang.String regex)
Description copied from interface: ScannerBase
Set a row regular expression that filters non matching entries server side.

Specified by:
setRowRegex in interface ScannerBase
Parameters:
regex - java regular expression to match

setColumnFamilyRegex

public void setColumnFamilyRegex(java.lang.String regex)
Description copied from interface: ScannerBase
Set a column family regular expression that filters non matching entries server side.

Specified by:
setColumnFamilyRegex in interface ScannerBase
Parameters:
regex - java regular expression to match

setColumnQualifierRegex

public void setColumnQualifierRegex(java.lang.String regex)
Description copied from interface: ScannerBase
Set a column qualifier regular expression that filters non matching entries server side.

Specified by:
setColumnQualifierRegex in interface ScannerBase
Parameters:
regex - java regular expression to match

setValueRegex

public void setValueRegex(java.lang.String regex)
Description copied from interface: ScannerBase
Set a value regular expression that filters non matching entries server side.

Specified by:
setValueRegex in interface ScannerBase
Parameters:
regex - java regular expression to match


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