changeset 705:122560887a6a

NcDataBlockWriter bugfix
author Devel 2
date Tue, 28 Nov 2017 15:31:17 +0100
parents b5062e521212
children b6da092613be
files stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Tue Nov 28 14:44:14 2017 +0100
+++ b/stress-tester/src/main/java/com/passus/st/reader/nc/NcDataBlockWriter.java	Tue Nov 28 15:31:17 2017 +0100
@@ -159,8 +159,6 @@
     public void close() throws IOException {
         if (ch != null) {
             closeSegmentBlock();
-            openSegmentBlock();
-            closeSegmentBlock();
             flush();
 
             try {
@@ -199,7 +197,7 @@
         currentSegmentInfoPos = ch.position() + 1;
         buffer.put(NcSegmentBlock.TYPE);
         buffer.putLong(0L);
-        buffer.putLong(0L);
+        buffer.putLong(prevSegmentSize);
         buffer.putShort((short) 0);
         writeBuffer();
 
@@ -218,6 +216,7 @@
         currentSegmentsBlocks = -1;
         currentSegmentSize = -1;
         sessionIdMap.clear();
+        openSegmentBlock();
     }
 
     private void updateSegmentInfo(long size) throws IOException {