Search in sources :

Example 1 with PartitionId

use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.

the class PartitionCollector method addPartitions.

@Override
public void addPartitions(Collection<PartitionChannel> partitions) throws HyracksException {
    for (PartitionChannel pc : partitions) {
        PartitionId pid = pc.getPartitionId();
        IInputChannel channel = pc.getInputChannel();
        pa.addPartition(pid, channel);
        channel.open(ctx);
    }
}
Also used : PartitionChannel(org.apache.hyracks.api.comm.PartitionChannel) PartitionId(org.apache.hyracks.api.partitions.PartitionId) IInputChannel(org.apache.hyracks.api.channels.IInputChannel)

Example 2 with PartitionId

use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.

the class NonDeterministicChannelReader method notifyEndOfStream.

@Override
public synchronized void notifyEndOfStream(IInputChannel channel) {
    PartitionId pid = (PartitionId) channel.getAttachment();
    int senderIndex = pid.getSenderIndex();
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("EOS: " + pid);
    }
    eosSenders.set(senderIndex);
    notifyAll();
}
Also used : PartitionId(org.apache.hyracks.api.partitions.PartitionId)

Example 3 with PartitionId

use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.

the class NonDeterministicChannelReader method notifyFailure.

@Override
public synchronized void notifyFailure(IInputChannel channel) {
    PartitionId pid = (PartitionId) channel.getAttachment();
    int senderIndex = pid.getSenderIndex();
    if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.fine("Failure: " + pid.getConnectorDescriptorId() + " sender: " + senderIndex + " receiver: " + pid.getReceiverIndex());
    }
    failSenders.set(senderIndex);
    eosSenders.set(senderIndex);
    notifyAll();
}
Also used : PartitionId(org.apache.hyracks.api.partitions.PartitionId)

Example 4 with PartitionId

use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.

the class TaskProfile method toJSON.

@Override
public ObjectNode toJSON() {
    ObjectMapper om = new ObjectMapper();
    ObjectNode json = om.createObjectNode();
    json.put("activity-id", taskAttemptId.getTaskId().getActivityId().toString());
    json.put("partition", taskAttemptId.getTaskId().getPartition());
    json.put("attempt", taskAttemptId.getAttempt());
    if (partitionSendProfile != null) {
        ArrayNode pspArray = om.createArrayNode();
        for (PartitionProfile pp : partitionSendProfile.values()) {
            ObjectNode ppObj = om.createObjectNode();
            PartitionId pid = pp.getPartitionId();
            ObjectNode pidObj = om.createObjectNode();
            pidObj.put("job-id", pid.getJobId().toString());
            pidObj.put("connector-id", pid.getConnectorDescriptorId().toString());
            pidObj.put("sender-index", pid.getSenderIndex());
            pidObj.put("receiver-index", pid.getReceiverIndex());
            ppObj.set("partition-id", pidObj);
            ppObj.put("open-time", pp.getOpenTime());
            ppObj.put("close-time", pp.getCloseTime());
            MultiResolutionEventProfiler samples = pp.getSamples();
            ppObj.put("offset", samples.getOffset());
            int resolution = samples.getResolution();
            int sampleCount = samples.getCount();
            ArrayNode ftA = om.createArrayNode();
            int[] ft = samples.getSamples();
            for (int i = 0; i < sampleCount; ++i) {
                ftA.add(ft[i]);
            }
            ppObj.set("frame-times", ftA);
            ppObj.put("resolution", resolution);
            pspArray.add(ppObj);
        }
        json.set("partition-send-profile", pspArray);
    }
    populateCounters(json);
    return json;
}
Also used : MultiResolutionEventProfiler(org.apache.hyracks.control.common.job.profiling.counters.MultiResolutionEventProfiler) ObjectNode(com.fasterxml.jackson.databind.node.ObjectNode) ArrayNode(com.fasterxml.jackson.databind.node.ArrayNode) PartitionId(org.apache.hyracks.api.partitions.PartitionId) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 5 with PartitionId

use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.

the class CCNCFunctions method readPartitionId.

private static PartitionId readPartitionId(DataInputStream dis) throws IOException {
    long jobId = dis.readLong();
    int cdid = dis.readInt();
    int senderIndex = dis.readInt();
    int receiverIndex = dis.readInt();
    PartitionId pid = new PartitionId(new JobId(jobId), new ConnectorDescriptorId(cdid), senderIndex, receiverIndex);
    return pid;
}
Also used : ConnectorDescriptorId(org.apache.hyracks.api.dataflow.ConnectorDescriptorId) PartitionId(org.apache.hyracks.api.partitions.PartitionId) JobId(org.apache.hyracks.api.job.JobId)

Aggregations

PartitionId (org.apache.hyracks.api.partitions.PartitionId)22 PartitionRequest (org.apache.hyracks.control.common.job.PartitionRequest)6 ConnectorDescriptorId (org.apache.hyracks.api.dataflow.ConnectorDescriptorId)5 PartitionDescriptor (org.apache.hyracks.control.common.job.PartitionDescriptor)5 ArrayList (java.util.ArrayList)4 PartitionMatchMaker (org.apache.hyracks.control.cc.partitions.PartitionMatchMaker)4 List (java.util.List)3 Pair (org.apache.commons.lang3.tuple.Pair)3 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)2 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 PartitionChannel (org.apache.hyracks.api.comm.PartitionChannel)2 ActivityId (org.apache.hyracks.api.dataflow.ActivityId)2 TaskId (org.apache.hyracks.api.dataflow.TaskId)2 IConnectorPolicy (org.apache.hyracks.api.dataflow.connectors.IConnectorPolicy)2 JobId (org.apache.hyracks.api.job.JobId)2 IJobManager (org.apache.hyracks.control.cc.job.IJobManager)2 JobRun (org.apache.hyracks.control.cc.job.JobRun)2