@Test public void testDeleteFamilyVersionIsUnsupported() { byte[] rowKey = randomHelper.randomData("rk1-"); byte[] family = randomHelper.randomData("family1-"); long hbaseTimestamp = 1000L; Delete delete = new Delete(rowKey); delete.addFamilyVersion(family, hbaseTimestamp); expectedException.expect(UnsupportedOperationException.class); expectedException.expectMessage("Cannot perform column family deletion at timestamp"); deleteAdapter.adapt(delete, com.google.cloud.bigtable.data.v2.models.Mutation.create()); }
@Override public void adapt( Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation) { if (operation.getFamilyCellMap().isEmpty()) { throwIfUnsupportedDeleteRow(operation); mutation.deleteRow(); } else { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { ByteString familyByteString = ByteString.copyFrom(entry.getKey()); for (Cell cell : entry.getValue()) { if (isColumnDelete(cell) || isPointDelete(cell)) { if (isPointDelete(cell)) { throwIfUnsupportedPointDelete(cell); } addDeleteFromColumnMods(familyByteString, cell, mutation); } else if (isFamilyDelete(cell)) { throwIfUnsupportedDeleteFamily(cell); mutation.deleteFamily(familyByteString.toStringUtf8()); } else if (isFamilyVersionDelete(cell)) { throwOnUnsupportedDeleteFamilyVersion(cell); } else { throwOnUnsupportedCellType(cell); } } } } }
DeleteAdapter extends MutationAdapter<Delete> { @Override public void adapt( Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation) { if (operation.getFamilyCellMap().isEmpty()) { throwIfUnsupportedDeleteRow(operation); mutation.deleteRow(); } else { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { ByteString familyByteString = ByteString.copyFrom(entry.getKey()); for (Cell cell : entry.getValue()) { if (isColumnDelete(cell) || isPointDelete(cell)) { if (isPointDelete(cell)) { throwIfUnsupportedPointDelete(cell); } addDeleteFromColumnMods(familyByteString, cell, mutation); } else if (isFamilyDelete(cell)) { throwIfUnsupportedDeleteFamily(cell); mutation.deleteFamily(familyByteString.toStringUtf8()); } else if (isFamilyVersionDelete(cell)) { throwOnUnsupportedDeleteFamilyVersion(cell); } else { throwOnUnsupportedCellType(cell); } } } } } }
DeleteAdapter extends MutationAdapter<Delete> { @Override public void adapt( Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation) { if (operation.getFamilyCellMap().isEmpty()) { throwIfUnsupportedDeleteRow(operation); mutation.deleteRow(); } else { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { ByteString familyByteString = ByteString.copyFrom(entry.getKey()); for (Cell cell : entry.getValue()) { if (isColumnDelete(cell) || isPointDelete(cell)) { if (isPointDelete(cell)) { throwIfUnsupportedPointDelete(cell); } addDeleteFromColumnMods(familyByteString, cell, mutation); } else if (isFamilyDelete(cell)) { throwIfUnsupportedDeleteFamily(cell); mutation.deleteFamily(familyByteString.toStringUtf8()); } else if (isFamilyVersionDelete(cell)) { throwOnUnsupportedDeleteFamilyVersion(cell); } else { throwOnUnsupportedCellType(cell); } } } } }  }
DeleteAdapter extends MutationAdapter<Delete> { @Override public void adapt( Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation) { if (operation.getFamilyCellMap().isEmpty()) { throwIfUnsupportedDeleteRow(operation); mutation.deleteRow(); } else { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { ByteString familyByteString = ByteString.copyFrom(entry.getKey()); for (Cell cell : entry.getValue()) { if (isColumnDelete(cell) || isPointDelete(cell)) { if (isPointDelete(cell)) { throwIfUnsupportedPointDelete(cell); } addDeleteFromColumnMods(familyByteString, cell, mutation); } else if (isFamilyDelete(cell)) { throwIfUnsupportedDeleteFamily(cell); mutation.deleteFamily(familyByteString.toStringUtf8()); } else if (isFamilyVersionDelete(cell)) { throwOnUnsupportedDeleteFamilyVersion(cell); } else { throwOnUnsupportedCellType(cell); } } } } }  @Override void adapt(
      Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation); }
DeleteAdapter extends MutationAdapter<Delete> { @Override public void adapt( Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation) { if (operation.getFamilyCellMap().isEmpty()) { throwIfUnsupportedDeleteRow(operation); mutation.deleteRow(); } else { for (Map.Entry<byte[], List<Cell>> entry : operation.getFamilyCellMap().entrySet()) { ByteString familyByteString = ByteString.copyFrom(entry.getKey()); for (Cell cell : entry.getValue()) { if (isColumnDelete(cell) || isPointDelete(cell)) { if (isPointDelete(cell)) { throwIfUnsupportedPointDelete(cell); } addDeleteFromColumnMods(familyByteString, cell, mutation); } else if (isFamilyDelete(cell)) { throwIfUnsupportedDeleteFamily(cell); mutation.deleteFamily(familyByteString.toStringUtf8()); } else if (isFamilyVersionDelete(cell)) { throwOnUnsupportedDeleteFamilyVersion(cell); } else { throwOnUnsupportedCellType(cell); } } } } }  @Override void adapt(
      Delete operation, com.google.cloud.bigtable.data.v2.models.MutationApi<?> mutation);  }