class RowShardResolver {

    private final Function<List<String>, String> idFunction;
    private final List<Input<?>> primaryKeyInputs;
    private final Input<?> routingInput;
    private final Iterable<CollectExpression<Row, ?>> expressions;

    private String id;
    private String routing;
    private List<String> pkValues;
    private long autoGeneratedTimestamp = Translog.UNSET_AUTO_GENERATED_TIMESTAMP;
    private boolean setAutoGeneratedTimestamp;


    public RowShardResolver(TransactionContext txnCtx,
                            NodeContext nodeCtx,
                            List<ColumnIdent> pkColumns,
                            List<? extends Symbol> primaryKeySymbols,
                            @Nullable ColumnIdent clusteredByColumn,
                            @Nullable Symbol routingSymbol) {
        InputFactory inputFactory = new InputFactory(nodeCtx);
        InputFactory.Context<CollectExpression<Row, ?>> context = inputFactory.ctxForInputColumns(txnCtx);
        idFunction = Id.compileWithNullValidation(pkColumns, clusteredByColumn);
        setAutoGeneratedTimestamp = pkColumns.size() == 1 && pkColumns.get(0).equals(DocSysColumns.ID);
        if (routingSymbol == null) {
            routingInput = null;
        } else {
            routingInput = context.add(routingSymbol);
        }
        primaryKeyInputs = new ArrayList<>(primaryKeySymbols.size());
        for (Symbol primaryKeySymbol : primaryKeySymbols) {
            primaryKeyInputs.add(context.add(primaryKeySymbol));
        }
        expressions = context.expressions();
    }


    public void setNextRow(Row row) {<FILL_FUNCTION_BODY>}

    private static List<String> pkValues(List<Input<?>> primaryKeyInputs) {
        return Lists.map(primaryKeyInputs, input -> nullOrString(input.value()));
    }

    public long autoGeneratedTimestamp() {
        return autoGeneratedTimestamp;
    }

    public List<String> pkValues() {
        return pkValues;
    }

    /**
     * Returns the through collected inputs generated id
     */
    public String id() {
        return id;
    }

    /**
     * Returns the collected routing value (if available)
     */
    @Nullable
    public String routing() {
        return routing;
    }
}

        for (CollectExpression<Row, ?> expression : expressions) {
            expression.setNextRow(row);
        }
        if (setAutoGeneratedTimestamp) {
            autoGeneratedTimestamp = Math.max(0, System.currentTimeMillis());
        }
        pkValues = pkValues(primaryKeyInputs);
        id = idFunction.apply(pkValues);
        if (routingInput == null) {
            routing = null;
        } else {
            // If clustered by column is specified it cannot be null.
            var clusteredBy = routingInput.value();
            if (clusteredBy == null) {
                throw new IllegalArgumentException("Clustered by value must not be NULL");
            }
            routing = clusteredBy.toString();
        }
    
<no_super_class>