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();
}
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();
}
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;
}
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;
}
use of org.apache.hyracks.api.partitions.PartitionId in project asterixdb by apache.
the class PartitionManager method unregisterPartitions.
public synchronized void unregisterPartitions(JobId jobId, Collection<IPartition> unregisteredPartitions) {
for (Iterator<Map.Entry<PartitionId, List<IPartition>>> i = availablePartitionMap.entrySet().iterator(); i.hasNext(); ) {
Map.Entry<PartitionId, List<IPartition>> e = i.next();
PartitionId pid = e.getKey();
if (jobId.equals(pid.getJobId())) {
for (IPartition p : e.getValue()) {
unregisteredPartitions.add(p);
}
i.remove();
}
}
}
Aggregations