Package org.nustaq.serialization.simpleapi

Examples of org.nustaq.serialization.simpleapi.FSTCoder


    }

    @Test
    public void testKeys() throws Exception {
        new File("/tmp/test1.mmf").delete();
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);

        int count = 10;
        FSTAsciiStringOffheapMap<String> store = new FSTAsciiStringOffheapMap<>("/tmp/test1.mmf", klen, STORE_INITIAL_SIZE, MAX, coder);
        while( count-->0 ) {
View Full Code Here


    @Test
    public void hardcore() throws Exception {
        new File("/tmp/test.mmf").delete();
        fillMemMapped();
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);

        int count = 5;
//        while (true)
        while (count-- > 0)
        {
View Full Code Here

    @Test
    public void fillAndReloadMemMapped() throws Exception {
        new File("/tmp/test.mmf").delete();
        fillMemMapped();
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);

        FSTAsciiStringOffheapMap<TestRec> store = new FSTAsciiStringOffheapMap<>("/tmp/test.mmf", klen, 2*FSTAsciiStringOffheapMap.MB, MAX, coder);

        Assert.assertTrue(store.getSize() == MAX);
        checkStore(store);
View Full Code Here

    int klen = 16;
    int MAX = 200000;

    @Test
    public void fillMemMapped() throws Exception {
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);
        new File("/tmp/test.mmf").delete();

        FSTAsciiStringOffheapMap<TestRec> store = new FSTAsciiStringOffheapMap<>("/tmp/test.mmf", klen, FSTAsciiStringOffheapMap.MB, MAX, coder);

        fillAll(store);
View Full Code Here

        System.out.println("free: "+store.getFreeMem()/1024/1024);
    }

    @Test
    public void removeSomeMemMapped() throws Exception {
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);
        int klen = 16;
        new File("/tmp/test.mmf").delete();
        FSTAsciiStringOffheapMap store = new FSTAsciiStringOffheapMap("/tmp/test.mmf", klen, 2*FSTAsciiStringOffheapMap.MB, MAX, coder);
        fillAll(store);
        System.out.println("size pre "+store.getSize());
View Full Code Here

    String longString = "somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger+somewhatlonger";

    @Test
    public void testPutGetIter() {
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);
        int klen = 16;
        int MAX = 100000;

        FSTAsciiStringOffheapMap store = new FSTAsciiStringOffheapMap(klen, FSTAsciiStringOffheapMap.GB, MAX, coder);
View Full Code Here

        System.out.println("UsedMem "+store.getUsedMem()/1024/1024+" MB elems "+store.getSize()+" per elem bytes "+store.getUsedMem()/store.getSize());
    }

    @Test
    public void randomTest() {
        FSTCoder coder = createCoder();
        coder.getConf().registerClass(TestRec.class);
        int klen = 16;
        int MAX = 10000;

        ArrayList<String> keys = new ArrayList<>();
        FSTAsciiStringOffheapMap store = new FSTAsciiStringOffheapMap(klen, FSTAsciiStringOffheapMap.GB, MAX, coder);
View Full Code Here

TOP

Related Classes of org.nustaq.serialization.simpleapi.FSTCoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.