@Override public IFrameWriter createPartitioner(IHyracksTaskContext ctx, RecordDescriptor recordDesc, IPartitionWriterFactory edwFactory, int index, int nProducerPartitions, int nConsumerPartitions) throws HyracksDataException { return edwFactory.createFrameWriter(index); }
final boolean[] isOpen = new boolean[nConsumerPartitions]; for (int i = 0; i < nConsumerPartitions; ++i) { epWriters[i] = edwFactory.createFrameWriter(i);
protected void initializeAppenders(IPartitionWriterFactory pwFactory) throws HyracksDataException { for (int i = 0; i < consumerPartitionCount; ++i) { try { pWriters[i] = pwFactory.createFrameWriter(i); appenders[i] = createTupleAppender(ctx); } catch (IOException e) { throw HyracksDataException.create(e); } } }
@Override public IFrameWriter createFrameWriter(final int receiverIndex) throws HyracksDataException { final IFrameWriter writer = new ConnectorSenderProfilingFrameWriter(ctx, delegate.createFrameWriter(receiverIndex), cd.getConnectorId(), senderIndex, receiverIndex); return new IFrameWriter() { private long openTime;
public LocalityAwarePartitionDataWriter(IHyracksTaskContext ctx, IPartitionWriterFactory pwFactory, RecordDescriptor recordDescriptor, ITuplePartitionComputer tpc, int nConsumerPartitions, ILocalityMap localityMap, int senderIndex) throws HyracksDataException { int[] consumerPartitions = localityMap.getConsumers(senderIndex, nConsumerPartitions); pWriters = new IFrameWriter[consumerPartitions.length]; appenders = new IFrameTupleAppender[consumerPartitions.length]; isWriterOpen = new boolean[consumerPartitions.length]; for (int i = 0; i < consumerPartitions.length; ++i) { try { pWriters[i] = pwFactory.createFrameWriter(consumerPartitions[i]); appenders[i] = new FrameTupleAppender(); appenders[i].reset(new VSizeFrame(ctx), true); } catch (IOException e) { throw HyracksDataException.create(e); } } tupleAccessor = new FrameTupleAccessor(recordDescriptor); this.tpc = tpc; }