Package org.apache.commons.lang.mutable

Examples of org.apache.commons.lang.mutable.MutableInt.intValue()


          "duration should be equal to or less than %s", agentManager.getMaxRunHour());
    }
    Map<String, MutableInt> agentCountMap = agentManagerService.getAvailableAgentCountMap(user);
    MutableInt agentCountObj = agentCountMap.get(isClustered() ? newOne.getRegion() : Config.NONE_REGION);
    checkNotNull(agentCountObj, "region should be within current region list");
    int agentMaxCount = agentCountObj.intValue();
    checkArgument(newOne.getAgentCount() <= agentMaxCount, "test agent should be equal to or less than %s",
        agentMaxCount);
    if (newOne.getStatus().equals(Status.READY)) {
      checkArgument(newOne.getAgentCount() >= 1, "agentCount should be more than 1 when it's READY status.");
    }
View Full Code Here


      newOne.setAgentCount(0);
    }
    Map<String, MutableInt> agentCountMap = agentManagerService.getAvailableAgentCountMap(user);
    MutableInt agentCountObj = agentCountMap.get(isClustered() ? test.getRegion() : Config.NONE_REGION);
    checkNotNull(agentCountObj, "test region should be within current region list");
    int agentMaxCount = agentCountObj.intValue();
    checkArgument(newOne.getAgentCount() != 0, "test agent should not be %s", agentMaxCount);
    checkArgument(newOne.getAgentCount() <= agentMaxCount, "test agent should be equal to or less than %s",
        agentMaxCount);
    PerfTest savePerfTest = perfTestService.save(user, newOne);
    CoreLogger.LOGGER.info("test {} is created through web api by {}", savePerfTest.getId(), user.getUserId());
View Full Code Here

    int maxAgentSizePerConsole = getMaxAgentSizePerConsole();

    for (String region : regions) {
      MutableInt mutableInt = availShareAgents.get(region);
      int shareAgentCount = mutableInt.intValue();
      mutableInt.setValue(Math.min(shareAgentCount, maxAgentSizePerConsole));
      mutableInt.add(availUserOwnAgent.get(region));
    }
    return availShareAgents;
  }
View Full Code Here

      public boolean progress() {
        long t = EnvironmentEdgeManager.currentTimeMillis();
        if ((t - last_report_at) > reportPeriod) {
          last_report_at = t;
          int latestZKVersion =
              attemptToOwnTask(false, watcher, serverName, curTask, mode, zkVersion.intValue());
          if (latestZKVersion < 0) {
            LOG.warn("Failed to heartbeat the task" + curTask);
            return false;
          }
          zkVersion.setValue(latestZKVersion);
View Full Code Here

        if (count == null) {
          count = new MutableInt();
          filesMap.put(lqi.family, count);
        }
        count.increment();
        if (count.intValue() > maxFilesPerRegionPerFamily) {
          LOG.error("Trying to load more than " + maxFilesPerRegionPerFamily
            + " hfiles to family " + Bytes.toStringBinary(lqi.family)
            + " of region with start key "
            + Bytes.toStringBinary(e.getKey()));
          return false;
View Full Code Here

                });
            }
        });
       
        //Verify all aggrs created
        assertEquals(1152, aggrs.intValue());
       


        //Find aggrs for one day
        this.execute(new CallableWithoutResult() {
View Full Code Here

                });
            }
        });
       
        //Verify all aggrs created
        assertEquals(2, aggrs.intValue());

        //Find unclosed 1 aggr
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
View Full Code Here

                            for (int u = 0; u < r.nextInt(50); u++) {
                                updateAggregation(intervalInfo, baseAggregationA, r);
                                updateAggregation(intervalInfo, baseAggregationB, r);
                            }
                            
                            if (aggrs.intValue() % 4 == 0) {
                                baseAggregationA.intervalComplete(5);
                            }
                            baseAggregationB.intervalComplete(5);
                            
                            getAggregationDao().updateAggregation(baseAggregationA);
View Full Code Here

                });
            }
        });
       
        //Verify all aggrs created
        assertEquals(4, aggrs.intValue());

        //Find unclosed 1 aggr
        this.execute(new CallableWithoutResult() {
            @Override
            protected void callWithoutResult() {
View Full Code Here

        }
       
        //Store the results of the aggregation
        eventAggregationManagementDao.updateEventAggregatorStatus(eventAggregatorStatus);
       
        complete = complete && (this.eventAggregationBatchSize <= 0 || events.intValue() < this.eventAggregationBatchSize);
        return new EventProcessingResult(events.intValue(), lastAggregated, eventAggregatorStatus.getLastEventDate(), complete);
    }
   
    /**
     * Helper class that loads and caches the interval configuration for each aggregator as well as the union of intervals handled by the set of aggregators.
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.