Skip to content

Commit

Permalink
TEZ-4523: Findbugs build is broken tez-tfile-parser. (#319) (Ayush Sa…
Browse files Browse the repository at this point in the history
…xena reviewed by Laszlo Bodor)
  • Loading branch information
ayushtkn authored Dec 4, 2023
1 parent 43562ad commit 0ed5e32
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
16 changes: 16 additions & 0 deletions tez-tools/tez-tfile-parser/findbugs-exclude.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!--
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License. See accompanying LICENSE file.
-->
<FindBugsFilter>

</FindBugsFilter>
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.io.EOFException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

/**
* Simple record reader which reads the TFile and emits it as key, value pair.
Expand Down Expand Up @@ -84,15 +85,15 @@ private void populateKV(TFile.Reader.Scanner.Entry entry) throws IOException {
//splitpath contains the machine name. Create the key as splitPath + realKey
String keyStr = new StringBuilder()
.append(splitPath.getName()).append(":")
.append(new String(keyBytesWritable.getBytes()))
.append(new String(keyBytesWritable.getBytes(), StandardCharsets.UTF_8))
.toString();

/**
* In certain cases, values can be huge (files > 2 GB). Stream is
* better to handle such scenarios.
*/
currentValueReader = new BufferedReader(
new InputStreamReader(entry.getValueStream()));
new InputStreamReader(entry.getValueStream(), StandardCharsets.UTF_8));
key.set(keyStr);
String line = currentValueReader.readLine();
value.set((line == null) ? "" : line);
Expand Down

0 comments on commit 0ed5e32

Please sign in to comment.