@@ -0,0 +1,2778 @@
+/*%0A * Copyright 2009-2010 by The Regents of the University of California%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * you may obtain a copy of the License from%0A * %0A *     http://www.apache.org/licenses/LICENSE-2.0%0A * %0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage edu.uci.ics.hyracks.dataflow.std.result;%0A%0Aimport java.nio.ByteBuffer;%0A%0Aimport edu.uci.ics.hyracks.api.comm.IFrameWriter;%0Aimport edu.uci.ics.hyracks.api.context.IHyracksTaskContext;%0Aimport edu.uci.ics.hyracks.api.dataflow.IOperatorNodePushable;%0Aimport edu.uci.ics.hyracks.api.dataflow.value.IRecordDescriptorProvider;%0Aimport edu.uci.ics.hyracks.api.dataset.IDatasetPartitionManager;%0Aimport edu.uci.ics.hyracks.api.exceptions.HyracksDataException;%0Aimport edu.uci.ics.hyracks.api.job.IOperatorDescriptorRegistry;%0Aimport edu.uci.ics.hyracks.api.job.JobId;%0Aimport edu.uci.ics.hyracks.dataflow.std.base.AbstractSingleActivityOperatorDescriptor;%0Aimport edu.uci.ics.hyracks.dataflow.std.base.AbstractUnaryInputSinkOperatorNodePushable;%0A%0Apublic class ResultWriterOperatorDescriptor extends AbstractSingleActivityOperatorDescriptor %7B%0A    private static final long serialVersionUID = 1L;%0A%0A    public ResultWriterOperatorDescriptor(IOperatorDescriptorRegistry spec) %7B%0A        super(spec, 1, 0);%0A    %7D%0A%0A    @Override%0A    public IOperatorNodePushable createPushRuntime(IHyracksTaskContext ctx,%0A            IRecordDescriptorProvider recordDescProvider, final int partition, final int nPartitions) %7B%0A        final JobId jobId = ctx.getJobletContext().getJobId();%0A        final IDatasetPartitionManager dpm = ctx.getDatasetPartitionManager();%0A%0A        return new AbstractUnaryInputSinkOperatorNodePushable() %7B%0A            IFrameWriter datasetPartitionWriter;%0A%0A            @Override%0A            public void open() throws HyracksDataException %7B%0A                datasetPartitionWriter = dpm.createDatasetPartitionWriter(jobId, partition, nPartitions);%0A            %7D%0A%0A            @Override%0A            public void nextFrame(ByteBuffer buffer) throws HyracksDataException %7B%0A                datasetPartitionWriter.nextFrame(buffer);%0A            %7D%0A%0A            @Override%0A            public void fail() throws HyracksDataException %7B%0A                datasetPartitionWriter.fail();%0A            %7D%0A%0A            @Override%0A            public void close() throws HyracksDataException %7B%0A                datasetPartitionWriter.close();%0A            %7D%0A        %7D;%0A    %7D%0A%7D

Implement a basic ResultWriterOperatorDescriptor.