Added get/set display name to Operators and Connectors
git-svn-id: https://hyracks.googlecode.com/svn/branches/hyracks_dev_next@1053 123451ca-8445-de46-9d55-352943316053
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IConnectorDescriptor.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IConnectorDescriptor.java
index ec8ab76..c816d26 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IConnectorDescriptor.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IConnectorDescriptor.java
@@ -44,7 +44,8 @@
public ConnectorDescriptorId getConnectorId();
/**
- * Factory method to create the send side writer that writes into this connector.
+ * Factory method to create the send side writer that writes into this
+ * connector.
*
* @param ctx
* Context
@@ -66,7 +67,8 @@
throws HyracksDataException;
/**
- * Factory metod to create the receive side reader that reads data from this connector.
+ * Factory metod to create the receive side reader that reads data from this
+ * connector.
*
* @param ctx
* Context
@@ -96,12 +98,23 @@
ICCApplicationContext appCtx);
/**
- * Indicate which consumer partitions may receive data from the given producer partition.
+ * Indicate which consumer partitions may receive data from the given
+ * producer partition.
*/
public void indicateTargetPartitions(int nProducerPartitions, int nConsumerPartitions, int producerIndex,
BitSet targetBitmap);
/**
+ * Gets the display name.
+ */
+ public String getDisplayName();
+
+ /**
+ * Sets the display name.
+ */
+ public void setDisplayName(String displayName);
+
+ /**
* Translate this connector descriptor to JSON.
*
* @return
diff --git a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IOperatorDescriptor.java b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IOperatorDescriptor.java
index 78847eb..c37a530 100644
--- a/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IOperatorDescriptor.java
+++ b/hyracks-api/src/main/java/edu/uci/ics/hyracks/api/dataflow/IOperatorDescriptor.java
@@ -59,7 +59,8 @@
public RecordDescriptor[] getOutputRecordDescriptors();
/**
- * Contributes the activity graph that describes the behavior of this operator.
+ * Contributes the activity graph that describes the behavior of this
+ * operator.
*
* @param builder
* - graph builder
@@ -78,6 +79,16 @@
ICCApplicationContext appCtx);
/**
+ * Gets the display name.
+ */
+ public String getDisplayName();
+
+ /**
+ * Sets the display name.
+ */
+ public void setDisplayName(String displayName);
+
+ /**
* Translates this operator descriptor to JSON.
*/
public JSONObject toJSON() throws JSONException;
diff --git a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractConnectorDescriptor.java b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractConnectorDescriptor.java
index 4ffc060..37154bc 100644
--- a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractConnectorDescriptor.java
+++ b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractConnectorDescriptor.java
@@ -28,21 +28,33 @@
private static final long serialVersionUID = 1L;
protected final ConnectorDescriptorId id;
+ protected String displayName;
+
public AbstractConnectorDescriptor(JobSpecification spec) {
this.id = spec.createConnectorDescriptor();
spec.getConnectorMap().put(id, this);
+ displayName = getClass().getName() + "[" + id + "]";
}
public ConnectorDescriptorId getConnectorId() {
return id;
}
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
@Override
public JSONObject toJSON() throws JSONException {
JSONObject jconn = new JSONObject();
jconn.put("id", getConnectorId().getId());
jconn.put("java-class", getClass().getName());
+ jconn.put("display-name", displayName);
return jconn;
}
diff --git a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
index 1bb13ca..1a60290 100644
--- a/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
+++ b/hyracks-dataflow-std/src/main/java/edu/uci/ics/hyracks/dataflow/std/base/AbstractOperatorDescriptor.java
@@ -38,12 +38,15 @@
protected final int outputArity;
+ protected String displayName;
+
public AbstractOperatorDescriptor(JobSpecification spec, int inputArity, int outputArity) {
odId = spec.createOperatorDescriptorId();
this.inputArity = inputArity;
this.outputArity = outputArity;
recordDescriptors = new RecordDescriptor[outputArity];
spec.getOperatorMap().put(getOperatorId(), this);
+ displayName = getClass().getName() + "[" + odId + "]";
}
@Override
@@ -66,6 +69,14 @@
return recordDescriptors;
}
+ public String getDisplayName() {
+ return displayName;
+ }
+
+ public void setDisplayName(String displayName) {
+ this.displayName = displayName;
+ }
+
@Override
public void contributeSchedulingConstraints(IConstraintAcceptor constraintAcceptor, JobActivityGraph plan,
ICCApplicationContext appCtx) {
@@ -79,6 +90,7 @@
jop.put("java-class", getClass().getName());
jop.put("in-arity", getInputArity());
jop.put("out-arity", getOutputArity());
+ jop.put("display-name", displayName);
return jop;
}
}
\ No newline at end of file