Skip to content

Commit

Permalink
format issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Oct 28, 2023
1 parent bad98a2 commit 7524b88
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private static boolean verifyHash(byte[] hash, byte[] msg, SecretKey key) {
*/
public static String hashFromString(String enc_str, SecretKey key)
throws IOException {
return generateHash(enc_str.getBytes(StandardCharsets.UTF_8), key);
return generateHash(enc_str.getBytes(StandardCharsets.UTF_8), key);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;

import org.apache.hadoop.mapred.nativetask.NativeDataTarget;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,8 @@ public static PrintWriter createWriter(File dir, String prefix) throws IOExcepti
final File f = new File(dir,
prefix + dateFormat.format(new Date(System.currentTimeMillis())) + ".txt");
if (!f.exists())
return new PrintWriter(new OutputStreamWriter(new FileOutputStream(f), StandardCharsets.UTF_8));
return new PrintWriter(new OutputStreamWriter(
new FileOutputStream(f), StandardCharsets.UTF_8));

try {Thread.sleep(10);} catch (InterruptedException e) {}
}
Expand Down Expand Up @@ -310,13 +311,14 @@ static List<TaskResult> readJobOutputs(FileSystem fs, Path outdir) throws IOExce
static void writeResults(String name, List<TaskResult> results, FileSystem fs, String dir) throws IOException {
final Path outfile = new Path(dir, name + ".txt");
Util.out.println(name + "> writing results to " + outfile);
final PrintWriter out = new PrintWriter(new OutputStreamWriter(fs.create(outfile), StandardCharsets.UTF_8), true);
final PrintWriter printWriter = new PrintWriter(new OutputStreamWriter(
fs.create(outfile), StandardCharsets.UTF_8), true);
try {
for(TaskResult r : results)
out.println(r);
printWriter.println(r);
}
finally {
out.close();
printWriter.close();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.lang.reflect.Field;
import java.nio.charset.StandardCharsets;

import org.apache.commons.codec.Charsets;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.azurebfs.constants.ConfigurationKeys;
import org.apache.hadoop.fs.azurebfs.constants.TestConfigurationKeys;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
*/
package org.apache.hadoop.tools.rumen;

import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@ public void configure(JobConf job) {
inputFormatClassName.equals(TextInputFormat.class.getCanonicalName()));
}

mapOutputFieldSeparator = job.get("stream.map.output.field.separator", "\t").getBytes(StandardCharsets.UTF_8);
mapInputFieldSeparator = job.get("stream.map.input.field.separator", "\t").getBytes(StandardCharsets.UTF_8);
mapOutputFieldSeparator = job.get("stream.map.output.field.separator", "\t")
.getBytes(StandardCharsets.UTF_8);
mapInputFieldSeparator = job.get("stream.map.input.field.separator", "\t")
.getBytes(StandardCharsets.UTF_8);
numOfMapOutputKeyFields = job.getInt("stream.num.map.output.key.fields", 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@ public void configure(JobConf job) {
SkipBadRecords.setAutoIncrReducerProcCount(job, false);
skipping = job.getBoolean(MRJobConfig.SKIP_RECORDS, false);

reduceOutFieldSeparator = job_.get("stream.reduce.output.field.separator", "\t").getBytes(StandardCharsets.UTF_8);
reduceInputFieldSeparator = job_.get("stream.reduce.input.field.separator", "\t").getBytes(StandardCharsets.UTF_8);
reduceOutFieldSeparator = job_.get("stream.reduce.output.field.separator", "\t")
.getBytes(StandardCharsets.UTF_8);
reduceInputFieldSeparator = job_.get("stream.reduce.input.field.separator", "\t")
.getBytes(StandardCharsets.UTF_8);
this.numOfReduceOutputKeyFields = job_.getInt("stream.num.reduce.output.key.fields", 1);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.DataInput;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.nio.charset.CharacterCodingException;
import java.nio.charset.StandardCharsets;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package org.apache.hadoop.streaming.mapreduce;

import java.io.IOException;
import java.nio.charset.StandardCharsets;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -107,7 +108,7 @@ void numRecStats(byte[] record, int start, int len) throws IOException {
numRec_++;
if (numRec_ == nextStatusRec_) {
String recordStr = new String(record, start, Math.min(len,
statusMaxRecordChars_), "UTF-8");
statusMaxRecordChars_), StandardCharsets.UTF_8);
nextStatusRec_ += 100;// *= 10;
String status = getStatus(recordStr);
LOG.info(status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import java.io.PrintStream;
import java.io.PrintWriter;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Paths;
Expand Down

0 comments on commit 7524b88

Please sign in to comment.