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

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

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

origin: apache/lens

/**
 * Get {@link Storage} object corresponding to the name
 *
 * @param storageName The storage name
 * @return Returns storage if name passed is a storage
 * @throws LensException if there is no storage by the name
 */
public Storage getStorage(String storageName) throws LensException {
 return getStorage(storageName, true);
}
origin: apache/lens

public void updatePartitions(String factOrDimtableName, String storageName,
 Map<UpdatePeriod, List<Partition>> partitions) throws HiveException, InvalidOperationException, LensException {
 for (Map.Entry entry : partitions.entrySet()) {
  List<Partition> partitionsToAlter = Lists.newArrayList();
  partitionsToAlter.addAll((List<Partition>) entry.getValue());
  String storageTableName = getStorageTableName(factOrDimtableName, storageName, (UpdatePeriod) entry.getKey());
  partitionsToAlter.addAll(
   getAllLatestPartsEquivalentTo(factOrDimtableName, storageTableName, (List<Partition>) entry.getValue()));
  getStorage(storageName).updatePartitions(storageTableName, getClient(), factOrDimtableName, partitionsToAlter);
 }
}
origin: apache/lens

 getStorage(storageName).addPartitions(getClient(), factOrDimTable, updatePeriod, storagePartitionDescs,
  latestInfos, storageTableName);
ListIterator<Partition> iter = partsAdded.listIterator();
 partsAdded = getStorage(storageName).addPartitions(getClient(), factOrDimTable, updatePeriod,
  storagePartitionDescs, null, storageTableName);
origin: org.apache.lens/lens-cube

/**
 * Get {@link Storage} object corresponding to the name
 *
 * @param storageName The storage name
 * @return Returns storage if name passed is a storage
 * @throws LensException if there is no storage by the name
 */
public Storage getStorage(String storageName) throws LensException {
 return getStorage(storageName, true);
}
public Storage getStorage(String storageName, boolean throwException) throws LensException {
origin: org.apache.lens/lens-cube

public void updatePartitions(String factOrDimtableName, String storageName,
 Map<UpdatePeriod, List<Partition>> partitions) throws HiveException, InvalidOperationException, LensException {
 for (Map.Entry entry : partitions.entrySet()) {
  List<Partition> partitionsToAlter = Lists.newArrayList();
  partitionsToAlter.addAll((List<Partition>) entry.getValue());
  String storageTableName = getStorageTableName(factOrDimtableName, storageName, (UpdatePeriod) entry.getKey());
  partitionsToAlter.addAll(
   getAllLatestPartsEquivalentTo(factOrDimtableName, storageTableName, (List<Partition>) entry.getValue()));
  getStorage(storageName).updatePartitions(storageTableName, getClient(), factOrDimtableName, partitionsToAlter);
 }
}
origin: org.apache.lens/lens-cube

 getStorage(storageName).addPartitions(getClient(), factOrDimTable, updatePeriod, storagePartitionDescs,
  latestInfos, storageTableName);
ListIterator<Partition> iter = partsAdded.listIterator();
 partsAdded = getStorage(storageName).addPartitions(getClient(), factOrDimTable, updatePeriod,
     storagePartitionDescs, null, storageTableName);
origin: org.apache.lens/lens-cube

public Storage getStorage(String storageName, boolean throwException) throws LensException {
 storageName = storageName.trim().toLowerCase();
 Storage storage = allStorages.get(storageName);
 if (storage == null) {
  synchronized (allStorages) {
   if (!allStorages.containsKey(storageName)) {
    Table tbl = getTableWithType(storageName, CubeTableType.STORAGE, throwException);
    if (tbl != null) {
     storage = getStorage(tbl);
     if (enableCaching && storage != null) {
      allStorages.put(storageName, storage);
     }
    }
   } else {
    storage = allStorages.get(storageName);
   }
  }
 }
 return storage;
}
origin: apache/lens

getStorage(storageName).dropPartition(getClient(), storageTableName, partVals, latest, nonTimePartSpec);
if (!latestAvailable) {
getStorage(storageName).dropPartition(getClient(), storageTableName, partVals, null, null);
if (partitionTimelineCache.updateForDeletion(cubeTableName, storageName, updatePeriod, timePartSpec)) {
 this.alterTablePartitionCache((Storage.getPrefix(storageName) + cubeTableName).toLowerCase(), updatePeriod,
origin: apache/lens

public Storage getStorage(String storageName, boolean throwException) throws LensException {
 storageName = storageName.trim().toLowerCase();
 Storage storage = allStorages.get(storageName);
 if (storage == null) {
  synchronized (allStorages) {
   if (!allStorages.containsKey(storageName)) {
    Table tbl = getTableWithType(storageName, CubeTableType.STORAGE, throwException);
    if (tbl != null) {
     storage = getStorage(tbl);
     if (enableCaching && storage != null) {
      allStorages.put(storageName, storage);
     }
    }
   } else {
    storage = allStorages.get(storageName);
   }
  }
 }
 return storage;
}
origin: org.apache.lens/lens-cube

getStorage(storageName).dropPartition(getClient(), storageTableName, partVals, latest, nonTimePartSpec);
if (!latestAvailable) {
getStorage(storageName).dropPartition(getClient(), storageTableName, partVals, null, null);
if (partitionTimelineCache.updateForDeletion(cubeTableName, storageName, updatePeriod, timePartSpec)) {
 this.alterTablePartitionCache((Storage.getPrefix(storageName) + cubeTableName).toLowerCase(), updatePeriod,
origin: org.apache.lens/lens-cube

public void alterStorage(String storageName, Storage storage) throws LensException, HiveException {
 Table storageTbl = getTableWithTypeFailFast(storageName, CubeTableType.STORAGE);
 alterCubeTable(storageName, storageTbl, storage);
 if (enableCaching) {
  allStorages.put(storageName.trim().toLowerCase(), getStorage(refreshTable(storageName)));
 }
}
origin: org.apache.lens/lens-cube

public void createStorage(Storage storage) throws LensException {
 createCubeHiveTable(storage);
 // do a get to update cache
 getStorage(storage.getName());
}
origin: apache/lens

/**
 * Get all storages in metastore
 *
 * @return List of Storage objects
 * @throws LensException
 */
public Collection<Storage> getAllStorages() throws LensException {
 if (!allStoragesPopulated) {
  List<Storage> storages = new ArrayList<>();
  try {
   for (String table : getAllHiveTableNames()) {
    Storage storage = getStorage(table, false);
    if (storage != null) {
     storages.add(storage);
    }
   }
  } catch (HiveException e) {
   throw new LensException("Could not get all storages", e);
  }
  allStoragesPopulated = enableCaching;
  return storages;
 } else {
  return allStorages.values();
 }
}
origin: apache/lens

public void alterStorage(String storageName, Storage storage)
 throws LensException, HiveException {
 checkIfAuthorized();
 Table storageTbl = getTableWithTypeFailFast(storageName, CubeTableType.STORAGE);
 alterCubeTable(storageName, storageTbl, storage);
 if (enableCaching) {
  allStorages.put(storageName.trim().toLowerCase(), getStorage(refreshTable(storageName)));
 }
}
origin: org.apache.lens/lens-cube

/**
 * Get all storages in metastore
 *
 * @return List of Storage objects
 * @throws LensException
 */
public Collection<Storage> getAllStorages() throws LensException {
 if (!allStoragesPopulated) {
  List<Storage> storages = new ArrayList<>();
  try {
   for (String table : getAllHiveTableNames()) {
    Storage storage = getStorage(table, false);
    if (storage != null) {
     storages.add(storage);
    }
   }
  } catch (HiveException e) {
   throw new LensException("Could not get all storages", e);
  }
  allStoragesPopulated = enableCaching;
  return storages;
 } else {
  return allStorages.values();
 }
}
origin: apache/lens

public void createStorage(Storage storage) throws LensException {
 checkIfAuthorized();
 createCubeHiveTable(storage);
 // do a get to update cache
 getStorage(storage.getName());
}
origin: apache/lens

@Override
public XStorage getStorage(LensSessionHandle sessionid, String storageName)
 throws LensException {
 try (SessionContext ignored = new SessionContext(sessionid)){
  return JAXBUtils.xstorageFromStorage(getClient(sessionid).getStorage(storageName));
 }
}
origin: apache/lens

@Test(priority = 1)
public void testStorage() throws Exception {
 Storage hdfsStorage = new HDFSStorage(c1);
 client.createStorage(hdfsStorage);
 assertEquals(client.getAllStorages().size(), 1);
 Storage hdfsStorage2 = new HDFSStorage(c2);
 client.createStorage(hdfsStorage2);
 assertEquals(client.getAllStorages().size(), 2);
 Storage hdfsStorage3 = new HDFSStorage(c3);
 client.createStorage(hdfsStorage3);
 assertEquals(client.getAllStorages().size(), 3);
 Storage hdfsStorage4 = new HDFSStorage(c4);
 client.createStorage(hdfsStorage4);
 assertEquals(client.getAllStorages().size(), 4);
 assertEquals(hdfsStorage, client.getStorage(c1));
 assertEquals(hdfsStorage2, client.getStorage(c2));
 assertEquals(hdfsStorage3, client.getStorage(c3));
 assertEquals(hdfsStorage4, client.getStorage(c4));
}
org.apache.lens.cube.metadataCubeMetastoreClientgetStorage

Javadoc

Get Storage object corresponding to the name

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,
  • dropStorageFromFact,
  • getAllCubes,
  • getAllDimensionTables,
  • getAllFacts

Popular in Java

  • Creating JSON documents from java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • Reference (javax.naming)
  • Top Vim plugins
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