public static class StoreFile.Writer extends Object implements Compactor.CellSink
Modifier and Type | Field and Description |
---|---|
private BloomType |
bloomType |
private BloomFilterWriter |
deleteFamilyBloomFilterWriter |
private long |
deleteFamilyCnt |
private long |
earliestPutTs |
private BloomFilterWriter |
generalBloomFilterWriter |
(package private) boolean |
isTimeRangeTrackerSet |
private KeyValue.KVComparator |
kvComparator |
private byte[] |
lastBloomKey |
private int |
lastBloomKeyLen |
private int |
lastBloomKeyOffset |
private Cell |
lastCell |
private Cell |
lastDeleteFamilyCell |
(package private) TimeRangeTracker |
timeRangeTracker |
protected HFile.Writer |
writer |
Modifier | Constructor and Description |
---|---|
private |
StoreFile.Writer(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.conf.Configuration conf,
CacheConfig cacheConf,
KeyValue.KVComparator comparator,
BloomType bloomType,
long maxKeys,
InetSocketAddress[] favoredNodes,
HFileContext fileContext,
boolean shouldDropCacheBehind)
Creates an HFile.Writer that also write helpful meta data.
|
Modifier and Type | Method and Description |
---|---|
void |
append(Cell cell) |
private void |
appendDeleteFamilyBloomFilter(Cell cell) |
void |
appendFileInfo(byte[] key,
byte[] value) |
private void |
appendGeneralBloomfilter(Cell cell) |
void |
appendMetadata(long maxSequenceId,
boolean majorCompaction)
Writes meta data.
|
void |
appendTrackedTimestampsToMetadata()
Add TimestampRange and earliest put timestamp to Metadata
|
void |
close() |
private boolean |
closeBloomFilter(BloomFilterWriter bfw) |
private boolean |
closeDeleteFamilyBloomFilter() |
private boolean |
closeGeneralBloomFilter() |
(package private) BloomFilterWriter |
getGeneralBloomWriter()
For unit testing only.
|
(package private) HFile.Writer |
getHFileWriter()
For use in testing, e.g.
|
org.apache.hadoop.fs.Path |
getPath() |
(package private) boolean |
hasGeneralBloom() |
void |
setTimeRangeTracker(TimeRangeTracker trt)
Set TimeRangeTracker
|
void |
trackTimestamps(Cell cell)
Record the earlest Put timestamp.
|
private final BloomFilterWriter generalBloomFilterWriter
private final BloomFilterWriter deleteFamilyBloomFilterWriter
private final BloomType bloomType
private byte[] lastBloomKey
private int lastBloomKeyOffset
private int lastBloomKeyLen
private KeyValue.KVComparator kvComparator
private Cell lastCell
private long earliestPutTs
private Cell lastDeleteFamilyCell
private long deleteFamilyCnt
TimeRangeTracker timeRangeTracker
boolean isTimeRangeTrackerSet
protected HFile.Writer writer
private StoreFile.Writer(org.apache.hadoop.fs.FileSystem fs, org.apache.hadoop.fs.Path path, org.apache.hadoop.conf.Configuration conf, CacheConfig cacheConf, KeyValue.KVComparator comparator, BloomType bloomType, long maxKeys, InetSocketAddress[] favoredNodes, HFileContext fileContext, boolean shouldDropCacheBehind) throws IOException
fs
- file system to write topath
- file name to createconf
- user configurationcomparator
- key comparatorbloomType
- bloom filter settingmaxKeys
- the expected maximum number of keys to be added. Was used
for Bloom filter size in HFile
format version 1.favoredNodes
- fileContext
- - The HFile contextshouldDropCacheBehind
- Drop pages written to page cache after writing the store file.IOException
- problem writing to FSpublic void appendMetadata(long maxSequenceId, boolean majorCompaction) throws IOException
close()
since its written as meta data to this file.maxSequenceId
- Maximum sequence id.majorCompaction
- True if this file is product of a major compactionIOException
- problem writing to FSpublic void appendTrackedTimestampsToMetadata() throws IOException
IOException
public void setTimeRangeTracker(TimeRangeTracker trt)
trt
- public void trackTimestamps(Cell cell)
cell
- private void appendGeneralBloomfilter(Cell cell) throws IOException
IOException
private void appendDeleteFamilyBloomFilter(Cell cell) throws IOException
IOException
public void append(Cell cell) throws IOException
append
in interface Compactor.CellSink
IOException
public org.apache.hadoop.fs.Path getPath()
boolean hasGeneralBloom()
BloomFilterWriter getGeneralBloomWriter()
private boolean closeBloomFilter(BloomFilterWriter bfw) throws IOException
IOException
private boolean closeGeneralBloomFilter() throws IOException
IOException
private boolean closeDeleteFamilyBloomFilter() throws IOException
IOException
public void close() throws IOException
IOException
public void appendFileInfo(byte[] key, byte[] value) throws IOException
IOException
HFile.Writer getHFileWriter()
CreateRandomStoreFile
Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.