Package com.taobao.metamorphosis.server.store

Examples of com.taobao.metamorphosis.server.store.FileMessageSet


        this.assertMessages(store);
    }


    private void assertMessages(final MessageStore store) throws IOException, InvalidMessageException {
        final FileMessageSet msgSet = (FileMessageSet) store.slice(0, 1024);
        final ByteBuffer buf = ByteBuffer.allocate((int) msgSet.getSizeInBytes());
        msgSet.read(buf, 0);
        final MessageIterator it = new MessageIterator("topic1", buf.array());
        int count = 0;
        while (it.hasNext()) {
            final Message msg = it.next();
            assertTrue(new String(msg.getData()).startsWith("msg"));
View Full Code Here


            final SegmentInfo segInfo) throws IOException {
        final long minOffset = segInfo.startOffset;
        final long size = segInfo.size;
        final long maxOffset = minOffset + size;
        long startOffset = minOffset;
        FileMessageSet msgSet = null;
        // ��segment��ƫ��offset����
        final Set<OffsetInfo> segRecoverOffsetInfos = new HashSet<SamsaMasterBroker.OffsetInfo>();
        // ��ǰ�����ļ�
        while (startOffset < maxOffset && (msgSet = (FileMessageSet) store.slice(startOffset, MAX_SIZE)) != null) {
            final int sizeInBytes = (int) msgSet.getSizeInBytes();
            final ByteBuffer buffer = ByteBuffer.allocate(sizeInBytes);
            msgSet.read(buffer);
            final MessageIterator it = new MessageIterator(topic, buffer.array());
            final List<DecodeMessage> msgList = new ArrayList<DecodeMessage>();
            // ������Ϣ
            long msgOffset = 0;
            while (it.hasNext()) {
View Full Code Here

TOP

Related Classes of com.taobao.metamorphosis.server.store.FileMessageSet

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.