<commit_before>package com.hyd.ssdb;

import com.hyd.ssdb.conf.Server;
import com.hyd.ssdb.protocol.Request;
import com.hyd.ssdb.protocol.Response;
import com.hyd.ssdb.util.Bytes;
import com.hyd.ssdb.util.IdScore;
import com.hyd.ssdb.util.KeyValue;
import com.hyd.ssdb.util.Processor;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import static org.junit.Assert.*;

/**
 * (description)
 * created at 15-12-2
 *
 * @author Yiding
 */
public class SsdbClientTest extends BaseTest {

    ////////////////////////////////////////////////////////////////

    @Test
    public void testSendRequest() throws Exception {
        Response response = ssdbClient.sendRequest(new Request("get name"));
        System.out.println(response.getHead());
        System.out.println(response.getBlocks());
    }

    @Test
    public void testDbsize() throws Exception {
        Server server = ssdbClient.getSharding().getClusters().get(0).getServers().get(0);
        System.out.println("dbsize of " + server + ": " + ssdbClient.dbsize(server));
    }

    @Test<commit_msg>某些命令在多服务器环境下需要特殊处理<commit_after>package com.hyd.ssdb;

import com.hyd.ssdb.conf.Server;
import com.hyd.ssdb.protocol.Request;
import com.hyd.ssdb.protocol.Response;
import com.hyd.ssdb.util.Bytes;
import com.hyd.ssdb.util.IdScore;
import com.hyd.ssdb.util.KeyValue;
import com.hyd.ssdb.util.Processor;
import org.junit.Test;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

import static org.junit.Assert.*;

/**
 * (description)
 * created at 15-12-2
 *
 * @author Yiding
 */
public class SsdbClientTest extends BaseTest {

    ////////////////////////////////////////////////////////////////

    @Test
    public void testSendRequest() throws Exception {
        Response response = ssdbClient.sendRequest(new Request("get name"));
        System.out.println(response.getHead());
        System.out.println(response.getBlocks());
    }

    @Test
    public void testMultiGet() {
        ssdbClient.multiSet("key1", "value1", "key2", "value2", "key3", "value3");
        List<String> values = ssdbClient.multiGet("key1", "key2", "key3");
        assertEquals(Arrays.asList("value1", "value2", "value3"), values);
    }

    @Test
    public void testDbsize() throws Exception {
        Server server = ssdbClient.getSharding().getClusters().get(0).getServers().get(0);
        System.out.println("dbsize of " + server + ": " + ssdbClient.dbsize(server));
    }

    @Test
{'fraction_non_alphanumeric': 0.18230358504958047, 'fraction_numerical': 0.009916094584286803, 'mean_word_length': 2.968229954614221, 'pattern_counts': {'":': 2, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3862481', 'n_tokens_mistral': 843, 'n_tokens_neox': 826, 'n_words': 152}