Package org.apache.ambari.server.api.query

Examples of org.apache.ambari.server.api.query.QueryInfo


  //todo: Need to do some refactoring to do this.
  //todo: BaseResourceDefinition.BaseHrefPostProcessor calls static ClusterControllerHelper.getClusterController().


  private TreeNode<QueryInfo> createPropertyTree() {
    TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<QueryInfo>(null, new QueryInfo(
        new ClusterResourceDefinition(), new HashSet<String>()), "Cluster");
    Set<String> clusterProperties = propertyTree.getObject().getProperties();
    clusterProperties.add("Clusters/cluster_name");
    clusterProperties.add("Clusters/version");
    clusterProperties.add("Clusters/prop1");
View Full Code Here


    return propertyTree;
  }

  private TreeNode<QueryInfo> createPropertyTreeWithSubProps() {
    TreeNode<QueryInfo> propertyTree = new TreeNodeImpl<QueryInfo>(null, new QueryInfo(
        new ClusterResourceDefinition(), new HashSet<String>()), "Cluster");
    Set<String> clusterProperties = propertyTree.getObject().getProperties();
    clusterProperties.add("Clusters/cluster_name");
    clusterProperties.add("Clusters/version");
    clusterProperties.add("Clusters/prop1");
    clusterProperties.add("foo");

    propertyTree.addChild(new QueryInfo(new HostResourceDefinition(), new HashSet<String>()), "Host");
    propertyTree.getChild("Host").getObject().getProperties().add("foo");

    return propertyTree;
  }
View Full Code Here

  @Override
  public TreeNode<Set<String>> finalizeProperties(
      TreeNode<QueryInfo> queryTree, boolean isCollection) {

    QueryInfo queryInfo = queryTree.getObject();
    TreeNode<Set<String>> resultTree = new TreeNodeImpl<Set<String>>(
        null, queryInfo.getProperties(), queryTree.getName());

    copyPropertiesToResult(queryTree, resultTree);

    m_rootType     = queryTree.getObject().getResource().getType();
    m_isCollection = isCollection;
View Full Code Here

   * properties against.
   *
   * @param queryTree  query tree to process
   */
  private void processRequestedProperties(TreeNode<QueryInfo> queryTree) {
    QueryInfo queryInfo = queryTree.getObject();
    if (queryInfo != null) {
      Resource.Type type = queryInfo.getResource().getType();
      Set<String> properties = m_originalProperties.get(type);
      if (properties == null) {
        properties = new HashSet<String>();
        m_originalProperties.put(type, properties);
      }
      properties.addAll(queryInfo.getProperties());
      for (TreeNode<QueryInfo> child : queryTree.getChildren()) {
        processRequestedProperties(child);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.ambari.server.api.query.QueryInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.