Skip to content

Commit ba32083

Browse files
Lee RhodesPraveenkumar Venkatesan
authored andcommitted
Changes to force
1 parent 0126a6c commit ba32083

4 files changed

Lines changed: 184 additions & 181 deletions

File tree

src/main/java/com/yahoo/sketches/memory/MemoryMappedFile.java

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,15 @@ public class MemoryMappedFile extends NativeMemory {
4545
public MemoryMappedFile(File file, long position, long len) throws Exception {
4646
super(0L, null, null);
4747

48-
if (position < 0L)
48+
if (position < 0L) {
4949
throw new IllegalArgumentException("Negative position");
50-
if (len < 0L)
50+
}
51+
if (len < 0L) {
5152
throw new IllegalArgumentException("Negative size");
52-
if (position + len < 0)
53+
}
54+
if (position + len < 0) {
5355
throw new IllegalArgumentException("Position + size overflow");
56+
}
5457

5558
this.randomAccessFile_ = new RandomAccessFile(file, "rw");
5659
this.fileChannel_ = randomAccessFile_.getChannel();
@@ -123,18 +126,18 @@ public boolean isLoaded() {
123126
}
124127

125128
/**
126-
*
127129
* Forces any changes made to this content to be written to the storage device
128130
* containing the mapped file.
129131
*
130-
* If the file mapped into this buffer resides on a local storage device then when this method
131-
* returns it is guaranteed that all changes made to the buffer since it was created,
132-
* or since this method was last invoked, will have been written to that device.
132+
* <p>If the file mapped into this buffer resides on a local storage device then when this
133+
* method returns it is guaranteed that all changes made to the buffer since it was created,
134+
* or since this method was last invoked, will have been written to that device.</p>
133135
*
134-
* If the file does not reside on a local device then no such guarantee is made.
136+
* <p>If the file does not reside on a local device then no such guarantee is made.</p>
135137
*
136-
* If this buffer was not mapped in read/write mode
138+
* <p>If this buffer was not mapped in read/write mode
137139
* (java.nio.channels.FileChannel.MapMode.READ_WRITE) then invoking this method has no effect.
140+
* </p>
138141
*
139142
* @see
140143
* <a href="https://docs.oracle.com/javase/8/docs/api/java/nio/MappedByteBuffer.html#force--">

0 commit comments

Comments
 (0)