@Override public void truncate(final long position) { if (position <= getCommitPosition()) { throw new IllegalArgumentException("Can't truncate position which is already committed"); } final long truncateAddress = getAddressForPosition(this, position); if (truncateAddress != INVALID_ADDRESS) { logStorage.truncate(truncateAddress); } else { throw new IllegalArgumentException( String.format("Truncation failed! Position %d was not found.", position)); } }
@Override public void truncate(final long position) { if (position <= getCommitPosition()) { throw new IllegalArgumentException("Can't truncate position which is already committed"); } final long truncateAddress = getAddressForPosition(this, position); if (truncateAddress != INVALID_ADDRESS) { logStorage.truncate(truncateAddress); } else { throw new IllegalArgumentException( String.format("Truncation failed! Position %d was not found.", position)); } }