gpt4 book ai didi

org.apache.lens.api.metastore.XPartitionList.getPartition()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 20:24:40 27 4
gpt4 key购买 nike

本文整理了Java中org.apache.lens.api.metastore.XPartitionList.getPartition()方法的一些代码示例,展示了XPartitionList.getPartition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XPartitionList.getPartition()方法的具体详情如下:
包路径:org.apache.lens.api.metastore.XPartitionList
类名称:XPartitionList
方法名:getPartition

XPartitionList.getPartition介绍

[英]Gets the value of the partition property.

This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a set method for the partition property.

For example, to add a new item, do as follows:

getPartition().add(newItem);

Objects of the following type(s) are allowed in the list XPartition
[中]获取分区属性的值。
此访问器方法返回对实时列表的引用,而不是快照。因此,对返回列表所做的任何修改都将出现在JAXB对象中。这就是为什么分区属性没有set方法。
例如,要添加新项目,请执行以下操作:

getPartition().add(newItem);

列表X分区中允许使用以下类型的对象

代码示例

代码示例来源:origin: apache/lens

public XPartitionList withPartition(XPartition... values) {
  if (values!= null) {
    for (XPartition value: values) {
      getPartition().add(value);
    }
  }
  return this;
}

代码示例来源:origin: org.apache.lens/lens-api

public XPartitionList withPartition(Collection<XPartition> values) {
  if (values!= null) {
    getPartition().addAll(values);
  }
  return this;
}

代码示例来源:origin: org.apache.lens/lens-api

public XPartitionList withPartition(XPartition... values) {
  if (values!= null) {
    for (XPartition value: values) {
      getPartition().add(value);
    }
  }
  return this;
}

代码示例来源:origin: apache/lens

public XPartitionList withPartition(Collection<XPartition> values) {
  if (values!= null) {
    getPartition().addAll(values);
  }
  return this;
}

代码示例来源:origin: org.apache.lens/lens-cube

public static List<StoragePartitionDesc> storagePartSpecListFromXPartitionList(
 final XPartitionList xpartList) {
 ArrayList<StoragePartitionDesc> ret = new ArrayList<StoragePartitionDesc>();
 for (XPartition xpart : xpartList.getPartition()) {
  ret.add(storagePartSpecFromXPartition(xpart));
 }
 return ret;
}

代码示例来源:origin: apache/lens

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    List<XPartition> thePartition;
    thePartition = (((this.partition!= null)&&(!this.partition.isEmpty()))?this.getPartition():null);
    strategy.appendField(locator, this, "partition", buffer, thePartition);
  }
  return buffer;
}

代码示例来源:origin: apache/lens

public static XPartitionList xpartitionListFromPartitionList(String cubeTableName, List<Partition> partitions,
 List<String> timePartCols) throws HiveException {
 XPartitionList xPartitionList = new XPartitionList();
 xPartitionList.getPartition();
 if (partitions != null) {
  for (Partition partition : partitions) {
   xPartitionList.getPartition().add(xpartitionFromPartition(cubeTableName, partition, timePartCols));
  }
 }
 return xPartitionList;
}

代码示例来源:origin: apache/lens

public static List<StoragePartitionDesc> storagePartSpecListFromXPartitionList(
 final XPartitionList xpartList) {
 ArrayList<StoragePartitionDesc> ret = new ArrayList<StoragePartitionDesc>();
 for (XPartition xpart : xpartList.getPartition()) {
  ret.add(storagePartSpecFromXPartition(xpart));
 }
 return ret;
}

代码示例来源:origin: org.apache.lens/lens-api

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    List<XPartition> thePartition;
    thePartition = (((this.partition!= null)&&(!this.partition.isEmpty()))?this.getPartition():null);
    strategy.appendField(locator, this, "partition", buffer, thePartition);
  }
  return buffer;
}

代码示例来源:origin: org.apache.lens/lens-cube

public static XPartitionList xpartitionListFromPartitionList(String cubeTableName, List<Partition> partitions,
 List<String> timePartCols) throws HiveException {
 XPartitionList xPartitionList = new XPartitionList();
 xPartitionList.getPartition();
 if (partitions != null) {
  for (Partition partition : partitions) {
   xPartitionList.getPartition().add(xpartitionFromPartition(cubeTableName, partition, timePartCols));
  }
 }
 return xPartitionList;
}

代码示例来源:origin: apache/lens

public List<XPartition> getAllPartitionsOfDimensionTable(String dimTblName, String storage,
 String filter) {
 WebTarget target = getMetastoreWebTarget();
 JAXBElement<XPartitionList> partList = target.path("dimtables").path(dimTblName)
  .path("storages").path(storage).path("partitions")
  .queryParam("sessionid", this.connection.getSessionHandle())
  .queryParam("filter", filter)
  .request(MediaType.APPLICATION_XML)
  .get(new GenericType<JAXBElement<XPartitionList>>() {
  });
 return partList.getValue().getPartition();
}

代码示例来源:origin: apache/lens

public List<XPartition> getPartitionsOfFactTable(String factName, String storage, String filter) {
 WebTarget target = getMetastoreWebTarget();
 JAXBElement<XPartitionList> elements = target.path("facts").path(factName)
  .path("storages").path(storage).path("partitions")
  .queryParam("sessionid", this.connection.getSessionHandle())
  .queryParam("filter", filter)
  .request(MediaType.APPLICATION_XML)
  .get(new GenericType<JAXBElement<XPartitionList>>() {
  });
 return elements.getValue().getPartition();
}

代码示例来源:origin: org.apache.lens/lens-client

public List<XPartition> getPartitionsOfFactTable(String factName, String storage, String filter) {
 WebTarget target = getMetastoreWebTarget();
 JAXBElement<XPartitionList> elements = target.path("facts").path(factName)
  .path("storages").path(storage).path("partitions")
  .queryParam("sessionid", this.connection.getSessionHandle())
  .queryParam("filter", filter)
  .request(MediaType.APPLICATION_XML)
  .get(new GenericType<JAXBElement<XPartitionList>>() {
  });
 return elements.getValue().getPartition();
}

代码示例来源:origin: org.apache.lens/lens-client

public List<XPartition> getAllPartitionsOfDimensionTable(String dimTblName, String storage,
 String filter) {
 WebTarget target = getMetastoreWebTarget();
 JAXBElement<XPartitionList> partList = target.path("dimtables").path(dimTblName)
  .path("storages").path(storage).path("partitions")
  .queryParam("sessionid", this.connection.getSessionHandle())
  .queryParam("filter", filter)
  .request(MediaType.APPLICATION_XML)
  .get(new GenericType<JAXBElement<XPartitionList>>() {
  });
 return partList.getValue().getPartition();
}

代码示例来源:origin: apache/lens

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    List<XPartition> thePartition;
    thePartition = (((this.partition!= null)&&(!this.partition.isEmpty()))?this.getPartition():null);
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "partition", thePartition), currentHashCode, thePartition);
  }
  return currentHashCode;
}

代码示例来源:origin: org.apache.lens/lens-api

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    List<XPartition> thePartition;
    thePartition = (((this.partition!= null)&&(!this.partition.isEmpty()))?this.getPartition():null);
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "partition", thePartition), currentHashCode, thePartition);
  }
  return currentHashCode;
}

代码示例来源:origin: apache/lens

private void checkNonNullPartitionList(XPartitionList partitions) {
 checkNonNullArgs("Partition List is null", partitions);
 checkNonNullArgs("One partition is null", partitions.getPartition().toArray());
}

代码示例来源:origin: apache/lens

private XPartitionList toXPartitionList(final XPartition... xps) {
 XPartitionList ret = new XPartitionList();
 Collections.addAll(ret.getPartition(), xps);
 return ret;
}

代码示例来源: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

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);
 }
}

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com