Examples of TagLists


Examples of com.netflix.ice.reader.TagLists

    }

    public Map<Tag, TagLists> getTagListsMap(Interval interval, TagLists tagLists, TagType groupBy, boolean forReservation) {
        Map<Tag, TagLists> result = Maps.newHashMap();

        TagLists tagListsForTag = tagLists;
        if (groupBy != TagType.ResourceGroup && tagLists.resourceGroups != null && tagLists.resourceGroups.size() > 0) {
            tagListsForTag = new TagLists(tagLists.accounts, tagLists.regions, tagLists.zones, tagLists.products, tagLists.operations, tagLists.usageTypes);
        }

        List<Tag> groupByTags = Lists.newArrayList();
        switch (groupBy) {
            case Account:
                groupByTags.addAll(getAccounts(interval, tagListsForTag));
                break;
            case Region:
                groupByTags.addAll(getRegions(interval, tagListsForTag));
                break;
            case Zone:
                groupByTags.addAll(getZones(interval, tagListsForTag));
                break;
            case Product:
                groupByTags.addAll(getProducts(interval, tagListsForTag));
                break;
            case Operation:
                groupByTags.addAll(getOperations(interval, tagListsForTag));
                break;
            case UsageType:
                groupByTags.addAll(getUsageTypes(interval, tagListsForTag));
                break;
            case ResourceGroup:
                groupByTags.addAll(getResourceGroups(interval, tagListsForTag));
                break;
        }
        if (groupBy == TagType.Operation && !forReservation) {
            for (Operation.ReservationOperation lentOp: Operation.getLentInstances())
                groupByTags.remove(lentOp);
        }
        for (Tag tag: groupByTags) {
            if (tagLists.contains(tag, groupBy)) {
                TagLists tmp = tagLists.getTagLists(tag, groupBy);
                if (!forReservation && groupBy != TagType.Operation) {
                    if (tmp.operations == null || tmp.operations.size() == 0) {
                        List<Operation> operations = Lists.newArrayList(getOperations(tmp));
                        tmp = new TagLists(tmp.accounts, tmp.regions, tmp.zones, tmp.products, operations, tmp.usageTypes, tmp.resourceGroups);
                    }
                    for (Operation.ReservationOperation lentOp: Operation.getLentInstances())
                        tmp.operations.remove(lentOp);
                }
                result.put(tag, tmp);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.