Package io.permazen.jsck
Class Issue
java.lang.Object
io.permazen.jsck.Issue
- Direct Known Subclasses:
InvalidKey
,InvalidValue
,MissingKey
Represents a point of corruption or inconsistency in a Permazen key/value database.
Issue
s are specific to a single key/value pair in the database.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Apply the fix for this issue to the givenKVStore
.boolean
byte[]
getKey()
Get the databse key.byte[]
Get the replacement value, if any.byte[]
Get the original value, if any.int
hashCode()
setDetail
(ObjId id, CompositeIndex index, String detail) toString()
-
Constructor Details
-
Issue
Constructor.- Parameters:
description
- short description of the issuekey
- key of invalid key/value pairoldValue
- the original, invalid value forkey
, or null ifkey
was missing or don't carenewValue
- the corrected replacement value forkey
, or null ifkey
should be deleted- Throws:
IllegalArgumentException
- ifkey
is nullIllegalArgumentException
- ifoldValue
andnewValue
are equal
-
-
Method Details
-
getKey
public byte[] getKey()Get the databse key.- Returns:
- key of this issue
-
getOldValue
public byte[] getOldValue()Get the original value, if any.- Returns:
- original value, null if key/value pair was missing
-
getNewValue
public byte[] getNewValue()Get the replacement value, if any.- Returns:
- replacement value, null if key/value pair was missing or should be deleted
-
apply
Apply the fix for this issue to the givenKVStore
.This overwrites the key/value pair with the new value, or deletes it if
getNewValue()
is null.- Parameters:
kvstore
- target key/value store- Throws:
IllegalArgumentException
- ifkvstore
is null
-
setDetail
-
setDetail
-
setDetail
-
setDetail
-
setDetail
-
toString
-
equals
-
hashCode
public int hashCode()
-