Skip to content

Commit 74e83ca

Browse files
author
吴炳亨
authoredDec 23, 2019
Merge pull request #281 from NigelWu95/dev
fix TextFileRandomReader and ProcessUtils.needBucketProcesses and rel…
2 parents b95fd1e + bdf8072 commit 74e83ca

File tree

6 files changed

+9
-7
lines changed

6 files changed

+9
-7
lines changed
 

‎pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.qiniu</groupId>
88
<artifactId>qsuits</artifactId>
9-
<version>8.3.4</version>
9+
<version>8.3.5</version>
1010
<name>qsuits</name>
1111
<description>qiniu-suits is a efficient tools for qiniu api implemented by java8.</description>
1212
<url>https://github.com/NigelWu95/qiniu-suits-java</url>

‎src/main/java/com/qiniu/datasource/TextContainer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public void export(ITextReader reader, IResultOutput saver, ILineProcess<T> proc
146146
if (retry == 0) throw e;
147147
}
148148
}
149-
if (srcList != null) statistics.addAndGet(srcList.size());
149+
statistics.addAndGet(srcList.size());
150150
convertedList = converter.convertToVList(srcList);
151151
if (converter.errorSize() > 0) saver.writeError(converter.errorLines(), false);
152152
if (stringConverter != null) {

‎src/main/java/com/qiniu/datasource/TextFileContainer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected ITextReader generateReader(String name) throws IOException {
6666
private List<ITextReader> splitSingleFile(File file) throws IOException {
6767
int lineSize = FileUtils.predictLineSize(file);
6868
long linesNumber = file.length() / lineSize;
69-
if (linesNumber < threads) {
69+
if (linesNumber < threads * 2) {
7070
return new ArrayList<ITextReader>(){{ add(new TextFileReader(file, null, unitLen)); }};
7171
}
7272
long avgLines = linesNumber / threads;

‎src/main/java/com/qiniu/datasource/TextFileRandomReader.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public TextFileRandomReader(String name, RandomAccessFile accessFile, String end
2828
this.end = "".equals(end) ? null : end;
2929
if (originalLine != null) {
3030
line = new String(originalLine.getBytes(StandardCharsets.ISO_8859_1));
31-
if (this.end != null && this.end.compareTo(line) >= 0) lineList.add(line);
31+
lineList.add(line);
3232
}
3333
}
3434

@@ -43,7 +43,9 @@ public List<String> readLines() throws IOException {
4343
List<String> srcList = new ArrayList<>(limit);
4444
srcList.addAll(lineList);
4545
lineList.clear();
46-
if (end != null) {
46+
if (line.equals(this.end)) {
47+
line = null;
48+
} else if (end != null) {
4749
while (true) {
4850
if (srcList.size() >= limit) {
4951
line = null;

‎src/main/java/com/qiniu/util/ProcessUtils.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ public final class ProcessUtils {
5757
add("qupload");
5858
add("mime");
5959
add("metadata");
60-
add("fetch");
6160
add("syncupload");
6261
}};
6362
public static Set<String> canBatchProcesses = new HashSet<String>(){{
@@ -100,6 +99,7 @@ public final class ProcessUtils {
10099
}};
101100
public static Set<String> needQiniuAuthProcesses = new HashSet<String>(){{
102101
addAll(qiniuProcessesWithBucket);
102+
add("fetch");
103103
add("asyncfetch");
104104
add("privateurl");
105105
add("imagecensor");

‎version.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
version=8.3.4
1+
version=8.3.5

0 commit comments

Comments
 (0)
Please sign in to comment.