[jboss-cvs] JBoss Messaging SVN: r5568 - in trunk/src/main/org/jboss/messaging/core: paging/impl and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Jan 2 07:49:25 EST 2009
Author: timfox
Date: 2009-01-02 07:49:25 -0500 (Fri, 02 Jan 2009)
New Revision: 5568
Removed:
trunk/src/main/org/jboss/messaging/core/paging/LastPageRecord.java
trunk/src/main/org/jboss/messaging/core/paging/impl/LastPageRecordImpl.java
Modified:
trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
trunk/src/main/org/jboss/messaging/core/paging/PagingStore.java
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
trunk/src/main/org/jboss/messaging/core/persistence/StorageManager.java
trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java
trunk/src/main/org/jboss/messaging/core/persistence/impl/nullpm/NullStorageManager.java
Log:
Removed LastPageRecord
Deleted: trunk/src/main/org/jboss/messaging/core/paging/LastPageRecord.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/LastPageRecord.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/LastPageRecord.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -1,50 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.messaging.core.paging;
-
-import org.jboss.messaging.core.journal.EncodingSupport;
-import org.jboss.messaging.util.SimpleString;
-
-/**
- *
- * Stores the last pageID processed during depage, to detect duplications after the delete
- *
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public interface LastPageRecord extends EncodingSupport
-{
- /** Internal field with the primary key, used on the journal/database */
- long getRecordId();
-
- /** Internal field with the primary key, used on the journal/database */
- void setRecordId(long recordId);
-
- SimpleString getDestination();
-
- /** Last Page ID*/
- long getLastId();
-
- /** Last Page ID*/
- void setLastId(long lastId);
-}
Modified: trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/PagingManager.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -110,12 +110,6 @@
* */
PageTransactionInfo getTransaction(long transactionID);
- /**
- *
- * Duplication detection for paging processing
- * */
- void setLastPageRecord(LastPageRecord lastPage) throws Exception;
-
/**
*
* To be called when there are no more references to the message
Modified: trunk/src/main/org/jboss/messaging/core/paging/PagingStore.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/PagingStore.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/PagingStore.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -62,21 +62,17 @@
void sync() throws Exception;
boolean page(PagedMessage message, boolean sync) throws Exception;
-
+
/**
*
* @return false if a thread was already started, or if not in page mode
* @throws Exception
*/
boolean startDepaging();
-
+
/** When start depaging from a global perspective, we don't want all the stores depaging at once what could saturate the servers */
boolean startDepaging(Executor executor);
- LastPageRecord getLastPageRecord();
-
- void setLastPageRecord(LastPageRecord record);
-
/**
* @param memoryEstimate
* @return
Deleted: trunk/src/main/org/jboss/messaging/core/paging/impl/LastPageRecordImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/LastPageRecordImpl.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/LastPageRecordImpl.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -1,123 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, Red Hat Middleware LLC, and individual contributors
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.messaging.core.paging.impl;
-
-import static org.jboss.messaging.util.DataConstants.SIZE_LONG;
-
-import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.paging.LastPageRecord;
-import org.jboss.messaging.core.remoting.spi.MessagingBuffer;
-import org.jboss.messaging.util.SimpleString;
-
-/**
- *
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class LastPageRecordImpl implements LastPageRecord
-{
- // Constants -----------------------------------------------------
-
- private static final Logger log = Logger.getLogger(LastPageRecordImpl.class);
-
-
- // Attributes ----------------------------------------------------
-
- private volatile long recordId = 0;
-
- private volatile SimpleString destination;
-
- private volatile long lastId;
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- public LastPageRecordImpl(final long lastId, final SimpleString destination)
- {
- this.lastId = lastId;
- this.destination = destination;
- }
-
- public LastPageRecordImpl()
- {
- }
-
- public long getRecordId()
- {
- return recordId;
- }
-
- public void setRecordId(final long recordId)
- {
- this.recordId = recordId;
- }
-
- public SimpleString getDestination()
- {
- return destination;
- }
-
- public void setDestination(final SimpleString destination)
- {
- this.destination = destination;
- }
-
- public long getLastId()
- {
- return lastId;
- }
-
- public void setLastId(final long lastId)
- {
- this.lastId = lastId;
- }
-
- public void decode(final MessagingBuffer buffer)
- {
- lastId = buffer.getLong();
- destination = buffer.getSimpleString();
- }
-
- public void encode(final MessagingBuffer buffer)
- {
- buffer.putLong(lastId);
- buffer.putSimpleString(destination);
- }
-
- public int getEncodeSize()
- {
- return SIZE_LONG + SimpleString.sizeofString(destination);
- }
-
- // Package protected ---------------------------------------------
-
- // Protected -----------------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
-
-}
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingManagerImpl.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -30,7 +30,6 @@
import java.util.concurrent.atomic.AtomicLong;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.paging.LastPageRecord;
import org.jboss.messaging.core.paging.PageTransactionInfo;
import org.jboss.messaging.core.paging.PagingManager;
import org.jboss.messaging.core.paging.PagingStore;
@@ -193,13 +192,6 @@
return defaultPageSize;
}
- public void setLastPageRecord(final LastPageRecord lastPage) throws Exception
- {
- trace("LastPage loaded was " + lastPage.getLastId() + " recordID = " + lastPage.getRecordId());
-
- getPageStore(lastPage.getDestination()).setLastPageRecord(lastPage);
- }
-
public boolean isPaging(final SimpleString destination) throws Exception
{
return getPageStore(destination).isPaging();
Modified: trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/paging/impl/PagingStoreImpl.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -36,7 +36,6 @@
import org.jboss.messaging.core.journal.SequentialFile;
import org.jboss.messaging.core.journal.SequentialFileFactory;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.paging.LastPageRecord;
import org.jboss.messaging.core.paging.Page;
import org.jboss.messaging.core.paging.PageTransactionInfo;
import org.jboss.messaging.core.paging.PagedMessage;
@@ -110,8 +109,6 @@
private volatile boolean running = false;
- private volatile LastPageRecord lastPageRecord;
-
// Static --------------------------------------------------------
private static final boolean isTrace = log.isTraceEnabled();
@@ -460,16 +457,6 @@
}
}
- public LastPageRecord getLastPageRecord()
- {
- return lastPageRecord;
- }
-
- public void setLastPageRecord(final LastPageRecord record)
- {
- lastPageRecord = record;
- }
-
// MessagingComponent implementation
public synchronized boolean isStarted()
@@ -716,27 +703,6 @@
Transaction depageTransaction = new TransactionImpl(storageManager, postOffice, true);
- LastPageRecord lastPageRecord = getLastPageRecord();
-
- if (lastPageRecord == null)
- {
- lastPageRecord = new LastPageRecordImpl(pageId, destination);
-
- setLastPageRecord(lastPageRecord);
- }
- else
- {
- if (pageId <= lastPageRecord.getLastId())
- {
- log.warn("Page " + pageId + " was already processed, ignoring the page");
- return;
- }
- }
-
- lastPageRecord.setLastId(pageId);
-
- storageManager.storeLastPage(depageTransaction.getID(), lastPageRecord);
-
HashSet<PageTransactionInfo> pageTransactionsToUpdate = new HashSet<PageTransactionInfo>();
for (PagedMessage pagedMessage : pagedMessages)
@@ -880,11 +846,6 @@
}
}
- public void clearLastPageRecord(final LastPageRecord lastRecord) throws Exception
- {
- storageManager.deleteLastPage(lastRecord.getRecordId());
- }
-
private Page createPage(final int page) throws Exception
{
String fileName = createFileName(page);
@@ -934,14 +895,7 @@
Page page = depage();
if (page == null)
- {
- if (lastPageRecord != null)
- {
- clearLastPageRecord(lastPageRecord);
- }
-
- lastPageRecord = null;
-
+ {
return;
}
Modified: trunk/src/main/org/jboss/messaging/core/persistence/StorageManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/persistence/StorageManager.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/persistence/StorageManager.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -27,7 +27,6 @@
import javax.transaction.xa.Xid;
-import org.jboss.messaging.core.paging.LastPageRecord;
import org.jboss.messaging.core.paging.PageTransactionInfo;
import org.jboss.messaging.core.postoffice.Binding;
import org.jboss.messaging.core.postoffice.PostOffice;
@@ -95,10 +94,6 @@
void storePageTransaction(long txID, PageTransactionInfo pageTransaction) throws Exception;
- void storeLastPage(long txID, LastPageRecord pageTransaction) throws Exception;
-
- void deleteLastPage(long recordID) throws Exception;
-
void deletePageTransactional(long txID, long recordID) throws Exception;
void loadMessageJournal(PostOffice postOffice,
Modified: trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/persistence/impl/journal/JournalStorageManager.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -54,10 +54,8 @@
import org.jboss.messaging.core.journal.impl.JournalImpl;
import org.jboss.messaging.core.journal.impl.NIOSequentialFileFactory;
import org.jboss.messaging.core.logging.Logger;
-import org.jboss.messaging.core.paging.LastPageRecord;
import org.jboss.messaging.core.paging.PageTransactionInfo;
import org.jboss.messaging.core.paging.PagingManager;
-import org.jboss.messaging.core.paging.impl.LastPageRecordImpl;
import org.jboss.messaging.core.paging.impl.PageTransactionInfoImpl;
import org.jboss.messaging.core.persistence.StorageManager;
import org.jboss.messaging.core.postoffice.Binding;
@@ -70,10 +68,10 @@
import org.jboss.messaging.core.server.Bindable;
import org.jboss.messaging.core.server.BindableFactory;
import org.jboss.messaging.core.server.JournalType;
+import org.jboss.messaging.core.server.LargeServerMessage;
import org.jboss.messaging.core.server.Link;
import org.jboss.messaging.core.server.MessageReference;
import org.jboss.messaging.core.server.Queue;
-import org.jboss.messaging.core.server.LargeServerMessage;
import org.jboss.messaging.core.server.ServerMessage;
import org.jboss.messaging.core.server.impl.ServerMessageImpl;
import org.jboss.messaging.core.transaction.ResourceManager;
@@ -119,8 +117,6 @@
public static final byte PAGE_TRANSACTION = 34;
- public static final byte LAST_PAGE = 35;
-
public static final byte SET_SCHEDULED_DELIVERY_TIME = 36;
public static final byte DUPLICATE_ID = 37;
@@ -333,25 +329,6 @@
pageTransaction);
}
- public void storeLastPage(final long txID, final LastPageRecord lastPage) throws Exception
- {
- if (lastPage.getRecordId() != 0)
- {
- // To avoid linked list effect on reclaiming, we delete and add a new
- // record, instead of simply updating it
- messageJournal.appendDeleteRecordTransactional(txID, lastPage.getRecordId());
- }
-
- lastPage.setRecordId(generateUniqueID());
-
- messageJournal.appendAddRecordTransactional(txID, lastPage.getRecordId(), LAST_PAGE, lastPage);
- }
-
- public void deleteLastPage(final long recordID) throws Exception
- {
- messageJournal.appendDeleteRecord(recordID);
- }
-
public void storeAcknowledgeTransactional(final long txID, final long queueID, final long messageID) throws Exception
{
messageJournal.appendUpdateRecordTransactional(txID, messageID, ACKNOWLEDGE_REF, new ACKEncoding(queueID));
@@ -472,7 +449,7 @@
message.decode(buff);
message.setReload();
-
+
postOffice.route(message, null);
break;
@@ -541,20 +518,6 @@
break;
}
- case LAST_PAGE:
- {
- LastPageRecordImpl recordImpl = new LastPageRecordImpl();
-
- recordImpl.setRecordId(record.id);
-
- recordImpl.decode(buff);
-
- PagingManager pagingManager = postOffice.getPagingManager();
-
- pagingManager.setLastPageRecord(recordImpl);
-
- break;
- }
case SET_SCHEDULED_DELIVERY_TIME:
{
long messageID = record.id;
@@ -930,7 +893,7 @@
{
throw new IllegalStateException("Failed to remove reference for " + messageID);
}
-
+
break;
}
case PAGE_TRANSACTION:
@@ -940,16 +903,17 @@
pageTransactionInfo.decode(buff);
pageTransactionInfo.markIncomplete();
-
+
tx.setPageTransaction(pageTransactionInfo);
break;
}
case SET_SCHEDULED_DELIVERY_TIME:
- {
- //Do nothing - for prepared txs, the set scheduled delivery time will only occur in a send in which
- //case the message will already have the header for the scheduled delivery time, so no need to do anything.
-
+ {
+ // Do nothing - for prepared txs, the set scheduled delivery time will only occur in a send in which
+ // case the message will already have the header for the scheduled delivery time, so no need to do
+ // anything.
+
break;
}
case DUPLICATE_ID:
@@ -1011,13 +975,13 @@
}
}
- for (MessageReference ack: referencesToAck)
+ for (MessageReference ack : referencesToAck)
{
tx.addAckTempUntilNextRefactoring(ack);
}
-
+
tx.setState(Transaction.State.PREPARED);
-
+
resourceManager.putTransaction(xid, tx);
}
}
@@ -1115,7 +1079,7 @@
boolean exclusive;
SimpleString linkAddress;
-
+
boolean duplicateDetection;
public BindingEncoding()
@@ -1185,13 +1149,12 @@
buffer.putNullableSimpleString(linkAddress);
buffer.putBoolean(duplicateDetection);
}
-
+
public int getEncodeSize()
{
- return SIZE_INT +
- SimpleString.sizeofString(name) +
+ return SIZE_INT + SimpleString.sizeofString(name) +
SimpleString.sizeofString(address) +
- SimpleString.sizeofNullableString(filter) +
+ SimpleString.sizeofNullableString(filter) +
SIZE_BOOLEAN +
SimpleString.sizeofNullableString(linkAddress) +
SIZE_BOOLEAN;
Modified: trunk/src/main/org/jboss/messaging/core/persistence/impl/nullpm/NullStorageManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/persistence/impl/nullpm/NullStorageManager.java 2009-01-02 12:34:41 UTC (rev 5567)
+++ trunk/src/main/org/jboss/messaging/core/persistence/impl/nullpm/NullStorageManager.java 2009-01-02 12:49:25 UTC (rev 5568)
@@ -27,15 +27,14 @@
import javax.transaction.xa.Xid;
-import org.jboss.messaging.core.paging.LastPageRecord;
import org.jboss.messaging.core.paging.PageTransactionInfo;
import org.jboss.messaging.core.persistence.StorageManager;
import org.jboss.messaging.core.postoffice.Binding;
import org.jboss.messaging.core.postoffice.PostOffice;
-import org.jboss.messaging.core.server.MessageReference;
-import org.jboss.messaging.core.server.Queue;
import org.jboss.messaging.core.server.BindableFactory;
import org.jboss.messaging.core.server.LargeServerMessage;
+import org.jboss.messaging.core.server.MessageReference;
+import org.jboss.messaging.core.server.Queue;
import org.jboss.messaging.core.server.ServerMessage;
import org.jboss.messaging.core.transaction.ResourceManager;
import org.jboss.messaging.util.IDGenerator;
@@ -201,14 +200,6 @@
return started;
}
- public void storeLastPage(final long txID, final LastPageRecord pageTransaction) throws Exception
- {
- }
-
- public void deleteLastPage(final long recordID) throws Exception
- {
- }
-
public void deleteMessageTransactional(final long txID, final long messageID, final long queueID) throws Exception
{
}
More information about the jboss-cvs-commits
mailing list