private static void endCommand(
            Config config,
            ManifestWorkspace workspace,
            Map<Path, Set<Row>> rowsByLocation
    ) throws IOException, TerseException {
        if (config.command == Command.LIST) {
            // end the table with an empty line to enable users to separate the table from the summary.
            config.out.println();
            rowsByLocation.remove(null);
            Set<Row> isolatedRows = rowsByLocation.values().stream().flatMap(Set::stream).collect(Collectors.toSet());
            long totalPlugins = isolatedRows.size();
            long loadablePlugins = isolatedRows.stream().filter(Row::loadable).count();
            long compatiblePlugins = isolatedRows.stream().filter(Row::compatible).count();
            config.out.printf("Total plugins:      \t%d%n", totalPlugins);
            config.out.printf("Loadable plugins:   \t%d%n", loadablePlugins);
            config.out.printf("Compatible plugins: \t%d%n", compatiblePlugins);
        } else if (config.command == Command.SYNC_MANIFESTS) {
            if (workspace.commit(true)) {
                if (config.dryRun) {
                    config.out.println("Dry run passed: All above changes can be committed to disk if re-run with dry run disabled.");
                } else {
                    config.out.println("Writing changes to plugins...");
                    try {
                        workspace.commit(false);
                    } catch (Throwable t) {
                        config.err.println(Utils.stackTrace(t));
                        throw new TerseException("Sync incomplete due to exception; plugin path may be corrupted. Discard the contents of the plugin.path before retrying.");
                    }
                    config.out.println("All loadable plugins have accurate ServiceLoader manifests.");
                }
            } else {
                config.out.println("No changes required.");
            }
        }
    }
The unit of work for a command.
<p>This is unique to the (source, class, type) tuple, and contains additional pre-computed information
that pertains to this specific plugin.
tools/src/main/java/org/apache/kafka/tools/ConnectPluginPath.java