tephra-hbase-compat-2.0-base/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java [216:253]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete,
      WALEdit edit, Durability durability) throws IOException {
    // Translate deletes into our own delete tombstones
    // Since HBase deletes cannot be undone, we need to translate deletes into special puts,
    // which allows
    // us to rollback the changes (by a real delete) if the transaction fails

    // Deletes that are part of a transaction rollback do not need special handling.
    // They will never be rolled back, so are performed as normal HBase deletes.
    if (isRollbackOperation(delete)) {
      return;
    }

    Transaction tx = getFromOperation(delete);
    ensureValidTxLifetime(e.getEnvironment(), delete, tx);

    // Other deletes are client-initiated and need to be translated into our own tombstones
    // TODO: this should delegate to the DeleteStrategy implementation.
    Put deleteMarkers = new Put(delete.getRow(), delete.getTimeStamp());
    for (byte[] family : delete.getFamilyCellMap().keySet()) {
      List<Cell> familyCells = delete.getFamilyCellMap().get(family);
      if (isFamilyDelete(familyCells)) {
        deleteMarkers.addColumn(family, TxConstants.FAMILY_DELETE_QUALIFIER,
          familyCells.get(0).getTimestamp(), HConstants.EMPTY_BYTE_ARRAY);
      } else {
        for (Cell cell : familyCells) {
          deleteMarkers.addColumn(family, CellUtil.cloneQualifier(cell), cell.getTimestamp(),
            HConstants.EMPTY_BYTE_ARRAY);
        }
      }
    }
    for (Map.Entry<String, byte[]> entry : delete.getAttributesMap().entrySet()) {
      deleteMarkers.setAttribute(entry.getKey(), entry.getValue());
    }
    e.getEnvironment().getRegion().put(deleteMarkers);
    // skip normal delete handling
    e.bypass();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tephra-hbase-compat-2.3/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java [216:253]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete,
      WALEdit edit, Durability durability) throws IOException {
    // Translate deletes into our own delete tombstones
    // Since HBase deletes cannot be undone, we need to translate deletes into special puts,
    // which allows
    // us to rollback the changes (by a real delete) if the transaction fails

    // Deletes that are part of a transaction rollback do not need special handling.
    // They will never be rolled back, so are performed as normal HBase deletes.
    if (isRollbackOperation(delete)) {
      return;
    }

    Transaction tx = getFromOperation(delete);
    ensureValidTxLifetime(e.getEnvironment(), delete, tx);

    // Other deletes are client-initiated and need to be translated into our own tombstones
    // TODO: this should delegate to the DeleteStrategy implementation.
    Put deleteMarkers = new Put(delete.getRow(), delete.getTimeStamp());
    for (byte[] family : delete.getFamilyCellMap().keySet()) {
      List<Cell> familyCells = delete.getFamilyCellMap().get(family);
      if (isFamilyDelete(familyCells)) {
        deleteMarkers.addColumn(family, TxConstants.FAMILY_DELETE_QUALIFIER,
          familyCells.get(0).getTimestamp(), HConstants.EMPTY_BYTE_ARRAY);
      } else {
        for (Cell cell : familyCells) {
          deleteMarkers.addColumn(family, CellUtil.cloneQualifier(cell), cell.getTimestamp(),
            HConstants.EMPTY_BYTE_ARRAY);
        }
      }
    }
    for (Map.Entry<String, byte[]> entry : delete.getAttributesMap().entrySet()) {
      deleteMarkers.setAttribute(entry.getKey(), entry.getValue());
    }
    e.getEnvironment().getRegion().put(deleteMarkers);
    // skip normal delete handling
    e.bypass();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



tephra-hbase-compat-2.4/src/main/java/org/apache/tephra/hbase/coprocessor/TransactionProcessor.java [216:253]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public void preDelete(ObserverContext<RegionCoprocessorEnvironment> e, Delete delete,
      WALEdit edit, Durability durability) throws IOException {
    // Translate deletes into our own delete tombstones
    // Since HBase deletes cannot be undone, we need to translate deletes into special puts,
    // which allows
    // us to rollback the changes (by a real delete) if the transaction fails

    // Deletes that are part of a transaction rollback do not need special handling.
    // They will never be rolled back, so are performed as normal HBase deletes.
    if (isRollbackOperation(delete)) {
      return;
    }

    Transaction tx = getFromOperation(delete);
    ensureValidTxLifetime(e.getEnvironment(), delete, tx);

    // Other deletes are client-initiated and need to be translated into our own tombstones
    // TODO: this should delegate to the DeleteStrategy implementation.
    Put deleteMarkers = new Put(delete.getRow(), delete.getTimeStamp());
    for (byte[] family : delete.getFamilyCellMap().keySet()) {
      List<Cell> familyCells = delete.getFamilyCellMap().get(family);
      if (isFamilyDelete(familyCells)) {
        deleteMarkers.addColumn(family, TxConstants.FAMILY_DELETE_QUALIFIER,
          familyCells.get(0).getTimestamp(), HConstants.EMPTY_BYTE_ARRAY);
      } else {
        for (Cell cell : familyCells) {
          deleteMarkers.addColumn(family, CellUtil.cloneQualifier(cell), cell.getTimestamp(),
            HConstants.EMPTY_BYTE_ARRAY);
        }
      }
    }
    for (Map.Entry<String, byte[]> entry : delete.getAttributesMap().entrySet()) {
      deleteMarkers.setAttribute(entry.getKey(), entry.getValue());
    }
    e.getEnvironment().getRegion().put(deleteMarkers);
    // skip normal delete handling
    e.bypass();
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



