text:
package org.camunda.bpm.engine.impl.util;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.camunda.bpm.engine.impl.ProcessEngineLogger;

public class PropertiesUtil {

  protected static final EngineUtilLogger LOG = ProcessEngineLogger.UTIL_LOGGER;

  /**
   * Reads a <code>.properties</code> file from the classpath and provides a {@link Properties} object.
   */
  public static Properties getProperties(String propertiesFile) {
    Properties productProperties = new Properties();
    try (InputStream inputStream = ProductPropertiesUtil.class.getResourceAsStream(propertiesFile)) {
      productProperties.load(inputStream);
    } catch (IOException | NullPointerException e) {
      // if `propertiesFile` is null, the file is missing, or an error occurs during reading
      LOG.logMissingPropertiesFile(propertiesFile);
    }

    return productProperties;
  }
}


text:
#include "Workers.h"

#include <cstdint>
#include <chrono>
#include <map>
#include <random>
#include <thread>

#include <netinet/in.h>

#include <boost/atomic.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/log/trivial.hpp>
#include <boost/format.hpp>

#include <rte_branch_prediction.h>
#include <rte_ring.h>
#include <rte_mbuf.h>

#include <pcapplusplus/UdpLayer.h>
#include <pcapplusplus/MBufRawPacket.h>
#include <pcapplusplus/DpdkDevice.h>
#include <pcapplusplus/EthLayer.h>

#include <zmq.hpp>
#include <queue>

#include "statistics.pb.h"

#include "Config.h"
#include "Payload.h"

using namespace std::literals::chrono_literals;

namespace org::openkilda {

    uint64_t get_current_timestamp() {
        auto now = std::chrono::time_point_cast<std::chrono::nanoseconds>(
                std::chrono::high_resolution_clock::now());
        auto duration = now.time_since_epoch();
        uint64_t seconds = std::chrono::duration_cast<std::chrono::seconds>(duration).count();
        uint64_t nanoseconds = std::chrono::duration_cast<std::chrono::nanoseconds>(duration - std::chrono::seconds(seconds)).count();
        uint64_t timestamp = (seconds << 32ul) + (nanoseconds & 0xFFFFFFFF);
        return timestamp;
    }

    bool write_thread(boost::atomic<bool> &alive,
                      pcpp::DpdkDevice* device,
                      org::openkilda::flow_pool_t& m_pool,
                      std::mutex& m_pool_guard) {

        const uint64_t cycles_in_one_second = rte_get_timer_hz();
        const uint64_t cycles_in_500_ms = cycles_in_one_second / 2;

        while (alive.load()) {
            try {
                BOOST_LOG_TRIVIAL(info) << "tick pool_size: " << m_pool.table.size();

                uint64_t start_tsc = rte_get_timer_cycles();
                {
                    std::lock_guard<std::mutex> guard(m_pool_guard);
                    pcpp::MBufRawPacket **start = m_pool.table.data();
                    pcpp::MBufRawPacket **end = start + m_pool.table.size();

                    const uint64_t timestamp = htobe64(get_current_timestamp());

                    const auto chunk_size = long(Config::chunk_size);
                    uint_fast8_t error_count = 0;
                    for (pcpp::MBufRawPacket **pos = start; pos < end; pos += chunk_size) {
                        uint16_t send = 0;
                        uint_fast8_t tries = 0;

                        pcpp::MBufRawPacket mbuf_send_buffer[Config::chunk_size];
                        pcpp::MBufRawPacket *mbuf_send_buffer_p[Config::chunk_size];

                        for (uint_fast8_t i = 0; i < std::min(chunk_size, end - pos); ++i) {
                            mbuf_send_buffer[i].initFromRawPacket(*(pos+i), device);
                            mbuf_send_buffer_p[i] = &mbuf_send_buffer[i];
                            mbuf_send_buffer_p[i]->setFreeMbuf(true);

                            //TODO: can be switched to raw memory arithmetics
                            pcpp::Packet parsed_packet(mbuf_send_buffer_p[i], false, pcpp::UDP);
                            auto *udp_layer = parsed_packet.getLayerOfType<pcpp::UdpLayer>();
                            auto *payload = reinterpret_cast<org::openkilda::Payload *>(udp_layer->getLayerPayload());
                            payload->t0 = timestamp;
                        }

                        while (send != std::min(chunk_size, end - pos)) {
                            send = device->sendPackets(mbuf_send_buffer_p, std::min(chunk_size, end - pos), 0, false);
                            if (send != std::min(chunk_size, end - pos)) {
                                if(++tries > 3) {
                                    ++error_count;
                                    break;
                                }
                            }
                        }
                        if (error_count > 5) {
                            BOOST_LOG_TRIVIAL(error) << "Errors while send packets, drop send try";
                            break;
                        }
                    }
                }
                while (true) {
                    uint64_t current_tsc = rte_get_timer_cycles();
                    if (unlikely(current_tsc - start_tsc >= cycles_in_500_ms)) {
                        break;
                    }
                }
            } catch (std::exception &exception) {
                BOOST_LOG_TRIVIAL(error) << "Error " << exception.what();
            } catch (...) {
                BOOST_LOG_TRIVIAL(error) << "unhandled Error";
            };
        }

        return true;
    }

    bool read_thread(
            boost::atomic<bool> &alive,
            pcpp::DpdkDevice *device,
            boost::shared_ptr<rte_ring> ring) {

        BOOST_LOG_TRIVIAL(info) << "read_thread started ";
        pcpp::MBufRawPacket mbuf_raw_table[Config::chunk_size];

        pcpp::MBufRawPacket *mbuf_raw_ptr_table[Config::chunk_size] = {};

        rte_mbuf *mbuf_table[Config::chunk_size] = {};

        for (int i = 0; i < Config::chunk_size; ++i) {
            mbuf_raw_ptr_table[i] = &mbuf_raw_table[i];
            mbuf_raw_ptr_table[i]->setFreeMbuf(false);
        }

        while (alive.load()) {
            const uint32_t table_size = device->receivePackets(mbuf_raw_ptr_table, Config::chunk_size, 0);

            if (unlikely(table_size == 0)) {
                continue;
            }

            uint64_t timestamp = get_current_timestamp();

            BOOST_LOG_TRIVIAL(debug) << "read_thread recived packets " << table_size;

            for (uint32_t i = 0; i < table_size; ++i) {
                mbuf_table[i] = mbuf_raw_ptr_table[i]->getMBuf();
                mbuf_table[i]->timestamp = timestamp;
            }

            uint32_t enqueued = rte_ring_sp_enqueue_bulk(ring.get(), reinterpret_cast<void *const *>(mbuf_table), table_size,
                                                         nullptr);

            if (unlikely(enqueued == 0)) {
                //TODO: add_to_statistics
                BOOST_LOG_TRIVIAL(error) << "ring is full discard " << table_size << " packets";
                for (uint32_t i = 0; i < table_size; ++i) {
                    mbuf_raw_ptr_table[i]->setFreeMbuf(true);
                    mbuf_raw_ptr_table[i]->clear();
                    mbuf_raw_ptr_table[i]->setFreeMbuf(false);
                }
            }
        }
        return true;
    }

    bool process_thread(uint32_t core_id,
            boost::atomic<bool> &alive,
            boost::shared_ptr<rte_ring> rx_ring,
            uint16_t zmq_port,
            const pcpp::MacAddress &src_mac) {

        using Bucket = server42::stats::messaging::flowrtt::FlowLatencyPacketBucket;

        zmq::context_t context(1);
        context.setctxopt(ZMQ_THREAD_AFFINITY_CPU_ADD, core_id);
        zmq::socket_t socket(context, ZMQ_PUSH);

        std::string endpoint = str(boost::format("tcp://*:%1%") % zmq_port);
        socket.bind(endpoint);

        BOOST_LOG_TRIVIAL(info)
            << "process_thread on core_id: " << core_id << " "
            << "bind zmq socket for push on " << endpoint;

        uint64_t packet_id = 0;
        pcpp::Packet dummy_packet;

        rte_mbuf *mbuf_table[Config::chunk_size] = {};

        void **const mbuf_table_prt = reinterpret_cast<void **>(mbuf_table);
        while (alive.load()) {
            try {
                uint32_t table_size =
                        rte_ring_mc_dequeue_bulk(rx_ring.get(), mbuf_table_prt, Config::chunk_size, nullptr);

                if (unlikely(table_size == 0)) {
                    BOOST_LOG_TRIVIAL(debug) << "process_thread table_size 0";
                    socket.send(zmq::str_buffer(""), zmq::send_flags::dontwait);
                    std::this_thread::sleep_for(100ms);
                    continue;
                }

                BOOST_LOG_TRIVIAL(debug) << "process_thread recived packets " << table_size;

                Bucket bucket;

                for (uint32_t i = 0; i < table_size; ++i) {

                    // A macro that points to the start of the data in the mbuf.
                    const uint8_t *mbuf = rte_pktmbuf_mtod(mbuf_table[i], const uint8_t*);
                    pcpp::RawPacket raw_packet(mbuf,
                                               rte_pktmbuf_pkt_len(mbuf_table[i]),
                                               timeval(),
                                               false,
                                               pcpp::LINKTYPE_ETHERNET);

                    pcpp::Packet parsed_packet(&raw_packet);

                    auto eth = parsed_packet.getLayerOfType<pcpp::EthLayer>();
                    auto udp = parsed_packet.getLayerOfType<pcpp::UdpLayer>();

                    if (likely(eth->getDestMac() == src_mac && udp)) {
                        if (udp->getLayerPayloadSize() == sizeof(Payload)) {
                            packet_id++;
                            auto payload = reinterpret_cast<const org::openkilda::Payload *>(udp->getLayerPayload());
                            auto packet = bucket.add_packet();

                            BOOST_LOG_TRIVIAL(debug) << "flow_id: " << payload->flow_id << " "
                                                     << "t0 raw: " << payload->t0 << " "
                                                     << "t1 raw: " << payload->t1 << " "
                                                     << "t0: " << be64toh(payload->t0) << " "
                                                     << "t1: " << be64toh(payload->t1) << " "
                                                     << "packet_id: " << packet_id << " "
                                                     << "direction: " << payload->direction;

                            packet->set_flow_id(payload->flow_id);
                            packet->set_t0(be64toh(payload->t0));

                            if (payload->t1) {
                                packet->set_t1(be64toh(payload->t1));
                            } else {
                                packet->set_t1(mbuf_table[i]->timestamp);
                            }
                            packet->set_packet_id(packet_id);
                            packet->set_direction(payload->direction);
                            BOOST_LOG_TRIVIAL(debug) << packet->DebugString();
                        } else {
                            BOOST_LOG_TRIVIAL(error)
                                << "drop packet by invalid payload size: " << udp->getLayerPayloadSize() << " "
                                << "expected: " << sizeof(Payload);
                        }
                    } else {
                        if (eth->getDestMac() != src_mac) {
                            BOOST_LOG_TRIVIAL(error)
                                << "drop packet by invalid mac dst: " << eth->getDestMac().toString() << " "
                                << "expected: " << src_mac.toString();
                        } else {
                            BOOST_LOG_TRIVIAL(error)
                                << "drop packet by missed udp layer";
                        }
                    }

                    rte_pktmbuf_free(mbuf_table[i]);
                }

                if (bucket.packet_size()) {

                    zmq::message_t message(bucket.ByteSizeLong());
                    BOOST_LOG_TRIVIAL(debug) << "flow_bucket <" << bucket.DebugString() << ">";
                    bucket.SerializeToArray(message.data(), message.size());

                    /*
                     * When a ZMQ_PUSH socket enters the mute state due to having reached the high water mark for all
                     * downstream nodes, or if there are no downstream nodes at all, then any zmq_send(3) operations on
                     * the socket shall block until the mute state ends or at least one downstream node becomes available
                     * for sending; messages are not discarded.
                     */
                    while (!socket.send(message, zmq::send_flags::dontwait) && alive) {}

                } else {
                    BOOST_LOG_TRIVIAL(info) << "flow_bucket packet_size==0 " << bucket.DebugString() << "\n" << std::flush;
                }

            } catch (zmq::error_t &exception) {
                BOOST_LOG_TRIVIAL(error) << "ZMQ Error " << exception.what();
            } catch (std::exception &exception) {
                BOOST_LOG_TRIVIAL(error) << "Error " << exception.what();
            }
        }

        return true;
    }

    bool echo_thread(boost::atomic<bool> &alive,
                     pcpp::DpdkDevice* device) {

        pcpp::MBufRawPacket *rx_mbuf[Config::chunk_size] = {};

        const pcpp::MacAddress src(device->getMacAddress());

        std::map<std::string, uint64_t> fake_duration;
        std::random_device rd{};
        std::uniform_int_distribution<int> base_latency(0, 900); // in ms

        typedef std::tuple<uint64_t, std::shared_ptr<pcpp::MBufRawPacket>> mbuf_container_t;

        // Using lambda to compare elements.
        auto cmp = [](mbuf_container_t& left, mbuf_container_t& right) { return std::get<0>(left) > std::get<0>(right); };
        std::priority_queue<mbuf_container_t, std::vector<mbuf_container_t>, decltype(cmp) > queue(cmp);

        const uint64_t cycles_in_one_second = rte_get_hpet_hz();
        const uint64_t cycles_in_1_ms = cycles_in_one_second / 1000;

        while (alive.load()) {
            uint16_t num_of_packets = device->receivePackets(rx_mbuf, Config::chunk_size, 0);

            uint64_t start_tsc = rte_get_hpet_cycles();

            for (uint16_t i = 0; i < num_of_packets; ++i) {

                pcpp::Packet parsed_packet(rx_mbuf[i]);

                auto *eth = parsed_packet.getLayerOfType<pcpp::EthLayer>();

                eth->setDestMac(eth->getSourceMac());
                eth->setSourceMac(src);

                auto *udp_layer = parsed_packet.getLayerOfType<pcpp::UdpLayer>();

                auto *payload = reinterpret_cast<org::openkilda::Payload *>(udp_layer->getLayerPayload());

                std::string flow_id(payload->flow_id);

                if (!fake_duration.count(flow_id)) {
                    fake_duration[flow_id] = base_latency(rd) * cycles_in_1_ms;
                }

                std::shared_ptr<pcpp::MBufRawPacket> mbuf_raw_ptr(new pcpp::MBufRawPacket());

                mbuf_raw_ptr->initFromRawPacket(rx_mbuf[i], device);

                uint64_t latency_time = fake_duration[flow_id];
                const uint64_t delta_based_direction = 3 * cycles_in_1_ms;
                if (payload->direction) {
                    latency_time += delta_based_direction;
                } else {
                    latency_time -= delta_based_direction;
                }

                queue.push(std::make_tuple(start_tsc + latency_time, mbuf_raw_ptr));
            }

            std::vector<pcpp::MBufRawPacket *> send_buf;
            std::vector<std::shared_ptr<pcpp::MBufRawPacket>> holder;

            while (queue.size()) {
                uint64_t ts = std::get<0>(queue.top());
                if (start_tsc > ts) {
                    auto ptr = std::get<1>(queue.top());
                    send_buf.push_back(ptr.get());
                    holder.push_back(ptr);
                    queue.pop();
                } else {
                    break;
                }
            }

            if (send_buf.size() > 0) {
                device->sendPackets(send_buf.data(), send_buf.size(), 0, false);
            }
        }

        return true;
    }
}

redpajama_set_name: RedPajamaGithub


text:
//
//  NSString+Emoji.h
//  Myproject
//
//  Created by Jeason on 14-8-11.
//  Copyright (c) 2014年 Myproject. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (Emoji)

/**
 *  Encode a string contains emoji string to a string contains emoji filename.
 *  Just encode each substring to filename, if it hs no associating filename, it will return nil.
 *  @return the encoded string
 */
- (NSString *)encodeString;

/**
 *  Decode the string contains file names to String contains emoji string.
 *
 *  @return the result string
 */
- (NSString *)decodeString;

/**
 *  Generate the encode dictionary to encode an emoji string to filename
 *
 *  @return the encode dictionary
 */
+ (NSDictionary *)encodeDictionary;

@end


text:
package org.apache.camel.component.quartz2;

import org.apache.camel.Endpoint;
import org.apache.camel.Processor;
import org.apache.camel.support.DefaultConsumer;

/**
 * This consumer process QuartzMessage when scheduler job is executed per scheduled time. When the job runs, it will
 * call this consumer's processor to process a new exchange with QuartzMessage.
 */
public class QuartzConsumer extends DefaultConsumer {

    public QuartzConsumer(Endpoint endpoint, Processor processor) {
        super(endpoint, processor);
    }

    @Override
    public QuartzEndpoint getEndpoint() {
        return (QuartzEndpoint) super.getEndpoint();
    }

    @Override
    protected void doStart() throws Exception {
        super.doStart();
        getEndpoint().onConsumerStart(this);
    }

    @Override
    protected void doStop() throws Exception {
        getEndpoint().onConsumerStop(this);
        super.doStop();
    }

}


text:
/* Written by Ulrich Drepper <drepper@gnu.org>, 1995.  */
/* Win32 code written by Tor Lillqvist <tml@iki.fi>.  */
/* Modified for GpgOL use by Werner Koch <wk@gnupg.org>, 2005.  */
/* Modified for GnuPG use by Werner Koch <wk@gnupg.org>, 2007 */

#ifdef HAVE_CONFIG_H
# include <config.h>
#endif

#include <stdlib.h>
#include <string.h>
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif

#include "../jnlib/w32help.h"

/* XPG3 defines the result of 'setlocale (category, NULL)' as:
   "Directs 'setlocale()' to query 'category' and return the current
    setting of 'local'."
   However it does not specify the exact format.  Neither do SUSV2 and
   ISO C 99.  So we can use this feature only on selected systems (e.g.
   those using GNU C Library).  */
#if defined _LIBC || (defined __GNU_LIBRARY__ && __GNU_LIBRARY__ >= 2)
# define HAVE_LOCALE_NULL
#endif

/* Use a dummy value for LC_MESSAGES in case it is not defined.  This
   works becuase we always test for HAVE_LC_MESSAGES and the core
   fucntion takes the category as a string as well.  */
#ifndef HAVE_LC_MESSAGES
#define LC_MESSAGES 0
#endif

/* Determine the current locale's name, and canonicalize it into XPG syntax
     language[_territory[.codeset]][@modifier]
   The codeset part in the result is not reliable; the locale_charset()
   should be used for codeset information instead.
   The result must not be freed; it is statically allocated.  */

#ifndef HAVE_W32_SYSTEM
static const char *
do_nl_locale_name (int category, const char *categoryname)
{
  const char *retval;

  /* Use the POSIX methods of looking to 'LC_ALL', 'LC_xxx', and 'LANG'.
     On some systems this can be done by the 'setlocale' function itself.  */
# if defined HAVE_SETLOCALE && defined HAVE_LC_MESSAGES && defined HAVE_LOCALE_NULL
  (void)categoryname;
  retval = setlocale (category, NULL);
# else
  /* Setting of LC_ALL overwrites all other.  */
  retval = getenv ("LC_ALL");
  if (retval == NULL || retval[0] == '\0')
    {
      /* Next comes the name of the desired category.  */
      retval = getenv (categoryname);
      if (retval == NULL || retval[0] == '\0')
	{
	  /* Last possibility is the LANG environment variable.  */
	  retval = getenv ("LANG");
	  if (retval == NULL || retval[0] == '\0')
	    /* We use C as the default domain.  POSIX says this is
	       implementation defined.  */
	    retval = "C";
	}
    }
# endif

  return retval;
}
#endif /* HAVE_W32_SYSTEM */

/* Return the locale used for translatable messages.  The standard C
   and POSIX are locale names are mapped to an empty string.  If a
   locale can't be found an empty string will be returned.  */
const char *
gnupg_messages_locale_name (void)
{
  const char *s;

#ifdef HAVE_W32_SYSTEM
  /* We use the localname function from ../jnlib/w32-gettext.c. */
  s = gettext_localename ();
#else
  s = do_nl_locale_name (LC_MESSAGES, "LC_MESSAGES");
#endif
  if (!s)
    s = "";
  else if (!strcmp (s, "C") || !strcmp (s, "POSIX"))
    s = "";

  return s;
}


text:
package com.gemstone.gemfire.internal.redis;

import com.gemstone.gemfire.internal.redis.executor.AuthExecutor;
import com.gemstone.gemfire.internal.redis.executor.DBSizeExecutor;
import com.gemstone.gemfire.internal.redis.executor.DelExecutor;
import com.gemstone.gemfire.internal.redis.executor.EchoExecutor;
import com.gemstone.gemfire.internal.redis.executor.ExistsExecutor;
import com.gemstone.gemfire.internal.redis.executor.ExpireAtExecutor;
import com.gemstone.gemfire.internal.redis.executor.ExpireExecutor;
import com.gemstone.gemfire.internal.redis.executor.FlushAllExecutor;
import com.gemstone.gemfire.internal.redis.executor.KeysExecutor;
import com.gemstone.gemfire.internal.redis.executor.PExpireAtExecutor;
import com.gemstone.gemfire.internal.redis.executor.PExpireExecutor;
import com.gemstone.gemfire.internal.redis.executor.PTTLExecutor;
import com.gemstone.gemfire.internal.redis.executor.PersistExecutor;
import com.gemstone.gemfire.internal.redis.executor.PingExecutor;
import com.gemstone.gemfire.internal.redis.executor.QuitExecutor;
import com.gemstone.gemfire.internal.redis.executor.ScanExecutor;
import com.gemstone.gemfire.internal.redis.executor.ShutDownExecutor;
import com.gemstone.gemfire.internal.redis.executor.TTLExecutor;
import com.gemstone.gemfire.internal.redis.executor.TimeExecutor;
import com.gemstone.gemfire.internal.redis.executor.TypeExecutor;
import com.gemstone.gemfire.internal.redis.executor.UnkownExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HDelExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HExistsExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HGetAllExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HGetExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HIncrByExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HIncrByFloatExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HKeysExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HLenExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HMGetExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HMSetExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HScanExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HSetExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HSetNXExecutor;
import com.gemstone.gemfire.internal.redis.executor.hash.HValsExecutor;
import com.gemstone.gemfire.internal.redis.executor.hll.PFAddExecutor;
import com.gemstone.gemfire.internal.redis.executor.hll.PFCountExecutor;
import com.gemstone.gemfire.internal.redis.executor.hll.PFMergeExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LIndexExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LInsertExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LLenExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LPopExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LPushExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LPushXExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LRangeExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LRemExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LSetExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.LTrimExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.RPopExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.RPushExecutor;
import com.gemstone.gemfire.internal.redis.executor.list.RPushXExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SAddExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SCardExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SDiffExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SDiffStoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SInterExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SInterStoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SIsMemberExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SMembersExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SMoveExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SPopExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SRandMemberExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SRemExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SScanExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SUnionExecutor;
import com.gemstone.gemfire.internal.redis.executor.set.SUnionStoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZAddExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZCardExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZCountExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZIncrByExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZLexCountExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRangeByLexExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRangeByScoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRangeExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRankExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRemExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRemRangeByLexExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRemRangeByRankExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRemRangeByScoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRevRangeByScoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRevRangeExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZRevRankExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZScanExecutor;
import com.gemstone.gemfire.internal.redis.executor.sortedset.ZScoreExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.AppendExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.BitCountExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.BitOpExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.BitPosExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.DecrByExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.DecrExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.GetBitExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.GetExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.GetRangeExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.GetSetExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.IncrByExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.IncrByFloatExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.IncrExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.MGetExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.MSetExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.MSetNXExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.PSetEXExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.SetBitExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.SetEXExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.SetExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.SetNXExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.SetRangeExecutor;
import com.gemstone.gemfire.internal.redis.executor.string.StrlenExecutor;
import com.gemstone.gemfire.internal.redis.executor.transactions.DiscardExecutor;
import com.gemstone.gemfire.internal.redis.executor.transactions.ExecExecutor;
import com.gemstone.gemfire.internal.redis.executor.transactions.MultiExecutor;
import com.gemstone.gemfire.internal.redis.executor.transactions.UnwatchExecutor;
import com.gemstone.gemfire.internal.redis.executor.transactions.WatchExecutor;

/**
 * The redis command type used by the server. Each command is directly from
 * the redis protocol and calling {@link #getExecutor()} on a type returns the executor
 * class for that command.
 *
 * @author Vitaliy Gavrilov
 *
 */
public enum RedisCommandType {

  /***************************************
   *************** Keys ******************
   ***************************************/

  /**
   * AUTH password

   * Authenticate to the server
   */
  AUTH {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new AuthExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * DEL key [key ...]

   * Delete a key
   */
  DEL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new DelExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * EXISTS key

   * Determine if a key exists
   */
  EXISTS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ExistsExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * EXPIRE key seconds

   * Set a key's time to live in seconds
   */
  EXPIRE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ExpireExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * EXPIREAT key timestamp

   * Set the expiration for a key as a UNIX timestamp
   */
  EXPIREAT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ExpireAtExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * FLUSHALL

   * Remove all keys from all databases
   */
  FLUSHALL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new FlushAllExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * FLUSHDB
Remove all keys from the current database
Same as FLUSHALL for this implementation
   */
  FLUSHDB {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new FlushAllExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * KEYS pattern

   * Find all keys matching the given pattern
   */
  KEYS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new KeysExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PERSIST key

   * Remove the expiration from a key
   */
  PERSIST {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PersistExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PEXPIRE key milliseconds
Set a key's time to live in milliseconds
   */
  PEXPIRE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PExpireExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PEXPIREAT key milliseconds-timestamp
Set the expiration for a key as a UNIX timestamp specified in milliseconds
   */
  PEXPIREAT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PExpireAtExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PTTL key
Get the time to live for a key in milliseconds
   */
  PTTL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PTTLExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SCAN cursor [MATCH pattern] [COUNT count]
Incrementally iterate the keys space
   */
  SCAN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ScanExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * TTL key
Get the time to live for a key
   */
  TTL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new TTLExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * TYPE key
Determine the type stored at key
   */
  TYPE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new TypeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   ************** Strings ****************
   ***************************************/

  /**
   * APPEND key value
Append a value to a key
   */
  APPEND {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new AppendExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * BITCOUNT key start end [start end ...]
Count set bits in a string
   */
  BITCOUNT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new BitCountExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * BITOP operation destkey key [key ...]
Perform bitwise operations between strings
   */
  BITOP {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new BitOpExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * BITPOS key bit [start] [end]
Find first bit set or clear in a string
   */
  BITPOS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new BitPosExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * DECR key
Decrement the integer value of a key by one
   */
  DECR {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new DecrExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * DECRBY key decrement
Decrement the integer value of a key by the given number
   */
  DECRBY {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new DecrByExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * GET key
Get the value of a key
   */
  GET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new GetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * GETBIT key offset
Returns the bit value at offset in the string value stored at key
   */
  GETBIT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new GetBitExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * GETRANGE key start end
Get a substring of the string stored at a key
   */
  GETRANGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new GetRangeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * GETSET key value
Set the string value of a key and return its old value
   */
  GETSET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new GetSetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * INCR key
Increment the integer value of a key by one
   */
  INCR {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new IncrExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * INCRBY key increment
Increment the integer value of a key by the given amount
   */
  INCRBY {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new IncrByExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * INCRBYFLOAT key increment
Increment the float value of a key by the given amount
   */
  INCRBYFLOAT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new IncrByFloatExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * MGET key [key ...]
Get the values of all the given keys
   */
  MGET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new MGetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * MSET key value [key value ...]
Set multiple keys to multiple values
   */
  MSET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new MSetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * MSETNX key value [key value ...]
Set multiple keys to multiple values, only if none of the keys exist
   */
  MSETNX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new MSetNXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PSETEX key milliseconds value
Set the value and expiration in milliseconds of a key
   */
  PSETEX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PSetEXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SETEX key seconds value
Set the value and expiration of a key
   */
  SETEX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SetEXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SET key value [EX seconds] [PX milliseconds] [NX|XX]
Set the string value of a key
   */
  SET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SETBIT key offset value
Sets or clears the bit at offset in the string value stored at key
   */
  SETBIT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SetBitExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SETNX key value
Set the value of a key, only if the key does not exist
   */
  SETNX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SetNXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SETRANGE key offset value
Overwrite part of a string at key starting at the specified offset
   */
  SETRANGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SetRangeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * STRLEN key
Get the length of the value stored in a key
   */
  STRLEN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new StrlenExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_STRING;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   **************** Hashes ***************
   ***************************************/
  /**
   * HDEL key field [field ...]
Delete one or more hash fields
   */
  HDEL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HDelExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HEXISTS key field
Determine if a hash field exists
   */
  HEXISTS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HExistsExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HGET key field
Get the value of a hash field
   */
  HGET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HGetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HGETALL key
Get all the fields and values in a hash
   */
  HGETALL {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HGetAllExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HINCRBY key field increment
Increment the integer value of a hash field by the given number
   */
  HINCRBY {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HIncrByExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HINCRBYFLOAT key field increment
Increment the float value of a hash field by the given amount
   */
  HINCRBYFLOAT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HIncrByFloatExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HKEYS key
Get all the fields in a hash
   */
  HKEYS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HKeysExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HLEN key
Get the number of fields in a hash
   */
  HLEN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HLenExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HMGET key field [field ...]
Get the values of all the given hash fields
   */
  HMGET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HMGetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HMSET key field value [field value ...]
Set multiple hash fields to multiple values
   */
  HMSET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HMSetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HSCAN key cursor [MATCH pattern] [COUNT count]
Incrementally iterate hash fields and associated values
   */
  HSCAN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HScanExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HSET key field value
Set the string value of a hash field
   */
  HSET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HSetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HSETNX key field value
Set the value of a hash field, only if the field does not exist
   */
  HSETNX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HSetNXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * HVALS key
Get all the values in a hash
   */
  HVALS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new HValsExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HASH;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   *********** HyperLogLogs **************
   ***************************************/

  /**
   * PFADD key element [element ...]
Adds the specified elements to the specified HyperLogLog
   */
  PFADD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PFAddExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HLL;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PFCOUNT key [key ...]
Return the approximated cardinality of the set(s) observed by the HyperLogLog at key(s)
   */
  PFCOUNT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PFCountExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HLL;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PFMERGE destkey sourcekey [sourcekey ...]
Merge N different HyperLogLogs into a single one
   */
  PFMERGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PFMergeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_HLL;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   *************** Lists *****************
   ***************************************/

  /**
   * LINDEX key index
Get an element from a list by its index
   */
  LINDEX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LIndexExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LINSERT key BEFORE|AFTER pivot value
Insert an element before or after another element in a list
   */
  LINSERT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LInsertExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LLEN key
Get the length of a list
   */
  LLEN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LLenExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LPOP key
Remove and get the first element in a list
   */
  LPOP {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LPopExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LPUSH key value [value ...]
Prepend one or multiple values to a list
   */
  LPUSH {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LPushExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LPUSHX key value
Prepend a value to a list, only if the list exists
   */
  LPUSHX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LPushXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LRANGE key start stop
Get a range of elements from a list
   */
  LRANGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LRangeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LREM key count value
Remove elements from a list
   */
  LREM {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LRemExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LSET key index value
Set the value of an element in a list by its index
   */
  LSET {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LSetExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * LTRIM key start stop
Trim a list to the specified range
   */
  LTRIM {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new LTrimExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * RPOP key
Remove and get the last element in a list
   */
  RPOP {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new RPopExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * RPUSH key value [value ...]
Append one or multiple values to a list
   */
  RPUSH {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new RPushExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * RPUSHX key value
Append a value to a list, only if the list exists
   */
  RPUSHX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new RPushXExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_LIST;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   **************** Sets *****************
   ***************************************/

  /**
   * SADD key member [member ...]
Add one or more members to a set
   */
  SADD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SAddExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SCARD key
Get the number of members in a set
   */
  SCARD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SCardExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SDIFF key [key ...]
Subtract multiple sets
   */
  SDIFF {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SDiffExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SDIFFSTORE destination key [key ...]
Subtract multiple sets and store the resulting set in a key
   */
  SDIFFSTORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SDiffStoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SISMEMBER key member
Determine if a given value is a member of a set
   */
  SISMEMBER {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SIsMemberExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SINTER key [key ...]
Intersect multiple sets
   */
  SINTER {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SInterExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SINTERSTORE destination key [key ...]
Intersect multiple sets and store the resulting set in a key
   */
  SINTERSTORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SInterStoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SMEMBERS key
Get all the members in a set
   */
  SMEMBERS {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SMembersExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SMOVE source destination member
Move a member from one set to another
   */
  SMOVE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SMoveExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SPOP key
Remove and return a random member from a set
   */
  SPOP {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SPopExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SRANDMEMBER key [count]
Get one or multiple random members from a set
   */
  SRANDMEMBER {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SRandMemberExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SUNION key [key ...]
Add multiple sets
   */
  SUNION {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SUnionExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SUNIONSTORE destination key [key ...]
Add multiple sets and store the resulting set in a key
   */
  SUNIONSTORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SUnionStoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SSCAN key cursor [MATCH pattern] [COUNT count]
Incrementally iterate Set elements
   */
  SSCAN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SScanExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SREM key member [member ...]
Remove one or more members from a set
   */
  SREM {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new SRemExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   ************* Sorted Sets *************
   ***************************************/

  /**
   * ZADD key score member [score member ...]
Add one or more members to a sorted set, or update its score if it already exists
   */
  ZADD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZAddExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZCARD key
Get the number of members in a sorted set
   */
  ZCARD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZCardExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZCOUNT key min max
Count the members in a sorted set with scores within the given values
   */
  ZCOUNT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZCountExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZINCRBY key increment member
Increment the score of a member in a sorted set
   */
  ZINCRBY {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZIncrByExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZLEXCOUNT key min max
Count the number of members in a sorted set between a given lexicographical range
   */
  ZLEXCOUNT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZLexCountExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZRANGE key start stop [WITHSCORES]
Return a range of members in a sorted set, by index
   */
  ZRANGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRangeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZRANGEBYLEX key min max [LIMIT offset count]
Return a range of members in a sorted set, by lexicographical range
   */
  ZRANGEBYLEX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRangeByLexExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count]
Return a range of members in a sorted set, by score
   */
  ZRANGEBYSCORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRangeByScoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREVRANGE key start stop [WITHSCORES]
Return a range of members in a sorted set, by index, with scores ordered from high to low
   */
  ZREVRANGE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRevRangeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZRANK key member
Determine the index of a member in a sorted set
   */
  ZRANK {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRankExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREM key member [member ...]
Remove one or more members from a sorted set
   */
  ZREM {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRemExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREMRANGEBYLEX key min max
Remove all members in a sorted set between the given lexicographical range
   */
  ZREMRANGEBYLEX {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRemRangeByLexExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREMRANGEBYRANK key start stop
Remove all members in a sorted set within the given indexes
   */
  ZREMRANGEBYRANK {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRemRangeByRankExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREMRANGEBYSCORE key min max
Remove all members in a sorted set within the given scores
   */
  ZREMRANGEBYSCORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRemRangeByScoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count]
Return a range of members in a sorted set, by score, with scores ordered from high to low
   */
  ZREVRANGEBYSCORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRevRangeByScoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZREVRANK key member
Determine the index of a member in a sorted set, with scores ordered from high to low
   */
  ZREVRANK {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZRevRankExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZSCAN key cursor [MATCH pattern] [COUNT count]
Incrementally iterate sorted sets elements and associated scores
   */
  ZSCAN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZScanExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ZSCORE key member
Get the score associated with the given member in a sorted set
   */
  ZSCORE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ZScoreExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.REDIS_SORTEDSET;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   ************ Transactions *************
   ***************************************/

  /**
   * DISCARD
Discard all commands issued after MULTI
   */
  DISCARD {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new DiscardExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * EXEC
Execute all commands issued after MULTI
   */
  EXEC {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ExecExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * MULTI
Mark the start of a transaction block
   */
  MULTI {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new MultiExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * UNWATCH
Forget about all watched keys
   */
  UNWATCH {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new UnwatchExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * WATCH key [key ...]
Watch the given keys to determine execution of the MULTI/EXEC block
   */
  WATCH {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new WatchExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /***************************************
   *************** Server ****************
   ***************************************/

  /**
   * DBSIZE
Return the number of keys in the selected database
   */
  DBSIZE {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new DBSizeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * ECHO message
Echo the given string
   */
  ECHO {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new EchoExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * TIME
Return the current server time
   */
  TIME {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new TimeExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * PING
Ping the server
   */
  PING {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new PingExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * QUIT
Close the connection
   */
  QUIT {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new QuitExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  /**
   * SHUTDOWN
Shut down the server
   */
  SHUTDOWN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new ShutDownExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  },

  // UNKNOWN
  UNKNOWN {
    private Executor executor;
    @Override
    public Executor getExecutor() {
      if (executor == null) {
        executor = new UnkownExecutor();
      }
      return executor;
    }
    private final RedisDataType dataType = RedisDataType.NONE;
    @Override
    public RedisDataType getDataType() {
      return this.dataType;
    }
  };

  /**
   * Abstract method overridden by each value in enum
   * to get the executor associated with that command type
   *
   * @return {@link Executor} for command type
   */
  public abstract Executor getExecutor();

  public abstract RedisDataType getDataType();
  /*
  private RedisCommandType (RedisDataType dataType) {
    this.dataType = dataType;
  }
   */
}


text:
package com.appleframework.qos.server.monitor.dao;

import org.springframework.stereotype.Repository;

import com.appleframework.qos.server.core.entity.AppInfo;

@Repository
public interface AppInfoDao {

	public AppInfo getByCode(String code);

	public void insert(AppInfo appInfo);

	public void createTable();

}


text:
<?php

declare(strict_types=1);

namespace Migrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
 * Auto-generated Migration: Please modify to your needs!
 */
final class Version20190216001804 extends AbstractMigration
{
    public function getDescription(): string
    {
        return '';
    }

    public function up(Schema $schema): void
    {
        // this up() migration is auto-generated, please modify it to your needs
        $this->abortIf(
            $this->connection->getDatabasePlatform()->getName() !== 'mysql',
            'Migration can only be executed safely on \'mysql\'.'
        );
        $this->addSql(
            'ALTER TABLE user ADD last_authentication_at DATETIME DEFAULT NULL COMMENT \'(DC2Type:datetime)\''
        );
    }

    public function down(Schema $schema): void
    {
        // this down() migration is auto-generated, please modify it to your needs
        $this->abortIf(
            $this->connection->getDatabasePlatform()->getName() !== 'mysql',
            'Migration can only be executed safely on \'mysql\'.'
        );
        $this->addSql('ALTER TABLE user DROP last_authentication_at');
    }
}


text:
<?xml version="1.0" encoding="utf-8" ?>
<project name="CI-Eye" default="snapshot" basedir=".">

    <property name="target.version" value="0.5.0"/>

    <property name="build.dir"      value="${basedir}/build"/>
    <property name="lib.dir"        value="${basedir}/vendor/lib"/>
    <property name="jslib.dir"      value="${basedir}/vendor/jslib"/>
    <property name="buildlib.dir"   value="${basedir}/vendor/buildlib"/>

    <tstamp><format property="build.number" pattern="yyyyMMddHHmmss" timezone="GMT"/></tstamp>
    <tstamp><format property="build.timestamp" pattern="yyyy-MM-dd HH:mm:ss" timezone="GMT"/></tstamp>

    <macrodef name="compile-module">
        <attribute name="srcdir"/>
        <attribute name="destdir"/>
        <attribute name="classpathref"/>

        <sequential>
            <mkdir dir="@{destdir}"/>

            <javac srcdir="@{srcdir}/java"
                   includes="**"
                   includeantruntime="false"
                   encoding="utf-8"
                   destdir="@{destdir}"
                   source="1.6"
                   target="1.6"
                   debug="true"
                   debuglevel="lines,vars,source">
                <classpath refid="@{classpathref}"/>
            </javac>

            <copy todir="@{destdir}">
                <fileset dir="@{srcdir}/java" excludes="**/*.java"/>
                <fileset dir="@{srcdir}/webapp"/>
                <fileset dir="@{srcdir}/resources"/>
            </copy>
        </sequential>
    </macrodef>

    <target name="version-for-snapshot" unless="version.label">
        <property name="version.label" value="${target.version}-SNAPSHOT-${build.number}"/>
    </target>

    <target name="version-for-release" unless="version.label">
        <property name="version.label" value="${target.version}"/>
    </target>

    <target name="version" depends="version-for-snapshot,version-for-release">
        <echo message="Building version ${version.label}"/>
        <property name="main.jar" value="${build.dir}/ci-eye-${version.label}.jar"/>
        <property name="test.jar" value="${build.dir}/ci-eye-tests-${version.label}.jar"/>
    </target>

    <target name="clean" description="Clean this project">
        <delete dir="${build.dir}" failonerror="false"/>
        <mkdir dir="${build.dir}"/>
    </target>

    <target name="jar-main" depends="clean,version">
        <path id="compile-main.req">
            <fileset dir="${lib.dir}" includes="**/*.jar"/>
        </path>
        <compile-module srcdir="${basedir}/src/main" destdir="${build.dir}/main" classpathref="compile-main.req"/>
        <copy todir="${build.dir}/main">
            <fileset dir="${jslib.dir}"/>
        </copy>

        <zip destfile="${build.dir}/main-deps.jar"><zipgroupfileset dir="${lib.dir}" includes="**/*.jar"/></zip>

        <jar destfile="${main.jar}">
            <fileset dir="${build.dir}/main"/>
            <fileset dir="${basedir}" includes="LICENSE NOTICE README"/>
            <zipfileset src="${build.dir}/main-deps.jar" excludes="**/META-INF/**"/>
            <manifest>
                <attribute name="Main-Class" value="org.netmelody.cieye.CiEye"/>
                <attribute name="Built-By" value="${user.name}"/>
                <attribute name="Implementation-Vendor" value="netmelody.org"/>
                <attribute name="Implementation-Title" value="${ant.project.name}"/>
                <attribute name="Implementation-Version" value="${version.label}"/>
                <attribute name="Built-Date" value="${build.timestamp}"/>
            </manifest>
        </jar>
    </target>

    <target name="jar-test" depends="clean,jar-main">
        <path id="compile-test.req">
            <fileset file="${main.jar}"/>
            <fileset dir="${buildlib.dir}" includes="**/*.jar"/>
        </path>
        <compile-module srcdir="${basedir}/src/test" destdir="${build.dir}/test" classpathref="compile-test.req"/>

        <zip destfile="${build.dir}/test-deps.jar">
            <zipgroupfileset dir="${buildlib.dir}">
                <include name="hamcrest-core-*.jar"/>
                <include name="hamcrest-library-*.jar"/>
                <include name="jmock-*.jar"/>
                <include name="junit-dep-*.jar"/>
                <include name="menodora-*.jar"/>
            </zipgroupfileset>
        </zip>
        <jar destfile="${test.jar}">
            <fileset dir="${build.dir}/test"/>
            <fileset dir="${basedir}" includes="LICENSE NOTICE README.md"/>
            <zipfileset src="${build.dir}/test-deps.jar" excludes="**/META-INF/**"/>
            <manifest>
                <attribute name="Built-By" value="${user.name}"/>
                <attribute name="Implementation-Vendor" value="netmelody.org"/>
                <attribute name="Implementation-Title" value="${ant.project.name} Tests"/>
                <attribute name="Implementation-Version" value="${version.label}"/>
                <attribute name="Built-Date" value="${build.timestamp}"/>
            </manifest>
        </jar>
    </target>

    <target name="jar" description="Create jar files" depends="jar-main,jar-test"/>

    <target name="test" description="Test this project" depends="jar">
        <mkdir dir="${build.dir}/testreport"/>
        <mkdir dir="${build.dir}/tmp"/>

        <junit printsummary="yes" haltonfailure="yes" forkmode="once" tempdir="${build.dir}/tmp">
            <classpath>
              <pathelement location="${main.jar}"/>
              <pathelement location="${test.jar}"/>
            </classpath>
            <formatter type="plain"/>
            <batchtest fork="yes" todir="${build.dir}/testreport">
                <zipfileset src="${test.jar}">
                    <include name="org/netmelody/cieye/**/*Test.class"/>
                </zipfileset>
            </batchtest>
        </junit>
    </target>

    <target name="dependency-check" depends="clean,jar" description="Perform dependency checks">
        <taskdef name="classycleDependencyCheck"
                 classname="classycle.ant.DependencyCheckingTask"
                 classpath="${buildlib.dir}/classycle-1.4.jar"/>

        <classycleDependencyCheck definitionFile="dependencies.ddf" failOnUnwantedDependencies="true" includingClasses="org.netmelody.*">
            <fileset file="${main.jar}"/>
        </classycleDependencyCheck>
    </target>

    <target name="snapshot" description="Create a tested snapshot jar file" depends="test,dependency-check"/>
    <target name="release" description="Create a tested release jar file" depends="version-for-release,snapshot"/>

    <target name="shrink" depends="release">
        <taskdef resource="proguard/ant/task.properties" classpath="${buildlib.dir}/proguard.jar" />
        <copy file="${main.jar}" tofile="${build.dir}/ci-eye-in.jar"></copy>
        <proguard configuration="ci-eye.pro"/>
    </target>
</project>


text:
FROM java:8-alpine
MAINTAINER Your Name <you@example.com>

ADD target/uberjar/fb-bot.jar /fb-bot/app.jar

EXPOSE 3000

CMD ["java", "-jar", "/fb-bot/app.jar"]


text:
AutoRoll Configs Have Moved
===========================

AutoRoll configs have moved to the [skia-autoroll-internal-config](https://skia.googlesource.com/skia-autoroll-internal-config.git/+/main/skia-public) repo.


text:
package com.google.api.ads.adwords.jaxws.v201502.o;

import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;

/**
 *
 *             Represents the estimate results for a single ad group.
 *
 *
 *
Java class for AdGroupEstimate complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="AdGroupEstimate">
 *   <complexContent>
 *     <extension base="{https://adwords.google.com/api/adwords/o/v201502}Estimate">
 *       <sequence>
 *         <element name="adGroupId" type="{http://www.w3.org/2001/XMLSchema}long" minOccurs="0"/>
 *         <element name="keywordEstimates" type="{https://adwords.google.com/api/adwords/o/v201502}KeywordEstimate" maxOccurs="unbounded" minOccurs="0"/>
 *       </sequence>
 *     </extension>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AdGroupEstimate", propOrder = {
    "adGroupId",
    "keywordEstimates"
})
public class AdGroupEstimate
    extends Estimate
{

    protected Long adGroupId;
    protected List<KeywordEstimate> keywordEstimates;

    /**
     * Gets the value of the adGroupId property.
     *
     * @return
     *     possible object is
     *     {@link Long }
     *
     */
    public Long getAdGroupId() {
        return adGroupId;
    }

    /**
     * Sets the value of the adGroupId property.
     *
     * @param value
     *     allowed object is
     *     {@link Long }
     *
     */
    public void setAdGroupId(Long value) {
        this.adGroupId = value;
    }

    /**
     * Gets the value of the keywordEstimates property.
     *
     *

     * This accessor method returns a reference to the live list,
     * not a snapshot. Therefore any modification you make to the
     * returned list will be present inside the JAXB object.
     * This is why there is not a set method for the keywordEstimates property.
     *
     *

     * For example, to add a new item, do as follows:
     *

     *    getKeywordEstimates().add(newItem);
     *

     *
     *
     *

     * Objects of the following type(s) are allowed in the list
     * {@link KeywordEstimate }
     *
     *
     */
    public List<KeywordEstimate> getKeywordEstimates() {
        if (keywordEstimates == null) {
            keywordEstimates = new ArrayList<KeywordEstimate>();
        }
        return this.keywordEstimates;
    }

}


text:
downloadURI = function(uri, name) {
  var link = document.createElement("a");
  link.download = name;
  link.href = uri;
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
  delete link;
}

makeRequest = function(method, url) {
  return new Promise(function (resolve, reject) {
    var xhr = new XMLHttpRequest();
    xhr.open(method, url);
    xhr.onload = function () {
      if (this.status >= 200 && this.status < 300) {
        resolve(xhr.responseText);
      } else {
        reject({
          status: this.status,
          statusText: xhr.statusText
        });
      }
    };
    xhr.onerror = function () {
      reject({
        status: this.status,
        statusText: xhr.statusText
      });
    };
    xhr.send();
  });
}

var steamImageUrls = [];

getUrlFromResponse = function(responseText) {
  window.resp = responseText;
  var linkRegex = new RegExp('https://steamuserimages[^\"]+');
  var url = linkRegex.exec(window.resp)[0];
  steamImageUrls.push(url);
  console.log(url);
  return url;
}

var urls = [];
jQuery('a.profile_media_item.modalContentLink').each(function(index, el) {
	urls.push(el.href);
});

for (var i = 0; i < urls.length; ++i) {
	makeRequest("GET", urls[i])
	.then( function(text) {
		var imageUrl = getUrlFromResponse(text);
		downloadURI(imageUrl, 'image' + i + '.jpg');
	});
}