congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
XPartition.setLocation
Code IndexAdd Tabnine to your IDE (free)

How to use
setLocation
method
in
org.apache.lens.api.metastore.XPartition

Best Java code snippets using org.apache.lens.api.metastore.XPartition.setLocation (Showing top 14 results out of 315)

origin: apache/lens

public XPartition withLocation(String value) {
  setLocation(value);
  return this;
}
origin: org.apache.lens/lens-api

public XPartition withLocation(String value) {
  setLocation(value);
  return this;
}
origin: apache/lens

private void createFactPartition(String fileName, String fact, String storage) throws JAXBException, IOException {
 XPartition partition = (XPartition) SampleMetastore.readFromXML(fileName);
 String partLocation = partition.getLocation();
 if (!partLocation.startsWith("/")) {
  partition.setLocation("file://" + System.getProperty("lens.home") + "/" + partLocation);
 }
 result = metaClient.addPartitionToFactTable(fact, storage, partition);
 if (result.getStatus().equals(APIResult.Status.FAILED)) {
  System.err.println("Adding partition from:" + fileName + " failed");
  retCode = 1;
 } else {
  System.out.println("Added partition from:" + fileName);
 }
}
origin: apache/lens

private void createDimTablePartition(String fileName, String dimTable, String storage)
 throws JAXBException, IOException {
 XPartition partition = (XPartition) SampleMetastore.readFromXML(fileName);
 String partLocation = partition.getLocation();
 if (!partLocation.startsWith("/")) {
  partition.setLocation("file://" + System.getProperty("lens.home") + "/" + partLocation);
 }
 result = metaClient.addPartitionToDimensionTable(dimTable, storage, partition);
 if (result.getStatus().equals(APIResult.Status.FAILED)) {
  System.err.println("Adding partition from:"+ fileName + " failed");
  retCode = 1;
 } else {
  System.out.println("Added partition from:" + fileName);
 }
}
origin: apache/lens

private void createFactPartitions(String fileName, String fact, String storage) throws JAXBException, IOException {
 XPartitionList partitionList = (XPartitionList) SampleMetastore.readFromXML(fileName);
 for (XPartition partition : partitionList.getPartition()) {
  String partLocation = partition.getLocation();
  if (!partLocation.startsWith("/")) {
   partition.setLocation("file://" + System.getProperty("lens.home") + "/" + partLocation);
  }
 }
 result = metaClient.addPartitionsToFactTable(fact, storage, partitionList);
 if (result.getStatus().equals(APIResult.Status.FAILED)) {
  System.err.println("Adding partitions from:" + fileName + " failed");
  retCode = 1;
 } else {
  System.out.println("Added partitions from:" + fileName);
 }
}
origin: apache/lens

private void createDimTablePartitions(String fileName, String dimTable, String storage)
 throws JAXBException, IOException {
 XPartitionList partitionList = (XPartitionList) SampleMetastore.readFromXML(fileName);
 for (XPartition partition : partitionList.getPartition()) {
  String partLocation = partition.getLocation();
  if (!partLocation.startsWith("/")) {
   partition.setLocation("file://" + System.getProperty("lens.home") + "/" + partLocation);
  }
 }
 result = metaClient.addPartitionsToDimensionTable(dimTable, storage, partitionList);
 if (result.getStatus().equals(APIResult.Status.FAILED)) {
  System.err.println("Adding partitions from:" + fileName + " failed");
  retCode = 1;
 } else {
  System.out.println("Added partitions from:" + fileName);
 }
}
origin: apache/lens

/**
 * Sets up query command instances and adds partitions to a table.
 * @throws Exception
 */
@BeforeClass
public void setup() throws Exception {
 LensClient client = new LensClient();
 LensCubeCommands command = new LensCubeCommands();
 command.setClient(client);
 log.debug("Starting to test cube commands");
 URL cubeSpec = TestLensQueryCommands.class.getClassLoader().getResource("schema/cubes/base/sample-cube.xml");
 command.createCube(new File(cubeSpec.toURI()));
 TestLensDimensionCommands.createDimension();
 TestLensDimensionTableCommands.addDim1Table("dim_table", "schema/dimtables/dim_table.xml", "local");
 // Add partition
 URL dataDir = TestLensQueryCommands.class.getClassLoader().getResource("dim2-part");
 XPartition xp = new XPartition();
 xp.setFactOrDimensionTableName("dim_table");
 xp.setLocation(new Path(dataDir.toURI()).toString());
 xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
 XTimePartSpec timePart = new XTimePartSpec();
 XTimePartSpecElement partElement = new XTimePartSpecElement();
 partElement.setKey("dt");
 partElement.setValue(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));
 timePart.getPartSpecElement().add(partElement);
 xp.setTimePartitionSpec(timePart);
 APIResult result = client.addPartitionToDim("dim_table", "local", xp);
 assertEquals(result.getStatus(), APIResult.Status.SUCCEEDED);
}
origin: apache/lens

private XPartition createPartition(String cubeTableName, final List<XTimePartSpecElement>
  timePartSpecs, String updatePeriod) {
 XPartition xp = cubeObjectFactory.createXPartition();
 xp.setLocation(new Path(new File("target").getAbsolutePath(), "part/test_part").toString());
 xp.setFactOrDimensionTableName(cubeTableName);
 xp.setNonTimePartitionSpec(new XPartSpec());
 xp.setTimePartitionSpec(new XTimePartSpec());
 xp.setPartitionParameters(new XProperties());
 xp.setSerdeParameters(new XProperties());
 for (XTimePartSpecElement timePartSpec : timePartSpecs) {
  xp.getTimePartitionSpec().getPartSpecElement().add(timePartSpec);
 }
 if (updatePeriod==null) {
  xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
 } else {
  XUpdatePeriod updatePeriod1=XUpdatePeriod.valueOf(updatePeriod.toUpperCase());
  xp.setUpdatePeriod(updatePeriod1);
 }
 return xp;
}
origin: org.apache.lens/lens-cube

xp.setSerdeParameters(new XProperties());
xp.setName(p.getCompleteName());
xp.setLocation(p.getLocation());
xp.setInputFormat(p.getInputFormatClass().getCanonicalName());
xp.setOutputFormat(p.getOutputFormatClass().getCanonicalName());
origin: apache/lens

xp.setSerdeParameters(new XProperties());
xp.setName(p.getCompleteName());
xp.setLocation(p.getLocation());
xp.setInputFormat(p.getInputFormatClass().getCanonicalName());
xp.setOutputFormat(p.getOutputFormatClass().getCanonicalName());
origin: apache/lens

assertEquals(partAddResult.getStatus(), Status.FAILED);
xp.setLocation(xp.getLocation() + "/a/b/c");
APIResult partUpdateResult = target().path("metastore/facts/").path(table).path("storages/S1/partition")
 .queryParam("sessionid", lensSessionId).request(mediaType)
origin: apache/lens

XPartition xp = new XPartition();
xp.setFactOrDimensionTableName("dim_table");
xp.setLocation(new File("target/test-classes/dim2-part").getAbsolutePath());
xp.setUpdatePeriod(XUpdatePeriod.HOURLY);
XTimePartSpec timePart = new XTimePartSpec();
origin: apache/lens

xp.setLocation(xp.getLocation() + "/a/b/c");
APIResult partUpdateResult = target().path("metastore/dimtables/").path(table).path("storages/test/partition")
 .queryParam("sessionid", lensSessionId).request(mediaType)
origin: apache/lens

assertEquals(partAddResult.getStatus(), Status.FAILED);
xp.setLocation(xp.getLocation() + "/a/b/c");
APIResult partUpdateResult = target().path("metastore/facts/").path(table).path("storages/S2/partition")
 .queryParam("sessionid", lensSessionId)
org.apache.lens.api.metastoreXPartitionsetLocation

Javadoc

Sets the value of the location property.

Popular methods of XPartition

  • setFactOrDimensionTableName
    Sets the value of the factOrDimensionTableName property.
  • setTimePartitionSpec
    Sets the value of the timePartitionSpec property.
  • setUpdatePeriod
    Sets the value of the updatePeriod property.
  • <init>
  • getLocation
    Gets the value of the location property.
  • getUpdatePeriod
    Gets the value of the updatePeriod property.
  • getFactOrDimensionTableName
    Gets the value of the factOrDimensionTableName property.
  • getFullPartitionSpec
    Gets the value of the fullPartitionSpec property.
  • getNonTimePartitionSpec
    Gets the value of the nonTimePartitionSpec property.
  • getTimePartitionSpec
    Gets the value of the timePartitionSpec property.
  • setNonTimePartitionSpec
    Sets the value of the nonTimePartitionSpec property.
  • setPartitionParameters
    Sets the value of the partitionParameters property.
  • setNonTimePartitionSpec,
  • setPartitionParameters,
  • setSerdeParameters,
  • getInputFormat,
  • getOutputFormat,
  • getPartitionParameters,
  • getSerdeClassname,
  • getSerdeParameters,
  • setFullPartitionSpec

Popular in Java

  • Finding current android device location
  • getApplicationContext (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JTextField (javax.swing)
  • Top plugins for WebStorm
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