1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.hadoop.hbase;
20
21 import java.io.DataInput;
22 import java.io.DataOutput;
23 import java.io.IOException;
24 import java.util.ArrayList;
25 import java.util.Collection;
26 import java.util.Collections;
27 import java.util.HashMap;
28 import java.util.HashSet;
29 import java.util.Iterator;
30 import java.util.List;
31 import java.util.Map;
32 import java.util.Set;
33 import java.util.TreeMap;
34 import java.util.TreeSet;
35 import java.util.regex.Matcher;
36
37 import org.apache.hadoop.hbase.util.ByteStringer;
38 import org.apache.commons.logging.Log;
39 import org.apache.commons.logging.LogFactory;
40 import org.apache.hadoop.hbase.classification.InterfaceAudience;
41 import org.apache.hadoop.hbase.classification.InterfaceStability;
42 import org.apache.hadoop.conf.Configuration;
43 import org.apache.hadoop.fs.Path;
44 import org.apache.hadoop.hbase.client.Durability;
45 import org.apache.hadoop.hbase.client.RegionReplicaUtil;
46 import org.apache.hadoop.hbase.exceptions.DeserializationException;
47 import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
48 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
49 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.BytesBytesPair;
50 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.ColumnFamilySchema;
51 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameStringPair;
52 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.TableSchema;
53 import org.apache.hadoop.hbase.regionserver.BloomType;
54 import org.apache.hadoop.hbase.security.User;
55 import org.apache.hadoop.hbase.util.Bytes;
56 import org.apache.hadoop.hbase.util.Writables;
57 import org.apache.hadoop.io.WritableComparable;
58
59
60
61
62
63
64
65 @InterfaceAudience.Public
66 @InterfaceStability.Evolving
67 public class HTableDescriptor implements WritableComparable<HTableDescriptor> {
68
69 private static final Log LOG = LogFactory.getLog(HTableDescriptor.class);
70
71
72
73
74
75
76
77
78
79 private static final byte TABLE_DESCRIPTOR_VERSION = 7;
80
81 private TableName name = null;
82
83
84
85
86
87
88 private final Map<ImmutableBytesWritable, ImmutableBytesWritable> values =
89 new HashMap<ImmutableBytesWritable, ImmutableBytesWritable>();
90
91
92
93
94
95
96 private final Map<String, String> configuration = new HashMap<String, String>();
97
98 public static final String SPLIT_POLICY = "SPLIT_POLICY";
99
100
101
102
103
104
105
106
107 public static final String MAX_FILESIZE = "MAX_FILESIZE";
108 private static final ImmutableBytesWritable MAX_FILESIZE_KEY =
109 new ImmutableBytesWritable(Bytes.toBytes(MAX_FILESIZE));
110
111 public static final String OWNER = "OWNER";
112 public static final ImmutableBytesWritable OWNER_KEY =
113 new ImmutableBytesWritable(Bytes.toBytes(OWNER));
114
115
116
117
118
119
120
121 public static final String READONLY = "READONLY";
122 private static final ImmutableBytesWritable READONLY_KEY =
123 new ImmutableBytesWritable(Bytes.toBytes(READONLY));
124
125
126
127
128
129
130
131 public static final String COMPACTION_ENABLED = "COMPACTION_ENABLED";
132 private static final ImmutableBytesWritable COMPACTION_ENABLED_KEY =
133 new ImmutableBytesWritable(Bytes.toBytes(COMPACTION_ENABLED));
134
135
136
137
138
139
140
141
142 public static final String MEMSTORE_FLUSHSIZE = "MEMSTORE_FLUSHSIZE";
143 private static final ImmutableBytesWritable MEMSTORE_FLUSHSIZE_KEY =
144 new ImmutableBytesWritable(Bytes.toBytes(MEMSTORE_FLUSHSIZE));
145
146 public static final String FLUSH_POLICY = "FLUSH_POLICY";
147
148
149
150
151
152
153
154 public static final String IS_ROOT = "IS_ROOT";
155 private static final ImmutableBytesWritable IS_ROOT_KEY =
156 new ImmutableBytesWritable(Bytes.toBytes(IS_ROOT));
157
158
159
160
161
162
163
164
165 public static final String IS_META = "IS_META";
166 private static final ImmutableBytesWritable IS_META_KEY =
167 new ImmutableBytesWritable(Bytes.toBytes(IS_META));
168
169
170
171
172
173
174 @Deprecated
175 public static final String DEFERRED_LOG_FLUSH = "DEFERRED_LOG_FLUSH";
176 @Deprecated
177 private static final ImmutableBytesWritable DEFERRED_LOG_FLUSH_KEY =
178 new ImmutableBytesWritable(Bytes.toBytes(DEFERRED_LOG_FLUSH));
179
180
181
182
183 public static final String DURABILITY = "DURABILITY";
184 private static final ImmutableBytesWritable DURABILITY_KEY =
185 new ImmutableBytesWritable(Bytes.toBytes("DURABILITY"));
186
187
188
189
190 public static final String REGION_REPLICATION = "REGION_REPLICATION";
191 private static final ImmutableBytesWritable REGION_REPLICATION_KEY =
192 new ImmutableBytesWritable(Bytes.toBytes(REGION_REPLICATION));
193
194
195
196
197
198 public static final String REGION_MEMSTORE_REPLICATION = "REGION_MEMSTORE_REPLICATION";
199 private static final ImmutableBytesWritable REGION_MEMSTORE_REPLICATION_KEY =
200 new ImmutableBytesWritable(Bytes.toBytes(REGION_MEMSTORE_REPLICATION));
201
202
203
204
205
206
207
208 public static final String NORMALIZATION_ENABLED = "NORMALIZATION_ENABLED";
209 private static final ImmutableBytesWritable NORMALIZATION_ENABLED_KEY =
210 new ImmutableBytesWritable(Bytes.toBytes(NORMALIZATION_ENABLED));
211
212 public static final String NORMALIZER_TARGET_REGION_COUNT =
213 "NORMALIZER_TARGET_REGION_COUNT";
214 private static final ImmutableBytesWritable NORMALIZER_TARGET_REGION_COUNT_KEY =
215 new ImmutableBytesWritable(Bytes.toBytes(NORMALIZER_TARGET_REGION_COUNT));
216
217 public static final String NORMALIZER_TARGET_REGION_SIZE = "NORMALIZER_TARGET_REGION_SIZE";
218 private static final ImmutableBytesWritable NORMALIZER_TARGET_REGION_SIZE_KEY =
219 new ImmutableBytesWritable(Bytes.toBytes(NORMALIZER_TARGET_REGION_SIZE));
220
221
222 private static final Durability DEFAULT_DURABLITY = Durability.USE_DEFAULT;
223
224 public static final String PRIORITY = "PRIORITY";
225 private static final ImmutableBytesWritable PRIORITY_KEY =
226 new ImmutableBytesWritable(Bytes.toBytes(PRIORITY));
227
228
229 private static final int DEFAULT_PRIORITY = HConstants.NORMAL_QOS;
230
231
232
233
234
235
236 private static final ImmutableBytesWritable FALSE =
237 new ImmutableBytesWritable(Bytes.toBytes(Boolean.FALSE.toString()));
238
239 private static final ImmutableBytesWritable TRUE =
240 new ImmutableBytesWritable(Bytes.toBytes(Boolean.TRUE.toString()));
241
242 private static final boolean DEFAULT_DEFERRED_LOG_FLUSH = false;
243
244
245
246
247 public static final boolean DEFAULT_READONLY = false;
248
249
250
251
252 public static final boolean DEFAULT_COMPACTION_ENABLED = true;
253
254
255
256
257 public static final boolean DEFAULT_NORMALIZATION_ENABLED = false;
258
259
260
261
262
263 public static final long DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*128L;
264
265 public static final int DEFAULT_REGION_REPLICATION = 1;
266
267 public static final boolean DEFAULT_REGION_MEMSTORE_REPLICATION = true;
268
269 private final static Map<String, String> DEFAULT_VALUES
270 = new HashMap<String, String>();
271 private final static Set<ImmutableBytesWritable> RESERVED_KEYWORDS
272 = new HashSet<ImmutableBytesWritable>();
273 static {
274 DEFAULT_VALUES.put(MAX_FILESIZE,
275 String.valueOf(HConstants.DEFAULT_MAX_FILE_SIZE));
276 DEFAULT_VALUES.put(READONLY, String.valueOf(DEFAULT_READONLY));
277 DEFAULT_VALUES.put(MEMSTORE_FLUSHSIZE,
278 String.valueOf(DEFAULT_MEMSTORE_FLUSH_SIZE));
279 DEFAULT_VALUES.put(DEFERRED_LOG_FLUSH,
280 String.valueOf(DEFAULT_DEFERRED_LOG_FLUSH));
281 DEFAULT_VALUES.put(DURABILITY, DEFAULT_DURABLITY.name());
282 DEFAULT_VALUES.put(REGION_REPLICATION, String.valueOf(DEFAULT_REGION_REPLICATION));
283 DEFAULT_VALUES.put(NORMALIZATION_ENABLED, String.valueOf(DEFAULT_NORMALIZATION_ENABLED));
284 DEFAULT_VALUES.put(PRIORITY, String.valueOf(DEFAULT_PRIORITY));
285 for (String s : DEFAULT_VALUES.keySet()) {
286 RESERVED_KEYWORDS.add(new ImmutableBytesWritable(Bytes.toBytes(s)));
287 }
288 RESERVED_KEYWORDS.add(IS_ROOT_KEY);
289 RESERVED_KEYWORDS.add(IS_META_KEY);
290 }
291
292
293
294
295 private volatile Boolean meta = null;
296
297
298
299 private volatile Boolean root = null;
300
301
302
303
304 private Durability durability = null;
305
306
307
308
309 private final Map<byte [], HColumnDescriptor> families =
310 new TreeMap<byte [], HColumnDescriptor>(Bytes.BYTES_RAWCOMPARATOR);
311
312
313
314
315
316 @InterfaceAudience.Private
317 protected HTableDescriptor(final TableName name, HColumnDescriptor[] families) {
318 setName(name);
319 for(HColumnDescriptor descriptor : families) {
320 this.families.put(descriptor.getName(), descriptor);
321 }
322 }
323
324
325
326
327
328 protected HTableDescriptor(final TableName name, HColumnDescriptor[] families,
329 Map<ImmutableBytesWritable,ImmutableBytesWritable> values) {
330 setName(name);
331 for(HColumnDescriptor descriptor : families) {
332 this.families.put(descriptor.getName(), descriptor);
333 }
334 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> entry:
335 values.entrySet()) {
336 setValue(entry.getKey(), entry.getValue());
337 }
338 }
339
340
341
342
343
344
345
346
347
348 @Deprecated
349 public HTableDescriptor() {
350 super();
351 }
352
353
354
355
356
357
358 public HTableDescriptor(final TableName name) {
359 super();
360 setName(name);
361 }
362
363
364
365
366
367
368 @Deprecated
369 public HTableDescriptor(final byte[] name) {
370 this(TableName.valueOf(name));
371 }
372
373
374
375
376
377
378 @Deprecated
379 public HTableDescriptor(final String name) {
380 this(TableName.valueOf(name));
381 }
382
383
384
385
386
387
388
389
390 public HTableDescriptor(final HTableDescriptor desc) {
391 this(desc.name, desc);
392 }
393
394
395
396
397
398
399
400
401
402
403 public HTableDescriptor(final TableName name, final HTableDescriptor desc) {
404 super();
405 setName(name);
406 setMetaFlags(this.name);
407 for (HColumnDescriptor c: desc.families.values()) {
408 this.families.put(c.getName(), new HColumnDescriptor(c));
409 }
410 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e:
411 desc.values.entrySet()) {
412 setValue(e.getKey(), e.getValue());
413 }
414 for (Map.Entry<String, String> e : desc.configuration.entrySet()) {
415 this.configuration.put(e.getKey(), e.getValue());
416 }
417 }
418
419
420
421
422
423
424
425
426 private void setMetaFlags(final TableName name) {
427 setMetaRegion(isRootRegion() ||
428 name.equals(TableName.META_TABLE_NAME));
429 }
430
431
432
433
434
435
436 public boolean isRootRegion() {
437 if (this.root == null) {
438 this.root = isSomething(IS_ROOT_KEY, false)? Boolean.TRUE: Boolean.FALSE;
439 }
440 return this.root.booleanValue();
441 }
442
443
444
445
446
447
448
449
450 protected void setRootRegion(boolean isRoot) {
451
452 setValue(IS_ROOT_KEY, isRoot ? TRUE : FALSE);
453 }
454
455
456
457
458
459
460
461
462 public boolean isMetaRegion() {
463 if (this.meta == null) {
464 this.meta = calculateIsMetaRegion();
465 }
466 return this.meta.booleanValue();
467 }
468
469 private synchronized Boolean calculateIsMetaRegion() {
470 byte [] value = getValue(IS_META_KEY);
471 return (value != null)? Boolean.valueOf(Bytes.toString(value)): Boolean.FALSE;
472 }
473
474 private boolean isSomething(final ImmutableBytesWritable key,
475 final boolean valueIfNull) {
476 byte [] value = getValue(key);
477 if (value != null) {
478 return Boolean.valueOf(Bytes.toString(value));
479 }
480 return valueIfNull;
481 }
482
483
484
485
486
487
488
489
490
491 protected void setMetaRegion(boolean isMeta) {
492 setValue(IS_META_KEY, isMeta? TRUE: FALSE);
493 }
494
495
496
497
498
499
500 public boolean isMetaTable() {
501 return isMetaRegion() && !isRootRegion();
502 }
503
504
505
506
507
508
509
510
511 public byte[] getValue(byte[] key) {
512 return getValue(new ImmutableBytesWritable(key));
513 }
514
515 private byte[] getValue(final ImmutableBytesWritable key) {
516 ImmutableBytesWritable ibw = values.get(key);
517 if (ibw == null)
518 return null;
519 return ibw.get();
520 }
521
522
523
524
525
526
527
528
529 public String getValue(String key) {
530 byte[] value = getValue(Bytes.toBytes(key));
531 if (value == null)
532 return null;
533 return Bytes.toString(value);
534 }
535
536
537
538
539
540
541
542 public Map<ImmutableBytesWritable,ImmutableBytesWritable> getValues() {
543
544 return Collections.unmodifiableMap(values);
545 }
546
547
548
549
550
551
552
553
554 public HTableDescriptor setValue(byte[] key, byte[] value) {
555 setValue(new ImmutableBytesWritable(key), new ImmutableBytesWritable(value));
556 return this;
557 }
558
559
560
561
562
563 private HTableDescriptor setValue(final ImmutableBytesWritable key,
564 final String value) {
565 setValue(key, new ImmutableBytesWritable(Bytes.toBytes(value)));
566 return this;
567 }
568
569
570
571
572
573
574
575 public HTableDescriptor setValue(final ImmutableBytesWritable key,
576 final ImmutableBytesWritable value) {
577 if (key.compareTo(DEFERRED_LOG_FLUSH_KEY) == 0) {
578 boolean isDeferredFlush = Boolean.valueOf(Bytes.toString(value.get()));
579 LOG.warn("HTableDescriptor property:" + DEFERRED_LOG_FLUSH + " is deprecated, " +
580 "use " + DURABILITY + " instead");
581 setDurability(isDeferredFlush ? Durability.ASYNC_WAL : DEFAULT_DURABLITY);
582 return this;
583 }
584 if (value == null || value.getLength() == 0) {
585 remove(key);
586 } else {
587 values.put(key, value);
588 }
589 return this;
590 }
591
592
593
594
595
596
597
598
599 public HTableDescriptor setValue(String key, String value) {
600 if (value == null || value.length() == 0) {
601 remove(key);
602 } else {
603 setValue(Bytes.toBytes(key), Bytes.toBytes(value));
604 }
605 return this;
606 }
607
608
609
610
611
612
613
614 public void remove(final String key) {
615 remove(new ImmutableBytesWritable(Bytes.toBytes(key)));
616 }
617
618
619
620
621
622
623
624 public void remove(ImmutableBytesWritable key) {
625 values.remove(key);
626 }
627
628
629
630
631
632
633
634 public void remove(final byte [] key) {
635 remove(new ImmutableBytesWritable(key));
636 }
637
638
639
640
641
642
643
644 public boolean isReadOnly() {
645 return isSomething(READONLY_KEY, DEFAULT_READONLY);
646 }
647
648
649
650
651
652
653
654
655
656 public HTableDescriptor setReadOnly(final boolean readOnly) {
657 return setValue(READONLY_KEY, readOnly? TRUE: FALSE);
658 }
659
660
661
662
663
664
665
666 public boolean isCompactionEnabled() {
667 return isSomething(COMPACTION_ENABLED_KEY, DEFAULT_COMPACTION_ENABLED);
668 }
669
670
671
672
673
674
675 public HTableDescriptor setCompactionEnabled(final boolean isEnable) {
676 setValue(COMPACTION_ENABLED_KEY, isEnable ? TRUE : FALSE);
677 return this;
678 }
679
680
681
682
683
684
685
686 public boolean isNormalizationEnabled() {
687 return isSomething(NORMALIZATION_ENABLED_KEY, DEFAULT_NORMALIZATION_ENABLED);
688 }
689
690
691
692
693
694
695 public HTableDescriptor setNormalizationEnabled(final boolean isEnable) {
696 setValue(NORMALIZATION_ENABLED_KEY, isEnable ? TRUE : FALSE);
697 return this;
698 }
699
700 public HTableDescriptor setNormalizerTargetRegionCount(final int regionCount) {
701 setValue(NORMALIZER_TARGET_REGION_COUNT_KEY, Integer.toString(regionCount));
702 return this;
703 }
704
705 public int getNormalizerTargetRegionCount() {
706 byte [] value = getValue(NORMALIZER_TARGET_REGION_COUNT_KEY);
707 if (value != null) {
708 return Integer.parseInt(Bytes.toString(value));
709 }
710 return -1;
711 }
712
713 public HTableDescriptor setNormalizerTargetRegionSize(final long regionSize) {
714 setValue(NORMALIZER_TARGET_REGION_SIZE_KEY, Long.toString(regionSize));
715 return this;
716 }
717
718 public long getNormalizerTargetRegionSize() {
719 byte [] value = getValue(NORMALIZER_TARGET_REGION_SIZE_KEY);
720 if (value != null) {
721 return Long.parseLong(Bytes.toString(value));
722 }
723 return -1;
724 }
725
726
727
728
729
730
731 public HTableDescriptor setDurability(Durability durability) {
732 this.durability = durability;
733 setValue(DURABILITY_KEY, durability.name());
734 return this;
735 }
736
737
738
739
740
741 public Durability getDurability() {
742 if (this.durability == null) {
743 byte[] durabilityValue = getValue(DURABILITY_KEY);
744 if (durabilityValue == null) {
745 this.durability = DEFAULT_DURABLITY;
746 } else {
747 try {
748 this.durability = Durability.valueOf(Bytes.toString(durabilityValue));
749 } catch (IllegalArgumentException ex) {
750 LOG.warn("Received " + ex + " because Durability value for HTableDescriptor"
751 + " is not known. Durability:" + Bytes.toString(durabilityValue));
752 this.durability = DEFAULT_DURABLITY;
753 }
754 }
755 }
756 return this.durability;
757 }
758
759
760
761
762
763
764 public TableName getTableName() {
765 return name;
766 }
767
768
769
770
771
772
773
774 @Deprecated
775 public byte[] getName() {
776 return name.getName();
777 }
778
779
780
781
782
783
784 public String getNameAsString() {
785 return name.getNameAsString();
786 }
787
788
789
790
791
792
793
794 public HTableDescriptor setRegionSplitPolicyClassName(String clazz) {
795 setValue(SPLIT_POLICY, clazz);
796 return this;
797 }
798
799
800
801
802
803
804
805
806
807 public String getRegionSplitPolicyClassName() {
808 return getValue(SPLIT_POLICY);
809 }
810
811
812
813
814
815
816 @Deprecated
817 public HTableDescriptor setName(byte[] name) {
818 setName(TableName.valueOf(name));
819 return this;
820 }
821
822 @Deprecated
823 public HTableDescriptor setName(TableName name) {
824 this.name = name;
825 setMetaFlags(this.name);
826 return this;
827 }
828
829
830
831
832
833
834
835
836
837
838 public long getMaxFileSize() {
839 byte [] value = getValue(MAX_FILESIZE_KEY);
840 if (value != null) {
841 return Long.parseLong(Bytes.toString(value));
842 }
843 return -1;
844 }
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861 public HTableDescriptor setMaxFileSize(long maxFileSize) {
862 setValue(MAX_FILESIZE_KEY, Long.toString(maxFileSize));
863 return this;
864 }
865
866
867
868
869
870
871
872
873 public long getMemStoreFlushSize() {
874 byte [] value = getValue(MEMSTORE_FLUSHSIZE_KEY);
875 if (value != null) {
876 return Long.parseLong(Bytes.toString(value));
877 }
878 return -1;
879 }
880
881
882
883
884
885
886
887 public HTableDescriptor setMemStoreFlushSize(long memstoreFlushSize) {
888 setValue(MEMSTORE_FLUSHSIZE_KEY, Long.toString(memstoreFlushSize));
889 return this;
890 }
891
892
893
894
895
896
897
898 public HTableDescriptor setFlushPolicyClassName(String clazz) {
899 setValue(FLUSH_POLICY, clazz);
900 return this;
901 }
902
903
904
905
906
907
908
909
910 public String getFlushPolicyClassName() {
911 return getValue(FLUSH_POLICY);
912 }
913
914
915
916
917
918
919 public HTableDescriptor addFamily(final HColumnDescriptor family) {
920 if (family.getName() == null || family.getName().length <= 0) {
921 throw new IllegalArgumentException("Family name cannot be null or empty");
922 }
923 if (hasFamily(family.getName())) {
924 throw new IllegalArgumentException("Family '" +
925 family.getNameAsString() + "' already exists so cannot be added");
926 }
927 this.families.put(family.getName(), family);
928 return this;
929 }
930
931
932
933
934
935
936 public HTableDescriptor modifyFamily(final HColumnDescriptor family) {
937 if (family.getName() == null || family.getName().length <= 0) {
938 throw new IllegalArgumentException("Family name cannot be null or empty");
939 }
940 if (!hasFamily(family.getName())) {
941 throw new IllegalArgumentException("Column family '" + family.getNameAsString()
942 + "' does not exist");
943 }
944 this.families.put(family.getName(), family);
945 return this;
946 }
947
948
949
950
951
952
953 public boolean hasFamily(final byte [] familyName) {
954 return families.containsKey(familyName);
955 }
956
957
958
959
960
961
962 @Override
963 public String toString() {
964 StringBuilder s = new StringBuilder();
965 s.append('\'').append(Bytes.toString(name.getName())).append('\'');
966 s.append(getValues(true));
967 for (HColumnDescriptor f : families.values()) {
968 s.append(", ").append(f);
969 }
970 return s.toString();
971 }
972
973
974
975
976
977 public String toStringCustomizedValues() {
978 StringBuilder s = new StringBuilder();
979 s.append('\'').append(Bytes.toString(name.getName())).append('\'');
980 s.append(getValues(false));
981 for(HColumnDescriptor hcd : families.values()) {
982 s.append(", ").append(hcd.toStringCustomizedValues());
983 }
984 return s.toString();
985 }
986
987
988
989
990 public String toStringTableAttributes() {
991 return getValues(true).toString();
992 }
993
994 private StringBuilder getValues(boolean printDefaults) {
995 StringBuilder s = new StringBuilder();
996
997
998 Set<ImmutableBytesWritable> reservedKeys = new TreeSet<ImmutableBytesWritable>();
999 Set<ImmutableBytesWritable> userKeys = new TreeSet<ImmutableBytesWritable>();
1000 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> entry : values.entrySet()) {
1001 ImmutableBytesWritable k = entry.getKey();
1002 if (k == null || k.get() == null) continue;
1003 String key = Bytes.toString(k.get());
1004
1005 if (!RESERVED_KEYWORDS.contains(k) && !key.startsWith("coprocessor$")) {
1006 userKeys.add(k);
1007 continue;
1008 }
1009
1010 String value = Bytes.toString(entry.getValue().get());
1011 if (key.equalsIgnoreCase(IS_ROOT) || key.equalsIgnoreCase(IS_META)) {
1012 if (Boolean.valueOf(value) == false) continue;
1013 }
1014
1015 if (printDefaults
1016 || !DEFAULT_VALUES.containsKey(key)
1017 || !DEFAULT_VALUES.get(key).equalsIgnoreCase(value)) {
1018 reservedKeys.add(k);
1019 }
1020 }
1021
1022
1023 boolean hasAttributes = !reservedKeys.isEmpty() || !userKeys.isEmpty();
1024 if (!hasAttributes && configuration.isEmpty()) return s;
1025
1026 s.append(", {");
1027
1028 if (hasAttributes) {
1029 s.append("TABLE_ATTRIBUTES => {");
1030
1031
1032 boolean printCommaForAttr = false;
1033 for (ImmutableBytesWritable k : reservedKeys) {
1034 String key = Bytes.toString(k.get());
1035 String value = Bytes.toStringBinary(values.get(k).get());
1036 if (printCommaForAttr) s.append(", ");
1037 printCommaForAttr = true;
1038 s.append(key);
1039 s.append(" => ");
1040 s.append('\'').append(value).append('\'');
1041 }
1042
1043 if (!userKeys.isEmpty()) {
1044
1045 if (printCommaForAttr) s.append(", ");
1046 printCommaForAttr = true;
1047 s.append(HConstants.METADATA).append(" => ");
1048 s.append("{");
1049 boolean printCommaForCfg = false;
1050 for (ImmutableBytesWritable k : userKeys) {
1051 String key = Bytes.toString(k.get());
1052 String value = Bytes.toStringBinary(values.get(k).get());
1053 if (printCommaForCfg) s.append(", ");
1054 printCommaForCfg = true;
1055 s.append('\'').append(key).append('\'');
1056 s.append(" => ");
1057 s.append('\'').append(value).append('\'');
1058 }
1059 s.append("}");
1060 }
1061 }
1062
1063
1064 if (!configuration.isEmpty()) {
1065 if (hasAttributes) {
1066 s.append(", ");
1067 }
1068 s.append(HConstants.CONFIGURATION).append(" => ");
1069 s.append('{');
1070 boolean printCommaForConfig = false;
1071 for (Map.Entry<String, String> e : configuration.entrySet()) {
1072 if (printCommaForConfig) s.append(", ");
1073 printCommaForConfig = true;
1074 s.append('\'').append(e.getKey()).append('\'');
1075 s.append(" => ");
1076 s.append('\'').append(e.getValue()).append('\'');
1077 }
1078 s.append("}");
1079 }
1080 s.append("}");
1081 return s;
1082 }
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093 @Override
1094 public boolean equals(Object obj) {
1095 if (this == obj) {
1096 return true;
1097 }
1098 if (obj == null) {
1099 return false;
1100 }
1101 if (!(obj instanceof HTableDescriptor)) {
1102 return false;
1103 }
1104 return compareTo((HTableDescriptor)obj) == 0;
1105 }
1106
1107
1108
1109
1110
1111 @Override
1112 public int hashCode() {
1113 int result = this.name.hashCode();
1114 result ^= Byte.valueOf(TABLE_DESCRIPTOR_VERSION).hashCode();
1115 if (this.families != null && this.families.size() > 0) {
1116 for (HColumnDescriptor e: this.families.values()) {
1117 result ^= e.hashCode();
1118 }
1119 }
1120 result ^= values.hashCode();
1121 result ^= configuration.hashCode();
1122 return result;
1123 }
1124
1125
1126
1127
1128
1129
1130 @Deprecated
1131 @Override
1132 public void readFields(DataInput in) throws IOException {
1133 int version = in.readInt();
1134 if (version < 3)
1135 throw new IOException("versions < 3 are not supported (and never existed!?)");
1136
1137 name = TableName.valueOf(Bytes.readByteArray(in));
1138 setRootRegion(in.readBoolean());
1139 setMetaRegion(in.readBoolean());
1140 values.clear();
1141 configuration.clear();
1142 int numVals = in.readInt();
1143 for (int i = 0; i < numVals; i++) {
1144 ImmutableBytesWritable key = new ImmutableBytesWritable();
1145 ImmutableBytesWritable value = new ImmutableBytesWritable();
1146 key.readFields(in);
1147 value.readFields(in);
1148 setValue(key, value);
1149 }
1150 families.clear();
1151 int numFamilies = in.readInt();
1152 for (int i = 0; i < numFamilies; i++) {
1153 HColumnDescriptor c = new HColumnDescriptor();
1154 c.readFields(in);
1155 families.put(c.getName(), c);
1156 }
1157 if (version >= 7) {
1158 int numConfigs = in.readInt();
1159 for (int i = 0; i < numConfigs; i++) {
1160 ImmutableBytesWritable key = new ImmutableBytesWritable();
1161 ImmutableBytesWritable value = new ImmutableBytesWritable();
1162 key.readFields(in);
1163 value.readFields(in);
1164 configuration.put(
1165 Bytes.toString(key.get(), key.getOffset(), key.getLength()),
1166 Bytes.toString(value.get(), value.getOffset(), value.getLength()));
1167 }
1168 }
1169 }
1170
1171
1172
1173
1174
1175
1176
1177 @Deprecated
1178 @Override
1179 public void write(DataOutput out) throws IOException {
1180 out.writeInt(TABLE_DESCRIPTOR_VERSION);
1181 Bytes.writeByteArray(out, name.toBytes());
1182 out.writeBoolean(isRootRegion());
1183 out.writeBoolean(isMetaRegion());
1184 out.writeInt(values.size());
1185 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e:
1186 values.entrySet()) {
1187 e.getKey().write(out);
1188 e.getValue().write(out);
1189 }
1190 out.writeInt(families.size());
1191 for(Iterator<HColumnDescriptor> it = families.values().iterator();
1192 it.hasNext(); ) {
1193 HColumnDescriptor family = it.next();
1194 family.write(out);
1195 }
1196 out.writeInt(configuration.size());
1197 for (Map.Entry<String, String> e : configuration.entrySet()) {
1198 new ImmutableBytesWritable(Bytes.toBytes(e.getKey())).write(out);
1199 new ImmutableBytesWritable(Bytes.toBytes(e.getValue())).write(out);
1200 }
1201 }
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212 @Override
1213 public int compareTo(final HTableDescriptor other) {
1214 int result = this.name.compareTo(other.name);
1215 if (result == 0) {
1216 result = families.size() - other.families.size();
1217 }
1218 if (result == 0 && families.size() != other.families.size()) {
1219 result = Integer.compare(families.size(), other.families.size());
1220 }
1221 if (result == 0) {
1222 for (Iterator<HColumnDescriptor> it = families.values().iterator(),
1223 it2 = other.families.values().iterator(); it.hasNext(); ) {
1224 result = it.next().compareTo(it2.next());
1225 if (result != 0) {
1226 break;
1227 }
1228 }
1229 }
1230 if (result == 0) {
1231
1232 result = this.values.hashCode() - other.values.hashCode();
1233 if (result < 0)
1234 result = -1;
1235 else if (result > 0)
1236 result = 1;
1237 }
1238 if (result == 0) {
1239 result = this.configuration.hashCode() - other.configuration.hashCode();
1240 if (result < 0)
1241 result = -1;
1242 else if (result > 0)
1243 result = 1;
1244 }
1245 return result;
1246 }
1247
1248
1249
1250
1251
1252
1253
1254
1255 public Collection<HColumnDescriptor> getFamilies() {
1256 return Collections.unmodifiableCollection(this.families.values());
1257 }
1258
1259
1260
1261
1262 public int getRegionReplication() {
1263 return getIntValue(REGION_REPLICATION_KEY, DEFAULT_REGION_REPLICATION);
1264 }
1265
1266 private int getIntValue(ImmutableBytesWritable key, int defaultVal) {
1267 byte[] val = getValue(key);
1268 if (val == null || val.length == 0) {
1269 return defaultVal;
1270 }
1271 return Integer.parseInt(Bytes.toString(val));
1272 }
1273
1274
1275
1276
1277
1278 public HTableDescriptor setRegionReplication(int regionReplication) {
1279 setValue(REGION_REPLICATION_KEY,
1280 new ImmutableBytesWritable(Bytes.toBytes(Integer.toString(regionReplication))));
1281 return this;
1282 }
1283
1284
1285
1286
1287 public boolean hasRegionMemstoreReplication() {
1288 return isSomething(REGION_MEMSTORE_REPLICATION_KEY, DEFAULT_REGION_MEMSTORE_REPLICATION);
1289 }
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300 public HTableDescriptor setRegionMemstoreReplication(boolean memstoreReplication) {
1301 setValue(REGION_MEMSTORE_REPLICATION_KEY, memstoreReplication ? TRUE : FALSE);
1302
1303
1304 setConfiguration(RegionReplicaUtil.REGION_REPLICA_WAIT_FOR_PRIMARY_FLUSH_CONF_KEY,
1305 Boolean.toString(memstoreReplication));
1306 return this;
1307 }
1308
1309 public HTableDescriptor setPriority(int priority) {
1310 setValue(PRIORITY_KEY, Integer.toString(priority));
1311 return this;
1312 }
1313
1314 public int getPriority() {
1315 return getIntValue(PRIORITY_KEY, DEFAULT_PRIORITY);
1316 }
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326 public Set<byte[]> getFamiliesKeys() {
1327 return Collections.unmodifiableSet(this.families.keySet());
1328 }
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338 public HColumnDescriptor[] getColumnFamilies() {
1339 Collection<HColumnDescriptor> hColumnDescriptors = getFamilies();
1340 return hColumnDescriptors.toArray(new HColumnDescriptor[hColumnDescriptors.size()]);
1341 }
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352 public HColumnDescriptor getFamily(final byte [] column) {
1353 return this.families.get(column);
1354 }
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365 public HColumnDescriptor removeFamily(final byte [] column) {
1366 return this.families.remove(column);
1367 }
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379 public HTableDescriptor addCoprocessor(String className) throws IOException {
1380 addCoprocessor(className, null, Coprocessor.PRIORITY_USER, null);
1381 return this;
1382 }
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398 public HTableDescriptor addCoprocessor(String className, Path jarFilePath,
1399 int priority, final Map<String, String> kvs)
1400 throws IOException {
1401 checkHasCoprocessor(className);
1402
1403
1404 StringBuilder kvString = new StringBuilder();
1405 if (kvs != null) {
1406 for (Map.Entry<String, String> e: kvs.entrySet()) {
1407 if (!e.getKey().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_KEY_PATTERN)) {
1408 throw new IOException("Illegal parameter key = " + e.getKey());
1409 }
1410 if (!e.getValue().matches(HConstants.CP_HTD_ATTR_VALUE_PARAM_VALUE_PATTERN)) {
1411 throw new IOException("Illegal parameter (" + e.getKey() +
1412 ") value = " + e.getValue());
1413 }
1414 if (kvString.length() != 0) {
1415 kvString.append(',');
1416 }
1417 kvString.append(e.getKey());
1418 kvString.append('=');
1419 kvString.append(e.getValue());
1420 }
1421 }
1422
1423 String value = ((jarFilePath == null)? "" : jarFilePath.toString()) +
1424 "|" + className + "|" + Integer.toString(priority) + "|" +
1425 kvString.toString();
1426 return addCoprocessorToMap(value);
1427 }
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440 public HTableDescriptor addCoprocessorWithSpec(final String specStr) throws IOException {
1441 String className = getCoprocessorClassNameFromSpecStr(specStr);
1442 if (className == null) {
1443 throw new IllegalArgumentException("Format does not match " +
1444 HConstants.CP_HTD_ATTR_VALUE_PATTERN + ": " + specStr);
1445 }
1446 checkHasCoprocessor(className);
1447 return addCoprocessorToMap(specStr);
1448 }
1449
1450 private void checkHasCoprocessor(final String className) throws IOException {
1451 if (hasCoprocessor(className)) {
1452 throw new IOException("Coprocessor " + className + " already exists.");
1453 }
1454 }
1455
1456
1457
1458
1459
1460
1461
1462 private HTableDescriptor addCoprocessorToMap(final String specStr) {
1463 if (specStr == null) return this;
1464
1465 int maxCoprocessorNumber = 0;
1466 Matcher keyMatcher;
1467 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e:
1468 this.values.entrySet()) {
1469 keyMatcher =
1470 HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(
1471 Bytes.toString(e.getKey().get()));
1472 if (!keyMatcher.matches()) {
1473 continue;
1474 }
1475 maxCoprocessorNumber = Math.max(Integer.parseInt(keyMatcher.group(1)), maxCoprocessorNumber);
1476 }
1477 maxCoprocessorNumber++;
1478 String key = "coprocessor$" + Integer.toString(maxCoprocessorNumber);
1479 this.values.put(new ImmutableBytesWritable(Bytes.toBytes(key)),
1480 new ImmutableBytesWritable(Bytes.toBytes(specStr)));
1481 return this;
1482 }
1483
1484
1485
1486
1487
1488
1489
1490 public boolean hasCoprocessor(String classNameToMatch) {
1491 Matcher keyMatcher;
1492 Matcher valueMatcher;
1493 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e:
1494 this.values.entrySet()) {
1495 keyMatcher =
1496 HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(
1497 Bytes.toString(e.getKey().get()));
1498 if (!keyMatcher.matches()) {
1499 continue;
1500 }
1501 String className = getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));
1502 if (className == null) continue;
1503 if (className.equals(classNameToMatch.trim())) {
1504 return true;
1505 }
1506 }
1507 return false;
1508 }
1509
1510
1511
1512
1513
1514
1515 public List<String> getCoprocessors() {
1516 List<String> result = new ArrayList<String>();
1517 Matcher keyMatcher;
1518 Matcher valueMatcher;
1519 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e : this.values.entrySet()) {
1520 keyMatcher = HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e.getKey().get()));
1521 if (!keyMatcher.matches()) {
1522 continue;
1523 }
1524 String className = getCoprocessorClassNameFromSpecStr(Bytes.toString(e.getValue().get()));
1525 if (className == null) continue;
1526 result.add(className);
1527 }
1528 return result;
1529 }
1530
1531
1532
1533
1534
1535 private static String getCoprocessorClassNameFromSpecStr(final String spec) {
1536 Matcher matcher = HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(spec);
1537
1538 return matcher != null && matcher.matches()? matcher.group(2).trim(): null;
1539 }
1540
1541
1542
1543
1544
1545 public void removeCoprocessor(String className) {
1546 ImmutableBytesWritable match = null;
1547 Matcher keyMatcher;
1548 Matcher valueMatcher;
1549 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e : this.values
1550 .entrySet()) {
1551 keyMatcher = HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e
1552 .getKey().get()));
1553 if (!keyMatcher.matches()) {
1554 continue;
1555 }
1556 valueMatcher = HConstants.CP_HTD_ATTR_VALUE_PATTERN.matcher(Bytes
1557 .toString(e.getValue().get()));
1558 if (!valueMatcher.matches()) {
1559 continue;
1560 }
1561
1562 String clazz = valueMatcher.group(2).trim();
1563
1564 if (clazz.equals(className.trim())) {
1565 match = e.getKey();
1566 break;
1567 }
1568 }
1569
1570 if (match != null)
1571 remove(match);
1572 }
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584 @Deprecated
1585 public static Path getTableDir(Path rootdir, final byte [] tableName) {
1586
1587
1588 TableName name = TableName.valueOf(tableName);
1589 return new Path(rootdir, new Path(HConstants.BASE_NAMESPACE_DIR,
1590 new Path(name.getNamespaceAsString(), new Path(name.getQualifierAsString()))));
1591 }
1592
1593
1594
1595
1596
1597
1598 @Deprecated
1599 public static final HTableDescriptor META_TABLEDESC = new HTableDescriptor(
1600 TableName.META_TABLE_NAME,
1601 new HColumnDescriptor[] {
1602 new HColumnDescriptor(HConstants.CATALOG_FAMILY)
1603
1604 .setMaxVersions(HConstants.DEFAULT_HBASE_META_VERSIONS)
1605 .setInMemory(true)
1606 .setBlocksize(HConstants.DEFAULT_HBASE_META_BLOCK_SIZE)
1607 .setScope(HConstants.REPLICATION_SCOPE_LOCAL)
1608
1609 .setBloomFilterType(BloomType.NONE)
1610
1611
1612 .setCacheDataInL1(true)
1613 });
1614
1615 static {
1616 try {
1617 META_TABLEDESC.addCoprocessor(
1618 "org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint",
1619 null, Coprocessor.PRIORITY_SYSTEM, null);
1620 } catch (IOException ex) {
1621
1622 throw new RuntimeException(ex);
1623 }
1624 }
1625
1626 public final static String NAMESPACE_FAMILY_INFO = "info";
1627 public final static byte[] NAMESPACE_FAMILY_INFO_BYTES = Bytes.toBytes(NAMESPACE_FAMILY_INFO);
1628 public final static byte[] NAMESPACE_COL_DESC_BYTES = Bytes.toBytes("d");
1629
1630
1631 public static final HTableDescriptor NAMESPACE_TABLEDESC = new HTableDescriptor(
1632 TableName.NAMESPACE_TABLE_NAME,
1633 new HColumnDescriptor[] {
1634 new HColumnDescriptor(NAMESPACE_FAMILY_INFO)
1635
1636 .setMaxVersions(10)
1637 .setInMemory(true)
1638 .setBlocksize(8 * 1024)
1639 .setScope(HConstants.REPLICATION_SCOPE_LOCAL)
1640
1641
1642 .setCacheDataInL1(true)
1643 });
1644
1645
1646
1647
1648
1649 @Deprecated
1650 public HTableDescriptor setOwner(User owner) {
1651 return setOwnerString(owner != null ? owner.getShortName() : null);
1652 }
1653
1654
1655
1656
1657
1658
1659 @Deprecated
1660 public HTableDescriptor setOwnerString(String ownerString) {
1661 if (ownerString != null) {
1662 setValue(OWNER_KEY, ownerString);
1663 } else {
1664 remove(OWNER_KEY);
1665 }
1666 return this;
1667 }
1668
1669
1670
1671
1672
1673 @Deprecated
1674 public String getOwnerString() {
1675 if (getValue(OWNER_KEY) != null) {
1676 return Bytes.toString(getValue(OWNER_KEY));
1677 }
1678
1679
1680
1681 return null;
1682 }
1683
1684
1685
1686
1687
1688 public byte [] toByteArray() {
1689 return ProtobufUtil.prependPBMagic(convert().toByteArray());
1690 }
1691
1692
1693
1694
1695
1696
1697
1698
1699 public static HTableDescriptor parseFrom(final byte [] bytes)
1700 throws DeserializationException, IOException {
1701 if (!ProtobufUtil.isPBMagicPrefix(bytes)) {
1702 return (HTableDescriptor)Writables.getWritable(bytes, new HTableDescriptor());
1703 }
1704 int pblen = ProtobufUtil.lengthOfPBMagic();
1705 TableSchema.Builder builder = TableSchema.newBuilder();
1706 TableSchema ts;
1707 try {
1708 ProtobufUtil.mergeFrom(builder, bytes, pblen, bytes.length - pblen);
1709 ts = builder.build();
1710 return convert(ts);
1711 } catch (IOException | IllegalArgumentException e) {
1712
1713
1714 throw new DeserializationException(e);
1715 }
1716 }
1717
1718
1719
1720
1721
1722
1723 @Deprecated
1724 public TableSchema convert() {
1725 TableSchema.Builder builder = TableSchema.newBuilder();
1726 builder.setTableName(ProtobufUtil.toProtoTableName(getTableName()));
1727 for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e: this.values.entrySet()) {
1728 BytesBytesPair.Builder aBuilder = BytesBytesPair.newBuilder();
1729 aBuilder.setFirst(ByteStringer.wrap(e.getKey().get()));
1730 aBuilder.setSecond(ByteStringer.wrap(e.getValue().get()));
1731 builder.addAttributes(aBuilder.build());
1732 }
1733 for (HColumnDescriptor hcd: getColumnFamilies()) {
1734 builder.addColumnFamilies(hcd.convert());
1735 }
1736 for (Map.Entry<String, String> e : this.configuration.entrySet()) {
1737 NameStringPair.Builder aBuilder = NameStringPair.newBuilder();
1738 aBuilder.setName(e.getKey());
1739 aBuilder.setValue(e.getValue());
1740 builder.addConfiguration(aBuilder.build());
1741 }
1742 return builder.build();
1743 }
1744
1745
1746
1747
1748
1749 @Deprecated
1750 public static HTableDescriptor convert(final TableSchema ts) {
1751 List<ColumnFamilySchema> list = ts.getColumnFamiliesList();
1752 HColumnDescriptor [] hcds = new HColumnDescriptor[list.size()];
1753 int index = 0;
1754 for (ColumnFamilySchema cfs: list) {
1755 hcds[index++] = HColumnDescriptor.convert(cfs);
1756 }
1757 HTableDescriptor htd = new HTableDescriptor(
1758 ProtobufUtil.toTableName(ts.getTableName()),
1759 hcds);
1760 for (BytesBytesPair a: ts.getAttributesList()) {
1761 htd.setValue(a.getFirst().toByteArray(), a.getSecond().toByteArray());
1762 }
1763 for (NameStringPair a: ts.getConfigurationList()) {
1764 htd.setConfiguration(a.getName(), a.getValue());
1765 }
1766 return htd;
1767 }
1768
1769
1770
1771
1772 public String getConfigurationValue(String key) {
1773 return configuration.get(key);
1774 }
1775
1776
1777
1778
1779 public Map<String, String> getConfiguration() {
1780
1781 return Collections.unmodifiableMap(configuration);
1782 }
1783
1784
1785
1786
1787
1788
1789 public HTableDescriptor setConfiguration(String key, String value) {
1790 if (value == null || value.length() == 0) {
1791 removeConfiguration(key);
1792 } else {
1793 configuration.put(key, value);
1794 }
1795 return this;
1796 }
1797
1798
1799
1800
1801 public void removeConfiguration(final String key) {
1802 configuration.remove(key);
1803 }
1804
1805 public static HTableDescriptor metaTableDescriptor(final Configuration conf)
1806 throws IOException {
1807 HTableDescriptor metaDescriptor = new HTableDescriptor(
1808 TableName.META_TABLE_NAME,
1809 new HColumnDescriptor[] {
1810 new HColumnDescriptor(HConstants.CATALOG_FAMILY)
1811 .setMaxVersions(conf.getInt(HConstants.HBASE_META_VERSIONS,
1812 HConstants.DEFAULT_HBASE_META_VERSIONS))
1813 .setInMemory(true)
1814 .setBlocksize(conf.getInt(HConstants.HBASE_META_BLOCK_SIZE,
1815 HConstants.DEFAULT_HBASE_META_BLOCK_SIZE))
1816 .setScope(HConstants.REPLICATION_SCOPE_LOCAL)
1817
1818 .setBloomFilterType(BloomType.NONE)
1819 .setCacheDataInL1(true)
1820 });
1821 metaDescriptor.addCoprocessor(
1822 "org.apache.hadoop.hbase.coprocessor.MultiRowMutationEndpoint",
1823 null, Coprocessor.PRIORITY_SYSTEM, null);
1824 return metaDescriptor;
1825 }
1826
1827 }