You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/02/11 19:41:19 UTC
[GitHub] Manno15 commented on a change in pull request #36: Factor out
TestUtil from Import-Control
Manno15 commented on a change in pull request #36: Factor out TestUtil from Import-Control
URL: https://github.com/apache/accumulo-examples/pull/36#discussion_r255663221
##########
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:
I actually had that at one point because i figured the same thing but I assumed it would be best to match the code as much as possible as the previous. The textUtil getBytes() function had this form but I do realize now that you're right in that it prints twice.
----------------------------------------------------------------
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