Repository: kudu
Updated Branches:
  refs/heads/master 0418b225e -> 34b058b8b


Add kudu-backup module to Maven build

Change Base64 encode/decode to java 7 compatible versions to fix sniffer
errors.

Change-Id: Ia1b34b733d8d85106060068e611be7eecc0717f2
Reviewed-on: http://gerrit.cloudera.org:8080/11059
Reviewed-by: Grant Henke <granthe...@apache.org>
Tested-by: Grant Henke <granthe...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/fb79471c
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/fb79471c
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/fb79471c

Branch: refs/heads/master
Commit: fb79471c26ddd5d325febd2d40456ca8e83b6f04
Parents: 0418b22
Author: Tony Foerster <t...@phdata.io>
Authored: Thu Jul 26 11:34:40 2018 -0500
Committer: Grant Henke <granthe...@apache.org>
Committed: Thu Jul 26 21:50:40 2018 +0000

----------------------------------------------------------------------
 java/kudu-backup/pom.xml                                    | 9 ++++++++-
 .../main/scala/org/apache/kudu/backup/TableMetadata.scala   | 8 ++++----
 java/pom.xml                                                | 1 +
 3 files changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/fb79471c/java/kudu-backup/pom.xml
----------------------------------------------------------------------
diff --git a/java/kudu-backup/pom.xml b/java/kudu-backup/pom.xml
index 7f0e1a5..37aefc4 100644
--- a/java/kudu-backup/pom.xml
+++ b/java/kudu-backup/pom.xml
@@ -116,6 +116,13 @@
             <scope>test</scope>
         </dependency>
         <dependency>
+            <groupId>org.apache.kudu</groupId>
+            <artifactId>kudu-client</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>${junit.version}</version>
@@ -162,7 +169,7 @@
                          
https://www.xolstice.org/protobuf-maven-plugin/usage.html -->
                     <checkStaleness>true</checkStaleness>
                     <protoSourceRoot>src/main/protobuf</protoSourceRoot>
-                    
<protocArtifact>com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier}</protocArtifact>
+                    
<protocArtifact>com.google.protobuf:protoc:${protobuf.version}:exe:${os.detected.classifier}</protocArtifact>
                 </configuration>
                 <executions>
                     <execution>

http://git-wip-us.apache.org/repos/asf/kudu/blob/fb79471c/java/kudu-backup/src/main/scala/org/apache/kudu/backup/TableMetadata.scala
----------------------------------------------------------------------
diff --git 
a/java/kudu-backup/src/main/scala/org/apache/kudu/backup/TableMetadata.scala 
b/java/kudu-backup/src/main/scala/org/apache/kudu/backup/TableMetadata.scala
index 9110e5f..9574943 100644
--- a/java/kudu-backup/src/main/scala/org/apache/kudu/backup/TableMetadata.scala
+++ b/java/kudu-backup/src/main/scala/org/apache/kudu/backup/TableMetadata.scala
@@ -17,13 +17,13 @@
 package org.apache.kudu.backup
 
 import java.math.BigDecimal
-import java.util.Base64
 
 import com.google.protobuf.StringValue
+import org.apache.commons.net.util.Base64
 import org.apache.kudu.backup.Backup._
 import org.apache.kudu.ColumnSchema.{ColumnSchemaBuilder, 
CompressionAlgorithm, Encoding}
 import org.apache.kudu.ColumnTypeAttributes.ColumnTypeAttributesBuilder
-import org.apache.kudu.client.{CreateTableOptions, KuduTable, PartialRow}
+import org.apache.kudu.client.{Bytes, CreateTableOptions, KuduTable, 
PartialRow}
 import org.apache.kudu.{ColumnSchema, Schema, Type}
 import org.apache.yetus.audience.{InterfaceAudience, InterfaceStability}
 
@@ -223,7 +223,7 @@ object TableMetadata {
       case Type.STRING =>
         value.asInstanceOf[String]
       case Type.BINARY =>
-        Base64.getEncoder.encodeToString(value.asInstanceOf[Array[Byte]])
+        Base64.encodeBase64String(value.asInstanceOf[Array[Byte]])
       case Type.DECIMAL =>
         value.asInstanceOf[BigDecimal].toString // TODO: Explicitly control 
print format
       case _ => throw new IllegalArgumentException(s"Unsupported column type: 
$colType")
@@ -240,7 +240,7 @@ object TableMetadata {
       case Type.FLOAT => value.toFloat
       case Type.DOUBLE => value.toDouble
       case Type.STRING => value
-      case Type.BINARY => Base64.getDecoder.decode(value)
+      case Type.BINARY => Base64.decodeBase64(value.asInstanceOf[Array[Byte]])
       case Type.DECIMAL => new BigDecimal(value) // TODO: Explicitly pass scale
       case _ => throw new IllegalArgumentException(s"Unsupported column type: 
$colType")
     }

http://git-wip-us.apache.org/repos/asf/kudu/blob/fb79471c/java/pom.xml
----------------------------------------------------------------------
diff --git a/java/pom.xml b/java/pom.xml
index 4dbe193..29958d6 100644
--- a/java/pom.xml
+++ b/java/pom.xml
@@ -105,6 +105,7 @@
     </properties>
 
     <modules>
+        <module>kudu-backup</module>
         <module>kudu-client-tools</module>
         <module>kudu-client</module>
         <module>kudu-flume-sink</module>

Reply via email to