[ASTERIXDB-3463] Revert ASTERIXDB-3360
- user model changes: no
- storage format changes: no
- interface changes: no
Details:
Revert ASTERIXDB-3360 as it has caused several
issues. This can be revesited in the future and
can be eneabled again.
Ext-ref: MB-62736
Change-Id: I24b4e7bcd5790b04d0db7b3c2796ca09f0206040
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/18493
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Wail Alkowaileet <wael.y.k@gmail.com>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
index 90aacc7..c910131 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/bytes/stream/out/MultiPersistentBufferBytesOutputStream.java
@@ -38,12 +38,6 @@
@Override
protected void preReset() throws HyracksDataException {
if (allocatedBytes > 0) {
- /*
- * Ensure limit is set to current position and position is set to 0. This to ensure no unrelated bytes are
- * persisted to disk. Unrelated bytes are bytes that were in the ByteBuffer (when the column writer
- * confiscated it from the buffer cache) but those byte do not belong to the column that to be written.
- */
- currentBuf.flip();
//Persist all buffers before resetting the stream
multiPageOpRef.getValue().persist();
allocatedBytes = 0;
diff --git a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
index 1d8f684..ee12140 100644
--- a/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
+++ b/asterixdb/asterix-column/src/main/java/org/apache/asterix/column/values/writer/ColumnBatchWriter.java
@@ -94,10 +94,7 @@
}
// compute the final length
- int totalLength = nonKeyColumnStartOffset + columns.size();
- // reset to ensure the last buffer's position and limit are set appropriately
- columns.reset();
- return totalLength;
+ return nonKeyColumnStartOffset + columns.size();
}
@Override
diff --git a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
index 6bc85ff..86511d1 100644
--- a/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
+++ b/hyracks-fullstack/hyracks/hyracks-storage-common/src/main/java/org/apache/hyracks/storage/common/file/CompressedBufferedFileHandle.java
@@ -111,11 +111,7 @@
final long bytesWritten;
final long expectedBytesWritten;
- if (cPage.isLargePage()) {
- fixBufferPointers(uBuffer, 0);
- } else {
- uBuffer.position(0);
- }
+ fixBufferPointers(uBuffer, 0);
long offset;
if (compressToWriteBuffer(uBuffer, cBuffer) < bufferCache.getPageSize()) {
cBuffer.position(0);
@@ -125,8 +121,6 @@
} else {
// Compression did not gain any savings
final ByteBuffer[] buffers = header.prepareWrite(cPage);
- // Incompressible pages should be written entirely
- fixBufferPointers(buffers[1], 0);
offset = compressedFileManager.writePageInfo(pageId, bufferCache.getPageSizeWithHeader());
expectedBytesWritten = buffers[0].limit() + (long) buffers[1].limit();
bytesWritten = context.write(ioManager, handle, offset, buffers);