Tabnine Logo
CubeMetastoreClient.dropStorageFromFact
Code IndexAdd Tabnine to your IDE (free)

How to use
dropStorageFromFact
method
in
org.apache.lens.cube.metadata.CubeMetastoreClient

Best Java code snippets using org.apache.lens.cube.metadata.CubeMetastoreClient.dropStorageFromFact (Showing top 5 results out of 315)

origin: apache/lens

@Override
public void dropAllStoragesOfFact(LensSessionHandle sessionid, String factName) throws LensException {
 try (SessionContext ignored = new SessionContext(sessionid)){
  CubeMetastoreClient msClient = getClient(sessionid);
  CubeFactTable tab = msClient.getCubeFactTable(factName);
  int total = tab.getStorages().size();
  int i = 0;
  List<String> storageNames = new ArrayList<>(tab.getStorages());
  for (String s : storageNames) {
   msClient.dropStorageFromFact(factName, s);
   log.info("Dropped storage " + s + " from fact table " + factName
    + " [" + ++i + "/" + total + "]");
  }
  log.info("Dropped " + total + " storages from fact table " + factName);
 }
}
origin: apache/lens

@Override
public void dropStorageOfFact(LensSessionHandle sessionid, String fact, String storage) throws LensException {
 try (SessionContext ignored = new SessionContext(sessionid)){
  checkFactStorage(sessionid, fact, storage);
  getClient(sessionid).dropStorageFromFact(fact, storage);
  log.info("Dropped storage " + storage + " from fact " + fact);
 } catch (HiveException exc) {
  throw new LensException(exc);
 }
}
origin: org.apache.lens/lens-cube

/**
 * Drop a fact with cascade  flag
 *
 * @param factName fact name
 * @param cascade  If true, will drop all the storages of the fact
 * @throws LensException
 */
public void dropFact(String factName, boolean cascade) throws LensException {
 getTableWithTypeFailFast(factName, CubeTableType.FACT);
 FactTable fact = getFactTable(factName);
 if (cascade) {
  for (String storage : fact.getStorages()) {
   dropStorageFromFact(factName, storage, false);
  }
 }
 dropHiveTable(factName);
 allFactTables.remove(factName.trim().toLowerCase());
 if (fact.isVirtualFact()) {
  String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName()));
  if (factToVirtualFactMapping.get(sourceFactTable) != null
   && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) {
   factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName());
  }
 } else {
  dropAllVirtualFactTables(factName);
 }
}
origin: apache/lens

/**
 * Drop a fact with cascade  flag
 *
 * @param factName fact name
 * @param cascade  If true, will drop all the storages of the fact
 * @throws LensException
 */
public void dropFact(String factName, boolean cascade) throws LensException {
 getTableWithTypeFailFast(factName, CubeTableType.FACT);
 FactTable fact = getFactTable(factName);
 checkIfAuthorized();
 if (cascade) {
  for (String storage : fact.getStorages()) {
   dropStorageFromFact(factName, storage, false);
  }
 }
 dropHiveTable(factName);
 allFactTables.remove(factName.trim().toLowerCase());
 if (fact.isVirtualFact()) {
  String sourceFactTable = fact.getProperties().get(getSourceFactNameKey(fact.getName()));
  if (factToVirtualFactMapping.get(sourceFactTable) != null
   && factToVirtualFactMapping.get(sourceFactTable).contains(fact.getName())) {
   factToVirtualFactMapping.get(sourceFactTable).remove(fact.getName());
  }
 } else {
  dropAllVirtualFactTables(factName);
 }
}
origin: apache/lens

String storageTableName = getFactOrDimtableStorageTableName(factName, c3);
assertTrue(client.tableExists(storageTableName));
client.dropStorageFromFact(factName, c2);
storageTableName = getFactOrDimtableStorageTableName(factName, c2);
assertFalse(client.tableExists(storageTableName));
org.apache.lens.cube.metadataCubeMetastoreClientdropStorageFromFact

Javadoc

Drop a storage from fact

Popular methods of CubeMetastoreClient

  • getInstance
    Get the instance of CubeMetastoreClient corresponding to HiveConf
  • getHiveTable
    Get the hive Table corresponding to the name
  • createCubeDimensionTable
  • createStorage
  • getConf
    Get cube metastore client conf
  • addPartitions
    batch addition
  • alterCube
  • alterCubeDimensionTable
  • alterCubeFactTable
  • alterDimension
    Alter dimension specified by the dimension name to new definition
  • alterSegmentation
  • createCube
    Create cube in metastore defined by Cube or DerivedCube object
  • alterSegmentation,
  • createCube,
  • createDimension,
  • createSegmentation,
  • dropSegmentation,
  • dropStorageFromDim,
  • getAllCubes,
  • getAllDimensionTables,
  • getAllFacts

Popular in Java

  • Running tasks concurrently on multiple threads
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
  • getApplicationContext (Context)
  • Socket (java.net)
    Provides a client-side TCP socket.
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • JPanel (javax.swing)
  • Option (scala)
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now