gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-20 15:01:40 33 4
gpt4 key购买 nike

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

XJoinChains.getJoinChain介绍

[英]Gets the value of the joinChain 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 joinChain property.

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

getJoinChain().add(newItem);

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

getJoinChain().add(newItem);

列表XJoinChain中允许以下类型的对象

代码示例

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

public XJoinChains withJoinChain(XJoinChain... values) {
  if (values!= null) {
    for (XJoinChain value: values) {
      getJoinChain().add(value);
    }
  }
  return this;
}

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

public XJoinChains withJoinChain(XJoinChain... values) {
  if (values!= null) {
    for (XJoinChain value: values) {
      getJoinChain().add(value);
    }
  }
  return this;
}

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

public XJoinChains withJoinChain(Collection<XJoinChain> values) {
  if (values!= null) {
    getJoinChain().addAll(values);
  }
  return this;
}

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

public XJoinChains withJoinChain(Collection<XJoinChain> values) {
  if (values!= null) {
    getJoinChain().addAll(values);
  }
  return this;
}

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

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    List<XJoinChain> theJoinChain;
    theJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    strategy.appendField(locator, this, "joinChain", buffer, theJoinChain);
  }
  return buffer;
}

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

public StringBuilder appendFields(ObjectLocator locator, StringBuilder buffer, ToStringStrategy strategy) {
  {
    List<XJoinChain> theJoinChain;
    theJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    strategy.appendField(locator, this, "joinChain", buffer, theJoinChain);
  }
  return buffer;
}

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

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    List<XJoinChain> theJoinChain;
    theJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "joinChain", theJoinChain), currentHashCode, theJoinChain);
  }
  return currentHashCode;
}

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

public int hashCode(ObjectLocator locator, HashCodeStrategy strategy) {
  int currentHashCode = 1;
  {
    List<XJoinChain> theJoinChain;
    theJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    currentHashCode = strategy.hashCode(LocatorUtils.property(locator, "joinChain", theJoinChain), currentHashCode, theJoinChain);
  }
  return currentHashCode;
}

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

public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
  if (!(object instanceof XJoinChains)) {
    return false;
  }
  if (this == object) {
    return true;
  }
  final XJoinChains that = ((XJoinChains) object);
  {
    List<XJoinChain> lhsJoinChain;
    lhsJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    List<XJoinChain> rhsJoinChain;
    rhsJoinChain = (((that.joinChain!= null)&&(!that.joinChain.isEmpty()))?that.getJoinChain():null);
    if (!strategy.equals(LocatorUtils.property(thisLocator, "joinChain", lhsJoinChain), LocatorUtils.property(thatLocator, "joinChain", rhsJoinChain), lhsJoinChain, rhsJoinChain)) {
      return false;
    }
  }
  return true;
}

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

public boolean equals(ObjectLocator thisLocator, ObjectLocator thatLocator, Object object, EqualsStrategy strategy) {
  if (!(object instanceof XJoinChains)) {
    return false;
  }
  if (this == object) {
    return true;
  }
  final XJoinChains that = ((XJoinChains) object);
  {
    List<XJoinChain> lhsJoinChain;
    lhsJoinChain = (((this.joinChain!= null)&&(!this.joinChain.isEmpty()))?this.getJoinChain():null);
    List<XJoinChain> rhsJoinChain;
    rhsJoinChain = (((that.joinChain!= null)&&(!that.joinChain.isEmpty()))?that.getJoinChain():null);
    if (!strategy.equals(LocatorUtils.property(thisLocator, "joinChain", lhsJoinChain), LocatorUtils.property(thatLocator, "joinChain", rhsJoinChain), lhsJoinChain, rhsJoinChain)) {
      return false;
    }
  }
  return true;
}

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

@Override
public String toString() {
 return new CollectionTable<>(xJoinChains.getJoinChain(), new CollectionTable.RowProvider<XJoinChain>() {
  @Override
  public String[][] getRows(XJoinChain element) {

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

public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException {
 Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>();
 for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) {
  dims.add(hiveDimAttrFromXDimAttr(xd));
 }
 Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>();
 if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) {
  for (XExprColumn xe : dimension.getExpressions().getExpression()) {
   expressions.add(hiveExprColumnFromXExprColumn(xe));
  }
 }
 Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>();
 if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) {
  for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) {
   joinchains.add(joinChainFromXJoinChain(xj));
  }
 }
 Map<String, String> properties = mapFromXProperties(dimension.getProperties());
 return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L);
}

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

public static Dimension dimensionFromXDimension(XDimension dimension) throws LensException {
 Set<CubeDimAttribute> dims = new LinkedHashSet<CubeDimAttribute>();
 for (XDimAttribute xd : dimension.getAttributes().getDimAttribute()) {
  dims.add(hiveDimAttrFromXDimAttr(xd));
 }
 Set<ExprColumn> expressions = new LinkedHashSet<ExprColumn>();
 if (dimension.getExpressions() != null && !dimension.getExpressions().getExpression().isEmpty()) {
  for (XExprColumn xe : dimension.getExpressions().getExpression()) {
   expressions.add(hiveExprColumnFromXExprColumn(xe));
  }
 }
 Set<JoinChain> joinchains = new LinkedHashSet<JoinChain>();
 if (dimension.getJoinChains() != null && !dimension.getJoinChains().getJoinChain().isEmpty()) {
  for (XJoinChain xj : dimension.getJoinChains().getJoinChain()) {
   joinchains.add(joinChainFromXJoinChain(xj));
  }
 }
 Map<String, String> properties = mapFromXProperties(dimension.getProperties());
 return new Dimension(dimension.getName(), dims, expressions, joinchains, properties, 0L);
}

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

@Override
public XJoinChains getAllJoinChains(LensSessionHandle sessionHandle, String tableName) throws LensException {
 try (SessionContext ignored = new SessionContext(sessionHandle)){
  CubeMetastoreClient client = getClient(sessionHandle);
  Set<JoinChain> chains;
  if (client.isCube(tableName)) {
   chains = client.getCube(tableName).getJoinChains();
  } else if (client.isDimension(tableName)) {
   chains = client.getDimension(tableName).getJoinChains();
  } else {
   throw new BadRequestException("Can't get join chains. '"
    + tableName + "' is neither a cube nor a dimension");
  }
  XJoinChains xJoinChains = new XJoinChains();
  List<XJoinChain> joinChains = xJoinChains.getJoinChain();
  if (chains != null) {
   for (JoinChain chain : chains) {
    joinChains.add(JAXBUtils.getXJoinChainFromJoinChain(chain));
   }
  }
  return xJoinChains;
 }
}

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

public static XDimension xdimensionFromDimension(Dimension dimension) {
 XDimension xd = XCF.createXDimension();
 xd.setName(dimension.getName());
 xd.setAttributes(new XDimAttributes());
 xd.setExpressions(new XExpressions());
 xd.setJoinChains(new XJoinChains());
 xd.setProperties(new XProperties());
 xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties()));
 for (CubeDimAttribute cd : dimension.getAttributes()) {
  xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension));
 }
 for (ExprColumn ec : dimension.getExpressions()) {
  xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec));
 }
 for (JoinChain jc : dimension.getJoinChains()) {
  xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc));
 }
 return xd;
}

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

public static XDimension xdimensionFromDimension(Dimension dimension) {
 XDimension xd = XCF.createXDimension();
 xd.setName(dimension.getName());
 xd.setAttributes(new XDimAttributes());
 xd.setExpressions(new XExpressions());
 xd.setJoinChains(new XJoinChains());
 xd.setProperties(new XProperties());
 xd.getProperties().getProperty().addAll(xPropertiesFromMap(((AbstractCubeTable) dimension).getProperties()));
 for (CubeDimAttribute cd : dimension.getAttributes()) {
  xd.getAttributes().getDimAttribute().add(xDimAttrFromHiveDimAttr(cd, dimension));
 }
 for (ExprColumn ec : dimension.getExpressions()) {
  xd.getExpressions().getExpression().add(xExprColumnFromHiveExprColumn(ec));
 }
 for (JoinChain jc : dimension.getJoinChains()) {
  xd.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc));
 }
 return xd;
}

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

xbc.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc));

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

xbc.getJoinChains().getJoinChain().add(getXJoinChainFromJoinChain(jc));

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

chain2.getPaths().getPath().add(path2);
chain2.setDestTable("test_dim");
chains.getJoinChain().add(chain2);
chains.getJoinChain().add(chain1);
XJoinChains chainsInDiffOrder = new XJoinChains();
chainsInDiffOrder.getJoinChain().add(chain1);
chainsInDiffOrder.getJoinChain().add(chain2);
assertTrue(joinChains.equals(new XJoinChainTable(chains).toString())
  || joinChains.equals(new XJoinChainTable(chainsInDiffOrder).toString()));

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

private void testJoinChains(LensDimensionCommands command) {
 XJoinChains chains = new XJoinChains();
 XJoinChain chain1 = new XJoinChain();
 chain1.setPaths(new XJoinPaths());
 XJoinPath path = new XJoinPath();
 path.setEdges(new XJoinEdges());
 XJoinEdge edge1 = new XJoinEdge();
 XTableReference ref1 = new XTableReference();
 ref1.setTable("test_dim");
 ref1.setColumn("d2id");
 XTableReference ref2 = new XTableReference();
 ref2.setTable("test_detail");
 ref2.setColumn("id");
 edge1.setFrom(ref1);
 edge1.setTo(ref2);
 path.getEdges().getEdge().add(edge1);
 chain1.setName("dim2chain");
 chain1.getPaths().getPath().add(path);
 chain1.setDestTable("test_detail");
 chains.getJoinChain().add(chain1);
 assertEquals(command.showJoinChains("test_dim"), new XJoinChainTable(chains).toString());
}

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