use of org.pentaho.di.core.osgi.api.NamedClusterOsgi in project pentaho-kettle by pentaho.
the class NamedClusterEmbedManager method clear.
/**
* Clear the embedded metastore of any named clusters
*/
public void clear() {
NamedClusterServiceOsgi ncso = meta.getNamedClusterServiceOsgi();
if (ncso != null) {
// Don't kill the embedded if we don't have the service to rebuild
addedAllClusters = false;
addedAnyClusters = false;
// saved.
if (embeddedMetaStoreFactory != null) {
try {
List<NamedClusterOsgi> list = embeddedMetaStoreFactory.getElements();
for (NamedClusterOsgi nc : list) {
namedClusterPool.put(nc.getName(), nc);
embeddedMetaStoreFactory.deleteElement(nc.getName());
}
} catch (MetaStoreException e) {
logMetaStoreException(e);
}
}
}
}
use of org.pentaho.di.core.osgi.api.NamedClusterOsgi in project pentaho-kettle by pentaho.
the class NamedClusterEmbedManager method addAllClusters.
private void addAllClusters() {
NamedClusterServiceOsgi ncso = meta.getNamedClusterServiceOsgi();
if (ncso != null && meta.getMetaStore() != null) {
try {
List<String> list = ncso.listNames(meta.getMetaStore());
for (String name : list) {
addClusterToMeta(name);
}
for (NamedClusterOsgi nc : namedClusterPool.values()) {
if (!list.contains(nc.getName())) {
addClusterToMeta(nc);
}
}
addedAllClusters = true;
} catch (MetaStoreException e) {
logMetaStoreException(e);
}
}
}
Aggregations