本文整理汇总了Java中org.apache.flink.runtime.io.disk.SpillingBuffer类的典型用法代码示例。如果您正苦于以下问题:Java SpillingBuffer类的具体用法?Java SpillingBuffer怎么用?Java SpillingBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpillingBuffer类属于org.apache.flink.runtime.io.disk包,在下文中一共展示了SpillingBuffer类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SpillingResettableMutableObjectIterator
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
private SpillingResettableMutableObjectIterator(MutableObjectIterator<T> input, TypeSerializer<T> serializer,
MemoryManager memoryManager, IOManager ioManager,
List<MemorySegment> memory, boolean releaseMemOnClose)
{
this.memoryManager = memoryManager;
this.input = input;
this.serializer = serializer;
this.memorySegments = memory;
this.releaseMemoryOnClose = releaseMemOnClose;
if (LOG.isDebugEnabled()) {
LOG.debug("Creating spilling resettable iterator with " + memory.size() + " pages of memory.");
}
this.buffer = new SpillingBuffer(ioManager, new ListMemorySegmentSource(memory), memoryManager.getPageSize());
}
示例2: SpillingResettableIterator
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
private SpillingResettableIterator(Iterator<T> input, TypeSerializer<T> serializer,
MemoryManager memoryManager, IOManager ioManager,
List<MemorySegment> memory, boolean releaseMemOnClose)
{
this.memoryManager = memoryManager;
this.input = input;
this.instance = serializer.createInstance();
this.serializer = serializer;
this.memorySegments = memory;
this.releaseMemoryOnClose = releaseMemOnClose;
if (LOG.isDebugEnabled()) {
LOG.debug("Creating spilling resettable iterator with " + memory.size() + " pages of memory.");
}
this.buffer = new SpillingBuffer(ioManager, new ListMemorySegmentSource(memory), memoryManager.getPageSize());
}
示例3: run
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
@Override
public void run() {
final MutableObjectIterator<T> input = this.input;
final TypeSerializer<T> serializer = this.serializer;
final SpillingBuffer buffer = this.buffer;
try {
T record = serializer.createInstance();
while (this.running && ((record = input.next(record)) != null)) {
serializer.serialize(record, buffer);
}
TempBarrier.this.writingDone();
}
catch (Throwable t) {
TempBarrier.this.setException(t);
}
}
示例4: run
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
public void run() {
final MutableObjectIterator<T> input = this.input;
final TypeSerializer<T> serializer = this.serializer;
final SpillingBuffer buffer = this.buffer;
try {
T record = serializer.createInstance();
while (this.running && ((record = input.next(record)) != null)) {
serializer.serialize(record, buffer);
}
TempBarrier.this.writingDone();
}
catch (Throwable t) {
TempBarrier.this.setException(t);
}
}
示例5: TempBarrier
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
public TempBarrier(AbstractInvokable owner, MutableObjectIterator<T> input, TypeSerializerFactory<T> serializerFactory,
MemoryManager memManager, IOManager ioManager, int numPages) throws MemoryAllocationException
{
this.serializer = serializerFactory.getSerializer();
this.memManager = memManager;
this.memory = new ArrayList<MemorySegment>(numPages);
memManager.allocatePages(owner, this.memory, numPages);
this.buffer = new SpillingBuffer(ioManager, new ListMemorySegmentSource(this.memory), memManager.getPageSize());
this.tempWriter = new TempWritingThread(input, serializerFactory.getSerializer(), this.buffer);
}
示例6: TempWritingThread
import org.apache.flink.runtime.io.disk.SpillingBuffer; //导入依赖的package包/类
private TempWritingThread(MutableObjectIterator<T> input, TypeSerializer<T> serializer, SpillingBuffer buffer) {
super("Temp writer");
setDaemon(true);
this.input = input;
this.serializer = serializer;
this.buffer = buffer;
}