You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/04/26 00:29:53 UTC

[kudu] branch master updated: [backup] Remove suffix default of “-restore”

This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git


The following commit(s) were added to refs/heads/master by this push:
     new 89edd31  [backup] Remove suffix default of “-restore”
89edd31 is described below

commit 89edd3150730478a1c3b864fa13a27831a0c1eea
Author: Grant Henke <gr...@apache.org>
AuthorDate: Thu Apr 25 12:51:34 2019 -0500

    [backup] Remove suffix default of “-restore”
    
    Users expect to restore the exact table they backed up.
    This patch changes the default restore table suffix to
    be an empty string.
    
    To maintain the old behavior pass the option:
    `—tableSuffix=“-restore”`
    
    Change-Id: I5afd092e3e0c7d27d4b2b3881f24f55884845595
    Reviewed-on: http://gerrit.cloudera.org:8080/13121
    Reviewed-by: Mike Percy <mp...@apache.org>
    Tested-by: Mike Percy <mp...@apache.org>
---
 .../src/main/scala/org/apache/kudu/backup/Options.scala            | 7 +++----
 .../src/test/scala/org/apache/kudu/backup/TestOptions.scala        | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/java/kudu-backup/src/main/scala/org/apache/kudu/backup/Options.scala b/java/kudu-backup/src/main/scala/org/apache/kudu/backup/Options.scala
index cea1bcc..b8e1a15 100644
--- a/java/kudu-backup/src/main/scala/org/apache/kudu/backup/Options.scala
+++ b/java/kudu-backup/src/main/scala/org/apache/kudu/backup/Options.scala
@@ -163,13 +163,12 @@ case class RestoreOptions(
     tables: Seq[String],
     rootPath: String,
     kuduMasterAddresses: String = InetAddress.getLocalHost.getCanonicalHostName,
-    tableSuffix: String = RestoreOptions.DefaultTableSuffix,
+    tableSuffix: String = "",
     createTables: Boolean = RestoreOptions.DefaultCreateTables,
     timestampMs: Long = System.currentTimeMillis()
 ) extends CommonOptions
 
 object RestoreOptions {
-  val DefaultTableSuffix: String = "-restore"
   val DefaultCreateTables: Boolean = true
 
   val ClassName: String = KuduRestore.getClass.getCanonicalName.dropRight(1) // Remove trailing `$`
@@ -196,8 +195,8 @@ object RestoreOptions {
 
       opt[String]("tableSuffix")
         .action((v, o) => o.copy(tableSuffix = v))
-        .text("The suffix to add to the restored table names. Only used when createTables is " +
-          "true. Default: " + DefaultTableSuffix)
+        .text("If set, the suffix to add to the restored table names. Only used when " +
+          "createTables is true.")
         .optional()
 
       opt[Long]("timestampMs")
diff --git a/java/kudu-backup/src/test/scala/org/apache/kudu/backup/TestOptions.scala b/java/kudu-backup/src/test/scala/org/apache/kudu/backup/TestOptions.scala
index 0eec6f1..ea5f053 100644
--- a/java/kudu-backup/src/test/scala/org/apache/kudu/backup/TestOptions.scala
+++ b/java/kudu-backup/src/test/scala/org/apache/kudu/backup/TestOptions.scala
@@ -54,7 +54,7 @@ class TestOptions extends KuduTestSuite {
         |  --kuduMasterAddresses <value>
         |                           Comma-separated addresses of Kudu masters. Default: localhost
         |  --createTables <value>   If true, create the tables during restore. Set to false if the target tables already exist. Default: true
-        |  --tableSuffix <value>    The suffix to add to the restored table names. Only used when createTables is true. Default: -restore
+        |  --tableSuffix <value>    If set, the suffix to add to the restored table names. Only used when createTables is true.
         |  --timestampMs <value>    A UNIX timestamp in milliseconds that defines the latest time to use when selecting restore candidates. Default: `System.currentTimeMillis()`
         |  --help                   prints this usage text
         |  <table>...               A list of tables to be restored.""".stripMargin