Examples of AddMsgLocation


Examples of com.taobao.metamorphosis.server.transaction.store.JournalTransactionStore.AddMsgLocation

    }


    public static final Map<String, JournalTransactionStore.AddMsgLocation> decodeLocations(final ByteBuffer buf) {

        AddMsgLocation location = null;

        final Map<String, JournalTransactionStore.AddMsgLocation> rt =
                new LinkedHashMap<String, JournalTransactionStore.AddMsgLocation>();

        while ((location = AddMsgLocation.decode(buf)) != null) {
View Full Code Here

Examples of com.taobao.metamorphosis.server.transaction.store.JournalTransactionStore.AddMsgLocation

                final AtomicBoolean replayed = new AtomicBoolean(false);
                final AtomicInteger counter = new AtomicInteger();
                if (ids != null && !ids.isEmpty()) {
                    for (final Map.Entry<MessageStore, List<Long>> entry : ids.entrySet()) {
                        final MessageStore msgStore = entry.getKey();
                        final AddMsgLocation addedLocation = locations.get(msgStore.getDescription());
                        // û�������Ϣ����Ҫ�������
                        final List<Long> idList = entry.getValue();
                        final List<PutCommand> cmdList = putCmds.get(msgStore);
                        if (addedLocation == null) {
                            counter.incrementAndGet();
                            msgStore.append(idList, cmdList, new AppendCallback() {
                                @Override
                                public void appendComplete(final Location newLocation) {
                                    replayed.set(true);
                                    final int checksum =
                                            CheckSum.crc32(MessageUtils.makeMessageBuffer(idList, cmdList).array());
                                    locations.put(msgStore.getDescription(),
                                        new AddMsgLocation(newLocation.getOffset(), newLocation.getLength(), checksum,
                                            msgStore.getDescription()));
                                    counter.decrementAndGet();
                                }
                            });

                        }
                        else {
                            // �����ط�
                            counter.incrementAndGet();
                            msgStore.replayAppend(addedLocation.getOffset(), addedLocation.getLength(),
                                addedLocation.checksum, idList, cmdList, new AppendCallback() {
                                @Override
                                public void appendComplete(final Location newLocation) {
                                    // ����طŵ�ʱ�������λ�ã�����Ҫ����λ����Ϣ
                                    if (newLocation != null) {
                                        replayed.set(true);
                                        locations.put(msgStore.getDescription(),
                                            new AddMsgLocation(newLocation.getOffset(), newLocation.getLength(),
                                                addedLocation.checksum, addedLocation.storeDesc));
                                    }
                                    counter.decrementAndGet();
                                }
                            });
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.