Search in sources :

Example 1 with DatasetNetworkInputChannel

use of org.apache.hyracks.comm.channels.DatasetNetworkInputChannel in project asterixdb by apache.

the class HyracksDatasetReader method nextPartition.

private boolean nextPartition() throws HyracksDataException {
    ++lastReadPartition;
    try {
        DatasetDirectoryRecord record = getRecord(lastReadPartition);
        while (record.getEmpty() && (++lastReadPartition) < knownRecords.length) {
            record = getRecord(lastReadPartition);
        }
        if (lastReadPartition == knownRecords.length) {
            return false;
        }
        resultChannel = new DatasetNetworkInputChannel(netManager, getSocketAddress(record), jobId, resultSetId, lastReadPartition, NUM_READ_BUFFERS);
        lastMonitor = getMonitor(lastReadPartition);
        resultChannel.registerMonitor(lastMonitor);
        resultChannel.open(datasetClientCtx);
        return true;
    } catch (Exception e) {
        throw HyracksDataException.create(e);
    }
}
Also used : DatasetDirectoryRecord(org.apache.hyracks.api.dataset.DatasetDirectoryRecord) DatasetNetworkInputChannel(org.apache.hyracks.comm.channels.DatasetNetworkInputChannel) HyracksDataException(org.apache.hyracks.api.exceptions.HyracksDataException) UnknownHostException(java.net.UnknownHostException) HyracksException(org.apache.hyracks.api.exceptions.HyracksException)

Aggregations

UnknownHostException (java.net.UnknownHostException)1 DatasetDirectoryRecord (org.apache.hyracks.api.dataset.DatasetDirectoryRecord)1 HyracksDataException (org.apache.hyracks.api.exceptions.HyracksDataException)1 HyracksException (org.apache.hyracks.api.exceptions.HyracksException)1 DatasetNetworkInputChannel (org.apache.hyracks.comm.channels.DatasetNetworkInputChannel)1