spark core 2.0 MemoryBlock Soruce Code Analysis
2017-01-22 10:34
218 查看
MemoryBlock contains a consecutive block of memory, starting at a
MemoryLocation with a fixed size.
public class MemoryBlock extends MemoryLocation {
private final long length;
/**
* Optional page number; used when this MemoryBlock represents a page allocated by a
* TaskMemoryManager. This field is public so that it can be modified by the TaskMemoryManager,
* which lives in a different package.
*/
public int pageNumber = -1;
public MemoryBlock(@Nullable Object obj, long offset, long length) {
super(obj, offset);
this.length = length;
}
/**
* Returns the size in bytes of the memory block.
*/
public long size() {
return length;
}
/**
* Creates a memory block pointing to the memory used by the long array.
*/
public static MemoryBlock fromLongArray(final long[] array) {
return new MemoryBlock(array, Platform.LONG_ARRAY_OFFSET, array.length * 8L);
}
}
MemoryLocation with a fixed size.
public class MemoryBlock extends MemoryLocation {
private final long length;
/**
* Optional page number; used when this MemoryBlock represents a page allocated by a
* TaskMemoryManager. This field is public so that it can be modified by the TaskMemoryManager,
* which lives in a different package.
*/
public int pageNumber = -1;
public MemoryBlock(@Nullable Object obj, long offset, long length) {
super(obj, offset);
this.length = length;
}
/**
* Returns the size in bytes of the memory block.
*/
public long size() {
return length;
}
/**
* Creates a memory block pointing to the memory used by the long array.
*/
public static MemoryBlock fromLongArray(final long[] array) {
return new MemoryBlock(array, Platform.LONG_ARRAY_OFFSET, array.length * 8L);
}
}
相关文章推荐
- spark core 2.0 DiskBlockObjectWriter
- spark core 2.0 StorageMemoryPool
- spark core 2.0 ExecutionMemoryPool
- spark core 2.0 UnifiedMemoryManager
- Cocos Code IDE 2.0 BATE 创建游戏时注意事项
- Enterprise Library2.0(1):Data Access Application Block学习
- The Ultimate List of Open Source Static Code Analysis Security Tools
- Android Memory analysis tips --stackoverflow
- Codeforces Round #370 (Div. 2) D. Memory and Scores(DP)
- CodeFirst从零开始搭建Asp.Net Core2.0网站
- Enterprise Library 2.0 -- Caching Application Block
- [Revisit.SolidMCP] Porting from VS to GCC/CodeBlock
- Java Thread: retained memory analysis
- Linux MTD (Memory Technology Device) subsystem analysis -For Atheros char device
- Exercise 2: Suppressing Code Analysis Warnings
- Android knock code analysis
- CODE:BLOCK中的CreateProcess: No such file or directory
- Analysis of Haswell’s Transactional Memory
- 利用webservice和.net技术上传和下载文件--Sending files in chunks with MTOM Web Services and .NET 2.0 from:http://www.codeproject.com/soap/MTO