Tabnine Logo
XDimensionTable
Code IndexAdd Tabnine to your IDE (free)

How to use
XDimensionTable
in
org.apache.lens.api.metastore

Best Java code snippets using org.apache.lens.api.metastore.XDimensionTable (Showing top 20 results out of 315)

origin: org.apache.lens/lens-cube

public static CubeDimensionTable cubeDimTableFromDimTable(XDimensionTable dimensionTable) throws LensException {
 return new CubeDimensionTable(dimensionTable.getDimensionName(),
  dimensionTable.getTableName(),
  fieldSchemaListFromColumns(dimensionTable.getColumns()),
  dimensionTable.getWeight(),
  dumpPeriodsFromStorageTables(dimensionTable.getStorageTables()),
  mapFromXProperties(dimensionTable.getProperties()));
}
origin: org.apache.lens/lens-api

public XDimensionTable withTableName(String value) {
  setTableName(value);
  return this;
}
origin: org.apache.lens/lens-api

public XDimensionTable withColumns(XColumns value) {
  setColumns(value);
  return this;
}
origin: org.apache.lens/lens-cube

public static XDimensionTable dimTableFromCubeDimTable(CubeDimensionTable cubeDimTable) {
 if (cubeDimTable == null) {
  return null;
 }
 XDimensionTable dimTab = XCF.createXDimensionTable();
 dimTab.setDimensionName(cubeDimTable.getDimName());
 dimTab.setTableName(cubeDimTable.getName());
 dimTab.setWeight(cubeDimTable.weight());
 dimTab.setColumns(new XColumns());
 dimTab.setProperties(new XProperties());
 dimTab.setStorageTables(new XStorageTables());
 for (FieldSchema column : cubeDimTable.getColumns()) {
  dimTab.getColumns().getColumn().add(columnFromFieldSchema(column));
 }
 dimTab.getProperties().getProperty().addAll(xPropertiesFromMap(cubeDimTable.getProperties()));
 return dimTab;
}
origin: org.apache.lens/lens-cube

public void alterCubeDimensionTable(XDimensionTable dimensionTable) throws LensException, HiveException {
 alterCubeDimensionTable(dimensionTable.getTableName(),
  JAXBUtils.cubeDimTableFromDimTable(dimensionTable),
  JAXBUtils.tableDescPrefixMapFromXStorageTables(dimensionTable.getStorageTables()));
}
/**
origin: apache/lens

/**
 * Create a cube dimension table based on JAXB object
 *
 * @param xDimTable dim table spec
 * @throws LensException
 */
@Override
public void createDimensionTable(LensSessionHandle sessionid, XDimensionTable xDimTable) throws LensException {
 try (SessionContext ignored = new SessionContext(sessionid)){
  getClient(sessionid).createCubeDimensionTable(xDimTable);
  log.info("Dimension Table created " + xDimTable.getTableName());
 }
}
origin: apache/lens

public XDimensionTable getXDimensionTable(CubeDimensionTable dimTable) throws LensException {
 XDimensionTable dt = JAXBUtils.dimTableFromCubeDimTable(dimTable);
 if (!dimTable.getStorages().isEmpty()) {
  for (String storageName : dimTable.getStorages()) {
   XStorageTableElement tblElement = JAXBUtils.getXStorageTableFromHiveTable(
    this.getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(dimTable.getName(), storageName)));
   tblElement.setStorageName(storageName);
   UpdatePeriod p = dimTable.getSnapshotDumpPeriods().get(storageName);
   if (p != null) {
    tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name()));
   }
   dt.getStorageTables().getStorageTable().add(tblElement);
  }
 }
 return dt;
}
origin: org.apache.lens/lens-api

public XDimensionTable withDimensionName(String value) {
  setDimensionName(value);
  return this;
}
origin: org.apache.lens/lens-api

public XDimensionTable withProperties(XProperties value) {
  setProperties(value);
  return this;
}
origin: apache/lens

public static XDimensionTable dimTableFromCubeDimTable(CubeDimensionTable cubeDimTable) {
 if (cubeDimTable == null) {
  return null;
 }
 XDimensionTable dimTab = XCF.createXDimensionTable();
 dimTab.setDimensionName(cubeDimTable.getDimName());
 dimTab.setTableName(cubeDimTable.getName());
 dimTab.setWeight(cubeDimTable.weight());
 dimTab.setColumns(new XColumns());
 dimTab.setProperties(new XProperties());
 dimTab.setStorageTables(new XStorageTables());
 for (FieldSchema column : cubeDimTable.getColumns()) {
  dimTab.getColumns().getColumn().add(columnFromFieldSchema(column));
 }
 dimTab.getProperties().getProperty().addAll(xPropertiesFromMap(cubeDimTable.getProperties()));
 return dimTab;
}
origin: apache/lens

public void alterCubeDimensionTable(XDimensionTable dimensionTable)
 throws LensException, HiveException {
 alterCubeDimensionTable(dimensionTable.getTableName(),
  JAXBUtils.cubeDimTableFromDimTable(dimensionTable),
  JAXBUtils.tableDescPrefixMapFromXStorageTables(dimensionTable.getStorageTables()));
}
origin: org.apache.lens/lens-client

public APIResult updateDimensionTable(XDimensionTable table) {
 String dimTableName = table.getTableName();
 WebTarget target = getMetastoreWebTarget();
 return translate(target.path("dimtables").path(dimTableName)
  .queryParam("sessionid", this.connection.getSessionHandle())
  .request(MediaType.APPLICATION_XML)
  .put(Entity.xml(new GenericEntity<JAXBElement<XDimensionTable>>(objFact.createXDimensionTable(table)){})));
}
origin: org.apache.lens/lens-cube

public XDimensionTable getXDimensionTable(CubeDimensionTable dimTable) throws LensException {
 XDimensionTable dt = JAXBUtils.dimTableFromCubeDimTable(dimTable);
 if (!dimTable.getStorages().isEmpty()) {
  for (String storageName : dimTable.getStorages()) {
   XStorageTableElement tblElement = JAXBUtils.getXStorageTableFromHiveTable(
    this.getHiveTable(MetastoreUtil.getFactOrDimtableStorageTableName(dimTable.getName(), storageName)));
   tblElement.setStorageName(storageName);
   UpdatePeriod p = dimTable.getSnapshotDumpPeriods().get(storageName);
   if (p != null) {
    tblElement.getUpdatePeriods().getUpdatePeriod().add(XUpdatePeriod.valueOf(p.name()));
   }
   dt.getStorageTables().getStorageTable().add(tblElement);
  }
 }
 return dt;
}
/**
origin: apache/lens

public XDimensionTable withDimensionName(String value) {
  setDimensionName(value);
  return this;
}
origin: apache/lens

public XDimensionTable withProperties(XProperties value) {
  setProperties(value);
  return this;
}
origin: apache/lens

public static CubeDimensionTable cubeDimTableFromDimTable(XDimensionTable dimensionTable) throws LensException {
 return new CubeDimensionTable(dimensionTable.getDimensionName(),
  dimensionTable.getTableName(),
  fieldSchemaListFromColumns(dimensionTable.getColumns()),
  dimensionTable.getWeight(),
  dumpPeriodsFromStorageTables(dimensionTable.getStorageTables()),
  mapFromXProperties(dimensionTable.getProperties()));
}
origin: apache/lens

private XDimensionTable createDimTable(String dimName, String table) {
 XDimensionTable dt = cubeObjectFactory.createXDimensionTable();
 dt.setDimensionName(dimName);
 dt.setTableName(table);
 dt.setWeight(15.0);
 dt.setColumns(new XColumns());
 dt.setProperties(new XProperties());
 dt.setStorageTables(new XStorageTables());
 XColumn c1 = cubeObjectFactory.createXColumn();
 c1.setName("col1");
 c1.setType("STRING");
 c1.setComment("Fisrt column");
 dt.getColumns().getColumn().add(c1);
 XColumn c2 = cubeObjectFactory.createXColumn();
 c2.setName("col2");
 c2.setType("INT");
 c2.setComment("Second column");
 dt.getColumns().getColumn().add(c2);
 XProperty p1 = cubeObjectFactory.createXProperty();
 p1.setName("foodim");
 p1.setValue("bardim");
 dt.getProperties().getProperty().add(p1);
 return dt;
}
origin: apache/lens

public APIResult updateDimensionTable(XDimensionTable table) {
 String dimTableName = table.getTableName();
 WebTarget target = getMetastoreWebTarget();
 return translate(target.path("dimtables").path(dimTableName)
  .queryParam("sessionid", this.connection.getSessionHandle())
  .request(MediaType.APPLICATION_XML)
  .put(Entity.xml(new GenericEntity<JAXBElement<XDimensionTable>>(objFact.createXDimensionTable(table)){})));
}
origin: apache/lens

public XDimensionTable withTableName(String value) {
  setTableName(value);
  return this;
}
origin: apache/lens

private XDimensionTable createDimTable(String dimTableName, MediaType mediaType) throws Exception {
 XDimension dimension = createDimension("testdim");
 APIResult result = target().path("metastore").path("dimensions")
  .queryParam("sessionid", lensSessionId).request(
   mediaType).post(Entity.entity(new GenericEntity<JAXBElement<XDimension>>(cubeObjectFactory
   .createXDimension(dimension)) {}, mediaType), APIResult.class);
 assertSuccess(result);
 XDimensionTable dt = createDimTable("testdim", dimTableName);
 dt.getStorageTables().getStorageTable().add(createStorageTblElement("test", dimTableName, "HOURLY"));
 result = target()
  .path("metastore")
  .path("dimtables").queryParam("sessionid", lensSessionId)
  .request(mediaType)
  .post(Entity.entity(
   new GenericEntity<JAXBElement<XDimensionTable>>(cubeObjectFactory.createXDimensionTable(dt)) {},
   mediaType), APIResult.class);
 assertSuccess(result);
 return dt;
}
org.apache.lens.api.metastoreXDimensionTable

Javadoc

DimensionTable which belongs to a Dimension. The columns in the dimension table will be a subset of all fields in Dimension.

Java class for x_dimension_table complex type.

The following schema fragment specifies the expected content contained within this class.

 
<complexType name="x_dimension_table"> 
<complexContent> 
<restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> 
<sequence> 
<element name="columns" type="{uri:lens:cube:0.1}x_columns"/> 
<element name="properties" type="{uri:lens:cube:0.1}x_properties" minOccurs="0"/> 
<element name="storage_tables" type="{uri:lens:cube:0.1}x_storage_tables" minOccurs="0"/> 
</sequence> 
<attribute name="dimension_name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 
<attribute name="table_name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> 
<attribute name="weight" use="required"> 
<simpleType> 
<restriction base="{http://www.w3.org/2001/XMLSchema}double"> 
<minInclusive value="0"/> 
</restriction> 
</simpleType> 
</attribute> 
</restriction> 
</complexContent> 
</complexType> 

Most used methods

  • getTableName
    Gets the value of the tableName property.
  • setTableName
    Sets the value of the tableName property.
  • getColumns
    Gets the value of the columns property.
  • getDimensionName
    Gets the value of the dimensionName property.
  • getProperties
    Gets the value of the properties property.
  • getStorageTables
    Gets the value of the storageTables property.
  • getWeight
    Gets the value of the weight property.
  • setColumns
    Sets the value of the columns property.
  • setDimensionName
    Sets the value of the dimensionName property.
  • setProperties
    Sets the value of the properties property.
  • setStorageTables
    Sets the value of the storageTables property.
  • setWeight
    Sets the value of the weight property.
  • setStorageTables,
  • setWeight,
  • <init>,
  • append,
  • appendFields,
  • equals,
  • hashCode

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • 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