From 743e2fbed972682dcea7894a6de8d038cf2cdaf0 Mon Sep 17 00:00:00 2001 From: anoopsamjohn Date: Wed, 16 Oct 2013 07:29:47 +0000 Subject: [PATCH] HBASE-9761 Put copy constructor should clone the operation attributes also git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1532663 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/hadoop/hbase/client/Put.java | 3 +++ .../src/main/java/org/apache/hadoop/hbase/client/Scan.java | 3 +++ 2 files changed, 6 insertions(+) diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java index 41ec446f7f1..d40b7a38c7a 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Put.java @@ -100,6 +100,9 @@ public class Put extends Mutation implements HeapSize, Comparable { this.familyMap.put(entry.getKey(), entry.getValue()); } this.durability = putToCopy.durability; + for (Map.Entry entry : putToCopy.getAttributesMap().entrySet()) { + this.setAttribute(entry.getKey(), entry.getValue()); + } } /** diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java index 0c5565baedc..b876fa7e837 100644 --- a/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java +++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/client/Scan.java @@ -222,6 +222,9 @@ public class Scan extends OperationWithAttributes { this.tr = get.getTimeRange(); this.familyMap = get.getFamilyMap(); this.getScan = true; + for (Map.Entry attr : get.getAttributesMap().entrySet()) { + setAttribute(attr.getKey(), attr.getValue()); + } } public boolean isGetScan() {