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.SizeMultiWriterNested classes/interfaces inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
AbstractMultiFileWriter.WriterFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate longprivate StoreFileWriterprivate byte[]private booleanprivate Cellprivate intprivate intFields inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
boundaries, comparator, existingWritersFields inherited from class org.apache.hadoop.hbase.regionserver.AbstractMultiFileWriter
sourceScanner, writerFactory -
Constructor Summary
ConstructorsConstructorDescriptionBoundaryMultiWriter(CellComparator comparator, List<byte[]> targetBoundaries, byte[] majorRangeFrom, byte[] majorRangeTo) -
Method Summary
Modifier and TypeMethodDescriptionvoidAppend the given cellprivate voidprivate voidCalled if there are no cells for some stripe.private booleanisCellAfterCurrentWriter(Cell cell) protected voidprivate voidprepareWriterFor(Cell cell) private voidMethods inherited from class org.apache.hadoop.hbase.regionserver.StripeMultiFileWriter
preCloseWriter, preCommitWriters, sanityCheckLeft, sanityCheckRight, setNoStripeMetadata, writersMethods 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:CellSinkAppend the given cell- Parameters:
cell- the cell to be added- Throws:
IOException
-
isCellAfterCurrentWriter
-
preCommitWritersInternal
- Specified by:
preCommitWritersInternalin 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
-