@@ -42,10 +42,14 @@ public class TestSequenceIdAccounting {
4242
4343 private static final byte [] ENCODED_REGION_NAME = Bytes .toBytes ("r" );
4444 private static final byte [] FAMILY_NAME = Bytes .toBytes ("cf" );
45+ private static final byte [] META_FAMILY = Bytes .toBytes ("METAFAMILY" );
4546 private static final Set <byte []> FAMILIES ;
47+ private static final Set <byte []> META_FAMILY_SET ;
4648 static {
4749 FAMILIES = new HashSet <>();
4850 FAMILIES .add (FAMILY_NAME );
51+ META_FAMILY_SET = new HashSet <>();
52+ META_FAMILY_SET .add (META_FAMILY );
4953 }
5054
5155 @ Test
@@ -117,6 +121,20 @@ public void testAreAllLower() {
117121 sida .update (ENCODED_REGION_NAME , FAMILIES , ++sequenceid , true );
118122 sida .update (ENCODED_REGION_NAME , FAMILIES , ++sequenceid , true );
119123 assertTrue (sida .areAllLower (m ));
124+ m .put (ENCODED_REGION_NAME , sequenceid );
125+ assertFalse (sida .areAllLower (m ));
126+
127+ // Test the METAFAMILY is filtered in SequenceIdAccounting.lowestUnflushedSequenceIds
128+ SequenceIdAccounting meta_sida = new SequenceIdAccounting ();
129+ Map <byte [], Long > meta_m = new HashMap <>();
130+ meta_sida .getOrCreateLowestSequenceIds (ENCODED_REGION_NAME );
131+ meta_m .put (ENCODED_REGION_NAME , sequenceid );
132+ meta_sida .update (ENCODED_REGION_NAME , META_FAMILY_SET , ++sequenceid , true );
133+ meta_sida .update (ENCODED_REGION_NAME , META_FAMILY_SET , ++sequenceid , true );
134+ meta_sida .update (ENCODED_REGION_NAME , META_FAMILY_SET , ++sequenceid , true );
135+ assertTrue (meta_sida .areAllLower (meta_m ));
136+ meta_m .put (ENCODED_REGION_NAME , sequenceid );
137+ assertTrue (meta_sida .areAllLower (meta_m ));
120138 }
121139
122140 @ Test
0 commit comments