Author: manik.surtani(a)jboss.com
Date: 2009-02-25 07:02:25 -0500 (Wed, 25 Feb 2009)
New Revision: 7782
Modified:
core/branches/flat/src/main/java/org/horizon/CacheDelegate.java
core/branches/flat/src/main/java/org/horizon/Version.java
core/branches/flat/src/main/java/org/horizon/atomic/AtomicMap.java
core/branches/flat/src/main/java/org/horizon/commands/remote/ClusteredGetCommand.java
core/branches/flat/src/main/java/org/horizon/commands/write/InvalidateCommand.java
core/branches/flat/src/main/java/org/horizon/config/parsing/XmlConfigurationParserImpl.java
core/branches/flat/src/main/java/org/horizon/container/NullMarkerEntry.java
core/branches/flat/src/main/java/org/horizon/container/ReadCommittedEntry.java
core/branches/flat/src/main/java/org/horizon/container/RepeatableReadEntry.java
core/branches/flat/src/main/java/org/horizon/context/EntryLookup.java
core/branches/flat/src/main/java/org/horizon/eviction/DefaultEvictionAction.java
core/branches/flat/src/main/java/org/horizon/eviction/EvictionAction.java
core/branches/flat/src/main/java/org/horizon/eviction/algorithms/BaseEvictionAlgorithm.java
core/branches/flat/src/main/java/org/horizon/eviction/events/EvictionEvent.java
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentFactory.java
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java
core/branches/flat/src/main/java/org/horizon/factories/EntryFactory.java
core/branches/flat/src/main/java/org/horizon/factories/EntryFactoryImpl.java
core/branches/flat/src/main/java/org/horizon/interceptors/CacheLoaderInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/CallInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/InvocationContextInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/PassivationInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/ReplicationInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/base/BaseRpcInterceptor.java
core/branches/flat/src/main/java/org/horizon/interceptors/base/CommandInterceptor.java
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
core/branches/flat/src/main/java/org/horizon/jmx/PlatformMBeanServerRegistration.java
core/branches/flat/src/main/java/org/horizon/loader/decorators/SingletonStore.java
core/branches/flat/src/main/java/org/horizon/lock/IsolationLevel.java
core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java
core/branches/flat/src/main/java/org/horizon/marshall/HorizonMarshaller.java
core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java
core/branches/flat/src/main/java/org/horizon/remoting/ReplicationQueue.java
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java
core/branches/flat/src/main/java/org/horizon/statetransfer/StateTransferManager.java
core/branches/flat/src/main/java/org/horizon/transaction/GenericTransactionManagerLookup.java
core/branches/flat/src/main/java/org/horizon/util/concurrent/locks/OwnableReentrantLock.java
core/branches/flat/src/main/release/JBossORG-EULA.txt
core/branches/flat/src/main/release/README-Demo.txt
core/branches/flat/src/main/release/README-libs.txt
core/branches/flat/src/main/release/README.txt
core/branches/flat/src/main/release/licenses/README-bdbje-lib.txt
core/branches/flat/src/test/java/org/horizon/api/tree/TreeCacheAPITest.java
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/lru/LruQueueTest.java
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/mru/MruQueueTest.java
core/branches/flat/src/test/java/org/horizon/marshall/MarshalledValueTest.java
core/branches/flat/src/test/java/org/horizon/replication/AsyncReplTest.java
core/branches/flat/src/test/java/org/horizon/test/TestNameVerifier.java
core/branches/flat/src/test/java/org/horizon/test/TestingUtil.java
core/branches/flat/src/test/java/org/horizon/test/UnitTestDatabaseManager.java
Log:
Naming, Javadocs and Comments
Modified: core/branches/flat/src/main/java/org/horizon/CacheDelegate.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/CacheDelegate.java 2009-02-25 11:22:30
UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/CacheDelegate.java 2009-02-25 12:02:25
UTC (rev 7782)
@@ -207,8 +207,7 @@
if (transactionManager != null && (ongoingTransaction =
transactionManager.getTransaction()) != null) {
transactionManager.suspend();
}
-
- // if the node exists then this should be a no-op.
+ // if the entry exists then this should be a no-op.
putIfAbsent(key, value, Options.FAIL_SILENTLY, Options.FORCE_ASYNCHRONOUS,
Options.ZERO_LOCK_ACQUISITION_TIMEOUT);
}
catch (Exception e) {
Modified: core/branches/flat/src/main/java/org/horizon/Version.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/Version.java 2009-02-25 11:22:30 UTC (rev
7781)
+++ core/branches/flat/src/main/java/org/horizon/Version.java 2009-02-25 12:02:25 UTC (rev
7782)
@@ -24,7 +24,7 @@
import net.jcip.annotations.Immutable;
/**
- * Contains version information about this release of JBoss Cache.
+ * Contains version information about this release of Horizon.
*
* @author Bela Ban
* @since 1.0
Modified: core/branches/flat/src/main/java/org/horizon/atomic/AtomicMap.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/atomic/AtomicMap.java 2009-02-25 11:22:30
UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/atomic/AtomicMap.java 2009-02-25 12:02:25
UTC (rev 7782)
@@ -24,7 +24,7 @@
import java.util.Map;
/**
- * This is a special type of Map geared for use in JBoss Cache. This map type supports
JBoss Cache atomicizing writes
+ * This is a special type of Map geared for use in Horizon. This map type supports
Horizon atomicizing writes
* on the cache such that a coarse grained locking is used if this map is stored in the
cache, such that the entire map
* is locked for writes or is isolated for safe concurrent read.
* <p/>
Modified:
core/branches/flat/src/main/java/org/horizon/commands/remote/ClusteredGetCommand.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/commands/remote/ClusteredGetCommand.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/commands/remote/ClusteredGetCommand.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -45,15 +45,13 @@
public static final byte METHOD_ID = 22;
private DataCommand dataCommand;
- private boolean searchBackupSubtrees;
private DataContainer dataContainer;
private InterceptorChain interceptorChain;
private static final Log log = LogFactory.getLog(ClusteredGetCommand.class);
private static final boolean trace = log.isTraceEnabled();
- public ClusteredGetCommand(boolean searchBackupSubtrees, DataCommand dataCommand) {
- this.searchBackupSubtrees = searchBackupSubtrees;
+ public ClusteredGetCommand(boolean unused, DataCommand dataCommand) {
this.dataCommand = dataCommand;
}
@@ -74,7 +72,7 @@
*/
public Object perform(InvocationContext context) throws Throwable {
if (trace)
- log.trace("Clustered Get called with params: " + dataCommand + ",
" + searchBackupSubtrees);
+ log.trace("Clustered Get called with param: " + dataCommand);
Object callResults = null;
try {
@@ -112,21 +110,16 @@
return null;
}
- public Boolean getSearchBackupSubtrees() {
- return searchBackupSubtrees;
- }
-
public DataCommand getDataCommand() {
return dataCommand;
}
public Object[] getParameters() {
- return new Object[]{dataCommand, searchBackupSubtrees}; //To change body of
implemented methods use File | Settings | File Templates.
+ return new Object[]{dataCommand}; //To change body of implemented methods use File
| Settings | File Templates.
}
public void setParameters(int commandId, Object[] args) {
dataCommand = (DataCommand) args[0];
- searchBackupSubtrees = (Boolean) args[1];
}
@Override
@@ -136,16 +129,13 @@
ClusteredGetCommand that = (ClusteredGetCommand) o;
- if (dataCommand != null ? !dataCommand.equals(that.dataCommand) : that.dataCommand
!= null)
- return false;
- return searchBackupSubtrees == that.searchBackupSubtrees;
+ return !(dataCommand != null ? !dataCommand.equals(that.dataCommand) :
that.dataCommand != null);
}
@Override
public int hashCode() {
int result;
result = (dataCommand != null ? dataCommand.hashCode() : 0);
- result = 31 * result + (searchBackupSubtrees ? 1 : 0);
return result;
}
@@ -153,7 +143,6 @@
public String toString() {
return "ClusteredGetCommand{" +
"dataCommand=" + dataCommand +
- ", searchBackupSubtrees=" + searchBackupSubtrees +
'}';
}
}
Modified:
core/branches/flat/src/main/java/org/horizon/commands/write/InvalidateCommand.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/commands/write/InvalidateCommand.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/commands/write/InvalidateCommand.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -31,8 +31,7 @@
/**
- * Removes a node's content from memory - never removes the node. It also clenups
data for resident nodes - which are
- * not being touched by eviction.
+ * Removes an entry from memory - never removes the entry.
*
* @author Mircea.Markus(a)jboss.com
* @since 1.0
@@ -52,7 +51,7 @@
}
/**
- * Performs an invalidation on a specified node
+ * Performs an invalidation on a specified entry
*
* @param ctx invocation context
* @return null
Modified:
core/branches/flat/src/main/java/org/horizon/config/parsing/XmlConfigurationParserImpl.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/config/parsing/XmlConfigurationParserImpl.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/config/parsing/XmlConfigurationParserImpl.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -431,14 +431,14 @@
}
/**
- * Tests whether the element passed in is a modern (3.0) config element rather than a
legacy one.
+ * Tests whether the element passed in is a valid config element.
*
* @param element element to test
* @return true of the element is a modern one and can be parsed using the current
parser.
*/
public boolean isValidElementRoot(Element element) {
- // simply test for the "jbosscache" element.
- NodeList elements = element.getElementsByTagName("jbosscache");
+ // simply test for the "horizon" element.
+ NodeList elements = element.getElementsByTagName("horizon");
return elements != null && elements.getLength() > 0;
}
}
Modified: core/branches/flat/src/main/java/org/horizon/container/NullMarkerEntry.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/container/NullMarkerEntry.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/container/NullMarkerEntry.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -22,7 +22,7 @@
package org.horizon.container;
/**
- * A marker node to represent a null node for repeatable read, so that a read that
returns a null can continue to return
+ * A marker entry to represent a null for repeatable read, so that a read that returns a
null can continue to return
* null.
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
@@ -38,7 +38,7 @@
}
/**
- * @return always returns true so that any get commands, upon getting this node, will
ignore the node as though it
+ * @return always returns true so that any get commands, upon getting this entry, will
ignore the entry as though it
* were removed.
*/
@Override
@@ -47,7 +47,7 @@
}
/**
- * @return always returns true so that any get commands, upon getting this node, will
ignore the node as though it
+ * @return always returns true so that any get commands, upon getting this entry, will
ignore the entry as though it
* were invalid.
*/
@Override
Modified: core/branches/flat/src/main/java/org/horizon/container/ReadCommittedEntry.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/container/ReadCommittedEntry.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/container/ReadCommittedEntry.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -26,7 +26,7 @@
import org.horizon.logging.LogFactory;
/**
- * A node delegate that encapsulates read committed semantics when writes are initiated,
committed or rolled back.
+ * A wrapper around a cached entry that encapsulates read committed semantics when writes
are initiated, committed or rolled back.
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 1.0
Modified: core/branches/flat/src/main/java/org/horizon/container/RepeatableReadEntry.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/container/RepeatableReadEntry.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/container/RepeatableReadEntry.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -27,7 +27,7 @@
import org.horizon.logging.LogFactory;
/**
- * A node delegate that encapsulates repeatable read semantics when writes are initiated,
committed or rolled back.
+ * An extension of {@link org.horizon.container.ReadCommittedEntry} that provides
Repeatable Read semantics
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 1.0
@@ -43,7 +43,7 @@
public void copyForUpdate(DataContainer container, boolean writeSkewCheck) {
if (isFlagSet(CHANGED)) return; // already copied
- // mark node as changed.
+ // mark entry as changed.
setFlag(CHANGED);
if (writeSkewCheck) {
Modified: core/branches/flat/src/main/java/org/horizon/context/EntryLookup.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/context/EntryLookup.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/context/EntryLookup.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -36,7 +36,7 @@
/**
* Retrieves an entry from the collection of looked up entries in the current scope.
* <p/>
- * If a transaction is in progress, implementations should delegate to {@link
org.horizon.context.TransactionContext#lookupEntry(Object)}
+ * If a transaction is in progress, implementations should delegate to the same method
in {@link TransactionContext}.
* <p/>
*
* @param key key to look up
@@ -47,7 +47,7 @@
/**
* Retrieves a map of entries looked up within the current scope.
* <p/>
- * If a transaction is in progress, implementations should delegate to {@link
org.horizon.context.TransactionContext#getLookedUpEntries()}.
+ * If a transaction is in progress, implementations should delegate to the same method
in {@link TransactionContext}.
* <p/>
*
* @return a map of looked up entries.
@@ -55,10 +55,9 @@
Map<Object, MVCCEntry> getLookedUpEntries();
/**
- * Puts an entry in the registry of looked up nodes in the current scope.
+ * Puts an entry in the registry of looked up entries in the current scope.
* <p/>
- * If a transaction is in progress, implementations should delegate to {@link
TransactionContext#putLookedUpEntry(Object,
- * org.horizon.container.MVCCEntry)}
+ * If a transaction is in progress, implementations should delegate to the same method
in {@link TransactionContext}.
* <p/>
*
* @param key key to store
Modified:
core/branches/flat/src/main/java/org/horizon/eviction/DefaultEvictionAction.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/eviction/DefaultEvictionAction.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/eviction/DefaultEvictionAction.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -26,7 +26,7 @@
import org.horizon.logging.LogFactory;
/**
- * Default eviction action policy that calls {@link Cache#evict(Object)} to evict a
node.
+ * Default eviction action policy that calls {@link Cache#evict(Object)} to evict an
entry.
*
* @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
* @since 1.0
@@ -42,11 +42,11 @@
@SuppressWarnings("unchecked")
public boolean evict(Object key) {
- if (trace) log.trace("Attempting to evict cache node with key of {0}",
key);
+ if (trace) log.trace("Attempting to evict cached entry with key of {0}",
key);
try {
cache.evict(key);
- log.trace("Eviction of cache node with key of {0} successful", key);
+ log.trace("Eviction of cached entry with key of {0} successful",
key);
return true;
}
catch (Exception e) {
Modified: core/branches/flat/src/main/java/org/horizon/eviction/EvictionAction.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/eviction/EvictionAction.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/eviction/EvictionAction.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -38,7 +38,7 @@
void setCache(Cache<?, ?> cache);
/**
- * Performs an eviction on a given node.
+ * Performs an eviction on a given entry.
*
* @param key key of entry to evict
* @return true if the eviction was successful, false if not.
Modified:
core/branches/flat/src/main/java/org/horizon/eviction/algorithms/BaseEvictionAlgorithm.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/eviction/algorithms/BaseEvictionAlgorithm.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/eviction/algorithms/BaseEvictionAlgorithm.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -192,10 +192,10 @@
processClearCacheEvent();
break;
case MARK_IN_USE_EVENT:
- processMarkInUseNodes(event.getKey(), ((InUseEvictionEvent)
event).getInUseTimeout());
+ processMarkInUse(event.getKey(), ((InUseEvictionEvent)
event).getInUseTimeout());
break;
case UNMARK_IN_USE_EVENT:
- processUnmarkInUseNodes(event.getKey());
+ processUnmarkInUse(event.getKey());
break;
case EXPIRED_DATA_PURGE_START:
if (keysToRetainInQueue == null) keysToRetainInQueue = new
HashSet<Object>();
@@ -225,7 +225,7 @@
if (!result) {
log.warn("Unable to add key {0} to the recycle queue." +
"This is often sign that " +
- "evictions are not occurring and nodes that should be " +
+ "evictions are not occurring and entries that should be "
+
"evicted are piling up waiting to be evicted.", key);
}
}
@@ -235,13 +235,13 @@
}
}
- protected void processMarkInUseNodes(Object key, long inUseTimeout) throws
EvictionException {
+ protected void processMarkInUse(Object key, long inUseTimeout) throws
EvictionException {
log.trace("Marking {0} as in use with a usage timeout of {1}", key,
inUseTimeout);
keysInUse.put(key, inUseTimeout + System.currentTimeMillis());
}
- protected void processUnmarkInUseNodes(Object key) throws EvictionException {
- log.trace("Unmarking node {0} as in use", key);
+ protected void processUnmarkInUse(Object key) throws EvictionException {
+ log.trace("Unmarking {0} as in use", key);
keysInUse.remove(key);
}
@@ -273,7 +273,7 @@
/**
* Empty the Recycle Queue.
* <p/>
- * This method will go through the recycle queue and retry to evict the nodes from
cache.
+ * This method will go through the recycle queue and retry to evict the entries from
cache.
*
* @throws EvictionException
*/
Modified: core/branches/flat/src/main/java/org/horizon/eviction/events/EvictionEvent.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/eviction/events/EvictionEvent.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/eviction/events/EvictionEvent.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -22,7 +22,7 @@
package org.horizon.eviction.events;
/**
- * An eviction event records activity on nodes in the cache. These are recorded for
processing later.
+ * An eviction event records activity on entries in the cache. These are recorded for
processing later.
*
* @author (various)
* @since 1.0
@@ -65,19 +65,9 @@
@Override
public String toString() {
- return "EvictedEventNode[key=" + key + " event=" + type +
"]";
+ return "EvictionEvent[key=" + key + " event=" + type +
"]";
}
- /**
- * Copies this evicted event node to create a new one with the same values, except
with a new Fqn root.
- *
- * @param key new Fqn root to use
- * @return a new EvictedEventNode instance
- */
- public EvictionEvent copy(Object key) {
- return new EvictionEvent(key, type);
- }
-
@Override
public boolean equals(Object o) {
if (this == o) return true;
Modified:
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentFactory.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentFactory.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentFactory.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -30,7 +30,7 @@
import org.horizon.logging.LogFactory;
/**
- * Factory that creates components used internally within JBoss Cache, and also wires
dependencies into the components.
+ * Factory that creates components used internally within Horizon, and also wires
dependencies into the components.
* <p/>
* The {@link DefaultCacheFactory} is a special subclass of this, which bootstraps the
construction of other components.
* When this class is loaded, it maintains a static list of known default factories for
known components, which it then
Modified:
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/factories/AbstractComponentRegistry.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -110,7 +110,7 @@
* Wires an object instance with dependencies annotated with the {@link Inject}
annotation, creating more components
* as needed based on the Configuration passed in if these additional components
don't exist in the {@link
* ComponentRegistry}. Strictly for components that don't otherwise live in the
registry and have a lifecycle, such
- * as Nodes.
+ * as Commands.
*
* @param target object to wire
* @throws ConfigurationException if there is a problem wiring the instance
Modified: core/branches/flat/src/main/java/org/horizon/factories/EntryFactory.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/factories/EntryFactory.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/factories/EntryFactory.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -35,7 +35,7 @@
void releaseLock(InvocationContext ctx, Object key);
/**
- * Attempts to lock a node if the lock isn't already held in the current scope,
and records the lock in the context.
+ * Attempts to lock an entry if the lock isn't already held in the current scope,
and records the lock in the context.
*
* @param ctx context
* @param key Key to lock
Modified: core/branches/flat/src/main/java/org/horizon/factories/EntryFactoryImpl.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/factories/EntryFactoryImpl.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/factories/EntryFactoryImpl.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -85,7 +85,7 @@
return wrapEntryForWriting(ctx, key, false, false);
} else if ((mvccEntry = ctx.lookupEntry(key)) == null) {
if (trace) log.trace("Key " + key + " is not in context, fetching
from container.");
- // simple implementation. Peek the node, wrap it, put wrapped node in the
context.
+ // simple implementation. Peek the entry, wrap it, put wrapped entry in the
context.
StoredEntry se = container.createEntryForStorage(key);
mvccEntry = se == null ?
createWrappedEntry(key, null, false, -1) :
@@ -105,12 +105,12 @@
{
// acquire lock if needed
if (acquireLock(ctx, key)) {
- // create a copy of the underlying node
+ // create a copy of the underlying entry
mvccEntry.copyForUpdate(container, writeSkewCheck);
}
if (trace) log.trace("Exists in context.");
if (mvccEntry.isDeleted() && createIfAbsent) {
- if (trace) log.trace("Node is deleted in current scope. Need to
un-delete.");
+ if (trace) log.trace("Entry is deleted in current scope. Need to
un-delete.");
mvccEntry.setDeleted(false);
mvccEntry.setValid(true);
}
@@ -129,7 +129,7 @@
} else if (createIfAbsent) {
// this is the *only* point where new entries can be created!!
if (trace) log.trace("Creating new entry.");
- // now to lock and create the node. Lock first to prevent concurrent
creation!
+ // now to lock and create the entry. Lock first to prevent concurrent
creation!
acquireLock(ctx, key);
notifier.notifyCacheEntryCreated(key, true, ctx);
mvccEntry = createWrappedEntry(key, null, true, -1);
@@ -147,7 +147,7 @@
}
/**
- * Attempts to lock a node if the lock isn't already held in the current scope,
and records the lock in the context.
+ * Attempts to lock an entry if the lock isn't already held in the current scope,
and records the lock in the context.
*
* @param ctx context
* @param key Key to lock
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/CacheLoaderInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/CacheLoaderInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/CacheLoaderInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -119,7 +119,7 @@
}
/**
- * Loads a node from loader
+ * Loads an entry from loader
*/
private MVCCEntry loadEntry(InvocationContext ctx, Object key, MVCCEntry entry) throws
Exception {
log.trace("Loading key {0}", key);
@@ -153,12 +153,12 @@
notifier.notifyCacheEntryLoaded(key, pre, ctx);
}
- @ManagedAttribute(description = "number of cache loader node loads")
+ @ManagedAttribute(description = "number of cache loader loads")
public long getCacheLoaderLoads() {
return cacheLoads.get();
}
- @ManagedAttribute(description = "number of cache loader node misses")
+ @ManagedAttribute(description = "number of cache loader misses")
public long getCacheLoaderMisses() {
return cacheMisses.get();
}
Modified: core/branches/flat/src/main/java/org/horizon/interceptors/CallInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/CallInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/CallInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -40,9 +40,6 @@
* Always at the end of the chain, directly in front of the cache. Simply calls into the
cache using reflection. If the
* call resulted in a modification, add the Modification to the end of the modification
list keyed by the current
* transaction.
- * <p/>
- * Although always added to the end of an optimistically locked chain as well, calls
should not make it down to this
- * interceptor unless it is a call the OptimisticNodeInterceptor knows nothing about.
*
* @author Bela Ban
* @since 1.0
@@ -102,12 +99,6 @@
return handleAlterCacheMethod(ctx, command);
}
-
- /**
- * only add the modification to the modification list if we are using pessimistic
locking. Optimistic locking calls
- * *should* not make it this far down the interceptor chain, but just in case a method
has been invoked that the
- * OptimisticNodeInterceptor knows nothing about, it will filter down here.
- */
private Object handleAlterCacheMethod(InvocationContext ctx, VisitableCommand
command)
throws Throwable {
Object result = invokeCommand(ctx, command);
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/InvocationContextInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/InvocationContextInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/InvocationContextInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -167,7 +167,7 @@
// TODO: Calling ctx.reset() here breaks stuff. Check whether this is just
becuse UTs expect stuff in the ctx or whether this really breaks functionality.
// ctx.reset();
- // instead, for now, just wipe contents of the looked up node map
+ // instead, for now, just wipe contents of the looked up entries
ctx.clearLookedUpEntries();
}
}
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/PassivationInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/PassivationInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/PassivationInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -18,7 +18,7 @@
import java.util.concurrent.atomic.AtomicLong;
/**
- * Writes evicted nodes back to the store on the way in through the CacheStore
+ * Writes evicted entries back to the store on the way in through the CacheStore
*
* @since 1.0
*/
@@ -46,7 +46,7 @@
@Override
public Object visitEvictCommand(InvocationContext ctx, EvictCommand command) throws
Throwable {
- // notify listeners that this node is about to be passivated
+ // notify listeners that this entry is about to be passivated
Object key = command.getKey();
notifier.notifyCacheEntryPassivated(key, true, ctx);
log.trace("Passivating entry {0}", key);
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/ReplicationInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/ReplicationInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/ReplicationInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -37,7 +37,7 @@
import org.horizon.transaction.GlobalTransaction;
/**
- * Takes care of replicating modifications to other nodes in a cluster. Also listens for
prepare(), commit() and
+ * Takes care of replicating modifications to other caches in a cluster. Also listens for
prepare(), commit() and
* rollback() messages which are received 'side-ways' (see
docs/design/Refactoring.txt).
*
* @author Bela Ban
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/base/BaseRpcInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/base/BaseRpcInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/base/BaseRpcInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -77,7 +77,7 @@
if (rsp != null && rsp instanceof Throwable) {
// lets print a stack trace first.
if (log.isDebugEnabled())
- log.debug("Received Throwable from remote node", (Throwable)
rsp);
+ log.debug("Received Throwable from remote cache", (Throwable)
rsp);
throw (Throwable) rsp;
}
}
@@ -161,7 +161,7 @@
}
/**
- * The call runs in a transaction and it was initiated on this node of the cluster.
+ * The call runs in a transaction and it was initiated on this cache instance of the
cluster.
*/
protected final boolean isTransactionalAndLocal(InvocationContext ctx) {
GlobalTransaction gtx = ctx.getGlobalTransaction();
Modified:
core/branches/flat/src/main/java/org/horizon/interceptors/base/CommandInterceptor.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/interceptors/base/CommandInterceptor.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/interceptors/base/CommandInterceptor.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -103,8 +103,7 @@
/**
* Invokes the next interceptor in the chain. This is how interceptor implementations
should pass a call up the
- * chain to the next interceptor. In previous (pre-2.2.0) implementations of JBoss
Cache, this was done by calling
- * <pre>super.invoke()</pre>.
+ * chain to the next interceptor.
*
* @param ctx invocation context
* @param command command to pass up the chain.
Modified: core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/jmx/JmxRegistrationManager.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -41,10 +41,10 @@
* <b>ManagedOperation</b> or/and <b>MBean</b>. If no
<b>MBean</b> server is provided, then the {@link
* java.lang.management.ManagementFactory#getPlatformMBeanServer()} is being used.
<p/> It is immutable: both cache
* instance and MBeanServer are being passed as arguments to the constructor. <p />
<p> Note that by default object
- * names used are prefixed with <tt>jboss.cache:service=JBossCache</tt>.
While this format works for and is consistent
+ * names used are prefixed with <tt>jboss.cache:service=Horizon</tt>. While
this format works for and is consistent
* with JBoss AS and the JMX console, it has been known to cause problems with other JMX
servers such as Websphere. To
* work around this, you can provide the following VM system property to override this
prefix with a prefix of your
- * choice: <tt><b>-Djbosscache.jmx.prefix=JBossCache</b></tt>
</p>
+ * choice: <tt><b>-Dhorizon.jmx.prefix=Horizon</b></tt>
</p>
*
* @author Mircea.Markus(a)jboss.com
* @since 1.0
Modified:
core/branches/flat/src/main/java/org/horizon/jmx/PlatformMBeanServerRegistration.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/jmx/PlatformMBeanServerRegistration.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/jmx/PlatformMBeanServerRegistration.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -63,7 +63,7 @@
if (config.isExposeManagementStatistics()) {
JmxRegistrationManager jmxRegistrationManager = new
JmxRegistrationManager(cache);
jmxRegistrationManager.registerAllMBeans();
- log.info("JBossCache MBeans were successfully registered to the platform
mbean server.");
+ log.info("MBeans were successfully registered to the platform mbean
server.");
}
}
@@ -79,7 +79,7 @@
if (config.isExposeManagementStatistics()) {
JmxRegistrationManager jmxRegistrationManager = new
JmxRegistrationManager(cache);
jmxRegistrationManager.unregisterAllMBeans();
- log.trace("JBossCache MBeans were successfully unregistered from the
platform mbean server.");
+ log.trace("MBeans were successfully unregistered from the platform mbean
server.");
}
cache = null;
}
Modified:
core/branches/flat/src/main/java/org/horizon/loader/decorators/SingletonStore.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/loader/decorators/SingletonStore.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/loader/decorators/SingletonStore.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -80,7 +80,7 @@
private Address localAddress;
/**
- * Whether the the current node is the coordinator and therefore SingletonStore is
active. Being active means
+ * Whether the the current cache is the coordinator and therefore SingletonStore is
active. Being active means
* delegating calls to the underlying cache loader.
*/
private volatile boolean active;
@@ -173,11 +173,10 @@
}
/**
- * Pushes the state of a specific node by reading the node's data from the cache
and putting in the cache store via
- * the cache loader. This method is call recursively so that it iterates through the
whole cache.
+ * Pushes the state of a specific cache by reading the cache's data and putting in
the cache store. This method is
+ * called recursively so that it iterates through the whole cache.
*
- * @throws Exception if there's any issues reading the data from the cache or
pushing the node's data to the cache
- * loader.
+ * @throws Exception if there's any issues reading the data from the cache or
pushing data to the cache store.
*/
protected void pushState(final Cache cache) throws Exception {
DataContainer dc = cache.getAdvancedCache().getDataContainer();
@@ -216,10 +215,10 @@
/**
- * Method called when the node either becomes the coordinator or stops being the
coordinator. If it becomes the
+ * Method called when the cache either becomes the coordinator or stops being the
coordinator. If it becomes the
* coordinator, it can optionally start the in-memory state transfer to the underlying
cache store.
*
- * @param newActiveState true if the node just became the coordinator, false if the
nodes stopped being the
+ * @param newActiveState true if the cache just became the coordinator, false if the
cache stopped being the
* coordinator.
*/
protected void activeStatusChanged(boolean newActiveState) throws PushStateException
{
@@ -229,11 +228,11 @@
}
/**
- * Indicates whether the current nodes is the coordinator of the cluster. This
implementation assumes that the
+ * Indicates whether the current cache is the coordinator of the cluster. This
implementation assumes that the
* coordinator is the first member in the list.
*
* @param newView View instance containing the new view of the cluster
- * @return whether the current node is the coordinator or not.
+ * @return whether the current cache is the coordinator or not.
*/
private boolean isCoordinator(List<Address> newView, Address currentAddress) {
if (!currentAddress.equals(localAddress)) localAddress = currentAddress;
@@ -246,7 +245,7 @@
}
/**
- * Called when the SingletonStore discovers that the node has become the coordinator
and push in memory state has
+ * Called when the SingletonStore discovers that the cache has become the coordinator
and push in memory state has
* been enabled. It might not actually push the state if there's an ongoing push
task running, in which case will
* wait for the push task to finish.
*
@@ -299,13 +298,13 @@
/**
* Cache listener that reacts to cluster topology changes to find out whether a new
coordinator is elected.
- * SingletonStore reacts to these changes in order to decide which node should
interact with the underlying cache
+ * SingletonStore reacts to these changes in order to decide which cache should
interact with the underlying cache
* store.
*/
@Listener
public class SingletonStoreListener {
/**
- * Cache started, check whether the node is the coordinator and set the singleton
store's active status.
+ * Cache started, check whether the cache is the coordinator and set the singleton
store's active status.
*/
@CacheStarted
public void cacheStarted(Event e) {
@@ -314,8 +313,8 @@
}
/**
- * The cluster formation changed, so determine whether the current node stopped
being the coordinator or became
- * the coordinator. This method can lead to an optional in memory to cache loader
state push, if the current node
+ * The cluster formation changed, so determine whether the current cache stopped
being the coordinator or became
+ * the coordinator. This method can lead to an optional in memory to cache loader
state push, if the current cache
* became the coordinator. This method will report any issues that could
potentially arise from this push.
*/
@ViewChanged
@@ -327,7 +326,7 @@
activeStatusChanged(tmp);
}
catch (PushStateException e) {
- log.error("exception reported changing nodes active status",
e);
+ log.error("exception reported changing cache active status",
e);
}
}
Modified: core/branches/flat/src/main/java/org/horizon/lock/IsolationLevel.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/lock/IsolationLevel.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/lock/IsolationLevel.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -23,10 +23,10 @@
/**
* Various transaction isolation levels as an enumerated class. Note that <a
href="http://wiki.jboss.org/wiki/JBossCacheMVCC">MVCC</a>
- * in JBoss Cache 3.0.0 and above only supports {@link #READ_COMMITTED} and {@link
#REPEATABLE_READ}, upgrading where
+ * only supports {@link #READ_COMMITTED} and {@link #REPEATABLE_READ}, upgrading where
* possible.
* <p/>
- * Also note that JBoss Cache defaults to {@link #REPEATABLE_READ}.
+ * Also note that Horizon defaults to {@link #READ_COMMITTED}.
* <p/>
*
* @author (various)
Modified: core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/manager/DefaultCacheManager.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -87,7 +87,7 @@
@Scope(Scopes.GLOBAL)
@NonVolatile
public class DefaultCacheManager implements CacheManager {
- public static final String DEFAULT_CACHE_NAME =
"org.jboss.starobrno.manager.DefaultCacheManager.DEFAULT_CACHE_NAME";
+ public static final String DEFAULT_CACHE_NAME =
"org.horizon.manager.DefaultCacheManager.DEFAULT_CACHE_NAME";
protected GlobalConfiguration globalConfiguration;
private final ConcurrentMap<String, Cache> caches = new
ConcurrentHashMap<String, Cache>();
private final ConcurrentMap<String, Configuration> configurationOverrides = new
ConcurrentHashMap<String, Configuration>();
Modified: core/branches/flat/src/main/java/org/horizon/marshall/HorizonMarshaller.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/marshall/HorizonMarshaller.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/marshall/HorizonMarshaller.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -47,7 +47,7 @@
import java.util.*;
/**
- * Abstract AbstractMarshaller for JBoss Cache.
+ * Abstract marshaller
*
* @author <a href="mailto:manik@jboss.org">Manik Surtani
(manik(a)jboss.org)</a>
* @since 1.0
Modified: core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/marshall/Marshaller.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -33,7 +33,7 @@
/**
* A marshaller is a class that is able to marshall and unmarshall objects efficiently.
* <p/>
- * The reason why this is implemented specially in JBoss Cache rather than resorting to
Java serialization or even the
+ * The reason why this is implemented specially in Horizon rather than resorting to Java
serialization or even the
* more efficient JBoss serialization is that a lot of efficiency can be gained when a
majority of the serialization
* that occurs has to do with a small set of known types such as {@link
org.horizon.transaction.GlobalTransaction} or
* {@link org.horizon.commands.ReplicableCommand}, and class type information can be
replaced with simple magic
@@ -43,7 +43,7 @@
* <p/>
* In addition, using a marshaller allows adding additional data to the byte stream, such
as context class loader
* information on which class loader to use to deserialize the object stream, or
versioning information to allow streams
- * to interoperate between different versions of JBoss Cache (see {@link
VersionAwareMarshaller}
+ * to interoperate between different versions of Horizon (see {@link
VersionAwareMarshaller}
* <p/>
* This interface is used to marshall {@link org.horizon.commands.ReplicableCommand}s,
their parameters and their
* response values.
Modified: core/branches/flat/src/main/java/org/horizon/remoting/ReplicationQueue.java
===================================================================
--- core/branches/flat/src/main/java/org/horizon/remoting/ReplicationQueue.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/java/org/horizon/remoting/ReplicationQueue.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -141,7 +141,7 @@
try {
log.trace("Flushing {0} elements", toReplicateSize);
ReplicateCommand replicateCommand =
commandsFactory.buildReplicateCommand(toReplicate);
- // send to all live nodes in the cluster
+ // send to all live caches in the cluster
rpcManager.invokeRemotely(null, replicateCommand, ResponseMode.ASYNCHRONOUS,
configuration.getSyncReplTimeout());
}
catch (Throwable t) {
Modified:
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/statetransfer/DefaultStateTransferManager.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -21,173 +21,32 @@
*/
package org.horizon.statetransfer;
-import org.horizon.config.Configuration;
import org.horizon.factories.annotations.Inject;
import org.horizon.factories.annotations.Start;
-import org.horizon.loader.CacheLoaderManager;
-import org.horizon.logging.Log;
-import org.horizon.logging.LogFactory;
-import org.horizon.marshall.Marshaller;
-import org.horizon.tree.Fqn;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-/**
- * The default state transfer manager to be used when using MVCC locking. // TODO:
implement me
- *
- * @author (various)
- * @since 1.0
- */
public class DefaultStateTransferManager implements StateTransferManager {
- protected final static Log log =
LogFactory.getLog(DefaultStateTransferManager.class);
- protected static final boolean trace = log.isTraceEnabled();
- public static final Object STREAMING_DELIMITER_NODE = new Object();
-
- public static final String PARTIAL_STATE_DELIMITER =
"_PARTIAL_STATE_DELIMITER";
-
- // protected CacheSPI cache;
- protected Marshaller marshaller;
- // protected RegionManager regionManager;
- protected Configuration configuration;
- private CacheLoaderManager cacheLoaderManager;
- boolean fetchTransientState;
- boolean fetchPersistentState;
- protected long stateRetrievalTimeout;
-// protected StateTransferIntegrator integrator;
-// protected StateTransferGenerator generator;
-
-
@Inject
public void injectDependencies() {
-// this.cache = cache;
-// this.regionManager = regionManager;
- this.marshaller = marshaller;
- this.configuration = configuration;
- this.cacheLoaderManager = cacheLoaderManager;
-// this.integrator = integrator;
-// this.generator = generator;
}
@Start(priority = 14)
public void start() {
-// fetchTransientState = configuration.isFetchInMemoryState();
-// fetchPersistentState = cacheLoaderManager != null &&
cacheLoaderManager.isFetchPersistentState();
-// stateRetrievalTimeout = configuration.getStateRetrievalTimeout();
}
- public void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force,
boolean suppressErrors) throws Exception {
+ public void getState(ObjectOutputStream out, Object o, long timeout, boolean force,
boolean suppressErrors) throws Exception {
throw new UnsupportedOperationException("Implement me properly!");
- /*
-
- // can't give state for regions currently being activated/inactivated
- boolean canProvideState = (!evictionCacheManager.isInactive(fqn) &&
cache.peek(fqn, false) != null);
- if (trace) log.trace("Can provide state? " + canProvideState);
- if (canProvideState && (fetchPersistentState || fetchTransientState))
- {
- marshaller.objectToObjectStream(true, out);
- long startTime = System.currentTimeMillis();
- InternalNode subtreeRoot = fqn.isRoot() ? cache.getRoot().getDelegationTarget()
: cache.getNode(fqn).getDelegationTarget();
-
- // we don't need READ locks for MVCC based state transfer!
- if (log.isDebugEnabled())
- log.debug("Generating in-memory (transient) state for subtree " +
fqn);
-
- generator.generateState(out, subtreeRoot, fetchTransientState,
fetchPersistentState, suppressErrors);
-
- if (log.isDebugEnabled())
- log.debug("Successfully generated state in " +
(System.currentTimeMillis() - startTime) + " msec");
- }
- else
- {
- marshaller.objectToObjectStream(false, out);
- Exception e = null;
- if (!canProvideState)
- {
- String exceptionMessage = "Cache instance at " +
cache.getLocalAddress() + " cannot provide state for fqn " + fqn +
".";
-
- if (evictionCacheManager.isInactive(fqn))
- {
- exceptionMessage += " Region for fqn " + fqn + " is
inactive.";
- e = new InactiveRegionException(exceptionMessage);
- }
- // this is not really an exception. Just provide empty state. The exception
is just a signal. Yes, lousy. - JBCACHE-1349
- if (cache.peek(fqn, false, false) == null)
- {
- e = new RegionEmptyException();
- }
- }
- if (!fetchPersistentState && !fetchTransientState)
- {
- e = new CacheException("Cache instance at " +
cache.getLocalAddress() + " is not configured to provide state");
- }
- marshaller.objectToObjectStream(e, out);
- if (e != null) throw e;
- }
- */
}
- public void setState(ObjectInputStream in, Fqn targetRoot) throws Exception {
+ public void setState(ObjectInputStream in, Object o) throws Exception {
throw new UnsupportedOperationException("fix me!");
- /*
- cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
- NodeSPI target = cache.getNode(targetRoot);
- if (target == null)
- {
- // Create the integration root, but do not replicate
- cache.getInvocationContext().getOptionOverrides().setCacheModeLocal(true);
-
- //needed for BR state transfers
-
cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
- cache.put(targetRoot, null);
-
cache.getInvocationContext().getOptionOverrides().setSkipCacheStatusCheck(true);
- target = cache.getNode(targetRoot);
- }
- Object o = marshaller.objectFromObjectStream(in);
- Boolean hasState = (Boolean) o;
- if (hasState)
- {
- setState(in, target);
- }
- else
- {
- throw new CacheException("Cache instance at " +
cache.getLocalAddress()
- + " cannot integrate state since state provider could not provide
state due to " + marshaller.objectFromObjectStream(in));
- }
- */
}
- /**
- * Set the portion of the cache rooted in <code>targetRoot</code> to match
the given state. Updates the contents of
- * <code>targetRoot</code> to reflect those in
<code>new_state</code>.
- * <p/>
- * <strong>NOTE:</strong> This method performs no locking of nodes; it is
up to the caller to lock
- * <code>targetRoot</code> before calling this method.
- *
- * @param state a serialized byte[][] array where element 0 is the transient
state (or null) , and element 1 is
- * the persistent state (or null)
- * @param targetRoot node into which the state should be integrated
- */
// TODO: implement me
protected void setState()
-// protected void setState(ObjectInputStream state, NodeSPI targetRoot) throws
Exception
{
- long startTime = System.currentTimeMillis();
- /*
- * Vladimir/Manik/Brian (Dec 7,2006)
- *
- * integrator.integrateState(in,targetRoot, cl) will call cache.put for each
- * node read from stream. Having option override below allows nodes read
- * to be directly stored into a tree since we bypass interceptor chain.
- *
- */
- // TODO: implement me
-// if (log.isDebugEnabled())
-// log.debug("starting state integration at node " + targetRoot +
". Fetch Persistent State = " + fetchPersistentState);
-// integrator.integrateState(state, targetRoot.getDelegationTarget(),
targetRoot.getFqn(), fetchPersistentState);
-
- if (log.isDebugEnabled())
- log.debug("successfully integrated state in " +
(System.currentTimeMillis() - startTime) + " msec");
}
}
Modified:
core/branches/flat/src/main/java/org/horizon/statetransfer/StateTransferManager.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/statetransfer/StateTransferManager.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/statetransfer/StateTransferManager.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -21,52 +21,12 @@
*/
package org.horizon.statetransfer;
-import org.horizon.tree.Fqn;
-
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-/**
- * This interface handles requests to generate or integrate state from neighbouring
caches in a cluster.
- * <p/>
- * This has existed prior to 3.0.0 as a concrete class. An interface was introduced in
3.0.0 to provide more
- * flexibility in state transfer implementations.
- * <p/>
- *
- * @author Manik Surtani (<a
href="mailto:manik@jboss.org">manik@jboss.org</a>)
- * @since 1.0
- */
public interface StateTransferManager {
- /**
- * Writes the state for the portion of the tree named by <code>fqn</code>
to the provided OutputStream.
- * <p/>
- * <p/>
- *
- * @param out stream to write state to
- * @param fqn Fqn indicating the uppermost node in the portion of the tree
whose state should be
- * returned.
- * @param timeout max number of millis this method should wait to acquire any
locks, if necessary, on the
- * nodes being transferred
- * @param force if locks are needed and cannot be acquired after
<code>timeout</code> millis, should the
- * lock acquisition be forced, and any existing transactions
holding locks on the nodes be
- * rolled back?
- * @param suppressErrors if true, all exceptions are logged but not propagated.
- * @throws Exception in event of error
- */
- void getState(ObjectOutputStream out, Fqn fqn, long timeout, boolean force, boolean
suppressErrors) throws Exception;
- /**
- * Set the portion of the cache rooted in <code>targetRoot</code> to match
the given state. Updates the contents of
- * <code>targetRoot</code> to reflect those in
<code>new_state</code>.
- * <p/>
- * <strong>NOTE:</strong> This method performs no locking of nodes; it is
up to the caller to lock
- * <code>targetRoot</code> before calling this method.
- * <p/>
- *
- * @param in an input stream containing the state
- * @param targetRoot fqn of the node into which the state should be integrated
- * @throws Exception In event of error
- */
- void setState(ObjectInputStream in, Fqn targetRoot) throws Exception;
+ void getState(ObjectOutputStream out, Object o, long timeout, boolean force, boolean
suppressErrors) throws Exception;
+ void setState(ObjectInputStream in, Object o) throws Exception;
}
Modified:
core/branches/flat/src/main/java/org/horizon/transaction/GenericTransactionManagerLookup.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/transaction/GenericTransactionManagerLookup.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/transaction/GenericTransactionManagerLookup.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -96,9 +96,9 @@
if (tm != null)
return tm;
if (lookupFailed) {
- //fall back to a dummy from JBossCache
+ //fall back to a dummy from Horizon
tm = DummyTransactionManager.getInstance();
- log.warn("Falling back to DummyTransactionManager from JBossCache");
+ log.warn("Falling back to DummyTransactionManager from Horizon");
}
return tm;
}
Modified:
core/branches/flat/src/main/java/org/horizon/util/concurrent/locks/OwnableReentrantLock.java
===================================================================
---
core/branches/flat/src/main/java/org/horizon/util/concurrent/locks/OwnableReentrantLock.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/main/java/org/horizon/util/concurrent/locks/OwnableReentrantLock.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -34,7 +34,7 @@
* constructed with a reference to the {@link InvocationContextContainer}, so it is able
to determine whether the
* caller's "owner" reference is the current thread or a {@link
GlobalTransaction} instance.
* <p/>
- * This makes this lock implementation very closely tied to JBoss Cache internals, but it
provides for a very clean,
+ * This makes this lock implementation very closely tied to Horizon internals, but it
provides for a very clean,
* efficient and moreover familiar interface to work with, since it implements {@link
java.util.concurrent.locks.Lock}.
* <p/>
* For the sake of performance, this lock only supports nonfair queueing.
Modified: core/branches/flat/src/main/release/JBossORG-EULA.txt
===================================================================
--- core/branches/flat/src/main/release/JBossORG-EULA.txt 2009-02-25 11:22:30 UTC (rev
7781)
+++ core/branches/flat/src/main/release/JBossORG-EULA.txt 2009-02-25 12:02:25 UTC (rev
7782)
@@ -11,7 +11,7 @@
(b) JBoss Rules, which is licensed pursuant to the Apache License v.2.0;
-(c) an optional download for JBoss Cache for the Berkeley DB for Java database, which is
licensed under the
+(c) an optional download for Horizon for the Berkeley DB for Java database, which is
licensed under the
(open source) Sleepycat License (if Client does not wish to use the open source version
of this database,
it may purchase a license from Sleepycat Software);
Modified: core/branches/flat/src/main/release/README-Demo.txt
===================================================================
--- core/branches/flat/src/main/release/README-Demo.txt 2009-02-25 11:22:30 UTC (rev
7781)
+++ core/branches/flat/src/main/release/README-Demo.txt 2009-02-25 12:02:25 UTC (rev
7782)
@@ -1,7 +1,7 @@
-JBoss Cache GUI Demo
---------------------
+Horizon GUI Demo
+-----------------
-JBoss Cache comes with a GUI demo, to visually demonstrate state being moved around a
cluster.
+Horizon comes with a GUI demo, to visually demonstrate state being moved around a
cluster.
The demo is available for download on
Modified: core/branches/flat/src/main/release/README-libs.txt
===================================================================
--- core/branches/flat/src/main/release/README-libs.txt 2009-02-25 11:22:30 UTC (rev
7781)
+++ core/branches/flat/src/main/release/README-libs.txt 2009-02-25 12:02:25 UTC (rev
7782)
@@ -3,16 +3,14 @@
1) REQUIRED JARs
----------------
-The following JARs are REQUIRED for the proper operation of JBoss Cache, in addition to
the jbosscache-core.jar file:
+The following JARs are REQUIRED for the proper operation of Horizon, in addition to the
horizon.jar file:
-* commons-logging.jar - Used for logging.
-
* jcip-annotations.jar - (
http://jcip.net) - Annotations used to assert concurrency
behaviour of internal classes.
-* jgroups.jar (
http://jgroups.com) - Group communications library that is the backbone of
JBoss Cache's replication.
+* jgroups.jar (
http://jgroups.com) - Group communications library that is the backbone of
Horizon's replication.
Necessary even when the cache is run in LOCAL mode.
-* jboss-common-core.jar - JBoss utilities used by JBoss Cache. Version 2.0.5.GA or above
needed if run with JDK 6.
+* jboss-common-core.jar - JBoss utilities used by Horizon. Version 2.0.5.GA or above
needed if run with JDK 6.
* jboss-logging-spi.jar - Required by jboss-common-core.
Modified: core/branches/flat/src/main/release/README.txt
===================================================================
--- core/branches/flat/src/main/release/README.txt 2009-02-25 11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/main/release/README.txt 2009-02-25 12:02:25 UTC (rev 7782)
@@ -1,31 +1,17 @@
-JBossCache -- a replicated, transactional, and fine-grained cache system
-========================================================================
+Horizon -- a replicated, transactional data grid
+================================================
Note:
- We offer different packaging for download:
- + jbosscache-core-2.1.x-bin, just the core jar file and dependencies.
- + jbosscache-core-2.1.x-all, everything including docs, sources and tests.
- + jbosscache-core-2.1.x-doc, just the documentation.
+ + horizon-x.y.z-bin, just the core jar file and dependencies.
+ + horizon-x.y.z-all, everything including docs and tests.
+ + horizon-x.y.z-doc, just the documentation.
+ + horizon-x.y.z-src, a snapshot of the source tree.
- - If you are looking for JBoss Cache POJO edition, this is a separate distribution:
- + jbosscache-pojo-2.1.x-bin, just the core jar file and dependencies. Note that this
will include jbosscache-core.jar as a dependency.
- + jbosscache-pojo-2.1.x-all, everything including docs, sources and tests.
- + jbosscache-pojo-2.1.x-doc, just the documentation.
-
-
Requirements:
- JDK 5.0 and up
-Running the tutorial:
- - The bin and all distros come with a build.xml file in the directory root, which
contains targets for running
- tests as well as the demo outlined in the tutorial. You need an installation of
Jakarta Ant 1.6.0 or higher
- to run the script.
-
-- Just run 'ant' in the root directry for instructions.
-
-
Problems:
- - Please report problems to the JBoss cache forum
+ - Please report problems on the Horizon forum
(
http://www.jboss.org/forum.jsp?forum=157)
or the JBoss dev mailing list
-
Modified: core/branches/flat/src/main/release/licenses/README-bdbje-lib.txt
===================================================================
--- core/branches/flat/src/main/release/licenses/README-bdbje-lib.txt 2009-02-25 11:22:30
UTC (rev 7781)
+++ core/branches/flat/src/main/release/licenses/README-bdbje-lib.txt 2009-02-25 12:02:25
UTC (rev 7782)
@@ -2,18 +2,17 @@
$Id$
NAME: Sleepycat Berkeley DB Java Edition
-VERSION: 1.7.0
PROJECT:
http://www.oracle.com/database/berkeley-db/je/index.html
-PURPOSE: Used for Berkeley DB-based CacheLoader
(org.jboss.cache.loader.bdbje.BdbjeCacheLoader) in JBossCache
-RESTRICTION: JBossCache can use Berkeley DB Java Edition from Oracle
+PURPOSE: Used for Berkeley DB-based CacheLoader
(org.horizon.loader.bdbje.BdbjeCacheStore) in Horizon
+RESTRICTION: Horizon can use Berkeley DB Java Edition from Oracle
for persistent, reliable and transaction-protected
data storage. If you choose to use Berkeley DB Java Edition
- with JBossCache, you must comply with the terms of
- Oracle's public license, included in the file LICENSE.txt.
+ with Horizon, you must comply with the terms of
+ Oracle's public license, included in the file LICENSE-bdbje-lib.txt.
If you prefer not to release the source code for your own
application in order to comply with the Oracle public
license, you may purchase a different license for use of
- Berkeley DB Java Edition with JBossCache. For details,
+ Berkeley DB Java Edition with Horizon. For details,
please go to:
http://www.oracle.com/database/berkeley-db/je/index.html
Modified: core/branches/flat/src/test/java/org/horizon/api/tree/TreeCacheAPITest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/api/tree/TreeCacheAPITest.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/test/java/org/horizon/api/tree/TreeCacheAPITest.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -49,13 +49,6 @@
cache = null;
}
- /**
- * All cache operations should happen on a {@link Node} - I.e., you look up a {@link
Node} and perform data
- * operations on this {@link Node}. For convenience and familiarity with JBoss Cache
1.x, we provide some helpers in
- * {@link Cache} which dives you direct data access to nodes.
- * <p/>
- * This test exercises these.
- */
public void testConvenienceMethods() {
Fqn fqn = Fqn.fromString("/test/fqn");
String key = "key", value = "value";
Modified:
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/lru/LruQueueTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/lru/LruQueueTest.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/lru/LruQueueTest.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -58,14 +58,14 @@
int count = 0;
for (Iterator<Object> it = queue.iterator(); it.hasNext();) {
- int nodeIndex = (Integer) it.next();
+ int entryIndex = (Integer) it.next();
if (count < 50) {
// the top 50 should be all odds in the lruQueue/
- assert nodeIndex % 2 != 0;
+ assert entryIndex % 2 != 0;
} else {
// the bottom fifty should all be even #'s (and 0)
- assert nodeIndex % 2 == 0;
+ assert entryIndex % 2 == 0;
}
it.remove();
count++;
Modified:
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/mru/MruQueueTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/mru/MruQueueTest.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/test/java/org/horizon/eviction/algorithms/mru/MruQueueTest.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -57,14 +57,14 @@
int count = 0;
for (Iterator<Object> it = queue.iterator(); it.hasNext();) {
- int nodeIndex = (Integer) it.next();
+ int entryIndex = (Integer) it.next();
if (count < 50) {
// the top 50 should be all evens in the mruQueue
- assert nodeIndex % 2 == 0;
+ assert entryIndex % 2 == 0;
} else {
// the bottom fifty should all be odd #'s (and 0)
- assert nodeIndex % 2 != 0;
+ assert entryIndex % 2 != 0;
}
it.remove();
count++;
Modified: core/branches/flat/src/test/java/org/horizon/marshall/MarshalledValueTest.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/marshall/MarshalledValueTest.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/test/java/org/horizon/marshall/MarshalledValueTest.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -115,7 +115,7 @@
assert mvli.invocationCount == 0 : "Call should not have gone beyond the
MarshalledValueInterceptor";
}
- public void testNodeReleaseObjectValueReferences() {
+ public void testReleaseObjectValueReferences() {
Pojo value = new Pojo();
cache1.put("key", value);
assertSerializationCounts(1, 0);
@@ -150,7 +150,7 @@
assertSerialized(mv);
}
- public void testNodeReleaseObjectKeyReferences() throws IOException,
ClassNotFoundException {
+ public void testReleaseObjectKeyReferences() throws IOException,
ClassNotFoundException {
Pojo key = new Pojo();
cache1.put(key, "value");
@@ -305,7 +305,7 @@
Object newValue;
@CacheEntryModified
- public void nodeModified(CacheEntryModifiedEvent e) {
+ public void modified(CacheEntryModifiedEvent e) {
if (!e.isPre()) newValue = e.getValue();
}
}
Modified: core/branches/flat/src/test/java/org/horizon/replication/AsyncReplTest.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/replication/AsyncReplTest.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/test/java/org/horizon/replication/AsyncReplTest.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -20,9 +20,6 @@
import java.util.List;
import java.util.concurrent.TimeUnit;
-/**
- * Unit test for replicated async CacheSPI. Use locking and multiple threads to test
concurrent access to the tree.
- */
@Test(groups = "functional", testName = "replication.AsyncReplTest")
public class AsyncReplTest extends MultipleCacheManagersTest {
Modified: core/branches/flat/src/test/java/org/horizon/test/TestNameVerifier.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/test/TestNameVerifier.java 2009-02-25
11:22:30 UTC (rev 7781)
+++ core/branches/flat/src/test/java/org/horizon/test/TestNameVerifier.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -127,7 +127,6 @@
builder.append(line + "\n");
}
this.fileCache = builder.toString();
-// fileReader.close();
return fileCache;
}
@@ -185,25 +184,4 @@
if (!existingTestName.equals(expectedTestName)) return expectedTestName;
return null;
}
-
-
-// @Test(enabled = false)
-// public static void main(String[] args) throws Exception {
-// File file = new
File("C:\\jboss\\brainstoriming\\horizon\\src\\test\\java\\org\\horizon\\api\\tree\\NodeMoveAPITest.java");
-// String incorrectName = new TestNameVerifier().incorrectTestName(file);
-// System.out.println("incorrectName = " + incorrectName);
-
-
-// new TestNameVerifier().process();
-// Pattern classLinePattern = Pattern.compile("@Test[^)]*");
-// String totest = "aaaa\n" + "@Test(groups =
{\"functional\", \"pessimistic\"})\n" + "{ dsadsadsa";
-// Matcher matcher = classLinePattern.matcher(totest);
-// boolean found = matcher.find();
-// System.out.println("found = " + found);
-// String theMatch = matcher.group();
-// String result = matcher.replaceFirst(theMatch + ",
testName=\"alaBala\"");
-// System.out.println("theMatch = " + theMatch);
-// System.out.println("result = " + result);
-
-// }
}
\ No newline at end of file
Modified: core/branches/flat/src/test/java/org/horizon/test/TestingUtil.java
===================================================================
--- core/branches/flat/src/test/java/org/horizon/test/TestingUtil.java 2009-02-25 11:22:30
UTC (rev 7781)
+++ core/branches/flat/src/test/java/org/horizon/test/TestingUtil.java 2009-02-25 12:02:25
UTC (rev 7782)
@@ -34,12 +34,6 @@
import java.util.Random;
import java.util.Properties;
-/**
- * Utilities for unit testing JBossCache.
- *
- * @author <a href="mailto://brian.stansberry@jboss.com">Brian
Stansberry</a>
- * @since 1.0
- */
public class TestingUtil {
private static Random random = new Random();
public static final String TEST_FILES = "testFiles";
Modified: core/branches/flat/src/test/java/org/horizon/test/UnitTestDatabaseManager.java
===================================================================
---
core/branches/flat/src/test/java/org/horizon/test/UnitTestDatabaseManager.java 2009-02-25
11:22:30 UTC (rev 7781)
+++
core/branches/flat/src/test/java/org/horizon/test/UnitTestDatabaseManager.java 2009-02-25
12:02:25 UTC (rev 7782)
@@ -30,7 +30,7 @@
realConfig.setDataColumnName("bucket");
realConfig.setDataColumnType("BINARY");
realConfig.setDriverClass("org.hsqldb.jdbcDriver");
- realConfig.setConnectionUrl("jdbc:hsqldb:mem:jbosscache");
+ realConfig.setConnectionUrl("jdbc:hsqldb:mem:horizon");
realConfig.setUserName("sa");
}
@@ -73,7 +73,6 @@
}
public static String getDatabaseName(Properties prop) {
- //jdbc:hsqldb:mem:jbosscache
StringTokenizer tokenizer = new
StringTokenizer(prop.getProperty("cache.jdbc.url"), ":");
tokenizer.nextToken();
tokenizer.nextToken();
@@ -84,17 +83,15 @@
private static String getShutdownUrl(JdbcCacheStoreConfig props) {
String url = props.getConnectionUrl();
assert url != null;
- //jdbc:derby:jbossdb;create=true
StringTokenizer tokenizer = new StringTokenizer(url, ";");
String result = tokenizer.nextToken() + ";" + "shutdown=true";
return result;
}
private static JdbcCacheStoreConfig returnBasedOnDifferentInstance() {
- //jdbc:hsqldb:mem:jbosscache
JdbcCacheStoreConfig result = realConfig.clone();
String jdbcUrl = result.getConnectionUrl();
- Pattern pattern = Pattern.compile("jbosscache");
+ Pattern pattern = Pattern.compile("horizon");
Matcher matcher = pattern.matcher(jdbcUrl);
boolean found = matcher.find();
assert found;
@@ -109,7 +106,7 @@
for (int i = stack.length - 1; i > 0; i--) {
StackTraceElement e = stack[i];
String className = e.getClassName();
- if (className.indexOf("org.jboss.cache") != -1) return
className.replace('.', '_') + "_" + e.getMethodName();
+ if (className.indexOf("org.horizon") != -1) return
className.replace('.', '_') + "_" + e.getMethodName();
}
return null;
}