Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ public static void writeDictionaryFromMeta(FileReader fileReader, String outfold
}
var ai = new AtomicInteger();
var entries = metaList.parallelStream()
.filter(meta -> !meta.containsProperty(GorMeta.HEADER_LINE_COUNT_KEY) || meta.getLineCount() > 0)
.filter(meta -> !meta.containsProperty(GorMeta.HEADER_LINE_COUNT_KEY) || meta.getLineCount() > 0L)
.map(meta -> {
var p = meta.getMetaPath();
// Assume we have all data in the root folder (note relatives does not work here for S3Shared).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,10 @@ object GeneralQueryHandler {
val metaPath = DataUtil.toFile(f, DataType.META)
val opt: Optional[String] = if (fileReader.exists(metaPath)) {
val meta = GorMeta.createAndLoad(fileReader, metaPath)
if (meta.getLineCount == -1) {
if (meta.getLineCount == -1L) {
val ret = dictRangeFromSeekRange(x._2, prefix)
Optional.of[String](ret)
} else if(meta.getLineCount > 0) {
} else if(meta.getLineCount > 0L) {
Optional.of[String](prefix + meta.getRange().formatAsTabDelimited())
} else {
Optional.empty()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ private void writeEntry(String chr, int pos, long filePos) throws IOException {
}
}

public static int loadVersion1(String line, BufferedReader reader, PositionCache pc) throws IOException {
int lineCount = 0;
public static long loadVersion1(String line, BufferedReader reader, PositionCache pc) throws IOException {
long lineCount = 0L;
while (line != null) {
String[] split = line.split("\t");
StringIntKey key = new StringIntKey(split[0], Integer.parseInt(split[1]));
Expand Down Expand Up @@ -162,7 +162,7 @@ void invoke() throws IOException {
break;
case VERSION2:
// Version 1 and 2 have same format
int lineCount = loadVersion1(line, reader, pc);
long lineCount = loadVersion1(line, reader, pc);
log.debug("{} lines read from index file", lineCount);
break;
default:
Expand Down
6 changes: 3 additions & 3 deletions model/src/main/java/org/gorpipe/gor/model/BaseMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,11 @@ public String getTags() {
return getProperty(HEADER_TAGS_KEY);
}

public int getLineCount() {
public long getLineCount() {
if (headerProps.containsKey(HEADER_LINE_COUNT_KEY)) {
return Integer.parseInt(headerProps.get(HEADER_LINE_COUNT_KEY));
return Long.parseLong(headerProps.get(HEADER_LINE_COUNT_KEY));
}
return -1;
return -1L;
}

public String[] getFileHeader() {
Expand Down
Loading