Class Instances


  • @Loggable(2)
    public final class Instances
    extends Object
    Running instances of MySQL.

    The class is thread-safe.

    Since:
    0.1
    Suppressed Checkstyle violations:
    ClassDataAbstractionCoupling (500 lines), MultipleStringLiterals (500 lines)
    • Constructor Detail

      • Instances

        public Instances()
    • Method Detail

      • start

        public void start​(@NotNull
                          @NotNull Config config,
                          @NotNull
                          @NotNull File dist,
                          @NotNull
                          @NotNull File target,
                          boolean deldir,
                          File socket)
                   throws IOException
        Start a new one at this port.
        Parameters:
        config - Instance configuration
        dist - Path to MySQL distribution
        target - Where to keep temp data
        deldir - If existing DB should be deleted
        socket - Alternative socket location for mysql (may be null)
        Throws:
        IOException - If fails to start
        Suppressed Checkstyle violations:
        ParameterNumberCheck (10 lines)
      • stop

        public void stop​(int port)
        Stop a running one at this port.
        Parameters:
        port - The port to stop at
      • reusedExistingDatabase

        public boolean reusedExistingDatabase()
        Returns if a clean database had to be created. Note that this must be called after Instances#start(Config, File, File, boolean).
        Returns:
        If this is a clean database or could have been reused