Class HRegion.FlushResultImpl
java.lang.Object
org.apache.hadoop.hbase.regionserver.HRegion.FlushResultImpl
- All Implemented Interfaces:
HRegion.FlushResult
- Enclosing class:
- HRegion
Objects from this class are created when flushing to describe all the different states that
that method ends up in. The Result enum describes those states. The sequence id should only be
specified if the flush was successful, and the failure message should only be specified if it
didn't flush.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.hadoop.hbase.regionserver.HRegion.FlushResult
HRegion.FlushResult.Result
-
Field Summary
Modifier and TypeFieldDescription(package private) final String
(package private) final long
(package private) final HRegion.FlushResult.Result
(package private) final boolean
-
Constructor Summary
ConstructorDescriptionFlushResultImpl
(HRegion.FlushResult.Result result, long flushSequenceId) Convenience constructor to use when the flush is successful, the failure message is set to null.FlushResultImpl
(HRegion.FlushResult.Result result, long flushSequenceId, String failureReason, boolean wroteFlushMarker) Constructor with all the parameters.FlushResultImpl
(HRegion.FlushResult.Result result, String failureReason, boolean wroteFlushMarker) Convenience constructor to use when we cannot flush. -
Method Summary
Modifier and TypeMethodDescriptionReturns the detailed result codeboolean
Convenience method, the equivalent of checking if result is FLUSHED_COMPACTION_NEEDED.boolean
Convenience method, the equivalent of checking if result is FLUSHED_NO_COMPACTION_NEEDED or FLUSHED_NO_COMPACTION_NEEDED.toString()
-
Field Details
-
result
-
failureReason
-
flushSequenceId
-
wroteFlushWalMarker
-
-
Constructor Details
-
FlushResultImpl
FlushResultImpl(HRegion.FlushResult.Result result, long flushSequenceId) Convenience constructor to use when the flush is successful, the failure message is set to null.- Parameters:
result
- Expecting FLUSHED_NO_COMPACTION_NEEDED or FLUSHED_COMPACTION_NEEDED.flushSequenceId
- Generated sequence id that comes right after the edits in the memstores.
-
FlushResultImpl
FlushResultImpl(HRegion.FlushResult.Result result, String failureReason, boolean wroteFlushMarker) Convenience constructor to use when we cannot flush.- Parameters:
result
- Expecting CANNOT_FLUSH_MEMSTORE_EMPTY or CANNOT_FLUSH.failureReason
- Reason why we couldn't flush.
-
FlushResultImpl
FlushResultImpl(HRegion.FlushResult.Result result, long flushSequenceId, String failureReason, boolean wroteFlushMarker) Constructor with all the parameters.- Parameters:
result
- Any of the Result.flushSequenceId
- Generated sequence id if the memstores were flushed else -1.failureReason
- Reason why we couldn't flush, or null.
-
-
Method Details
-
isFlushSucceeded
Convenience method, the equivalent of checking if result is FLUSHED_NO_COMPACTION_NEEDED or FLUSHED_NO_COMPACTION_NEEDED.- Specified by:
isFlushSucceeded
in interfaceHRegion.FlushResult
- Returns:
- true if the memstores were flushed, else false.
-
isCompactionNeeded
Convenience method, the equivalent of checking if result is FLUSHED_COMPACTION_NEEDED.- Specified by:
isCompactionNeeded
in interfaceHRegion.FlushResult
- Returns:
- True if the flush requested a compaction, else false (doesn't even mean it flushed).
-
toString
-
getResult
Description copied from interface:HRegion.FlushResult
Returns the detailed result code- Specified by:
getResult
in interfaceHRegion.FlushResult
-