作者:喻维伦_753 | 来源:互联网 | 2023-08-17 19:59
本文整理了Java中org.apache.lucene.store.ByteArrayDataOutput.writeVLong()方法的一些代码示例,展示了
本文整理了Java中org.apache.lucene.store.ByteArrayDataOutput.writeVLong()
方法的一些代码示例,展示了ByteArrayDataOutput.writeVLong()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ByteArrayDataOutput.writeVLong()
方法的具体详情如下:
包路径:org.apache.lucene.store.ByteArrayDataOutput
类名称:ByteArrayDataOutput
方法名:writeVLong
ByteArrayDataOutput.writeVLong介绍
暂无
代码示例
代码示例来源:origin: org.apache.lucene/lucene-codecs
private void encodeValues(int count) throws IOException {
out.reset(buffer);
long lastOrd = 0;
for (int i = 0; i long ord = ords.next().longValue();
out.writeVLong(ord - lastOrd);
lastOrd = ord;
}
}
代码示例来源:origin: harbby/presto-connectors
void add(long value, int docID) throws IOException {
if (valueCount >= maxValuesSortInHeap) {
if (writer == null) {
switchToOffline();
}
scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeLong(value);
scratchBytesOutput.writeVInt(docID);
scratchBytesOutput.writeVLong(valueCount);
writer.write(scratchBytes, 0, scratchBytes.length);
} else {
// Not too many points added yet, continue using heap:
heapWriter.append(value, valueCount, docID);
}
valueCount++;
globalMaxValue = Math.max(value, globalMaxValue);
globalMinValue = Math.min(value, globalMinValue);
}
代码示例来源:origin: harbby/presto-connectors
/** If the current segment has too many points then we switchover to temp files / offline sort. */
private void switchToOffline() throws IOException {
// For each .add we just append to this input file, then in .finish we sort this input and resursively build the tree:
tempInput = Files.createTempFile(OfflineSorter.getDefaultTempDir(), "in", "");
writer = new OfflineSorter.ByteSequencesWriter(tempInput);
for(int i=0;i scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeLong(heapWriter.values[i]);
scratchBytesOutput.writeVInt(heapWriter.docIDs[i]);
scratchBytesOutput.writeVLong(i);
// TODO: can/should OfflineSorter optimize the fixed-width case?
writer.write(scratchBytes, 0, scratchBytes.length);
}
heapWriter = null;
}
代码示例来源:origin: harbby/presto-connectors
/** If the current segment has too many points then we switchover to temp files / offline sort. */
private void switchToOffline() throws IOException {
// For each .add we just append to this input file, then in .finish we sort this input and resursively build the tree:
tempInput = Files.createTempFile(OfflineSorter.getDefaultTempDir(), "in", "");
writer = new OfflineSorter.ByteSequencesWriter(tempInput);
for(int i=0;i scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeInt(heapWriter.latEncs[i]);
scratchBytesOutput.writeInt(heapWriter.lonEncs[i]);
scratchBytesOutput.writeVInt(heapWriter.docIDs[i]);
scratchBytesOutput.writeVLong(i);
// TODO: can/should OfflineSorter optimize the fixed-width case?
writer.write(scratchBytes, 0, scratchBytes.length);
}
heapWriter = null;
}
代码示例来源:origin: harbby/presto-connectors
/** If the current segment has too many points then we switchover to temp files / offline sort. */
private void switchToOffline() throws IOException {
// For each .add we just append to this input file, then in .finish we sort this input and resursively build the tree:
tempInput = Files.createTempFile(OfflineSorter.getDefaultTempDir(), "in", "");
writer = new OfflineSorter.ByteSequencesWriter(tempInput);
for(int i=0;i scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeInt(heapWriter.xs[i]);
scratchBytesOutput.writeInt(heapWriter.ys[i]);
scratchBytesOutput.writeInt(heapWriter.zs[i]);
scratchBytesOutput.writeVInt(heapWriter.docIDs[i]);
scratchBytesOutput.writeVLong(i);
// TODO: can/should OfflineSorter optimize the fixed-width case?
writer.write(scratchBytes, 0, scratchBytes.length);
}
heapWriter = null;
}
代码示例来源:origin: harbby/presto-connectors
void add(int latEnc, int lonEnc, int docID) throws IOException {
assert latEnc > Integer.MIN_VALUE;
assert latEnc assert lonEnc > Integer.MIN_VALUE;
assert lonEnc if (pointCount >= maxPointsSortInHeap) {
if (writer == null) {
switchToOffline();
}
scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeInt(latEnc);
scratchBytesOutput.writeInt(lonEnc);
scratchBytesOutput.writeVInt(docID);
scratchBytesOutput.writeVLong(pointCount);
writer.write(scratchBytes, 0, scratchBytes.length);
} else {
// Not too many points added yet, continue using heap:
heapWriter.append(latEnc, lonEnc, pointCount, docID);
}
pointCount++;
}
代码示例来源:origin: harbby/presto-connectors
public void add(int x, int y, int z, int docID) throws IOException {
if (pointCount >= maxPointsSortInHeap) {
if (writer == null) {
switchToOffline();
}
scratchBytesOutput.reset(scratchBytes);
scratchBytesOutput.writeInt(x);
scratchBytesOutput.writeInt(y);
scratchBytesOutput.writeInt(z);
scratchBytesOutput.writeVInt(docID);
scratchBytesOutput.writeVLong(pointCount);
writer.write(scratchBytes, 0, scratchBytes.length);
} else {
// Not too many points added yet, continue using heap:
heapWriter.append(x, y, z, pointCount, docID);
}
pointCount++;
}