View File | Revision Log | Show Annotations | Download File | View Changeset
/hippo/hippo-cms7/tools/checker/trunk/jr241.patch
(Generate patch)

Comparing hippo-cms7/tools/checker/trunk/jr241.patch (file contents):
Revision 37592 by uhommes, Sun Dec 2 12:58:57 2012 UTC vs.
Revision 37593 by uhommes, Tue Jan 1 11:27:05 2013 UTC

367+ return false; 367+ return false;
368+ } 368+ }
369+ } 369+ }
370+} 370+}
371\ No newline at end of file 371\ No newline at end of file
372Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java
373===================================================================
374--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (revision 1368393)
375+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/value/InternalValue.java (working copy)
376@@ -711,6 +711,10 @@
377 }
378 }
379
380+ public boolean isInDataStore() {
381+ return val instanceof BLOBInDataStore;
382+ }
383+
384 /**
385 * @see org.apache.jackrabbit.spi.QValue#discard()
386 */
372Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java 387Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java
373=================================================================== 388===================================================================
374--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java (revision 1350176) 389--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java (revision 1368393)
375+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java (working copy) 390+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/IterablePersistenceManager.java (working copy)
376@@ -17,8 +17,10 @@ 391@@ -17,8 +17,10 @@
377 package org.apache.jackrabbit.core.persistence; 392 package org.apache.jackrabbit.core.persistence;
378 393
379 import java.util.List; 394 import java.util.List;
395 410
396+ 411+
397 } 412 }
398Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java 413Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java
399=================================================================== 414===================================================================
400--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java (revision 1350176) 415--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java (revision 1368393)
401+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java (working copy) 416+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/BundleFsPersistenceManager.java (working copy)
402@@ -16,6 +16,7 @@ 417@@ -16,6 +16,7 @@
403 */ 418 */
404 package org.apache.jackrabbit.core.persistence.bundle; 419 package org.apache.jackrabbit.core.persistence.bundle;
405 420
436 /** 451 /**
437 * {@inheritDoc} 452 * {@inheritDoc}
438 */ 453 */
439Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java 454Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java
440=================================================================== 455===================================================================
441--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java (revision 1350176) 456--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java (revision 1368393)
442+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java (working copy) 457+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/bundle/ConsistencyCheckerImpl.java (working copy)
443@@ -18,8 +18,10 @@ 458@@ -18,8 +18,10 @@
444 459
445 import java.util.ArrayList; 460 import java.util.ArrayList;
446 import java.util.Collection; 461 import java.util.Collection;
1037 } 1052 }
1038 } 1053 }
1039 } 1054 }
1040Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java 1055Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java
1041=================================================================== 1056===================================================================
1042--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java (revision 1350176) 1057--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java (revision 1368393)
1043+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java (working copy) 1058+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/pool/BundleDbPersistenceManager.java (working copy)
1044@@ -26,7 +26,9 @@ 1059@@ -26,7 +26,9 @@
1045 import java.sql.SQLException; 1060 import java.sql.SQLException;
1046 import java.sql.Types; 1061 import java.sql.Types;
1047 import java.util.ArrayList; 1062 import java.util.ArrayList;
1157 } 1172 }
1158 1173
1159 } 1174 }
1160Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java 1175Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java
1161=================================================================== 1176===================================================================
1162--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java (revision 1350176) 1177--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java (revision 1368393)
1163+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java (working copy) 1178+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItem.java (working copy)
1164@@ -17,17 +17,77 @@ 1179@@ -17,17 +17,77 @@
1165 package org.apache.jackrabbit.core.persistence.check; 1180 package org.apache.jackrabbit.core.persistence.check;
1166 1181
1167 /** 1182 /**
1241+ public CheckerEvent getCheckerEvent(); 1256+ public CheckerEvent getCheckerEvent();
1242+ 1257+
1243 } 1258 }
1244Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java 1259Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java
1245=================================================================== 1260===================================================================
1246--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java (revision 1350176) 1261--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java (revision 1368393)
1247+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java (working copy) 1262+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/check/ReportItemImpl.java (working copy)
1248@@ -16,24 +16,36 @@ 1263@@ -16,24 +16,36 @@
1249 */ 1264 */
1250 package org.apache.jackrabbit.core.persistence.check; 1265 package org.apache.jackrabbit.core.persistence.check;
1251 1266
1286 return nodeId + " -- " + message; 1301 return nodeId + " -- " + message;
1287Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java 1302Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java
1288=================================================================== 1303===================================================================
1289--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java (revision 0) 1304--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java (revision 0)
1290+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java (revision 0) 1305+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/util/NodeInfo.java (revision 0)
1291@@ -0,0 +1,102 @@ 1306@@ -0,0 +1,115 @@
1292+package org.apache.jackrabbit.core.persistence.util; 1307+package org.apache.jackrabbit.core.persistence.util;
1293+ 1308+
1294+import java.util.ArrayList; 1309+import java.util.ArrayList;
1295+import java.util.Collections; 1310+import java.util.Collections;
1296+import java.util.HashMap; 1311+import java.util.HashMap;
1317+ private final NodeId nodeId; 1332+ private final NodeId nodeId;
1318+ private NodeId parentId; 1333+ private NodeId parentId;
1319+ private List<NodeId> children; 1334+ private List<NodeId> children;
1320+ private Map<Name, List<NodeId>> references; 1335+ private Map<Name, List<NodeId>> references;
1321+ private boolean isReferenceable; 1336+ private boolean isReferenceable;
1337+ private boolean hasBlobsInDataStore;
1322+ 1338+
1323+ public NodeInfo(final NodePropBundle bundle) { 1339+ public NodeInfo(final NodePropBundle bundle) {
1324+ nodeId = getNodeId(bundle.getId()); 1340+ nodeId = getNodeId(bundle.getId());
1325+ parentId = getNodeId(bundle.getParentId()); 1341+ parentId = getNodeId(bundle.getParentId());
1326+ 1342+
1343+ for (InternalValue value : entry.getValues()) { 1359+ for (InternalValue value : entry.getValues()) {
1344+ values.add(getNodeId(value.getNodeId())); 1360+ values.add(getNodeId(value.getNodeId()));
1345+ } 1361+ }
1346+ references.put(entry.getName(), values); 1362+ references.put(entry.getName(), values);
1347+ } 1363+ }
1364+ else if (entry.getType() == PropertyType.BINARY) {
1365+ for (InternalValue internalValue : entry.getValues()) {
1366+ if (internalValue.isInDataStore()) {
1367+ hasBlobsInDataStore = true;
1368+ break;
1369+ }
1370+ }
1371+ }
1348+ } 1372+ }
1349+ 1373+
1350+ if (references == null) { 1374+ if (references == null) {
1351+ references = Collections.emptyMap(); 1375+ references = Collections.emptyMap();
1352+ } 1376+ }
1369+ return references; 1393+ return references;
1370+ } 1394+ }
1371+ 1395+
1372+ public boolean isReferenceable() { 1396+ public boolean isReferenceable() {
1373+ return isReferenceable; 1397+ return isReferenceable;
1398+ }
1399+
1400+ public boolean hasBlobsInDataStore() {
1401+ return hasBlobsInDataStore;
1374+ } 1402+ }
1375+ 1403+
1376+ private static NodeId getNodeId(NodeId nodeId) { 1404+ private static NodeId getNodeId(NodeId nodeId) {
1377+ if (nodeId == null) { 1405+ if (nodeId == null) {
1378+ return null; 1406+ return null;
1391+ nodeIdPool.clear(); 1419+ nodeIdPool.clear();
1392+ } 1420+ }
1393+} 1421+}
1394Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java 1422Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java
1395=================================================================== 1423===================================================================
1396--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java (revision 1350176) 1424--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java (revision 1368393)
1397+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java (working copy) 1425+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/persistence/mem/InMemBundlePersistenceManager.java (working copy)
1398@@ -27,6 +27,7 @@ 1426@@ -27,6 +27,7 @@
1399 import java.io.InputStream; 1427 import java.io.InputStream;
1400 import java.util.ArrayList; 1428 import java.util.ArrayList;
1401 import java.util.HashMap; 1429 import java.util.HashMap;
1422+ result.put(nodeId, new NodeInfo(loadBundle(nodeId))); 1450+ result.put(nodeId, new NodeInfo(loadBundle(nodeId)));
1423+ } 1451+ }
1424+ return result; 1452+ return result;
1425+ } 1453+ }
1426+ 1454+
1427 1455 /**
1456 * {@inheritDoc}
1457 */
1458Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java
1459===================================================================
1460--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java (revision 1368393)
1461+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/data/GarbageCollector.java (working copy)
1462@@ -22,6 +22,7 @@
1463 import org.apache.jackrabbit.core.id.PropertyId;
1464 import org.apache.jackrabbit.core.observation.SynchronousEventListener;
1465 import org.apache.jackrabbit.core.persistence.IterablePersistenceManager;
1466+import org.apache.jackrabbit.core.persistence.util.NodeInfo;
1467 import org.apache.jackrabbit.core.state.ItemStateException;
1468 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
1469 import org.apache.jackrabbit.core.state.NodeState;
1470@@ -32,6 +33,7 @@
1471 import org.slf4j.LoggerFactory;
1472
1473 import java.util.ArrayList;
1474+import java.util.Map;
1475 import java.util.Set;
1476 import java.util.concurrent.atomic.AtomicBoolean;
1477
1478@@ -78,6 +80,11 @@
1479 /** logger instance */
1480 private static final Logger LOG = LoggerFactory.getLogger(GarbageCollector.class);
1481
1482+ /**
1483+ * The number of nodes to fetch at once from the persistence manager. Defaults to 8kb
1484+ */
1485+ private static final int NODESATONCE = Integer.getInteger("org.apache.jackrabbit.garbagecollector.nodesatonce", 1024 * 8);
1486+
1487 private MarkEventListener callback;
1488
1489 private long sleepBetweenNodes;
1490@@ -202,30 +209,38 @@
1491
1492 private void scanPersistenceManagers() throws RepositoryException, ItemStateException {
1493 for (IterablePersistenceManager pm : pmList) {
1494- for (NodeId id : pm.getAllNodeIds(null, 0)) {
1495- if (callback != null) {
1496- callback.beforeScanning(null);
1497- }
1498- try {
1499- NodeState state = pm.load(id);
1500- Set<Name> propertyNames = state.getPropertyNames();
1501- for (Name name : propertyNames) {
1502- PropertyId pid = new PropertyId(id, name);
1503- PropertyState ps = pm.load(pid);
1504- if (ps.getType() == PropertyType.BINARY) {
1505- for (InternalValue v : ps.getValues()) {
1506- // getLength will update the last modified date
1507- // if the persistence manager scan is running
1508- v.getLength();
1509+ Map<NodeId,NodeInfo> batch = pm.getAllNodeInfos(null, NODESATONCE);
1510+ while (!batch.isEmpty()) {
1511+ NodeId lastId = null;
1512+ for (NodeInfo info : batch.values()) {
1513+ lastId = info.getId();
1514+ if (callback != null) {
1515+ callback.beforeScanning(null);
1516+ }
1517+ if (info.hasBlobsInDataStore()) {
1518+ try {
1519+ NodeState state = pm.load(info.getId());
1520+ Set<Name> propertyNames = state.getPropertyNames();
1521+ for (Name name : propertyNames) {
1522+ PropertyId pid = new PropertyId(info.getId(), name);
1523+ PropertyState ps = pm.load(pid);
1524+ if (ps.getType() == PropertyType.BINARY) {
1525+ for (InternalValue v : ps.getValues()) {
1526+ // getLength will update the last modified date
1527+ // if the persistence manager scan is running
1528+ v.getLength();
1529+ }
1530+ }
1531 }
1532+ } catch (NoSuchItemStateException ignored) {
1533+ // the node may have been deleted in the meantime
1534 }
1535 }
1536- } catch (NoSuchItemStateException e) {
1537- // the node may have been deleted or moved in the meantime
1538- // ignore it
1539 }
1540+ batch = pm.getAllNodeInfos(lastId, NODESATONCE);
1541 }
1542 }
1543+ NodeInfo.clearPool();
1544 }
1545
1546 /**
1428Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java 1547Index: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java
1429=================================================================== 1548===================================================================
1430--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java (revision 1368393) 1549--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java (revision 1368393)
1431+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java (working copy) 1550+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerImpl.java (working copy)
1432@@ -448,6 +448,21 @@ 1551@@ -448,6 +448,21 @@
1478=================================================================== 1597===================================================================
1479--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java (revision 1368393) 1598--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java (revision 1368393)
1480+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java (working copy) 1599+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManagerBase.java (working copy)
1481@@ -762,6 +762,29 @@ 1600@@ -762,6 +762,29 @@
1482 } 1601 }
1483 1602
1484 /** 1603 /**
1485+ * Removes the specified history from the storage 1604+ * Removes the specified history from the storage
1486+ * 1605+ *
1487+ * @param history the version history to remove 1606+ * @param history the version history to remove
1488+ * @throws VersionException 1607+ * @throws VersionException
1512=================================================================== 1631===================================================================
1513--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManager.java (revision 1368393) 1632--- jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManager.java (revision 1368393)
1514+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManager.java (working copy) 1633+++ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/version/InternalVersionManager.java (working copy)
1515@@ -92,6 +92,15 @@ 1634@@ -92,6 +92,15 @@
1516 throws RepositoryException; 1635 throws RepositoryException;
1517 1636
1518 /** 1637 /**
1519+ * Removes the specified version history from storage. 1638+ * Removes the specified version history from storage.
1520+ * 1639+ *
1521+ * @param session the session that performs the remove 1640+ * @param session the session that performs the remove
1522+ * @param history the version history to remove 1641+ * @param history the version history to remove
1526+ 1645+
1527+ /** 1646+ /**
1528 * Sets the version <code>label</code> to the given <code>version</code>. 1647 * Sets the version <code>label</code> to the given <code>version</code>.
1529 * If the label is already assigned to another version, a VersionException is 1648 * If the label is already assigned to another version, a VersionException is
1530 * thrown unless <code>move</code> is <code>true</code>. If <code>version</code> 1649 * thrown unless <code>move</code> is <code>true</code>. If <code>version</code>
1531
1532
1533Index: jackrabbit-core/pom.xml 1650Index: jackrabbit-core/pom.xml
1534=================================================================== 1651===================================================================
1535--- jackrabbit-core/pom.xml (revision 1368393) 1652--- jackrabbit-core/pom.xml (revision 1368393)
1536+++ jackrabbit-core/pom.xml (working copy) 1653+++ jackrabbit-core/pom.xml (working copy)
1537@@ -32,6 +32,7 @@ 1654@@ -32,6 +32,7 @@
1538 <artifactId>jackrabbit-core</artifactId> 1655 <artifactId>jackrabbit-core</artifactId>
1539 <name>Jackrabbit Core</name> 1656 <name>Jackrabbit Core</name>
1540 <description>Jackrabbit content repository implementation</description> 1657 <description>Jackrabbit content repository implementation</description>
1541+ <version>2.4.1-h1</version> 1658+ <version>2.4.1-h2</version>
1542 1659
1543 <properties> 1660 <properties>
1544 <org.apache.jackrabbit.test.integration>false</org.apache.jackrabbit.test.integration> 1661 <org.apache.jackrabbit.test.integration>false</org.apache.jackrabbit.test.integration>

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines