Package org.apache.cassandra.utils.memory

Examples of org.apache.cassandra.utils.memory.AbstractAllocator


    }

    // Replaces all the CounterUpdateCell-s with updated regular CounterCell-s
    private ColumnFamily processModifications(ColumnFamily changesCF)
    {
        AbstractAllocator allocator = HeapAllocator.instance;
        ColumnFamilyStore cfs = Keyspace.open(getKeyspaceName()).getColumnFamilyStore(changesCF.id());

        ColumnFamily resultCF = changesCF.cloneMeShallow();

        List<CounterUpdateCell> counterUpdateCells = new ArrayList<>(changesCF.getColumnCount());
View Full Code Here


    private static final Pool POOL = new HeapPool(Integer.MAX_VALUE, 1f, null);

    /** Allocates 1 byte from a new SlabAllocator and returns it. */
    private AbstractAllocator bumpedSlab()
    {
        AbstractAllocator allocator = POOL.newAllocator(new OpOrder());
        allocator.allocate(1);
        return allocator;
    }
View Full Code Here

    public void testClearLocal()
    {
        ContextState state;
        ByteBuffer marked;
        ByteBuffer cleared;
        AbstractAllocator allocator = HeapAllocator.instance;

        // mark/clear for remote-only contexts is a no-op
        state = ContextState.allocate(0, 0, 1, allocator);
        state.writeRemote(CounterId.fromInt(1), 1L, 1L);
View Full Code Here

        Cell right;
        Cell reconciled;

        ByteBuffer context;

        AbstractAllocator allocator = HeapAllocator.instance;

        // tombstone + tombstone
        left  = new DeletedCell(cellname("x"), 1, 1L);
        right = new DeletedCell(cellname("x"), 2, 2L);
View Full Code Here

    }

    @Test
    public void testDiff()
    {
        AbstractAllocator allocator = HeapAllocator.instance;
        ContextState left;
        ContextState right;

        CounterCell leftCell;
        CounterCell rightCell;
View Full Code Here

    }

    @Test
    public void testSerializeDeserialize() throws IOException
    {
        AbstractAllocator allocator = HeapAllocator.instance;
        CounterContext.ContextState state = CounterContext.ContextState.allocate(0, 2, 2, allocator);
        state.writeRemote(CounterId.fromInt(1), 4L, 4L);
        state.writeLocal(CounterId.fromInt(2), 4L, 4L);
        state.writeRemote(CounterId.fromInt(3), 4L, 4L);
        state.writeLocal(CounterId.fromInt(4), 4L, 4L);
View Full Code Here

    }

    @Test
    public void testUpdateDigest() throws Exception
    {
        AbstractAllocator allocator = HeapAllocator.instance;
        MessageDigest digest1 = MessageDigest.getInstance("md5");
        MessageDigest digest2 = MessageDigest.getInstance("md5");

        CounterContext.ContextState state = CounterContext.ContextState.allocate(0, 2, 2, allocator);
        state.writeRemote(CounterId.fromInt(1), 4L, 4L);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.utils.memory.AbstractAllocator

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.