code: public static void clipDBWithKeyGroupRange(
  		@Nonnull RocksDB db,
  		@Nonnull List<ColumnFamilyHandle> columnFamilyHandles,
  		@Nonnull KeyGroupRange targetKeyGroupRange,
  		@Nonnull KeyGroupRange currentKeyGroupRange,
  		@Nonnegative int keyGroupPrefixBytes) throws RocksDBException {
  
  		final byte[] beginKeyGroupBytes = new byte[keyGroupPrefixBytes];
  		final byte[] endKeyGroupBytes = new byte[keyGroupPrefixBytes];
  
  		if (currentKeyGroupRange.getStartKeyGroup() < targetKeyGroupRange.getStartKeyGroup()) {
  			RocksDBKeySerializationUtils.serializeKeyGroup(
  				currentKeyGroupRange.getStartKeyGroup(), beginKeyGroupBytes);
  			RocksDBKeySerializationUtils.serializeKeyGroup(
  				targetKeyGroupRange.getStartKeyGroup(), endKeyGroupBytes);
  			deleteRange(db, columnFamilyHandles, beginKeyGroupBytes, endKeyGroupBytes);
  		}
  
  		if (currentKeyGroupRange.getEndKeyGroup() > targetKeyGroupRange.getEndKeyGroup()) {
  			RocksDBKeySerializationUtils.serializeKeyGroup(
  				targetKeyGroupRange.getEndKeyGroup() + 1, beginKeyGroupBytes);
  			RocksDBKeySerializationUtils.serializeKeyGroup(
  				currentKeyGroupRange.getEndKeyGroup() + 1, endKeyGroupBytes);
  			deleteRange(db, columnFamilyHandles, beginKeyGroupBytes, endKeyGroupBytes);
  		}
  	}
docs: The method to clip the db instance according to the target key group range using
  the {@link RocksDB#delete(ColumnFamilyHandle, byte[])}.
  
  @param db the RocksDB instance to be clipped.
  @param columnFamilyHandles the column families in the db instance.
  @param targetKeyGroupRange the target key group range.
  @param currentKeyGroupRange the key group range of the db instance.
  @param keyGroupPrefixBytes Number of bytes required to prefix the key groups.