support DataEncode in BackupMeta (#287)

Signed-off-by: marsishandsome <marsishandsome@gmail.com>
This commit is contained in:
Liangliang Gu 2021-10-25 10:10:27 +08:00 committed by GitHub
parent 599da193df
commit b82276231c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -14,7 +14,7 @@
# limitations under the License.
#
kvproto_hash=465fa4c7b42e644d5aacaf79d06c75733dc12eb3
kvproto_hash=d62ddcee4ccd95f19f3ffa89c2832f2fb81030ca
raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926
tipb_hash=c4d518eb1d60c21f05b028b36729e64610346dac

View File

@ -41,11 +41,13 @@ public class BackupDecoder implements Serializable {
}
private KVDecoder initKVDecoder() throws SSTDecodeException {
// Currently only v1 is supported.
// V2 will be added after https://github.com/tikv/tikv/issues/10938.
if (backupMeta.getIsRawKv()) {
// TODO: ttl_enable should be witten to BackupMeta
return new RawKVDecoderV1(ttlEnabled);
if ("V1".equals(backupMeta.getApiVersion().name())) {
return new RawKVDecoderV1(ttlEnabled);
} else {
throw new SSTDecodeException(
"does not support decode APIVersion " + backupMeta.getApiVersion().name());
}
} else {
throw new SSTDecodeException("TxnKV is not supported yet!");
}