public void modifyColumnFamilyRule ( ) { System . out . printf ( "%nUpdating column family %s GC rule%n" , COLUMN_FAMILY_1 ) ; // [START bigtable_update_gc_rule] // Updates the column family metadata to update the GC rule. // Updates a column family GC rule. VersionRule versionRule = GCRULES . maxVersions ( 1 ) ; try { // ModifyColumnFamiliesRequest can be used both for adding and modifying families, here it is // being used to modify a family // Updates column family with given GC rule. ModifyColumnFamiliesRequest updateRequest = ModifyColumnFamiliesRequest . of ( tableId ) . updateFamily ( COLUMN_FAMILY_1 , versionRule ) ; adminClient . modifyFamilies ( updateRequest ) ; System . out . printf ( "Column family %s GC rule updated%n" , COLUMN_FAMILY_1 ) ; } catch ( NotFoundException e ) { System . err . println ( "Failed to modify a non-existent column family: " + e . getMessage ( ) ) ; } // [END bigtable_update_gc_rule] }
Demonstrates how to modify a column family s rule .