Class Cube

All Implemented Interfaces:
ICube

public class Cube extends CachedComponent implements ICube
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
      Description copied from interface: ICube
      Get the name of the cube.
      Specified by:
      getName in interface ICube
      Returns:
      name of the cube
    • getCubeInfo

      public ICubeInfo getCubeInfo()
      Specified by:
      getCubeInfo in interface ICube
    • getCubeMemorySize

      public long getCubeMemorySize()
      Specified by:
      getCubeMemorySize in interface ICube
    • getDimensions

      public IDimension[] getDimensions() throws PaloException, PaloJException
      Description copied from interface: ICube
      Get the list of dimensions in this cube.
      Specified by:
      getDimensions in interface ICube
      Returns:
      list of dimensions
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getDimensions

      public Dimension[] getDimensions(boolean withVirtualDimensions) throws PaloException, PaloJException
      Description copied from interface: ICube
      Get the list of dimensions in this cube.
      Specified by:
      getDimensions in interface ICube
      Parameters:
      withVirtualDimensions - if yes return also all virtual dimension of the cube
      Returns:
      list of dimensions of the cube
      Throws:
      PaloException
      PaloJException
    • getDimensionIndexByName

      public int getDimensionIndexByName(String name) throws PaloJException, PaloException
      Description copied from interface: ICube
      Get a specific dimension index in this cube
      Specified by:
      getDimensionIndexByName in interface ICube
      Parameters:
      name - name of the dimension
      Returns:
      dimension, or -1 if it does not exists
      Throws:
      PaloJException - exception from the library itself
      PaloException - exception from OLAP server
    • getCellPath

      public IElement[] getCellPath(String[] names) throws PaloException, PaloJException
      Description copied from interface: ICube
      get the elements object that points to a cell path within the cube
      Specified by:
      getCellPath in interface ICube
      Parameters:
      names - the element names
      Returns:
      element objects
      Throws:
      PaloException
      PaloJException
    • getNumberOfFilledCells

      public BigInteger getNumberOfFilledCells() throws PaloException
      Description copied from interface: ICube
      Get the number of filled cells in the cube.
      Specified by:
      getNumberOfFilledCells in interface ICube
      Returns:
      number of filled cells.
      Throws:
      PaloException - exception from OLAP server
    • getNumberOfCells

      public BigInteger getNumberOfCells() throws PaloException
      Description copied from interface: ICube
      Get the number of cells, filled and empty ones.
      Specified by:
      getNumberOfCells in interface ICube
      Returns:
      overall number of possible cells in the cube
      Throws:
      PaloException - exception from OLAP server
    • getNumberOfZeroCells

      public BigInteger getNumberOfZeroCells() throws PaloException
      Description copied from interface: ICube
      Number of cells storing zero values (introduced in 6.5)
      Specified by:
      getNumberOfZeroCells in interface ICube
      Returns:
      Number of cells storing zero values
      Throws:
      PaloException - exception from OLAP server
    • getNumberOfEmptyCells

      public BigInteger getNumberOfEmptyCells() throws PaloException
      Description copied from interface: ICube
      Number of cells storing empty values (introduced in 6.5)
      Specified by:
      getNumberOfEmptyCells in interface ICube
      Returns:
      Number of cells storing empty values
      Throws:
      PaloException - exception from OLAP server
    • canStoreZero

      public boolean canStoreZero() throws PaloException
      Description copied from interface: ICube
      check if the cube can store zero values (introduced in 6.5)
      Specified by:
      canStoreZero in interface ICube
      Returns:
      true if zeros can stored.
      Throws:
      PaloException - exception from OLAP server
    • getType

      public ICube.CubeType getType() throws PaloException
      Description copied from interface: ICube
      Get the cube type ICube.CubeType
      Specified by:
      getType in interface ICube
      Returns:
      cube type
      Throws:
      PaloException - exception from OLAP server
    • getDimensionIds

      public int[] getDimensionIds() throws PaloException
      Throws:
      PaloException
    • clear

      public void clear() throws PaloException
      Description copied from interface: ICube
      clears completely the data in the cube
      Specified by:
      clear in interface ICube
      Throws:
      PaloException - exception from OLAP server
    • clearCells

      public void clearCells(IElement[][] area) throws PaloException
      Description copied from interface: ICube
      empty cells in an area within a cube
      Specified by:
      clearCells in interface ICube
      Parameters:
      area - Area contained from the cartesian product of the elements mentioned in each dimension. The dimensions in the array has the same order as in the cube. So, Element[0] refers to elements in the first dimension of the cube. If no elements are given for a certain dimension, then all elements will be used.
      Throws:
      PaloException - exception from OLAP server
    • save

      @Deprecated public void save() throws PaloException
      Deprecated.
      Description copied from interface: ICube
      save the cube to the csv files.
      Specified by:
      save in interface ICube
      Throws:
      PaloException - exception from OLAP server
    • lockComplete

      public int lockComplete() throws PaloException
      Description copied from interface: ICube
      lock the data in the cube, no reading is possible.
      Specified by:
      lockComplete in interface ICube
      Returns:
      id of the locked cube area, needed to do the commit later
      Throws:
      PaloException - exception from OLAP server
    • lockArea

      public int lockArea(IElement[][] area) throws PaloException
      Description copied from interface: ICube
      lock only an area in the cube, reading is still possible.
      Specified by:
      lockArea in interface ICube
      Parameters:
      area - cube area
      Returns:
      id of the locked area, needed to do the commit later
      Throws:
      PaloException - exception from OLAP server
    • modify

      public ICube modify(IDimension[] dimensions)
      Description copied from interface: ICube
      modify the given cube
      Specified by:
      modify in interface ICube
      Parameters:
      dimensions - the new list of dimensions
      Returns:
      the modified cube
    • commitLock

      public void commitLock(int lockId) throws PaloException
      Description copied from interface: ICube
      commit/free a lock in the cube
      Specified by:
      commitLock in interface ICube
      Parameters:
      lockId - id of the locked area in the cube
      Throws:
      PaloException - exception from OLAP server
    • convert

      @Deprecated public void convert(ICube.CubeType cubetype) throws PaloJException, PaloException
      Deprecated.
      Description copied from interface: ICube
      convert cube type from normal to gpu or other vice versa.
      Specified by:
      convert in interface ICube
      Parameters:
      cubetype - ICube.CubeType
      Throws:
      PaloJException - exception from the library itself
      PaloException - exception from OLAP server
    • activateGpu

      public void activateGpu(boolean activate) throws PaloException, PaloJException
      Description copied from interface: ICube
      activate and deactivate GPU acceleration for the cube
      Specified by:
      activateGpu in interface ICube
      Parameters:
      activate - : if true activate, if false deactivate
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • loadCells

      @Deprecated public void loadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException
      Deprecated.
      Description copied from interface: ICube
      Write cells back in palo server.
      Specified by:
      loadCells in interface ICube
      Parameters:
      paths - each path specify cell coordinates.
      values - each value is a cell value
      context - load context ICellLoadContext
      lockedPaths - paths where Splashing will not change them and their sources areas if they are consolidated.
      Throws:
      PaloJException - exception from the library itself
      PaloException - exception from OLAP server
    • loadCells

      public void loadCells(IElement[][] paths, Object[] values, ICellLoadContext context, IElement[][] lockedPaths, boolean useAudit) throws PaloJException, PaloException
      Description copied from interface: ICube
      Write cells back in palo server.
      Specified by:
      loadCells in interface ICube
      Parameters:
      paths - each path specify cell coordinates.
      values - each value is a cell value
      context - load context ICellLoadContext
      lockedPaths - paths where Splashing will not change them and their sources areas if they are consolidated.
      useAudit - If audit is enabled for the cube, save all performed bulk operations to it
      Throws:
      PaloJException - exception from the library itself
      PaloException - exception from OLAP server
    • loadCell

      public void loadCell(IElement[] path, Object value, ICellLoadContext context, IElement[][] lockedPaths) throws PaloJException, PaloException
      Specified by:
      loadCell in interface ICube
      Parameters:
      path - path specify cell coordinates.
      value - value is a cell value
      context - load context ICellLoadContext
      lockedPaths - paths where Splashing will not change them and their sources areas if they are consolidated.
      Throws:
      PaloJException
      PaloException
    • getRules

      public IRule[] getRules() throws PaloException
      Description copied from interface: ICube
      get the list of the rules for this cube
      Specified by:
      getRules in interface ICube
      Returns:
      rules IRule
      Throws:
      PaloException - exception from OLAP server
    • updateRuleTemplates

      public void updateRuleTemplates()
      Description copied from interface: ICube
      update the template rules in this cube
      Specified by:
      updateRuleTemplates in interface ICube
    • getDimensionByName

      public IDimension getDimensionByName(String name) throws PaloException, PaloJException
      Description copied from interface: ICube
      Get a specific dimension in this cube
      Specified by:
      getDimensionByName in interface ICube
      Parameters:
      name - name of the dimension
      Returns:
      dimension
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getId

      public int getId()
      Description copied from interface: ICube
      Get the ID of the Cube
      Specified by:
      getId in interface ICube
      Returns:
      Cube ID
    • addRule

      public void addRule(String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) throws PaloException
      Description copied from interface: ICube
      add a rule to cube.
      Specified by:
      addRule in interface ICube
      Parameters:
      definition - definition of the rule
      activate - true when rule should be active, false otherwise.
      externalIdentifier - optional external ID
      comment - optional comment
      useIdentifier - use id instead of name in rules
      position - position in the rules list
      source - query definition for template rules. Empty for regular rules.
      Throws:
      PaloException - exception from OLAP server
    • updateRule

      public void updateRule(int id, String definition, boolean activate, String externalIdentifier, String comment, boolean useIdentifier, double position, String source) throws PaloException
      Description copied from interface: ICube
      update an existing rule
      Specified by:
      updateRule in interface ICube
      Parameters:
      id - id of the rule.
      definition - definition of the rule
      activate - true, if the rule is active, false otherwise.
      externalIdentifier - optional external ID
      comment - optional comment
      useIdentifier - use id instead of name in rules
      position - position in the rules list
      source - query definition for template rules. Empty for regular rules.
      Throws:
      PaloException - exception from OLAP server
    • parseRule

      public String parseRule(String definition) throws PaloException, PaloJException
      Description copied from interface: ICube
      parse a definition of the rule
      Specified by:
      parseRule in interface ICube
      Parameters:
      definition - rule definition
      Returns:
      XML representation of the enterprise rule.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • removeRules

      public void removeRules(IRule[] rules) throws PaloException
      Description copied from interface: ICube
      remove a set of rules, the rules will be removed depending on their identifiers.
      Specified by:
      removeRules in interface ICube
      Parameters:
      rules - rules to be removed
      Throws:
      PaloException - exception from OLAP server
    • removeRules

      public void removeRules() throws PaloException
      Description copied from interface: ICube
      remove all rules.
      Specified by:
      removeRules in interface ICube
      Throws:
      PaloException - exception from OLAP server
    • getCellsExporter

      public CellsExporter getCellsExporter(IElement[][] area, ICellExportContext context) throws PaloException, PaloJException
      Description copied from interface: ICube
      Get an exporter to use later to export cells from an olap cube
      Specified by:
      getCellsExporter in interface ICube
      Parameters:
      area - Area contained from the cartesian product of the elements mentioned in each dimension. The dimensions in the array has the same order as in the cube. So, Element[0] refers to elements in the first dimension of the cube. If no elements are given for a certain dimension, then all elements will be used.
      context - of the export ICellExportContext
      Returns:
      exporter to get the cells in blocks and only when needed ICellsExporter.
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getCell

      public ICell getCell(IElement[] path) throws PaloException, PaloJException
      Description copied from interface: ICube
      get the value of a single cell typically using cell/value
      Specified by:
      getCell in interface ICube
      Parameters:
      path - path to certain cell
      Returns:
      cube cell with its value ICell
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • getCells

      public ICell[] getCells(IElement[][] paths) throws PaloException, PaloJException
      Description copied from interface: ICube
      get the values of multiple cells typically using cell/values
      Specified by:
      getCells in interface ICube
      Parameters:
      paths - An array of paths to certain cells
      Returns:
      cube cells with their values ICell
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • hasCells

      public Boolean[] hasCells(IElement[][] paths) throws PaloException, PaloJException
      Description copied from interface: ICube
      check for multiple cell paths if there is a non-empty cell
      Specified by:
      hasCells in interface ICube
      Parameters:
      paths - An array of paths to certain cells
      Returns:
      For each cell path true if a non-empty cell with at least read access exists in the cube, otherwise false
      Throws:
      PaloException - exception from OLAP server
      PaloJException - exception from the library itself
    • copyCell

      public void copyCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) throws PaloException
      Specified by:
      copyCell in interface ICube
      Parameters:
      fromPath - Source cell path used for copy
      toPath - Target cell path
      lockedPaths - Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.
      useRules - copy rule based cell values
      wait - wait until the asynchronous part of operation is finished
      Throws:
      PaloException - exception from OLAP server
    • copyLikeCell

      public void copyLikeCell(IElement[] fromPath, IElement[] toPath, IElement[][] lockedPaths, Double likeValue, boolean useRules, boolean wait) throws PaloException
      Specified by:
      copyLikeCell in interface ICube
      Parameters:
      fromPath - Source cell path used for copy
      toPath - Target cell path
      lockedPaths - Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.
      likeValue - Numeric value of the target cube cell
      useRules - copy rule based cell values
      wait - wait until the asynchronous part of operation is finished
      Throws:
      PaloException - exception from OLAP server
    • predictCell

      public void predictCell(IElement[][] fromArea, IElement[] toPath, IElement[][] lockedPaths, boolean useRules, boolean wait) throws PaloException
      Specified by:
      predictCell in interface ICube
      Parameters:
      fromArea - Source area used for the predictive function. Only one element list can contain multiple elements. The area is the cartesian product.
      toPath - Target cell path
      lockedPaths - Optional list of locked paths. Splashing will not change locked paths and sources areas of these paths if they are consolidated.
      useRules - copy rule based cell values
      wait - wait until the asynchronous part of operation is finished
      Throws:
      PaloException - exception from OLAP server
    • rename

      public void rename(String name) throws PaloException
      Description copied from interface: ICube
      rename a cube
      Specified by:
      rename in interface ICube
      Parameters:
      name - new cube name
      Throws:
      PaloException - exception from OLAP server
    • getCBToken

      public long getCBToken() throws PaloException
      Description copied from interface: ICube
      get current Palo_CB Token
      Specified by:
      getCBToken in interface ICube
      Returns:
      Palo_CB token
      Throws:
      PaloException - exception from OLAP server
    • getCCToken

      public long getCCToken() throws PaloException
      Description copied from interface: ICube
      get current Palo_CC Token
      Specified by:
      getCCToken in interface ICube
      Returns:
      Palo_CC token
      Throws:
      PaloException - exception from OLAP server
    • activateRules

      public void activateRules(IRule[] rules) throws PaloException
      Description copied from interface: ICube
      activate a set of rules, the rules will be changed depending on their identifiers.
      Specified by:
      activateRules in interface ICube
      Parameters:
      rules - rules to be activated
      Throws:
      PaloException - exception from OLAP server
    • deactivateRules

      public void deactivateRules(IRule[] rules) throws PaloException
      Description copied from interface: ICube
      deactivate a set of rules, the rules will be changed depending on their identifiers.
      Specified by:
      deactivateRules in interface ICube
      Parameters:
      rules - rules to be deactivated
      Throws:
      PaloException - exception from OLAP server
    • getCellLoadContext

      public ICellLoadContext getCellLoadContext(ICube.SplashMode mode, int blockSize, boolean add, boolean eventProcessor)
      Description copied from interface: ICube
      get a cell load context which is needed when writing cell values
      Specified by:
      getCellLoadContext in interface ICube
      Parameters:
      mode - ICellLoadContext.getSplashMode()
      blockSize - ICellLoadContext.getBlockSize()
      add - ICellLoadContext.isAdd()
      eventProcessor - ICellLoadContext.isEventProcessor()
      Returns:
      cellLoadContext
    • generateScript

      public String generateScript(ICubeScriptContext sc)
      Specified by:
      generateScript in interface ICube
    • getScriptContext

      public ICubeScriptContext getScriptContext()
      Specified by:
      getScriptContext in interface ICube
    • checkCCTokenChange

      protected boolean checkCCTokenChange()
    • checkCBTokenChange

      protected boolean checkCBTokenChange()
    • getDimensionById

      public Dimension getDimensionById(int dimId) throws PaloException, PaloJException
      Throws:
      PaloException
      PaloJException
    • resetCache

      public void resetCache()
    • getDataToken

      public Long getDataToken()
      Specified by:
      getDataToken in interface ICube
    • addHold

      public IHold addHold(IElement[][] area) throws PaloException
      Specified by:
      addHold in interface ICube
      Throws:
      PaloException
    • getHolds

      public IHold[] getHolds() throws PaloException
      Specified by:
      getHolds in interface ICube
      Throws:
      PaloException
    • removeHolds

      public void removeHolds() throws PaloException
      Specified by:
      removeHolds in interface ICube
      Throws:
      PaloException
    • removeHolds

      public void removeHolds(IHold[] holds) throws PaloException
      Specified by:
      removeHolds in interface ICube
      Throws:
      PaloException