作者:总是生活在记忆中_873 | 来源:互联网 | 2023-09-02 11:38
本文整理了Java中org.apache.hyracks.api.io.IIOManager.syncRead()
方法的一些代码示例,展示了IIOManager.syncRead()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。IIOManager.syncRead()
方法的具体详情如下:
包路径:org.apache.hyracks.api.io.IIOManager
类名称:IIOManager
方法名:syncRead
IIOManager.syncRead介绍
暂无
代码示例
代码示例来源:origin: apache/asterixdb
protected final long readToBuffer(ByteBuffer buf, long offset) throws HyracksDataException {
return ioManager.syncRead(fileHandle, offset, buf);
}
代码示例来源:origin: apache/asterixdb
public synchronized long read(long offset, ByteBuffer buffer) throws HyracksDataException {
long readSize = 0;
while (offset >= size && !eos.get() && !failed.get()) {
try {
wait();
} catch (InterruptedException e) {
throw HyracksDataException.create(e);
}
}
if ((offset >= size && eos.get()) || failed.get()) {
return readSize;
}
if (fileHandle == null) {
initReadFileHandle();
}
readSize = ioManager.syncRead(fileHandle, offset, buffer);
return readSize;
}
代码示例来源:origin: apache/asterixdb
initReadFileHandle();
readSize = ioManager.syncRead(fileHandle, offset, buffer);
if (readSize <0) {
throw new HyracksDataException("Premature end of file");
代码示例来源:origin: apache/asterixdb
while (true) {
buffer.clear();
long size = ioManager.syncRead(fh, offset, buffer);
if (size <0) {
break;
代码示例来源:origin: apache/asterixdb
@Override
public boolean nextFrame(IFrame frame) throws HyracksDataException {
if (readPtr >= size) {
return false;
}
frame.reset();
int readLength = ioManager.syncRead(handle, readPtr, frame.getBuffer());
if (readLength <= 0) {
throw new HyracksDataException("Premature end of file");
}
readPtr += readLength;
frame.ensureFrameSize(frame.getMinSize() * FrameHelper.deserializeNumOfMinFrame(frame.getBuffer()));
if (frame.getBuffer().hasRemaining()) {
if (readPtr readLength = ioManager.syncRead(handle, readPtr, frame.getBuffer());
if (readLength <0) {
throw new HyracksDataException("Premature end of file");
}
readPtr += readLength;
}
if (frame.getBuffer().hasRemaining()) { // file is vanished.
FrameHelper.clearRemainingFrame(frame.getBuffer(), frame.getBuffer().position());
}
}
frame.getBuffer().flip();
return true;
}
代码示例来源:origin: apache/asterixdb
long readLen = ioManager.syncRead(readHandle, offset, buffer);
if (readLen throw new HyracksDataException("Premature end of file");