Package com.netflix.zeno.fastblob.record

Examples of com.netflix.zeno.fastblob.record.ByteDataBuffer.reset()


                            remapper.remapOrdinals(rec, mappedBuffer);

                            int newOrdinal = destState.addData(mappedBuffer, FastBlobImageUtils.toLong(imageMembershipsFlags));
                            stateOrdinalMapping.setMappedOrdinal(ordinal, newOrdinal);

                            mappedBuffer.reset();
                        }
                    }
                }
            });
        }
View Full Code Here


        for(int i=0;i<1000;i++) {
            buf.write((byte)10);
        }

        buf.reset();

        for(int i=0;i<1000;i++) {
            buf.write((byte)i);
        }
View Full Code Here

        /// add 1000 entries
        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 10000 + i);
            map.getOrAssignOrdinal(buf);
            buf.reset();
        }


        /// mark half of the entries used
        ThreadSafeBitSet bitSet = new ThreadSafeBitSet(10);
View Full Code Here

        /// ensure that the used entries are still available
        for(int i=0;i<1000;i+=2) {
            VarInt.writeVInt(buf, 10000 + i);
            Assert.assertEquals(i, map.getOrAssignOrdinal(buf));
            buf.reset();
        }


        /// track the ordinals which are assigned to new values
        Set<Integer> newlyAssignedOrdinals = new HashSet<Integer>();
View Full Code Here

        Set<Integer> newlyAssignedOrdinals = new HashSet<Integer>();
        for(int i=1;i<1000;i+=2) {
            VarInt.writeVInt(buf, 50230532 + i);
            int newOrdinal = map.getOrAssignOrdinal(buf);
            newlyAssignedOrdinals.add(newOrdinal);
            buf.reset();
        }

        /// those ordinals should be the recycled ones after the compact.
        for(int i=1;i<1000;i+=2) {
            Assert.assertTrue(newlyAssignedOrdinals.contains(i));
View Full Code Here

        ByteDataBuffer buf = new ByteDataBuffer();

        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 10000 + i);
            map.put(buf, i + 50);
            buf.reset();
        }

        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 10000 + i);
            Assert.assertEquals(i + 50, map.get(buf));
View Full Code Here

        }

        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 10000 + i);
            Assert.assertEquals(i + 50, map.get(buf));
            buf.reset();
        }

        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 20000 + i);
            Assert.assertEquals(-1, map.get(buf));
View Full Code Here

        }

        for(int i=0;i<1000;i++) {
            VarInt.writeVInt(buf, 20000 + i);
            Assert.assertEquals(-1, map.get(buf));
            buf.reset();
        }

        map.clear();

        Assert.assertEquals(0, map.getDataSize());
View Full Code Here

        Assert.assertEquals(0, map.getDataSize());

        for(int i=0;i<5000;i++) {
            VarInt.writeVInt(buf, 20000 + i);
            Assert.assertEquals(-1, map.get(buf));
            buf.reset();
        }

        for(int i=0;i<5000;i++) {
            VarInt.writeVInt(buf, 20000 + i);
            map.put(buf, i + 50);
View Full Code Here

        }

        for(int i=0;i<5000;i++) {
            VarInt.writeVInt(buf, 20000 + i);
            map.put(buf, i + 50);
            buf.reset();
        }

    }

    @Test
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.