|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.accumulo.core.client.mapreduce.InputTableConfig
public class InputTableConfig
This class to holds a batch scan configuration for a table. It contains all the properties needed to specify how rows should be returned from the table.
Constructor Summary | |
---|---|
InputTableConfig()
|
|
InputTableConfig(DataInput input)
Creates a batch scan config object out of a previously serialized batch scan config object. |
Method Summary | |
---|---|
boolean |
equals(Object o)
|
InputTableConfig |
fetchColumns(Collection<Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>> columns)
Restricts the columns that will be mapped over for this job for the default input table. |
Collection<Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>> |
getFetchedColumns()
Returns the columns to be fetched for this configuration |
List<IteratorSetting> |
getIterators()
Returns the iterators to be set on this configuration |
List<Range> |
getRanges()
Returns the ranges to be queried in the configuration |
int |
hashCode()
|
boolean |
isOfflineScan()
Determines whether a configuration has the offline table scan feature enabled. |
void |
readFields(DataInput dataInput)
Reads the fields in the DataInput into the current object |
InputTableConfig |
setAutoAdjustRanges(boolean autoAdjustRanges)
Controls the automatic adjustment of ranges for this job. |
InputTableConfig |
setIterators(List<IteratorSetting> iterators)
Set iterators on to be used in the query. |
InputTableConfig |
setOfflineScan(boolean offlineScan)
Enable reading offline tables. |
InputTableConfig |
setRanges(List<Range> ranges)
Sets the input ranges to scan for all tables associated with this job. |
InputTableConfig |
setUseIsolatedScanners(boolean useIsolatedScanners)
Controls the use of the IsolatedScanner in this job. |
InputTableConfig |
setUseLocalIterators(boolean useLocalIterators)
Controls the use of the ClientSideIteratorScanner in this job. |
boolean |
shouldAutoAdjustRanges()
Determines whether a configuration has auto-adjust ranges enabled. |
boolean |
shouldUseIsolatedScanners()
Determines whether a configuration has isolation enabled. |
boolean |
shouldUseLocalIterators()
Determines whether a configuration uses local iterators. |
void |
write(DataOutput dataOutput)
Writes the state for the current object out to the specified DataOutput |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InputTableConfig()
public InputTableConfig(DataInput input) throws IOException
input
- the data input of the serialized batch scan config
IOException
Method Detail |
---|
public InputTableConfig setRanges(List<Range> ranges)
ranges
- the ranges that will be mapped overpublic List<Range> getRanges()
public InputTableConfig fetchColumns(Collection<Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>> columns)
columns
- a pair of Text
objects corresponding to column family and column qualifier. If the column qualifier is null, the entire column family is
selected. An empty set is the default and is equivalent to scanning the all columns.public Collection<Pair<org.apache.hadoop.io.Text,org.apache.hadoop.io.Text>> getFetchedColumns()
public InputTableConfig setIterators(List<IteratorSetting> iterators)
iterators
- the configurations for the iteratorspublic List<IteratorSetting> getIterators()
public InputTableConfig setAutoAdjustRanges(boolean autoAdjustRanges)
By default, this feature is enabled.
autoAdjustRanges
- the feature is enabled if true, disabled otherwisesetRanges(java.util.List)
public boolean shouldAutoAdjustRanges()
setAutoAdjustRanges(boolean)
public InputTableConfig setUseLocalIterators(boolean useLocalIterators)
ClientSideIteratorScanner
in this job. Enabling this feature will cause the iterator stack
to be constructed within the Map task, rather than within the Accumulo TServer. To use this feature, all classes needed for those iterators must be
available on the classpath for the task.
By default, this feature is disabled.
useLocalIterators
- the feature is enabled if true, disabled otherwisepublic boolean shouldUseLocalIterators()
setUseLocalIterators(boolean)
public InputTableConfig setOfflineScan(boolean offlineScan)
Enable reading offline tables. By default, this feature is disabled and only online tables are scanned. This will make the map reduce job directly read the table's files. If the table is not offline, then the job will fail. If the table comes online during the map reduce job, it is likely that the job will fail.
To use this option, the map reduce user will need access to read the Accumulo directory in HDFS.
Reading the offline table will create the scan time iterator stack in the map process. So any iterators that are configured for the table will need to be on the mapper's classpath. The accumulo-site.xml may need to be on the mapper's classpath if HDFS or the Accumulo directory in HDFS are non-standard.
One way to use this feature is to clone a table, take the clone offline, and use the clone as the input table for a map reduce job. If you plan to map reduce over the data many times, it may be better to the compact the table, clone it, take it offline, and use the clone for all map reduce jobs. The reason to do this is that compaction will reduce each tablet in the table to one file, and it is faster to read from one file.
There are two possible advantages to reading a tables file directly out of HDFS. First, you may see better read performance. Second, it will support speculative execution better. When reading an online table speculative execution can put more load on an already slow tablet server.
By default, this feature is disabled.
offlineScan
- the feature is enabled if true, disabled otherwisepublic boolean isOfflineScan()
setOfflineScan(boolean)
public InputTableConfig setUseIsolatedScanners(boolean useIsolatedScanners)
IsolatedScanner
in this job.
By default, this feature is disabled.
useIsolatedScanners
- the feature is enabled if true, disabled otherwisepublic boolean shouldUseIsolatedScanners()
setUseIsolatedScanners(boolean)
public void write(DataOutput dataOutput) throws IOException
DataOutput
write
in interface org.apache.hadoop.io.Writable
dataOutput
- the output for which to write the object's state
IOException
public void readFields(DataInput dataInput) throws IOException
DataInput
into the current object
readFields
in interface org.apache.hadoop.io.Writable
dataInput
- the input fields to read into the current object
IOException
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |