Search in sources :

Example 1 with NamedClusterOsgi

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);
            }
        }
    }
}
Also used : NamedClusterOsgi(org.pentaho.di.core.osgi.api.NamedClusterOsgi) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) NamedClusterServiceOsgi(org.pentaho.di.core.osgi.api.NamedClusterServiceOsgi)

Example 2 with NamedClusterOsgi

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);
        }
    }
}
Also used : NamedClusterOsgi(org.pentaho.di.core.osgi.api.NamedClusterOsgi) MetaStoreException(org.pentaho.metastore.api.exceptions.MetaStoreException) NamedClusterServiceOsgi(org.pentaho.di.core.osgi.api.NamedClusterServiceOsgi)

Aggregations

NamedClusterOsgi (org.pentaho.di.core.osgi.api.NamedClusterOsgi)2 NamedClusterServiceOsgi (org.pentaho.di.core.osgi.api.NamedClusterServiceOsgi)2 MetaStoreException (org.pentaho.metastore.api.exceptions.MetaStoreException)2