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

com.alachisoft.ncache.client.internal.command.HashSetRemoveRandomCommand Maven / Gradle / Ivy

package com.alachisoft.ncache.client.internal.command;

import Alachisoft.NCache.Common.DataTypes.HashSet.HashSetRemoveRandomOperation;
import com.alachisoft.ncache.common.protobuf.HashSetCommandProtocol;
import com.alachisoft.ncache.common.protobuf.HashSetRemoveRandomProtocol;
import com.alachisoft.ncache.runtime.exceptions.CommandException;

public class HashSetRemoveRandomCommand extends HashSetCommandBase {
    private HashSetRemoveRandomProtocol.HashSetRemoveRandom.Builder _hashSetRemove;

    public HashSetRemoveRandomCommand(HashSetRemoveRandomOperation operation)
    {
        super.name = "HashSetRemoveRandom";
        super.key = operation.getName();
        _writeThruOption = operation.getWriteThruOptions();
        _lockId = (String)operation.getLockId();
        _lockTimeout = operation.getLockTimeout();
    }

    @Override
    public RequestType getCommandRequestType()
    {
        return RequestType.AtomicRead;
    }

    @Override
    public CommandType getCommandType()
    {
        return CommandType.DATA_TYPE;
    }

    @Override
    protected void createCommand() throws CommandException
    {
        _hashSetRemove = HashSetRemoveRandomProtocol.HashSetRemoveRandom.newBuilder();

        super.createCommand();

        _hashSetCommandBuilder.setType(HashSetCommandProtocol.HashSetCommand.Type.HASHSET_REMOVE_RANDOM);
        _hashSetCommandBuilder.setHashSetRemoveRandom(_hashSetRemove);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy