org.apache.flink.core.memory.MemorySegmentSource Java Examples

The following examples show how to use org.apache.flink.core.memory.MemorySegmentSource. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: HashPartition.java    From Flink-CEPplus with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new partition, initially in memory, with one buffer for the build side. The partition is
 * initialized to expect record insertions for the build side.
 * 
 * @param partitionNumber The number of the partition.
 * @param recursionLevel The recursion level - zero for partitions from the initial build, <i>n + 1</i> for
 *                       partitions that are created from spilled partition with recursion level <i>n</i>. 
 * @param initialBuffer The initial buffer for this partition.
 */
HashPartition(TypeSerializer<BT> buildSideAccessors, TypeSerializer<PT> probeSideAccessors,
		int partitionNumber, int recursionLevel, MemorySegment initialBuffer, MemorySegmentSource memSource,
		int segmentSize)
{
	super(0);
	
	this.buildSideSerializer = buildSideAccessors;
	this.probeSideSerializer = probeSideAccessors;
	this.partitionNumber = partitionNumber;
	this.recursionLevel = recursionLevel;
	
	this.memorySegmentSize = segmentSize;
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	
	this.overflowSegments = new MemorySegment[2];
	this.numOverflowSegments = 0;
	this.nextOverflowBucket = 0;
	
	this.buildSideWriteBuffer = new BuildSideBuffer(initialBuffer, memSource);
}
 
Example #2
Source File: HashPartition.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new partition, initially in memory, with one buffer for the build side. The partition is
 * initialized to expect record insertions for the build side.
 * 
 * @param partitionNumber The number of the partition.
 * @param recursionLevel The recursion level - zero for partitions from the initial build, <i>n + 1</i> for
 *                       partitions that are created from spilled partition with recursion level <i>n</i>. 
 * @param initialBuffer The initial buffer for this partition.
 */
HashPartition(TypeSerializer<BT> buildSideAccessors, TypeSerializer<PT> probeSideAccessors,
		int partitionNumber, int recursionLevel, MemorySegment initialBuffer, MemorySegmentSource memSource,
		int segmentSize)
{
	super(0);
	
	this.buildSideSerializer = buildSideAccessors;
	this.probeSideSerializer = probeSideAccessors;
	this.partitionNumber = partitionNumber;
	this.recursionLevel = recursionLevel;
	
	this.memorySegmentSize = segmentSize;
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	
	this.overflowSegments = new MemorySegment[2];
	this.numOverflowSegments = 0;
	this.nextOverflowBucket = 0;
	
	this.buildSideWriteBuffer = new BuildSideBuffer(initialBuffer, memSource);
}
 
Example #3
Source File: HashPartition.java    From flink with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new partition, initially in memory, with one buffer for the build side. The partition is
 * initialized to expect record insertions for the build side.
 * 
 * @param partitionNumber The number of the partition.
 * @param recursionLevel The recursion level - zero for partitions from the initial build, <i>n + 1</i> for
 *                       partitions that are created from spilled partition with recursion level <i>n</i>. 
 * @param initialBuffer The initial buffer for this partition.
 */
HashPartition(TypeSerializer<BT> buildSideAccessors, TypeSerializer<PT> probeSideAccessors,
		int partitionNumber, int recursionLevel, MemorySegment initialBuffer, MemorySegmentSource memSource,
		int segmentSize)
{
	super(0);
	
	this.buildSideSerializer = buildSideAccessors;
	this.probeSideSerializer = probeSideAccessors;
	this.partitionNumber = partitionNumber;
	this.recursionLevel = recursionLevel;
	
	this.memorySegmentSize = segmentSize;
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	
	this.overflowSegments = new MemorySegment[2];
	this.numOverflowSegments = 0;
	this.nextOverflowBucket = 0;
	
	this.buildSideWriteBuffer = new BuildSideBuffer(initialBuffer, memSource);
}
 
Example #4
Source File: SimpleCollectingOutputView.java    From flink with Apache License 2.0 5 votes vote down vote up
public SimpleCollectingOutputView(List<MemorySegment> fullSegmentTarget, 
								MemorySegmentSource memSource, int segmentSize)
{
	super(memSource.nextSegment(), segmentSize, 0);
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	this.fullSegments = fullSegmentTarget;
	this.memorySource = memSource;
	this.fullSegments.add(getCurrentSegment());
}
 
Example #5
Source File: ReOpenableHashPartition.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
ReOpenableHashPartition(TypeSerializer<BT> buildSideAccessors,
		TypeSerializer<PT> probeSideAccessors, int partitionNumber,
		int recursionLevel, MemorySegment initialBuffer,
		MemorySegmentSource memSource, int segmentSize) {
	super(buildSideAccessors, probeSideAccessors, partitionNumber, recursionLevel,
			initialBuffer, memSource, segmentSize);
}
 
Example #6
Source File: SpillingBuffer.java    From flink with Apache License 2.0 5 votes vote down vote up
public SpillingBuffer(IOManager ioManager, MemorySegmentSource memSource, int segmentSize) {
	super(memSource.nextSegment(), segmentSize, 0);
	
	this.fullSegments = new ArrayList<MemorySegment>(16);
	this.memorySource = memSource;
	this.ioManager = ioManager;
}
 
Example #7
Source File: InMemoryPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private WriteView(ArrayList<MemorySegment> pages, MemorySegmentSource memSource,
		int pageSize, int pageSizeBits)
{
	super(pages.get(0), pageSize, 0);
	
	this.pages = pages;
	this.memSource = memSource;
	this.sizeBits = pageSizeBits;
	this.sizeMask = pageSize - 1;
	this.segmentNumberOffset = 0;
}
 
Example #8
Source File: HashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private BuildSideBuffer(MemorySegment initialSegment, MemorySegmentSource memSource) {
	super(initialSegment, initialSegment.size(), 0);
	
	this.targetList = new ArrayList<MemorySegment>();
	this.memSource = memSource;
	this.sizeBits = MathUtils.log2strict(initialSegment.size());
}
 
Example #9
Source File: ReOpenableHashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
ReOpenableHashPartition(TypeSerializer<BT> buildSideAccessors,
		TypeSerializer<PT> probeSideAccessors, int partitionNumber,
		int recursionLevel, MemorySegment initialBuffer,
		MemorySegmentSource memSource, int segmentSize) {
	super(buildSideAccessors, probeSideAccessors, partitionNumber, recursionLevel,
			initialBuffer, memSource, segmentSize);
}
 
Example #10
Source File: BinaryHashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private BuildSideBuffer(MemorySegment initialSegment, MemorySegmentSource memSource) {
	super(initialSegment, initialSegment.size(), 0);

	this.memSource = memSource;
	this.sizeBits = MathUtils.log2strict(initialSegment.size());
	this.targetList = new ArrayList<>();
	this.buildStageSegments = new ArrayList<>();
	this.buildStageSegments.add(initialSegment);
	this.buildStageInputView = new RandomAccessInputView(
			buildStageSegments, initialSegment.size());
}
 
Example #11
Source File: SimpleCollectingOutputView.java    From flink with Apache License 2.0 5 votes vote down vote up
public SimpleCollectingOutputView(List<MemorySegment> fullSegmentTarget, 
								MemorySegmentSource memSource, int segmentSize)
{
	super(memSource.nextSegment(), segmentSize, 0);
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	this.fullSegments = fullSegmentTarget;
	this.memorySource = memSource;
	this.fullSegments.add(getCurrentSegment());
}
 
Example #12
Source File: SpillingBuffer.java    From flink with Apache License 2.0 5 votes vote down vote up
public SpillingBuffer(IOManager ioManager, MemorySegmentSource memSource, int segmentSize) {
	super(memSource.nextSegment(), segmentSize, 0);
	
	this.fullSegments = new ArrayList<MemorySegment>(16);
	this.memorySource = memSource;
	this.ioManager = ioManager;
}
 
Example #13
Source File: InMemoryPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private WriteView(ArrayList<MemorySegment> pages, MemorySegmentSource memSource,
		int pageSize, int pageSizeBits)
{
	super(pages.get(0), pageSize, 0);
	
	this.pages = pages;
	this.memSource = memSource;
	this.sizeBits = pageSizeBits;
	this.sizeMask = pageSize - 1;
	this.segmentNumberOffset = 0;
}
 
Example #14
Source File: HashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private BuildSideBuffer(MemorySegment initialSegment, MemorySegmentSource memSource) {
	super(initialSegment, initialSegment.size(), 0);
	
	this.targetList = new ArrayList<MemorySegment>();
	this.memSource = memSource;
	this.sizeBits = MathUtils.log2strict(initialSegment.size());
}
 
Example #15
Source File: ReOpenableHashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
ReOpenableHashPartition(TypeSerializer<BT> buildSideAccessors,
		TypeSerializer<PT> probeSideAccessors, int partitionNumber,
		int recursionLevel, MemorySegment initialBuffer,
		MemorySegmentSource memSource, int segmentSize) {
	super(buildSideAccessors, probeSideAccessors, partitionNumber, recursionLevel,
			initialBuffer, memSource, segmentSize);
}
 
Example #16
Source File: BinaryHashPartition.java    From flink with Apache License 2.0 5 votes vote down vote up
private BuildSideBuffer(MemorySegment initialSegment, MemorySegmentSource memSource) {
	super(initialSegment, initialSegment.size(), 0);

	this.memSource = memSource;
	this.sizeBits = MathUtils.log2strict(initialSegment.size());
	this.targetList = new ArrayList<>();
	this.buildStageSegments = new ArrayList<>();
	this.buildStageSegments.add(initialSegment);
	this.buildStageInputView = new RandomAccessInputView(
			buildStageSegments, initialSegment.size());
}
 
Example #17
Source File: SimpleCollectingOutputView.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public SimpleCollectingOutputView(List<MemorySegment> fullSegmentTarget, 
								MemorySegmentSource memSource, int segmentSize)
{
	super(memSource.nextSegment(), segmentSize, 0);
	this.segmentSizeBits = MathUtils.log2strict(segmentSize);
	this.fullSegments = fullSegmentTarget;
	this.memorySource = memSource;
	this.fullSegments.add(getCurrentSegment());
}
 
Example #18
Source File: SpillingBuffer.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
public SpillingBuffer(IOManager ioManager, MemorySegmentSource memSource, int segmentSize) {
	super(memSource.nextSegment(), segmentSize, 0);
	
	this.fullSegments = new ArrayList<MemorySegment>(16);
	this.memorySource = memSource;
	this.ioManager = ioManager;
}
 
Example #19
Source File: InMemoryPartition.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private WriteView(ArrayList<MemorySegment> pages, MemorySegmentSource memSource,
		int pageSize, int pageSizeBits)
{
	super(pages.get(0), pageSize, 0);
	
	this.pages = pages;
	this.memSource = memSource;
	this.sizeBits = pageSizeBits;
	this.sizeMask = pageSize - 1;
	this.segmentNumberOffset = 0;
}
 
Example #20
Source File: HashPartition.java    From Flink-CEPplus with Apache License 2.0 5 votes vote down vote up
private BuildSideBuffer(MemorySegment initialSegment, MemorySegmentSource memSource) {
	super(initialSegment, initialSegment.size(), 0);
	
	this.targetList = new ArrayList<MemorySegment>();
	this.memSource = memSource;
	this.sizeBits = MathUtils.log2strict(initialSegment.size());
}