Package org.radargun

Examples of org.radargun.Operation


      @Override
      public Object run() throws RequestException {
         Random random = stressor.getRandom();
         Object key = keyGenerator.generateKey(keySelector.next());
         Operation operation = operationSelector.next(random);
         Object newValue = valueGenerator.generateValue(key, entrySize.next(random), random);
         boolean shouldMatch = matchSelector.shouldMatch();

         Object oldValue = stressor.makeRequest(new Invocations.Get(basicCache, key));
View Full Code Here


            if (!value && !expectLostKeys) {
               log.error("REMOVE: Entry for key " + pair.key + " was not found!");
            }
            return value;
         } else {
            Operation operation = operationSelector.next(random);
            if (operation == BasicOperations.GET && minRemoveTimestamp < Long.MAX_VALUE) {
               Load load = null;
               for (int attempt = 0; attempt < 100; ++attempt) {
                  load = loadForSize.get(entrySize.next(random));
                  if (!load.scheduledKeys.isEmpty()) break;
View Full Code Here

      @Override
      public Object run() throws RequestException {
         Object key = keyGenerator.generateKey(keySelector.next());
         Random random = stressor.getRandom();
         Operation operation = operationSelector.next(random);

         Invocation invocation;
         if (operation == BasicOperations.GET) {
            invocation = new Invocations.Get(cache, key);
            return stressor.makeRequest(invocation);
View Full Code Here

      return keySelectorRandom.nextLong() % numEntries;
   }

   @Override
   protected boolean invokeLogic(long keyId) throws Exception {
      Operation operation = manager.getOperation(operationTypeRandom);

      // In shared mode, we can't ever atomically modify the two keys (main and backup) to have only
      // one of them with the actual value (this is not true even for private mode but there the moment
      // when we move the value from main to backup or vice versa does not cause any problem, because the
      // worst thing is to read slightly outdated value). However, here the invariant holds that the operation
View Full Code Here

   }

   private boolean checkedPutValue(long keyId, SharedLogValue oldValue, SharedLogValue newValue) throws Exception {
      boolean returnValue;
      long startTime = System.nanoTime();
      Operation operation = Operation.UNKNOWN;
      try {
         if (oldValue == null) {
            operation = ConditionalOperations.PUT_IF_ABSENT;
            returnValue = conditionalCache.putIfAbsent(keyGenerator.generateKey(keyId), newValue);
         } else {
View Full Code Here

      return keySelectorRandom.nextInt(keyRangeEnd - keyRangeStart) + keyRangeStart;
   }

   @Override
   protected boolean invokeLogic(long keyId) throws Exception {
      Operation operation = manager.getOperation(operationTypeRandom);

      // first we have to get the value
      PrivateLogValue prevValue = checkedGetValue(keyId);
      // now for modify operations, execute it
      if (prevValue == null || operation == BasicOperations.PUT) {
View Full Code Here

      }

      @Override
      public Object run() throws RequestException {
         Random random = stressor.getRandom();
         Operation operation = operationSelector.next(random);

         Invocation invocation;
         if (operation == BulkOperations.PUT_ALL_NATIVE || operation == BulkOperations.PUT_ALL_ASYNC) {
            Map<Object, Object> map = new HashMap<>(bulkSize);
            for (int i = 0; i < bulkSize;) {
View Full Code Here

         log.info("Data have been loaded, terminating.");
         return;
      }
      long startTime = 0;
      Object key = null;
      Operation operation = manager.getOperation(rand);
      try {
         key = keyGenerator.generateKey(currentKey++);
         if (currentKey == keyRangeEnd) {
            currentKey = keyRangeStart;
         }
View Full Code Here

         // after deserialization
         operationStats = new OperationStats[0];
      }
      if (stats.operationStats == null) {
         for (Map.Entry<String, OperationStats> entry : stats.operationStatsMap.entrySet()) {
            Operation operation = Operation.getByName(entry.getKey());
            ensure(operation.id + 1);
            operationStats[operation.id].merge(entry.getValue());
         }
      } else {
         ensure(stats.operationStats.length);
View Full Code Here

TOP

Related Classes of org.radargun.Operation

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.