public static OperatorDescriptorId parse(String str) { if (str.startsWith("ODID:")) { str = str.substring(5); return new OperatorDescriptorId(Integer.parseInt(str)); } throw new IllegalArgumentException("Unable to parse: " + str); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ActivityId)) { return false; } ActivityId other = (ActivityId) o; return other.odId.equals(odId) && other.id == id; }
@Override public void readFields(DataInput input) throws IOException { odId = OperatorDescriptorId.create(input); id = input.readInt(); } }
public static OperatorDescriptorId create(DataInput dis) throws IOException { OperatorDescriptorId operatorDescriptorId = new OperatorDescriptorId(); operatorDescriptorId.readFields(dis); return operatorDescriptorId; }
if (lvalue.getTag() == ConstraintExpression.ExpressionTag.PARTITION_COUNT) { PartitionCountExpression count = (PartitionCountExpression) lvalue; if (count.getOperatorDescriptorId().equals(sourceOp.getOperatorId())) { source.append("\n").append(constraint); if (count.getOperatorDescriptorId().equals(destOp.getOperatorId())) { destination.append("\n").append(constraint); if (location.getOperatorDescriptorId().equals(sourceOp.getOperatorId())) { source.append("\n").append(constraint); if (location.getOperatorDescriptorId().equals(destOp.getOperatorId())) { destination.append("\n").append(constraint); graph.createNode(DotFormatBuilder.StringValue.of(sourceOp.getOperatorId().toString()), DotFormatBuilder.StringValue.of(sourceOp.toString() + "-" + source)); DotFormatBuilder.Node destinationNode = graph.createNode(DotFormatBuilder.StringValue.of(destOp.getOperatorId().toString()), DotFormatBuilder.StringValue.of(destOp.toString() + "-" + destination)); graph.createEdge(sourceNode, destinationNode).setLabel(DotFormatBuilder.StringValue.of(edgeLabel));
@Override protected void toString(StringBuilder buffer) { buffer.append(getTag()).append('(').append(opId.toString()).append(", ").append(partition).append(')'); }
@Override public String toString() { StringBuilder buffer = new StringBuilder(); opMap.forEach((key, value) -> { buffer.append(key.getId()).append(" : ").append(value.toString()).append("\n"); List<IConnectorDescriptor> inputs = opInputMap.get(key); if (inputs != null && !inputs.isEmpty()) { buffer.append(" Inputs:\n"); for (IConnectorDescriptor c : inputs) { buffer.append(" ").append(c.getConnectorId().getId()).append(" : ").append(c.toString()) .append("\n"); } } List<IConnectorDescriptor> outputs = opOutputMap.get(key); if (outputs != null && !outputs.isEmpty()) { buffer.append(" Outputs:\n"); for (IConnectorDescriptor c : outputs) { buffer.append(" ").append(c.getConnectorId().getId()).append(" : ").append(c.toString()) .append("\n"); } } }); buffer.append("\n").append("Constraints:\n").append(userConstraints); return buffer.toString(); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((opId == null) ? 0 : opId.hashCode()); result = prime * result + partition; return result; }
@Override protected void toString(StringBuilder buffer) { buffer.append(getTag()).append('(').append(opId.toString()).append(')'); }
private static void writeTaskAttemptId(DataOutputStream dos, TaskAttemptId taId) throws IOException { TaskId tid = taId.getTaskId(); ActivityId aid = tid.getActivityId(); OperatorDescriptorId odId = aid.getOperatorDescriptorId(); dos.writeInt(odId.getId()); dos.writeInt(aid.getLocalId()); dos.writeInt(tid.getPartition()); dos.writeInt(taId.getAttempt()); }
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((odId == null) ? 0 : odId.hashCode()); result = prime * result + partition; return result; }
@Override public OperatorDescriptorId createOperatorDescriptorId(IOperatorDescriptor op) { OperatorDescriptorId odId = new OperatorDescriptorId(operatorIdCounter++); op.setOperatorId(odId); opMap.put(odId, op); return odId; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PartitionCountExpression other = (PartitionCountExpression) obj; if (opId == null) { if (other.opId != null) return false; } else if (!opId.equals(other.opId)) return false; return true; } }
connectorOpMap.get(key); if (connection != null) { conn.put("in-operator-id", connection.getLeft().getLeft().getOperatorId().toString()); conn.put("in-operator-port", connection.getLeft().getRight().intValue()); conn.put("out-operator-id", connection.getRight().getLeft().getOperatorId().toString()); conn.put("out-operator-port", connection.getRight().getRight().intValue());
@Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((opId == null) ? 0 : opId.hashCode()); return result; }
private static TaskAttemptId readTaskAttemptId(DataInputStream dis) throws IOException { int odid = dis.readInt(); int aid = dis.readInt(); int partition = dis.readInt(); int attempt = dis.readInt(); TaskAttemptId taId = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(odid), aid), partition), attempt); return taId; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; OperatorInstanceId other = (OperatorInstanceId) obj; if (odId == null) { if (other.odId != null) return false; } else if (!odId.equals(other.odId)) return false; if (partition != other.partition) return false; return true; } }
@Override public int hashCode() { return odId.hashCode() + id; }
public static IHyracksTaskContext create(int frameSize, IOManager ioManager) { try { INCServiceContext serviceCtx = new TestNCServiceContext(ioManager, null); TestJobletContext jobletCtx = new TestJobletContext(frameSize, serviceCtx, new JobId(0)); TaskAttemptId tid = new TaskAttemptId(new TaskId(new ActivityId(new OperatorDescriptorId(0), 0), 0), 0); IHyracksTaskContext taskCtx = new TestTaskContext(jobletCtx, tid); return taskCtx; } catch (HyracksException e) { throw new RuntimeException(e); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; PartitionLocationExpression other = (PartitionLocationExpression) obj; if (opId == null) { if (other.opId != null) return false; } else if (!opId.equals(other.opId)) return false; if (partition != other.partition) return false; return true; } }