Examples of execute()


Examples of org.infinispan.client.hotrod.impl.operations.PutIfAbsentOperation.execute()

      assertRemoteCacheManagerIsStarted();
      int lifespanSecs = toSeconds(lifespan, lifespanUnit);
      int maxIdleSecs = toSeconds(maxIdleTime, maxIdleTimeUnit);
      applyDefaultExpirationFlags(lifespan, maxIdleTime);
      PutIfAbsentOperation op = operationsFactory.newPutIfAbsentOperation(obj2bytes(key, true), obj2bytes(value, false), lifespanSecs, maxIdleSecs);
      byte[] bytes = op.execute();
      return (V) bytes2obj(bytes);
   }

   @Override
   @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.PutOperation.execute()

      applyDefaultExpirationFlags(lifespan, maxIdleTime);
      if (log.isTraceEnabled()) {
         log.tracef("About to add (K,V): (%s, %s) lifespanSecs:%d, maxIdleSecs:%d", key, value, lifespanSecs, maxIdleSecs);
      }
      PutOperation op = operationsFactory.newPutKeyValueOperation(obj2bytes(key, true), obj2bytes(value, false), lifespanSecs, maxIdleSecs);
      byte[] result = op.execute();
      return (V) bytes2obj(result);
   }


   @Override
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.QueryOperation.execute()

   private List<Object> executeQuery() {
      List<Object> results;

      QueryOperation op = cache.getOperationsFactory().newQueryOperation(this);
      QueryResponse response = op.execute();
      totalResults = (int) response.getTotalResults();
      if (response.getProjectionSize() > 0) {
         results = new ArrayList<Object>(response.getResults().size() / response.getProjectionSize());
         Iterator<WrappedMessage> it = response.getResults().iterator();
         while (it.hasNext()) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.RemoveIfUnmodifiedOperation.execute()

   @Override
   public boolean removeWithVersion(K key, long version) {
      assertRemoteCacheManagerIsStarted();
      RemoveIfUnmodifiedOperation op = operationsFactory.newRemoveIfUnmodifiedOperation(obj2bytes(key, true), version);
      VersionedOperationResponse response = op.execute();
      return response.getCode().isUpdated();
   }

   @Override
   public NotifyingFuture<Boolean> removeWithVersionAsync(final K key, final long version) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.RemoveOperation.execute()

   @Override
   @SuppressWarnings("unchecked")
   public V remove(Object key) {
      assertRemoteCacheManagerIsStarted();
      RemoveOperation removeOperation = operationsFactory.newRemoveOperation(obj2bytes(key, true));
      byte[] existingValue = removeOperation.execute();
      // TODO: It sucks that you need the prev value to see if it works...
      // We need to find a better API for RemoteCache...
      return (V) bytes2obj(existingValue);
   }
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.ReplaceIfUnmodifiedOperation.execute()

   @Override
   public boolean replaceWithVersion(K key, V newValue, long version, int lifespanSeconds, int maxIdleTimeSeconds) {
      assertRemoteCacheManagerIsStarted();
      ReplaceIfUnmodifiedOperation op = operationsFactory.newReplaceIfUnmodifiedOperation(obj2bytes(key, true), obj2bytes(newValue, false), lifespanSeconds, maxIdleTimeSeconds, version);
      VersionedOperationResponse response = op.execute();
      return response.getCode().isUpdated();
   }

   @Override
   public NotifyingFuture<Boolean> replaceWithVersionAsync(final K key, final V newValue, final long version, final int lifespanSeconds, final int maxIdleSeconds) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.ReplaceOperation.execute()

      assertRemoteCacheManagerIsStarted();
      int lifespanSecs = toSeconds(lifespan, lifespanUnit);
      int maxIdleSecs = toSeconds(maxIdleTime, maxIdleTimeUnit);
      applyDefaultExpirationFlags(lifespan, maxIdleTime);
      ReplaceOperation op = operationsFactory.newReplaceOperation(obj2bytes(key, true), obj2bytes(value, false), lifespanSecs, maxIdleSecs);
      byte[] bytes = op.execute();
      return (V) bytes2obj(bytes);
   }

   @Override
   public NotifyingFuture<V> putAsync(final K key, final V value, final long lifespan, final TimeUnit lifespanUnit, final long maxIdle, final TimeUnit maxIdleUnit) {
View Full Code Here

Examples of org.infinispan.client.hotrod.impl.operations.StatsOperation.execute()

   @Override
   public int size() {
      assertRemoteCacheManagerIsStarted();
      StatsOperation op = operationsFactory.newStatsOperation();
      return Integer.parseInt(op.execute().get(ServerStatistics.CURRENT_NR_OF_ENTRIES));
   }

   @Override
   public boolean isEmpty() {
      return size() == 0;
View Full Code Here

Examples of org.infinispan.profiling.testinternals.TaskRunner.execute()

      long startTime = System.currentTimeMillis();
      TaskRunner runner = new TaskRunner(NUM_THREADS);
      log.warn("Starting warmup");
      // creates all the Fqns since this can be expensive and we don't really want to measure this (for now)
      for (final Fqn fqn : fqns) {
         runner.execute(new Runnable() {
            public void run() {
               try {
                  // this will create the necessary nodes.
                  cache.put(fqn, "key", Collections.emptyMap());
               }
View Full Code Here

Examples of org.infinispan.quickstart.compatibility.commands.Command.execute()

         if ("quit".equals(input)) break;
         Command cmd = client.parseCommand(input);
         if (cmd == null) {
            con.printf("Unable to perform the requested action.\n");
         } else {
            cmd.execute(con, input);
         }
      }
   }

   private Command parseCommand(String input) {
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.