svn commit: r1820856 - in /jackrabbit/oak/branches/1.2/oak-core: ./ src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java src/test/java/org/apache/jackrabbit/oak/pl
Author: reschke Date: Thu Jan 11 10:17:02 2018 New Revision: 1820856 URL: http://svn.apache.org/viewvc?rev=1820856&view=rev Log: OAK-7126: make RDBCacheConsistency2Test store-agnostic (ported to 1.2) Added: jackrabbit/oak/branches/1.2/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java - copied, changed from r1820661, jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java Removed: jackrabbit/oak/branches/1.2/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBCacheConsistency2Test.java Modified: jackrabbit/oak/branches/1.2/oak-core/ (props changed) Propchange: jackrabbit/oak/branches/1.2/oak-core/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jan 11 10:17:02 2018 @@ -1,5 +1,5 @@ /jackrabbit/oak/branches/1.0/oak-core:1665962 /jackrabbit/oak/branches/1.4/oak-core:1745750,1747354,1750078,1750512,1790375,1803776,1805392,1805400,1805402 /jackrabbit/oak/trunk/oak-core:1672350,1672468-1672469,1672537,1672603,1672611,1672642,1672644,1672834-1672835,1673351,1673410,1673414-1673415,1673436,1673644,1673662-1673664,1673669,1673695,1673713,1673738,1673787,1673791,1674046,1674065,1674075,1674107,1674228,1674780,1674880,1675054-1675055,1675089,1675319,1675332,1675354,1675357,1675382,167,1675566,1675593,1676198,1676237,1676407,1676458,1676539,1676670,1676693,1676703,1676725,1677579,1677581,1677609,1677611,164,1677788,1677797,1677804,1677806,1677939,1677991,1678023,1678095-1678096,1678124,1678171,1678173,1678202,1678211,1678323,1678758,1678938,1678954,1679144,1679165,1679191,1679232,1679235,1679503,1679958,1679961,1680170,1680172,1680182,1680222,1680232,1680236,1680461,1680633,1680643,1680747,1680805-1680806,1680903,1681282,1681767,1681918,1681921,1681955,1682042,1682218,1682235,1682437,1682488,1682494,1682555,1682855,1682904,1683059,1683089,1683213,1683249,1683259,1683278,1683323,1683687,1683700,1684174-1684175,168418 6,1684376,1684442,1684561,1684570,1684601,1684618,1684669,1684820,1684868,1684894,1685023,1685075,1685370,1685541,1685552,1685589-1685590,1685834,1685839-1685840,1685964,1685977,1685989,1685999,1686003,1686023,1686032,1686097,1686162,1686229,1686234,1686253,1686414,1686772,1686780,1686790,1686854,1686857,1686971,1687053-1687055,1687175,1687196,1687198,1687220,1687239-1687240,1687301,1687441,1687553,1688089-1688090,1688172,1688179,1688349,1688421,1688436,1688453,1688616,1688622,1688634,1688636,1688817,1689003-1689004,1689008,1689577,1689581,1689623,1689810,1689828,1689831,1689833,1689903,1690017,1690043,1690047,1690057,1690247,1690249,1690634-1690637,1690650,1690657,1690669,1690672,1690674,1690885,1690941,1691139,1691151,1691159,1691167,1691183,1691188,1691201,1691210,1691217-1691218,1691280,1691307,1691331-1691333,1691345,1691384-1691385,1691394,1691401,1691498,1691509,1692133-1692134,1692156,1692250,1692272,1692274,1692363,1692382,1692393,1692478,1692955,1693002,1693030,1693050,169 3209,1693401,1693421,1693525-1693526,1694007,1694049,1694393-1694394,1694651,1694653-1694654,1695032,1695050,1695122,1695223,1695280,1695299,1695420,1695457,1695482,1695492,1695507,1695521,1695540,1695571,1695829-1695830,1695905,1696190,1696194,1696242,1696285,1696375,1696522,1696578,1696759,1696916,1697363,1697373,1697383,1697410,1697579,1697582,1697589,1697616,1697672,1697896,1698096,1698144,1700191,1700231,1700397,1700403,1700506,1700571,1700709,1700718,1700720,1700727,1700749,1700769,1700775,1701065,1701613,1701619,1701733,1701743,1701750,1701768,1701806,1701810,1701814,1701907,1701948,1701955,1701959,1701965,1701986,1702014,1702022,1702045,1702051,1702241,1702272,1702371,1702387,1702405,1702423,1702426,1702428,1702860,1702866,1702942,1702960,1703212,1703382,1703395,1703411,1703428,1703430,1703568,1703592,1703758,1703858,1703878,1704256,1704282,1704285,1704457,1704479,1704490,1704614,1704629,1704636,1704655,1704670,1704886,1705005,1705027,1705043,1705055,1705250,1705268,1705273, 1705323,1705677,1705701,1705871,1705992,1705998,1706009,1706037,1706059,1706212,1706218,1706270,1706764,1706772,1707049,1707189,1707191,1707223,1707331,1707435,1707509,1707753,1708049,1708105,1708307,1708315,1708401,1708546,1708592,1708738,1708766,1709012,1709852,1709978,1710013,1710031,1710049,1710205,1710242,1710559,1710575,1710590,1710614,1710637,1710789,1710800,1710811,1710816,1710972,1711209,1711248,1711282,1711296,1711405,1711498,1711654,1712018,1712042,1712319,1712490,1712531,1712730,1712785,1712963,1713008,1713439,1713461,1713580,1713586,1713599-1713600,1713626,1713698,1713803,1713809,1714034,1714061,1714084,1714170,1714174,1714213,1714229,1714238,1714519-1714520,1714543-1714544,1714730,1714739,1714779,1714827,1714956,1714961,1715010,1715092,1715191,1715346,1715716,1715767,1715771,1715888,1715898,1716100,1716178,1716426,1716576,1716588-1716589,1716596,1716616,1716703,1716712,1
svn commit: r1820859 - /jackrabbit/oak/trunk/oak-store-document/src/main/resources/
Author: mreutegg Date: Thu Jan 11 10:28:11 2018 New Revision: 1820859 URL: http://svn.apache.org/viewvc?rev=1820859&view=rev Log: OAK-7141: Remove unused metatype.properties Removed: jackrabbit/oak/trunk/oak-store-document/src/main/resources/
svn commit: r1820861 - /jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java
Author: reschke Date: Thu Jan 11 10:36:37 2018 New Revision: 1820861 URL: http://svn.apache.org/viewvc?rev=1820861&view=rev Log: OAK-7029: RDBDocumentStore.getStats() implementation Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java?rev=1820861&r1=1820860&r2=1820861&view=diff == --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Thu Jan 11 10:36:37 2018 @@ -674,6 +674,80 @@ public enum RDBDocumentStoreDB { } return result.toString(); } + +private long parseSize(String readable) { +try { +if (readable != null && readable.endsWith(" KB")) { +return 1024 * Long.parseLong(readable.substring(0, readable.length() - 3)); +} else { +return -1; +} +} catch (NumberFormatException ex) { +return -1; +} +} + +@Override +public Map getAdditionalStatistics(RDBConnectionHandler ch, String catalog, String tableName) { +Map result = new HashMap(); +Connection con = null; + +// table data +try { +con = ch.getROConnection(); +try (PreparedStatement stmt = con.prepareStatement("exec sp_spaceused ?")) { +stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +long treserved = parseSize(rs.getString("reserved")); +long tdata = parseSize(rs.getString("data")); +long tindexSize = parseSize(rs.getString("index_size")); +long tunused = parseSize(rs.getString("unused")); +if (treserved >= 0 && tdata >= 0 && tindexSize >= 0 && tunused >= 0) { +result.put("storageSize", Long.toString(treserved + tdata + tindexSize + tunused)); +result.put("size", Long.toString(treserved + tdata + tunused)); +result.put("totalIndexSize", Long.toString(tindexSize)); +} +String data = extractFields(rs, "rows reserved data index_size unused"); +result.put("_data", data); +} +} +con.commit(); +} +} catch (SQLException ex) { +LOG.debug("while getting diagnostics", ex); +} finally { +ch.closeConnection(con); +} + +// index data +try { +con = ch.getROConnection(); +try (PreparedStatement stmt = con.prepareStatement( +"SELECT i.[name] AS name, SUM(s.[row_count]) as rows, SUM(s.[used_page_count] * 8) as usedKB, SUM(s.[reserved_page_count] * 8) as reservedKB " ++ "FROM sys.dm_db_partition_stats AS s " ++ "INNER JOIN sys.indexes AS i ON s.[object_id] = i.[object_id] " ++ "AND s.[index_id] = i.[index_id] WHERE i.[object_id]=OBJECT_ID(?) " + "GROUP BY i.[name]")) { +stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +String index = rs.getString("name"); +String data = extractFields(rs, "rows usedKB reservedKB"); +result.put("index." + index + "._data", data); +} +} +con.commit(); +} +con.commit(); +} catch (SQLException ex) { +ex.printStackTrace(); +LOG.debug("while getting diagnostics", ex); +} finally { +ch.closeConnection(con); +} + +return result; +} }; private static final Logger LOG = LoggerFactory.getLogger(RDBDocumentStoreDB.class); @@ -836,6 +910,11 @@ public enum RDBDocumentStoreDB { * SHOW
svn propchange: r1820861 - svn:log
Author: reschke Revision: 1820861 Modified property: svn:log Modified: svn:log at Thu Jan 11 10:37:23 2018 -- --- svn:log (original) +++ svn:log Thu Jan 11 10:37:23 2018 @@ -1 +1 @@ -OAK-7029: RDBDocumentStore.getStats() implementation +OAK-7060: RDBDocumentStore.getStats() for SQLServer
svn commit: r1820871 - in /jackrabbit/oak/trunk/oak-store-document/src: main/java/org/apache/jackrabbit/oak/plugins/document/mongo/ test/java/com/mongodb/ test/java/org/apache/jackrabbit/oak/plugins/d
Author: mreutegg Date: Thu Jan 11 12:30:43 2018 New Revision: 1820871 URL: http://svn.apache.org/viewvc?rev=1820871&view=rev Log: OAK-7139: Wrap MongoException when query fails Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java jackrabbit/oak/trunk/oak-store-document/src/test/java/com/mongodb/OakFongo.java jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDBExceptionTest.java Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java?rev=1820871&r1=1820870&r2=1820871&view=diff == --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java Thu Jan 11 12:30:43 2018 @@ -490,7 +490,7 @@ public class MongoDocumentStore implemen } catch (RuntimeException e) { t = e; } -throw new DocumentStoreException("Failed to load document with " + key, t); +throw handleException(t, collection, key); } /** @@ -526,7 +526,7 @@ public class MongoDocumentStore implemen } } if (ex != null) { -throw ex; +throw handleException(ex, collection, key); } else { // impossible to get here throw new IllegalStateException(); @@ -581,19 +581,23 @@ public class MongoDocumentStore implemen String indexedProperty, long startValue, int limit) { -return queryInternal(collection, fromKey, toKey, indexedProperty, -startValue, limit, maxQueryTimeMS); +try { +return queryInternal(collection, fromKey, toKey, indexedProperty, +startValue, limit, maxQueryTimeMS); +} catch (MongoException e) { +throw handleException(e, collection, Lists.newArrayList(fromKey, toKey)); +} } @SuppressWarnings("unchecked") @Nonnull - List queryInternal(Collection collection, - String fromKey, - String toKey, - String indexedProperty, - long startValue, - int limit, - long maxQueryTime) { +protected List queryInternal(Collection collection, + String fromKey, + String toKey, + String indexedProperty, + long startValue, + int limit, + long maxQueryTime) { log("query", fromKey, toKey, indexedProperty, startValue, limit); DBCollection dbCollection = getDBCollection(collection); QueryBuilder queryBuilder = QueryBuilder.start(Document.ID); @@ -1700,7 +1704,7 @@ public class MongoDocumentStore implemen } } -private DocumentStoreException handleException(Exception ex, +private DocumentStoreException handleException(Throwable ex, Collection collection, Iterable ids) { if (collection == Collection.NODES) { @@ -1711,7 +1715,7 @@ public class MongoDocumentStore implemen return DocumentStoreException.convert(ex, ids); } -private DocumentStoreException handleException(Exception ex, +private DocumentStoreException handleException(Throwable ex, Collection collection, String id) { return handleException(ex, collection, Collections.singleton(id)); Modified: jackrabbit/oak/trunk/oak-store-document/src/test/java/com/mongodb/OakFongo.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/com/mongodb/OakFongo.java?rev=1820871&r1=1820
svn commit: r1820874 - in /jackrabbit/oak/branches/1.0/oak-core: ./ src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java src/test/java/org/apache/jackrabbit/oak/pl
Author: reschke Date: Thu Jan 11 13:10:57 2018 New Revision: 1820874 URL: http://svn.apache.org/viewvc?rev=1820874&view=rev Log: OAK-7126: make RDBCacheConsistency2Test store-agnostic (ported to 1.0) Added: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java - copied, changed from r1820661, jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/ConcurrentQueryAndUpdate2IT.java Removed: jackrabbit/oak/branches/1.0/oak-core/src/test/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBCacheConsistency2Test.java Modified: jackrabbit/oak/branches/1.0/oak-core/ (props changed) Propchange: jackrabbit/oak/branches/1.0/oak-core/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jan 11 13:10:57 2018 @@ -1,5 +1,5 @@ /jackrabbit/oak/branches/1.2/oak-core:1695500,1700753,1709440,1714095,1725270,1742959,1743356,1745019,1745589,1749700,1750645,1751766,1751768,1782746,1805405-1805406,1805409,1819473,1820108 /jackrabbit/oak/branches/1.4/oak-core:1745750,1747354,1750078,1750512,1805392,1805400,1805402 /jackrabbit/oak/trunk/oak-core:1584578,1584602,1584614,1584616,1584709,1584781,1584937,1585297,1585304-1585305,1585420,1585424,1585427,1585448,1585465,1585468,1585486,1585497,1585509,1585647,1585655-1585656,1585661,1585665-1585666,1585669-1585670,1585673,1585680,1585719,1585763,1585770,1585896,1585904,1585907,1585940,1585949,1585951,1585956,1585962-1585963,1586287,1586320,1586364,1586372,1586655,1586836,1587130,1587224,1587399,1587408,1587472,1587485,1587488,1587538,1587580,1587807,1588033,1588042,1588046,1588066,1588201,1589025,1589101,1589137,1589141,1589263,1589440,1589442,1589484,1589488,1589661,1589664,1589682,1589708,1589741,1589748,1589789,1589794,1589850,1589864,1590628,1590660,1590684,1590697,1590701,1590980,1590988,1591101,1591226,1591229,1591293,1591314,1591317,1591362,1591374,1591381,1591438,1591467,1591552,1591704,1591713,1591715,1591723,1591874,1592487,1592512,1592658,1592665,1592677,1592742,1592744,1592787,1592809,1592955,1593036,1593048,1593061,1593133,1593210-159321 1,1593231,1593245,1593250,1593294,1593304,1593317,1593342,1593554,1594158-1594164,1594166-1594167,1594169,1594237,1594800,1594808,1594835,1594888,1594987,1595147,1595186,1595457,1595856,1596241,1596474,1596534,1596844,1596889,1597569,1597795,1597854,1597860,1598292,1598302,1598352,1598369,1598595,1598631,1598696,1598732,1598797-1598798,1599160,1599299,1599332,1599416,1599434,1599671,1600088,1600935,1601309,1601388,1601578,1601649,1601676,1601757,1601768,1601814,1601833,1601838,1601853,1601878,1601888,1601922,1602156,1602170,1602174,1602179,1602183,1602201,1602207,1602227,1602256,1602261,1602342,1602796-1602797,1602800,1602809,1602853,1602872,1602914,1603155,1603307,1603401,1603441,1603748,1604166,1605030,1605036,1605038,1605292,1605447,1605526,1605670,1605725,1605831,1605852,1606077,1606079,1606087,1606638,1606641,1606644,1606708,1606711,1607031-1607032,1607077,1607127,1607141,1607152,1607185,1607196,1607331,1607362,1607366,1607392,1607526,1607557,1607664,1607737,1608463,1608560,160 8731,1608783,1609064,1609081,1609165,1609214,1609488,1610489,1610592,1610603,1610634,1610658,1610664,1611021,1611041,1611270,1611275,1611277,1611313,1611332,1611584,1612560,1612825,1612848,1612892,1612899,1612993,1613018,1613041,1614032,1614265,1614272,1614344-1614345,1614384-1614385,1614397,1614405-1614406,1614574,1614591,1614593,1614596,1614604,1614689,1614807,1614835,1614891,1615417-1615418,1616182,1616236,1616463,1616719,1617417,1617451,1617463,1617711,1618158,1618613,1618624,1618709,1619222,1619411,1619695,1619800,1619808,1619815,1619823-1619824,1620512,1620581,1620585,1620634,1620898,1620905,1621115,1621123-1621124,1621168,1621192,1621201,1621706,1621962,1622197,1622201,1622207,1622250,1622479,1623364,1623766,1623827,1623949,1623969,1623973,1624216,1624317,1624551,1624559,1624973,1624993-1624994,1625025,1625036,1625158,1625224,1625237,1625299,1625348,1625620,1625916,1625962-1625963,1626021,1626053,1626163,1626168,1626175,1626191,1626265,1626770,1627047,1627052,1627228,1627346, 1627470,1627473,1627479,1627503,1627586,1627590,1627715,1627731,1628180,1628198,1628262,1628447,1628608,1629629,1629688,1629840,1629858,1629917,1630055-1630057,1630156,1630299,1630338,1630773,1631283-1631284,1631333-1631334,1631617-1631619,1631630,1631699,1631704,1631711,1631967-1631969,1631986,1631990,1631999,1632002-1632003,1632017,1632258,1632264,1632270,1632293,1632303,1632592,1632605,1633315,1633327,1633389,1633559-1633560,1633562,1633567,1633571,1633598,1633608,1633641,1633687,1633697,1633768,1633783,1634505,1634513,1634774,1634779,1634781,1634792,1634803,1634814,1634816,1634838,1634841,1634852,1634864,1634896,1634898,1635044-1635045,1635060,1635077,1635089,1635102,1635108,1635178,1635218,1635387,1635435,1635518,1635563,1635586,1636336,1636348,1636505,
svn commit: r1820876 - /jackrabbit/oak/trunk/.travis.yml
Author: mreutegg Date: Thu Jan 11 13:26:15 2018 New Revision: 1820876 URL: http://svn.apache.org/viewvc?rev=1820876&view=rev Log: OAK-7143: Run oak-jcr tests and ITs in parallel on travis-ci Modified: jackrabbit/oak/trunk/.travis.yml Modified: jackrabbit/oak/trunk/.travis.yml URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/.travis.yml?rev=1820876&r1=1820875&r2=1820876&view=diff == --- jackrabbit/oak/trunk/.travis.yml (original) +++ jackrabbit/oak/trunk/.travis.yml Thu Jan 11 13:26:15 2018 @@ -15,16 +15,17 @@ sudo: false env: - - MODULE=oak-jcr - - MODULE=oak-store-document - - MODULE=oak-it - - MODULE=oak-lucene - - MODULE=oak-run - - MODULE=oak-it-osgi - - MODULE=oak-pojosr - - MODULE=oak-upgrade + - MODULE=oak-jcr PROFILE="-PintegrationTesting" UT="-Dsurefire.skip.ut=true" + - MODULE=oak-jcr PROFILE="" UT="" + - MODULE=oak-store-document PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-it PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-lucene PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-run PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-it-osgi PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-pojosr PROFILE="-PintegrationTesting" UT="" + - MODULE=oak-upgrade PROFILE="-PintegrationTesting" UT="" install: mvn --batch-mode -DskipTests -Dbaseline.skip=true install -pl :${MODULE} -am -nsu -script: mvn --batch-mode clean verify -Dbaseline.skip=true -PintegrationTesting -Dnsfixtures=DOCUMENT_NS -pl :${MODULE} -nsu +script: mvn --batch-mode clean verify -Dbaseline.skip=true ${UT} ${PROFILE} -Dnsfixtures=DOCUMENT_NS -pl :${MODULE} -nsu language: java jdk: - oraclejdk8
svn commit: r1820877 - in /jackrabbit/oak/trunk/oak-store-document/src: main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java test/java/org/apache/jackrabbit/oak/plugins/d
Author: mreutegg Date: Thu Jan 11 13:32:01 2018 New Revision: 1820877 URL: http://svn.apache.org/viewvc?rev=1820877&view=rev Log: OAK-7140: Retry query on MongoException Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/mongo/RetryReadIT.java Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java?rev=1820877&r1=1820876&r2=1820877&view=diff == --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java Thu Jan 11 13:32:01 2018 @@ -220,6 +220,13 @@ public class MongoDocumentStore implemen private int bulkRetries = Integer.getInteger("oak.mongo.bulkRetries", 0); +/** + * How many times a query to MongoDB should be retried when it fails with a + * MongoException. + */ +private final int queryRetries = +Integer.getInteger("oak.mongo.queryRetries", 2); + private String lastReadWriteMode; private final Map metadata; @@ -429,7 +436,7 @@ public class MongoDocumentStore implemen final int maxCacheAge) { if (collection != Collection.NODES) { return findUncachedWithRetry(collection, key, -DocumentReadPreference.PRIMARY, 2); +DocumentReadPreference.PRIMARY); } NodeDocument doc; if (maxCacheAge > 0 || preferCached) { @@ -467,7 +474,7 @@ public class MongoDocumentStore implemen } final NodeDocument d = (NodeDocument) findUncachedWithRetry( collection, key, -getReadPreference(maxCacheAge), 2); +getReadPreference(maxCacheAge)); invalidateCache(collection, key); doc = nodesCache.get(key, new Callable() { @Override @@ -500,20 +507,17 @@ public class MongoDocumentStore implemen * @param collection the collection to read from. * @param key the key of the document to find. * @param docReadPref the read preference. - * @param retries the number of retries. Must not be negative. * @param the document type of the given collection. * @return the document or {@code null} if the document doesn't exist. */ @CheckForNull private T findUncachedWithRetry( Collection collection, String key, -DocumentReadPreference docReadPref, -int retries) { -checkArgument(retries >= 0, "retries must not be negative"); +DocumentReadPreference docReadPref) { if (key.equals("0:/")) { LOG.trace("root node"); } -int numAttempts = retries + 1; +int numAttempts = queryRetries + 1; MongoException ex = null; for (int i = 0; i < numAttempts; i++) { if (i > 0) { @@ -581,11 +585,40 @@ public class MongoDocumentStore implemen String indexedProperty, long startValue, int limit) { -try { -return queryInternal(collection, fromKey, toKey, indexedProperty, -startValue, limit, maxQueryTimeMS); -} catch (MongoException e) { -throw handleException(e, collection, Lists.newArrayList(fromKey, toKey)); +return queryWithRetry(collection, fromKey, toKey, indexedProperty, +startValue, limit, maxQueryTimeMS); +} + +/** + * Queries for documents and performs a number of retries if the read fails + * with an exception. + */ +@Nonnull +private List queryWithRetry(Collection collection, +String fromKey, +String toKey, +String indexedProperty, +long startValue, +int limit, +long maxQueryTime) { +int numAttempts = queryRetries + 1; +MongoException ex = null; +for (int i = 0; i < numAttempts; i++) { +if (i > 0) { +
svn commit: r1820878 - /jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java
Author: reschke Date: Thu Jan 11 13:34:49 2018 New Revision: 1820878 URL: http://svn.apache.org/viewvc?rev=1820878&view=rev Log: OAK-7142: RDBDocumentStoreDB: use try-with-resources in new code introduced for getStats() Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Modified: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java?rev=1820878&r1=1820877&r2=1820878&view=diff == --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Thu Jan 11 13:34:49 2018 @@ -151,27 +151,25 @@ public enum RDBDocumentStoreDB { public Map getAdditionalStatistics(RDBConnectionHandler ch, String catalog, String tableName) { Map result = new HashMap(); Connection con = null; -PreparedStatement stmt = null; -ResultSet rs = null; SortedSet indexNames = Collections.emptySortedSet(); // get index names try { SortedSet in = new TreeSet(); con = ch.getROConnection(); -stmt = con.prepareStatement("SELECT indexname FROM pg_indexes WHERE tablename=?"); -stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); -rs = stmt.executeQuery(); -while (rs.next()) { -in.add(rs.getString(1)); +try (PreparedStatement stmt = con.prepareStatement("SELECT indexname FROM pg_indexes WHERE tablename=?")) { +stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +in.add(rs.getString(1)); +} +} } con.commit(); indexNames = in; } catch (SQLException ex) { LOG.debug("while getting diagnostics", ex); } finally { -closeResultSet(rs); -closeStatement(stmt); ch.closeConnection(con); } @@ -180,30 +178,30 @@ public enum RDBDocumentStoreDB { StringBuilder query = new StringBuilder("SELECT pg_total_relation_size(?), pg_table_size(?), pg_indexes_size(?)"); indexNames.forEach(name -> query.append(", pg_relation_size(?)")); con = ch.getROConnection(); -stmt = con.prepareStatement(query.toString()); -int i = 1; -stmt.setString(i++, tableName); -stmt.setString(i++, tableName); -stmt.setString(i++, tableName); -for(String name : indexNames) { -stmt.setString(i++, name); -} -rs = stmt.executeQuery(); -while (rs.next()) { -i = 1; -result.put("storageSize", rs.getString(i++)); -result.put("size", rs.getString(i++)); -result.put("totalIndexSize", rs.getString(i++)); +try (PreparedStatement stmt = con.prepareStatement(query.toString())) { +int i = 1; +stmt.setString(i++, tableName); +stmt.setString(i++, tableName); +stmt.setString(i++, tableName); for (String name : indexNames) { -result.put("indexSizes." + name, rs.getString(i++)); +stmt.setString(i++, name); +} +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +i = 1; +result.put("storageSize", rs.getString(i++)); +result.put("size", rs.getString(i++)); +result.put("totalIndexSize", rs.getString(i++)); +for (String name : indexNames) { +result.put("indexSizes." + name, rs.getString(i++)); +} +} } } con.commit(); } catch (SQLException ex) { LOG.debug("while getting diagnostics", ex); } finally { -closeResultSet(rs); -closeStatement(stmt);
svn commit: r1820881 - in /jackrabbit/oak/trunk/oak-jcr/src/test: java/org/apache/jackrabbit/oak/jcr/ resources/
Author: mreutegg Date: Thu Jan 11 13:54:28 2018 New Revision: 1820881 URL: http://svn.apache.org/viewvc?rev=1820881&view=rev Log: OAK-7107: Ability to run AbstractJCRTest derived tests with different fixtures Added: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/BaseRepositoryStub.java - copied, changed from r1820880, jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java (with props) Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentMemRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentRDBRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakSegmentTarRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakTarMKRepositoryStub.java jackrabbit/oak/trunk/oak-jcr/src/test/resources/repositoryStubImpl.properties Copied: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/BaseRepositoryStub.java (from r1820880, jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java) URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/BaseRepositoryStub.java?p2=jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/BaseRepositoryStub.java&p1=jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java&r1=1820880&r2=1820881&rev=1820881&view=diff == --- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakRepositoryStub.java (original) +++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/BaseRepositoryStub.java Thu Jan 11 13:54:28 2018 @@ -33,7 +33,7 @@ import org.apache.jackrabbit.test.Reposi /** * Base RepositoryStub for the Oak Repository */ -abstract class OakRepositoryStub extends RepositoryStub { +abstract class BaseRepositoryStub extends RepositoryStub { private static final Principal UNKNOWN_PRINCIPAL = new Principal() { @Override @@ -42,7 +42,7 @@ abstract class OakRepositoryStub extends } }; -protected OakRepositoryStub(Properties env) { +protected BaseRepositoryStub(Properties env) { super(env); } Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentMemRepositoryStub.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentMemRepositoryStub.java?rev=1820881&r1=1820880&r2=1820881&view=diff == --- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentMemRepositoryStub.java (original) +++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentMemRepositoryStub.java Thu Jan 11 13:54:28 2018 @@ -27,7 +27,7 @@ import org.apache.jackrabbit.test.Reposi /** * A repository stub using the DocumentNodeStore with an in-memory DocumentStore. */ -public class OakDocumentMemRepositoryStub extends OakRepositoryStub { +public class OakDocumentMemRepositoryStub extends BaseRepositoryStub { private final Repository repository; Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentRDBRepositoryStub.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentRDBRepositoryStub.java?rev=1820881&r1=1820880&r2=1820881&view=diff == --- jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentRDBRepositoryStub.java (original) +++ jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakDocumentRDBRepositoryStub.java Thu Jan 11 13:54:28 2018 @@ -33,7 +33,7 @@ import org.apache.jackrabbit.oak.plugins /** * A repository stub implementation for the RDB document store. */ -public class OakDocumentRDBRepositoryStub extends OakRepositoryStub { +public class OakDocumentRDBRepositoryStub extends BaseRepositoryStub { protected static final String URL = System.getProperty("rdb.jdbc-url", "jdbc:h2:file:./{fname}oaktest;DB_CLOSE_ON_EXIT=FALSE"); Modified: jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/test/java/org/apache/jackrabbit/oak/jcr/OakMongoNSRepositoryStub.java?rev=1820881&r1=1820880
svn commit: r1820885 - in /jackrabbit/oak/branches/1.8: ./ oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java
Author: reschke Date: Thu Jan 11 14:24:55 2018 New Revision: 1820885 URL: http://svn.apache.org/viewvc?rev=1820885&view=rev Log: OAK-7060: RDBDocumentStore.getStats() for SQLServer (ported to 1.8) Modified: jackrabbit/oak/branches/1.8/ (props changed) jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Propchange: jackrabbit/oak/branches/1.8/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Thu Jan 11 14:24:55 2018 @@ -1,3 +1,3 @@ /jackrabbit/oak/branches/1.0:1665962 -/jackrabbit/oak/trunk:1820660-1820661 +/jackrabbit/oak/trunk:1820660-1820661,1820861 /jackrabbit/trunk:1345480 Modified: jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java?rev=1820885&r1=1820884&r2=1820885&view=diff == --- jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java (original) +++ jackrabbit/oak/branches/1.8/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStoreDB.java Thu Jan 11 14:24:55 2018 @@ -674,6 +674,80 @@ public enum RDBDocumentStoreDB { } return result.toString(); } + +private long parseSize(String readable) { +try { +if (readable != null && readable.endsWith(" KB")) { +return 1024 * Long.parseLong(readable.substring(0, readable.length() - 3)); +} else { +return -1; +} +} catch (NumberFormatException ex) { +return -1; +} +} + +@Override +public Map getAdditionalStatistics(RDBConnectionHandler ch, String catalog, String tableName) { +Map result = new HashMap(); +Connection con = null; + +// table data +try { +con = ch.getROConnection(); +try (PreparedStatement stmt = con.prepareStatement("exec sp_spaceused ?")) { +stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +long treserved = parseSize(rs.getString("reserved")); +long tdata = parseSize(rs.getString("data")); +long tindexSize = parseSize(rs.getString("index_size")); +long tunused = parseSize(rs.getString("unused")); +if (treserved >= 0 && tdata >= 0 && tindexSize >= 0 && tunused >= 0) { +result.put("storageSize", Long.toString(treserved + tdata + tindexSize + tunused)); +result.put("size", Long.toString(treserved + tdata + tunused)); +result.put("totalIndexSize", Long.toString(tindexSize)); +} +String data = extractFields(rs, "rows reserved data index_size unused"); +result.put("_data", data); +} +} +con.commit(); +} +} catch (SQLException ex) { +LOG.debug("while getting diagnostics", ex); +} finally { +ch.closeConnection(con); +} + +// index data +try { +con = ch.getROConnection(); +try (PreparedStatement stmt = con.prepareStatement( +"SELECT i.[name] AS name, SUM(s.[row_count]) as rows, SUM(s.[used_page_count] * 8) as usedKB, SUM(s.[reserved_page_count] * 8) as reservedKB " ++ "FROM sys.dm_db_partition_stats AS s " ++ "INNER JOIN sys.indexes AS i ON s.[object_id] = i.[object_id] " ++ "AND s.[index_id] = i.[index_id] WHERE i.[object_id]=OBJECT_ID(?) " + "GROUP BY i.[name]")) { +stmt.setString(1, tableName.toLowerCase(Locale.ENGLISH)); +try (ResultSet rs = stmt.executeQuery()) { +while (rs.next()) { +String index = rs.getString("name"); +String data = extractFields(rs, "rows usedKB reservedKB"); +result.put("index." + index + "._data", data); +} +} +con.commit(); +} +
svn commit: r1820888 - /jackrabbit/oak/trunk/oak-core/src/main/resources/OSGI-INF/
Author: mreutegg Date: Thu Jan 11 14:30:20 2018 New Revision: 1820888 URL: http://svn.apache.org/viewvc?rev=1820888&view=rev Log: OAK-7141: Remove unused metatype.properties Removed: jackrabbit/oak/trunk/oak-core/src/main/resources/OSGI-INF/
svn commit: r1820899 - in /jackrabbit/oak/trunk/oak-store-document/src: main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java test/java/org/apache/jackrabbit/oak/plugins/document/Docume
Author: mreutegg Date: Thu Jan 11 16:53:27 2018 New Revision: 1820899 URL: http://svn.apache.org/viewvc?rev=1820899&view=rev Log: OAK-2907: Move DocumentMK to test Added: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java - copied, changed from r1820898, jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java Removed: jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java Copied: jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java (from r1820898, jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java) URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java?p2=jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java&p1=jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java&r1=1820898&r2=1820899&rev=1820899&view=diff == --- jackrabbit/oak/trunk/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java (original) +++ jackrabbit/oak/trunk/oak-store-document/src/test/java/org/apache/jackrabbit/oak/plugins/document/DocumentMK.java Thu Jan 11 16:53:27 2018 @@ -39,11 +39,9 @@ import org.apache.jackrabbit.oak.commons import org.apache.jackrabbit.oak.json.JsopDiff; import org.apache.jackrabbit.oak.plugins.blob.ReferencedBlob; import org.apache.jackrabbit.oak.plugins.document.DocumentNodeState.Children; -import org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentNodeStoreBuilder; import org.apache.jackrabbit.oak.plugins.document.mongo.MongoDocumentNodeStoreBuilderBase; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBBlobReferenceIterator; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBBlobStore; -import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentNodeStoreBuilder; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBDocumentStore; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBOptions; import org.apache.jackrabbit.oak.plugins.document.rdb.RDBVersionGCSupport; @@ -55,9 +53,7 @@ import org.slf4j.LoggerFactory; /** * A JSON-based wrapper around the NodeStore implementation that stores the * data in a {@link DocumentStore}. It is used for testing purpose only. - * @deprecated Use {@link DocumentNodeStore} instead. */ -@Deprecated public class DocumentMK { static final Logger LOG = LoggerFactory.getLogger(DocumentMK.class); @@ -119,14 +115,6 @@ public class DocumentMK { return nodeStore.getHeadRevision().toString(); } -public String checkpoint(long lifetime) throws DocumentStoreException { -try { -return nodeStore.checkpoint(lifetime); -} catch (DocumentStoreException e) { -throw new DocumentStoreException(e); -} -} - public String diff(String fromRevisionId, String toRevisionId, String path, @@ -477,12 +465,7 @@ public class DocumentMK { /** * A builder for a DocumentMK instance. - * @deprecated Use {@link DocumentNodeStoreBuilder} instead or one of the - * backend implementation specific variants {@link MongoDocumentNodeStoreBuilder} - * or {@link RDBDocumentNodeStoreBuilder}. - * */ -@Deprecated public static class Builder extends MongoDocumentNodeStoreBuilderBase { public static final long DEFAULT_MEMORY_CACHE_SIZE = DocumentNodeStoreBuilder.DEFAULT_MEMORY_CACHE_SIZE; public static final int DEFAULT_NODE_CACHE_PERCENTAGE = DocumentNodeStoreBuilder.DEFAULT_NODE_CACHE_PERCENTAGE;
svn commit: r1820947 - in /jackrabbit/oak/trunk/oak-run/src: main/java/org/apache/jackrabbit/oak/index/indexer/document/ test/java/org/apache/jackrabbit/oak/index/ test/java/org/apache/jackrabbit/oak/
Author: chetanm Date: Fri Jan 12 05:29:56 2018 New Revision: 1820947 URL: http://svn.apache.org/viewvc?rev=1820947&view=rev Log: OAK-7147 - Oak run LuceneIndexer indexes excluded parent nodes Added: jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexerTest.java (with props) Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/index/DocumentStoreIndexerIT.java Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java?rev=1820947&r1=1820946&r2=1820947&view=diff == --- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java (original) +++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java Fri Jan 12 05:29:56 2018 @@ -51,10 +51,12 @@ public class CompositeIndexer implements } @Override -public void index(NodeStateEntry entry) throws IOException, CommitFailedException { +public boolean index(NodeStateEntry entry) throws IOException, CommitFailedException { +boolean result = false; for (NodeStateIndexer indexer : indexers) { -indexer.index(entry); +result |= indexer.index(entry); } +return result; } @Override Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java?rev=1820947&r1=1820946&r2=1820947&view=diff == --- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java (original) +++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java Fri Jan 12 05:29:56 2018 @@ -54,7 +54,7 @@ public class LuceneIndexer implements No @Override public boolean shouldInclude(String path) { -return definition.getPathFilter().filter(path) != PathFilter.Result.EXCLUDE; +return getFilterResult(path) != PathFilter.Result.EXCLUDE; } @Override @@ -64,11 +64,15 @@ public class LuceneIndexer implements No } @Override -public void index(NodeStateEntry entry) throws IOException, CommitFailedException { +public boolean index(NodeStateEntry entry) throws IOException, CommitFailedException { +if (getFilterResult(entry.getPath()) != PathFilter.Result.INCLUDE) { +return false; +} + IndexingRule indexingRule = definition.getApplicableIndexingRule(entry.getNodeState()); if (indexingRule == null) { -return; +return false; } LuceneDocumentMaker maker = newDocumentMaker(indexingRule, entry.getPath()); @@ -76,7 +80,10 @@ public class LuceneIndexer implements No if (doc != null) { writeToIndex(doc, entry.getPath()); progressReporter.indexUpdate(definition.getIndexPath()); +return true; } + +return false; } @Override @@ -94,6 +101,10 @@ public class LuceneIndexer implements No indexWriter.close(System.currentTimeMillis()); } +private PathFilter.Result getFilterResult(String path) { +return definition.getPathFilter().filter(path); +} + private void writeToIndex(Document doc, String path) throws IOException { indexWriter.updateDocument(path, doc); } Modified: jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java?rev=1820947&r1=1820946&r2=1820947&view=diff == --- jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java (original) +++ jackrabbit/oak/trunk/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java Fri Jan 12 05:29:56 2018 @@ -32,7 +32,7 @@ public interf
svn commit: r1820948 - in /jackrabbit/oak/branches/1.8: ./ oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/ oak-run/src/test/java/org/apache/jackrabbit/oak/index/ oak-run/src/te
Author: chetanm Date: Fri Jan 12 05:45:10 2018 New Revision: 1820948 URL: http://svn.apache.org/viewvc?rev=1820948&view=rev Log: OAK-7147 - Oak run LuceneIndexer indexes excluded parent nodes Merge 1820947 Added: jackrabbit/oak/branches/1.8/oak-run/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexerTest.java - copied unchanged from r1820947, jackrabbit/oak/trunk/oak-run/src/test/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexerTest.java Modified: jackrabbit/oak/branches/1.8/ (props changed) jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/NodeStateIndexer.java jackrabbit/oak/branches/1.8/oak-run/src/test/java/org/apache/jackrabbit/oak/index/DocumentStoreIndexerIT.java Propchange: jackrabbit/oak/branches/1.8/ -- --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Jan 12 05:45:10 2018 @@ -1,3 +1,3 @@ /jackrabbit/oak/branches/1.0:1665962 -/jackrabbit/oak/trunk:1820660-1820661,1820861 +/jackrabbit/oak/trunk:1820660-1820661,1820861,1820947 /jackrabbit/trunk:1345480 Modified: jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java?rev=1820948&r1=1820947&r2=1820948&view=diff == --- jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java (original) +++ jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/CompositeIndexer.java Fri Jan 12 05:45:10 2018 @@ -51,10 +51,12 @@ public class CompositeIndexer implements } @Override -public void index(NodeStateEntry entry) throws IOException, CommitFailedException { +public boolean index(NodeStateEntry entry) throws IOException, CommitFailedException { +boolean result = false; for (NodeStateIndexer indexer : indexers) { -indexer.index(entry); +result |= indexer.index(entry); } +return result; } @Override Modified: jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java URL: http://svn.apache.org/viewvc/jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java?rev=1820948&r1=1820947&r2=1820948&view=diff == --- jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java (original) +++ jackrabbit/oak/branches/1.8/oak-run/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/LuceneIndexer.java Fri Jan 12 05:45:10 2018 @@ -54,7 +54,7 @@ public class LuceneIndexer implements No @Override public boolean shouldInclude(String path) { -return definition.getPathFilter().filter(path) != PathFilter.Result.EXCLUDE; +return getFilterResult(path) != PathFilter.Result.EXCLUDE; } @Override @@ -64,11 +64,15 @@ public class LuceneIndexer implements No } @Override -public void index(NodeStateEntry entry) throws IOException, CommitFailedException { +public boolean index(NodeStateEntry entry) throws IOException, CommitFailedException { +if (getFilterResult(entry.getPath()) != PathFilter.Result.INCLUDE) { +return false; +} + IndexingRule indexingRule = definition.getApplicableIndexingRule(entry.getNodeState()); if (indexingRule == null) { -return; +return false; } LuceneDocumentMaker maker = newDocumentMaker(indexingRule, entry.getPath()); @@ -76,7 +80,10 @@ public class LuceneIndexer implements No if (doc != null) { writeToIndex(doc, entry.getPath()); progressReporter.indexUpdate(definition.getIndexPath()); +return true; } + +return false; } @Override @@ -94,6 +101,10 @@ public class LuceneIndexer implements No indexWriter.close(System.currentTimeMillis()); } +private PathFilter.Result getFilterResult(String path) { +return definition.getPathFilter().filter(path); +} + private void writeToIndex(Document doc, String path) throws IOException { indexWriter.updateDocument(path, doc); } Modified: jackrabbit/oak/branc