How to use the catalog/catalogUtils.fetchAndSave function in catalog

To help you get started, we’ve selected a few catalog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
const reloadPartitions = function(dataCatalogEntry, apiOptions) {
  return dataCatalogEntry.trackedPromise(
    'partitionsPromise',
    catalogUtils.fetchAndSave('fetchPartitions', 'partitions', dataCatalogEntry, apiOptions)
  );
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
const reloadSample = function(dataCatalogEntry, apiOptions) {
  return dataCatalogEntry.trackedPromise(
    'samplePromise',
    catalogUtils.fetchAndSave('fetchSample', 'sample', dataCatalogEntry, apiOptions)
  );
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
cancellablePromises.push(
        catalogUtils
          .fetchAndSave('fetchSourceMetadata', 'sourceMeta', dataCatalogEntry, options)
          .done(deferred.resolve)
          .fail(deferred.reject)
      );
    });
    return dataCatalogEntry.trackedPromise(
      'sourceMetaPromise',
      new CancellablePromise(deferred, undefined, cancellablePromises)
    );
  }

  return dataCatalogEntry.trackedPromise(
    'sourceMetaPromise',
    catalogUtils.fetchAndSave('fetchSourceMetadata', 'sourceMeta', dataCatalogEntry, options)
  );
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
const reloadNavOptMeta = function(dataCatalogEntry, apiOptions) {
  if (dataCatalogEntry.dataCatalog.canHaveNavOptMetadata()) {
    return dataCatalogEntry.trackedPromise(
      'navOptMetaPromise',
      catalogUtils.fetchAndSave('fetchNavOptMeta', 'navOptMeta', dataCatalogEntry, apiOptions)
    );
  }
  dataCatalogEntry.navOptMetaPromise = $.Deferred.reject().promise();
  return dataCatalogEntry.navOptMetaPromise;
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
const reloadNavigatorMeta = function(dataCatalogEntry, apiOptions) {
  if (dataCatalogEntry.canHaveNavigatorMetadata()) {
    return dataCatalogEntry
      .trackedPromise(
        'navigatorMetaPromise',
        catalogUtils.fetchAndSave(
          'fetchNavigatorMetadata',
          'navigatorMeta',
          dataCatalogEntry,
          apiOptions
        )
      )
      .done(navigatorMeta => {
        if (navigatorMeta && dataCatalogEntry.commentObservable) {
          dataCatalogEntry.commentObservable(dataCatalogEntry.getResolvedComment());
        }
      });
  }
  dataCatalogEntry.navigatorMetaPromise = $.Deferred().reject();
  return dataCatalogEntry.navigatorMetaPromise;
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / dataCatalogEntry.js View on Github external
const reloadAnalysis = function(dataCatalogEntry, apiOptions) {
  return dataCatalogEntry.trackedPromise(
    'analysisPromise',
    catalogUtils.fetchAndSave(
      apiOptions && apiOptions.refreshAnalysis ? 'refreshAnalysis' : 'fetchAnalysis',
      'analysis',
      dataCatalogEntry,
      apiOptions
    )
  );
};
github cloudera / hue / desktop / core / src / desktop / js / catalog / multiTableEntry.js View on Github external
const genericNavOptReload = function(
  multiTableEntry,
  options,
  promiseAttribute,
  dataAttribute,
  apiHelperFunction
) {
  if (multiTableEntry.dataCatalog.canHaveNavOptMetadata()) {
    return multiTableEntry.trackedPromise(
      promiseAttribute,
      catalogUtils.fetchAndSave(apiHelperFunction, dataAttribute, multiTableEntry, options)
    );
  }
  multiTableEntry[promiseAttribute] = $.Deferred().reject();
  return multiTableEntry[promiseAttribute];
};