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

  • Finding current android device location
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • compareTo (BigDecimal)
  • putExtra (Intent)
  • Menu (java.awt)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • 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