Class StripeMultiFileWriter.BoundaryMultiWriter
java.lang.Object
org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter.BoundaryMultiWriter
- All Implemented Interfaces:
CellSink
,ShipperListener
- Enclosing class:
- StripeMultiFileWriter
MultiWriter that separates the cells based on fixed row-key boundaries. All the KVs between
each pair of neighboring boundaries from the list supplied to ctor will end up in one file, and
separate from all other such pairs.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
StripeMultiFileWriter.BoundaryMultiWriter, StripeMultiFileWriter.SizeMultiWriter
Nested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
AbstractMultiFileWriter.WriterFactory
-
Field Summary
Modifier and TypeFieldDescriptionprivate long
private StoreFileWriter
private byte[]
private boolean
private Cell
private int
private int
Fields inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
boundaries, comparator, existingWriters
Fields inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
sourceScanner, writerFactory
-
Constructor Summary
ConstructorDescriptionBoundaryMultiWriter
(CellComparator comparator, List<byte[]> targetBoundaries, byte[] majorRangeFrom, byte[] majorRangeTo) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Append the given cellprivate void
private void
Called if there are no cells for some stripe.private boolean
isCellAfterCurrentWriter
(Cell cell) protected void
private void
prepareWriterFor
(Cell cell) private void
Methods inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
preCloseWriter, preCommitWriters, sanityCheckLeft, sanityCheckRight, setNoStripeMetadata, writers
Methods inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
abortWriters, beforeShipped, commitWriters, commitWriters, init
-
Field Details
-
currentWriter
-
currentWriterEndKey
-
lastCell
-
cellsInCurrentWriter
-
majorRangeFromIndex
-
majorRangeToIndex
-
hasAnyWriter
-
-
Constructor Details
-
BoundaryMultiWriter
public BoundaryMultiWriter(CellComparator comparator, List<byte[]> targetBoundaries, byte[] majorRangeFrom, byte[] majorRangeTo) throws IOException - Parameters:
targetBoundaries
- The boundaries on which writers/files are separated.majorRangeFrom
- Major range is the range for which at least one file should be written (because all files are included in compaction). majorRangeFrom is the left boundary.majorRangeTo
- The right boundary of majorRange (see majorRangeFrom).- Throws:
IOException
-
-
Method Details
-
append
Description copied from interface:CellSink
Append the given cell- Parameters:
cell
- the cell to be added- Throws:
IOException
-
isCellAfterCurrentWriter
-
preCommitWritersInternal
- Specified by:
preCommitWritersInternal
in classStripeMultiFileWriter
- Throws:
IOException
-
prepareWriterFor
- Throws:
IOException
-
createEmptyWriter
Called if there are no cells for some stripe. We need to have something in the writer list for this stripe, so that writer-boundary list indices correspond to each other. We can insert null in the writer list for that purpose, except in the following cases where we actually need a file: 1) If we are in range for which we are compacting all the files, we need to create an empty file to preserve stripe metadata. 2) If we have not produced any file at all for this compactions, and this is the last chance (the last stripe), we need to preserve last seqNum (see also HBASE-6059).- Throws:
IOException
-
checkCanCreateWriter
- Throws:
IOException
-
stopUsingCurrentWriter
-