public static RecordsToDelete beforeOffset(long offset) {
        return new RecordsToDelete(offset);
    }
Delete all the records before the given {@code offset}

@param offset    the offset before which all records will be deleted
clients/src/main/java/org/apache/kafka/clients/admin/RecordsToDelete.java