You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2016/09/12 10:30:57 UTC

svn commit: r1760331 - in /qpid/java/trunk: bdbstore/bin/ bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml

Author: orudyy
Date: Mon Sep 12 10:30:57 2016
New Revision: 1760331

URL: http://svn.apache.org/viewvc?rev=1760331&view=rev
Log:
QPID-7411: [Java Broker] Remove backup.sh from bdbstore module

Removed:
    qpid/java/trunk/bdbstore/bin/
Modified:
    qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
    qpid/java/trunk/doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml

Modified: qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java
URL: http://svn.apache.org/viewvc/qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java?rev=1760331&r1=1760330&r2=1760331&view=diff
==============================================================================
--- qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java (original)
+++ qpid/java/trunk/bdbstore/systests/src/test/java/org/apache/qpid/server/store/berkeleydb/BDBBackupTest.java Mon Sep 12 10:30:57 2016
@@ -19,9 +19,7 @@
 package org.apache.qpid.server.store.berkeleydb;
 
 import java.io.File;
-import java.io.IOException;
 import java.util.Map;
-import java.util.concurrent.TimeUnit;
 
 import javax.jms.Connection;
 import javax.jms.Destination;
@@ -33,26 +31,20 @@ import javax.jms.Session;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import org.apache.qpid.server.configuration.BrokerProperties;
 import org.apache.qpid.server.model.VirtualHostNode;
 import org.apache.qpid.server.virtualhostnode.berkeleydb.BDBVirtualHostNode;
-import org.apache.qpid.test.utils.Piper;
 import org.apache.qpid.test.utils.QpidBrokerTestCase;
 import org.apache.qpid.util.FileUtils;
 import org.apache.qpid.util.Strings;
-import org.apache.qpid.util.SystemUtils;
 
 /**
- * Tests the BDB backup script can successfully perform a backup and that
+ * Tests the BDB backup can successfully perform a backup and that
  * backup can be restored and used by the Broker.
  */
 public class BDBBackupTest extends QpidBrokerTestCase
 {
     protected static final Logger LOGGER = LoggerFactory.getLogger(BDBBackupTest.class);
 
-    private static final String BACKUP_SCRIPT = "/bin/backup.sh";
-    private static final String BACKUP_COMPLETE_MESSAGE = "Hot Backup Completed";
-
     private static final String TEST_VHOST = "test";
     private static final String SYSTEM_TMP_DIR = System.getProperty("java.io.tmpdir");
 
@@ -139,48 +131,7 @@ public class BDBBackupTest extends QpidB
 
     private void invokeBdbBackup(final File backupFromDir, final File backupToDir) throws Exception
     {
-        if (SystemUtils.isWindows())
-        {
-            BDBBackup.main(new String[]{"-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath()});
-        }
-        else
-        {
-            runBdbBackupScript(backupFromDir, backupToDir);
-        }
-    }
-
-    private void runBdbBackupScript(final File backupFromDir, final File backupToDir) throws IOException,
-            InterruptedException
-    {
-        Process backupProcess = null;
-        try
-        {
-            String qpidHome = QPID_HOME;
-            ProcessBuilder pb = new ProcessBuilder(qpidHome + BACKUP_SCRIPT, "-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath());
-            pb.redirectErrorStream(true);
-            Map<String, String> env = pb.environment();
-            env.put(BrokerProperties.PROPERTY_QPID_HOME, qpidHome);
-
-            LOGGER.debug("Backup command is " + pb.command());
-            backupProcess = pb.start();
-            Piper piper = new Piper(backupProcess.getInputStream(),  null, BACKUP_COMPLETE_MESSAGE, "BACKUP", "");
-            piper.start();
-            piper.await(2, TimeUnit.SECONDS);
-            backupProcess.waitFor();
-            piper.join();
-
-            LOGGER.debug("Backup command completed " + backupProcess.exitValue());
-            assertEquals("Unexpected exit value from backup script", 0, backupProcess.exitValue());
-        }
-        finally
-        {
-            if (backupProcess != null)
-            {
-                backupProcess.getErrorStream().close();
-                backupProcess.getInputStream().close();
-                backupProcess.getOutputStream().close();
-            }
-        }
+        BDBBackup.main(new String[]{"-todir", backupToDir.getAbsolutePath(), "-fromdir", backupFromDir.getAbsolutePath()});
     }
 
     private void replaceStoreWithBackup(File source, File dst) throws Exception

Modified: qpid/java/trunk/doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml
URL: http://svn.apache.org/viewvc/qpid/java/trunk/doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml?rev=1760331&r1=1760330&r2=1760331&view=diff
==============================================================================
--- qpid/java/trunk/doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml (original)
+++ qpid/java/trunk/doc/java-broker/src/docbkx/Java-Broker-Backup-And-Recovery.xml Mon Sep 12 10:30:57 2016
@@ -41,39 +41,23 @@
       type.</para>
     <section xml:id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-BDB">
       <title>BDB</title>
-      <para>Qpid Broker distribution includes the "hot" backup utility <literal>backup.sh</literal>
-        which can be found at broker bin folder. This utility can perform the backup when broker is
-        running.</para>
-      <para><literal>backup.sh</literal> script invokes
-          <classname>org.apache.qpid.server.store.berkeleydb.BDBBackup</classname> to do the
-        job.</para>
-      <para>You can also run this class from command line like in an example below:</para>
+      <para>BDB module includes the "hot" backup utility <literal>org.apache.qpid.server.store.berkeleydb.BDBBackup</literal>.
+        This utility can perform the backup when broker is running.</para>
+      <para>You can run this class from command line like in an example below:</para>
       <example>
         <title>Performing store backup by using <classname>BDBBackup</classname> class
           directly</title>
         <cmdsynopsis>
           <command>java</command>
-          <arg choice="plain">-cp qpid-bdbstore-${project.version}.jar</arg>
-          <arg choice="plain">org.apache.qpid.server.store.berkeleydb.BDBBackup</arg>
+          <arg choice="plain">-cp <replaceable>"$QPID_HOME/lib/*"</replaceable></arg>
+          <arg choice="plain">org.apache.qpid.server.store.berkeleydb.BDBBackup \</arg>
           <sbr/>
           <arg choice="plain">-fromdir <replaceable>\${QPID_WORK}/&lt;nodename&gt;/config</replaceable></arg>
-          <arg choice="plain">-todir <replaceable>path/to/backup/folder</replaceable></arg>
-        </cmdsynopsis>
+          <arg choice="plain">-todir <replaceable>path/to/backup/folder</replaceable></arg></cmdsynopsis>
       </example>
-      <para>In the example above BDBBackup utility is called from
-        qpid-bdbstore-${project.version}.jar to backup the store at
+      <para>In the example above BDBBackup utility is called to backup the store at
           <literal>\${QPID_WORK}/&lt;nodename&gt;/config</literal> and copy store logs into
           <literal>path/to/backup/folder</literal>.</para>
-      <para>Linux and Unix users can take advantage of <literal>backup.sh</literal> bash script by
-        running this script in a similar way.</para>
-      <example>
-        <title>Performing store backup by using <classname>backup.sh</classname> bash script</title>
-        <cmdsynopsis>
-          <command>backup.sh</command>
-          <arg choice="plain">-fromdir <replaceable>\${QPID_WORK}/&lt;nodename&gt;/config</replaceable></arg>
-          <arg choice="plain">-todir <replaceable>path/to/backup/folder</replaceable></arg>
-        </cmdsynopsis>
-      </example>
     </section>
     <section xml:id="Java-Broker-Backup-And-Recovery-Virtualhost-Node-BDB-HA">
       <title>BDB-HA</title>



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org