Skip to content

Commit

Permalink
KYLO-2603: Added NifiControllerServiceId to data source metadata model.
Browse files Browse the repository at this point in the history
  • Loading branch information
felten committed Oct 10, 2018
1 parent 56c6e1a commit b7b9bf6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public interface DataSource extends SystemEntity, Auditable, DataSetSparkParamsS
interface ID extends Serializable { }

ID getId();

String getNifiControllerServiceId();

void setNifiControllerServiceId(String id);

Connector getConnector();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ public class JcrDataSource extends JcrEntity<JcrDataSource.DataSourceId> impleme
public static final String NODE_TYPE = "tba:DataSource";
public static final String DATA_SETS_NODE_TYPE = "tba:DataSets";
public static final String DATA_SETS = "dataSets";
public static final String NIFI_CONTROLLER_SVC_ID = "tba:nifiControllerServiceId";

/**
* @param node
Expand Down Expand Up @@ -91,6 +92,19 @@ public void setSystemName(String name) {
JcrUtil.rename(getNode(), name);
}

/* (non-Javadoc)
* @see com.thinkbiganalytics.metadata.api.catalog.DataSource#getNifiControllerServiceId()
*/
@Override
public String getNifiControllerServiceId() {
return getProperty(NIFI_CONTROLLER_SVC_ID, String.class, null);
}

@Override
public void setNifiControllerServiceId(String id) {
setProperty(NIFI_CONTROLLER_SVC_ID, id);
}

/* (non-Javadoc)
* @see com.thinkbiganalytics.metadata.modeshape.catalog.DataSetSparkParamsSupplierMixin#getSparkParametersChain()
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,7 @@
+ * (tba:DataSource)

[tba:DataSource] > mix:title, tba:entity, tba:DataSetSparkParamsSupplier, tba:accessControlled, mix:referenceable
- tba:nifiControllerServiceId (STRING)
+ dataSets (tba:DataSets) = tba:DataSets autocreated mandatory

[tba:DataSets]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ public void updateSparkParameters(DataSetTemplate model, DataSetSparkParameters
public com.thinkbiganalytics.metadata.api.catalog.DataSource updateDataSource(DataSource model, com.thinkbiganalytics.metadata.api.catalog.DataSource domain) {
domain.setTitle(model.getTitle());
domain.setDescription(generateDescription(model));
domain.setNifiControllerServiceId(model.getNifiControllerServiceId());
updateSparkParameters(model.getTemplate(), domain.getSparkParameters());
return domain;
}
Expand Down Expand Up @@ -166,6 +167,7 @@ public Function<com.thinkbiganalytics.metadata.api.catalog.DataSource, DataSourc
DataSource model = new DataSource();
model.setId(domain.getId().toString());
model.setTitle(domain.getTitle());
model.setNifiControllerServiceId(domain.getNifiControllerServiceId());
model.setConnector(connectorToRestModel().apply(domain.getConnector()));
model.setTemplate(sparkParamsToRestModel().apply(domain.getSparkParameters()));
securityTransform.applyAccessControl(domain, model);
Expand Down

0 comments on commit b7b9bf6

Please sign in to comment.