I have code that's based on what I see in org.apache.crail.tools.CrailBenchmark. The subject file to be fetched is in crail DRAM and is 1GB in size.
String filename = "/G1.txt"; int bufsize = 1024*1024; CrailBuffer buf = OffHeapBuffer.wrap(ByteBuffer.allocateDirect(bufsize)); CrailFile file = cstore.lookup(filename).get().asFile(); CrailInputStream directStream = file.getDirectInputStream(file.getCapacity()); buf.clear(); CrailResult cr = directStream.read(buf).get(); long ret = cr.getLen(); ByteBuffer bb = buf.getByteBuffer(); bb.flip(); int rem = bb.remaining(); This works fine. But if I change the bufsize to, say, 2*1024*1024 the results are unexpected. ret is the expected 2*1024*1024 but rem is much less, and there is no Exception thrown. That is, it seems that the max buffer size is 1024*1024 bytes per read request? Please advise. Thanks. Lou.
