-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2.3.0-preview1, see CHANGES.md for list of changes
- Loading branch information
1 parent
75c47b4
commit 47d3eaa
Showing
12 changed files
with
605 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/main/java/com/microsoft/azure/datalake/store/ReadBuffer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.microsoft.azure.datalake.store; | ||
|
||
|
||
import java.util.concurrent.CountDownLatch; | ||
|
||
/** | ||
* This object represents the buffer state as it is going through it's lifecycle. | ||
* The buffer (the byte array) itself is assigned to this object from a free pool, | ||
* so we do not create tons of objects in large object heap. | ||
*/ | ||
class ReadBuffer { | ||
ADLFileInputStream file; | ||
long offset; // offset within the file for the buffer | ||
int length; // actual length, set after the buffer is filles | ||
int requestedLength; // requested length of the read | ||
byte[] buffer; // the buffer itself | ||
int bufferindex = -1; // index in the buffers array in Buffer manager | ||
ReadBufferStatus status; // status of the buffer | ||
CountDownLatch latch = null; // signaled when the buffer is done reading, so any client | ||
// waiting on this buffer gets unblocked | ||
|
||
// fields to help with eviction logic | ||
long birthday = 0; // tick at which buffer became available to read | ||
boolean firstByteConsumed = false; | ||
boolean lastByteConsumed = false; | ||
boolean anyByteConsumed = false; | ||
} |
Oops, something went wrong.