accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] keith-turner commented on a change in pull request #36: Factor out TestUtil from Import-Control
Date Mon, 11 Feb 2019 21:06:55 GMT
keith-turner commented on a change in pull request #36: Factor out TestUtil from Import-Control
URL: https://github.com/apache/accumulo-examples/pull/36#discussion_r255692664
 
 

 ##########
 File path: src/main/java/org/apache/accumulo/examples/mapreduce/bulk/BulkIngestExample.java
 ##########
 @@ -121,9 +120,15 @@ public static void main(String[] args) throws Exception {
       try (PrintStream out = new PrintStream(
           new BufferedOutputStream(fs.create(new Path(workDir + "/splits.txt"))))) {
         Collection<Text> splits = client.tableOperations().listSplits(SetupTable.tableName,
100);
-        for (Text split : splits)
-          out.println(Base64.getEncoder().encodeToString(TextUtil.getBytes(split)));
+        for (Text split : splits) {
+          byte[] bytes = split.getBytes();
+          if (bytes.length != split.getLength()) {
+            out.println(Base64.getEncoder().encodeToString(split.copyBytes()));
 
 Review comment:
   Even if this was not example this code does not need to be efficient because its called
once during map reduce setup.  The code is not calling for each key/value in the map reduce
job.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message