Examples of DeferredSerialization


Examples of org.voltcore.utils.DeferredSerialization

                    r.flattenToBuffer(buf);
                    buf.flip();

                    //Check for no change
                    ByteBuffer oldValue = null;
                    DeferredSerialization ds = m_currentTopologyValues.get();
                    if (ds != null) {
                        oldValue = ByteBuffer.allocate(ds.getSerializedSize());
                        ds.serialize(oldValue);
                    }

                    if (buf.equals(oldValue)) return;

                    m_currentTopologyValues.set(new DeferredSerialization() {
                        @Override
                        public void serialize(ByteBuffer outbuf) throws IOException {
                            outbuf.put(buf.duplicate());
                        }
                        @Override
View Full Code Here

Examples of org.voltdb.utils.DeferredSerialization

        synchronized (this) {
            if (m_isShutdown) {
                return false;
            }
            updateLastPendingWriteTimeAndQueueBackpressure();
            m_queuedWrites.offer(new DeferredSerialization() {
                @Override
                public BBContainer serialize(final DBBPool pool) throws IOException {
                    final FastSerializer fs = new FastSerializer(pool, m_port.m_expectedOutgoingMessageSize);
                    return fs.writeObjectForMessaging(f);
                }
View Full Code Here

Examples of org.voltdb.utils.DeferredSerialization

        synchronized (this) {
            if (m_isShutdown) {
                return false;
            }
            updateLastPendingWriteTimeAndQueueBackpressure();
            m_queuedWrites.offer(new DeferredSerialization() {
                @Override
                public BBContainer serialize(final DBBPool pool) throws IOException {
                    final FastSerializer fs = new FastSerializer(pool, expectedSize);
                    return fs.writeObjectForMessaging(f);
                }
View Full Code Here

Examples of org.voltdb.utils.DeferredSerialization

             * Attempt to use one of our own pooled direct byte buffers
             * so that a gathering write can be done later. Java gathering
             * writes spam direct byte buffers if many regular BBs are used
             */
            if (b.remaining() < DBBPool.MAX_ALLOCATION_SIZE){
                m_queuedWrites.offer(new DeferredSerialization() {
                    @Override
                    public BBContainer serialize(final DBBPool pool) {
                        final BBContainer c = pool.acquire(b.remaining());
                        assert(c.b.isDirect());
                        c.b.put(b);
View Full Code Here

Examples of org.voltdb.utils.DeferredSerialization

                }
            }
        }
        final BBContainer results[] = new BBContainer[oldlist.size()];
        int ii = 0;
        DeferredSerialization ds = null;
        int bytesQueued = 0;
        while ((ds = oldlist.poll()) != null) {
            results[ii] = ds.serialize(pool);
            bytesQueued += results[ii].b.remaining();
            assert(results[ii] != null);
            assert(results[ii].b != null);
            ii++;
        }
View Full Code Here

Examples of org.voltdb.utils.DeferredSerialization

        while ((c = m_queuedBuffers.poll()) != null) {
            bytesReleased += c.b.remaining();
            c.discard();
        }
        updateQueued(-bytesReleased, false);
        DeferredSerialization ds = null;
        while ((ds = m_queuedWrites.poll()) != null) {
            ds.cancel();
        }
    }
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.