Search in sources :

Example 6 with Namespace

use of com.emc.ecs.management.entity.Namespace in project ecs-dashboard by carone1.

the class NamespaceBO method collectNamespaceQuota.

/**
 * Gathers all namespaces quota present on a cluster
 *
 * @return List - List of namespace quota
 */
public void collectNamespaceQuota(Date collectionTime) {
    // Start collecting namespace data quota from ECS systems
    List<Namespace> namespaceList = getNamespaces();
    // At this point we should have all the namespace supported by the ECS
    // system
    long objCounter = 0;
    for (Namespace namespace : namespaceList) {
        NamespaceRequest namespaceRequest = new NamespaceRequest();
        namespaceRequest.setName(namespace.getName());
        LOGGER.info("Collecting Quota Details for namespace: " + namespace.getName());
        NamespaceQuota namespaceQuota = client.getNamespaceQuota(namespaceRequest);
        if (namespaceQuota == null) {
            continue;
        }
        objCounter++;
        // Push collected details into datastore
        if (namespaceDAO != null) {
            // insert something
            namespaceDAO.insert(namespaceQuota, collectionTime);
        }
    }
    // peg global counter
    this.objectCount.getAndAdd(objCounter);
}
Also used : NamespaceQuota(com.emc.ecs.management.entity.NamespaceQuota) ListNamespaceRequest(com.emc.ecs.management.entity.ListNamespaceRequest) NamespaceRequest(com.emc.ecs.management.entity.NamespaceRequest) Namespace(com.emc.ecs.management.entity.Namespace)

Aggregations

Namespace (com.emc.ecs.management.entity.Namespace)6 ListNamespaceRequest (com.emc.ecs.management.entity.ListNamespaceRequest)5 NamespaceRequest (com.emc.ecs.management.entity.NamespaceRequest)3 ListNamespacesResult (com.emc.ecs.management.entity.ListNamespacesResult)2 ObjectBucket (com.emc.ecs.management.entity.ObjectBucket)2 ArrayList (java.util.ArrayList)2 BucketBillingInfo (com.emc.ecs.management.entity.BucketBillingInfo)1 NamespaceBillingInfo (com.emc.ecs.management.entity.NamespaceBillingInfo)1 NamespaceDetail (com.emc.ecs.management.entity.NamespaceDetail)1 NamespaceQuota (com.emc.ecs.management.entity.NamespaceQuota)1 ObjectBuckets (com.emc.ecs.management.entity.ObjectBuckets)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Set (java.util.Set)1