@@ -412,7 +412,7 @@ public static void testMultiCFDeleteFamilyImpl(Map.Entry<String, List<String>> e
412
412
hTable .close ();
413
413
}
414
414
415
- public static void testMultiCFDeleteFamilyVersionImpl (Map .Entry <String , List <String >> entry ) throws Exception {
415
+ public static void testMultiCFDeleteFamilyWithVersionImpl (Map .Entry <String , List <String >> entry ) throws Exception {
416
416
String key = "putKey" ;
417
417
String value = "value" ;
418
418
String column = "putColumn" ;
@@ -449,6 +449,43 @@ public static void testMultiCFDeleteFamilyVersionImpl(Map.Entry<String, List<Str
449
449
hTable .close ();
450
450
}
451
451
452
+ public static void testMultiCFDeleteFamilyVersionImpl (Map .Entry <String , List <String >> entry ) throws Exception {
453
+ String key = "putKey" ;
454
+ String value = "value" ;
455
+ String column = "putColumn" ;
456
+
457
+ long ts1 = System .currentTimeMillis ();
458
+ long ts2 = ts1 + 1000 ;
459
+ long ts3 = ts2 + 1000 ;
460
+ long ts4 = ts3 + 1000 ;
461
+ System .out .println ("ts1:" + ts1 + ", ts2:" + ts2 + ", ts3:" + ts3 + ", ts4:" + ts4 );
462
+ OHTableClient hTable = ObHTableTestUtil .newOHTableClient (entry .getKey ());
463
+ hTable .init ();
464
+ Put put = new Put (toBytes (key ));
465
+ Delete delete = new Delete (toBytes (key ));
466
+ for (String tableName : entry .getValue ()) {
467
+ String family = getColumnFamilyName (tableName );
468
+ put .addColumn (toBytes (family ), toBytes (column + family ), ts1 , toBytes (value + ts1 ));
469
+ put .addColumn (toBytes (family ), toBytes (column + family ), ts2 , toBytes (value + ts2 ));
470
+ put .addColumn (toBytes (family ), toBytes (column + family ), ts3 , toBytes (value + ts3 ));
471
+ put .addColumn (toBytes (family ), toBytes (column + family ), ts4 , toBytes (value + ts4 ));
472
+ delete .addFamilyVersion (toBytes (family ), ts2 );
473
+ }
474
+ hTable .put (put );
475
+ hTable .delete (delete );
476
+
477
+
478
+ Get get = new Get (toBytes (key ));
479
+ get .setMaxVersions ();
480
+ for (String tableName : entry .getValue ()) {
481
+ String family = getColumnFamilyName (tableName );
482
+ get .addColumn (toBytes (family ), toBytes (column + family ));
483
+ }
484
+ Result result = hTable .get (get );
485
+ Assert (entry .getValue (), ()->Assert .assertEquals (6 , result .size ()));
486
+ hTable .close ();
487
+ }
488
+
452
489
public static void testDeleteAllImpl (Map .Entry <String , List <String >> entry ) throws Exception {
453
490
String key = "putKey" ;
454
491
String value = "value" ;
@@ -530,6 +567,11 @@ public void testMultiCFDeleteFamily() throws Throwable {
530
567
FOR_EACH (group2tableNames , OHTableSecondaryPartDeleteTest ::testMultiCFDeleteFamilyImpl );
531
568
}
532
569
570
+ @ Test
571
+ public void testMultiCFDeleteFamilyWithVersion () throws Throwable {
572
+ FOR_EACH (group2tableNames , OHTableSecondaryPartDeleteTest ::testMultiCFDeleteFamilyWithVersionImpl );
573
+ }
574
+
533
575
@ Test
534
576
public void testMultiCFDeleteFamilyVersion () throws Throwable {
535
577
FOR_EACH (group2tableNames , OHTableSecondaryPartDeleteTest ::testMultiCFDeleteFamilyVersionImpl );
0 commit comments