APISonar


com.dremio.dac.cmd.AdminLogger.log

> com > dremio > dac > cmd > AdminLogger > log
com APIs dremio APIs dac APIs cmd APIs AdminLogger APIs log APIs

Example 1
private void update(ExternalReflection reflection) {
    try {
      final String queryDatasetId = reflection.getQueryDatasetId();
      reflection.setQueryDatasetHash(computeDatasetHash(queryDatasetId));

      final String targetDatasetId = reflection.getTargetDatasetId();
      reflection.setTargetDatasetHash(computeDatasetHash(targetDatasetId));

      AdminLogger.log("  Updated external reflection {}", reflection.getId());
      store.addExternalReflection(reflection);
    } catch (Exception e) {
      AdminLogger.log("  Failed to update external reflection {}", reflection.getId());
    }
  }
Example 2
public void run(boolean noDBOpenRetry) throws Exception {
    Optional<LocalKVStoreProvider> storeOptional = CmdUtils.getKVStoreProvider(dacConfig.getConfig(), classpathScan, noDBOpenRetry);
    if (!storeOptional.isPresent()) {
      AdminLogger.log("No database found. Skipping upgrade");
      return;
    }
    try (final KVStoreProvider storeProvider = storeOptional.get()) {
      storeProvider.start();

      run(storeProvider);
    }

  }
Example 3
public static void main(String[] args) {
    final DACConfig dacConfig = DACConfig.newConfig();
    final ScanResult classPathScan = ClassPathScanner.fromPrescan(dacConfig.getConfig().getSabotConfig());
    try {
      Upgrade upgrade = new Upgrade(dacConfig, classPathScan, true);
      upgrade.run();
    } catch (Exception e) {
      AdminLogger.log("\nUpgrade failed", e);
      System.exit(1);
    }
  }
Example 4
private void migrateGoals(UpgradeContext context) {
    final NamespaceService namespaceService = new NamespaceServiceImpl(context.getKVStoreProvider());
    final Provider<KVStoreProvider> provider = DirectProvider.wrap(context.getKVStoreProvider());
    final ReflectionGoalsStore reflectionGoalsStore = new ReflectionGoalsStore(provider);
    final ReflectionEntriesStore reflectionEntriesStore = new ReflectionEntriesStore(provider);
    final MaterializationStore materializationStore = new MaterializationStore(provider);

    for (ReflectionGoal reflectionGoal : reflectionGoalsStore.getAll()) {
      try {
        migrateGoal(namespaceService, reflectionGoalsStore, reflectionEntriesStore, materializationStore, reflectionGoal);
      } catch (Exception e) {
        AdminLogger.log("    failed migrating reflection {} for dataset {}: {}", reflectionGoal.getId(), reflectionGoal.getDatasetId(), e.getMessage());
      }
    }
  }