@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writer.writeTo(channel, smoosher); } }
private void writeToVersionOne(WritableByteChannel channel) throws IOException { //null for the FileSmoosher means that we default to "version 1" of GenericIndexed. writer.writeTo(channel, null); } }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { Channels.writeFully(channel, ByteBuffer.wrap(new byte[]{version.asByte()})); if (version.compareTo(VERSION.COMPRESSED) >= 0) { channel.write(ByteBuffer.wrap(Ints.toByteArray(flags))); } if (dictionaryWriter != null) { dictionaryWriter.writeTo(channel, smoosher); } if (valueWriter != null) { valueWriter.writeTo(channel, smoosher); } if (bitmapIndexWriter != null) { bitmapIndexWriter.writeTo(channel, smoosher); } if (spatialIndexWriter != null) { spatialIndexWriter.writeTo(channel, smoosher); } } }
@Setup(Level.Trial) public void createGenericIndexed() throws IOException { GenericIndexedWriter<byte[]> genericIndexedWriter = new GenericIndexedWriter<>( new OffHeapMemorySegmentWriteOutMedium(), "genericIndexedBenchmark", byteArrayStrategy ); genericIndexedWriter.open(); // GenericIndexObject caches prevObject for comparison, so need two arrays for correct objectsSorted computation. ByteBuffer[] elements = new ByteBuffer[2]; elements[0] = ByteBuffer.allocate(elementSize); elements[1] = ByteBuffer.allocate(elementSize); for (int i = 0; i < n; i++) { ByteBuffer element = elements[i & 1]; element.putInt(0, i); genericIndexedWriter.write(element.array()); } smooshDir = Files.createTempDir(); file = File.createTempFile("genericIndexedBenchmark", "meta"); try (FileChannel fileChannel = FileChannel.open(file.toPath(), StandardOpenOption.CREATE, StandardOpenOption.WRITE); FileSmoosher fileSmoosher = new FileSmoosher(smooshDir)) { genericIndexedWriter.writeTo(fileChannel, fileSmoosher); } FileChannel fileChannel = FileChannel.open(file.toPath()); MappedByteBuffer byteBuffer = fileChannel.map(FileChannel.MapMode.READ_ONLY, 0, file.length()); genericIndexed = GenericIndexed.read(byteBuffer, byteArrayStrategy, SmooshedFileMapper.load(smooshDir)); }
private void writeToVersionOne(WritableByteChannel channel) throws IOException { //null for the FileSmoosher means that we default to "version 1" of GenericIndexed. writer.writeTo(channel, null); } }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writer.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { writeEndBuffer(); metaSerdeHelper.writeTo(channel, this); flattener.writeTo(channel, smoosher); }
@Override public void writeTo(WritableByteChannel channel, FileSmoosher smoosher) throws IOException { Channels.writeFully(channel, ByteBuffer.wrap(new byte[]{version.asByte()})); if (version.compareTo(VERSION.COMPRESSED) >= 0) { channel.write(ByteBuffer.wrap(Ints.toByteArray(flags))); } if (dictionaryWriter != null) { dictionaryWriter.writeTo(channel, smoosher); } if (valueWriter != null) { valueWriter.writeTo(channel, smoosher); } if (bitmapIndexWriter != null) { bitmapIndexWriter.writeTo(channel, smoosher); } if (spatialIndexWriter != null) { spatialIndexWriter.writeTo(channel, smoosher); } } }