From b82276231c8a523ebb27bc106c1836016d9be025 Mon Sep 17 00:00:00 2001 From: Liangliang Gu Date: Mon, 25 Oct 2021 10:10:27 +0800 Subject: [PATCH] support DataEncode in BackupMeta (#287) Signed-off-by: marsishandsome --- scripts/proto.sh | 2 +- src/main/java/org/tikv/br/BackupDecoder.java | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/proto.sh b/scripts/proto.sh index a5e54ccd4e..fcd851e2e3 100755 --- a/scripts/proto.sh +++ b/scripts/proto.sh @@ -14,7 +14,7 @@ # limitations under the License. # -kvproto_hash=465fa4c7b42e644d5aacaf79d06c75733dc12eb3 +kvproto_hash=d62ddcee4ccd95f19f3ffa89c2832f2fb81030ca raft_rs_hash=b9891b673573fad77ebcf9bbe0969cf945841926 tipb_hash=c4d518eb1d60c21f05b028b36729e64610346dac diff --git a/src/main/java/org/tikv/br/BackupDecoder.java b/src/main/java/org/tikv/br/BackupDecoder.java index c36e6194cf..725b5096fb 100644 --- a/src/main/java/org/tikv/br/BackupDecoder.java +++ b/src/main/java/org/tikv/br/BackupDecoder.java @@ -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!"); }