All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.infinispan.server.resp.commands.generic.SCAN Maven / Gradle / Ivy

There is a newer version: 15.1.4.Final
Show newest version
package org.infinispan.server.resp.commands.generic;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

import org.infinispan.container.entries.CacheEntry;
import org.infinispan.server.iteration.IterationManager;
import org.infinispan.server.resp.Resp3Handler;
import org.infinispan.server.resp.commands.iteration.BaseIterationCommand;

/**
 * SCAN
 *
 * @since 15.0
 */
public class SCAN extends BaseIterationCommand {

   public SCAN() {
      super(-2, 0, 0, 0);
   }

   @Override
   protected IterationManager retrieveIterationManager(Resp3Handler handler) {
      return handler.respServer().getIterationManager();
   }

   @Override
   protected String cursor(List raw) {
      return new String(raw.get(0), StandardCharsets.US_ASCII);
   }

   @Override
   protected List writeResponse(List response) {
      List output = new ArrayList<>(response.size());
      for (CacheEntry entry : response) {
         output.add((byte[]) entry.getKey());
      }
      return output;
   }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy